Arrows
Taking an arrow out of the air, a flight as an actor.
v2's cookbook, taking an arrow out of the air (G264-G265). An arrow is an actor and its flight an effect lasting its distance over its speed, so its landing is the flight's end (DESIGN.md, challenge 1). The game reports an arrow it draws crossing a wall; a deflection turns the flight back from where the arrow is, and its hit is the deflector's.
1
# v2's cookbook, taking an arrow out of the air (G264-G265). An arrow is an actor and its flight an effect lasting its2
# distance over its speed, so its landing is the flight's end (DESIGN.md, challenge 1). The game reports an arrow it3
# draws crossing a wall; a deflection turns the flight back from where the arrow is, and its hit is the deflector's.5
rate 606
stat MaxHealth7
stat Armor8
pool Health max MaxHealth9
pool Charges max 310
pool Payload11
damage Health12
link owner13
link victim14
tags Physical15
event Arrived Crossed17
effect Flight18
lasts 1s * distance(holder.owner, holder.victim) / 1019
expire20
raise Arrived of holder.victim by holder22
effect Arrowhead23
after Arrived by holder24
deal holder.Payload Physical to event.subject from holder.owner25
destroy holder27
archetype Arrow28
pools Payload29
has Flight30
has Arrowhead32
ability Loose33
target one within 10034
create Arrow with owner = holder, victim = target, Payload = 1036
archetype Archer37
base MaxHealth 10038
full Health39
grants Loose41
# ---- G264 the wind wall: each arrow the game says crossed it is taken out of the air, no hit and no miss, a charge42
# each; the third takes the wall ----44
effect WindWall45
after Crossed of holder46
destroy event.source47
lose Charges 148
after Depleted Charges of holder49
destroy holder51
archetype Wall52
full Charges53
has WindWall55
# ---- G265 deflecting: an arrow arriving is turned back at its shooter, flying from here, its hit the deflector's; each56
# turn-back is 5 armour for 10 seconds, refreshed by the next ----58
effect Deflecting59
before Arrived of holder credit holder60
prevent61
set link victim on event.source to event.source.owner62
set link owner on event.source to holder63
apply Flight to event.source64
apply Guarded66
effect Guarded67
stack refresh68
lasts 10s69
Armor + 51
catalog arrows.ledger2
row G264 Flight Arrowhead WindWall Loose Arrow Archer Wall3
row G265 Flight Arrowhead Deflecting Guarded Loose Arrow Archer5
play G264 "Four arrows fly 10 paces a second at an archer 50 off; a wind wall halfway takes each the game says crossed it out of the air, a charge each, and goes with its third; the fourth lands for 10. An arrow taken already is taken again for nothing"6
make s Archer at 07
make t Archer at 508
make w Wall at 259
act s Loose at t10
find a1 Arrow11
act s Loose at t12
find a2 Arrow13
act s Loose at t14
find a3 Arrow15
act s Loose at t16
find a4 Arrow17
advance 2.5s18
raise Crossed of w by a119
expect a1 gone20
expect w.Charges = 2 from G264: "three charges" - count "Crossed of w"21
raise Crossed of w by a222
save23
raise Crossed of w by a324
expect w gone25
advance 2.5s26
expect t.Health = 90 from content: G264 gives no health and leaves open whether a hit due exactly as the 5 s run out counts; the content lands it, 10 off its 10027
expect a4 gone28
destroy a129
expect already31
play G265 "Deflecting, an archer 30 off turns each arrow back as it arrives, 3 seconds out and 3 back, and it lands on its shooter for 10, the deflector's; each turn-back is 5 armour for 10 seconds, the second refreshing it"32
make s Archer at 033
make d Archer at 3034
apply Deflecting to d35
act s Loose at d36
advance 1s37
act s Loose at d38
advance 2s39
expect d.Health = 100 from G265: d.Health40
expect d.Armor = 5 from G265: "5 armor"41
expect d remaining Guarded = 10s from G265: "for 10 s"42
save43
advance 1s44
expect d remaining Guarded = 10s from G265: "for 10 s"45
advance 2s46
expect s.Health = 90 from G265: s.Health - "for 10 damage"47
expect event Change of s credited to d tagged Damage48
advance 1s49
expect s.Health = 80 from G265: s.Health - count "s Loose at d" * "for 10 damage"Run it yourself
ledger check content/cookbook/arrows.ledger content/cookbook/arrows.play
ledger play content/cookbook/arrows.play