Compare commits

...

3 Commits

Author SHA1 Message Date
932573c9ae Fix #98 hindrance stuff 2022-10-05 14:44:35 +02:00
d6a57de134 Fix #98 hindrance stuff 2022-10-05 14:44:12 +02:00
e2d5a0ec74 Fix #96 hindrance stuff 2022-10-05 14:38:31 +02:00
2 changed files with 15 additions and 9 deletions

View File

@ -146,10 +146,10 @@ export class PegasusUtility {
static updateEffectsBonusDice(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice")
for (let effect of rollData.effectsList) {
if (effect && effect.applied && effect.type == "effect" && effect.effect && effect.effect.system.bonusdice) {
if (effect && effect.applied && effect.type == "effect" && !effect.effect?.system?.hindrance && effect.effect && effect.effect.system.bonusdice) {
newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name))
}
if (effect && effect.applied && effect.type == "effect" && effect.value && effect.isdynamic) {
if (effect && effect.applied && effect.type == "effect" && effect.value && effect.isdynamic && !effect.effect?.system?.hindrance) {
newDicePool = newDicePool.concat(this.buildDicePool("effect-bonus-dice", effect.value, 0, effect.name))
}
}
@ -161,7 +161,9 @@ export class PegasusUtility {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-hindrance")
for (let hindrance of rollData.effectsList) {
if (hindrance && hindrance.applied && (hindrance.type == "hindrance" || (hindrance.type == "effect" && hindrance.effect?.system?.hindrance))) {
console.log("Adding Hindrance 1", hindrance, newDicePool)
newDicePool = newDicePool.concat(this.buildDicePool("effect-hindrance", (hindrance.value) ? hindrance.value : hindrance.effect.system.effectlevel, 0, hindrance.name))
console.log("Adding Hindrance 2", newDicePool)
}
}
rollData.dicePool = newDicePool
@ -1211,11 +1213,15 @@ export class PegasusUtility {
if (token.document.disposition == 0) {
continue
}
let disposition = ( token.document.disposition == -1) ? 1 : -1
let ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == disposition)
let neutrals = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == 0)
if (neutrals ) {
ennemies = ennemies.concat(neutrals)
let ennemies = []
if (token.document.disposition == -1) {
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == 1 || newToken.document.disposition == 0 ))
}
if (token.document.disposition == 1) {
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 0 ))
}
if (token.document.disposition == 0) {
ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 1 ))
}
for (let ennemy of ennemies) {
if (ennemy.actor.id != token.actor.id) {

View File

@ -253,7 +253,7 @@
],
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "10.1.0",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.0.zip",
"version": "10.1.1",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.1.1.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
}