PowerQuest 0.17.3
IInventory Interface Reference

Detailed Description

Inventory: Contains functions and data for manipluating Inventory Items - Eg.

    I.RubberChicken.Add();
    I.Active.Description = "A rubber chicken with a pulley in the middle"           
    if ( I.Sword.Active )
        Display: You can't use a sword on that
    if ( I.HeavyRock.EverCollected )
        Dave: I'm not lugging any more of those around          

Properties

string Description [get, set]
 Gets/Sets the name shown to players. More...
 
string Anim [get, set]
 Use for setting the Gui AND cursor sprite/animation for the inventory item. Useful if the same sprite is used on both the gui and the cursor. More...
 
string AnimGui [get, set]
 Use for setting the sprite/animation for the inventory item on the Gui. More...
 
string AnimCursor [get, set]
 Use for setting the sprite/animation for the inventory item for the cursor. More...
 
string AnimCursorInactive [get, set]
 Use for setting the sprite/animation for the inventory item for the cursor, when not over a clickable object. More...
 
string ScriptName [get]
 The name used in scripts. More...
 
bool Active [get, set]
 Whether this item is the active item for the current player (ie: selected item to use on stuff) More...
 
bool Owned [get, set]
 Whether the current player has the item in their inventory. More...
 
bool EverCollected [get]
 Whether the item has ever been collected. More...
 
bool FirstUse [get]
 Returns true the first time the player "uses" the object. More...
 
bool FirstLook [get]
 Returns true the first time the player "looked" at the object. More...
 
int UseCount [get]
 Returns the number of times player has "used" at the object. 0 when it's the first click on the object. More...
 
int LookCount [get]
 Returns the number of times player has "looked" at the object. 0 when it's the first click on the object. More...
 
Inventory Data [get]
 Access to the base class with extra functionality used by the PowerQuest. More...
 

Public Member Functions

void Add (int quantity=1)
 Gives the inventory item to the current player. Same as C.Player.AddInventory(item) More...
 
void AddAsActive (int quantity=1)
 Gives the inventory item to the current player and set's it as active inventory. Same as C.Player.AddInventory(item) More...
 
void Remove (int quantity=1)
 Removes the item from the current player. Same as C.Player.RemoveInventory(item) More...
 
void SetActive ()
 Sets this item as the active item for the current player (ie: selected item to use on stuff) More...
 
GetScript< T > ()
 PowerQuest internal function: Access to the specific quest script for the object. Use the specific item class as the templated parameter so you can access specific members of the script. Eg: GetScript<InventoryKey>().m_inDoor = true;. More...
 

Property Documentation

◆ Description

string Description
getset

Gets/Sets the name shown to players.

◆ Anim

string Anim
getset

Use for setting the Gui AND cursor sprite/animation for the inventory item. Useful if the same sprite is used on both the gui and the cursor.

◆ AnimGui

string AnimGui
getset

Use for setting the sprite/animation for the inventory item on the Gui.

◆ AnimCursor

string AnimCursor
getset

Use for setting the sprite/animation for the inventory item for the cursor.

◆ AnimCursorInactive

string AnimCursorInactive
getset

Use for setting the sprite/animation for the inventory item for the cursor, when not over a clickable object.

◆ ScriptName

string ScriptName
get

The name used in scripts.

◆ Active

bool Active
getset

Whether this item is the active item for the current player (ie: selected item to use on stuff)

◆ Owned

bool Owned
getset

Whether the current player has the item in their inventory.

◆ EverCollected

bool EverCollected
get

Whether the item has ever been collected.

◆ FirstUse

bool FirstUse
get

Returns true the first time the player "uses" the object.

◆ FirstLook

bool FirstLook
get

Returns true the first time the player "looked" at the object.

◆ UseCount

int UseCount
get

Returns the number of times player has "used" at the object. 0 when it's the first click on the object.

◆ LookCount

int LookCount
get

Returns the number of times player has "looked" at the object. 0 when it's the first click on the object.

◆ Data

Inventory Data
get

Access to the base class with extra functionality used by the PowerQuest.

Member Function Documentation

◆ Add()

void Add ( int  quantity = 1)

Gives the inventory item to the current player. Same as C.Player.AddInventory(item)

◆ AddAsActive()

void AddAsActive ( int  quantity = 1)

Gives the inventory item to the current player and set's it as active inventory. Same as C.Player.AddInventory(item)

◆ Remove()

void Remove ( int  quantity = 1)

Removes the item from the current player. Same as C.Player.RemoveInventory(item)

◆ SetActive()

void SetActive ( )

Sets this item as the active item for the current player (ie: selected item to use on stuff)

◆ GetScript< T >()

T GetScript< T > ( )

PowerQuest internal function: Access to the specific quest script for the object. Use the specific item class as the templated parameter so you can access specific members of the script. Eg: GetScript<InventoryKey>().m_inDoor = true;.

Type Constraints
T :InventoryScript<T>