Prev: A9A8 Up: Map Next: A9ED
A9BF: Handle Horse
Type 14: a horse waiting in the street. It goes away if the sheriff is three cells away. If the sheriff touches it, the horse is removed, the sheriff turns into a mounted sheriff (type 15) who has a higher top speed, and the price of the horse is taken from the bounty.
Remove the horse if the sheriff has moved away.
HandleHorse A9BF LD C,$03 Set the distance to three cells.
A9C1 CALL CheckDistance Check how close the sheriff is.
A9C4 JP NC,HandleBody_Remove Remove the horse if the sheriff has moved away.
Mount the sheriff when he touches the horse.
A9C7 CALL CheckSheriffTouch Check whether the sheriff is touching the horse.
A9CA RET NC Return if not.
A9CB LD A,$08 Write 08 to SoundNotesLeft so that the sound lasts eight notes.
A9CD LD ($A23C),A
A9D0 LD HL,$AEBF Point SoundNoteAddress at the notes of the horse sound.
A9D3 LD ($A23D),HL
A9D6 LD (IX+$00),$00 Remove the horse.
A9DA LD A,$12 Raise the top speed of the sheriff to 12.
A9DC LD ($A21F),A
A9DF LD (IY+$00),$15 Turn the sheriff into a mounted sheriff.
A9E3 LD BC,($A25C) Fetch the price of a horse.
A9E7 CALL TakeFromBounty Take it from the bounty.
A9EA JP DrawBountyDigits Jump to DrawBountyDigits.
Prev: A9A8 Up: Map Next: A9ED