Prev: A4B5 Up: Map Next: A4EC
A4C9: Handle Money Bag
Type 18: a money bag put in the street by CreateMoneyBag to help a player who has run out of money. It disappears if the sheriff moves away from it. When the sheriff touches it, it adds $100 to the bounty.
Remove the bag if the sheriff has moved away.
HandleMoneyBag A4C9 LD C,$02 Set the distance at which the bag stays alive to two cells.
A4CB CALL CheckDistance Check how close the sheriff is.
A4CE JP NC,HandleBody_Remove Remove the bag if the sheriff has moved away.
Add $100 when the sheriff touches the bag.
A4D1 CALL CheckSheriffTouch Check whether the sheriff is touching the bag.
A4D4 RET NC Return if not.
A4D5 LD BC,$0100 Set the $100 added to the bounty in BC.
A4D8 CALL AddToBounty Add it to the bounty.
A4DB CALL DrawBountyDigits Print the new bounty.
A4DE LD A,$08 Write 08 to SoundNotesLeft so that the pick-up sound lasts eight notes.
A4E0 LD ($A23C),A
A4E3 LD HL,$AEC7 Point SoundNoteAddress at the notes of the pick-up sound.
A4E6 LD ($A23D),HL
A4E9 JP HandleBody_Remove Remove the bag.
Prev: A4B5 Up: Map Next: A4EC