include/game/item.h
Items: their definitions, types, flags and effects.
Included by menu_tables.c, ability_staging.h, battle_unit.h, game.h, inventory.h and shop.h.
Structures
| Name | Description | |
|---|---|---|
struct | EQUIP_EFFECT | One effect of an item while equipped: its kind (EQUIP_EFFECT_KIND) and amount. |
struct | ITEM_DEFINITION | An item's definition: its price, type, who can equip it, its bonuses and unleash, its effects and the action it is used for. |
Macros
| Name | Description | |
|---|---|---|
#define | ITEM_USE_FREE 0 | What using an item costs (ITEM_DEFINITION's useType). |
#define | ITEM_USE_CONSUMED 1 | one is used up |
#define | ITEM_USE_MAY_BREAK 2 | breaks one time in eight |
#define | ITEM_USE_TEACHES | |
#define | ITEM_USE_EMPTIES 4 | Hermes' Water leaves an Empty Bottle |
#define | EQUIP_EFFECT_SLOTS 4 | How many effects an item has while equipped (ITEM_DEFINITION.effects). |
#define | STAT_SCALE_ONE 10 | A multiplier of 10 tenths, which keeps a stat as it is: the classes' stats (CLASS_DEFINITION) and the EQUIP_EFFECT_SCALE_ effects are in tenths. |
#define | EQUIP_CHARACTER (character) (1 << (character)) | The equipMask bit of character (ISAAC to PIERS): gmItemCanUnitEquip reads bit unit->id of the mask. |
#define | EQUIP_ALL_CHARACTERS 0xff | Every one of the eight characters' bits. |
Enumerations
| Name | Description | |
|---|---|---|
enum | INVENTORY_ENCODING { INVENTORY_ITEM_ID_MASK, INVENTORY_EQUIPPED, INVENTORY_BROKEN … } | An inventory entry's parts, and a unit's slot count: bits 15 to 11 hold the quantity, 10 the broken mark, 9 the equipped mark and 8 to 0 the item id. |
enum | INVENTORY_REMOVE_RESULT { INVENTORY_REMOVE_EMPTY_SLOT, INVENTORY_REMOVE_ONE, INVENTORY … } | What gmInventoryRemove and gmInventoryDiscard return. |
enum | INVENTORY_EQUIP_RESULT { INVENTORY_EQUIP_DONE, INVENTORY_EQUIP_REFUSED, INVENTORY_EQU … } | What gmInventoryEquip returns. |
enum | INVENTORY_DISCARD_CHECK { INVENTORY_DISCARD_ALLOWED, INVENTORY_DISCARD_EMPTY_SLOT, INV … } | What gmInventoryCheckDiscard returns: whether an item may be dropped or sold, and why not. |
enum | ITEM_FLAGS { ITEM_CURSED, ITEM_CANNOT_UNEQUIP, ITEM_RARE, ITEM_INDISPENSA … } | The bits of ITEM_DEFINITION.flags. |
enum | EQUIPMENT_GROUP { EQUIPMENT_GROUP_NONE, EQUIPMENT_GROUP_WEAPON, EQUIPMENT_GROU … } | What kind of thing an item is (gmItemGetEquipmentGroup), which picks the comparison a shop shows. |
enum | ITEM_TYPE { ITEM_TYPE_NONE, ITEM_TYPE_WEAPON, ITEM_TYPE_ARMOR, ITEM_TYPE … } | An item's type (ITEM_DEFINITION's type, item_table.c's type field). |
enum | EQUIP_EFFECT_KIND { EQUIP_EFFECT_NONE, EQUIP_EFFECT_ADD_HP, EQUIP_EFFECT_ADD_HP_ … } | What an effect of an equipped item does (EQUIP_EFFECT.kind); the Item screen names each by MsgEquipEffectName + kind ("Max HP", "Luck"). |
Description
Items: their definitions, types, flags and effects.
Macros in detail
ITEM_USE_FREE
#define ITEM_USE_FREE 0
What using an item costs (ITEM_DEFINITION's useType).
nothing: it is kept, as equipment is
Referenced by btActionRunBuild() and mnItemMenuDrawItemDetails().
Definition at line 81 of file item.h.
ITEM_USE_CONSUMED
#define ITEM_USE_CONSUMED 1
one is used up
Referenced by btAIChooseAction(), btStagingRunItem(), fdUseItem(), ItemDefinitionTable, mnItemMenuDrawItemDetails(), mnItemUse() and scGomaCaveEntranceGiveShamansRod().
Definition at line 82 of file item.h.
ITEM_USE_MAY_BREAK
#define ITEM_USE_MAY_BREAK 2
breaks one time in eight
Referenced by btActionRunBuild(), btStagingRunItem(), ItemDefinitionTable, mnItemMenuDrawItemDetails(), mnItemMenuTryBreak() and mnShopRepairItem().
Definition at line 83 of file item.h.
ITEM_USE_TEACHES
#define ITEM_USE_TEACHES
Referenced by gmUnitRefreshPsynergy(), ItemDefinitionTable, mnItemCheckBattleUse(), mnItemClassifyUseMode() and mnItemMenuDrawItemDetails().
Definition at line 84 of file item.h.
ITEM_USE_EMPTIES
#define ITEM_USE_EMPTIES 4
Hermes' Water leaves an Empty Bottle
Referenced by btStagingRunItem(), ItemDefinitionTable, mnItemMenuDrawItemDetails() and mnItemUse().
Definition at line 87 of file item.h.
EQUIP_EFFECT_SLOTS
#define EQUIP_EFFECT_SLOTS 4
How many effects an item has while equipped (ITEM_DEFINITION.effects).
Referenced by gmEquipmentGetUnleashRateBonus(), gmFlagRefreshLureCap(), gmUnitCalculate() and mnItemMenuDrawItemDetails().
Definition at line 120 of file item.h.
STAT_SCALE_ONE
#define STAT_SCALE_ONE 10
A multiplier of 10 tenths, which keeps a stat as it is: the classes' stats
(CLASS_DEFINITION) and the EQUIP_EFFECT_SCALE_ effects are in tenths.
Referenced by gmUnitCalculate() and mnItemMenuDrawItemDetails().
Definition at line 123 of file item.h.
EQUIP_CHARACTER
#define EQUIP_CHARACTER(character) (1 << (character))
The equipMask bit of character (ISAAC to PIERS): gmItemCanUnitEquip reads
bit unit->id of the mask.
Referenced by ItemDefinitionTable.
Definition at line 187 of file item.h.
EQUIP_ALL_CHARACTERS
#define EQUIP_ALL_CHARACTERS 0xff
Every one of the eight characters' bits.
Referenced by ItemDefinitionTable.
Definition at line 189 of file item.h.
Enumerations in detail
INVENTORY_ENCODING
enum INVENTORY_ENCODING
An inventory entry's parts, and a unit's slot count: bits 15 to 11 hold the quantity, 10 the broken mark, 9 the equipped mark and 8 to 0 the item id.
| Enumerator | Value | Description |
|---|---|---|
INVENTORY_ITEM_ID_MASK | 0x1ff | |
INVENTORY_EQUIPPED | 0x200 | |
INVENTORY_BROKEN | 0x400 | |
INVENTORY_ENTRY_MASK | 0x7ff | The item id with its broken and equipped bits, all but the quantity. |
INVENTORY_QUANTITY_SHIFT | 11 | The quantity field holds the count less one; a stack (ITEM_STACKABLE) grows to INVENTORY_STACK_MAX (gmInventoryAddItem). |
INVENTORY_QUANTITY_STEP | 1 << INVENTORY_QUANTITY_SHIFT | One more in the |
INVENTORY_QUANTITY_MASK | 0xf800 | stack. |
INVENTORY_SLOTS | 15 | UNIT.inventory's entries. |
INVENTORY_STACK_MAX | 30 | The most items a stack holds. |
Definition at line 14 of file item.h.
INVENTORY_REMOVE_RESULT
enum INVENTORY_REMOVE_RESULT
What gmInventoryRemove and gmInventoryDiscard return.
| Enumerator | Value | Description |
|---|---|---|
INVENTORY_REMOVE_EMPTY_SLOT | -1 | nothing was there to take |
INVENTORY_REMOVE_ONE | 1 | the stack is one smaller |
INVENTORY_REMOVE_LAST | 2 | the last one left its slot, and the slots after it moved up |
Definition at line 34 of file item.h.
INVENTORY_EQUIP_RESULT
enum INVENTORY_EQUIP_RESULT
What gmInventoryEquip returns.
| Enumerator | Value | Description |
|---|---|---|
INVENTORY_EQUIP_DONE | 0 | equipped, or it was already |
INVENTORY_EQUIP_REFUSED | -1 | the character cannot equip it |
INVENTORY_EQUIP_STUCK | -2 | the item it would replace is cursed on (ITEM_CANNOT_UNEQUIP) |
Definition at line 43 of file item.h.
INVENTORY_DISCARD_CHECK
enum INVENTORY_DISCARD_CHECK
What gmInventoryCheckDiscard returns: whether an item may be dropped or sold,
and why not.
| Enumerator | Value | Description |
|---|---|---|
INVENTORY_DISCARD_ALLOWED | 0 | |
INVENTORY_DISCARD_EMPTY_SLOT | -1 | |
INVENTORY_DISCARD_STUCK | -3 | Equipped and cursed on: the shop shows "Can't remove." |
INVENTORY_DISCARD_INDISPENSABLE | -4 | An important item (ITEM_INDISPENSABLE): the shop shows "Can't drop." |
Definition at line 53 of file item.h.
ITEM_FLAGS
enum ITEM_FLAGS
The bits of ITEM_DEFINITION.flags.
| Enumerator | Value | Description |
|---|---|---|
ITEM_CURSED | 1 | Equipping it curses the wearer (UNIT.curse). |
ITEM_CANNOT_UNEQUIP | 2 | Once equipped it cannot be taken off, or dropped while worn. |
ITEM_RARE | 4 | A rare item: "A rare item" on the Item screen, the shop's MsgRareSellOffer, and second rank among the spoils (btSpoilsRankItem). |
ITEM_INDISPENSABLE | 8 | "An important item" on the Item screen: never dropped, worth nothing to a shop (mnShopSalePrice), and first among a battle's drops kept. |
ITEM_STACKABLE | 16 | Kept in one inventory entry with a quantity. |
Definition at line 64 of file item.h.
EQUIPMENT_GROUP
enum EQUIPMENT_GROUP
What kind of thing an item is (gmItemGetEquipmentGroup), which picks the
comparison a shop shows.
| Enumerator | Value | Description |
|---|---|---|
EQUIPMENT_GROUP_NONE | 0 | anything not a weapon or armor, rings |
EQUIPMENT_GROUP_WEAPON | 1 | included |
EQUIPMENT_GROUP_ARMOR | 2 | Armor, shields, helms, boots and shirts. |
Definition at line 91 of file item.h.
ITEM_TYPE
enum ITEM_TYPE
An item's type (ITEM_DEFINITION's type, item_table.c's type field). A unit
equips one item of each type, except Psynergy items.
| Enumerator | Value | Description |
|---|---|---|
ITEM_TYPE_NONE | 0 | not equipment: Herb, Game Ticket, the keys, unused rows |
ITEM_TYPE_WEAPON | 1 | swords, axes, maces, rods and staffs |
ITEM_TYPE_ARMOR | 2 | armor, clothes and robes |
ITEM_TYPE_SHIELD | 3 | shields, gloves and armlets |
ITEM_TYPE_HELM | 4 | helms, caps, crowns and circlets |
ITEM_TYPE_BOOTS | 5 | Hyper Boots to Turtle Boots |
ITEM_TYPE_PSYNERGY | 6 | items that teach Psynergy while held: Orb of Force to Catch Beads |
ITEM_TYPE_UNUSED | 7 | no row of item_table.c has it; listed as equipment |
ITEM_TYPE_RING | 8 | Adept Ring to Cleric's Ring |
ITEM_TYPE_SHIRT | 9 | Mythril Shirt, Silk Shirt, Running Shirt |
Definition at line 102 of file item.h.
EQUIP_EFFECT_KIND
enum EQUIP_EFFECT_KIND
What an effect of an equipped item does (EQUIP_EFFECT.kind); the Item screen
names each by MsgEquipEffectName + kind ("Max HP", "Luck").
| Enumerator | Value | Description |
|---|---|---|
EQUIP_EFFECT_NONE | ||
EQUIP_EFFECT_ADD_HP | ||
EQUIP_EFFECT_ADD_HP_REGEN | ||
EQUIP_EFFECT_ADD_PP | ||
EQUIP_EFFECT_ADD_PP_REGEN | ||
EQUIP_EFFECT_ADD_AGILITY | ||
EQUIP_EFFECT_ADD_LUCK | ||
EQUIP_EFFECT_SCALE_HP | ||
EQUIP_EFFECT_SCALE_HP_REGEN | ||
EQUIP_EFFECT_SCALE_PP | ||
EQUIP_EFFECT_SCALE_PP_REGEN | ||
EQUIP_EFFECT_SCALE_ATTACK | ||
EQUIP_EFFECT_SCALE_DEFENSE | ||
EQUIP_EFFECT_SCALE_AGILITY | ||
EQUIP_EFFECT_SCALE_LUCK | ||
EQUIP_EFFECT_ADD_VENUS_POWER | Element power and resistance, in the element order Venus, Mercury, Mars, Jupiter. | |
EQUIP_EFFECT_ADD_MERCURY_POWER | ||
EQUIP_EFFECT_ADD_MARS_POWER | ||
EQUIP_EFFECT_ADD_JUPITER_POWER | ||
EQUIP_EFFECT_ADD_VENUS_RESIST | ||
EQUIP_EFFECT_ADD_MERCURY_RESIST | ||
EQUIP_EFFECT_ADD_MARS_RESIST | ||
EQUIP_EFFECT_ADD_JUPITER_RESIST | ||
EQUIP_EFFECT_ADD_UNLEASH_CHANCE | "Critical Hits increase": each point adds a percent to the weapon's unleash chance and half a percent to a plain attack's chance of a critical hit. | |
EQUIP_EFFECT_ADD_COUNTERSTRIKE_RATE | Summed by gmUnitCalculate into equipBonus[1]; no item of item_table.c has it, the item menu draws no line for it, and nothing reads the total. | |
EQUIP_EFFECT_CURSE_REMOVABLE | "The curse can be removed": sets CURSE_REMOVABLE, which lifts CURSE_BOUND. | |
EQUIP_EFFECT_ADD_ACTIONS | more actions each turn | |
EQUIP_EFFECT_LURE | sets FLAG_LURE_CAP while worn: encounters come faster |
Definition at line 127 of file item.h.