Prev: 45592 Up: Map Next: 45783
45730: Test Jetman Range
Return carry if this actor is touching Jetman. This entry uses a vertical range of 14; TickThenExplode_TestJetman takes the range in E. Carry is clear while the delay timer at GameDelayTimer is running or Jetman's type is 17 or above.
Input
IX Actor slot
TickThenExplode_CloseRange 45730 LD E,14 E=14.
Return carry if this actor is close enough to Jetman. Type 17 and above means Jetman is not on foot.
TickThenExplode_TestJetman 45732 LD A,(24167) Fetch GameDelayTimer.
45735 AND A Return if the delay timer is still running.
45736 RET NZ
45737 LD A,(24696) Fetch Jetman_Slot.
45740 CP 17 Return if Jetman's type is at least 17.
45742 RET NC
Test the horizontal distance to Jetman.
45743 LD L,(IX+2) Fetch the actor world X.
45746 LD H,(IX+3) Fetch the high byte.
45749 LD BC,8 Add an 8 box offset.
45752 ADD HL,BC
45753 LD BC,(24698) Fetch Jetman_Position.
45757 AND A Clear the carry flag.
45758 SBC HL,BC Subtract Jetman's world X.
45760 LD A,H Fetch the high byte of the difference.
45761 AND %00011111 Keep only bits 0-4.
45763 RET NZ Return if they are on different screens.
45764 LD A,L Fetch the low byte.
45765 CP 16 Return if it is at least 16.
45767 RET NC
Work out the vertical gap to Jetman.
45768 LD A,(24700) Fetch Jetman_Y.
45771 SUB 4 Subtract 4.
45773 SUB (IX+4) Subtract the actor Y.
A is (Jetman's Y minus 4) minus this actor's Y. Keep that gap as a positive distance, then compare it with E.
See Immunity.
TickThenExplode_TestHeight 45776 JP P,TickThenExplode_Compare Jump to TickThenExplode_Compare if Jetman is at or below this actor.
45779 NEG Else make the vertical gap positive.
See Immunity.
TickThenExplode_Compare 45781 CP E Return. Carry is set when the gap is smaller than E.
45782 RET
Prev: 45592 Up: Map Next: 45783