Prev: 33076 Up: Map Next: 33148
33099: Throw Fireball
Used by the routine at HandlerWizard.
Launches a fireball for the wizard, unless a weapon is already in flight or the player is in a doorway. The fireball sprites have the IDs 52 to 55 and are animated by HandlerFireball.
Input
IX The player entity
ThrowFireball 33099 LD A,(60056) Return if a weapon is already in flight.
33102 AND A
33103 RET NZ
33104 LD A,(24109) Return if the player is in a doorway.
33107 AND A
33108 RET NZ
33109 CALL SoundsFireball Call SoundsFireball to make the fireball sound.
33112 CALL SetWeaponVelocity Call SetWeaponVelocity to set the velocity of the weapon.
33115 LD HL,60056 Point HL at the player weapon at PlayerWeapon.
33118 LD (HL),52 Write 52 to the weapon, the sprite ID of the first fireball frame.
This entry point is used by the routines at ThrowAxe and ThrowSword.
Place the weapon in the same room as the player, at the position of the player, and draw it.
LaunchWeapon 33120 INC HL Move HL on to the room of the weapon.
33121 LD A,(IX+1) Fetch the room of the player.
33124 LD (HL),A Write the room of the player to the room of the weapon.
33125 INC HL Move HL on to the X position of the weapon.
33126 INC HL
33127 LD A,(IX+3) Fetch the X position of the player.
33130 LD (HL),A Write the X position of the player to the X position of the weapon.
33131 INC HL Move HL on to the Y position of the weapon.
33132 LD A,(IX+4) Fetch the Y position of the player.
33135 LD (HL),A Write the Y position of the player to the Y position of the weapon.
33136 PUSH IX Stash the player entity on the stack.
33138 LD IX,60056 Point IX at the weapon at PlayerWeapon.
33142 CALL DrawEntity Call DrawEntity to draw the weapon.
33145 POP IX Restore the player entity from the stack.
33147 RET Return.
Prev: 33076 Up: Map Next: 33148