Routines |
Prev: 53054 | Up: Map | Next: 53145 |
Set up a missile/bolt fired by a warlock, demon, or goblin missile thrower.
|
||||
53080 | LD A,(60327) | Type of missile fired by this creature | ||
53083 | CP 0 | 0 = No missile fired | ||
53085 | JP Z,53323 | Jump out if so | ||
53088 | LD C,A | Store missile type in C register | ||
53089 | LD A,(60305) | Creature missile count. 0 = no creature-fired missiles currently on screen, 1 = there is one | ||
53092 | CP 0 | Is there a creature-fired missile already on screen? | ||
53094 | JP NZ,53323 | 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.
|
||||
53097 | INC A | Increment missile-count-in-room and re-store | ||
53098 | LD (60305),A | |||
53101 | LD A,C | |||
53102 | LD (60307),A | Store missile number/type | ||
53105 | LD A,5 | |||
53107 | LD (60314),A | 5 = Object type - missile fired by creature (at Maroc) | ||
53110 | LD HL,(60231) | Copy horizontal co-ordinate into data buffer | ||
53113 | LD (60308),HL | The creature's co-ordinates will be the origin point | ||
53116 | LD HL,(60233) | |||
53119 | LD (60310),HL | Do the same for the vertical co-ordinate | ||
53122 | LD A,(60097) | Maroc's vertical (Y-axis) screen position | ||
53125 | LD (60313),A | Set as vertical screen position of target | ||
53128 | LD A,(60096) | Maroc's horizontal (X-axis) screen position | ||
53131 | LD (60312),A | Set as horizontal screen position of target | ||
53134 | LD A,0 | |||
53136 | LD (60236),A | Set vertical movement speed to zero | ||
53139 | LD (60237),A | Set horizontal movement speed to zero (these two values will need to be calculated later) | ||
53142 | JP 53323 |
Prev: 53054 | Up: Map | Next: 53145 |