![]() |
Routines |
| Prev: CF3E | Up: Map | Next: CF99 |
|
Set up a missile/bolt fired by a warlock, demon, or goblin missile thrower.
|
||||
| CF58 | LD A,($EBA7) | Type of missile fired by this creature | ||
| CF5B | CP $00 | 0 = No missile fired | ||
| CF5D | JP Z,$D04B | Jump out if so | ||
| CF60 | LD C,A | Store missile type in C register | ||
| CF61 | LD A,($EB91) | Creature missile count. 0 = no creature-fired missiles currently on screen, 1 = there is one | ||
| CF64 | CP $00 | Is there a creature-fired missile already on screen? | ||
| CF66 | JP NZ,$D04B | If so, we're not allowed to have more than one creature missile on screen, so skip to the next routine | ||
|
OK for creature to fire a missile/bolt. Next, we need to calculate its trajectory.
|
||||
| CF69 | INC A | Increment missile-count-in-room and re-store | ||
| CF6A | LD ($EB91),A | |||
| CF6D | LD A,C | |||
| CF6E | LD ($EB93),A | Store missile number/type | ||
| CF71 | LD A,$05 | |||
| CF73 | LD ($EB9A),A | 5 = Object type - missile fired by creature (at Maroc) | ||
| CF76 | LD HL,($EB47) | Copy horizontal co-ordinate into data buffer | ||
| CF79 | LD ($EB94),HL | The creature's co-ordinates will be the origin point | ||
| CF7C | LD HL,($EB49) | |||
| CF7F | LD ($EB96),HL | Do the same for the vertical co-ordinate | ||
| CF82 | LD A,($EAC1) | Maroc's vertical (Y-axis) screen position | ||
| CF85 | LD ($EB99),A | Set as vertical screen position of target | ||
| CF88 | LD A,($EAC0) | Maroc's horizontal (X-axis) screen position | ||
| CF8B | LD ($EB98),A | Set as horizontal screen position of target | ||
| CF8E | LD A,$00 | |||
| CF90 | LD ($EB4C),A | Set vertical movement speed to zero | ||
| CF93 | LD ($EB4D),A | Set horizontal movement speed to zero (these two values will need to be calculated later) | ||
| CF96 | JP $D04B | |||
| Prev: CF3E | Up: Map | Next: CF99 |