From d67df22b4d6200bcaa6389d0967c7ae040644bdb Mon Sep 17 00:00:00 2001 From: NilsUeter Date: Tue, 18 Apr 2023 21:12:24 +0200 Subject: [PATCH] calculate -1 to hit directly in ws --- src/Weapons.jsx | 13 ++++++++++++- src/roster40k.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Weapons.jsx b/src/Weapons.jsx index f6577e4..50f6938 100644 --- a/src/Weapons.jsx +++ b/src/Weapons.jsx @@ -57,7 +57,7 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { type = type.substring(0, lastWhiteSpace); const bs = modelStats[0].bs; - const ws = modelStats[0].ws; + let ws = modelStats[0].ws; const strModel = modelStats[0].str; const meleeAttacks = modelStats[0].attacks; @@ -83,6 +83,17 @@ const Weapon = ({ weapon, modelStats, isMelee, className }) => { abilities = abilities.replaceAll("Blast", ""); type += ", Blast"; } + if ( + abilities?.includes( + "Each time an attack is made with this weapon, subtract 1 from that attack’s hit roll." + ) + ) { + abilities = abilities.replaceAll( + "Each time an attack is made with this weapon, subtract 1 from that attack’s hit roll.", + "" + ); + ws = `${parseInt(ws, 10) + 1}+`; + } return ( <> diff --git a/src/roster40k.js b/src/roster40k.js index e365cb6..066d9f2 100644 --- a/src/roster40k.js +++ b/src/roster40k.js @@ -158,7 +158,7 @@ export class Model extends BaseNotes { } nameAndGear() { - let name = super.name; + let name = this.name; if (this.weapons.length > 0 || this.upgrades.length > 0) { const gear = this.getDedupedWeaponsAndUpgrades();