Prev: 46840 Up: Map Next: 46932
46873: Handle Bystander
Type 6: a bystander who wanders about the town. He goes away when the sheriff is more than two cells away. If he is shot, the bullet turns into a puff of smoke, the fine is taken from the bounty and the bystander dies. If the sheriff on foot touches him, the sheriff dies; if the mounted sheriff does, the bystander dies.
HandleBystander 46873 LD A,(IX+5) Fetch the speed of the bystander.
46876 CALL SetSpeedsFromHeading Set the speeds from it.
46879 LD A,(IX+7) Fetch the flags of the bystander.
46882 PUSH AF Stash them on the stack.
46883 CALL TestMove Move around any walls.
46886 POP AF Retrieve the flags.
46887 CALL PlayFootstepSound Make a footstep sound if a foot has gone down.
46890 CALL MoveObject Move the bystander.
46893 CALL UpdateDirection Choose a new direction every so often.
46896 CALL SetFrameAndFlip Set the frame and the direction the bystander faces.
46899 LD C,2 Set the distance to two cells.
46901 CALL CheckDistance Check how close the sheriff is.
46904 JP NC,HandleBody_Remove Remove the bystander if the sheriff has moved away.
46907 LD BC,47000 Point BC at BystanderSpriteLists.
46910 CALL ChooseSpriteList Choose the sprite list.
This entry point is used by the routine at HandlePointer.
Check whether a bullet or the sheriff has hit the bystander.
HandleBystander_CheckHit 46913 CALL CheckBulletHit Check whether a bullet has hit the bystander.
46916 JR C,ShootBystander Jump to ShootBystander if it has.
46918 CALL CheckSheriffTouch Check whether the sheriff is touching the bystander.
46921 RET NC Return if not.
46922 LD A,(IY+0) Fetch the type of the sheriff.
46925 CP 21 Jump to TakeFine if he is mounted.
46927 JR Z,TakeFine
46929 CALL TakeFine Take the fine from the bounty.
Continue on to KillSheriff.
Prev: 46840 Up: Map Next: 46932