diff --git a/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html b/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html index 463e3fb8a9..6fa760de3e 100644 --- a/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html +++ b/Mongoose Traveller 2e Official/Official Mongoose Publishing Traveller 2nd Edition.html @@ -13059,7 +13059,7 @@
To represent the core character attributes on a token so they can be
@@ -14094,41 +14094,84 @@
});
});
+
+
+
// Total Weight
- on("change:weightright change:weightleft change:fixedcombatweight change:repeatingarmourweight change:repeatingweaponweight change:current-Strength change:current-Endurance change:injury-Strength change:injury-Endurance change:skilllevel-Athletics change:armour-mass sheet:opened", function() {
- getAttrs(["weightright", "weightleft", "fixedcombatweight", "repeatingarmourweight", "repeatingweaponweight",
- "current-Strength", "current-Endurance", "skilllevel-Athletics", "armour-mass", "armour-carried"], function(values) {
+ on("change:weightright change:weightleft change:fixedcombatweight change:repeatingarmourweight change:repeatingweaponweight change:current-Strength change:current-Endurance change:injury-Strength change:injury-Endurance change:repeating_athleticsspec change:armour-mass sheet:opened", function(event) {
+ // In order to calculate encumberance we need to know STR and END which is easy, but also need to know
+ // the Athletics 'sub-skills' and check for strength or endurance specialities
+ let attrs = [
+ "weightright", "weightleft",
+ "fixedcombatweight",
+ "repeatingarmourweight", "repeatingweaponweight",
+ "current-Strength", "current-Endurance",
+ "skilllevel-Athletics", "skillCharacteristicDM-Athletics", "skillmodifier-Athletics",
+ "armour-mass", "armour-carried"
+ ];
- // Grab our attrs to check weight against, then remove from values so we can tot up equipment weight
- const carryCapacity = parseInt(values["current-Strength"]) + parseInt(values["current-Endurance"]) + parseInt(values["skilllevel-Athletics"]);
- const armourMass = parseFloat(values["armour-mass"]) * parseFloat(values["armour-carried"]);
- delete values["current-Strength"];
- delete values["current-Endurance"];
- delete values["skilllevel-Athletics"];
- delete values["armour-mass"];
- delete values["armour-carried"];
-
- const tw = Object.values(values).reduce((a, b) => parseFloat(a) + parseFloat(b), 0);
- const tiw = parseFloat(values.weightleft) + parseFloat(values.weightright)
-
- // Calculate encumberance, Armour is only 25% of its weight for encumberance purposes, knock it off and re-calc
- const totalArmourWeight = parseFloat(values.repeatingarmourweight) + armourMass;
- let totalEncumberanceWeight = tw; // (tw - totalArmourWeight) + (totalArmourWeight * 0.25);
- totalEncumberanceWeight = totalEncumberanceWeight.toFixed(2); //Math.round(totalEncumberanceWeight * 10) / 10;
- let encumbered = totalEncumberanceWeight > carryCapacity ? "Yes" : "No";
-
- // If the total gear weight is TWICE our capacity, then signal the DM-2 on physical actions
- if(totalEncumberanceWeight > carryCapacity * 2) {
- encumbered = "Yes (DM-2)";
+ // Get our specialities and their modifier to re-create the inline formula
+ getSectionIDs("repeating_athleticsspec", function (idarr) {
+ for (let i=0; i