Prev: 46013 Up: Map Next: 46112
46042: Handle Outlaw
Types 10 and 22: the outlaw who is wanted at this level. A bullet hit sets OutlawShotFlag to one, which makes FinishTownStage end the stage. Otherwise the outlaw wanders about the town: if he touches the sheriff, the sheriff dies. Type 22 is made by CreateOutlaw instead of type 10 when the outlaw is to be a little faster.
Check whether a bullet has hit the outlaw.
HandleOutlaw 46042 CALL CheckBulletHit Check whether a bullet has hit the outlaw.
46045 JR NC,HandleOutlaw_Walk Jump to HandleOutlaw_Walk if not.
46047 LD A,1 Set OutlawShotFlag.
46049 LD (41482),A
46052 JR HandleOutlaw_Draw Jump to HandleOutlaw_Draw to draw the outlaw.
Check whether the outlaw has touched the sheriff, and make him wander.
HandleOutlaw_Walk 46054 CALL CheckSheriffTouch Check whether the outlaw is touching the sheriff.
46057 JP C,KillSheriff Kill the sheriff if he is.
46060 LD A,(IX+5) Fetch the speed of the outlaw.
46063 CALL SetSpeedsFromHeading Set the speeds from it.
46066 LD A,(IX+7) Fetch the flags of the outlaw.
46069 PUSH AF Stash them on the stack.
46070 CALL TestMove Move around any walls.
46073 POP AF Retrieve the flags.
46074 CALL PlayFootstepSound Make a footstep sound if a foot has gone down.
46077 CALL MoveObject Move the outlaw.
46080 CALL UpdateDirection Choose a new direction every so often.
46083 CALL SetFacingFlags Set the direction the outlaw faces.
46086 CALL NextSpriteNumber Move on to the next frame of the walk.
Make the sprites for the outlaw.
HandleOutlaw_Draw 46089 CALL ChooseFigureSprites Choose the sprites for the figure.
46092 EX AF,AF' Keep the sprite number in the alternate accumulator.
46093 LD L,A Keep the sprite number in L.
46094 LD A,(41568) Fetch the level.
46097 ADD A,A Double it.
46098 AND %00000110 Keep two bits.
46100 JR NZ,HandleOutlaw_AddSpriteSet Jump to HandleOutlaw_AddSpriteSet unless the sprite set is the first.
46102 LD A,2 Use the second sprite set.
HandleOutlaw_AddSpriteSet 46104 ADD A,L Add the sprite set to the sprite number.
46105 EX AF,AF' Keep the number in the alternate accumulator.
46106 LD HL,41522 Point HL at OutlawSpriteList.
46109 JP BuildFigureSpriteList Jump to BuildFigureSpriteList.
Prev: 46013 Up: Map Next: 46112