|
API
Functions and classes available in the Lua API
|
#include <0016.h>
Public Member Functions | |
| cItem (void) | |
| Creates an empty item. | |
| cItem (short a_ItemType, char a_ItemCount=1, short a_ItemDamage=0, const AString &a_Enchantments="") | |
| Creates an item of the specified type, by default 1 piece with no damage and no enchantments. | |
| void | Clear (void) |
| cItem | CopyOne (void) const |
| Returns a copy of this item with m_ItemCount set to 1. Useful to preserve enchantments etc. on stacked items. | |
| bool | DamageItem (short a_Amount=1) |
| Damages a weapon / tool. Returns true when damage reaches max value and the item should be destroyed. | |
| void | Empty (void) |
| short | GetMaxDamage (void) const |
| Returns the maximum damage value that this item can have; zero if damage is not applied. | |
| bool | IsDamageable (void) const |
| bool | IsEmpty (void) const |
| bool | IsEqual (const cItem &a_Item) const |
| bool | IsSameType (const cItem &a_Item) const |
| bool | IsStackableWith (const cItem &a_OtherStack) const |
| Returns true if this itemstack can stack with the specified stack (types match, enchantments etc.) ItemCounts are ignored! | |
Static Public Member Functions | |
| static bool | IsEnchantable (short a_ItemType) |
Public Attributes | |
| cEnchantments | m_Enchantments |
| char | m_ItemCount |
| short | m_ItemDamage |
| short | m_ItemType |
|
inline |
Creates an empty item.
|
inline |
Creates an item of the specified type, by default 1 piece with no damage and no enchantments.
|
inline |
| cItem cItem::CopyOne | ( | void | ) | const |
Returns a copy of this item with m_ItemCount set to 1. Useful to preserve enchantments etc. on stacked items.
| bool cItem::DamageItem | ( | short | a_Amount = 1 | ) |
Damages a weapon / tool. Returns true when damage reaches max value and the item should be destroyed.
|
inline |
| short cItem::GetMaxDamage | ( | void | ) | const |
Returns the maximum damage value that this item can have; zero if damage is not applied.
|
inline |
|
inline |
|
static |
|
inline |
|
inline |
| bool cItem::IsStackableWith | ( | const cItem & | a_OtherStack | ) | const |
Returns true if this itemstack can stack with the specified stack (types match, enchantments etc.) ItemCounts are ignored!
| cEnchantments cItem::m_Enchantments |
| char cItem::m_ItemCount |
| short cItem::m_ItemDamage |
| short cItem::m_ItemType |
1.8.1.2