Prev: B28C Up: Map Next: B318
B2E9: Finish Town Stage
Used by the routine at InitialiseGame.
Called every frame in the town. When the outlaw has been shot (OutlawShotFlag is one) it plays a tune, clears all the objects and goes on to the duel with the outlaw. The player is given a life to make up for the one which is taken when the next stage starts.
FinishTownStage B2E9 LD HL,$A20A Point HL at the outlaw shot flag.
B2EC LD A,(HL) Fetch the flag.
B2ED CP $01 Return if the outlaw has not just been shot.
B2EF RET NZ
B2F0 INC (HL) Set the flag to two so that this does not happen again.
Play the tune for shooting the outlaw.
B2F1 LD DE,$B1B5 Call PlayMusic to play OutlawShotTune.
B2F4 CALL PlayMusic
B2F7 CALL RemoveAllObjects Remove all of the objects.
B2FA XOR A Write 00 to TownOffset so the next stage is outside the town.
B2FB LD ($A267),A
B2FE LD ($A212),A Clear the flag at ShotsFiredCount.
B301 LD HL,$0201 Set one stage to play, of the kind which is the duel.
B304 LD ($A264),HL
B307 LD HL,$A263 Point HL at Lives.
B30A INC (HL) Add one to the number of lives, to make up for the one which the next stage takes.
B30B LD A,$01 Write 01 to StageRunningFlag to show that a new stage is starting.
B30D LD ($A240),A
B310 LD A,$45 Write INK:CYAN, PAPER:BLACK (BRIGHT) to ScreenAttribute.
B312 LD ($A266),A
B315 JP StartStage Start the next stage.
Prev: B28C Up: Map Next: B318