Ledger v3 · C# · Godot 4.7 Get started

Wave

A wave's start paying the player, and the foes made tougher a wave

✓ 1 play, 18 steps, all passingFrom TD, content\td.ledger
after WaveStartedplayer.Wavemax(...)

A wave's start and the foes it makes tougher, lifted from the tower-defense slice's content\td.ledger (Waves, WaveScaled and the Player). The game raises WaveStarted of the player as each wave begins: the player counts it and is paid 35 and 5 more a wave; a creep made in a wave after the first has 10% more health a wave, fixed as it is made. Which creeps a wave sends, and when, is the game's list, kept in its C#.

content/cookbook/mechanics/wave.ledgerthe content
1# A wave's start and the foes it makes tougher, lifted from the tower-defense slice's content\td.ledger (Waves,
2# WaveScaled and the Player). The game raises WaveStarted of the player as each wave begins: the player counts it and
3# is paid 35 and 5 more a wave; a creep made in a wave after the first has 10% more health a wave, fixed as it is made.
4# Which creeps a wave sends, and when, is the game's list, kept in its C#.
5
6rate 60
7link team
8link player global
9allegiance team
10stat MaxHealth
11pool Health max MaxHealth
12pool Gold whole
13pool Wave whole
14damage Health
15tags Creep
16event WaveStarted
18effect Waves
19 after WaveStarted of holder
20 gain Wave 1
21 gain Gold 35 + 5 * holder.Wave
23effect WaveScaled
24 MaxHealth + 10% * max(0, player.Wave - 1)
26archetype Side
28archetype Player
29 with Gold = 150
30 pools Wave
31 has Waves
33archetype Runner
34 tags Creep
35 base MaxHealth 24
36 full Health
37 has WaveScaled
content/cookbook/mechanics/wave.playwhat it must do
1catalog wave.ledger
2
3# The wave's numbers, from Waves (35 + 5 x the wave's count, paid as it begins) and WaveScaled (10% a wave after the
4# first); the player's 150 gold and the Runner's 24 Health.
5
6play "the first wave pays 40 and its runner has 24; the third pays 50 and its runner has 28.8"
7 make a Side
8 make b Side
9 make p Player with team = a
10 link player p
11 raise WaveStarted of p
12 expect p.Wave = 1 from content: one wave begun
13 expect p.Gold = 190 from content: 150 + 35 + 5 x 1
14 make r1 Runner with team = b
15 expect r1.MaxHealth = 24 from content: the Runner's 24, the first wave adding none
16 save
17 raise WaveStarted of p
18 raise WaveStarted of p
19 expect p.Wave = 3 from content: three waves begun
20 expect p.Gold = 285 from content: 190 + (35 + 5 x 2) + (35 + 5 x 3)
21 make r3 Runner with team = b
22 expect r3.MaxHealth = 28.8 from content: 24 + 10% x (3 - 1)
23 expect r3.Health = 28.8 from content: full at its MaxHealth
24 expect r1.MaxHealth = 24 from content: fixed as it was made, in the first wave

Run it yourself

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