From 39d220cfe6a4185d40807376c7e44c426871754c Mon Sep 17 00:00:00 2001 From: sladecraven Date: Fri, 2 Sep 2022 20:34:37 +0200 Subject: [PATCH] Fix effects --- modules/pegasus-utility.js | 22 ++++++++++++++-------- system.json | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 00523ca..d780116 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -111,11 +111,14 @@ export class PegasusUtility { for (let effect of rollData.effectsList) { if (effect && effect.applied && effect.type == "effect" && effect.effect.data.bonusdice) { let diceKey = PegasusUtility.getDiceFromLevel(effect.effect.data.effectlevel) - let newDice = { - name: "effect-bonus-dice", key: diceKey, level: effect.effect.data.effectlevel, effect: effect.effect.name, - img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp` + let diceList = diceKey.split(" ") + for (let myDice of diceList) { + let newDice = { + name: "effect-bonus-dice", key: myDice, level: effect.effect.data.effectlevel, effect: effect.effect.name, + img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp` + } + newDicePool.push(newDice) } - newDicePool.push(newDice) } } rollData.dicePool = newDicePool @@ -127,11 +130,14 @@ export class PegasusUtility { for (let hindrance of rollData.effectsList) { if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.data?.hindrance) ) ) { let diceKey = PegasusUtility.getDiceFromLevel( (hindrance.value) ? hindrance.value : hindrance.effect.data.effectlevel) - let newDice = { - name: "effect-hindrance", key: diceKey, level: hindrance.value, effect: hindrance.name, - img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp` + let diceList = diceKey.split(" ") + for (let myDice of diceList) { + let newDice = { + name: "effect-hindrance", key: myDice, level: hindrance.value, effect: hindrance.name, + img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp` + } + newDicePool.push(newDice) } - newDicePool.push(newDice) } } rollData.dicePool = newDicePool diff --git a/system.json b/system.json index 4264772..e120c2d 100644 --- a/system.json +++ b/system.json @@ -273,6 +273,6 @@ "templateVersion": 109, "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "0.6.26", + "version": "0.6.27", "background" : "./images/ui/pegasus_welcome_page.webp" }