pokeemerald/include/item.h
Eduardo Quezada 0d5b00aaf2 Merge remote-tracking branch 'pret/master' into RHH/pr/upcoming/pret_20230829
# Conflicts:
#	README.md
#	data/battle_ai_scripts.s
#	data/battle_scripts_1.s
#	data/maps/BattleFrontier_Lounge7/scripts.inc
#	include/battle_anim.h
#	include/battle_message.h
#	include/constants/items.h
#	src/battle_ai_script_commands.c
#	src/battle_ai_switch_items.c
#	src/battle_anim_throw.c
#	src/battle_anim_utility_funcs.c
#	src/battle_controller_link_opponent.c
#	src/battle_controller_link_partner.c
#	src/battle_controller_opponent.c
#	src/battle_controller_player.c
#	src/battle_controller_player_partner.c
#	src/battle_controller_recorded_opponent.c
#	src/battle_controller_recorded_player.c
#	src/battle_controller_wally.c
#	src/battle_gfx_sfx_util.c
#	src/battle_message.c
#	src/battle_script_commands.c
#	src/battle_util.c
#	src/data/party_menu.h
#	src/data/pokemon/tmhm_learnsets.h
#	src/daycare.c
#	src/field_specials.c
#	src/hall_of_fame.c
#	src/party_menu.c
#	src/pokemon.c
#	src/tv.c
2023-08-31 14:28:01 -04:00

102 lines
2.8 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
{
u8 name[ITEM_NAME_LENGTH];
u16 itemId;
u16 price;
u8 holdEffect;
u8 holdEffectParam;
const u8 *description;
u8 importance;
u8 pocket;
u8 type;
ItemUseFunc fieldUseFunc;
u8 battleUsage;
u16 secondaryId;
u8 flingPower;
};
struct BagPocket
{
struct ItemSlot *itemSlots;
u8 capacity;
};
extern const struct Item gItems[];
extern struct BagPocket gBagPockets[];
void ApplyNewEncryptionKeyToBagItems(u32 newKey);
void ApplyNewEncryptionKeyToBagItems_(u32 newKey);
void SetBagItemsPointers(void);
void CopyItemName(u16 itemId, u8 *dst);
void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity);
void GetBerryCountString(u8 *dst, const u8 *berryName, u32 quantity);
bool8 IsBagPocketNonEmpty(u8 pocket);
bool8 CheckBagHasItem(u16 itemId, u16 count);
bool8 HasAtLeastOneBerry(void);
bool8 CheckBagHasSpace(u16 itemId, u16 count);
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 *ItemId_GetName(u16 itemId);
u16 ItemId_GetPrice(u16 itemId);
u8 ItemId_GetHoldEffect(u16 itemId);
u8 ItemId_GetHoldEffectParam(u16 itemId);
const u8 *ItemId_GetDescription(u16 itemId);
u8 ItemId_GetImportance(u16 itemId);
u8 ItemId_GetPocket(u16 itemId);
u8 ItemId_GetType(u16 itemId);
ItemUseFunc ItemId_GetFieldFunc(u16 itemId);
u8 ItemId_GetBattleUsage(u16 itemId);
u8 ItemId_GetSecondaryId(u16 itemId);
u8 ItemId_GetFlingPower(u16 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