Ledger v3 · C# · Godot 4.7 Get started

Medic

A healer that heals on its own, paying in energy for what landed

✓ 1 play, 16 steps, all passingFrom RTS, content\medic.ledger
grants ... auto by nearestafter Heal by holder when event.landed

A healer that heals on its own, paying in energy, lifted from the RTS slice's content\medic.ledger (Mend, Tending and the medic). It heals the nearest hurt living ally of flesh (Bio) within 4, 4 a quarter second, with no order: an auto, ranked by nearest. It pays a third of what landed in energy, so a heal that lands nothing costs nothing. The slice's medic regains energy; this one doesn't, so the price reads plainly.

content/cookbook/mechanics/medic.ledgerthe content
1# A healer that heals on its own, paying in energy, lifted from the RTS slice's content\medic.ledger (Mend, Tending and
2# the medic). It heals the nearest hurt living ally of flesh (Bio) within 4, 4 a quarter second, with no order: an
3# auto, ranked by nearest. It pays a third of what landed in energy, so a heal that lands nothing costs nothing. The
4# slice's medic regains energy; this one doesn't, so the price reads plainly.
5
6rate 20
7stat MaxHealth
8stat MaxEnergy
9pool Health max MaxHealth
10pool Energy max MaxEnergy
11damage Health
12link team
13allegiance team
14tags Unit Bio Mech
16ability Mend
17 target one ally having Bio within 4
18 requires target.Health < target.MaxHealth else "unhurt"
19 requires holder.Energy >= 1 else "no energy"
20 cooldown 0.25s
21 heal 4 to target
23effect Tending
24 after Heal by holder when event.landed > 0
25 lose Energy event.landed / 3
27archetype Side
29archetype Medic
30 tags Unit Bio
31 base MaxHealth 60
32 base MaxEnergy 100
33 full Health Energy
34 has Tending
35 grants Mend auto by nearest
37archetype Rifle
38 tags Unit Bio
39 base MaxHealth 45
40 full Health
42archetype Siege
43 tags Unit Mech
44 base MaxHealth 175
45 full Health
content/cookbook/mechanics/medic.playwhat it must do
1catalog medic.ledger
2
3# The medic's numbers, from Mend (4 a quarter second within 4) and Tending (a third of what landed, in energy); the
4# Medic's 100 Energy and the Rifle's 45 Health.
5
6play "the medic heals the nearest hurt ally of flesh on its own, paying a third of what landed; a mech, a far one, none"
7 make s Side
8 make m Medic with team = s at 0 0
9 make t Siege with team = s at 1 0
10 make r Rifle with team = s at 2 0
11 make f Rifle with team = s at 20 0
12 deal 15 to r
13 deal 20 to t
14 deal 15 to f
15 advance 1.2s
16 expect r.Health = 45 from content: 30 and four heals, 4, 4, 4 and 3, the last landing only what was missing
17 expect t.Health = 155 from content: 175 less 20; a mech isn't healed
18 expect f.Health = 30 from content: 20 away, past the 4
19 expect m.Energy = 95.000001 from content: 100 less a third of each heal that landed, 4, 4, 4 and 3; each third of 4 kept to the millionth, 1.333333, so 100 - 3 x 1.333333 - 1
20 save
21 advance 10s
22 expect m.Energy = 95.000001 from content: nothing hurt within reach, nothing healed, nothing paid

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/medic.ledger Health
Health: a change to it meets 1 rule, in this order
after it lands
  Tending: Heal by holder when event.landed > 0 (content/cookbook/mechanics/medic.ledger:24)
    hears what landed; held by Medic
no archetype lacks a layer its like hold

Run it yourself

ledger check content/cookbook/mechanics/medic.ledger content/cookbook/mechanics/medic.play
ledger play content/cookbook/mechanics/medic.play
ledger pipeline content/cookbook/mechanics/medic.ledger Health