Ledger v3 · C# · Godot 4.7 Get started

Grenade

An area round a point that hurts friend and foe, at a cell the side sees

✓ 2 plays, 29 steps, all passingFrom Tactics, content\grenade.ledger
target point withinfact(Seen, holder, target)all actors within ... when

An area round a point that hurts friend and foe, lifted from the tactics slice's content\grenade.ledger (Grenade), with the pools and the sight fact of content\rules.ledger and its units from content\units.ledger. Thrown at a point within 6 the thrower's side sees, for its action and one grenade, it never misses: 3 to every unit within 1.5 of the point, the cell and the eight round it, the thrower among them. Whether a side sees a cell is the game's fog, asked as a fact of the point.

content/cookbook/mechanics/grenade.ledgerthe content
1# An area round a point that hurts friend and foe, lifted from the tactics slice's content\grenade.ledger (Grenade),
2# with the pools and the sight fact of content\rules.ledger and its units from content\units.ledger. Thrown at a point
3# within 6 the thrower's side sees, for its action and one grenade, it never misses: 3 to every unit within 1.5 of the
4# point, the cell and the eight round it, the thrower among them. Whether a side sees a cell is the game's fog,
5# asked as a fact of the point.
6
7rate 10
8link team
9allegiance team
10fact Seen
11stat MaxHealth
12pool Health max MaxHealth whole
13pool Actions max 1 whole
14pool Grenades whole
15damage Health
16tags Dead Cloud
18ability Grenade
19 target point within 6
20 requires fact(Seen, holder, target) > 0 else "can't see there"
21 cost Actions 1
22 cost Grenades 1
23 deal 3 to all actors within 1.5 of target when not has(it, Dead) and not has(it, Cloud)
25archetype Side
27archetype Soldier
28 base MaxHealth 7
29 full Health
30 with Actions = 1, Grenades = 1
31 grants Grenade
33archetype Trooper
34 base MaxHealth 5
35 full Health
content/cookbook/mechanics/grenade.playwhat it must do
1catalog grenade.ledger
2
3# The grenade's numbers, from Grenade: 3 to every unit within 1.5 of the point, thrown within 6 at a cell the side
4# sees, one action and one grenade.
5
6play "thrown at (4, 0): 3 to the trooper there, the one diagonal and the soldier beside, none to one 2 away"
7 make squad Side
8 make aliens Side
9 make s Soldier with team = squad at 0 0
10 make ally Soldier with team = squad at 3 1
11 make a Trooper with team = aliens at 4 0
12 make b Trooper with team = aliens at 5 1
13 make c Trooper with team = aliens at 6 0
14 act s Grenade at 4 0
15 expect refused Requirement "can't see there"
16 fact Seen s 4 0
17 act s Grenade at 4 0
18 expect done
19 expect a.Health = 2 from content: the trooper's 5 less 3, at the point
20 expect b.Health = 2 from content: 5 - 3, about 1.41 away, inside 1.5
21 expect ally.Health = 4 from content: the soldier's 7 less 3, about 1.41 away: friends too
22 expect c.Health = 5 from content: 2 away, past 1.5
23 expect s.Health = 7 from content: the thrower is 4 away
24 expect s.Grenades = 0 from content: 1 less the throw's 1
25 expect s.Actions = 0 from content: 1 less the throw's 1
27play "7 away is past the throw's 6; the thrower in its own blast takes 3"
28 make squad Side
29 make s Soldier with team = squad at 0 0
30 fact Seen s 7 0
31 fact Seen s 1 0
32 act s Grenade at 7 0
33 expect refused OutOfReach
34 save
35 act s Grenade at 1 0
36 expect done
37 expect s.Health = 4 from content: the soldier's 7 less 3, 1 from the point

Run it yourself

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