Ledger v3 · C# · Godot 4.7 Get started

Guards

Turning a hit away, where it stops.

✓ 5 plays, 83 steps, all passingFrom v2's cookbook

v2's cookbook, turning a hit away (G266-G271). A mage casts a firebolt at a paladin, 20 fire, 10 armour off for 10 seconds and a harmless mark, and pays its 10 mana every time; what differs is where the hit stops. A bubble refuses what is harmful and lets the rest land; a ward spends a charge on each magic part it stops; a totem eats the cast whole; a shield soaks damage and refuses nothing; a sigil turns away the first hex and takes its own half-damage rule with it. A presenter draws the fire only on a hit that lands (G271).

content/cookbook/guards.ledgerthe content
1# v2's cookbook, turning a hit away (G266-G271). A mage casts a firebolt at a paladin, 20 fire, 10 armour off for 10
2# seconds and a harmless mark, and pays its 10 mana every time; what differs is where the hit stops. A bubble refuses
3# what is harmful and lets the rest land; a ward spends a charge on each magic part it stops; a totem eats the cast
4# whole; a shield soaks damage and refuses nothing; a sigil turns away the first hex and takes its own half-damage rule
5# with it. A presenter draws the fire only on a hit that lands (G271).
6
7rate 60
8stat MaxHealth
9stat Armor
10stat Accuracy
11stat ShieldLeft
12pool Health max MaxHealth
13pool Mana max 100
14damage Health
15stages Absorb
16tags Fire Magic Harmful Unblockable Spell Hex Brand
18archetype Mage
19 base MaxHealth 100
20 base Accuracy 1
21 full Health Mana
22 grants Firebolt Expose DoubleHex HexAndBrand Strike
24archetype Paladin
25 base MaxHealth 100
26 full Health
28ability Firebolt
29 tags Spell Magic
30 target one
31 cost Mana 10
32 if chance(holder.Accuracy)
33 deal 20 Fire Magic Harmful to target
34 apply Scorched to target
35 apply Marked to target
37effect Scorched
38 tags Magic Harmful
39 stack refresh
40 lasts 10s
41 Armor - 10
43effect Marked
44 stack refresh
45 lasts 3s
47effect Blinded
48 Accuracy x 0
50# ---- G266 the divine shield: for 8 seconds whatever is harmful is refused, however much of it comes, unless it is
51# unblockable; what harmful was on the paladin goes as it rises ----
53effect DivineShield
54 lasts 8s
55 blocks Apply unless Unblockable having Harmful from others
56 blocks Damage unless Unblockable having Harmful from others
57 start
58 remove all Harmful
60ability Expose
61 target one
62 apply Exposed to target
64effect Exposed
65 tags Harmful Unblockable
66 lasts 10s
67 Armor - 5
69# ---- G267 the spell ward: the next three magic parts for 30 seconds, a charge each; a bolt is two, its damage and its
70# armour loss; a bolt that missed raised nothing, so costs nothing ----
72# v2 never put a ward and a sigil on one paladin. Held together, the sigil turns away the hex it is kept for first,
73# sparing a ward's charge: the content's choice, said by their keys.
74effect SpellWard
75 order 2
76 stack add max 3
77 lasts 30s
78 before Damage of holder having Magic
79 prevent
80 remove SpellWard 1
81 before Apply of holder having Magic
82 prevent
83 remove SpellWard 1
85# ---- G268 the grounding totem: the next spell cast at its holder in 15 seconds is eaten whole, its price paid ----
87effect Grounding
88 lasts 15s
89 before Activate targeting holder having Spell
90 prevent
91 remove self
93# ---- G269 power word: shield, 50 damage soaked for 15 seconds; nothing is refused, so every hit lands ----
95effect PowerWordShield
96 lasts 15s
97 var hp = 50
98 ShieldLeft + self.hp
99 before Damage of holder at Absorb
100 absorb into self.hp
101 if self.hp <= 0
102 remove self
104# ---- G270 the sigil: the first hex that reaches its holder is turned away and the sigil goes, and its half-damage
105# rule with it ----
107effect Sigil
108 order 1
109 before Apply of holder having Hex
110 prevent
111 remove self
112 before Damage of holder
113 scale 0.5
115effect Hexed
116 tags Hex
117 stack add
118 var dmg = 0
119 lasts 10s
120 start
121 deal self.dmg to holder
123ability DoubleHex
124 target one
125 apply Hexed to target with dmg = 15
126 apply Hexed to target with dmg = 10
128ability HexAndBrand
129 target one
130 apply Hexed to target with dmg = 15
131 deal 10 Brand to target
133ability Strike
134 target one
135 deal 10 to target
content/cookbook/guards.playwhat it must do
1catalog guards.ledger
2row G266 Scorched Marked DivineShield Exposed Firebolt Expose Mage Paladin
3row G267 Scorched Marked Blinded SpellWard Firebolt Mage Paladin
4row G268 Marked Grounding Firebolt Mage Paladin
5row G269 PowerWordShield Firebolt Mage Paladin
6row G270 Sigil Hexed DoubleHex HexAndBrand Strike Mage Paladin
7row G271 Firebolt
8
9play G266 G271 "A firebolt burns the paladin, 20 and 10 armour off; its divine shield clears the burn, and for 8 seconds two bolts land only their marks, the mage paying for both; an unblockable exposure lands; after it, a bolt lands whole. The fire is drawn only on the bolt that landed"
10 make m Mage
11 make p Paladin
12 act m Firebolt at p
13 expect p.Health = 80 from G266: p.Health - "20 fire damage"
14 expect event Change of p landed tagged Fire 1 time from G271: count "act m Firebolt at p"
15 expect p.Armor = -10 from G266: "-10 armor"
16 apply DivineShield to p
17 expect p lacks Scorched
18 act m Firebolt at p
19 act m Firebolt at p
20 expect no event Change of p landed tagged Fire
21 expect m.Mana = 70 from G266: m.Mana - count "act m Firebolt at p" * "costs the mage 10 mana"
22 expect p.Health = 80 from G266: p.Health - "20 fire damage"
23 expect p lacks Scorched
24 expect p has Marked
25 act m Expose at p
26 expect p has Exposed
27 expect p.Armor = -5 from content: G266 gives the exposure no size; the content's -5 on the paladin's cleared armour
28 save
29 advance 8s
30 act m Firebolt at p
31 expect p.Health = 60 from content: G266 leaves open whether the 8 s bubble still holds at exactly 8 s; the content's has ended, so the bolt's 20 lands, off 80
32 expect event Change of p landed tagged Fire 1 time from content: G266 leaves open whether the bubble still holds at exactly 8 s; the content's has ended, so the bolt lands and its fire shows once
33 expect p has Scorched
34 covers challenge 2
36play G267 "A spell ward of three: the first bolt's damage and armour loss take two, its mark lands; the second's damage takes the last and its armour loss lands. A blinded mage's bolt misses, raises nothing and spends nothing"
37 make m Mage
38 make b Mage
39 make p Paladin
40 apply SpellWard 3 to p
41 apply Blinded to b
42 act b Firebolt at p
43 expect b.Mana = 90 from G267: b.Mana - "costs the mage 10 mana" in G266
44 expect p has SpellWard 3 from G267: "three magic"
45 act m Firebolt at p
46 expect p has SpellWard 1 from G267: "three magic" - "two magic"
47 expect p.Health = 100 from G267: p.Health
48 expect p lacks Scorched
49 expect p has Marked
50 save
51 act m Firebolt at p
52 expect p lacks SpellWard
53 expect p.Health = 100 from G267: p.Health
54 expect p has Scorched
56play G268 "A grounding totem eats the next spell cast at the paladin whole, mark and all, and the mage pays for it; the bolt after lands"
57 make m Mage
58 make p Paladin
59 apply Grounding to p
60 act m Firebolt at p
61 expect refused Countered
62 expect m.Mana = 90 from G268: m.Mana - "costs the mage 10 mana" in G266
63 expect p.Health = 100 from G268: p.Health
64 expect p lacks Marked
65 expect p lacks Grounding
66 save
67 act m Firebolt at p
68 expect p.Health = 80 from G268: p.Health - "20 fire damage" in G266
69 expect p has Marked
71play G269 "Power word: shield soaks 50: a bolt leaves it 30 and the paladin's health whole, and its armour loss lands; the third bolt breaks it and 10 gets through"
72 make m Mage
73 make p Paladin
74 apply PowerWordShield to p
75 act m Firebolt at p
76 expect p.Health = 100 from G269: p.Health
77 expect p.ShieldLeft = 30 from G269: "50 damage" - "20-damage"
78 expect p has Scorched
79 act m Firebolt at p
80 expect p.ShieldLeft = 10 from G269: "50 damage" - "20-damage" - "20-damage"
81 save
82 act m Firebolt at p
83 expect p.Health = 90 from G269: p.Health - (count "act m Firebolt at p" * "20-damage" - "50 damage")
84 expect p lacks PowerWordShield
86play G270 "Warded by a sigil, a strike of 10 is halved, 5; a double hex, 15 then 10, is turned away on the first, which takes the sigil, and the second lands whole. Another's hex and brand: the hex is turned away and the brand's 10 lands whole"
87 make m Mage
88 make p Paladin
89 make q Paladin
90 apply Sigil to p
91 act m Strike at p
92 expect p.Health = 95 from content: G270 halves damage while warded but gives the strike no size; the content's 10, halved, off 100
93 act m DoubleHex at p
94 expect p lacks Sigil
95 expect p has Hexed 1 from content: G270 lands the double hex's second whole but gives no stacks; the content's hex lands as one stack of Hexed
96 expect p.Health = 85 from content: G270 gives the second hex's 10 but not the paladin's health; the content's 100, less the halved strike of 5 and 10
97 save
98 apply Sigil to q
99 act m HexAndBrand at q
100 expect q lacks Hexed
101 expect q.Health = 90 from G270: q.Health - "10 brand"

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/guards.ledger Health
Health: a change to it meets 3 rules, in this order
before, at Absorb
  PowerWordShield: Damage of holder at Absorb (content/cookbook/guards.ledger:99)
    absorbs from it, changes the world beyond it; held by no archetype and applied by no content: the game or a play puts it on
before, at no stage
  Sigil: Damage of holder (content/cookbook/guards.ledger:112)
    scales it; held by no archetype and applied by no content: the game or a play puts it on
  SpellWard: Damage of holder having Magic (content/cookbook/guards.ledger:78)
    prevents it, stops the phase: no rule after it runs, changes the world beyond it; held by no archetype and applied by no content: the game or a play puts it on
no archetype lacks a layer its like hold

Run it yourself

ledger check content/cookbook/guards.ledger content/cookbook/guards.play
ledger play content/cookbook/guards.play
ledger pipeline content/cookbook/guards.ledger Health