Prev: 8FD6 Up: Map Next: 9030
8FF5: THROW AT
Throwing something at a character is attacking the character with it, and at anything else striking it with it: the two objects are swapped and ATTACK WITH or STRIKE WITH is run (SWAPPED_OBJECTS). Done for real, the thrown thing lands, held by nothing, and the target reacts as to an attack.
DO_THROW_AT 8FF5 CALL CAN_LIFT Can it be lifted to throw?
8FF8 LD HL,DO_ATTACK At a character: ATTACK WITH; at a thing: STRIKE WITH
8FFB LD A,$0F
8FFD LD IX,(INSTRUMENT_RECORD)
9001 BIT 6,(IX+$07)
9005 JR NZ,DO_THROW_AT_0
9007 LD HL,DO_STRIKE
900A LD A,$0B
DO_THROW_AT_0 900C LD (ACTION),A Run it, the objects swapped
900F CALL SWAPPED_OBJECTS
9012 LD A,$2A Only a test: done
9014 LD (ACTION),A
9017 LD A,(DOING_IT)
901A CP $01
901C RET NZ
901D LD IX,(TARGET_RECORD) It lands, held by nothing
9021 LD (IX+$01),$FF
9025 LD A,$0F And the target reacts as to an attack
9027 LD (ACTION),A
902A LD A,(TARGET)
902D JP REACT_TO_ACTION
Prev: 8FD6 Up: Map Next: 9030