diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-01-19 13:39:18 -0500 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-01-19 13:39:18 -0500 |
commit | 752982552e212dcb33d57c66342f87eba3ce9089 (patch) | |
tree | 0790f0e7e7cc726d9e50e73b675d877c4b3741de /src | |
parent | 305ebdbc4a41960faa4fdde2422b443036f1edad (diff) |
Add FIRST_BALL, some FIRST_BERRY_INDEX usage
Diffstat (limited to 'src')
-rwxr-xr-x | src/berry_crush.c | 2 | ||||
-rw-r--r-- | src/data/items.h | 48 | ||||
-rw-r--r-- | src/item.c | 4 | ||||
-rwxr-xr-x | src/item_menu.c | 2 |
4 files changed, 28 insertions, 28 deletions
diff --git a/src/berry_crush.c b/src/berry_crush.c index 90bc7150d..2b16fcbec 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -877,7 +877,7 @@ void StartBerryCrush(MainCallback callback) static void GetBerryFromBag(void) { if (gSpecialVar_ItemId < FIRST_BERRY_INDEX || gSpecialVar_ItemId > LAST_BERRY_INDEX + 1) - gSpecialVar_ItemId = ITEM_CHERI_BERRY; + gSpecialVar_ItemId = FIRST_BERRY_INDEX; else RemoveBagItem(gSpecialVar_ItemId, 1); diff --git a/src/data/items.h b/src/data/items.h index 2230c3e2a..443c45f1a 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -20,10 +20,10 @@ const struct Item gItems[] = .price = 0, .description = sMasterBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_MASTER_BALL - 1, + .type = ITEM_MASTER_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_MASTER_BALL - 1, + .secondaryId = ITEM_MASTER_BALL - FIRST_BALL, }, [ITEM_ULTRA_BALL] = @@ -33,10 +33,10 @@ const struct Item gItems[] = .price = 1200, .description = sUltraBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_ULTRA_BALL - 1, + .type = ITEM_ULTRA_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_ULTRA_BALL - 1, + .secondaryId = ITEM_ULTRA_BALL - FIRST_BALL, }, [ITEM_GREAT_BALL] = @@ -46,10 +46,10 @@ const struct Item gItems[] = .price = 600, .description = sGreatBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_GREAT_BALL - 1, + .type = ITEM_GREAT_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_GREAT_BALL - 1, + .secondaryId = ITEM_GREAT_BALL - FIRST_BALL, }, [ITEM_POKE_BALL] = @@ -59,10 +59,10 @@ const struct Item gItems[] = .price = 200, .description = sPokeBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_POKE_BALL - 1, + .type = ITEM_POKE_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_POKE_BALL - 1, + .secondaryId = ITEM_POKE_BALL - FIRST_BALL, }, [ITEM_SAFARI_BALL] = @@ -72,10 +72,10 @@ const struct Item gItems[] = .price = 0, .description = sSafariBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_SAFARI_BALL - 1, + .type = ITEM_SAFARI_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_SAFARI_BALL - 1, + .secondaryId = ITEM_SAFARI_BALL - FIRST_BALL, }, [ITEM_NET_BALL] = @@ -85,10 +85,10 @@ const struct Item gItems[] = .price = 1000, .description = sNetBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_NET_BALL - 1, + .type = ITEM_NET_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_NET_BALL - 1, + .secondaryId = ITEM_NET_BALL - FIRST_BALL, }, [ITEM_DIVE_BALL] = @@ -98,10 +98,10 @@ const struct Item gItems[] = .price = 1000, .description = sDiveBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_DIVE_BALL - 1, + .type = ITEM_DIVE_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_DIVE_BALL - 1, + .secondaryId = ITEM_DIVE_BALL - FIRST_BALL, }, [ITEM_NEST_BALL] = @@ -111,10 +111,10 @@ const struct Item gItems[] = .price = 1000, .description = sNestBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_NEST_BALL - 1, + .type = ITEM_NEST_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_NEST_BALL - 1, + .secondaryId = ITEM_NEST_BALL - FIRST_BALL, }, [ITEM_REPEAT_BALL] = @@ -124,10 +124,10 @@ const struct Item gItems[] = .price = 1000, .description = sRepeatBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_REPEAT_BALL - 1, + .type = ITEM_REPEAT_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_REPEAT_BALL - 1, + .secondaryId = ITEM_REPEAT_BALL - FIRST_BALL, }, [ITEM_TIMER_BALL] = @@ -137,10 +137,10 @@ const struct Item gItems[] = .price = 1000, .description = sTimerBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_TIMER_BALL - 1, + .type = ITEM_TIMER_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_TIMER_BALL - 1, + .secondaryId = ITEM_TIMER_BALL - FIRST_BALL, }, [ITEM_LUXURY_BALL] = @@ -150,10 +150,10 @@ const struct Item gItems[] = .price = 1000, .description = sLuxuryBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_LUXURY_BALL - 1, + .type = ITEM_LUXURY_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_LUXURY_BALL - 1, + .secondaryId = ITEM_LUXURY_BALL - FIRST_BALL, }, [ITEM_PREMIER_BALL] = @@ -163,10 +163,10 @@ const struct Item gItems[] = .price = 200, .description = sPremierBallDesc, .pocket = POCKET_POKE_BALLS, - .type = ITEM_PREMIER_BALL - 1, + .type = ITEM_PREMIER_BALL - FIRST_BALL, .battleUsage = ITEM_B_USE_OTHER, .battleUseFunc = ItemUseInBattle_PokeBall, - .secondaryId = ITEM_PREMIER_BALL - 1, + .secondaryId = ITEM_PREMIER_BALL - FIRST_BALL, }, // Medicine diff --git a/src/item.c b/src/item.c index 0b6366048..91d2f1a0a 100644 --- a/src/item.c +++ b/src/item.c @@ -102,8 +102,8 @@ void CopyItemNameHandlePlural(u16 itemId, u8 *dst, u32 quantity) } else { - if (itemId >= ITEM_CHERI_BERRY && itemId <= ITEM_ENIGMA_BERRY) - GetBerryCountString(dst, gBerries[itemId - ITEM_CHERI_BERRY].name, 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)); } diff --git a/src/item_menu.c b/src/item_menu.c index 5e68898ae..6857fb7c3 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -865,7 +865,7 @@ void GetItemName(s8 *dest, u16 itemId) } break; case BERRIES_POCKET: - ConvertIntToDecimalStringN(gStringVar1, itemId - ITEM_CHERI_BERRY + 1, STR_CONV_MODE_LEADING_ZEROS, 2); + ConvertIntToDecimalStringN(gStringVar1, itemId - FIRST_BERRY_INDEX + 1, STR_CONV_MODE_LEADING_ZEROS, 2); CopyItemName(itemId, gStringVar2); StringExpandPlaceholders(dest, gText_NumberVar1Clear7Var2); break; |