diff --git a/src/module/actor/actor.js b/src/module/actor/actor.js index ff00843f..90066568 100644 --- a/src/module/actor/actor.js +++ b/src/module/actor/actor.js @@ -180,8 +180,6 @@ export class DemonlordActor extends Actor { // Health and Healing Rate system.characteristics.health.max += system.attributes.strength.value - - // Armor system.characteristics.defense = (system.bonuses.armor.fixed || system.attributes.agility.value + system.bonuses.armor.agility) // + system.characteristics.defense // Applied as ActiveEffect further down } @@ -190,6 +188,9 @@ export class DemonlordActor extends Actor { system.characteristics.defense = system.characteristics.defense || system.bonuses.armor.fixed || system.attributes.agility.value + system.bonuses.armor.agility } + // Insanity + if (this.type !== 'vehicle') system.characteristics.insanity.max += system.attributes.will.value + // --- Valid for all type of actors // Healing Rate system.characteristics.health.healingrate = system.characteristics.health.max / 4 @@ -200,8 +201,6 @@ export class DemonlordActor extends Actor { } // And then round down system.characteristics.health.healingrate = Math.floor(system.characteristics.health.healingrate) - // Insanity - system.characteristics.insanity.max += system.attributes.will.value // Final armor computation system.characteristics.defense += system.bonuses.armor.defense @@ -592,7 +591,8 @@ getTargetAttackBane(target) { for (let effect of this.appliedEffects) { const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`) - if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete() + const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false + if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate}) } Hooks.call('DL.RollAttack', { @@ -678,11 +678,8 @@ getTargetAttackBane(target) { for (let effect of this.appliedEffects) { const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`) - const doNotAnimate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? false: true - if (specialDuration === 'NextD20Roll' || specialDuration === 'NextChallengeRoll') { - if (doNotAnimate) await effect?.delete({animate: false}) - else await effect?.delete() - } + const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false + if (specialDuration === 'NextD20Roll' || specialDuration === 'NextChallengeRoll') await effect?.delete({animate:animate}) } return challengeRoll @@ -737,7 +734,8 @@ getTargetAttackBane(target) { for (let effect of this.appliedEffects) { const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`) - if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete() + const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false + if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate}) } return attackRoll @@ -823,7 +821,8 @@ getTargetAttackBane(target) { for (let effect of this.appliedEffects) { const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`) - if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete() + const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false + if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate}) } if (itemMacroEnabled) { @@ -945,7 +944,8 @@ getTargetAttackBane(target) { for (let effect of this.appliedEffects) { const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`) - if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete() + const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false + if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate}) } // Add concentration if it's in the spell duration @@ -1081,7 +1081,8 @@ getTargetAttackBane(target) { for (let effect of this.appliedEffects) { const specialDuration = foundry.utils.getProperty(effect, `flags.${game.system.id}.specialDuration`) - if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete() + const animate = foundry.utils.getProperty(effect, `flags.${game.system.id}.doNotAnimate`) === undefined ? true: false + if (specialDuration === 'NextD20Roll' || specialDuration === 'NextAttackRoll') await effect?.delete({animate:animate}) } if (itemMacroEnabled) { const defender = target?.actor diff --git a/src/templates/actor/tabs/creature-reference.hbs b/src/templates/actor/tabs/creature-reference.hbs index 515e3f45..77757912 100644 --- a/src/templates/actor/tabs/creature-reference.hbs +++ b/src/templates/actor/tabs/creature-reference.hbs @@ -2,7 +2,11 @@