Prev: 8FCF Up: Map Next: 903C
8FE0: SHOOT
The shooter must be carrying the bow (object 25): otherwise 'you are not carrying the bow.' Then, if it would work, it is treated as an attack.
Anyone except Bard: the dragon cannot be hit at all ('the arrow misses the dragon by a wide margin'), and anyone else is missed if a random number from 0 to 8 (9BF4) is below 3.
Bard (object 70) never misses. On a hit the arrow (object 26) is left lying where it fell, 'the arrow hits X.', and a living target is killed outright (96DD); anything else is broken (9257).
So the only way to kill the dragon is to get Bard to shoot it - which is what the HELP message in the lower halls means by 'look to bard'.
8FE0 LD A,$19 Is the actor holding the bow (object 25)?
8FE2 CALL $9BD0
8FE5 LD HL,$B013 "you are not carrying the bow."
8FE8 JP NC,$72D4 If not, say so and stop
8FEB CALL $90B4 Check the target is something that can be attacked at all
8FEE CALL $9C99 Dry run? Then stop here: it would work
8FF1 LD A,$0F Treat this as an ordinary attack from now on
8FF3 LD ($B5D8),A
8FF6 LD A,($B5DB) Is the actor Bard himself?
8FF9 CP $46
8FFB JR Z,$9012 Yes: Bard never misses - skip the ordinary chance-to-miss below
8FFD LD A,($B5D9) No: is the target the dragon?
9000 CP $3C
9002 LD HL,$B019 "the arrow misses the dragon by a wide margin."
9005 JP Z,$72D4 Against the dragon, anyone but Bard always misses
9008 LD A,$08 Anyone else: pick a random number from 0 to 8
900A CALL $9BF4
900D CP $03 Below 3?
900F JP C,$72D4 Yes: the shot misses (HL still holds the "misses" message)
9012 LD IX,$C3D9 IX = the arrow's own record
9016 LD A,($B5D9) Is the target the strong arrow itself (an odd edge case)?
9019 CP $1A
901B JR Z,$9021
901D LD (IX+$01),$FF Otherwise the arrow falls to the ground, held by nobody
9021 LD HL,$B028 "the arrow hits X."
9024 CALL $72D4
9027 LD IX,($B5F8) IX = the target's own record
902B CALL $A0F8 Is the target actually alive?
902E JP NZ,$9257 No: break it instead (STRIKE)
9031 LD A,($B5D9) Yes: kill it outright
9034 CALL $96DD
9037 LD A,$06 A = the state code for DEAD
9039 JP $A09C "the X is dead."
Prev: 8FCF Up: Map Next: 903C