Leak
A creep walking a lane to the castle, costing lives; at none the player has lost
pool ... regenafter Filledafter Depletedlink ... globalA creep walking a lane to the castle, lifted from the tower-defense slice's content\td.ledger (Progress, Leaking, Defeat and the Player) and its walker from content\creeps.ledger. How far a creep has walked is its pool Progress, drifting up at its Pace, and the lane is as long as the player's LaneLength says. A creep that walks the whole lane costs the player its leak in lives and is gone; at no lives the player has lost. The game lays the hundredths along its own path and stands the creep where its Progress puts it.
1
# A creep walking a lane to the castle, lifted from the tower-defense slice's content\td.ledger (Progress, Leaking,2
# Defeat and the Player) and its walker from content\creeps.ledger. How far a creep has walked is its pool Progress,3
# drifting up at its Pace, and the lane is as long as the player's LaneLength says. A creep that walks the whole lane4
# costs the player its leak in lives and is gone; at no lives the player has lost. The game lays the hundredths along5
# its own path and stands the creep where its Progress puts it.7
rate 608
link team9
link player global10
allegiance team11
stat LaneLength12
stat LaneEnd13
stat Walk14
stat Pace15
stat Leak16
stat MaxLives17
pool Progress max LaneEnd regen Pace18
pool Lives max MaxLives whole19
tags Creep20
event Lost22
effect Leaking23
after Filled Progress of holder24
lose Lives holder.Leak on player25
destroy holder27
effect Defeat28
after Depleted Lives of holder29
raise Lost of holder31
archetype Side33
archetype Player34
base MaxLives 2035
base LaneLength 10036
full Lives37
has Defeat39
archetype Runner40
tags Creep41
base Walk 3.542
base LaneEnd player.LaneLength43
base Pace holder.Walk44
base Leak 145
pools Progress46
has Leaking48
archetype Brute49
tags Creep50
base Walk 1.651
base LaneEnd player.LaneLength52
base Pace holder.Walk53
base Leak 2054
pools Progress55
has Leaking1
catalog leak.ledger3
# The lane's numbers, from the Player (20 lives, a lane of 100) and the Runner (3.5 hundredths a second, a leak of 1).5
play "a runner walks 3.5 a second; at the lane's end, 100 / 3.5 s on, it costs a life and is gone"6
make a Side7
make b Side8
make p Player with team = a9
link player p10
make r Runner with team = b11
advance 10s12
expect r.Progress = 35 from content: the Runner's Walk 3.5 a second for 10 s13
save14
advance 18.5s15
expect r alive16
expect p.Lives = 20 from content: the Player's 20, nothing reached the castle at 28.5 s, 99.75 walked17
advance 0.1s18
expect r gone19
expect p.Lives = 19 from content: 20 less the Runner's leak 1, at 100 / 3.5 = 28.57 s21
play "a brute leaking 20 takes the last lives, and the player has lost"22
make a Side23
make b Side24
make p Player with team = a25
link player p26
make bt Brute with team = b27
set bt.Progress = 9928
advance 1s29
expect bt gone30
expect p.Lives = 0 from content: 20 less the Brute's leak 2031
expect event Lost of pRun it yourself
ledger check content/cookbook/mechanics/leak.ledger content/cookbook/mechanics/leak.play
ledger play content/cookbook/mechanics/leak.play