Ifpinventory

From EDukeWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

ifpinventory <item> <value> { success_branch... }

For all inventory items, as well as for armor, the success_branch will be taken if the nearest player's amount of <item> is not equal to <value>.

For access cards (<item> == GET_ACCESS), the <value> parameter is ignored, and the success_branch will be taken whenever the nearest player currently owns the access card identified by the palette of the calling actor.


In other words, if ifpinventory 6 0 { ... } is called in the actor code of a switch with palette 21, it will take the success branch if the nearest player currently has the red keycard.

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