Skip to content

Commit

Permalink
Support Armor - * and active effects on creatures
Browse files Browse the repository at this point in the history
  • Loading branch information
juanferrer committed Nov 1, 2023
1 parent 6d9adcd commit b0d1a50
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,25 @@ 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

// Armor
system.characteristics.defense = (system.bonuses.armor.fixed || system.attributes.agility.value + system.bonuses.armor.agility) // + system.characteristics.defense // Applied as ActiveEffect further down

// Final armor computation
system.characteristics.defense += system.bonuses.armor.defense
system.characteristics.defense = system.bonuses.armor.override || system.characteristics.defense
for (let change of effectChanges.filter(e => e.key.includes("defense"))) {
const result = change.effect.apply(this, change)
if (result !== null) this.overrides[change.key] = result
}
}
// --- Creature specific data ---
else {
system.characteristics.defense = system.characteristics.defense || system.bonuses.armor.fixed || system.attributes.agility.value + system.bonuses.armor.agility
}

// Final armor computation
system.characteristics.defense += system.bonuses.armor.defense
system.characteristics.defense = system.bonuses.armor.override || system.characteristics.defense
for (let change of effectChanges.filter(e => e.key.includes("defense"))) {
const result = change.effect.apply(this, change)
if (result !== null) this.overrides[change.key] = result
}

// WIP: Adjust size here
// for (let change of effectChanges.filter(e => e.key.includes("size"))) {
// let size = change.value
Expand Down

0 comments on commit b0d1a50

Please sign in to comment.