2021-07-07 11:39:34 -05:00
|
|
|
#ifndef GUARD_ITEMS_H
|
|
|
|
#define GUARD_ITEMS_H
|
2021-05-15 16:59:55 -07:00
|
|
|
|
2021-09-28 12:50:36 -04:00
|
|
|
#include "constants/item.h"
|
2021-07-17 18:45:13 +02:00
|
|
|
#include "code_8092334.h"
|
|
|
|
|
2023-07-17 22:16:42 -04:00
|
|
|
// size: 0x20
|
2023-09-02 01:46:26 -04:00
|
|
|
typedef struct ItemDataEntry
|
2021-05-15 16:59:55 -07:00
|
|
|
{
|
2023-01-08 04:23:00 -05:00
|
|
|
/* 0x0 */ u8 *name;
|
2021-05-15 16:59:55 -07:00
|
|
|
/* 0x4 */ u32 buyPrice;
|
|
|
|
/* 0x8 */ u32 sellPrice;
|
2023-01-08 04:23:00 -05:00
|
|
|
/* 0xC */ u8 category;
|
2021-05-15 16:59:55 -07:00
|
|
|
/* 0xD */ u8 icon;
|
2023-01-08 04:23:00 -05:00
|
|
|
/* 0x10 */ u8 *description;
|
2021-09-09 19:22:48 -04:00
|
|
|
// Determines how the AI can use the item.
|
|
|
|
// Index 0: Item can be used on self.
|
|
|
|
// Index 1: Item can be thrown at allies.
|
|
|
|
// Index 2: Item can be thrown at enemies.
|
|
|
|
/* 0x14 */ bool8 aiFlags[3];
|
2023-01-08 04:23:00 -05:00
|
|
|
/* 0x18 */ s16 moveID;
|
2021-05-15 16:59:55 -07:00
|
|
|
/* 0x1A */ u8 order; // Numbered order they are in storage
|
2023-01-28 18:29:52 -05:00
|
|
|
/* 0x1B */ u8 spawnAmountRange[2];
|
2021-05-15 16:59:55 -07:00
|
|
|
/* 0x1D */ u8 palette;
|
2023-01-08 04:23:00 -05:00
|
|
|
/* 0x1E */ u8 actionType;
|
2023-09-02 01:46:26 -04:00
|
|
|
} ItemDataEntry;
|
2021-05-15 16:59:55 -07:00
|
|
|
|
2023-07-17 22:16:42 -04:00
|
|
|
// size: 0x4
|
2023-09-02 01:46:26 -04:00
|
|
|
typedef struct Item
|
2021-07-07 11:39:34 -05:00
|
|
|
{
|
2023-07-17 22:16:42 -04:00
|
|
|
/* 0x0 */ u8 flags;
|
|
|
|
/* 0x1 */ u8 quantity;
|
|
|
|
/* 0x2 */ u8 id;
|
2023-09-02 01:46:26 -04:00
|
|
|
} Item;
|
2021-07-07 11:39:34 -05:00
|
|
|
|
2023-07-17 22:16:42 -04:00
|
|
|
// size: 0x4
|
2023-09-02 01:46:26 -04:00
|
|
|
typedef struct BulkItem
|
2023-07-17 22:16:42 -04:00
|
|
|
{
|
|
|
|
/* 0x0 */ u8 id;
|
|
|
|
/* 0x1 */ u8 quantity;
|
2023-09-02 01:46:26 -04:00
|
|
|
} BulkItem;
|
2021-07-07 11:39:34 -05:00
|
|
|
|
2023-07-17 22:16:42 -04:00
|
|
|
// size: 0x4
|
2023-09-02 01:46:26 -04:00
|
|
|
typedef struct Gummi
|
2021-07-12 21:10:32 +02:00
|
|
|
{
|
2023-07-17 22:16:42 -04:00
|
|
|
/* 0x0 */ s16 boostAmount;
|
|
|
|
/* 0x2 */ u16 flags;
|
2023-09-02 01:46:26 -04:00
|
|
|
} Gummi;
|
2021-07-12 21:10:32 +02:00
|
|
|
|
2023-07-17 22:16:42 -04:00
|
|
|
// size: 0xC
|
2023-09-02 01:46:26 -04:00
|
|
|
typedef struct unkStruct_8090F58
|
2021-07-17 18:45:13 +02:00
|
|
|
{
|
|
|
|
u32 unk0;
|
|
|
|
u8 unk4;
|
|
|
|
u8 unk5;
|
|
|
|
s16 unk6;
|
|
|
|
u8 unk8;
|
2023-09-02 01:46:26 -04:00
|
|
|
} unkStruct_8090F58;
|
|
|
|
|
|
|
|
// size: 0x268
|
|
|
|
typedef struct TeamInventory
|
|
|
|
{
|
|
|
|
/* 0x0 */ Item teamItems[INVENTORY_SIZE];
|
|
|
|
/* 0x50 */ u16 teamStorage[STORAGE_SIZE];
|
|
|
|
/* 0x230 */ BulkItem kecleonShopItems[MAX_KECLEON_ITEM_SHOP_ITEMS];
|
|
|
|
/* 0x250 */ BulkItem kecleonWareItems[MAX_KECLEON_WARE_SHOP_ITEMS];
|
|
|
|
/* 0x260 */ s32 teamMoney;
|
|
|
|
/* 0x264 */ s32 teamSavings;
|
|
|
|
} TeamInventory;
|
2021-07-17 18:45:13 +02:00
|
|
|
|
2021-09-09 19:22:48 -04:00
|
|
|
enum ItemFlag
|
|
|
|
{
|
|
|
|
ITEM_FLAG_EXISTS = 1 << 0,
|
2023-07-12 20:19:38 -07:00
|
|
|
ITEM_FLAG_IN_SHOP = 1 << 1, // in a Kecleon shop
|
|
|
|
ITEM_FLAG_UNPAID = 1 << 2, // Picked up in Kecleon shop but not paid for yet
|
2021-09-09 19:22:48 -04:00
|
|
|
ITEM_FLAG_STICKY = 1 << 3,
|
|
|
|
ITEM_FLAG_SET = 1 << 4 // This item can be thrown by pressing L+R instead of having to go to the bag menu.
|
|
|
|
};
|
|
|
|
|
2021-11-13 19:59:20 -05:00
|
|
|
enum ItemAIFlag
|
|
|
|
{
|
|
|
|
ITEM_AI_FLAG_TARGET_SELF,
|
|
|
|
ITEM_AI_FLAG_TARGET_ALLY,
|
|
|
|
ITEM_AI_FLAG_TARGET_ENEMY
|
|
|
|
};
|
|
|
|
|
2023-09-02 01:46:26 -04:00
|
|
|
extern TeamInventory *gTeamInventoryRef;
|
2023-01-28 18:29:52 -05:00
|
|
|
|
2021-06-09 22:54:21 -05:00
|
|
|
void LoadItemParameters(void);
|
2023-09-02 01:46:26 -04:00
|
|
|
TeamInventory *GetMoneyItemsInfo(void);
|
2021-06-09 22:54:21 -05:00
|
|
|
void InitializeMoneyItems(void);
|
2021-10-19 17:48:38 -07:00
|
|
|
s32 GetNumberOfFilledInventorySlots(void);
|
2023-01-08 04:23:00 -05:00
|
|
|
bool8 IsThrowableItem(u8 id);
|
2023-09-02 01:46:26 -04:00
|
|
|
void xxx_init_itemslot_8090A8C(Item *param_1,u8 id,u8 param_3);
|
|
|
|
void xxx_init_helditem_8090B08(BulkItem *param_1,u8 id);
|
|
|
|
void HeldItemToSlot(Item *param_1, BulkItem *param_2);
|
|
|
|
void SlotToHeldItem(BulkItem *held, Item *slot);
|
2023-01-08 04:23:00 -05:00
|
|
|
u8 GetItemCategory(u8 index);
|
2023-09-02 01:46:26 -04:00
|
|
|
s32 GetStackBuyValue(Item *param_1);
|
|
|
|
s32 GetStackSellValue(Item *param_1);
|
|
|
|
s32 GetStackBuyPrice(Item *param_1);
|
|
|
|
s32 GetStackSellPrice(Item *param_1);
|
2023-01-08 04:23:00 -05:00
|
|
|
s32 GetItemBuyPrice(u8 id);
|
|
|
|
s32 GetItemSellPrice(u8 id);
|
|
|
|
s32 GetItemOrder(u8 id);
|
|
|
|
u8 GetItemPalette(u8 id);
|
|
|
|
u32 GetItemActionType(u8 id);
|
2023-01-28 18:29:52 -05:00
|
|
|
u32 GetSpawnAmountRange(u8 id, u32 r1);
|
2023-01-08 04:23:00 -05:00
|
|
|
u8 *GetItemDescription(u8 id);
|
|
|
|
bool8 GetItemAIFlag(u8 id, u32 r1);
|
2023-09-03 00:13:15 -04:00
|
|
|
void BufferItemName(u8 *, u8, unkStruct_8090F58 *);
|
2023-09-02 01:46:26 -04:00
|
|
|
void sub_8090E14(u8 *ext_buffer, Item *slot, unkStruct_8090F58 *);
|
|
|
|
bool8 AddItemToInventory(const Item* slot);
|
2021-07-10 18:23:20 +02:00
|
|
|
void ConvertMoneyItemToMoney();
|
|
|
|
void AddToTeamMoney(s32 amount);
|
2023-09-02 01:46:26 -04:00
|
|
|
u32 GetMoneyValue(Item* slot);
|
2023-01-08 04:23:00 -05:00
|
|
|
u16 GetItemMoveID(u8 index);
|
2021-07-17 18:45:13 +02:00
|
|
|
bool8 CanSellItem(u32 id);
|
2021-07-12 21:10:32 +02:00
|
|
|
bool8 IsGummiItem(u8);
|
2021-10-19 17:48:38 -07:00
|
|
|
void ShiftItemsDownFrom(s32 start);
|
2022-03-13 17:48:04 -07:00
|
|
|
void ClearItemSlotAt(u32 index);
|
2023-09-02 01:46:26 -04:00
|
|
|
void MoveToStorage(Item *slot);
|
2023-01-13 17:41:45 -08:00
|
|
|
s32 CountKecleonShopItems(void);
|
|
|
|
void InitKecleonShopItem(u8 index);
|
2023-09-02 01:46:26 -04:00
|
|
|
BulkItem *GetKecleonShopItem(u8 index);
|
2023-01-13 17:41:45 -08:00
|
|
|
void FillKecleonShopGaps(void);
|
|
|
|
void SortKecleonShopInventory(void);
|
2022-12-27 10:28:32 -08:00
|
|
|
void ChooseKecleonShopInventory(u8 index);
|
2023-01-13 17:41:45 -08:00
|
|
|
bool8 AddKecleonShopItem(u8 itemIndex);
|
|
|
|
u32 CountKecleonWareItems(void);
|
|
|
|
void InitKecleonWareItem(u8 index);
|
2023-09-02 01:46:26 -04:00
|
|
|
BulkItem* GetKecleonWareItem(u8 index);
|
2023-01-13 17:41:45 -08:00
|
|
|
void FillKecleonWareGaps(void);
|
|
|
|
void SortKecleonWareInventory(void);
|
|
|
|
void ChooseKecleonWareInventory(u8 index);
|
|
|
|
bool8 AddKecleonWareItem(u8 itemIndex);
|
2021-10-19 17:48:38 -07:00
|
|
|
void FillInventoryGaps();
|
2023-09-02 01:46:26 -04:00
|
|
|
bool8 AddHeldItemToInventory(BulkItem* slot);
|
2021-11-10 08:43:51 -08:00
|
|
|
bool8 IsNotMoneyOrUsedTMItem(u8 id);
|
2023-01-08 04:23:00 -05:00
|
|
|
s32 FindItemInInventory(u8 id);
|
2022-04-25 18:27:33 -07:00
|
|
|
bool8 IsHMItem(u8 id);
|
2022-05-29 12:03:10 -07:00
|
|
|
bool8 IsEdibleItem(u8 id);
|
2023-01-15 11:14:20 -08:00
|
|
|
u8 xxx_bit_lut_lookup_8091E50(u8 i0, u8 i1);
|
2023-06-10 10:03:13 -07:00
|
|
|
bool8 IsInvalidItemReward(u8 itemID);
|
2021-07-17 18:45:13 +02:00
|
|
|
|
2023-09-02 01:46:26 -04:00
|
|
|
void RestoreHeldItem(unkStruct_8094924 *, BulkItem *);
|
|
|
|
void SaveHeldItem(unkStruct_8094924 *, BulkItem *);
|
|
|
|
void RestoreItemSlot(unkStruct_8094924 *, Item *);
|
|
|
|
void SaveItemSlot(unkStruct_8094924 *, Item *);
|
|
|
|
s32 RestoreTeamInventory(u8 *, u32);
|
|
|
|
s32 SaveTeamInventory(u8 *, u32);
|
2021-06-09 22:54:21 -05:00
|
|
|
|
2021-05-15 16:59:55 -07:00
|
|
|
#endif
|