Prev: 44377 Up: Map Next: 44522
44459: Handler: Upward Missile
Fly an upward missile (types 128 and 132) by its speed and thrust. It explodes when it touches Jetman or is shot, or once its Y is less than 60.
Input
IX Actor slot
Fly the missile, or explode it on a hit.
Handler_UpwardMissile 44459 CALL TickThenExplode_CloseRange Call TickThenExplode_CloseRange.
44462 JR C,Handler_Missile_HitJetman Jump to Handler_Missile_HitJetman if Jetman is in range.
44464 BIT 0,(IX+16) Jump to Handler_Missile_AwardPoints if bit 0 of the explode flag is set.
44468 JR NZ,Handler_Missile_AwardPoints
Move the missile along by its speed and thrust.
44470 LD L,(IX+2) Fetch the actor world X.
44473 LD H,(IX+3) Fetch the high byte.
44476 LD B,0 Clear B.
44478 LD A,(IX+5) Fetch the actor speed.
44481 LD C,A Copy it into C.
44482 AND A Jump to Handler_Missile_AddSpeed if the speed is positive.
44483 JP P,Handler_Missile_AddSpeed
44486 DEC B Sign-extend into B.
Handler_Missile_AddSpeed 44487 ADD HL,BC Add the speed to the world X.
44488 LD (IX+2),L Write the low byte back.
44491 LD (IX+3),H Write the high byte back.
Move the missile along its Y by the thrust.
44494 LD A,(IX+4) Fetch the actor Y.
44497 ADD A,(IX+6) Add the thrust.
44500 LD (IX+4),A Write it back.
Explode the missile once it has flown above Y 60, otherwise draw it.
44503 CP 60 Jump to Handler_Missile_Explode if the Y is less than 60.
44505 JR C,Handler_Missile_Explode
44507 JP DrawCurrentActor_Draw Jump to DrawCurrentActor_Draw.
Handler_Missile_HitJetman 44510 CALL TickThenExplode_KillJetman Call TickThenExplode_KillJetman.
Destroying the missile adds 1280 points.
Handler_Missile_AwardPoints 44513 LD BC,1280 Set the points to award in BC to 1280.
44516 CALL AddPointsToScore Call AddPointsToScore.
Handler_Missile_Explode 44519 JP StartExplosion_SetSprite Jump to StartExplosion_SetSprite.
Prev: 44377 Up: Map Next: 44522