Ledger v3 · C# · Godot 4.7 Get started

Shield

A timed shield that soaks hits before Health

✓ 2 plays, 19 steps, all passingFrom ARPG, content\arena.ledger
stagesbefore Damage ... atabsorb intostart

A 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.

content/cookbook/mechanics/shield.ledgerthe content
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 the
3# Shield pool holds any, each hit goes into it first, and what it can't hold goes on to Health.
4
5rate 60
6stat MaxHealth
7stat MaxShield
8pool Health max MaxHealth
9pool Shield max MaxShield
10damage Health
11stages Soak
13effect Shielded
14 lasts 8s
15 MaxShield + 60
16 start
17 gain Shield 60
19effect ShieldSoak
20 before Damage of holder at Soak when holder.Shield > 0
21 absorb into Shield
23archetype Hero
24 base MaxHealth 300
25 full Health
26 pools Shield
27 has ShieldSoak
content/cookbook/mechanics/shield.playwhat it must do
1catalog shield.ledger
2
3# The shield's numbers, from Shielded (60 for 8 s) and ShieldSoak; the Hero's 300 Health.
4
5play "shielded: a hit of 40 goes to the shield; one of 50 empties it and 30 reaches Health"
6 make h Hero
7 apply Shielded to h
8 expect h.Shield = 60 from content: Shielded's gain Shield 60, its MaxShield 60
9 deal 40 to h
10 expect h.Shield = 20 from content: 60 less the hit's 40
11 expect h.Health = 300 from content: the Hero's 300, the hit soaked whole
12 save
13 deal 50 to h
14 expect h.Shield = 0 from content: 20 less 20 of the hit's 50
15 expect h.Health = 270 from content: 300 less what the shield couldn't hold, 50 - 20
16 deal 10 to h
17 expect h.Health = 260 from content: no shield left, the hit's 10 off Health
19play "after 8 s the shield is gone, and hits go to Health"
20 make h Hero
21 apply Shielded to h
22 advance 8s
23 expect h lacks Shielded
24 expect h.Shield = 0 from content: MaxShield back to 0, so the pool holds none
25 deal 10 to h
26 expect h.Health = 290 from content: 300 less 10

What 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.

> ledger pipeline content/cookbook/mechanics/shield.ledger Health
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