Relocate Damage Reduction

This commit is contained in:
Dapoolp 2025-07-10 16:26:48 +02:00
parent 7b24cc01eb
commit 081ebf5bb3
4 changed files with 6 additions and 9 deletions

View file

@ -510,10 +510,10 @@ export default class DhpActor extends Actor {
calculateDamage(baseDamage, type) {
if (Hooks.call(`${CONFIG.DH.id}.preCalculateDamage`, this, baseDamage, type) === false) return null;
if(this.system.resistance[type].immunity) return 0;
if(this.system.resistance[type].resistance) baseDamage = Math.ceil(baseDamage / 2);
if(this.system.resistance[type]?.immunity) return 0;
if(this.system.resistance[type]?.resistance) baseDamage = Math.ceil(baseDamage / 2);
const flatReduction = this.system.bonuses.damageReduction[type];
const flatReduction = this.system.resistance[type].reduction;
const damage = Math.max(baseDamage - (flatReduction ?? 0), 0);
const hpDamage = this.convertDamageToThreshold(damage);