Prev: 8703 Up: Map Next: 87D0
87A0: See whether an exploding grenade got an ant
Used by the routine at GRENADE_BLAST.
Only ants at the grenade's height and not already exploding. Within four cells (counted along the grid, not diagonally) the ant is blown up -- "GOOD SHOT!" -- and within seven it is stunned for 24 of its turns -- about 48 frames for a half-speed ant, since the stun counts down only on turns it takes. Both seen in play, in staged scenes.
Input
HL The grenade's x and y
C Its height
IY The ant
BLAST_ANT 87A0 LD A,(IY+$02) Another height, or already exploding: no.
87A3 CP C
87A4 RET NZ
87A5 LD A,(IY+$09)
87A8 AND A
87A9 RET NZ
87AA LD E,(IY+$00)
87AD LD D,(IY+$01)
87B0 CALL DISTANCE
87B3 CP $08 Eight or more away: missed.
87B5 RET NC
87B6 CP $05 Five to seven: stunned.
87B8 JR C,BLAST_ANT_0
87BA LD (IY+$06),$18
87BE RET
BLAST_ANT_0 87BF LD (IY+$09),$05 Four or less: blown up...
87C3 LD (IY+$06),$00
87C7 LD A,(GRENADE_EVENTS) ...and "GOOD SHOT!".
87CA OR $04
87CC LD (GRENADE_EVENTS),A
87CF RET
Prev: 8703 Up: Map Next: 87D0