Ledger v3 · C# · Godot 4.7 Get started

Split

A foe that splits in two as it dies, the halves going on from where it fell

✓ 1 play, 14 steps, all passingFrom TD, content\creeps.ledger
create KIND N with POOL = ...after Died of holder

A foe that splits in two as it dies, lifted from the tower-defense slice's content\creeps.ledger (the splitter's Splitting and its Splitling) and death from content\td.ledger (Mortal). Where it dies, two halves go on from where it fell: each made on its side with the walked lane it had. The game stands them on the path.

content/cookbook/mechanics/split.ledgerthe content
1# A foe that splits in two as it dies, lifted from the tower-defense slice's content\creeps.ledger (the splitter's
2# Splitting and its Splitling) and death from content\td.ledger (Mortal). Where it dies, two halves go on from where it
3# fell: each made on its side with the walked lane it had. The game stands them on the path.
4
5rate 60
6link team
7allegiance team
8stat MaxHealth
9stat LaneEnd
10stat Pace
11pool Health max MaxHealth
12pool Progress max LaneEnd regen Pace
13damage Health
14tags Creep
15event Died
17effect Mortal
18 dies at no Health raising Died
20effect Splitting
21 after Died of holder
22 create Splitling 2 with team = holder.team, Progress = holder.Progress
24archetype Side
26archetype Splitter
27 tags Creep
28 base MaxHealth 60
29 base LaneEnd 100
30 full Health
31 pools Progress
32 has Mortal
33 has Splitting
35archetype Splitling
36 tags Creep
37 base MaxHealth 20
38 base LaneEnd 100
39 full Health
40 pools Progress
41 has Mortal
content/cookbook/mechanics/split.playwhat it must do
1catalog split.ledger
2
3# The split's numbers, from Splitting: two Splitlings of 20 Health, each with the splitter's Progress.
4
5play "a splitter killed 40 along the lane leaves two splitlings on its side, 40 along; a splitling killed leaves none"
6 make b Side
7 make s Splitter with team = b
8 set s.Progress = 40
9 deal 60 to s
10 expect s gone
11 expect count Splitling = 2 from content: create Splitling 2
12 find h Splitling
13 expect h.team = b
14 expect h.Progress = 40 from content: the splitter's Progress as it fell
15 expect h.Health = 20 from content: the Splitling's 20
16 save
17 deal 20 to h
18 expect h gone
19 expect count Splitling = 1 from content: two less the one killed; a splitling splits no further

Run it yourself

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