A shield/barrier pool absorbed before HP, decaying on its own each tick unlike a plain
StatBlock stat, which only ever changes when something explicitly touches it. Several
layers can be held at once - a fresh cast over an older one, a ward stacked on a shield -
absorption always drains the most recently added layer first, so a ward cast on top of a
standing shield breaks before the shield underneath it does, matching how a layered proc
family (barrier-then-shield, shield-then-barrier) is meant to read regardless of order cast.
constbarrier = newBarrier(); barrier.add(20); // a shield spell barrier.add(10, 2); // a ward on top, decaying 2 per turn on its own
constabsorbed = barrier.absorb(15); // drains the ward first, then spills into the shield barrier.advance(1); // one turn of decay console.log(barrier.total);
A shield/barrier pool absorbed before HP, decaying on its own each tick unlike a plain
StatBlockstat, which only ever changes when something explicitly touches it. Several layers can be held at once - a fresh cast over an older one, a ward stacked on a shield - absorption always drains the most recently added layer first, so a ward cast on top of a standing shield breaks before the shield underneath it does, matching how a layered proc family (barrier-then-shield, shield-then-barrier) is meant to read regardless of order cast.Example