Prev: C1BD Up: Map Next: C206
C1C5: The update routine for a bolt (graphics 149 to 151, and 60)
Moves the bolt and cycles its graphic through 151, 150 and 149. Gravity is applied as to everything (DEC_DZ_AND_UPDATE_UVZ), but a bolt is held at Z 132, so one fired from the floor flies level, and one fired from higher up drops to that height. If it touches either thing from the sky (BOLT_HIT) the thing is shot down (SHOOT_DOWN); if its move was cut short in U or V by a wall or an object it goes up in a puff (START_PUFF). Otherwise its step is set again from +$14 and +$15 for the next turn, and it is marked to be redrawn.
The update-routine table (UPDATES) also gives this routine to graphic 60, which is one of the panel's pieces (PANEL_DATA); no room object has been seen with it.
BOLT C1C5 CALL DRAW_AT_L12_D6 its drawing nudge; fall and move, cut short against the room and the other objects
C1C8 CALL DEC_DZ_AND_UPDATE_UVZ
C1CB LD A,(IX+$00) the next frame: 151, 150, 149, then 151 again
C1CE DEC A
C1CF CP $94
C1D1 JR NZ,BOLT_0
C1D3 LD A,$97
BOLT_0 C1D5 LD (IX+$00),A
C1D8 LD A,(IX+$03) never lower than Z 132, where it stops falling
C1DB CP $84
C1DD JR NC,BOLT_1
C1DF LD (IX+$03),$84
C1E3 LD (IX+$0B),$00
BOLT_1 C1E7 CALL BOLT_HIT hit a thing from the sky: shoot it down
C1EA LD A,D
C1EB AND A
C1EC JP Z,SHOOT_DOWN
C1EF LD A,(IX+$0C) bumped in U or V: a puff
C1F2 AND $03
C1F4 JP NZ,START_PUFF
C1F7 LD A,(IX+$14) its step again, for the next turn
C1FA LD (IX+$09),A
C1FD LD A,(IX+$15)
C200 LD (IX+$0A),A
C203 JP SET_WIPE_AND_DRAW_FLAGS mark it to be redrawn
Prev: C1BD Up: Map Next: C206