Prev: B6EB Up: Map Next: B731
B6EC: Handler: Armed Bomb
Animate the bomb and, on action, collect it and play SoundsTakeObject.
Input
IX Actor slot
Animate the bomb and test the action key.
Handler_ArmedBomb B6EC CALL Handler_Bomb Call Handler_Bomb.
B6EF CALL TestActionKey Call TestActionKey.
B6F2 JR NZ,Handler_ArmedBomb_TestRover Jump to Handler_ArmedBomb_TestRover if action is pressed.
B6F4 RES 7,(IX+$08) Reset bit 7 of the actor flags.
Collect the bomb when the rover type is in 1A-29.
Handler_ArmedBomb_TestRover B6F8 LD A,($6090) Fetch Rover_Slot.
B6FB SUB $1A Subtract 1A.
B6FD CP $10 Compare it with 10.
B6FF JR NC,Handler_ArmedBomb_HangBeside Jump to Handler_ArmedBomb_HangBeside if it is out of range.
B701 CALL TestJetmanAction Call TestJetmanAction.
B704 JR NC,Handler_ArmedBomb_DrawHeld Jump to Handler_ArmedBomb_DrawHeld if Jetman cannot collect it.
Mark the bomb as carried and play the take sound.
B706 LD (IX+$08),$81 Write 81 to the actor flags.
B70A LD A,($6080) Fetch Jetman_Flags.
B70D OR %00000001 Set bit 0.
B70F LD ($6080),A Write it back.
B712 XOR A Write 00 to RoverCargoFlag.
B713 LD ($5EA3),A
B716 CALL SoundsTakeObject Call SoundsTakeObject.
Handler_ArmedBomb_DrawHeld B719 JP Handler_HeldObject_Loop Jump to Handler_HeldObject_Loop.
Hang the bomb beside Jetman. Type 16 and above is seated facing right; hang it on the left.
Handler_ArmedBomb_HangBeside B71C LD A,($6078) Fetch Jetman_Slot.
B71F CP $16 Compare it with 16.
B721 JR C,Handler_ArmedBomb_OnFootOffset Jump to Handler_ArmedBomb_OnFootOffset if it is lower.
B723 LD BC,$FFF4 Set the offset in BC to FFF4 (-0C).
Handler_ArmedBomb_Loop B726 LD HL,($607A) Fetch Jetman_Position.
B729 JP Handler_HeldObject_WriteX Jump to Handler_HeldObject_WriteX.
Handler_ArmedBomb_OnFootOffset B72C LD BC,$0012 Set the offset in BC to 0012.
B72F JR Handler_ArmedBomb_Loop Jump to Handler_ArmedBomb_Loop.
Prev: B6EB Up: Map Next: B731