Weapon

From ZDoom Wiki
Jump to: navigation, search
DoomWiki.org
For more information on this article, visit the Weapon page on the Doom Wiki.

A weapon is an inventory actor derived from the Weapon class. To work properly, a weapon needs to define several additional actor states, namely:

  • Ready
  • Select
  • Deselect
  • Fire

The following are optional:

  • AltFire
  • Hold
  • AltHold
  • Flash
  • AltFlash
  • Reload
  • Zoom
  • User#
    • # = 1, 2, 3 or 4.

Weapons can use the Offset keyword in their weapon-exclusive states to adjust the position of the HUD sprite, and may call the A_WeaponReady function to reset the offsets.

Weapons are also subject to the sv_fastweapons console variable and they consume ammo. Weapons need to be assigned weapon slots to be easily selectable in game. Weapons should provide an Inventory.Icon as it is required by some HUDs.