Prev: B11D Up: Map Next: B16F
B128: Handler: Alien Base Plasma
Handle the alien base plasma (types 90-97). 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 C8 object (SpawnLinkedObject), step the frame through 90-97 and colour the sprite.
Input
IX Actor slot
Handler_AlienBasePlasma B128 CALL Handler_Missile_TestJetmanRange Call Handler_Missile_TestJetmanRange.
B12B JP C,Handler_Missile_ExplodeObjects Jump to Handler_Missile_ExplodeObjects if this actor is in range.
B12E CALL TickThenExplode_CloseRange Call TickThenExplode_CloseRange.
B131 CALL C,TickThenExplode_KillJetman Call TickThenExplode_KillJetman if Jetman is close enough.
B134 CALL SpawnLinkedObject Call SpawnLinkedObject.
Step the actor type through 90-97.
B137 LD A,(IX+$00) Fetch the actor type.
B13A INC A Increase it by one.
B13B AND %00000111 Keep only bits 0-2.
Sprite IDs begin at 90 ("Alien Base Plasma: Frame 1").
B13D ADD A,$90 Add 90.
B13F LD (IX+$00),A Write it back.
B142 CALL DrawSprite Call DrawSprite.
Colour the sprite with the actor colour.
B145 LD L,(IX+$01) Fetch the actor screen column.
B148 LD H,(IX+$04) Fetch the actor Y.
B14B CALL AttributeAddress Call AttributeAddress.
B14E LD D,(IX+$07) Fetch the actor colour.
B151 LD C,$02 C=02.
B153 LD A,($5E57) Fetch SpriteWidth.
B156 AND A Return if it is zero.
B157 RET Z
B158 LD B,A Copy it into the column counter.
B159 CALL ColouriseSprite_Loop Call ColouriseSprite_Loop.
Colour one more row with a cycling bright INK.
B15C LD A,($5E42) Fetch GameTimer.
B15F RRCA Rotate it right three times.
B160 RRCA
B161 RRCA
B162 AND %00000111 Keep only bits 0-2.
B164 JR NZ,Handler_Missile_SetBrightColour Jump to Handler_Missile_SetBrightColour if the result is not zero, else force 01.
B166 INC A
Handler_Missile_SetBrightColour B167 OR %01000000 Set bit 6.
B169 LD D,A Copy the colour into D.
B16A LD C,$01 C=01.
B16C JP ColouriseSprite_Loop Jump to ColouriseSprite_Loop.
Prev: B11D Up: Map Next: B16F