From a763efe8730d584e4a99592fcb360c6c0e6c1bb5 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 5 Oct 2022 09:13:17 +0200 Subject: [PATCH] Fix #62 armors --- modules/pegasus-utility.js | 9 +++---- templates/item-effect-sheet.html | 41 ++++++++++++++++---------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 02f1ba1..af531ec 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -175,12 +175,13 @@ export class PegasusUtility { newDicePool = newDicePool.concat(this.buildDicePool("armor-shield", armor.value, 0)) } } - newDicePool = rollData.dicePool.filter(dice => dice.name != "vehicle-shield") + newDicePool = newDicePool.filter(dice => dice.name != "vehicle-shield") for (let shield of rollData.vehicleShieldList) { if (shield.applied) { newDicePool = newDicePool.concat(this.buildDicePool("vehicle-shield", shield.value, 0)) } } + console.log(">>>>Dicepoool", newDicePool) rollData.dicePool = newDicePool } @@ -1117,7 +1118,7 @@ export class PegasusUtility { static async processTactician() { // Tactician management let toApply = {} - let tacticianTokens = canvas.tokens.placeables.filter(token => token.actor.isTactician() && !newToken.document.hidden) + let tacticianTokens = canvas.tokens.placeables.filter(token => token.actor.isTactician() && !token.document.hidden) for (let token of tacticianTokens) { token.refresh() let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition) @@ -1165,7 +1166,7 @@ export class PegasusUtility { static async processEnhancer() { // Enhancer management let toApply = {} - let enhancerTokens = canvas.tokens.placeables.filter(token => token.actor.isEnhancer() && !newToken.document.hidden) + let enhancerTokens = canvas.tokens.placeables.filter(token => token.actor.isEnhancer() && !token.document.hidden) for (let token of enhancerTokens) { token.refresh() let friends = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == token.document.disposition) @@ -1215,7 +1216,7 @@ export class PegasusUtility { static async processAgitator() { // Agitator management let toApply = {} - let agitatorTokens = canvas.tokens.placeables.filter(token => token.actor.isAgitator()) + let agitatorTokens = canvas.tokens.placeables.filter(token => token.actor.isAgitator() && !token.document.hidden) for (let token of agitatorTokens) { token.refresh() if (token.document.disposition == 0) { diff --git a/templates/item-effect-sheet.html b/templates/item-effect-sheet.html index e923e66..4d2042a 100644 --- a/templates/item-effect-sheet.html +++ b/templates/item-effect-sheet.html @@ -34,6 +34,27 @@ +
  • + +
  • + {{#if data.effectstatlevel}} +
  • + +
  • + {{else}} +
  • + +
  • +
  • + +
  • + {{/if}} + +
  • @@ -65,26 +86,6 @@ -
  • - -
  • - {{#if data.effectstatlevel}} -
  • - -
  • - {{else}} -
  • - -
  • -
  • - -
  • - {{/if}} -