Ledger v3 · C# · Godot 4.7 Get started

Stim

A buff paid in health that hastens attacks

✓ 2 plays, 28 steps, all passingFrom RTS, content\rifle.ledger
cost Healthcooldown ... clock STATtemplate ability

A buff paid in health that hastens attacks, lifted from the RTS slice's content\rifle.ledger (Stim, Stimmed and the rifle's Shot), with the Attack template and the attack clock of content\rules.ledger. Stim trades 10 health for 11 seconds of half again the attack speed and the movement, and is refused where the 10 would kill. The shot's cooldown runs on its holder's AttackSpeed, so a stimmed rifle fires every 0.4 s, not 0.6. The slice's attack also requires the target in its side's sight, a fact its fog answers; that line is left out here.

content/cookbook/mechanics/stim.ledgerthe content
1# A buff paid in health that hastens attacks, lifted from the RTS slice's content\rifle.ledger (Stim, Stimmed and the
2# rifle's Shot), with the Attack template and the attack clock of content\rules.ledger. Stim trades 10 health for 11
3# seconds of half again the attack speed and the movement, and is refused where the 10 would kill. The shot's
4# cooldown runs on its holder's AttackSpeed, so a stimmed rifle fires every 0.4 s, not 0.6. The slice's attack also
5# requires the target in its side's sight, a fact its fog answers; that line is left out here.
6
7rate 20
8stat MaxHealth
9stat MoveSpeed
10stat AttackSpeed default 1
11pool Health max MaxHealth
12damage Health
13link team
14allegiance team
15tags Unit Attack
17template ability Attack(reach, cool, amount)
18 tags Attack
19 target one enemy within reach
20 cooldown 1s * cool clock AttackSpeed
21 deal amount to target
23ability Shot from Attack(5, 0.6, 6)
25ability Stim
26 requires holder.Health > 10 else "it would kill"
27 cost Health 10
28 apply Stimmed to holder
30effect Stimmed
31 stack refresh
32 lasts 11s
33 AttackSpeed + 50%
34 MoveSpeed + 50%
36archetype Side
38archetype Rifle
39 tags Unit
40 base MaxHealth 45
41 base MoveSpeed 3.15
42 full Health
43 grants Shot Stim
content/cookbook/mechanics/stim.playwhat it must do
1catalog stim.ledger
2
3# The stim's numbers, from Stim (10 health), Stimmed (50% on AttackSpeed and MoveSpeed for 11 s) and Shot (6 every
4# 0.6 s of the attack clock); the Rifle's 45 Health.
5
6play "stimmed: 10 health paid, the feet half again as fast, and a shot every 0.4 s"
7 make a Side
8 make b Side
9 make r Rifle with team = a at 0 0
10 make t Rifle with team = b at 3 0
11 act r Stim
12 expect done
13 expect r.Health = 35 from content: 45 less the stim's 10
14 expect r.MoveSpeed = 4.725 from content: 3.15 and Stimmed's 50%
15 act r Shot at t
16 expect done
17 expect t.Health = 39 from content: 45 less 6
18 advance 0.4s
19 act r Shot at t
20 expect done
21 expect t.Health = 33 from content: the cooldown's 0.6 s at AttackSpeed 1.5 is 0.4 s: 39 less 6
22 save
23 advance 11s
24 expect r lacks Stimmed
25 act r Shot at t
26 expect done
27 advance 0.4s
28 act r Shot at t
29 expect refused OnCooldown
31play "at 10 health or less, the stim is refused in its words"
32 make a Side
33 make r Rifle with team = a
34 deal 35 to r
35 act r Stim
36 expect refused Requirement "it would kill"

Run it yourself

ledger check content/cookbook/mechanics/stim.ledger content/cookbook/mechanics/stim.play
ledger play content/cookbook/mechanics/stim.play