The game object class for handling skills, items, weapons, and armor. It is required because save data should not include the database object itself.
Methods
- Initialize the item
Name Type Description item
Object The item data object to convert to game item object - Check if this item is an armor
Returns:
Type Description boolean True if armor - Check if this item is an equip item (weapon or armor)
Returns:
Type Description boolean True if weapon or armor - Check if this item is an item
Returns:
Type Description boolean True if item - Check if this item is null
Returns:
Type Description boolean True if null - Check if this item is a skill
Returns:
Type Description boolean True if skill - Check if this item is usable (item or skill)
Returns:
Type Description boolean True if item or skill - Check if this item is a weapon
Returns:
Type Description boolean True if weapon - Get the item id
Returns:
Type Description number The item's id - Get the item data object
Returns:
Type Description Object|null The item data object, or null if no item - Sets an equip item
Name Type Description isWeapon
boolean If the item is a weapon or armor itemId
number The item's id - Converts an item data object to an item game object
Name Type Description item
Object The item data object to convert