Conflicts: include/item.h src/battle_ai_script_commands.c src/battle_main.c src/battle_pyramid_bag.c src/battle_script_commands.c src/battle_util.c src/item.c src/item_menu.c src/item_use.c src/pokemon.c src/pokemon_summary_screen.c src/shop.c
110 lines
3.0 KiB
C
110 lines
3.0 KiB
C
#ifndef GUARD_ITEM_H
|
|
#define GUARD_ITEM_H
|
|
|
|
#include "constants/item.h"
|
|
#include "constants/items.h"
|
|
#include "constants/tms_hms.h"
|
|
|
|
typedef void (*ItemUseFunc)(u8);
|
|
|
|
struct Item
|
|
{
|
|
u32 price;
|
|
u16 secondaryId;
|
|
ItemUseFunc fieldUseFunc;
|
|
const u8 *description;
|
|
const u8 *effect;
|
|
u8 name[ITEM_NAME_LENGTH];
|
|
u8 pluralName[ITEM_NAME_PLURAL_LENGTH];
|
|
u8 holdEffect;
|
|
u8 holdEffectParam;
|
|
u8 importance:2;
|
|
u8 notConsumed:1;
|
|
u8 padding:5;
|
|
u8 pocket;
|
|
u8 type;
|
|
u8 battleUsage;
|
|
u8 flingPower;
|
|
const u32 *iconPic;
|
|
const u32 *iconPalette;
|
|
};
|
|
|
|
struct BagPocket
|
|
{
|
|
struct ItemSlot *itemSlots;
|
|
u8 capacity;
|
|
};
|
|
|
|
extern const struct Item gItemsInfo[];
|
|
extern struct BagPocket gBagPockets[];
|
|
|
|
void ApplyNewEncryptionKeyToBagItems(u32 newKey);
|
|
void ApplyNewEncryptionKeyToBagItems_(u32 newKey);
|
|
void SetBagItemsPointers(void);
|
|
u8 *CopyItemName(u16 itemId, u8 *dst);
|
|
u8 *CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity);
|
|
bool8 IsBagPocketNonEmpty(u8 pocket);
|
|
bool8 CheckBagHasItem(u16 itemId, u16 count);
|
|
bool8 HasAtLeastOneBerry(void);
|
|
bool8 HasAtLeastOnePokeBall(void);
|
|
bool8 CheckBagHasSpace(u16 itemId, u16 count);
|
|
u32 GetFreeSpaceForItemInBag(u16 itemId);
|
|
bool8 AddBagItem(u16 itemId, u16 count);
|
|
bool8 RemoveBagItem(u16 itemId, u16 count);
|
|
u8 GetPocketByItemId(u16 itemId);
|
|
void ClearItemSlots(struct ItemSlot *itemSlots, u8 itemCount);
|
|
u8 CountUsedPCItemSlots(void);
|
|
bool8 CheckPCHasItem(u16 itemId, u16 count);
|
|
bool8 AddPCItem(u16 itemId, u16 count);
|
|
void RemovePCItem(u8 index, u16 count);
|
|
void CompactPCItems(void);
|
|
void SwapRegisteredBike(void);
|
|
u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 pocketPos);
|
|
u16 BagGetQuantityByPocketPosition(u8 pocketId, u16 pocketPos);
|
|
void CompactItemsInBagPocket(struct BagPocket *bagPocket);
|
|
void SortBerriesOrTMHMs(struct BagPocket *bagPocket);
|
|
void MoveItemSlotInList(struct ItemSlot *itemSlots_, u32 from, u32 to_);
|
|
void ClearBag(void);
|
|
u16 CountTotalItemQuantityInBag(u16 itemId);
|
|
bool8 AddPyramidBagItem(u16 itemId, u16 count);
|
|
bool8 RemovePyramidBagItem(u16 itemId, u16 count);
|
|
const u8 *GetItemName(u16 itemId);
|
|
u32 GetItemPrice(u16 itemId);
|
|
const u8 *GetItemEffect(u32 itemId);
|
|
u32 GetItemHoldEffect(u32 itemId);
|
|
u32 GetItemHoldEffectParam(u32 itemId);
|
|
const u8 *GetItemDescription(u16 itemId);
|
|
u8 GetItemImportance(u16 itemId);
|
|
u8 GetItemConsumability(u16 itemId);
|
|
u8 GetItemPocket(u16 itemId);
|
|
u8 GetItemType(u16 itemId);
|
|
ItemUseFunc GetItemFieldFunc(u16 itemId);
|
|
u8 GetItemBattleUsage(u16 itemId);
|
|
u32 GetItemSecondaryId(u32 itemId);
|
|
u32 GetItemFlingPower(u32 itemId);
|
|
u32 GetItemStatus1Mask(u16 itemId);
|
|
u32 GetItemStatus2Mask(u16 itemId);
|
|
|
|
/* Expands to:
|
|
* enum
|
|
* {
|
|
* ITEM_TM_FOCUS_PUNCH,
|
|
* ...
|
|
* ITEM_HM_CUT,
|
|
* ...
|
|
* }; */
|
|
#define ENUM_TM(id) CAT(ITEM_TM_, id),
|
|
#define ENUM_HM(id) CAT(ITEM_HM_, id),
|
|
enum
|
|
{
|
|
ENUM_TM_START_ = ITEM_TM01 - 1,
|
|
FOREACH_TM(ENUM_TM)
|
|
|
|
ENUM_HM_START_ = ITEM_HM01 - 1,
|
|
FOREACH_HM(ENUM_HM)
|
|
};
|
|
#undef ENUM_TM
|
|
#undef ENUM_HM
|
|
|
|
#endif // GUARD_ITEM_H
|