Ledger v3 · C# · Godot 4.7 Get started

Stun

A stun: no casting, a running windup stopped, no walking

✓ 2 plays, 29 steps, all passingFrom ARPG, content\arena.ledger, content\enemies.ledger
blocks Activate by holderMoveSpeed x 0stack refresh

A stun, lifted from the ARPG slice's content\arena.ledger (Stunned) and the caster's hex that lays it from content\enemies.ledger (Hex). A stunned actor casts nothing, a windup it has running stops Blocked, and it walks nowhere: the game reads MoveSpeed each frame, so the stun reaches the feet through the stat. A stun more starts its second again.

content/cookbook/mechanics/stun.ledgerthe content
1# A stun, lifted from the ARPG slice's content\arena.ledger (Stunned) and the caster's hex that lays it from
2# content\enemies.ledger (Hex). A stunned actor casts nothing, a windup it has running stops Blocked, and it walks
3# nowhere: the game reads MoveSpeed each frame, so the stun reaches the feet through the stat. A stun more starts its
4# second again.
5
6rate 60
7stat MaxHealth
8stat MoveSpeed
9pool Health max MaxHealth
10damage Health
11link team
12allegiance team
13tags Unit Spell Stun
15effect Stunned
16 tags Stun
17 stack refresh
18 lasts 1s
19 blocks Activate by holder
20 MoveSpeed x 0
22ability Hex
23 tags Spell
24 target one enemy having Unit within 11
25 cooldown 4s
26 windup 1.5s
27 broken by Damage of holder when event.landed >= 20
28 deal 15 to target
29 apply Stunned to target
31archetype Side
33archetype Caster
34 tags Unit
35 base MaxHealth 35
36 base MoveSpeed 3
37 full Health
38 grants Hex
content/cookbook/mechanics/stun.playwhat it must do
1catalog stun.ledger
2
3# The stun's numbers, from Stunned and Hex: a 1.5 s windup, 15 and a 1 s stun. Two casters of sides r and b stand
4# 5 apart.
5
6play "hexed: at 1.5 s, 15 and a stun; stunned, it can't walk or cast, and a second later it can"
7 make r Side
8 make b Side
9 make a Caster with team = r at 0 0
10 make t Caster with team = b at 5 0
11 act a Hex at t
12 expect done
13 advance 1.5s
14 expect t.Health = 20 from content: the Caster's 35 less Hex's 15
15 expect t has Stunned
16 expect t.MoveSpeed = 0 from content: Stunned's MoveSpeed x 0
17 act t Hex at a
18 expect refused Blocked
19 save
20 advance 1s
21 expect t lacks Stunned
22 expect t.MoveSpeed = 3 from content: the Caster's base 3, the stun gone
23 act t Hex at a
24 expect done
26play "a stun mid-windup stops it Blocked, and nothing lands"
27 make r Side
28 make b Side
29 make a Caster with team = r at 0 0
30 make t Caster with team = b at 5 0
31 act a Hex at t
32 expect done
33 advance 0.5s
34 apply Stunned to a
35 expect a stopped Hex Blocked
36 advance 1.5s
37 expect t.Health = 35 from content: the Caster's 35, nothing landed

Run it yourself

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