A_FireShotgun
From DoomWiki.org
A_FireShotgun is a code pointer used in the attack animation for the shotgun. It implements the main 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[edit]
The A_FireShotgun
code pointer appears in the following states in Doom's state table:
Frame number | Doom internal name | Use |
---|---|---|
22 | S_SGUN2 | attack animation for the shotgun |
Example[edit]
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
Code structure[edit]
A_FireShotgun
uses the same P_GunShot
function as A_FirePistol and so its code structure is largely identical.
See also[edit]
- A_SPosAttack - monster equivalent code pointer used by the shotgun guy to fire his shotgun.
External links[edit]
- A_FireShotgun in the Doom source code.
- A_FireShotgun at the ZDoom wiki
- FireShotgun at the Eternity Engine wiki