Ledger v3 · C# · Godot 4.7 Get started

Watch

Overwatch: a reaction shot, fired on its own or offered to the player to answer

✓ 4 plays, 66 steps, all passingFrom Tactics, content\overwatch.ledger
after Moved of enemies whenraise ... bycast ... freeends onstack ignore per source

A reaction offered to the player: overwatch, lifted from the tactics slice's content\overwatch.ledger (Overwatch, Overwatching, ReactionShot, HoldFire, LetBy and Commanded), with the pools and events of content\rules.ledger and its units from content\units.ledger and content\dummies.ledger. The watch spends the unit's action and any move left, until its next turn. The first enemy it sees move within 9 draws a reaction shot at 70% of its aim, which halts the mover either way and spends the watch. A unit whose side has a commander to ask (Asks, the player's squad) fires nothing on its own: the world offers the shot (ShotOffered of the watcher, by the mover), the game holds the choice, and the player answers with an order, the reaction shot or holding fire, which lets that mover by until its next turn and keeps the watch. The game raises Moved at each cell a unit walks; the slice's dead carry Dead.

content/cookbook/mechanics/watch.ledgerthe content
1# A reaction offered to the player: overwatch, lifted from the tactics slice's content\overwatch.ledger (Overwatch,
2# Overwatching, ReactionShot, HoldFire, LetBy and Commanded), with the pools and events of content\rules.ledger and
3# its units from content\units.ledger and content\dummies.ledger. The watch spends the unit's action and any move left,
4# until its next turn. The first enemy it sees move within 9 draws a reaction shot at 70% of its aim, which halts the
5# mover either way and spends the watch. A unit whose side has a commander to ask (Asks, the player's squad) fires
6# nothing on its own: the world offers the shot (ShotOffered of the watcher, by the mover), the game holds the choice,
7# and the player answers with an order, the reaction shot or holding fire, which lets that mover by until its next
8# turn and keeps the watch. The game raises Moved at each cell a unit walks; the slice's dead carry Dead.
9
10rate 10
11link team
12allegiance team
13fact Sight Cover
14stat MaxHealth
15stat Aim
16stat Defense
17stat WeaponDamage
18pool Health max MaxHealth whole
19pool Moves max 1 whole
20pool Actions max 1 whole
21damage Health
22tags Dead Asks Shot Reaction
23event TurnStarted Moved Halted ShotOffered
24turn TurnStarted
26ability Overwatch
27 requires holder.Actions >= 1 else "no action left"
28 cost Actions 1
29 cost Moves holder.Moves
30 apply Overwatching
32effect Overwatching
33 stack ignore
34 ends on TurnStarted of holder
35 after Moved of enemies when fact(Sight, holder, event.subject) > 0 and distance(holder, event.subject) <= 9 and not has(event.subject, Dead) and stacks(event.subject, LetBy, holder) == 0
36 if has(holder, Asks)
37 raise ShotOffered of holder by event.subject
38 else
39 cast ReactionShot at event.subject free
41ability ReactionShot
42 tags Shot Reaction
43 target one enemy within 9
44 requires has(holder, Overwatching) else "not on overwatch"
45 requires fact(Sight, holder, target) > 0 else "no line of sight"
46 remove Overwatching
47 raise Halted of target
48 let hit = holder.Aim * 0.7 - target.Defense - 20 * fact(Cover, holder, target) - 4 * max(0, distance(holder, target) - 4)
49 outcome out of 100
50 Hit below hit
51 deal holder.WeaponDamage to target
52 Graze below hit + 10
53 deal holder.WeaponDamage * 0.5 to target
54 Miss
56ability HoldFire
57 target one enemy
58 requires has(holder, Overwatching) else "not on overwatch"
59 apply LetBy to target
61effect LetBy
62 stack ignore per source
63 ends on TurnStarted of holder
65effect Commanded
66 tags Asks
68archetype Side
70# the player's: its watch asks
71archetype Soldier
72 base MaxHealth 7
73 base Aim 75
74 base WeaponDamage 4
75 full Health
76 with Moves = 1, Actions = 1
77 has Commanded
78 grants Overwatch ReactionShot HoldFire
80# the aliens': its watch fires on its own
81archetype Trooper
82 base MaxHealth 5
83 base Aim 65
84 base WeaponDamage 3
85 full Health
86 with Moves = 1, Actions = 1
87 grants Overwatch ReactionShot
89# a target the shot can't miss: Defense -100 puts every chance past 100
90archetype Dummy
91 base MaxHealth 20
92 base Defense -100
93 full Health
content/cookbook/mechanics/watch.playwhat it must do
1catalog watch.ledger
2
3# Overwatch's numbers, from Overwatching and ReactionShot: a watch within 9, a shot at 70% of the watcher's aim. The
4# trooper (Aim 65, rifle 3) fires on its own; the soldier (Aim 75, rifle 4) asks. Sight is the game's fact.
5
6play "the trooper's watch spends the action and the move; the first enemy seen moving takes the shot, is halted, and the watch is spent"
7 make squad Side
8 make aliens Side
9 make t Trooper with team = aliens at 0 0
10 make d Dummy with team = squad at 6 0
11 fact Sight t d 1
12 act t Overwatch
13 expect done
14 expect t.Actions = 0 from content: 1 less the watch's 1
15 expect t.Moves = 0 from content: the move left, spent
16 raise Moved of d
17 expect d.Health = 17 from content: the dummy's 20 less the trooper's 3
18 expect event Halted of d 1 time from content: the rows above
19 expect t lacks Overwatching
20 raise Moved of d
21 expect d.Health = 17 from content: the watch is spent
23play "the watch is blind to a mover it can't see and one past 9, and ends as its holder's next turn starts"
24 make squad Side
25 make aliens Side
26 make t Trooper with team = aliens at 0 0
27 make d Dummy with team = squad at 6 0
28 act t Overwatch
29 raise Moved of d
30 expect d.Health = 20 from content: no sight, no shot
31 fact Sight t d 1
32 place d 10 0
33 raise Moved of d
34 expect d.Health = 20 from content: 10 away, past 9
35 expect t has Overwatching
36 save
37 raise TurnStarted of t
38 expect t lacks Overwatching
40play "the soldier's watch offers the shot and fires nothing; answered with the shot, it hits, halts and spends the watch"
41 make squad Side
42 make aliens Side
43 make s Soldier with team = squad at 0 0
44 make d Dummy with team = aliens at 5 0
45 fact Sight s d 1
46 act s Overwatch
47 raise Moved of d
48 expect event ShotOffered of s 1 time from content: the rows above
49 expect d.Health = 20 from content: offered, not fired
50 expect s has Overwatching
51 save
52 act s ReactionShot at d
53 expect done
54 expect d.Health = 16 from content: the dummy's 20 less the soldier's 4
55 expect event Halted of d 1 time from content: the rows above
56 expect s lacks Overwatching
58play "answered by holding fire, that mover is let by until its next turn and the watch is kept for the next"
59 make squad Side
60 make aliens Side
61 make s Soldier with team = squad at 0 0
62 make d Dummy with team = aliens at 5 0
63 make e Dummy with team = aliens at 6 1
64 fact Sight s d 1
65 fact Sight s e 1
66 act s Overwatch
67 raise Moved of d
68 act s HoldFire at d
69 expect done
70 expect d has LetBy from s
71 raise Moved of d
72 expect no event ShotOffered of s
73 raise Moved of e
74 expect event ShotOffered of s 1 time from content: e is no one let by
75 raise TurnStarted of d
76 expect d lacks LetBy
77 raise Moved of d
78 expect event ShotOffered of s 1 time from content: let by no longer

Run it yourself

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