108 ownerCursor = owners;
110 if (ownerIndex < ownerCount) {
115 }
while (ownerIndex < ownerCount);
126 s16 *ownerCursor = owners;
128 if (freeSlots < ownerCount) {
129 s32 remainingOwners = ownerCount;
134 }
while (remainingOwners != 0);
196 ownerCursor = owners;
198 if (ownerIndex < ownerCount) {
200 s16 ownerId = *ownerCursor++;
205 }
while (ownerIndex < ownerCount);
239 ownerCursor = owners;
241 if (ownerIndex < ownerCount) {
243 owner = *ownerCursor++;
247 }
while (ownerIndex < ownerCount);
272 for (equippedSlot = 0; equippedSlot <
INVENTORY_SLOTS; equippedSlot++) {
379 if (removalResult != -1) {
383 return removalResult;
462 s32 counter_slot = index;
466 if (counter_slot <= 127) {
467 s32 value = data[counter_slot];
473 }
else if (value > 99) {
479 data[counter_slot] = value;
531 if (itemCount < ownerCount) {
532 u16 *ownerCursor = owners;
533 s32 remainingOwners = ownerCount;
538 }
while (remainingOwners != 0);
void Event_ClearInvalidPackedValuesFar(void)
u8 gItem_ArtifactSlotTable[]
struct ItemDefinition gItem_DefinitionTable[]
What every part of the game object shares: its includes and the inventory helper two parts use.
struct GameState gGameState
u8 Item_GetTargetMode(s32 itemId)
Returns how the action an item performs when used picks its targets.
s32 PartyInventory_Discard(s32 itemId)
Discards one itemId from whoever carries it first, as Inventory_Discard does; always returns 0.
s32 PartyInventory_HasSpace(void)
Returns 1 when the selected character or any party member has a free inventory slot.
struct ItemDefinition * Inventory_GetEquippedDefinition(struct BattleUnit *unit, s32 type)
Returns the definition of the unit's equipped item of type, or NULL.
s32 Inventory_FindEquipped(s32 owner, s32 type)
Returns the slot of the equipped item of type, or -1.
s32 Inventory_CheckDiscard(s32 owner, s32 slot)
Returns whether the item in slot may be dropped: 0 yes, -1 the slot is empty, -4 the item is indispen...
s32 Inventory_GetEquippedItem(struct BattleUnit *unit, s32 type)
Returns the id of the unit's equipped item of type, or 0.
s32 Inventory_GetQuantity(s32 owner, s32 slot)
Returns how many of the item in slot the unit carries (0 for an empty slot).
s32 Inventory_AddItem(s32 owner, s32 itemId)
Gives a unit one item, joining its first matching stack (up to 30) or taking the first free slot.
s32 Item_IsCompatibleWithOwner(s32 unit, s32 item)
Returns 1 for an item that is not a weapon or armor, and for those whether the character can equip it...
s32 Inventory_Count(s32 owner)
Counts filled inventory slots up to the first empty slot; the inventory is kept closed up,...
s32 Inventory_Equip(s32 owner, s32 slot)
Equips the item in slot, clearing the equipped bit of the item of the same type it replaces.
struct ItemDefinition * Item_GetDirect(s32 item)
Returns item item's definition; an inventory entry may be passed, its equipped and quantity bits are ...
s32 ItemCounter_Adjust(s32 index, s32 delta)
Adds delta to rare item counter index, kept between 0 and 99, and returns the new count (0 for an ind...
s32 PartyInventory_CountItem(s32 itemId)
Counts itemId across the party.
s32 Inventory_Repair(s32 owner, s32 slot)
Clears the broken mark of the item in slot; returns -1 for an empty slot.
s32 Inventory_Discard(s32 owner, s32 slot)
Removes one item as Inventory_Remove does, and puts a rare item back into circulation (its counter go...
s32 Inventory_Find(s32 owner, s32 itemId)
Returns the first slot holding itemId (any quantity, equipped or not), or -1.
s32 Inventory_CountItem(s32 owner, s32 itemId)
Counts matching nonstackable items, or the quantity in the first matching stack.
s32 PartyInventory_CountFreeSlots(void)
Returns the free inventory slots of the whole party.
s32 Inventory_Remove(s32 owner, s32 slot)
Takes one item out of slot: a stack shrinks by one (returns 1), a last item empties the slot and the ...
s32 PartyInventory_FindOwner(s32 itemId)
Returns who carries itemId, asking the selected character first, or -1.
s32 Item_GetEquipmentGroup(s32 itemId)
Returns what kind of thing an item is: 1 a weapon, 2 armor (armor, shields, helms,...
s32 PartyInventory_Add(s32 itemId)
Gives the item to the first party member with room.
s32 Item_AdjustCounter(s32 itemId, s32 delta)
Adds delta to the counter of a rare item; ordinary items have none.
s32 Inventory_Break(s32 owner, s32 slot)
Marks the item in slot broken; returns -1 for an empty slot.
s32 Item_CanOwnerEquipDirect(s32 owner, s32 item)
Returns whether the character can equip item: bit classId of the item's equipMask.
s32 PartyInventory_Remove(s32 itemId)
Removes one itemId from whoever carries it first; always returns 0.
@ ITEM_TYPE_ARMOR
armor, clothes and robes
@ ITEM_TYPE_HELM
helms, caps, crowns and circlets
@ ITEM_TYPE_SHIELD
shields, gloves and armlets
@ ITEM_TYPE_PSYNERGY
The items that teach Psynergy while held: Orb of Force to Catch Beads.
@ ITEM_TYPE_WEAPON
swords, axes, maces, rods and staffs
@ ITEM_TYPE_SHIRT
Mythril Shirt, Silk Shirt, Running Shirt.
@ ITEM_TYPE_BOOTS
Hyper Boots to Turtle Boots.
@ INVENTORY_QUANTITY_STEP
@ INVENTORY_QUANTITY_MASK
@ INVENTORY_QUANTITY_SHIFT
s32 Unit_RefreshPsynergy(s32 owner)
Rebuilds a character's Psynergy list: drops the actions its class and items gave, closes up the list,...
struct BattleAct * BattleAction_GetDirect(s32 actionId)
Returns the definition of action actionId (its low 14 bits); an id past the table gives the first.
s32 Party_ListActiveOwners(s16 *owners)
Writes the party members to owners, ending with 0xff, and returns how many there are.
u8 targetMode
TARGET_MODE_NONE, _FOES, _ALLIES or _SELF.
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
u8 classId
Who the unit is: a character's id (ISAAC to JENNA, below 8) or an enemy's id (BattleUnitSet).
u16 inventory[15]
Items held, one entry each: bits 15..11 quantity | 10 broken | 9 equipped | 8..0 item id (INVENTORY_*...
s32 selectedActor
the leader: its unit and its actor
An item's definition: its price, type, who can equip it, its bonuses and unleash, its effects and the...
u8 type
enum ItemType; 0 for an item that is not equipment
u16 equipMask
one bit per character that can equip it, bit 0 Isaac
void UnitCalc(s32 owner)
Recomputes a unit's stats from its base stats, equipment, set Djinn, class and battle stat levels,...
struct BattleUnit * UnitGet(u32 owner)
Returns the unit record of owner: 0 to 7 are the playable characters in the game state,...