Ledger v3 · C# · Godot 4.7 Get started

Burn

A burn over time, stacking to 5, each new stack starting its time again

✓ 3 plays, 31 steps, all passingFrom ARPG, content\arena.ledger
stack add maxlastseverydeal ... from sourceself.stacks

A burn over time, lifted from the ARPG slice's content\arena.ledger (Burning). Each stack deals 3 a half second, up to 5 stacks, credited to whoever lit it; a new stack starts the 3 seconds again, so a burn kept lit never ends. The slice's fireball lights it (windup.ledger here); the play lights it by hand.

content/cookbook/mechanics/burn.ledgerthe content
1# A burn over time, lifted from the ARPG slice's content\arena.ledger (Burning). Each stack deals 3 a half second, up
2# to 5 stacks, credited to whoever lit it; a new stack starts the 3 seconds again, so a burn kept lit never ends. The
3# slice's fireball lights it (windup.ledger here); the play lights it by hand.
4
5rate 60
6stat MaxHealth
7pool Health max MaxHealth
8damage Health
9tags Fire
11effect Burning
12 tags Fire
13 stack add max 5
14 lasts 3s
15 every 0.5s
16 deal 3 * self.stacks Fire to holder from source
18archetype Dummy
19 base MaxHealth 1000
20 full Health
content/cookbook/mechanics/burn.playwhat it must do
1catalog burn.ledger
2
3# The burn's numbers, from Burning: 3 a stack every 0.5 s for 3 s, up to 5 stacks. A dummy stands at 1000 Health.
4
5play "one stack: 3 at each half second, six beats in its 3 seconds, 18 in all, and it is gone"
6 make p Dummy
7 make d Dummy
8 apply Burning to d from p
9 advance 0.5s
10 expect d.Health = 997 from content: 1000 less one beat of 3 * 1 stack at 0.5 s
11 expect event Change of d credited to p tagged Fire
12 advance 2.5s
13 expect d.Health = 982 from content: 1000 less six beats of 3, at 0.5 s to 3 s
14 expect d lacks Burning
16play "stacked: five at most, each beat 3 a stack"
17 make p Dummy
18 make d Dummy
19 repeat 5
20 apply Burning to d from p
21 apply Burning to d from p
22 expect already
23 expect d has Burning 5 from content: stack add max 5, the sixth turned away
24 advance 0.5s
25 expect d.Health = 985 from content: 1000 less one beat of 3 * 5 stacks
27play "a stack more starts the 3 seconds again"
28 make p Dummy
29 make d Dummy
30 apply Burning to d from p
31 advance 2s
32 expect d.Health = 988 from content: 1000 less four beats of 3
33 apply Burning to d from p
34 expect d remaining Burning = 3s from content: lasts 3s, started again by the second stack
35 save
36 advance 0.5s
37 expect d.Health = 982 from content: 988 less a beat of 3 * 2 stacks

Run it yourself

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