Prev: 44599 Up: Map Next: 44828
44664: Spawn Missile
Copy the left-facing missile and flame templates at Missile_Object_Template (or the right-facing pair at Missile_Object_Template_2, entered at Handler_Missile_CopyTemplate2) into Object_Slot_1 and place them at this actor. The hit count is the level plus 8 (up to 99). Then jump to ShowLaserEstimate to show the laser estimate, unless 24946 is non-zero or Jetman's type is 42 or above with no lives left.
Input
IX Actor slot
Copy the 160 template into Object_Slot_1.
Handler_Missile_CopyTemplate 44664 LD HL,44732 HL=Missile_Object_Template.
Handler_Missile_FillObjectSlots 44667 LD DE,24840 DE=Object_Slot_1.
44670 LD BC,48 Copy the 48-byte template into the object slots.
44673 LDIR
Place the missile at this actor's X, and 12 above its Y.
44675 LD L,(IX+2) Fetch the actor world X.
44678 LD H,(IX+3) Fetch the high byte.
44681 LD (24842),HL Write it to 24842.
44684 LD A,(IX+4) Fetch the actor Y.
44687 SUB 12 Subtract 12.
44689 LD (24844),A Write it to 24844.
Set the hit count to the level plus 8, up to 99.
44692 LD A,(24224) Fetch ActivePlayer_Level.
44695 ADD A,8 Add 8.
44697 CP 99 Jump to Handler_Missile_WriteHitCount if that is less than 99.
44699 JR C,Handler_Missile_WriteHitCount
44701 LD A,99 A=99.
Handler_Missile_WriteHitCount 44703 LD (24862),A Write it to 24862.
Decide whether to show the laser estimate at ShowLaserEstimate.
44706 LD A,(24946) Fetch 24946.
44709 AND A Return if it is not zero.
44710 RET NZ
44711 LD A,(24225) Fetch ActivePlayer_Lives.
44714 AND A Jump to ShowLaserEstimate if any lives remain.
44715 JP NZ,ShowLaserEstimate
44718 LD A,(24696) Fetch Jetman_Slot.
44721 CP 42 Return if Jetman's type is at least 42.
44723 RET NC
44724 JP ShowLaserEstimate Jump to ShowLaserEstimate.
This entry point is used by the routine at Handler_MissileSpawner.
Handler_Missile_CopyTemplate2 44727 LD HL,44780 HL=Missile_Object_Template_2.
44730 JR Handler_Missile_FillObjectSlots Jump to Handler_Missile_FillObjectSlots.
Missile_Object_Template 44732 DEFB 160,0,0,0,0,253,0,70
44740 DEFB 0,0,0,0,0,0,0,0
44748 DEFB 0,0,0,0,0,0,0,0
44756 DEFB 162,0,0,0,0,0,0,66
44764 DEFB 0,0,0,0,0,0,0,0
44772 DEFB 0,0,0,0,0,0,0,0
Missile_Object_Template_2 44780 DEFB 164,0,0,0,0,3,0,70
44788 DEFB 0,0,0,0,0,0,0,0
44796 DEFB 0,0,0,0,0,0,0,0
44804 DEFB 166,0,0,0,0,0,0,66
44812 DEFB 0,0,0,0,0,0,0,0
44820 DEFB 0,0,0,0,0,0,0,0
Prev: 44599 Up: Map Next: 44828