diff --git a/module/item/item.mjs b/module/item/item.mjs index bd5ef213..3f32d2dd 100644 --- a/module/item/item.mjs +++ b/module/item/item.mjs @@ -3751,7 +3751,7 @@ export class HeroSystem6eItem extends Item { } // Disadvantages sorted low to high - for (let modifier of modifiers) { + for (const modifier of modifiers) { system.description += this.createPowerDescriptionModifier(modifier); } @@ -3822,8 +3822,9 @@ export class HeroSystem6eItem extends Item { { // 1 Recoverable Continuing Charge lasting 1 Minute result += ", "; + const maxCharges = parseInt(modifier.OPTION_ALIAS); - if (maxCharges != parseInt(this.system.charges.max)) { + if (maxCharges !== parseInt(system.charges.max)) { console.error("CHARGES mismatch", item); } const currentCharges = parseInt(this.system.charges.value); @@ -3832,18 +3833,34 @@ export class HeroSystem6eItem extends Item { } result += modifier.OPTION_ALIAS; - let recoverable = (modifier.ADDER || []).find((o) => o.XMLID == "RECOVERABLE"); + const recoverable = (modifier.ADDER || []).find((o) => o.XMLID === "RECOVERABLE"); if (recoverable) { - result += " " + recoverable.ALIAS; + result += ` ${recoverable.ALIAS}`; + } + + const boostable = (modifier.ADDER || []).find((o) => o.XMLID === "BOOSTABLE"); + if (boostable) { + result += ` ${boostable.ALIAS}`; } - let continuing = (modifier.ADDER || []).find((o) => o.XMLID == "CONTINUING"); + const continuing = (modifier.ADDER || []).find((o) => o.XMLID === "CONTINUING"); if (continuing) { - result += " " + continuing.ALIAS; + result += ` ${continuing.ALIAS}`; + } + + const fuel = (modifier.ADDER || []).find((o) => o.XMLID === "FUEL"); + if (fuel) { + result += ` ${fuel.ALIAS}`; } result += maxCharges > 1 ? " Charges" : " Charge"; + const totalClips = this.system.charges.clipsMax; + if (totalClips > 1) { + const currentClips = this.system.charges.clips; + result += ` (${currentClips}/${totalClips} clips)`; + } + if (continuing) { result += " lasting " + continuing.OPTION_ALIAS; } diff --git a/module/ruler.mjs b/module/ruler.mjs index 3b39a520..2a100acd 100644 --- a/module/ruler.mjs +++ b/module/ruler.mjs @@ -49,7 +49,7 @@ export class HeroRuler extends Ruler { const activeMovement = movementItems.length === 0 ? "none" - : movementItems.find((o) => o._id == relevantToken.actor.flags.activeMovement)?._id || + : movementItems.find((o) => o._id === relevantToken.actor.flags.activeMovement)?._id || movementItems[0]._id; const radioOptions = movementItems @@ -201,7 +201,7 @@ export class HeroRuler extends Ruler { if ( automation === "all" || - (automation === "npcOnly" && actor.type == "npc") || + (automation === "npcOnly" && actor.type === "npc") || (automation === "pcEndOnly" && actor.type === "pc") ) { // Only consume endurance on token's phase, allowing for Knockback movement (which does not consume END) @@ -318,10 +318,10 @@ export class HeroRuler extends Ruler { return; } - // Kluge to update actor right away so the render has proper data. + // Kludge to update actor right away so the render has proper data. // There is likely a better way to deal with this, possibly in the refreshToken hook. if (args?.flags?.activeMovement) { - actor.flags.activeMovement = args?.flags?.activeMovement; + actor.flags.activeMovement = args.flags.activeMovement; } that._movementRadioSelectRender(); @@ -346,15 +346,6 @@ export class HeroRuler extends Ruler { * @returns {string} * @protected */ - - /** V11 - * Get the text label for a segment of the measured path - * @param {RulerMeasurementSegment} segment - * @param {number} totalDistance - * @returns {string} - * @protected - */ - _getSegmentLabel(_segment, _totalDistance) { // second argument only provided in v11 // however total distance is avail in v12 @@ -376,7 +367,7 @@ export class HeroRuler extends Ruler { const activeMovement = movementItems.length === 0 ? "none" - : movementItems.find((o) => o._id == actor.flags.activeMovement)?._id || movementItems[0]._id; + : movementItems.find((o) => o._id === actor.flags.activeMovement)?._id || movementItems[0]._id; const activeMovementLabel = activeMovement === "none" ? "Running" : movementItems.find((e) => e._id === activeMovement)?.name;