Prev: 47578 Up: Map Next: 47611
47581: Advance Gun Frame
Used by the routine at HandleOutlawGun.
Moves the outlaw's gun on to its next frame. If the player has provoked the outlaw, which is when DrawMessageState is one, the gun moves on every frame. Otherwise it moves on after a delay which is shorter at the higher levels of skill.
Input
IX The address of the gun
AdvanceGunFrame 47581 LD A,(41489) Fetch DrawMessageState.
47584 CP 1 Jump to AdvanceGunFrame_Next to move to the next frame at once if the outlaw has been provoked.
47586 JR Z,AdvanceGunFrame_Next
47588 LD A,(IX+5) Jump to AdvanceGunFrame_Reset if the delay is zero.
47591 AND A
47592 JR Z,AdvanceGunFrame_Reset
47594 DEC (IX+5) Count down the delay.
47597 RET Return.
The delay has finished, so set a new one from the skill level.
AdvanceGunFrame_Reset 47598 LD A,(41569) Fetch Skill.
47601 CPL Invert it.
47602 AND %00000111 Keep a number from 0 to 7 which is smaller at the higher skill levels.
47604 LD (IX+5),A Set the delay.
AdvanceGunFrame_Next 47607 INC (IX+12) Move on to the next frame.
47610 RET Return.
Prev: 47578 Up: Map Next: 47611