Prev: 81F0 Up: Map Next: 82C3
8283: The serf fires his sword
Used by the routine at UPDATE_SERF.
The serf's fire routine, called from UPDATE_SERF. Refuses outright if the weapon slot at $EA98 is occupied, so only one shot exists at a time -- that single test is the whole of the game's rate of fire -- or if IN_DOORWAY says the player is outside the room's walk area. With the way clear it makes the rising sweep and calls FIRE_WEAPON, then picks the sword's first angle from the velocity.
SERF_FIRE 8283 LD A,($EA98)
8286 AND A
8287 RET NZ
8288 LD A,($5E2D)
828B AND A
828C RET NZ
828D CALL SOUND_SWEEP_UP
8290 CALL FIRE_WEAPON
8293 LD C,$00
8295 LD A,(HL)
8296 AND A
8297 JR Z,SERF_FIRE_3
8299 JP P,SERF_FIRE_0
829C LD C,$04
SERF_FIRE_0 829E DEC HL
829F LD A,(HL)
82A0 AND A
82A1 JR Z,SERF_FIRE_1
82A3 JP P,SERF_FIRE_2
82A6 DEC C
SERF_FIRE_1 82A7 LD A,C
82A8 AND $07
82AA ADD A,$38
82AC LD HL,$EA98
82AF LD (HL),A
82B0 JP LAUNCH_SHOT
SERF_FIRE_2 82B3 INC C
82B4 JR SERF_FIRE_1
SERF_FIRE_3 82B6 DEC HL
82B7 BIT 7,(HL)
82B9 JR Z,SERF_FIRE_4
82BB LD C,$06
82BD JR SERF_FIRE_1
SERF_FIRE_4 82BF LD C,$02
82C1 JR SERF_FIRE_1
Prev: 81F0 Up: Map Next: 82C3