| Ant Attack | Routines |
| Prev: 8BFF | Up: Map | Next: 8D94 |
|
Used by the routine at MOVE_GRENADE.
S, D, F and G throw, further along the keyboard throwing further: each key's bit is its flight time (2, 4, 8 or 16 frames). The grenade starts at the player and moves like anything else, a cell a frame; when the time runs out it explodes where it is.
Every frame of the flight, not only the last, the grenade is checked against the player's cell and the rescued person's: if it is in either, they are blown up.
|
||||||||||
| THROW_GRENADE | 8D00 | LD A,(THROW_TIME) | In flight. | |||||||
| 8D03 | AND A | |||||||||
| 8D04 | JR NZ,THROW_GRENADE_0 | |||||||||
| 8D06 | LD A,(IX+$09) | Still exploding. | ||||||||
| 8D09 | AND A | |||||||||
| 8D0A | RET NZ | |||||||||
| 8D0B | LD BC,$FDFE | A to G: S, D, F or G. | ||||||||
| 8D0E | IN A,(C) | |||||||||
| 8D10 | CPL | |||||||||
| 8D11 | AND $1E | |||||||||
| 8D13 | RET Z | |||||||||
| 8D14 | LD C,A | C = the flight time. | ||||||||
| 8D15 | LD A,(AMMO_LOW) | None left, or one fewer. | ||||||||
| 8D18 | AND A | |||||||||
| 8D19 | RET Z | |||||||||
| 8D1A | DEC A | |||||||||
| 8D1B | LD (AMMO_LOW),A | |||||||||
| 8D1E | LD A,C | Launch. | ||||||||
| 8D1F | LD (THROW_TIME),A | |||||||||
| 8D22 | LD (IY+$08),$02 | The player's throwing pose. | ||||||||
| 8D26 | SET 2,(IX+$07) | The grenade moves... | ||||||||
| 8D2A | CALL COPY_POSITION | ...from where the player is... | ||||||||
| 8D2D | LD A,$01 | ...and the count is reprinted. | ||||||||
| 8D2F | LD (GRENADE_EVENTS),A | |||||||||
| 8D32 | LD (IX+$08),$F4 | In flight it is drawn as frame $F4. | ||||||||
| 8D36 | RET | |||||||||
| THROW_GRENADE_0 | 8D37 | DEC A | One frame less in the air... | |||||||
| 8D38 | LD (THROW_TIME),A | |||||||||
| 8D3B | JR NZ,THROW_GRENADE_1 | |||||||||
| 8D3D | LD A,$02 | ...and at the end, bang: explode and stop. | ||||||||
| 8D3F | LD (GRENADE_EVENTS),A | |||||||||
| 8D42 | LD (IX+$09),$05 | |||||||||
| 8D46 | RES 2,(IX+$07) | |||||||||
| 8D4A | NOP | |||||||||
| THROW_GRENADE_1 | 8D4B | LD A,(IX+$00) | In the player's cell... | |||||||
| 8D4E | CP (IY+$00) | |||||||||
| 8D51 | JR NZ,THROW_GRENADE_3 | |||||||||
| 8D53 | LD A,(IX+$01) | |||||||||
| 8D56 | CP (IY+$01) | |||||||||
| 8D59 | JR NZ,THROW_GRENADE_2 | |||||||||
| 8D5B | LD A,(IX+$02) | |||||||||
| 8D5E | CP (IY+$02) | |||||||||
| 8D61 | JR NZ,THROW_GRENADE_2 | |||||||||
| 8D63 | LD A,(IY+$09) | ...blows the player up. | ||||||||
| 8D66 | AND A | |||||||||
| 8D67 | RET NZ | |||||||||
| 8D68 | LD (IY+$09),$05 | |||||||||
| 8D6C | LD (IY+$0F),$08 | |||||||||
| 8D70 | RET | |||||||||
| THROW_GRENADE_2 | 8D71 | LD A,(IX+$00) | In the rescued person's cell... | |||||||
| THROW_GRENADE_3 | 8D74 | CP (IY+$10) | ||||||||
| 8D77 | RET NZ | |||||||||
| 8D78 | LD A,(IX+$01) | |||||||||
| 8D7B | CP (IY+$11) | |||||||||
| 8D7E | RET NZ | |||||||||
| 8D7F | LD A,(IX+$02) | |||||||||
| 8D82 | CP (IY+$12) | |||||||||
| 8D85 | RET NZ | |||||||||
| 8D86 | LD A,(IY+$19) | ...blows them up. | ||||||||
| 8D89 | AND A | |||||||||
| 8D8A | RET NZ | |||||||||
| 8D8B | LD (IY+$19),$05 | |||||||||
| 8D8F | LD (IY+$1F),$08 | |||||||||
| 8D93 | RET | |||||||||
| Prev: 8BFF | Up: Map | Next: 8D94 |