From 076945c76f3602136f97bfc9e10588f5ac8f1386 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 5 Oct 2022 09:16:22 +0200 Subject: [PATCH] Fix #92 armors --- modules/pegasus-actor-sheet.js | 4 ++-- modules/pegasus-actor.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/pegasus-actor-sheet.js b/modules/pegasus-actor-sheet.js index 125ad93..df83b68 100644 --- a/modules/pegasus-actor-sheet.js +++ b/modules/pegasus-actor-sheet.js @@ -249,13 +249,13 @@ export class PegasusActorSheet extends ActorSheet { this.actor.rollPool( 'def', true, "defence"); }); html.find('.damage-melee').click((event) => { - this.actor.rollPool( 'str', false, "melee-dmg"); + this.actor.rollPool( 'str', false, "melee-dmg") }); html.find('.damage-ranged').click((event) => { this.actor.rollPool( 'per', false, "ranged-dmg"); }); html.find('.damage-resistance').click((event) => { - this.actor.rollPool( 'phy', false, "dmg-res"); + this.actor.rollPool( 'phy', false, "dmg-res") }); html.find('.roll-stat').click((event) => { diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 357a4e8..4442988 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -1745,8 +1745,8 @@ export class PegasusActor extends Actor { } /* -------------------------------------------- */ - addArmorsShields(rollData, statKey = "none", useShield = false) { - if (statKey == 'phy') { + addArmorsShields(rollData, statKey = "none", useShield = false, subKey = undefined) { + if (statKey == 'phy' && subKey == "dmg-res") { let armors = this.getArmors() for (let armor of armors) { rollData.armorsList.push({ label: `Armor ${armor.name}`, type: "armor", applied: false, value: armor.system.resistance }) @@ -1870,7 +1870,7 @@ export class PegasusActor extends Actor { this.processSizeBonus(rollData) this.addEffects(rollData, isInit, isPower, subKey == "power-dmg") - this.addArmorsShields(rollData, statKey, useShield) + this.addArmorsShields(rollData, statKey, useShield, subKey) this.addWeapons(rollData, statKey, useShield) this.addEquipments(rollData, statKey) console.log("ROLLDATA", rollData)