Ledger v3 · C# · Godot 4.7 Get started

Pickup

A pickup walked over, its gift taken and it gone

✓ 2 plays, 22 steps, all passingFrom ARPG, content\pickups.ledger
auraafter Enterevent.sourcetemplate effecttemplate archetype

A pickup walked over, lifted from the ARPG slice's content\pickups.ledger (Lying and Pickup, two of its kinds), with the gifts from content\arena.ledger (Hasted) and content\slice2.ledger (Coin). A pickup is an actor on the floor whose area a picker enters; entering, the picker takes the gift and the pickup goes. One template makes each kind from its gift. The game lays and draws it.

content/cookbook/mechanics/pickup.ledgerthe content
1# A pickup walked over, lifted from the ARPG slice's content\pickups.ledger (Lying and Pickup, two of its kinds), with
2# the gifts from content\arena.ledger (Hasted) and content\slice2.ledger (Coin). A pickup is an actor on the floor
3# whose area a picker enters; entering, the picker takes the gift and the pickup goes. One template makes each kind
4# from its gift. The game lays and draws it.
5
6rate 60
7stat MoveSpeed
8pool Gold
9link team
10allegiance team
11tags Unit Picker
13effect Hasted
14 stack refresh
15 lasts 6s
16 MoveSpeed + 30%
18effect Coin
19 lasts 0.1s
20 start
21 gain Gold 5
23effect Near
25template effect Lying(gift)
26 aura Near on all having Picker within 1.2
27 after Enter
28 apply gift to event.source
29 destroy holder
31effect LyingHasted from Lying(Hasted)
32effect LyingCoin from Lying(Coin)
34template archetype Pickup(lying)
35 has lying
37archetype HastedPickup from Pickup(LyingHasted)
38archetype CoinPickup from Pickup(LyingCoin)
40archetype Side
42archetype Hero
43 tags Unit Picker
44 base MoveSpeed 6
45 pools Gold
content/cookbook/mechanics/pickup.playwhat it must do
1catalog pickup.ledger
2
3# The pickups' numbers, from Lying's reach of 1.2, Hasted's 30% and Coin's 5 Gold. A hero of side r starts at (0, 0).
4
5play "a haste pickup at (5, 0) is passed by 3 off; walked onto, it gives Hasted and goes"
6 make r Side
7 make h Hero with team = r at 0 0
8 make p HastedPickup at 5 0
9 place h 2 0
10 expect h lacks Hasted
11 place h 4.5 0
12 expect h has Hasted
13 expect h.MoveSpeed = 7.8 from content: the Hero's 6 and Hasted's 30%
14 expect p gone
16play "a coin walked onto gives 5 Gold; a second, once the first's 0.1 s gift is gone, 5 more"
17 make r Side
18 make h Hero with team = r at 0 0
19 make p CoinPickup at 5 0
20 make q CoinPickup at 10 0
21 place h 5 0
22 expect h.Gold = 5 from content: Coin's gain Gold 5
23 expect p gone
24 save
25 advance 0.1s
26 expect h lacks Coin
27 place h 10 0
28 expect h.Gold = 10 from content: 5 and the second coin's 5
29 expect q gone

Run it yourself

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