Rename ItemId_GetX to GetItemX (#2116)
This commit is contained in:
54
src/item.c
54
src/item.c
@@ -78,7 +78,7 @@ void SetBagItemsPointers(void)
|
||||
|
||||
void CopyItemName(u16 itemId, u8 *dst)
|
||||
{
|
||||
StringCopy(dst, ItemId_GetName(itemId));
|
||||
StringCopy(dst, GetItemName(itemId));
|
||||
}
|
||||
|
||||
void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity)
|
||||
@@ -86,7 +86,7 @@ void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity)
|
||||
if (itemId == ITEM_POKE_BALL)
|
||||
{
|
||||
if (quantity < 2)
|
||||
StringCopy(dst, ItemId_GetName(ITEM_POKE_BALL));
|
||||
StringCopy(dst, GetItemName(ITEM_POKE_BALL));
|
||||
else
|
||||
StringCopy(dst, gText_PokeBalls);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity)
|
||||
if (itemId >= FIRST_BERRY_INDEX && itemId <= LAST_BERRY_INDEX)
|
||||
GetBerryCountString(dst, gBerries[itemId - FIRST_BERRY_INDEX].name, quantity);
|
||||
else
|
||||
StringCopy(dst, ItemId_GetName(itemId));
|
||||
StringCopy(dst, GetItemName(itemId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,11 +131,11 @@ bool8 CheckBagHasItem(u16 itemId, u16 count)
|
||||
u8 i;
|
||||
u8 pocket;
|
||||
|
||||
if (ItemId_GetPocket(itemId) == 0)
|
||||
if (GetItemPocket(itemId) == 0)
|
||||
return FALSE;
|
||||
if (InBattlePyramid() || FlagGet(FLAG_STORING_ITEMS_IN_PYRAMID_BAG) == TRUE)
|
||||
return CheckPyramidBagHasItem(itemId, count);
|
||||
pocket = ItemId_GetPocket(itemId) - 1;
|
||||
pocket = GetItemPocket(itemId) - 1;
|
||||
// Check for item slots that contain the item
|
||||
for (i = 0; i < gBagPockets[pocket].capacity; i++)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ bool8 CheckBagHasSpace(u16 itemId, u16 count)
|
||||
u16 slotCapacity;
|
||||
u16 ownedCount;
|
||||
|
||||
if (ItemId_GetPocket(itemId) == POCKET_NONE)
|
||||
if (GetItemPocket(itemId) == POCKET_NONE)
|
||||
return FALSE;
|
||||
|
||||
if (InBattlePyramid() || FlagGet(FLAG_STORING_ITEMS_IN_PYRAMID_BAG) == TRUE)
|
||||
@@ -186,7 +186,7 @@ bool8 CheckBagHasSpace(u16 itemId, u16 count)
|
||||
return CheckPyramidBagHasSpace(itemId, count);
|
||||
}
|
||||
|
||||
pocket = ItemId_GetPocket(itemId) - 1;
|
||||
pocket = GetItemPocket(itemId) - 1;
|
||||
if (pocket != BERRIES_POCKET)
|
||||
slotCapacity = MAX_BAG_ITEM_CAPACITY;
|
||||
else
|
||||
@@ -239,7 +239,7 @@ bool8 AddBagItem(u16 itemId, u16 count)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
if (ItemId_GetPocket(itemId) == POCKET_NONE)
|
||||
if (GetItemPocket(itemId) == POCKET_NONE)
|
||||
return FALSE;
|
||||
|
||||
// check Battle Pyramid Bag
|
||||
@@ -253,7 +253,7 @@ bool8 AddBagItem(u16 itemId, u16 count)
|
||||
struct ItemSlot *newItems;
|
||||
u16 slotCapacity;
|
||||
u16 ownedCount;
|
||||
u8 pocket = ItemId_GetPocket(itemId) - 1;
|
||||
u8 pocket = GetItemPocket(itemId) - 1;
|
||||
|
||||
itemPocket = &gBagPockets[pocket];
|
||||
newItems = AllocZeroed(itemPocket->capacity * sizeof(struct ItemSlot));
|
||||
@@ -347,7 +347,7 @@ bool8 RemoveBagItem(u16 itemId, u16 count)
|
||||
u8 i;
|
||||
u16 totalQuantity = 0;
|
||||
|
||||
if (ItemId_GetPocket(itemId) == POCKET_NONE || itemId == ITEM_NONE)
|
||||
if (GetItemPocket(itemId) == POCKET_NONE || itemId == ITEM_NONE)
|
||||
return FALSE;
|
||||
|
||||
// check Battle Pyramid Bag
|
||||
@@ -362,7 +362,7 @@ bool8 RemoveBagItem(u16 itemId, u16 count)
|
||||
u16 ownedCount;
|
||||
struct BagPocket *itemPocket;
|
||||
|
||||
pocket = ItemId_GetPocket(itemId) - 1;
|
||||
pocket = GetItemPocket(itemId) - 1;
|
||||
itemPocket = &gBagPockets[pocket];
|
||||
|
||||
for (i = 0; i < itemPocket->capacity; i++)
|
||||
@@ -432,7 +432,7 @@ bool8 RemoveBagItem(u16 itemId, u16 count)
|
||||
|
||||
u8 GetPocketByItemId(u16 itemId)
|
||||
{
|
||||
return ItemId_GetPocket(itemId);
|
||||
return GetItemPocket(itemId);
|
||||
}
|
||||
|
||||
void ClearItemSlots(struct ItemSlot *itemSlots, u8 itemCount)
|
||||
@@ -672,7 +672,7 @@ u16 CountTotalItemQuantityInBag(u16 itemId)
|
||||
{
|
||||
u16 i;
|
||||
u16 ownedCount = 0;
|
||||
struct BagPocket *bagPocket = &gBagPockets[ItemId_GetPocket(itemId) - 1];
|
||||
struct BagPocket *bagPocket = &gBagPockets[GetItemPocket(itemId) - 1];
|
||||
|
||||
for (i = 0; i < bagPocket->capacity; i++)
|
||||
{
|
||||
@@ -871,74 +871,74 @@ static u16 SanitizeItemId(u16 itemId)
|
||||
return itemId;
|
||||
}
|
||||
|
||||
const u8 *ItemId_GetName(u16 itemId)
|
||||
const u8 *GetItemName(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].name;
|
||||
}
|
||||
|
||||
// Unused
|
||||
u16 ItemId_GetId(u16 itemId)
|
||||
u16 GetItemId(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].itemId;
|
||||
}
|
||||
|
||||
u16 ItemId_GetPrice(u16 itemId)
|
||||
u16 GetItemPrice(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].price;
|
||||
}
|
||||
|
||||
u8 ItemId_GetHoldEffect(u16 itemId)
|
||||
u8 GetItemHoldEffect(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].holdEffect;
|
||||
}
|
||||
|
||||
u8 ItemId_GetHoldEffectParam(u16 itemId)
|
||||
u8 GetItemHoldEffectParam(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].holdEffectParam;
|
||||
}
|
||||
|
||||
const u8 *ItemId_GetDescription(u16 itemId)
|
||||
const u8 *GetItemDescription(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].description;
|
||||
}
|
||||
|
||||
u8 ItemId_GetImportance(u16 itemId)
|
||||
u8 GetItemImportance(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].importance;
|
||||
}
|
||||
|
||||
// Unused
|
||||
u8 ItemId_GetRegistrability(u16 itemId)
|
||||
u8 GetItemRegistrability(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].registrability;
|
||||
}
|
||||
|
||||
u8 ItemId_GetPocket(u16 itemId)
|
||||
u8 GetItemPocket(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].pocket;
|
||||
}
|
||||
|
||||
u8 ItemId_GetType(u16 itemId)
|
||||
u8 GetItemType(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].type;
|
||||
}
|
||||
|
||||
ItemUseFunc ItemId_GetFieldFunc(u16 itemId)
|
||||
ItemUseFunc GetItemFieldFunc(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].fieldUseFunc;
|
||||
}
|
||||
|
||||
u8 ItemId_GetBattleUsage(u16 itemId)
|
||||
u8 GetItemBattleUsage(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].battleUsage;
|
||||
}
|
||||
|
||||
ItemUseFunc ItemId_GetBattleFunc(u16 itemId)
|
||||
ItemUseFunc GetItemBattleFunc(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].battleUseFunc;
|
||||
}
|
||||
|
||||
u8 ItemId_GetSecondaryId(u16 itemId)
|
||||
u8 GetItemSecondaryId(u16 itemId)
|
||||
{
|
||||
return gItems[SanitizeItemId(itemId)].secondaryId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user