Prev: AA0D Up: Map Next: AA6A
AA27: Handle Player Death
Used by the routines at GameComplete and HandlerSittingSabreman.
Called when the player has finished being shown as dead or sitting (see HandlerSittingSabreman). Depending on the number of players and the number of lives left this will either put the player back on their feet with one life less, end the game for the player, or hand over to the other player.
Input
IX Actor record of the player
Is this a one or two player game?
HandlePlayerDeath AA27 LD A,($9692) Fetch the game options from GameOptions.
AA2A AND %00000001 Keep only bit 0.
AA2C JR NZ,HandlePlayerDeath_TwoPlayer Jump to HandlePlayerDeath_TwoPlayer if this is a two player game.
This is a one player game.
HandlePlayerDeath_OnePlayer AA2E LD A,($96BD) Jump to GameOver_ControllerRestart if the player has no lives left.
AA31 AND A
AA32 JR Z,GameOver_ControllerRestart
AA34 LD HL,$96BD Point HL at the number of lives at ActivePlayer_Lives.
AA37 DEC (HL) Decrease the number of lives by one.
AA38 CALL DisplayPlayerLives Update the lives display.
Put the player back on their feet with the normal colour.
AA3B LD A,(IX+$00) Fetch the sprite ID of the player.
AA3E AND %00000111 Keep only bits 0-2.
AA40 OR %00010000 Set bit 4, giving a sprite ID of 10 to 17.
AA42 LD (IX+$00),A Set the new sprite ID of the player.
AA45 LD (IX+$05),$47 Set the colour of the player to INK:WHITE, PAPER:BLACK (BRIGHT).
Remove any orchid effect and delay the nastie and flame spawning.
AA49 XOR A Clear the orchid effect timer in OrchidEffectTimer.
AA4A LD ($96B0),A
AA4D LD A,$10 Set the nastie spawn delay in NastieSpawnDelay to 10.
AA4F LD ($96B1),A
AA52 LD A,$80 Set the flame spawn delay in FlameSpawnDelay to 80.
AA54 LD ($96B4),A
This entry point is used by the routine at HandlerSittingSabreman.
HandlePlayerDeath_Draw AA57 JP DisplayActor Jump to DisplayActor to display the player.
This is a two player game.
HandlePlayerDeath_TwoPlayer AA5A LD A,($96E0) Jump to HandlePlayerDeath_OnePlayer if the other player has no lives left.
AA5D AND A
AA5E JR Z,HandlePlayerDeath_OnePlayer
AA60 LD A,($96BD) Fetch the number of lives of this player from ActivePlayer_Lives.
AA63 AND A Show the game over message if this player has no lives left.
AA64 CALL Z,GameOver_Controller
AA67 JP SwitchPlayer Jump to SwitchPlayer to swap over to the other player.
Prev: AA0D Up: Map Next: AA6A