Ward
A ward that stops the first hit and goes
before Damage ... when event.amount > 0preventremove selfA ward that stops the first hit and goes, lifted from the card slice's content\shield.ledger (Shielded and the squire), with the board's units from content\rules.ledger (Mortal and the Body template). The first damage of more than 0 to the holder is prevented whole and takes the ward off; a hit of 0 leaves it.
1
# A ward that stops the first hit and goes, lifted from the card slice's content\shield.ledger (Shielded and the2
# squire), with the board's units from content\rules.ledger (Mortal and the Body template). The first damage of more3
# than 0 to the holder is prevented whole and takes the ward off; a hit of 0 leaves it.5
rate 106
link team owner7
allegiance team9
stat MaxHealth10
stat Attack11
pool Health max MaxHealth whole12
damage Health14
tags Body Unit Shield15
event Died17
effect Mortal18
dies at no Health raising Died20
effect Shielded21
tags Shield22
before Damage of holder when event.amount > 023
prevent24
remove self26
template archetype Body(attack, health)27
tags Body Unit28
base MaxHealth health29
base Attack attack30
full Health31
has Mortal33
archetype Squire from Body(2, 1)34
has Shielded1
catalog ward.ledger3
# The ward's numbers, from Shielded and the Squire, a 2/1.5
play "a squire's ward stops a hit of 5 and goes; the next hit of 1 kills it; a hit of 0 leaves the ward"6
make s Squire7
make t Squire8
deal 0 to t9
expect t has Shielded10
deal 5 to s11
expect refused Prevented12
expect s.Health = 1 from content: the Squire's 1, the hit prevented13
expect s lacks Shielded14
save15
deal 1 to s16
expect s goneWhat 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 no stage Shielded: Damage of holder when event.amount > 0 (content/cookbook/mechanics/ward.ledger:22) prevents it, stops the phase: no rule after it runs, changes the world beyond it; held by Squire no archetype lacks a layer its like hold
Run it yourself
ledger check content/cookbook/mechanics/ward.ledger content/cookbook/mechanics/ward.play
ledger play content/cookbook/mechanics/ward.play
ledger pipeline content/cookbook/mechanics/ward.ledger Health