A_FireShotgun

From DoomWiki.org

Revision as of 22:30, 16 March 2020 by Fraggle (talk | contribs) (Flesh out description)


A_FireShotgun being invoked to attack a monster.

A_FireShotgun is a code pointer used in the attack animation for the Shotgun. It implements the mail shotgun firing logic.

A_FireShotgun does the following:

  • Sets the player into state S_PLAY_ATK2 so that other players in the game see the player firing a weapon.
  • Activates the weapon's "flash state" that shows the gun-barrel flash
  • Plays the sound effect DSSHOTGN
  • Fires seven pellets in the direction that the player is facing (performing autoaim to determine vertical angle).

Uses

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

Example

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

Pointer 21 (Frame 34)
Codep Frame = 22

Or using BEX syntax:

[CODEPTR]
Frame 1234 = FireShotgun

See also

External links