Fix #92 armors

This commit is contained in:
sladecraven 2022-10-05 09:16:22 +02:00
parent a763efe873
commit 076945c76f
2 changed files with 5 additions and 5 deletions

View File

@ -249,13 +249,13 @@ export class PegasusActorSheet extends ActorSheet {
this.actor.rollPool( 'def', true, "defence"); this.actor.rollPool( 'def', true, "defence");
}); });
html.find('.damage-melee').click((event) => { 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) => { html.find('.damage-ranged').click((event) => {
this.actor.rollPool( 'per', false, "ranged-dmg"); this.actor.rollPool( 'per', false, "ranged-dmg");
}); });
html.find('.damage-resistance').click((event) => { 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) => { html.find('.roll-stat').click((event) => {

View File

@ -1745,8 +1745,8 @@ export class PegasusActor extends Actor {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
addArmorsShields(rollData, statKey = "none", useShield = false) { addArmorsShields(rollData, statKey = "none", useShield = false, subKey = undefined) {
if (statKey == 'phy') { if (statKey == 'phy' && subKey == "dmg-res") {
let armors = this.getArmors() let armors = this.getArmors()
for (let armor of armors) { for (let armor of armors) {
rollData.armorsList.push({ label: `Armor ${armor.name}`, type: "armor", applied: false, value: armor.system.resistance }) 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.processSizeBonus(rollData)
this.addEffects(rollData, isInit, isPower, subKey == "power-dmg") 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.addWeapons(rollData, statKey, useShield)
this.addEquipments(rollData, statKey) this.addEquipments(rollData, statKey)
console.log("ROLLDATA", rollData) console.log("ROLLDATA", rollData)