From 9394e0e851148df51c63875eec4279391e07f6f6 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 28 Sep 2022 20:21:04 +0200 Subject: [PATCH] Fix #73 : Power damage type --- modules/pegasus-actor.js | 4 ++-- template.json | 1 + templates/chat-generic-result.html | 4 ++++ templates/item-power-sheet.html | 20 ++++++++++++-------- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index 5f43694..ba321f4 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -1758,7 +1758,7 @@ export class PegasusActor extends Actor { processSizeBonus( rollData) { if ( rollData.defenderTokenId) { let diffSize = rollData.defenderSize - this.system.biodata.sizenum+this.system.biodata.sizebonus - console.log("Diffsize", diffSize) + //console.log("Diffsize", diffSize) if( rollData.subKey == "melee-atk" || rollData.subKey == "ranged-atk") { if ( diffSize > 0) { rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: diffSize }) @@ -1774,7 +1774,7 @@ export class PegasusActor extends Actor { rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) }) } } - if( rollData.subKey == "melee-dmg" || rollData.subKey == "ranged-dmg") { + if( rollData.subKey == "melee-dmg" || rollData.subKey == "ranged-dmg" || rollData.subKey == "power-dmg") { if ( diffSize < 0) { rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) }) } diff --git a/template.json b/template.json index 650fdae..5c0437f 100644 --- a/template.json +++ b/template.json @@ -566,6 +566,7 @@ "activatedtext": "", "deactivatedtext": "", "powerlevelcost": "", + "powerdamagetype": "", "dmgroll": false, "dmgstatistic": "", "description": "" diff --git a/templates/chat-generic-result.html b/templates/chat-generic-result.html index 5e78337..d39519a 100644 --- a/templates/chat-generic-result.html +++ b/templates/chat-generic-result.html @@ -45,6 +45,10 @@ {{/if}} {{/if}} + {{#if power}} +
  • Power Damage type : {{power.system.powerdamagetype}}
  • + {{/if}} + {{#if isResistance}}
  • Defense Result : {{finalScore}} {{else}} diff --git a/templates/item-power-sheet.html b/templates/item-power-sheet.html index 89a41b1..75178a8 100644 --- a/templates/item-power-sheet.html +++ b/templates/item-power-sheet.html @@ -104,14 +104,18 @@ data.dmgroll}} />
  • {{#if data.dmgroll}} -
  • - -
  • +
  • + +
  • +
  • + +
  • {{/if}}