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,11 +111,14 @@ export class PegasusUtility {
for (let effect of rollData.effectsList) { for (let effect of rollData.effectsList) {
if (effect && effect.applied && effect.type == "effect" && effect.effect.data.bonusdice) { if (effect && effect.applied && effect.type == "effect" && effect.effect.data.bonusdice) {
let diceKey = PegasusUtility.getDiceFromLevel(effect.effect.data.effectlevel) let diceKey = PegasusUtility.getDiceFromLevel(effect.effect.data.effectlevel)
let newDice = { let diceList = diceKey.split(" ")
name: "effect-bonus-dice", key: diceKey, level: effect.effect.data.effectlevel, effect: effect.effect.name, for (let myDice of diceList) {
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp` 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 rollData.dicePool = newDicePool
@ -127,11 +130,14 @@ export class PegasusUtility {
for (let hindrance of rollData.effectsList) { for (let hindrance of rollData.effectsList) {
if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.data?.hindrance) ) ) { 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 diceKey = PegasusUtility.getDiceFromLevel( (hindrance.value) ? hindrance.value : hindrance.effect.data.effectlevel)
let newDice = { let diceList = diceKey.split(" ")
name: "effect-hindrance", key: diceKey, level: hindrance.value, effect: hindrance.name, for (let myDice of diceList) {
img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp` 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 rollData.dicePool = newDicePool

View File

@ -273,6 +273,6 @@
"templateVersion": 109, "templateVersion": 109,
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-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" "background" : "./images/ui/pegasus_welcome_page.webp"
} }