Prev: 46827 Up: Map Next: 46897
46828: 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 46828 CALL Handler_Bomb Call Handler_Bomb.
46831 CALL TestActionKey Call TestActionKey.
46834 JR NZ,Handler_ArmedBomb_TestRover Jump to Handler_ArmedBomb_TestRover if action is pressed.
46836 RES 7,(IX+8) Reset bit 7 of the actor flags.
Collect the bomb when the rover type is in 26-41.
Handler_ArmedBomb_TestRover 46840 LD A,(24720) Fetch Rover_Slot.
46843 SUB 26 Subtract 26.
46845 CP 16 Compare it with 16.
46847 JR NC,Handler_ArmedBomb_HangBeside Jump to Handler_ArmedBomb_HangBeside if it is out of range.
46849 CALL TestJetmanAction Call TestJetmanAction.
46852 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.
46854 LD (IX+8),129 Write 129 to the actor flags.
46858 LD A,(24704) Fetch Jetman_Flags.
46861 OR %00000001 Set bit 0.
46863 LD (24704),A Write it back.
46866 XOR A Write 0 to RoverCargoFlag.
46867 LD (24227),A
46870 CALL SoundsTakeObject Call SoundsTakeObject.
Handler_ArmedBomb_DrawHeld 46873 JP Handler_HeldObject_Loop Jump to Handler_HeldObject_Loop.
Hang the bomb beside Jetman. Type 22 and above is seated facing right; hang it on the left.
Handler_ArmedBomb_HangBeside 46876 LD A,(24696) Fetch Jetman_Slot.
46879 CP 22 Compare it with 22.
46881 JR C,Handler_ArmedBomb_OnFootOffset Jump to Handler_ArmedBomb_OnFootOffset if it is lower.
46883 LD BC,65524 Set the offset in BC to 65524 (-12).
Handler_ArmedBomb_Loop 46886 LD HL,(24698) Fetch Jetman_Position.
46889 JP Handler_HeldObject_WriteX Jump to Handler_HeldObject_WriteX.
Handler_ArmedBomb_OnFootOffset 46892 LD BC,18 Set the offset in BC to 0018.
46895 JR Handler_ArmedBomb_Loop Jump to Handler_ArmedBomb_Loop.
Prev: 46827 Up: Map Next: 46897