Fix effects

This commit is contained in:
sladecraven 2022-09-02 20:34:37 +02:00
parent 92cea77239
commit 39d220cfe6
2 changed files with 15 additions and 9 deletions

View File

@ -111,13 +111,16 @@ 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 diceList = diceKey.split(" ")
for (let myDice of diceList) {
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`
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)
}
}
}
rollData.dicePool = newDicePool
}
@ -127,13 +130,16 @@ 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 diceList = diceKey.split(" ")
for (let myDice of diceList) {
let newDice = {
name: "effect-hindrance", key: diceKey, level: hindrance.value, effect: hindrance.name,
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp`
name: "effect-hindrance", key: myDice, level: hindrance.value, effect: hindrance.name,
img: `systems/fvtt-pegasus-rpg/images/dice/${myDice}.webp`
}
newDicePool.push(newDice)
}
}
}
rollData.dicePool = newDicePool
}

View File

@ -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"
}