### Version 1.1.15

- Made robot PC skills panel show/hide via checkbox
- Improve armour encumbrance check for battle dress and powered suits where the armour weight is effectively zero rather than 25% when worn
- Fixed issues with equipment, weapons and armour weight calculations and triggering events
This commit is contained in:
Simon Brooke
2026-06-08 09:48:04 +01:00
parent bc37fd7e59
commit e300e51586
4 changed files with 154 additions and 73 deletions
@@ -875,7 +875,7 @@ input.sheet-rollselect[value="bane"] ~ .sheet-button:not(.sheet-roll_bane) {
.sheet-gear_grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-columns: 0.8fr 0.8fr 0.8fr 1fr 1fr;
}
.sheet-gear_col {
@@ -1995,6 +1995,18 @@ span.sheet-vehiclecomponent {
grid-template-columns: 150px 80px 80px 1fr 1fr 1fr 1fr 1fr;
}
.sheet-pcrobotskills {
display: none;
}
.sheet-robotshowskills {
margin-bottom: 3px !important;
}
span:has(.sheet-robotshowskills:checked) ~ .sheet-pcrobotskills {
display: block;
}
.sheet-laf-skillrow button[type="compendium"] {
width: 18px;
margin-left: auto !important;
@@ -2061,6 +2073,10 @@ span.sheet-vehiclecomponent {
grid-column: 1 / 9;
}
.sheet-gridspan10 {
grid-column: 1 / 10;
}
.sheet-laf-skillrow button:first-child {
margin-top: 2px !important;
}
@@ -2095,6 +2111,10 @@ span.sheet-vehiclecomponent {
text-align: right;
}
.sheet-laf-gearrow input:nth-of-type(3) {
width: 3em !important;
}
.sheet-laf-finance {
width: 300px;
display: grid;
@@ -2203,12 +2223,12 @@ span.sheet-vehiclecomponent {
.sheet-laf-armourlist {
grid-template-columns: 1.5fr 1fr 1.2fr 1.75fr 1.2fr 1fr 1.2fr 0.4fr;
grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr 1.2fr 1fr 0.1fr 1.5fr 0.4fr;
margin-bottom: 3px;
}
.sheet-laf-armourlist-px {
grid-template-columns: 220px 1fr 1.2fr 1.75fr 1.2fr 1fr 1.2fr 0.4fr;
grid-template-columns: 220px 1fr 1.2fr 1.2fr 1.2fr 1fr 0.1fr 1.5fr 0.4fr;
margin-bottom: 3px;
}
@@ -2218,10 +2238,18 @@ span.sheet-vehiclecomponent {
margin-bottom: 3px;
}
.sheet-laf-armourlist input[type="checkbox"] {
outline: none;
}
.sheet-laf-armourlist select {
width: 100%;
}
.sheet-laf-armourlist > div {
width: max-content;
}
/* Do not know why I've had to do this but header spans just do not line up */
.sheet-laf-header-offset span: {
margin-left: 10px;
@@ -18,7 +18,6 @@
<!-- Start of character sheet! -->
<div class="sheet-settings">
<div class="sheet-laf-orangeflash"></div>
<span class="sheet-button sheet-header" data-i18n="settings-u"></span>
<span>&nbsp;</span>
<input type="checkbox" name="attr_ro_default_show" class="sheet-hider sheet-crate" value="1"/>
@@ -2913,11 +2912,26 @@
<div class="sheet-hidden"></div>
<div class="sheet-gear_grid sheet-gear_col sheet-redborder sheet-bold">
<div>
<span data-i18n="totalgearweight-u">Total Gear Weight</span>
<input type="number" class="sheet-hidden" name="attr_weightright" value="0"/>
<span name="attr_totalweight"></span>
<span>Equipment:</span>
<span name="attr_totalequipmentweight"></span>
<span data-i18n="gearweight-u">KG</span>
</div>
<div>
<span>Weapons:</span>
<span name="attr_totalweaponsweight"></span>
<span data-i18n="gearweight-u">KG</span>
</div>
<div>
<span>Armour:</span>
<span name="attr_totalarmourweight"></span>
<span data-i18n="gearweight-u">KG</span>
</div>
<!-- <div>-->
<!-- <span data-i18n="totalgearweight-u">Total Gear Weight</span>-->
<!-- <input type="number" class="sheet-hidden" name="attr_weightright" value="0"/>-->
<!-- <span name="attr_totalweight"></span>-->
<!-- <span data-i18n="gearweight-u">KG</span>-->
<!-- </div>-->
<div>
<span>&nbsp;</span>
<span data-i18n="carrycapacity-u" title="Str+End+Athletics/Item Weight + 25% Armour Weight">Carry Capacity</span>
@@ -2951,7 +2965,7 @@
<span data-i18n="gearquantity-u">Qty</span>
<input type="number" class="sheet-input" name="attr_quantityleft" value="0"/>
<span data-i18n="gearweight-u">KG</span>
<input type="number" class="sheet-input" name="attr_massleft" value="0" step="0.5" min="0"/>
<input type="number" class="sheet-input" name="attr_massleft" value="0" step="0.25" min="0"/>
<input type="hidden" class="sheet-input" name="attr_masstotalleft" value="0"/>
</div>
<textarea class="sheet-input sheet-gearnotes" name="attr_gearnotes-left"></textarea>
@@ -2970,7 +2984,7 @@
<span data-i18n="gearquantity-u">Qty</span>
<input type="number" class="sheet-input" name="attr_quantityright" value="0"/>
<span data-i18n="gearweight-u">KG</span>
<input type="number" class="sheet-input" name="attr_massright" value="0" step="0.5"
<input type="number" class="sheet-input" name="attr_massright" value="0" step="0.25"
min="0"/>
<input type="hidden" class="sheet-input" name="attr_masstotalright" value="0"/>
</div>
@@ -3049,13 +3063,26 @@
<div class="sheet-hidden"></div>
<div class="sheet-gear_grid sheet-gear_col sheet-redborder sheet-bold">
<div>
<span data-i18n="totalgearweight-u">Total Gear Weight</span>
<span>&nbsp;</span>
<input type="number" class="sheet-hidden" name="attr_weightright" value="0"/>
<span name="attr_totalweight"></span>
<span>Equipment:</span>
<span name="attr_totalequipmentweight"></span>
<span data-i18n="gearweight-u">KG</span>
</div>
<div>
<span>Weapons:</span>
<span name="attr_totalweaponsweight"></span>
<span data-i18n="gearweight-u">KG</span>
</div>
<div>
<span>Armour:</span>
<span name="attr_totalarmourweight"></span>
<span data-i18n="gearweight-u">KG</span>
</div>
<!-- <div>-->
<!-- <span data-i18n="totalgearweight-u">Total Gear Weight</span>-->
<!-- <input type="number" class="sheet-hidden" name="attr_weightright" value="0"/>-->
<!-- <span name="attr_totalweight"></span>-->
<!-- <span data-i18n="gearweight-u">KG</span>-->
<!-- </div>-->
<div>
<span>&nbsp;</span>
<span data-i18n="carrycapacity-u" title="Str+End+Athletics/Item Weight + 25% Armour Weight">Carry Capacity</span>
@@ -3075,8 +3102,7 @@
<div class="compendium-drop-target sheet-laf-compendium-drop-target sheet-redbold">
<input class="sheet-laf-compendium-accept-input" name="attr_compendiumArmourData" type="text"
accept="data">
<h3 data-i18n="armour-u">
Armour</h3>
<h3 data-i18n="pcarmour-u">Armour<span>Message</span></h3>
<button type="compendium" value="Rules:CR-EQUIPMENT-02-ARMOUR"></button>
</div>
<div class="sheet-laf-centredgrid sheet-laf-armourlist sheet-bold">
@@ -3086,6 +3112,7 @@
<span data-i18n="armourprotectionlaser-u">Protection (Laser)</span>
<span data-i18n="armourrads-u">Rad</span>
<span data-i18n="armourkgweight-u">KG</span>
<span title="Powered Armour">&#x26A1;&#xfe0e;</span>
<span data-i18n="armourskill-u">Required Skill</span>
<span data-i18n="gearequipped-u">Carried</span>
<div style="display: flex;">
@@ -3098,6 +3125,7 @@
<input type="number" name="attr_armour-protection-laser"/>
<input type="number" name="attr_armour-rads"/>
<input type="number" name="attr_armour-mass" step="0.5" min="0" value="0"/>
<input type="checkbox" name="attr_armour-powered" value="1">
<select type="text" name="attr_armour-RequiredSkill" value="0">
<option value="0" data-i18n="armournoneskill-u">
None
@@ -3122,7 +3150,7 @@
<input type="checkbox" class="sheet-carried" name="attr_armour-carried" value="1" checked>
<span></span>
</div>
<textarea class="sheet-input sheet-gridspan19 sheet-laf-wauto" name="attr_armornotes"></textarea>
<textarea class="sheet-input sheet-gridspan10 sheet-laf-wauto" name="attr_armornotes"></textarea>
</div>
<fieldset class="repeating_armour">
<br>
@@ -3133,6 +3161,7 @@
<input type="number" class="sheet-input" name="attr_reparmour-protection-laser"/>
<input type="number" class="sheet-input" name="attr_reparmour-rads"/>
<input type="number" class="sheet-input" name="attr_reparmour-mass" step="0.5" min="0" value="0"/>
<input type="checkbox" name="attr_reparmour-powered" value="1">
<select type="text" class="sheet-input" name="attr_reparmour-RequiredSkill" value="0">
<option value="0" data-i18n="armournoneskill-u">
None
@@ -3157,7 +3186,7 @@
<input type="checkbox" class="sheet-carried" name="attr_reparmour-carried" value="1" checked>
<span></span>
</div>
<textarea class="sheet-input sheet-gridspan19 sheet-laf-wauto" name="attr_reparmornotes"></textarea>
<textarea class="sheet-input sheet-gridspan10 sheet-laf-wauto" name="attr_reparmornotes"></textarea>
</div>
</fieldset>
</div>
@@ -7685,6 +7714,7 @@
<span data-i18n="armourprotectionlaser-u">Protection (Laser)</span>
<span data-i18n="armourrads-u">Rad</span>
<span data-i18n="armourkgweight-u">KG</span>
<span></span>
<span data-i18n="armourskill-u">Required Skill</span>
<span></span>
<div style="display: flex;">
@@ -7697,6 +7727,7 @@
<input type="number" name="attr_armour-protection-laser"/>
<input type="number" name="attr_armour-rads"/>
<input type="number" name="attr_armour-mass" step="0.5" min="0" value="0"/>
<span></span>
<select type="text" name="attr_armour-RequiredSkill" value="0">
<option value="0" data-i18n="armournoneskill-u">
None
@@ -7717,7 +7748,7 @@
Vacc Suit 4
</option>
</select>
<textarea class="sheet-input sheet-gridspan19 sheet-laf-wauto" name="attr_armornotes"></textarea>
<textarea class="sheet-input sheet-gridspan10 sheet-laf-wauto" name="attr_armornotes"></textarea>
</div>
<fieldset class="repeating_armour">
<br>
@@ -7728,6 +7759,7 @@
<input type="number" class="sheet-input" name="attr_reparmour-protection-laser"/>
<input type="number" class="sheet-input" name="attr_reparmour-rads"/>
<input type="number" class="sheet-input" name="attr_reparmour-mass" step="0.5" min="0" value="0"/>
<span></span>
<select type="text" class="sheet-input" name="attr_reparmour-RequiredSkill" value="0">
<option value="0" data-i18n="armournoneskill-u">
None
@@ -7748,7 +7780,7 @@
Vacc Suit 4
</option>
</select>
<textarea class="sheet-input sheet-gridspan19 sheet-laf-wauto" name="attr_reparmornotes"></textarea>
<textarea class="sheet-input sheet-gridspan10 sheet-laf-wauto" name="attr_reparmornotes"></textarea>
</div>
</fieldset>
</div>
@@ -7917,7 +7949,7 @@
<span data-i18n="gearquantity-u">Qty</span>
<input type="number" class="sheet-input" name="attr_quantityleft" value="0"/>
<span data-i18n="gearweight-u">KG</span>
<input type="number" class="sheet-input" name="attr_massleft" value="0" step="0.5" min="0"/>
<input type="number" class="sheet-input" name="attr_massleft" value="0" step="0.25" min="0"/>
<input type="hidden" class="sheet-input" name="attr_masstotalleft" value="0"/>
</div>
<textarea class="sheet-input sheet-gearnotes" name="attr_gearnotes-left"></textarea>
@@ -7936,7 +7968,7 @@
<span data-i18n="gearquantity-u">Qty</span>
<input type="number" class="sheet-input" name="attr_quantityright" value="0"/>
<span data-i18n="gearweight-u">KG</span>
<input type="number" class="sheet-input" name="attr_massright" value="0" step="0.5"
<input type="number" class="sheet-input" name="attr_massright" value="0" step="0.25"
min="0"/>
<input type="hidden" class="sheet-input" name="attr_masstotalright" value="0"/>
</div>
@@ -8045,8 +8077,7 @@
<span class="sheet-errortext" name="attr_compendium_error_Robots"></span>
<div class="compendium-drop-target sheet-laf-compendium-drop-target sheet-redbold">
<input class="sheet-laf-compendium-accept-input" name="attr_compendiumRobotData" type="text" accept="data">
<h3 data-i18n="robot-u">
Robot</h3>
<h3 data-i18n="robot-u">Robot</h3>
</div>
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-robot">
@@ -8117,7 +8148,11 @@
</fieldset>
</div>
<br>
<div class="sheet-redborder">
<!-- Standard PC/NPC skills block for Player Robots -->
<span>Show Player Skills Panel For PC Robots&nbsp;&nbsp;<input class="sheet-robotshowskills"
name="attr_robotshowskills" type="checkbox"></span>
<br>
<div class="sheet-redborder sheet-pcrobotskills">
<span class="">
<input type="checkbox" name="attr_Skill" class="sheet-power sheet-groupfunds" value="1"/>
<span></span>
@@ -11190,20 +11225,20 @@
</h5>
<br>
<span class="sheet-redbold-noborder" name="attr_shipweapon_error"></span>
<!-- <div class="sheet-laf-centredgrid sheet-laf-ship-hardpoint sheet-laf-ship-hardpoint-abs">-->
<!-- <span data-i18n="hardpoint-u">Hardpoint</span>-->
<!-- <span data-i18n="type-u">Type</span>-->
<!-- <span data-i18n="shiptl-u">TL</span>-->
<!-- <span data-i18n="skilltablepower-u">Power</span>-->
<!-- <span data-i18n="weaponrange-u">Range</span>-->
<!-- <span data-i18n="shipammunition-u">Ammo</span>-->
<!-- <span data-i18n="damage-u">Damage</span>-->
<!-- <span data-i18n="traits-u">Traits</span>-->
<!-- <span data-i18n="skilltabledicemodifier-u">DM</span>-->
<!-- <span>#</span>-->
<!-- <span></span>-->
<!-- <span></span>-->
<!-- </div>-->
<!-- <div class="sheet-laf-centredgrid sheet-laf-ship-hardpoint sheet-laf-ship-hardpoint-abs">-->
<!-- <span data-i18n="hardpoint-u">Hardpoint</span>-->
<!-- <span data-i18n="type-u">Type</span>-->
<!-- <span data-i18n="shiptl-u">TL</span>-->
<!-- <span data-i18n="skilltablepower-u">Power</span>-->
<!-- <span data-i18n="weaponrange-u">Range</span>-->
<!-- <span data-i18n="shipammunition-u">Ammo</span>-->
<!-- <span data-i18n="damage-u">Damage</span>-->
<!-- <span data-i18n="traits-u">Traits</span>-->
<!-- <span data-i18n="skilltabledicemodifier-u">DM</span>-->
<!-- <span>#</span>-->
<!-- <span></span>-->
<!-- <span></span>-->
<!-- </div>-->
<fieldset class="repeating_shipweapon">
<div class="sheet-laf-centredgrid sheet-laf-ship-hardpoint">
<span data-i18n="hardpoint-u">Hardpoint</span>
@@ -11384,7 +11419,7 @@
<span data-i18n="gearquantity-u">Qty</span>
<input type="number" class="sheet-input" name="attr_quantityleft" value="0"/>
<span data-i18n="gearweight-u">KG</span>
<input type="number" class="sheet-input" name="attr_massleft" value="0" step="0.5"
<input type="number" class="sheet-input" name="attr_massleft" value="0" step="0.25"
min="0"/>
<input type="hidden" class="sheet-input" name="attr_masstotalleft" value="0"/>
</div>
@@ -11405,7 +11440,7 @@
<span data-i18n="gearquantity-u">Qty</span>
<input type="number" class="sheet-input" name="attr_quantityright" value="0"/>
<span data-i18n="gearweight-u">KG</span>
<input type="number" class="sheet-input" name="attr_massright" value="0" step="0.5"
<input type="number" class="sheet-input" name="attr_massright" value="0" step="0.25"
min="0"/>
<input type="hidden" class="sheet-input" name="attr_masstotalright" value="0"/>
</div>
@@ -11495,6 +11530,7 @@
<span data-i18n="armourprotectionlaser-u">Protection (Laser)</span>
<span data-i18n="armourrads-u">Rad</span>
<span data-i18n="armourkgweight-u">KG</span>
<span></span>
<span data-i18n="armourskill-u">Required Skill</span>
<span></span>
</div>
@@ -11507,6 +11543,7 @@
<input type="number" class="sheet-input" name="attr_reparmour-rads"/>
<input type="number" class="sheet-input" name="attr_reparmour-mass" step="0.5" min="0"
value="0"/>
<span></span>
<select type="text" class="sheet-input" name="attr_reparmour-RequiredSkill" value="0">
<option value="0" data-i18n="armournoneskill-u">
None
@@ -11527,7 +11564,7 @@
Vacc Suit 4
</option>
</select>
<textarea class="sheet-input sheet-gridspan19 sheet-laf-wauto"
<textarea class="sheet-input sheet-gridspan10 sheet-laf-wauto"
name="attr_reparmornotes"></textarea>
</div>
</fieldset>
@@ -13022,7 +13059,7 @@
</div>
</div>
<div class="sheet-tab-content sheet-help">
<h3>Character Sheet Version 1.1.14</h3>
<h3>Character Sheet Version 1.1.15</h3>
<br>
<h4>Assigning Attributes To Tokens</h4>
<p style="margin-left: 10px; margin-top: 5px;">To represent the core character attributes on a token so they can be
@@ -14058,17 +14095,10 @@
});
// Total Weight
on("change:weightright change:weightleft change:fixedcombatweight change:repeatingarmourweight change:repeatingweaponweight change:current-Strength change:current-Endurance change:skilllevel-Athletics change:armour-mass sheet:opened", function() {
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) {
//console.log("current-Strength: " + values["current-Strength"]);
//console.log("current-Endurance: " + values["current-Endurance"]);
//console.log("skilllevel-Athletics: " + values["skilllevel-Athletics"]);
//console.log("values.repeatingarmourweight: " + values.repeatingarmourweight);
// <span data-i18n="gearequipped-u">Carried</span>
// <input type="checkbox" class="sheet-carried" name="attr_equippedleft" value="1">
// 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"]);
@@ -14083,12 +14113,8 @@
// Calculate encumberance, Armour is only 25% of its weight for encumberance purposes, knock it off and re-calc
const totalArmourWeight = parseFloat(values.repeatingarmourweight) + armourMass;
//console.log("tw: " + tw);
//console.log("totalArmourWeight: " + totalArmourWeight);
let totalEncumberanceWeight = (tw - totalArmourWeight) + (totalArmourWeight * 0.25);
//console.log("tew: " + totalEncumberanceWeight);
totalEncumberanceWeight = Math.round(totalEncumberanceWeight * 10) / 10;
//console.log("tew: " + totalEncumberanceWeight);
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
@@ -14101,7 +14127,8 @@
totalweight: tw.toFixed(1),
totalitemweight: tiw,
encumbered: encumbered,
carrycapacity: "" + carryCapacity + "/" + totalEncumberanceWeight
carrycapacity: "" + totalEncumberanceWeight + "/" + carryCapacity,
totalequipmentweight: tiw.toFixed(2)
});
});
});
@@ -14109,6 +14136,11 @@
// Left equipment weight
on("change:repeating_othergear:massleft change:repeating_othergear:quantityleft change:repeating_othergear:equippedleft xxxsheet:opened", function() {
getAttrs(["repeating_othergear_massleft", "repeating_othergear_quantityleft", "repeating_othergear_equippedleft"], function(values) {
if(isNaN(values.repeating_othergear_massleft)) {
values.repeating_othergear_massleft = 0;
}
const mass = (parseFloat(values.repeating_othergear_massleft).toFixed(2)) * (parseInt(values.repeating_othergear_quantityleft) * parseInt(values.repeating_othergear_equippedleft));
console.log("othergear-left: " + mass);
setAttrs({
@@ -14120,7 +14152,11 @@
// Right equipment weight
on("change:repeating_othergear:massright change:repeating_othergear:quantityright change:repeating_othergear:equippedright xxxsheet:opened", function() {
getAttrs(["repeating_othergear_massright", "repeating_othergear_quantityright", "repeating_othergear_equippedright"], function(values) {
console.log("change:repeating_othergear:massright");
if(isNaN(values.repeating_othergear_massright)) {
values.repeating_othergear_massright = 0;
}
const mass = (parseFloat(values.repeating_othergear_massright).toFixed(2)) * (parseInt(values.repeating_othergear_quantityright) * parseInt(values.repeating_othergear_equippedright));
console.log("othergear-right: " + mass);
setAttrs({
@@ -14130,33 +14166,38 @@
});
// Fixed combat weight
on("change:armour-mass change:armour-carried change:weapon_weight-1 change:weapon_weight-2 change:weapon_weight-3 change:weapon_weight-4 change:weapon_weight-5 change:weapon_weight-6 change:weapon_carried-1 change:weapon_carried-2 change:weapon_carried-3 change:weapon_carried-4 change:weapon_carried-5 change:weapon_carried-6 sheet:opened", function() {
on("change:armour-mass change:repeatingarmourweight change:armour-carried change:armour-powered change:weapon_weight-1 change:weapon_weight-2 change:weapon_weight-3 change:weapon_weight-4 change:weapon_weight-5 change:weapon_weight-6 change:weapon_carried-1 change:weapon_carried-2 change:weapon_carried-3 change:weapon_carried-4 change:weapon_carried-5 change:weapon_carried-6 sheet:opened", function() {
const attrs = ["armour-mass", "armour-carried",
const attrs = ["armour-mass", "armour-carried", "armour-powered", "repeatingarmourweight",
"weapon_weight-1", "weapon_weight-2", "weapon_weight-3", "weapon_weight-4", "weapon_weight-5", "weapon_weight-6",
"weapon_carried-1", "weapon_carried-2", "weapon_carried-3", "weapon_carried-4", "weapon_carried-5", "weapon_carried-6"];
getAttrs(attrs, function(values) {
//let fcw = Object.values(values).reduce((a, b) => parseFloat(a) + parseFloat(b), 0);
// More complicated now we have carried stuff, carried attrs are either 1 or 0
let fcw = parseFloat(values["armour-mass"]) * parseInt(values["armour-carried"]);
// Also need to account for powered armour which does not contribute to encumberance, otherwise is
// 25% of weight
let armourModifier = values["armour-powered"] === "1" ? 0 : 0.25;
let fcw = parseFloat(values["armour-mass"]) * parseInt(values["armour-carried"]) * armourModifier;
let taw = fcw + parseFloat(values["repeatingarmourweight"]);
let tww = 0;
for (let i=1; i<=6; i++) {
fcw += parseFloat(values["weapon_weight-" + i]) * parseInt(values["weapon_carried-" + i]);
tww += parseFloat(values["weapon_weight-" + i]) * parseInt(values["weapon_carried-" + i]);
}
fcw += tww;
console.log("armour-weapon-mass change: " + fcw + " : " + JSON.stringify(values));
setAttrs({
fixedcombatweight: fcw
fixedcombatweight: fcw,
totalweaponsweight: tww.toFixed(2),
totalarmourweight: taw.toFixed(2)
});
console.log("leaving armour-weapon-mass change: " + fcw + " : " + JSON.stringify(values));
});
});
// Repeating armour weight
on('change:repeating_armour remove:repeating_armour', function(){
console.log("reparmour-mass change");
// Made more complex by carrying
//TAS.repeatingSimpleSum('armour','reparmour-mass','repeatingarmourweight');
let attrs = [];
getSectionIDs("repeating_armour", function (idarr) {
let total = 0;
@@ -14165,12 +14206,18 @@
for (var i=0; i<idarr.length; i++) {
attrs.push("repeating_armour_" + idarr[i] + "_reparmour-mass");
attrs.push("repeating_armour_" + idarr[i] + "_reparmour-carried");
attrs.push("repeating_armour_" + idarr[i] + "_reparmour-powered");
}
getAttrs(attrs, function (values) {
for (var i=0; i<idarr.length; i++) {
// Also need to account for powered armour which does not contribute to encumberance, otherwise is
// 25% of weight
let armourModifier = values["repeating_armour_" + idarr[i] + "_reparmour-powered"] === "1" ? 0 : 0.25;
total += parseFloat(values["repeating_armour_" + idarr[i] + "_reparmour-mass"]) *
parseFloat(values["repeating_armour_" + idarr[i] + "_reparmour-carried"]);
parseFloat(values["repeating_armour_" + idarr[i] + "_reparmour-carried"]) *
armourModifier;
}
setAttrs({
@@ -14203,7 +14250,7 @@
}
setAttrs({
repeatingarmourweight: total
repeatingweaponweight: total
});
});
});
@@ -19695,6 +19742,7 @@
attrs.robot_options = compendiumData["Options"];
attrs.robot_locomotion = compendiumData["Locomotion"];
attrs.robot_tl = compendiumData["TL"];
attrs.robot_cost = compendiumData["Cost"];
console.log("- Processing robot skills: " + compendiumData["Skills"]);
+6 -2
View File
@@ -144,8 +144,12 @@ This is the Official Mongoose Traveller 2nd Edition Character Sheet
- Fixed weapon headers and fields width on resize on Ship Combat tab
- Changed DEX Mod label on Ship Combat Pilot tab to 'Charac. Mod'
- Added Characteristic Mod to initiative roll
- Changed Ship Combat Initiative button text to specify 'Available Thrust'
- Fixed Animal drag and drop parsing
### Version 1.1.15
- Made robot PC skills panel show/hide via checkbox
- Improve armour encumbrance check for battle dress and powered suits where the armour weight is effectively zero rather than 25% when worn
- Fixed issues with equipment, weapons and armour weight calculations and triggering events
-
![Image](Official%20Mongoose%20Publishing%20Traveller%202nd%20Edition.png)
@@ -86,6 +86,7 @@
"gearweight-u": "KG",
"gearequipped-u": "Carried",
"armour-u": "Armour",
"pcarmour-u": "Armour <span style=\"font-size: 16px; margin-left: 10px;\">(&#x26A1;&#xfe0e; signifies powered armour which has a worn mass of zero)</span>",
"financestitle-u": "Finances",
"pension-u": "Pension",
"monthlysalary-u": "Monthly Salary",
@@ -101,7 +102,7 @@
"armourtype-u": "Type",
"armourtechlevel-u": "TL",
"armourprotection-u": "Protection",
"armourprotectionlaser-u": "Protection (Laser)",
"armourprotectionlaser-u": "Prot. (Laser)",
"armourrads-u": "Rad",
"armourkgweight-u": "KG",
"armourskill-u": "Required Skill",