Prev: 45341 Up: Map Next: 45423
45352: Handler: Alien Base Plasma
Handle the alien base plasma (types 144-151). Jump to Handler_Missile_ExplodeObjects when it is close enough to its target (Handler_Missile_TestJetmanRange). Otherwise kill Jetman if he is close (TickThenExplode_KillJetman), try to spawn a linked 200 object (SpawnLinkedObject), step the frame through 144-151 and colour the sprite.
Input
IX Actor slot
Handler_AlienBasePlasma 45352 CALL Handler_Missile_TestJetmanRange Call Handler_Missile_TestJetmanRange.
45355 JP C,Handler_Missile_ExplodeObjects Jump to Handler_Missile_ExplodeObjects if this actor is in range.
45358 CALL TickThenExplode_CloseRange Call TickThenExplode_CloseRange.
45361 CALL C,TickThenExplode_KillJetman Call TickThenExplode_KillJetman if Jetman is close enough.
45364 CALL SpawnLinkedObject Call SpawnLinkedObject.
Step the actor type through 144-151.
45367 LD A,(IX+0) Fetch the actor type.
45370 INC A Increase it by one.
45371 AND %00000111 Keep only bits 0-2.
Sprite IDs begin at 144 ("Alien Base Plasma: Frame 1").
45373 ADD A,144 Add 144.
45375 LD (IX+0),A Write it back.
45378 CALL DrawSprite Call DrawSprite.
Colour the sprite with the actor colour.
45381 LD L,(IX+1) Fetch the actor screen column.
45384 LD H,(IX+4) Fetch the actor Y.
45387 CALL AttributeAddress Call AttributeAddress.
45390 LD D,(IX+7) Fetch the actor colour.
45393 LD C,2 C=2.
45395 LD A,(24151) Fetch SpriteWidth.
45398 AND A Return if it is zero.
45399 RET Z
45400 LD B,A Copy it into the column counter.
45401 CALL ColouriseSprite_Loop Call ColouriseSprite_Loop.
Colour one more row with a cycling bright INK.
45404 LD A,(24130) Fetch GameTimer.
45407 RRCA Rotate it right three times.
45408 RRCA
45409 RRCA
45410 AND %00000111 Keep only bits 0-2.
45412 JR NZ,Handler_Missile_SetBrightColour Jump to Handler_Missile_SetBrightColour if the result is not zero, else force 1.
45414 INC A
Handler_Missile_SetBrightColour 45415 OR %01000000 Set bit 6.
45417 LD D,A Copy the colour into D.
45418 LD C,1 C=1.
45420 JP ColouriseSprite_Loop Jump to ColouriseSprite_Loop.
Prev: 45341 Up: Map Next: 45423