Outcome
A match won when the other side's last base falls
link match globalafter Died of anyonecount(all actors having TAG when ...)A match's outcome, lifted from the RTS slice's content\match.ledger (Judges and the Match), with death from content\rules.ledger (Mortal) and the base from content\economy.ledger. The match is an actor the game reads by the global link match: its Winner is 0 while each side has a base standing; a side whose last base dies loses, and the other wins, 1 for the home side and 2 for the other. The dying base is heard whole, before it is destroyed, so it is left out of its side's count. The game only stops once the winner is set.
1
# A match's outcome, lifted from the RTS slice's content\match.ledger (Judges and the Match), with death from2
# content\rules.ledger (Mortal) and the base from content\economy.ledger. The match is an actor the game reads by the3
# global link match: its Winner is 0 while each side has a base standing; a side whose last base dies loses, and the4
# other wins, 1 for the home side and 2 for the other. The dying base is heard whole, before it is destroyed, so it is5
# left out of its side's count. The game only stops once the winner is set.7
rate 208
stat MaxHealth9
pool Health max MaxHealth10
pool Winner whole max 211
damage Health12
link team13
link match global14
link home15
allegiance team16
tags Building Base17
event Died19
effect Mortal20
dies at no Health raising Died22
effect Judges23
after Died of anyone24
if holder.Winner == 0 and has(event.subject, Base) and count(all actors having Base when it.team == event.subject.team and it != event.subject) == 025
if event.subject.team == holder.home26
set Winner 227
else28
set Winner 130
archetype Match31
pools Winner32
has Judges34
archetype Side36
archetype Base37
tags Building Base38
base MaxHealth 150039
full Health40
has Mortal1
catalog outcome.ledger3
# The outcome's numbers, from Judges: 0 while each side has a base, 1 when the other side's last falls, 2 when the4
# home side's does. Side one is home; each side has bases of 1,500.6
play "the other side's first base falls and nothing is decided; its last falls and the home side wins, 1"7
make one Side8
make two Side9
make m Match with home = one10
link match m11
make h Base with team = one12
make x Base with team = two13
make y Base with team = two14
deal 1500 to x15
expect x gone16
expect m.Winner = 0 from content: side two still has a base, y17
save18
deal 1500 to y19
expect m.Winner = 1 from content: side two's last base fell, so the home side wins20
deal 1500 to h21
expect m.Winner = 1 from content: set once, and kept23
play "the home side's last base falls: the other side wins, 2"24
make one Side25
make two Side26
make m Match with home = one27
link match m28
make h Base with team = one29
make x Base with team = two30
deal 1500 to h31
expect m.Winner = 2 from content: the home side's last base fellRun it yourself
ledger check content/cookbook/mechanics/outcome.ledger content/cookbook/mechanics/outcome.play
ledger play content/cookbook/mechanics/outcome.play