WEAPONx FLAGS: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
Fox (talk | contribs)
No edit summary
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
WEAPONx_FLAGS is a [[gamevar]] that has the power to change several different things about weapons (not projectiles).
'''WEAPONx_FLAGS''' is a [[gamevar]] that has the power to change several different things about weapons (not projectiles).


The flag values for WEAPONx_FLAGS are:
== Flags ==


:'''1''' - Holstering clears clip
{{Weapon flags}}
:'''2''' - Glows
:'''4''' - Automatic
:'''8''' - Fire every other frame
:'''16''' - Fire every third frame
:'''32''' - Random restart on automatic
:'''64''' - Use ammo per burst (like the Devastator)
:'''128''' - Is a bomb trigger (Pipebomb Detonator)
:'''256''' - Using does NOT cause player to become 'visible'
:'''512''' - Use 'throws' the 'shoots' item
:'''1024''' - Check weapon availability at 'reload' time
:'''2048''' - player should stop jumping
:'''0''' - Spawn Type 1 (Pistol shells)
:'''4096''' - Spawn Type 2 (Shotgun shells)
:'''8192''' - Spawn Type 3 (Chaingun shells)
:'''16384''' - Semi-automatic (cancel button press after each shot)
:'''32768''' - Alternate reload sound timing (hack for pistol reload sound timing)
:'''65536''' - Alternate weapon timing (hack for chaingun and freezer, see player.c)


 
[[Category:Bitfields]]
WEAPONx_FLAGS is a bitfield, so you can add the individual flags together in the manner of [[cstat]] and [[orientation]].
[[Category:Pre-defined gamevars]]

Latest revision as of 05:04, 21 February 2020

WEAPONx_FLAGS is a gamevar that has the power to change several different things about weapons (not projectiles).

Flags

The following values are used with WEAPONx_FLAGS.

Exposed Value Label Description
No 1 WEAPON_HOLSTER_CLEARS_CLIP Holster key "refills" magazine by removing excess ammo from the player
No 2 WEAPON_GLOWS Controls glowing effect on SHRINKER weapon's crystal, no effect on other weapons, probably breaks shotgun if used with that weapon
No 4 WEAPON_AUTOMATIC Resets kickback_pic to 1 instead of 0 when animation ends
No 8 WEAPON_FIREEVERYOTHER Fires projectiles every frame instead of when kickback_pic is equal to WEAPONx_FIREDELAY. Also alters burst fire behavior so that shots are dispatched once per tic instead of all at once.
No 16 WEAPON_FIREEVERYTHIRD Fires when kickback_pic  % 3 === 0 (every third frame)
No 32 WEAPON_RANDOMRESTART When used with WEAPON_AUTOMATIC, resets kickback_pic to a random value between 1 and 4 instead of 1 when animation ends
No 64 WEAPON_AMMOPERSHOT Use ammo per shot per burst (like the Devastator)
No 128 WEAPON_BOMB_TRIGGER Is a bomb trigger (Pipebomb Detonator)
No 256 WEAPON_NOVISIBLE Using does NOT cause player to flash the level (clear visibility)
No 512 WEAPON_THROWIT Currently unused
No 1024 WEAPON_CHECKATRELOAD Check weapon availability at 'reload' time, only affects weapons with WEAPONx_WORKSLIKE of TRIPBOMB_WEAPON
No 2048 WEAPON_STANDSTILL Stops all player z-axis movement when firing
No 4096 WEAPON_SPAWNTYPE2 Spawn Type 2 (Shotgun shells)
No 8192 WEAPON_SPAWNTYPE3 Spawn Type 3 (Chaingun shells)
No 16384 WEAPON_SEMIAUTO Semi-automatic (cancel button press after each shot)
No 32768 WEAPON_RELOAD_TIMING Alternate formula for reload sound timing, generally used for pistol
No 65536 WEAPON_RESET Resets kickback_pic to 1 instead of 0 at end of firing animation if fire is held
Defines
define WEAPON_HOLSTER_CLEARS_CLIP       0x00000001
define WEAPON_GLOWS                     0x00000002
define WEAPON_AUTOMATIC                 0x00000004
define WEAPON_FIREEVERYOTHER            0x00000008
define WEAPON_FIREEVERYTHIRD            0x00000010
define WEAPON_RANDOMRESTART             0x00000020
define WEAPON_AMMOPERSHOT               0x00000040
define WEAPON_BOMB_TRIGGER              0x00000080
define WEAPON_NOVISIBLE                 0x00000100
define WEAPON_THROWIT                   0x00000200
define WEAPON_CHECKATRELOAD             0x00000400
define WEAPON_STANDSTILL                0x00000800
define WEAPON_SPAWNTYPE2                0x00001000
define WEAPON_SPAWNTYPE3                0x00002000
define WEAPON_SEMIAUTO                  0x00004000
define WEAPON_RELOAD_TIMING             0x00008000
define WEAPON_RESET                     0x00010000