Prev: B218 Up: Map Next: B2D7
B2A2: Test Jetman Range
Return carry if this actor is touching Jetman. This entry uses a vertical range of 0E; TickThenExplode_TestJetman takes the range in E. Carry is clear while the delay timer at GameDelayTimer is running or Jetman's type is 11 or above.
Input
IX Actor slot
TickThenExplode_CloseRange B2A2 LD E,$0E E=0E.
Return carry if this actor is close enough to Jetman. Type 11 and above means Jetman is not on foot.
TickThenExplode_TestJetman B2A4 LD A,($5E67) Fetch GameDelayTimer.
B2A7 AND A Return if the delay timer is still running.
B2A8 RET NZ
B2A9 LD A,($6078) Fetch Jetman_Slot.
B2AC CP $11 Return if Jetman's type is at least 11.
B2AE RET NC
Test the horizontal distance to Jetman.
B2AF LD L,(IX+$02) Fetch the actor world X.
B2B2 LD H,(IX+$03) Fetch the high byte.
B2B5 LD BC,$0008 Add an 08 box offset.
B2B8 ADD HL,BC
B2B9 LD BC,($607A) Fetch Jetman_Position.
B2BD AND A Clear the carry flag.
B2BE SBC HL,BC Subtract Jetman's world X.
B2C0 LD A,H Fetch the high byte of the difference.
B2C1 AND %00011111 Keep only bits 0-4.
B2C3 RET NZ Return if they are on different screens.
B2C4 LD A,L Fetch the low byte.
B2C5 CP $10 Return if it is at least 10.
B2C7 RET NC
Work out the vertical gap to Jetman.
B2C8 LD A,($607C) Fetch Jetman_Y.
B2CB SUB $04 Subtract 04.
B2CD SUB (IX+$04) Subtract the actor Y.
A is (Jetman's Y minus 04) minus this actor's Y. Keep that gap as a positive distance, then compare it with E.
See Immunity.
TickThenExplode_TestHeight B2D0 JP P,TickThenExplode_Compare Jump to TickThenExplode_Compare if Jetman is at or below this actor.
B2D3 NEG Else make the vertical gap positive.
See Immunity.
TickThenExplode_Compare B2D5 CP E Return. Carry is set when the gap is smaller than E.
B2D6 RET
Prev: B218 Up: Map Next: B2D7