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 rifle 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 BFG 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.
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 BFG 9000|
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