Addweapon: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''addweapon''' <weapon> <amount><br>
<span {{code}}>'''addweapon''' <weapon> <amount> </span>
'''addweaponvar''' <weapon> <amount>


'''addweapon''' adds ''weapon'' with ''amount'' of ammo to the nearest player.
<span {{code}}>'''addweaponvar''' <weapon> <amount> </span>


If the player already has ''weapon'' with full ammo, execution of subsequent code is halted in a fashion similar to [[return]].


''weapon'' can be one of the following, taken from ''duke3d.h'' and ''DEFS.CON'':
Gives the specified ''<weapon>'' with ''<amount>'' ammo to the nearest player.


    KNEE_WEAPON
{{varsuffix}}
    PISTOL_WEAPON
 
    SHOTGUN_WEAPON
'''WARNING:''' If the player already has full ammo for the specified ''<weapon>'', execution of subsequent code is halted in a fashion similar to [[return]].
    CHAINGUN_WEAPON
 
    RPG_WEAPON
However, if the player has full ammo, but doesn't have the weapon in question, the subsequent code will be executed.
    HANDBOMB_WEAPON
 
    SHRINKER_WEAPON
==Weapon Reference==
    DEVISTATOR_WEAPON
{{Weapons}}
    TRIPBOMB_WEAPON
    FREEZE_WEAPON
    HANDREMOTE_WEAPON
    GROW_WEAPON


{{varsuffix}}


[[Category:Duke3D 1.3/1.5 commands]]
[[Category:Duke3D 1.3/1.5 commands]]
[[Category:Player manipulation]]
[[Category:Player manipulation]]

Latest revision as of 16:09, 17 November 2021

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