Turn
A turn's start giving back a unit's move and action; a move as long as its path
turn EVENTtakes Pathset POOLcost Moves 1A turn's start giving back a unit's move and its action, lifted from the tactics slice's content\rules.ledger (TakesTurns, Move and the pools they spend) and its soldier from content\units.ledger. A move of the path's length, up to the unit's mobility, spends its one move; the path is the game's, handed with the order. The game raises TurnStarted of each unit of the side whose turn begins, which sets its move and action back to one.
1
# A turn's start giving back a unit's move and its action, lifted from the tactics slice's content\rules.ledger2
# (TakesTurns, Move and the pools they spend) and its soldier from content\units.ledger. A move of the path's length,3
# up to the unit's mobility, spends its one move; the path is the game's, handed with the order. The game raises4
# TurnStarted of each unit of the side whose turn begins, which sets its move and action back to one.6
rate 107
link team8
allegiance team9
prop Path min 010
stat Mobility11
pool Moves max 1 whole12
pool Actions max 1 whole13
event TurnStarted14
turn TurnStarted16
effect TakesTurns17
after TurnStarted of holder18
set Moves 119
set Actions 121
ability Move22
takes Path23
requires event.Path <= holder.Mobility else "further than the unit's move"24
cost Moves 126
archetype Side28
archetype Soldier29
base Mobility 530
with Moves = 1, Actions = 131
has TakesTurns32
grants Move1
catalog turn.ledger3
# The turn's numbers, from TakesTurns, Move and the Soldier: Mobility 5, one move and one action a turn.5
play "a move of 5 spends the move; 6 is too far; a second waits for the next turn, which gives back the move"6
make squad Side7
make s Soldier with team = squad at 0 08
act s Move with Path = 69
expect refused Requirement "further than the unit's move"10
act s Move with Path = 511
expect done12
expect s.Moves = 0 from content: 1 less the move's 113
act s Move with Path = 114
expect refused CannotAfford15
save16
raise TurnStarted of s17
expect s.Moves = 1 from content: the turn sets it to 118
expect s.Actions = 1 from content: the turn sets it to 119
act s Move with Path = 120
expect doneRun it yourself
ledger check content/cookbook/mechanics/turn.ledger content/cookbook/mechanics/turn.play
ledger play content/cookbook/mechanics/turn.play