Ledger v3 · C# · Godot 4.7 Get started

Fuse

Charges that come back, and a grenade on a fuse

✓ 2 plays, 29 steps, all passingFrom Shooter, content\grenade.ledger
pool ... refill N every Dtarget directionflies ... landsof projectile

Charges that come back, and a throw on a fuse, lifted from the shooter slice's content\grenade.ledger (the Grenade ability and its archetype) and the player's charges from content\player.ledger (the Grenades pool). The player holds three grenades, one back every 4 seconds. Thrown along the aim, a grenade blows up on its 1.5 second fuse: 40 to every foe within 3 of where it lies, credited to its thrower. The game throws it as a body and tells the world its place each tick; the world's radius sees no walls.

content/cookbook/mechanics/fuse.ledgerthe content
1# Charges that come back, and a throw on a fuse, lifted from the shooter slice's content\grenade.ledger (the Grenade
2# ability and its archetype) and the player's charges from content\player.ledger (the Grenades pool). The player holds
3# three grenades, one back every 4 seconds. Thrown along the aim, a grenade blows up on its 1.5 second fuse: 40 to every
4# foe within 3 of where it lies, credited to its thrower. The game throws it as a body and tells the world its place
5# each tick; the world's radius sees no walls.
6
7rate 60
8stat MaxHealth
9pool Health max MaxHealth
10pool Grenades max 3 whole refill 1 every 4s
11damage Health
12link team owner
13allegiance team
14tags Unit Blast
16ability Grenade
17 target direction
18 cost Grenades 1
19 cooldown 0.5s
20 flies Grenade up to 1.5s
21 lands
22 deal 40 Blast to all enemies having Unit within 3 of projectile
24archetype Grenade
26archetype Side
28archetype Player
29 tags Unit
30 base MaxHealth 100
31 full Health Grenades
32 grants Grenade
34archetype Dummy
35 tags Unit
36 base MaxHealth 1000
37 full Health
content/cookbook/mechanics/fuse.playwhat it must do
1catalog fuse.ledger
2
3# The grenade's numbers, from Grenade (a 1.5 s fuse, 40 within 3) and the Grenades pool (3, one back every 4 s). A
4# player of side r at 0 throws east; the game places the grenade where its body lies.
5
6play "thrown: on its fuse at 1.5 s it blows 40 into a foe 2 from where it lies, and none into one 4 off"
7 make r Side
8 make b Side
9 make h Player with team = r at 0
10 make d Dummy with team = b at 7
11 make far Dummy with team = b at 9
12 act h Grenade toward 1 0 as g projectile nade
13 expect done
14 expect h.Grenades = 2 from content: 3 less the throw's 1
15 place nade 5
16 advance 1.4s
17 expect d.Health = 1000 from content: the fuse's 1.5 s not through
18 save
19 advance 0.1s
20 expect d.Health = 960 from content: 1000 less 40, 2 from where it lay
21 expect far.Health = 1000 from content: 4 from it, past 3
22 expect event Change of d credited to h tagged Blast
24play "three thrown empty the charges; one comes back 4 s on"
25 make r Side
26 make h Player with team = r at 0
27 act h Grenade toward 1 0
28 advance 0.5s
29 act h Grenade toward 1 0
30 advance 0.5s
31 act h Grenade toward 1 0
32 advance 0.5s
33 act h Grenade toward 1 0
34 expect refused CannotAfford
35 expect h.Grenades = 0 from content: 3 less three throws
36 advance 2.5s
37 expect h.Grenades = 1 from content: one back 4 s after the first throw

Run it yourself

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