Jump to content

Addinventory

From EDukeWiki

addinventory <index> <amount>

If used with inventory items (i.e. Steroids, Portable Medkit, Jetpack, etc.) it sets the current amount of item <index> to the exact specified value <amount> for the nearest player.

If used with armor (i.e. <index> == 1), it instead adds the specified value to the current armor value of the nearest player. If <amount> is negative, it will subtract armor from that player (which can become negative).

If used with access cards (<index> == 6), then <amount> is ignored, and instead the palette of the calling sprite will be used to determine which keycard to give to the nearest player.

All other values for <index> will cause an error to be printed.

Inventory Reference

The following values are used with addinventory and ifpinventory. Not be to be confused with inven_icon.

ExposedValueLabelDescription
No0GET_STEROIDSSteroids Powerup. 100% equals an inventory amount of 400.
If amount < 400, then it will automatically activate and begin counting down by 1 every game tic until it reaches 0.
If amount > 400, the item cannot be used.
No1GET_SHIELDArmor. In eduke32, the upper bound is max_shield_amount. In Duke 1.5, the upper bound for armor was set by max_player_health.
No2GET_SCUBAScuba Gear. 100% equals an inventory amount of 6400.
Activates automatically when underwater, and decreases by 1 every gametic until it reaches 0.
No3GET_HOLODUKEHoloduke. 100% equals an inventory amount of 2400. Decreases by 1 every gametic while active.
No4GET_JETPACKJetpack. 100% equals an inventory amount of 1600. Decreases by 1 every gametic while active.
No5GET_DUMMY1Reserved, unused.
No6GET_ACCESSAccess Card. Identified by palette: Blue: 0, Red: 21, Yellow: 23
No7GET_HEATSNight Vision Goggles. 100% equals an inventory amount of 1200. Decreases by 1 every gametic while active.
No8GET_DUMMY2Reserved, unused.
No9GET_FIRSTAIDPortable Medkit. 100% equals an inventory amount of 100. Upper bound is directly tied to max_player_health.
No10GET_BOOTSProtective Boots. 100% equals an inventory amount of 200.
Decreased by 2 every time the player is supposed to take damage from HURTRAIL, FLOORSLIME, or FLOORPLASMA.
Decreased by 1 every time the player is supposed to take damage from BLOODPOOL with pal 0.
Decreased by 1 every gametic as long as the player is in a sector with PURPLELAVA as floor or ceiling tile.
Defines
define GET_STEROIDS                  0
define GET_SHIELD                    1
define GET_SCUBA                     2
define GET_HOLODUKE                  3
define GET_JETPACK                   4
define GET_DUMMY1                    5
define GET_ACCESS                    6
define GET_HEATS                     7
define GET_DUMMY2                    8
define GET_FIRSTAID                  9
define GET_BOOTS                    10