A_FireMissile

From DoomWiki.org

Rocket launcher firing sequence, the state immediately before S_MISSILE2 when A_FireMissile is invoked.

A_FireMissile is a code pointer used in the attack animation for the rocket launcher.

A_FireMissile spawns a rocket (object of type MT_ROCKET) moving in the direction that the player is currently facing. Autoaim is applied to determine the vertical angle to aim at. The rocket is spawned in the exact same X/Y location as the player; it passes out of the player since rockets pass through the player that fired them.

Uses[edit]

The A_FireMissile code pointer appears in the following states in Doom's state table:

Example[edit]

The following is an example of how to set the A_FireMissile code pointer in a DeHackEd file:

Pointer 21 (Frame 34)
Codep Frame = 61

Or using BEX syntax:

[CODEPTR]
Frame 1234 = FireMissile

Code structure[edit]

The following call graph shows some of the underlying internals of the A_FireMissile function. The P_AimLineAttack function provides some autoaim adjustment before the rocket is spawned. If the rocket cannot be spawned, it detonates immediately.

A FireMissile call graph.svg

See also[edit]

External links[edit]