A_ReFire
From DoomWiki.org
A_ReFire is a code pointer used in the attack animation for all weapons.
A_ReFire
checks if the player currently has the fire button held down and if so, begins the weapon firing sequence again. It is called at the end of the firing sequence for most weapons, but most notably the plasma gun to implement its "cool down" animation: if the player is still holding the fire button, the firing sequence restarts to fire another plasma ball, but once the fire button is released the animation passes through to the cooldown frame, giving a short delay before the player can fire again. While it is less visible to the player, a similar 20 tic pause exists for the BFG9000 that is not present if the fire button is held down.
Every time that A_ReFire
restarts the firing sequence, an internal counter is incremented; the counter is reset to zero when fire is no longer held. The counter is then used by A_FirePistol and A_FireCGun to give higher accuracy on the first shot of the pistol and chaingun.
Uses[edit]
The A_ReFire
code pointer appears in the following states in Doom's state table:
Frame number | Doom internal name | Use |
---|---|---|
9 | S_PUNCH5 | attack animation for the fists |
16 | S_PISTOL4 | attack animation for the pistol |
29 | S_SGUN9 | attack animation for the shotgun |
44 | S_DSGUN10 | attack animation for the super shotgun |
54 | S_CHAIN3 | attack animation for the chaingun |
62 | S_MISSILE3 | attack animation for the rocket launcher |
73 | S_SAW3 | attack animation for the chainsaw |
78 | S_PLASMA2 | attack animation for the plasma gun |
87 | S_BFG4 | attack animation for the BFG9000 |
Example[edit]
The following is an example of how to set the A_ReFire
code pointer in a DeHackEd file:
Pointer 21 (Frame 34) Codep Frame = 87
Or using BEX syntax:
[CODEPTR] Frame 1234 = ReFire