Difference between revisions of "A ReFire"

From DoomWiki.org

[checked revision][checked revision]
m (External links)
(add some more detail)
Line 1: Line 1:
 
{{DISPLAYTITLE:A_ReFire}}
 
{{DISPLAYTITLE:A_ReFire}}
{{stub}}
+
[[File:Doom moire.jpg|thumb|right|<code>A_ReFire</code> is used to implement the "cool down" animation when the player stops firing the plasma gun.]]
 
'''A_ReFire''' is a [[code pointer]] used in the attack animation for all weapons.
 
'''A_ReFire''' is a [[code pointer]] used in the attack animation for all weapons.
 +
 +
<code>A_ReFire</code> 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 <code>A_ReFire</code> 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 ==
 
== Uses ==

Revision as of 20:42, 21 March 2020

A_ReFire is used to implement the "cool down" animation when the player stops firing the plasma gun.

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.

Uses

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

Example

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

External links