|
|
|
@ -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) {
|
|
|
|
|