Split
A foe that splits in two as it dies, the halves going on from where it fell
create KIND N with POOL = ...after Died of holderA 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.
1
# A foe that splits in two as it dies, lifted from the tower-defense slice's content\creeps.ledger (the splitter's2
# Splitting and its Splitling) and death from content\td.ledger (Mortal). Where it dies, two halves go on from where it3
# fell: each made on its side with the walked lane it had. The game stands them on the path.5
rate 606
link team7
allegiance team8
stat MaxHealth9
stat LaneEnd10
stat Pace11
pool Health max MaxHealth12
pool Progress max LaneEnd regen Pace13
damage Health14
tags Creep15
event Died17
effect Mortal18
dies at no Health raising Died20
effect Splitting21
after Died of holder22
create Splitling 2 with team = holder.team, Progress = holder.Progress24
archetype Side26
archetype Splitter27
tags Creep28
base MaxHealth 6029
base LaneEnd 10030
full Health31
pools Progress32
has Mortal33
has Splitting35
archetype Splitling36
tags Creep37
base MaxHealth 2038
base LaneEnd 10039
full Health40
pools Progress41
has Mortal1
catalog split.ledger3
# The split's numbers, from Splitting: two Splitlings of 20 Health, each with the splitter's Progress.5
play "a splitter killed 40 along the lane leaves two splitlings on its side, 40 along; a splitling killed leaves none"6
make b Side7
make s Splitter with team = b8
set s.Progress = 409
deal 60 to s10
expect s gone11
expect count Splitling = 2 from content: create Splitling 212
find h Splitling13
expect h.team = b14
expect h.Progress = 40 from content: the splitter's Progress as it fell15
expect h.Health = 20 from content: the Splitling's 2016
save17
deal 20 to h18
expect h gone19
expect count Splitling = 1 from content: two less the one killed; a splitling splits no furtherRun it yourself
ledger check content/cookbook/mechanics/split.ledger content/cookbook/mechanics/split.play
ledger play content/cookbook/mechanics/split.play