Wave
A wave's start paying the player, and the foes made tougher a wave
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#.
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 and3
# 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#.6
rate 607
link team8
link player global9
allegiance team10
stat MaxHealth11
pool Health max MaxHealth12
pool Gold whole13
pool Wave whole14
damage Health15
tags Creep16
event WaveStarted18
effect Waves19
after WaveStarted of holder20
gain Wave 121
gain Gold 35 + 5 * holder.Wave23
effect WaveScaled24
MaxHealth + 10% * max(0, player.Wave - 1)26
archetype Side28
archetype Player29
with Gold = 15030
pools Wave31
has Waves33
archetype Runner34
tags Creep35
base MaxHealth 2436
full Health37
has WaveScaled1
catalog wave.ledger3
# The wave's numbers, from Waves (35 + 5 x the wave's count, paid as it begins) and WaveScaled (10% a wave after the4
# first); the player's 150 gold and the Runner's 24 Health.6
play "the first wave pays 40 and its runner has 24; the third pays 50 and its runner has 28.8"7
make a Side8
make b Side9
make p Player with team = a10
link player p11
raise WaveStarted of p12
expect p.Wave = 1 from content: one wave begun13
expect p.Gold = 190 from content: 150 + 35 + 5 x 114
make r1 Runner with team = b15
expect r1.MaxHealth = 24 from content: the Runner's 24, the first wave adding none16
save17
raise WaveStarted of p18
raise WaveStarted of p19
expect p.Wave = 3 from content: three waves begun20
expect p.Gold = 285 from content: 190 + (35 + 5 x 2) + (35 + 5 x 3)21
make r3 Runner with team = b22
expect r3.MaxHealth = 28.8 from content: 24 + 10% x (3 - 1)23
expect r3.Health = 28.8 from content: full at its MaxHealth24
expect r1.MaxHealth = 24 from content: fixed as it was made, in the first waveRun it yourself
ledger check content/cookbook/mechanics/wave.ledger content/cookbook/mechanics/wave.play
ledger play content/cookbook/mechanics/wave.play