Prev: 38074 Up: Map Next: 38219
38165: Script routine: (61) Fire Bubo's projectile
Note that Bubo normally can't fire when being carried (see instructions at 38119-38129), however if he starts to fire immediately before being picked up, then his is-being-carried flag will be set by the time execution reaches this routine.
Used by the routine at 48096.
Input
IX Address of complex state data for Bubo (level 2)
IY Address of complex state data for Bubo's projectile
38165 SET 1,(IY+9) Set projectile's fired flag
38169 BIT 5,(IX+10) If Bubo is being carried...
38173 JR NZ,38181 ...then skip ahead to 38181
38175 LD (IY+12),251 Set projectile's velocity factor to -5
38179 JR 38185 Skip ahead to 38185
38181 LD (IY+12),246 Set projectile's velocity factor to -10
38185 LD A,(IX+5) Set projectile's x-coordinate to one more than Bubo's...
38188 INC A ...
38189 LD (IY+5),A ...
38192 LD (IY+7),A ...
38195 LD A,(IX+4) Set projectile's y-coordinate to be three less than Bubo's...
38198 SUB 3 ...
38200 LD (IY+4),A ...
38203 LD (IY+6),A ...
38206 LD A,(IX+0) Set projectile's room to be same as Bubo's...
38209 LD (IY+0),A ...
38212 LD (IY+1),1 Set projectile's depth to zero
38216 JP 48096 Advance HL to next script instruction and execute
Prev: 38074 Up: Map Next: 38219