Gather
Mining a patch in a windup and carrying the load home
windupmin(...)lose ... on targetdies at no POOLGathering: mining a patch and carrying the load home, lifted from the RTS slice's content\economy.ledger (Mine, Deposit, the OrePatch and its Spent, the Side's bank and the worker). A worker mines 5 in a windup of a second and a half, refused while it carries a load, and deposits it at a base of its side within 3, into the side's bank. A patch mined out dies. The walking between is the game's.
1
# Gathering: mining a patch and carrying the load home, lifted from the RTS slice's content\economy.ledger (Mine,2
# Deposit, the OrePatch and its Spent, the Side's bank and the worker). A worker mines 5 in a windup of a second and a3
# half, refused while it carries a load, and deposits it at a base of its side within 3, into the side's bank. A patch4
# mined out dies. The walking between is the game's.6
rate 207
stat MaxHealth8
pool Health max MaxHealth9
pool Ore whole10
pool Load whole11
damage Health12
link team base13
allegiance team14
tags Unit Building Base Worker Mineral16
archetype Side17
pools Ore18
with Ore = 5020
archetype Base21
tags Building Base22
base MaxHealth 150023
full Health25
archetype OrePatch26
tags Mineral27
pools Ore28
with Ore = 150029
has Spent31
effect Spent32
dies at no Ore34
ability Mine35
target one having Mineral within 1.536
requires holder.Load == 0 else "already carrying"37
windup 1.5s38
gain Load min(5, target.Ore)39
lose Ore min(5, target.Ore) on target41
ability Deposit42
target one ally having Base within 343
requires holder.Load > 0 else "nothing to carry"44
gain Ore holder.Load on holder.team45
set Load 047
archetype Worker48
tags Unit Worker49
base MaxHealth 4050
full Health51
pools Load52
grants Mine Deposit1
catalog gather.ledger3
# The gathering's numbers, from Mine (5 in 1.5 s), Deposit, the OrePatch's 1,500 and the side's 50 to start.5
play "a worker mines 5 in 1.5 s, carries it to its base and deposits it in its side's bank"6
make s Side7
make b Base with team = s at 0 08
make w Worker with team = s, base = b at 2 09
make p OrePatch at 3 010
act w Mine at p11
expect done12
advance 1.4s13
expect w.Load = 0 from content: the windup's 1.5 s not done14
advance 0.1s15
expect w.Load = 5 from content: a load is 516
expect p.Ore = 1495 from content: 1,500 less 517
act w Mine at p18
expect refused Requirement "already carrying"19
save20
act w Deposit at b21
expect done22
expect s.Ore = 55 from content: the side's 50 to start, and 523
expect w.Load = 0 from content: set to 0 as it deposits24
act w Deposit at b25
expect refused Requirement "nothing to carry"27
play "a patch's last 3 are a load of 3, and it is gone"28
make s Side29
make b Base with team = s at 0 030
make w Worker with team = s, base = b at 2 031
make p OrePatch at 3 032
set p.Ore = 333
act w Mine at p34
advance 1.5s35
expect w.Load = 3 from content: min(5, the patch's 3)36
expect p goneRun it yourself
ledger check content/cookbook/mechanics/gather.ledger content/cookbook/mechanics/gather.play
ledger play content/cookbook/mechanics/gather.play