Addinventory

From EDukeWiki
Revision as of 06:28, 10 January 2021 by Doom64hunter (talk | contribs) (Improve the documentation and add missing items)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

Exposed Value Label Description
No 0 GET_STEROIDS Steroids 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.
No 1 GET_SHIELD Armor. In eduke32, the upper bound is max_shield_amount. In Duke 1.5, the upper bound for armor was set by max_player_health.
No 2 GET_SCUBA Scuba Gear. 100% equals an inventory amount of 6400.
Activates automatically when underwater, and decreases by 1 every gametic until it reaches 0.
No 3 GET_HOLODUKE Holoduke. 100% equals an inventory amount of 2400. Decreases by 1 every gametic while active.
No 4 GET_JETPACK Jetpack. 100% equals an inventory amount of 1600. Decreases by 1 every gametic while active.
No 5 GET_DUMMY1 Reserved, unused.
No 6 GET_ACCESS Access Card. Identified by palette: Blue: 0, Red: 21, Yellow: 23
No 7 GET_HEATS Night Vision Goggles. 100% equals an inventory amount of 1200. Decreases by 1 every gametic while active.
No 8 GET_DUMMY2 Reserved, unused.
No 9 GET_FIRSTAID Portable Medkit. 100% equals an inventory amount of 100. Upper bound is directly tied to max_player_health.
No 10 GET_BOOTS Protective 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