Pickup
A pickup walked over, its gift taken and it gone
auraafter Enterevent.sourcetemplate effecttemplate archetypeA 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.
1
# A pickup walked over, lifted from the ARPG slice's content\pickups.ledger (Lying and Pickup, two of its kinds), with2
# the gifts from content\arena.ledger (Hasted) and content\slice2.ledger (Coin). A pickup is an actor on the floor3
# whose area a picker enters; entering, the picker takes the gift and the pickup goes. One template makes each kind4
# from its gift. The game lays and draws it.6
rate 607
stat MoveSpeed8
pool Gold9
link team10
allegiance team11
tags Unit Picker13
effect Hasted14
stack refresh15
lasts 6s16
MoveSpeed + 30%18
effect Coin19
lasts 0.1s20
start21
gain Gold 523
effect Near25
template effect Lying(gift)26
aura Near on all having Picker within 1.227
after Enter28
apply gift to event.source29
destroy holder31
effect LyingHasted from Lying(Hasted)32
effect LyingCoin from Lying(Coin)34
template archetype Pickup(lying)35
has lying37
archetype HastedPickup from Pickup(LyingHasted)38
archetype CoinPickup from Pickup(LyingCoin)40
archetype Side42
archetype Hero43
tags Unit Picker44
base MoveSpeed 645
pools Gold1
catalog pickup.ledger3
# 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).5
play "a haste pickup at (5, 0) is passed by 3 off; walked onto, it gives Hasted and goes"6
make r Side7
make h Hero with team = r at 0 08
make p HastedPickup at 5 09
place h 2 010
expect h lacks Hasted11
place h 4.5 012
expect h has Hasted13
expect h.MoveSpeed = 7.8 from content: the Hero's 6 and Hasted's 30%14
expect p gone16
play "a coin walked onto gives 5 Gold; a second, once the first's 0.1 s gift is gone, 5 more"17
make r Side18
make h Hero with team = r at 0 019
make p CoinPickup at 5 020
make q CoinPickup at 10 021
place h 5 022
expect h.Gold = 5 from content: Coin's gain Gold 523
expect p gone24
save25
advance 0.1s26
expect h lacks Coin27
place h 10 028
expect h.Gold = 10 from content: 5 and the second coin's 529
expect q goneRun it yourself
ledger check content/cookbook/mechanics/pickup.ledger content/cookbook/mechanics/pickup.play
ledger play content/cookbook/mechanics/pickup.play