Prev: B7A8 Up: Map Next: B810
B7BC: Carry Bomb
Stick the bomb to Jetman, or on action drop it with his current X speed and play SoundsDropItem.
Input
IX Actor slot
Stick the bomb to Jetman, or drop it on action.
CarryBomb B7BC CALL TestActionKey Call TestActionKey.
B7BF JR NZ,CarryBomb_TestDrop Jump to CarryBomb_TestDrop if action is pressed.
B7C1 RES 7,(IX+$08) Reset bit 7 of the actor flags.
Keep the bomb under Jetman.
CarryBomb_Loop B7C5 LD HL,($607A) Fetch Jetman_Position.
B7C8 LD (IX+$02),L Write the low world X.
B7CB LD (IX+$03),H Write the high world X.
B7CE LD A,($607C) Fetch Jetman_Y.
B7D1 ADD A,$10 Add 10.
B7D3 CP $AF Jump to CarryBomb_WriteY if it is still above the ground line.
B7D5 JR C,CarryBomb_WriteY
AF is the ground line.
B7D7 LD A,$AF A=AF.
CarryBomb_WriteY B7D9 LD (IX+$04),A Write the actor Y.
B7DC JR CollectBomb_Loop Jump to CollectBomb_Loop.
Drop the bomb, throwing it with a share of Jetman's speed unless it is on the ground line.
CarryBomb_TestDrop B7DE BIT 7,(IX+$08) Jump to CarryBomb_Loop if bit 7 of the actor flags is set.
B7E2 JR NZ,CarryBomb_Loop
B7E4 LD A,(IX+$04) Fetch the actor Y.
B7E7 CP $AF Jump to CarryBomb_OnGround if it is on the ground line.
B7E9 JR Z,CarryBomb_OnGround
Mark the bomb as thrown with a share of Jetman's speed.
B7EB LD (IX+$08),$82 Write 82 to the actor flags.
B7EF LD A,($607D) Fetch Jetman_Speed.
B7F2 SRA A Divide it by 10.
B7F4 SRA A
B7F6 SRA A
B7F8 SRA A
B7FA LD (IX+$05),A Write it as the bomb speed.
Clear bit 0 of Jetman's flags and play the drop sound.
CarryBomb_ClearCarrying B7FD LD A,($6080) Fetch Jetman_Flags.
B800 AND %11111110 Clear bit 0.
B802 LD ($6080),A Write it back.
B805 CALL SoundsDropItem Call SoundsDropItem.
B808 JR CollectBomb_Loop Jump to CollectBomb_Loop.
CarryBomb_OnGround B80A LD (IX+$08),$80 Write 80 to the actor flags.
B80E JR CarryBomb_ClearCarrying Jump to CarryBomb_ClearCarrying.
Prev: B7A8 Up: Map Next: B810