Addweapon

From EDukeWiki
Revision as of 17:09, 17 November 2021 by Doom64hunter (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

addweapon <weapon> <amount>

addweaponvar <weapon> <amount>


Gives the specified <weapon> with <amount> ammo to the nearest player.

Commands with an additional "var" suffix take gamevars rather than constants or defined labels for their inputs. As an alternate short form, "varvar" can be dropped from these commands; for example ife serves an an alias for ifvarvare.

WARNING: If the player already has full ammo for the specified <weapon>, execution of subsequent code is halted in a fashion similar to return.

However, if the player has full ammo, but doesn't have the weapon in question, the subsequent code will be executed.

Weapon Reference

The following table lists the available weapons in Duke Nukem 3D and its expansions, along with their internal index.

Exposed Value Label Description
No 0 KNEE_WEAPON Mighty Foot. Always available.
No 1 PISTOL_WEAPON Pistol. Player starts with this weapon unless the start is located on a HURTRAIL tile (picnum 859).
No 2 SHOTGUN_WEAPON Shotgun
No 3 CHAINGUN_WEAPON "Ripper" Chaingun
No 4 RPG_WEAPON Rocket Launcher (RPG)
No 5 HANDBOMB_WEAPON Pipebomb
No 6 SHRINKER_WEAPON Shrinker
No 7 DEVISTATOR_WEAPON Devastator
No 8 TRIPBOMB_WEAPON Laser Tripbomb
No 9 FREEZE_WEAPON Freezethrower
No 10 HANDREMOTE_WEAPON Pipebomb Detonator
No 11 GROW_WEAPON Expander (Plutonium Pack/Atomic Edition only)
No 12 FLAMETHROWER_WEAPON Incinerator (World Tour only)


Defines
define KNEE_WEAPON                        0
define PISTOL_WEAPON                      1
define SHOTGUN_WEAPON                     2
define CHAINGUN_WEAPON                    3
define RPG_WEAPON                         4
define HANDBOMB_WEAPON                    5
define SHRINKER_WEAPON                    6
define DEVISTATOR_WEAPON                  7
define TRIPBOMB_WEAPON                    8
define FREEZE_WEAPON                      9
define HANDREMOTE_WEAPON                 10
define GROW_WEAPON                       11
define FLAMETHROWER_WEAPON               12