Prev: 41767 Up: Map Next: 42064
41961: Update state of cannon's projectile
Used by the routine at 41767.
41961 LD IX,45599 Load IX with address of complex state data for cannon's projectile
41965 LD A,(IX+1) If projectile's depth is zero...
41968 OR A ...
41969 RET Z ...then return
41970 LD BC,49699 Set projectile's graphic layout data address to that of drip stage 8, disconnected and falling (ball)...
41973 CALL 42512 ...
41976 LD A,(IX+9) If projectile's state is zero (fired vertically)...
41979 OR A ...
41980 JR Z,42015 ...then skip ahead to 42015
41982 CP 8 If projectile's state is not 8 (finished)...
41984 JR NZ,41991 ...then skip ahead to 41991
41986 LD (IX+1),0 Set projectile's depth to 0
41990 RET Return
41991 CP 2 If projectile's state is not 2 (fired right)...
41993 JR NZ,42006 ...then skip ahead to 42006
Projectile flying left
41995 CALL 42447 Move entity left two characters...
41998 CALL 42447 ...
42001 CALL 54348 Move entity at IX into room to the left, if appropriate
42004 JR 42015 Skip ahead to 42015
Projectile flying right
42006 CALL 42505 Move entity right two characters...
42009 CALL 42505 ...
42012 CALL 54313 Move entity at IX into room to the right, if appropriate
Update projectile's vertical velocity
42015 LD A,(IX+12) Load projectile's velocity into A and E...
42018 LD E,A ...
42019 ADD A,(IX+4) Add velocity to y-coordinates of top and bottom of projectile...
42022 LD (IX+4),A ...
42025 LD (IX+6),A ...
42028 INC (IX+12) Increase velocity by one (initially negative so will accelerate downwards)
42031 LD A,E If velocity (before increase) was not 5...
42032 CP 5 ...i.e. projectile has not yet fallen back to floor-level...
42034 RET NZ ...then return
42035 LD (IX+9),8 Set projectile's state to 8 (finished)
42039 LD BC,51483 Set projectile's graphic layout data address to that of explosion (Bubo's projectile / fallen drips, level 4)...
42042 CALL 42512 ...
42045 CALL 54768 Check entity at IX for collision with another entity at same depth whose interaction-(11,6) flag is set...
42048 RET C ...and if no collision occurred, then return
42049 CP 36 If collision was not with entity of class 36 (skeleton, level 4)...
42051 JR NZ,42058 ...then skip ahead to 42058
42053 LD HL,45413 Set skeleton's is-dying flag...
42056 SET 1,(HL) ...
42058 CP 31 If collision was with entity of class 31 (Berk)...
42060 CALL Z,53667 ...then set Berk-has-been-killed flag
42063 RET Return
Prev: 41767 Up: Map Next: 42064