Shield
A timed shield that soaks hits before Health
stagesbefore Damage ... atabsorb intostartA shield that soaks hits before Health, lifted from the ARPG slice's content\arena.ledger (Shielded and ShieldSoak) and the hero who keeps the soak from content\hero.ledger. Shielded gives 60 more to lose, for 8 seconds; while the Shield pool holds any, each hit goes into it first, and what it can't hold goes on to Health.
1
# A shield that soaks hits before Health, lifted from the ARPG slice's content\arena.ledger (Shielded and ShieldSoak)2
# and the hero who keeps the soak from content\hero.ledger. Shielded gives 60 more to lose, for 8 seconds; while the3
# Shield pool holds any, each hit goes into it first, and what it can't hold goes on to Health.5
rate 606
stat MaxHealth7
stat MaxShield8
pool Health max MaxHealth9
pool Shield max MaxShield10
damage Health11
stages Soak13
effect Shielded14
lasts 8s15
MaxShield + 6016
start17
gain Shield 6019
effect ShieldSoak20
before Damage of holder at Soak when holder.Shield > 021
absorb into Shield23
archetype Hero24
base MaxHealth 30025
full Health26
pools Shield27
has ShieldSoak1
catalog shield.ledger3
# The shield's numbers, from Shielded (60 for 8 s) and ShieldSoak; the Hero's 300 Health.5
play "shielded: a hit of 40 goes to the shield; one of 50 empties it and 30 reaches Health"6
make h Hero7
apply Shielded to h8
expect h.Shield = 60 from content: Shielded's gain Shield 60, its MaxShield 609
deal 40 to h10
expect h.Shield = 20 from content: 60 less the hit's 4011
expect h.Health = 300 from content: the Hero's 300, the hit soaked whole12
save13
deal 50 to h14
expect h.Shield = 0 from content: 20 less 20 of the hit's 5015
expect h.Health = 270 from content: 300 less what the shield couldn't hold, 50 - 2016
deal 10 to h17
expect h.Health = 260 from content: no shield left, the hit's 10 off Health19
play "after 8 s the shield is gone, and hits go to Health"20
make h Hero21
apply Shielded to h22
advance 8s23
expect h lacks Shielded24
expect h.Shield = 0 from content: MaxShield back to 0, so the pool holds none25
deal 10 to h26
expect h.Health = 290 from content: 300 less 10What a change to Health meets
Every rule in this recipe a change to Health passes through, in order. Each line is a link to the rule.
Health: a change to it meets 1 rule, in this order before, at Soak ShieldSoak: Damage of holder at Soak when holder.Shield > 0 (content/cookbook/mechanics/shield.ledger:20) absorbs from it into Shield; held by Hero no archetype lacks a layer its like hold
Run it yourself
ledger check content/cookbook/mechanics/shield.ledger content/cookbook/mechanics/shield.play
ledger play content/cookbook/mechanics/shield.play
ledger pipeline content/cookbook/mechanics/shield.ledger Health