From 2eeb346387f64fe2e6e414f71de12fb06e0ef7e1 Mon Sep 17 00:00:00 2001 From: Nephrite Date: Tue, 29 Jul 2025 11:47:32 +0300 Subject: [PATCH] Bag refactor3 + Ghoulslash's sorting feature port (#7330) --- include/constants/item.h | 3 +- include/item.h | 74 +++++- include/item_menu.h | 12 +- src/data/items.h | 550 +++++++++++++++++++++++++++++++++++++++ src/item.c | 244 +++++++---------- src/item_menu.c | 397 ++++++++++++++++++++++++++-- src/menu_helpers.c | 3 +- test/bag.c | 49 +++- 8 files changed, 1141 insertions(+), 191 deletions(-) diff --git a/include/constants/item.h b/include/constants/item.h index bd35bdb861..2d8c3f9419 100644 --- a/include/constants/item.h +++ b/include/constants/item.h @@ -9,10 +9,9 @@ enum Pocket POCKET_BERRIES, POCKET_KEY_ITEMS, POCKETS_COUNT, + POCKET_DUMMY = POCKETS_COUNT, }; -#define POCKET_DUMMY POCKETS_COUNT - #define REPEL_LURE_MASK (1 << 15) #define IS_LAST_USED_LURE(var) (var & REPEL_LURE_MASK) #define REPEL_LURE_STEPS(var) (var & (REPEL_LURE_MASK - 1)) diff --git a/include/item.h b/include/item.h index 5622786c91..9cecce661a 100644 --- a/include/item.h +++ b/include/item.h @@ -44,6 +44,46 @@ enum TMHMIndex #undef UNPACK_TM_HM_ENUM +enum PACKED ItemSortType +{ + ITEM_TYPE_UNCATEGORIZED, + ITEM_TYPE_FIELD_USE, + ITEM_TYPE_LEVEL_UP_ITEM, + ITEM_TYPE_HEALTH_RECOVERY, + ITEM_TYPE_STATUS_RECOVERY, + ITEM_TYPE_PP_RECOVERY, + ITEM_TYPE_NATURE_MINT, + ITEM_TYPE_STAT_BOOST_DRINK, + ITEM_TYPE_STAT_BOOST_FEATHER, + ITEM_TYPE_STAT_BOOST_MOCHI, + ITEM_TYPE_BATTLE_ITEM, + ITEM_TYPE_FLUTE, + ITEM_TYPE_X_ITEM, + ITEM_TYPE_AUX_ITEM, + ITEM_TYPE_EVOLUTION_STONE, + ITEM_TYPE_EVOLUTION_ITEM, + ITEM_TYPE_SPECIAL_HELD_ITEM, + ITEM_TYPE_MEGA_STONE, + ITEM_TYPE_Z_CRYSTAL, + ITEM_TYPE_TERA_SHARD, + ITEM_TYPE_HELD_ITEM, + ITEM_TYPE_TYPE_BOOST_HELD_ITEM, + ITEM_TYPE_CONTEST_HELD_ITEM, + ITEM_TYPE_EV_BOOST_HELD_ITEM, + ITEM_TYPE_GEM, + ITEM_TYPE_PLATE, + ITEM_TYPE_MEMORY, + ITEM_TYPE_DRIVE, + ITEM_TYPE_INCENSE, + ITEM_TYPE_NECTAR, + ITEM_TYPE_GROWTH, + ITEM_TYPE_SHARD, + ITEM_TYPE_SELLABLE, + ITEM_TYPE_RELIC, + ITEM_TYPE_FOSSIL, + ITEM_TYPE_MAIL, +}; + typedef void (*ItemUseFunc)(u8); struct Item @@ -60,7 +100,7 @@ struct Item u8 importance:2; u8 notConsumed:1; enum Pocket pocket:5; - u8 padding; + enum ItemSortType sortType; u8 type; u8 battleUsage; u8 flingPower; @@ -139,16 +179,29 @@ static inline u16 GetTMHMMoveId(enum TMHMIndex index) return gTMHMItemMoveIds[index].moveId; } -enum SortPocket -{ - SORT_NONE, - SORT_POCKET_BY_ITEM_ID, - SORT_POCKET_TM_HM, -}; +void BagPocket_SetSlotData(struct BagPocket *pocket, u32 pocketPos, struct ItemSlot newSlot); +struct ItemSlot BagPocket_GetSlotData(struct BagPocket *pocket, u32 pocketPos); + +static inline void BagPocket_SetSlotItemIdAndCount(struct BagPocket *pocket, u32 pocketPos, u16 itemId, u16 quantity) +{ + BagPocket_SetSlotData(pocket, pocketPos, (struct ItemSlot) {itemId, quantity}); +} + +static inline u16 GetBagItemId(enum Pocket pocketId, u32 pocketPos) +{ + return BagPocket_GetSlotData(&gBagPockets[pocketId], pocketPos).itemId; +} + +static inline u16 GetBagItemQuantity(enum Pocket pocketId, u32 pocketPos) +{ + return BagPocket_GetSlotData(&gBagPockets[pocketId], pocketPos).quantity; +} + +static inline struct ItemSlot GetBagItemIdAndQuantity(enum Pocket pocketId, u32 pocketPos) +{ + return BagPocket_GetSlotData(&gBagPockets[pocketId], pocketPos); +} -void GetBagItemIdAndQuantity(enum Pocket pocketId, u32 pocketPos, u16 *itemId, u16 *quantity); -u16 GetBagItemId(enum Pocket pocketId, u32 pocketPos); -u16 GetBagItemQuantity(enum Pocket pocketId, u32 pocketPos); void ApplyNewEncryptionKeyToBagItems(u32 newKey); void SetBagItemsPointers(void); u8 *CopyItemName(u16 itemId, u8 *dst); @@ -168,7 +221,6 @@ void RemovePCItem(u8 index, u16 count); void CompactPCItems(void); void SwapRegisteredBike(void); void CompactItemsInBagPocket(enum Pocket pocketId); -void SortPocket(enum Pocket pocketId, enum SortPocket sortPocket); void MoveItemSlotInPocket(enum Pocket pocketId, u32 from, u32 to); void MoveItemSlotInPC(struct ItemSlot *itemSlots, u32 from, u32 to); void ClearBag(void); diff --git a/include/item_menu.h b/include/item_menu.h index 84137da1de..64d9f7628e 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -36,6 +36,15 @@ enum { ITEMWIN_COUNT }; +//bag sort +enum BagSortOptions +{ + SORT_ALPHABETICALLY, + SORT_BY_TYPE, + SORT_BY_AMOUNT, //greatest->least + SORT_BY_INDEX, +}; + #define ITEMMENU_SWAP_LINE_LENGTH 8 // Swap line is 8 sprites long enum { ITEMMENUSPRITE_BAG, @@ -105,10 +114,11 @@ void CB2_ChooseBerry(void); void CB2_ChooseMulch(void); void Task_FadeAndCloseBagMenu(u8 taskId); void BagMenu_YesNo(u8 taskId, u8 windowType, const struct YesNoFuncTable *funcTable); -void UpdatePocketItemList(u8 pocketId); +void UpdatePocketItemList(enum Pocket pocketId); void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 taskId)); void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback); void CloseItemMessage(u8 taskId); void ItemMenu_RotomCatalog(u8 taskId); +void SortItemsInBag(struct BagPocket *pocket, enum BagSortOptions type); #endif //GUARD_ITEM_MENU_H diff --git a/src/data/items.h b/src/data/items.h index d1d7ae3125..1a39f409b5 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -146,6 +146,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sQuestionMarksDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_QuestionMark, @@ -617,6 +618,7 @@ const struct Item gItemsInfo[] = "a Pokémon by\n" "20 points."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -640,6 +642,7 @@ const struct Item gItemsInfo[] = "50 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -663,6 +666,7 @@ const struct Item gItemsInfo[] = "200 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -681,6 +685,7 @@ const struct Item gItemsInfo[] = "Fully restores the\n" "HP of a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -700,6 +705,7 @@ const struct Item gItemsInfo[] = "HP and status of a\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_HEAL_AND_CURE_STATUS, @@ -718,6 +724,7 @@ const struct Item gItemsInfo[] = "Pokémon with half\n" "its HP."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_REVIVE, @@ -733,6 +740,7 @@ const struct Item gItemsInfo[] = .price = 4000, .description = sMaxReviveDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_REVIVE, @@ -756,6 +764,7 @@ const struct Item gItemsInfo[] = "by 50 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -779,6 +788,7 @@ const struct Item gItemsInfo[] = "by 60 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -805,6 +815,7 @@ const struct Item gItemsInfo[] = "by 80 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -825,6 +836,7 @@ const struct Item gItemsInfo[] = "that restores HP\n" "by 100 points."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -848,6 +860,7 @@ const struct Item gItemsInfo[] = "by 50 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -870,6 +883,7 @@ const struct Item gItemsInfo[] = "by 200 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -889,6 +903,7 @@ const struct Item gItemsInfo[] = "that heals all\n" "status problems."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -907,6 +922,7 @@ const struct Item gItemsInfo[] = "that revives a\n" "fainted Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_REVIVE, @@ -924,6 +940,7 @@ const struct Item gItemsInfo[] = "Heals a poisoned\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -941,6 +958,7 @@ const struct Item gItemsInfo[] = "Heals a paralyzed\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -958,6 +976,7 @@ const struct Item gItemsInfo[] = "Heals Pokémon\n" "of a burn."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -975,6 +994,7 @@ const struct Item gItemsInfo[] = "Defrosts a frozen\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -992,6 +1012,7 @@ const struct Item gItemsInfo[] = "Awakens a sleeping\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1007,6 +1028,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 400 : 600, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1026,6 +1048,7 @@ const struct Item gItemsInfo[] = "of a selected move\n" "by 10."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PP_RECOVERY, .type = ITEM_USE_PARTY_MENU_MOVES, .fieldUseFunc = ItemUseOutOfBattle_PPRecovery, .battleUsage = EFFECT_ITEM_RESTORE_PP, @@ -1045,6 +1068,7 @@ const struct Item gItemsInfo[] = "PP of a selected\n" "move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PP_RECOVERY, .type = ITEM_USE_PARTY_MENU_MOVES, .fieldUseFunc = ItemUseOutOfBattle_PPRecovery, .battleUsage = EFFECT_ITEM_RESTORE_PP, @@ -1063,6 +1087,7 @@ const struct Item gItemsInfo[] = "Restores the PP\n" "of all moves by 10."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PP_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_PPRecovery, .battleUsage = EFFECT_ITEM_RESTORE_PP, @@ -1082,6 +1107,7 @@ const struct Item gItemsInfo[] = "PP of a Pokémon's\n" "moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PP_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_PPRecovery, .battleUsage = EFFECT_ITEM_RESTORE_PP, @@ -1103,6 +1129,7 @@ const struct Item gItemsInfo[] = "that restores HP\n" "by 20 points."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -1122,6 +1149,7 @@ const struct Item gItemsInfo[] = "restores all\n" "fainted Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_SacredAsh, .effect = gItemEffect_SacredAsh, @@ -1140,6 +1168,7 @@ const struct Item gItemsInfo[] = "that restores HP\n" "by 20 points."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -1156,6 +1185,7 @@ const struct Item gItemsInfo[] = .price = 8000, .description = sMaxReviveDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_REVIVE, @@ -1174,6 +1204,7 @@ const struct Item gItemsInfo[] = .price = 250, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1189,6 +1220,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 350 : 300, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1207,6 +1239,7 @@ const struct Item gItemsInfo[] = "that heals all\n" "status problems."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1223,6 +1256,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 350 : 200, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1238,6 +1272,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 350 : 100, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1253,6 +1288,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 350 : 200, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1268,6 +1304,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 350 : 200, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1283,6 +1320,7 @@ const struct Item gItemsInfo[] = .price = 350, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -1302,6 +1340,7 @@ const struct Item gItemsInfo[] = "Raises the base HP\n" "of one Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_HPUp, @@ -1319,6 +1358,7 @@ const struct Item gItemsInfo[] = "Attack stat of one\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_Protein, @@ -1336,6 +1376,7 @@ const struct Item gItemsInfo[] = "Defense stat of\n" "one Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_Iron, @@ -1353,6 +1394,7 @@ const struct Item gItemsInfo[] = "Sp. Atk stat of one\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_Calcium, @@ -1370,6 +1412,7 @@ const struct Item gItemsInfo[] = "Sp. Def stat of one\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_Zinc, @@ -1388,6 +1431,7 @@ const struct Item gItemsInfo[] = "Speed stat of one\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_Carbos, @@ -1405,6 +1449,7 @@ const struct Item gItemsInfo[] = "PP of a selected\n" "move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_PPUp, .effect = gItemEffect_PPUp, @@ -1423,6 +1468,7 @@ const struct Item gItemsInfo[] = "move to its maximum\n" "points."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_DRINK, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_PPUp, .effect = gItemEffect_PPMax, @@ -1439,6 +1485,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 300 : 3000, .description = sHealthFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_FEATHER, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_HpFeather, @@ -1453,6 +1500,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 300 : 3000, .description = sMuscleFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_FEATHER, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_AtkFeather, @@ -1467,6 +1515,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 300 : 3000, .description = sResistFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_FEATHER, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_DefFeather, @@ -1481,6 +1530,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 300 : 3000, .description = sGeniusFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_FEATHER, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_SpatkFeather, @@ -1495,6 +1545,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 300 : 3000, .description = sCleverFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_FEATHER, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_SpdefFeather, @@ -1509,6 +1560,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 300 : 3000, .description = sSwiftFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_FEATHER, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_SpeedFeather, @@ -1528,6 +1580,7 @@ const struct Item gItemsInfo[] = "Switches a Poké-\n" "mon's ability."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_AbilityCapsule, .iconPic = gItemIcon_AbilityCapsule, @@ -1545,6 +1598,7 @@ const struct Item gItemsInfo[] = "of a Pokémon into\n" "a rare ability."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_AbilityPatch, .iconPic = gItemIcon_AbilityPatch, @@ -1562,6 +1616,7 @@ const struct Item gItemsInfo[] = "ups Attack, but\n" "reduces Defense."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_LONELY, @@ -1579,6 +1634,7 @@ const struct Item gItemsInfo[] = "ups Attack, but\n" "reduces Sp. Atk."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_ADAMANT, @@ -1596,6 +1652,7 @@ const struct Item gItemsInfo[] = "ups Attack, but\n" "reduces Sp. Def."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_NAUGHTY, @@ -1613,6 +1670,7 @@ const struct Item gItemsInfo[] = "ups Attack, but\n" "reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_BRAVE, @@ -1630,6 +1688,7 @@ const struct Item gItemsInfo[] = "ups Defense, but\n" "reduces Attack."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_BOLD, @@ -1647,6 +1706,7 @@ const struct Item gItemsInfo[] = "ups Defense, but\n" "reduces Sp. Atk."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_IMPISH, @@ -1664,6 +1724,7 @@ const struct Item gItemsInfo[] = "ups Defense, but\n" "reduces Sp. Def."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_LAX, @@ -1681,6 +1742,7 @@ const struct Item gItemsInfo[] = "ups Defense, but\n" "reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_RELAXED, @@ -1698,6 +1760,7 @@ const struct Item gItemsInfo[] = "ups Sp. Atk, but\n" "reduces Attack."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_MODEST, @@ -1715,6 +1778,7 @@ const struct Item gItemsInfo[] = "ups Sp. Atk, but\n" "reduces Defense."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_MILD, @@ -1732,6 +1796,7 @@ const struct Item gItemsInfo[] = "ups Sp. Atk, but\n" "reduces Sp. Def."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_RASH, @@ -1749,6 +1814,7 @@ const struct Item gItemsInfo[] = "ups Sp. Atk, but\n" "reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_QUIET, @@ -1766,6 +1832,7 @@ const struct Item gItemsInfo[] = "ups Sp. Def, but\n" "reduces Attack."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_CALM, @@ -1783,6 +1850,7 @@ const struct Item gItemsInfo[] = "ups Sp. Def, but\n" "reduces Defense."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_GENTLE, @@ -1800,6 +1868,7 @@ const struct Item gItemsInfo[] = "ups Sp. Def, but\n" "reduces Sp. Atk."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_CAREFUL, @@ -1817,6 +1886,7 @@ const struct Item gItemsInfo[] = "ups Sp. Def, but\n" "reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_SASSY, @@ -1834,6 +1904,7 @@ const struct Item gItemsInfo[] = "ups Speed, but\n" "reduces Attack."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_TIMID, @@ -1851,6 +1922,7 @@ const struct Item gItemsInfo[] = "ups Speed, but\n" "reduces Defense."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_HASTY, @@ -1868,6 +1940,7 @@ const struct Item gItemsInfo[] = "ups Speed, but\n" "reduces Sp. Atk."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_JOLLY, @@ -1885,6 +1958,7 @@ const struct Item gItemsInfo[] = "ups Speed, but\n" "reduces Sp. Def."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_NAIVE, @@ -1902,6 +1976,7 @@ const struct Item gItemsInfo[] = "makes each stat\n" "grow equally."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NATURE_MINT, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Mint, .secondaryId = NATURE_SERIOUS, @@ -1922,6 +1997,7 @@ const struct Item gItemsInfo[] = "of a Pokémon by\n" "one."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_LEVEL_UP_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_RareCandy, .effect = gItemEffect_RareCandy, @@ -1941,6 +2017,7 @@ const struct Item gItemsInfo[] = "amount of Exp. to\n" "a single Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_LEVEL_UP_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_RareCandy, .effect = gItemEffect_RareCandy, @@ -1960,6 +2037,7 @@ const struct Item gItemsInfo[] = "amount of Exp. to\n" "a single Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_LEVEL_UP_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_RareCandy, .effect = gItemEffect_RareCandy, @@ -1979,6 +2057,7 @@ const struct Item gItemsInfo[] = "amount of Exp. to\n" "a single Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_LEVEL_UP_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_RareCandy, .effect = gItemEffect_RareCandy, @@ -1998,6 +2077,7 @@ const struct Item gItemsInfo[] = "amount of Exp. to\n" "a single Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_LEVEL_UP_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_RareCandy, .effect = gItemEffect_RareCandy, @@ -2017,6 +2097,7 @@ const struct Item gItemsInfo[] = "amount of Exp. to\n" "a single Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_LEVEL_UP_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_RareCandy, .effect = gItemEffect_RareCandy, @@ -2035,6 +2116,7 @@ const struct Item gItemsInfo[] = "Level of a single\n" "Pokémon by one."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_LEVEL_UP_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_DynamaxCandy, .flingPower = 30, @@ -2054,6 +2136,7 @@ const struct Item gItemsInfo[] = "Pokémon."), .notConsumed = TRUE, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FLUTE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -2073,6 +2156,7 @@ const struct Item gItemsInfo[] = "out of confusion."), .notConsumed = TRUE, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FLUTE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -2092,6 +2176,7 @@ const struct Item gItemsInfo[] = "out of attraction."), .notConsumed = TRUE, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FLUTE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -2114,6 +2199,7 @@ const struct Item gItemsInfo[] = "Pokémon."), .notConsumed = TRUE, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FLUTE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_BlackWhiteFlute, .flingPower = 30, @@ -2131,6 +2217,7 @@ const struct Item gItemsInfo[] = "lures wild Pokémon."), .notConsumed = TRUE, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FLUTE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_BlackWhiteFlute, .flingPower = 30, @@ -2150,6 +2237,7 @@ const struct Item gItemsInfo[] = "Pokémon for 100\n" "steps."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_Repel, .flingPower = 30, @@ -2167,6 +2255,7 @@ const struct Item gItemsInfo[] = "Pokémon for 200\n" "steps."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_Repel, .flingPower = 30, @@ -2184,6 +2273,7 @@ const struct Item gItemsInfo[] = "Pokémon for 250\n" "steps."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_Repel, .flingPower = 30, @@ -2201,6 +2291,7 @@ const struct Item gItemsInfo[] = "likely to appear\n" "for 100 steps."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_Lure, .secondaryId = 0, @@ -2219,6 +2310,7 @@ const struct Item gItemsInfo[] = "likely to appear\n" "for 200 steps."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_Lure, .secondaryId = 0, @@ -2237,6 +2329,7 @@ const struct Item gItemsInfo[] = "likely to appear\n" "for 250 steps."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_Lure, .secondaryId = 0, @@ -2259,6 +2352,7 @@ const struct Item gItemsInfo[] = #else .price = (I_PRICE >= GEN_7) ? 1000 : 550, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FIELD_USE, #endif .type = ITEM_USE_FIELD, .fieldUseFunc = ItemUseOutOfBattle_EscapeRope, @@ -2285,6 +2379,7 @@ const struct Item gItemsInfo[] = "battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_INCREASE_STAT, @@ -2310,6 +2405,7 @@ const struct Item gItemsInfo[] = "battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_INCREASE_STAT, @@ -2335,6 +2431,7 @@ const struct Item gItemsInfo[] = "battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_INCREASE_STAT, @@ -2360,6 +2457,7 @@ const struct Item gItemsInfo[] = "battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_INCREASE_STAT, @@ -2385,6 +2483,7 @@ const struct Item gItemsInfo[] = "battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_INCREASE_STAT, @@ -2411,6 +2510,7 @@ const struct Item gItemsInfo[] = "during one battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_INCREASE_STAT, @@ -2429,6 +2529,7 @@ const struct Item gItemsInfo[] = "critical-hit ratio\n" "during one battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_SET_FOCUS_ENERGY, @@ -2448,6 +2549,7 @@ const struct Item gItemsInfo[] = "reduction when\n" "used in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_X_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_SET_MIST, @@ -2463,6 +2565,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE < GEN_7) ? 1000 : ((I_PRICE == GEN_7) ? 100 : 300), .description = sPokeDollDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_BATTLE_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_ESCAPE, @@ -2477,6 +2580,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 100 : 1000, .description = sPokeDollDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_BATTLE_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_ESCAPE, @@ -2491,6 +2595,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 100 : 1000, .description = sPokeDollDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_BATTLE_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_ESCAPE, @@ -2509,6 +2614,7 @@ const struct Item gItemsInfo[] = "during one battle\n" "by one stage."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_BATTLE_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .battleUsage = EFFECT_ITEM_INCREASE_ALL_STATS, @@ -2528,6 +2634,7 @@ const struct Item gItemsInfo[] = "cap that gives off\n" "a silver gleam."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2544,6 +2651,7 @@ const struct Item gItemsInfo[] = "cap that gives off\n" "a golden gleam."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2560,6 +2668,7 @@ const struct Item gItemsInfo[] = "gold. Can be sold at\n" "a high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2576,6 +2685,7 @@ const struct Item gItemsInfo[] = "of gold, sellable\n" "at a high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 130, @@ -2592,6 +2702,7 @@ const struct Item gItemsInfo[] = "that would sell\n" "at a cheap price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2605,6 +2716,7 @@ const struct Item gItemsInfo[] = .price = 5000 * TREASURE_FACTOR, .description = sBigMushroomDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2618,6 +2730,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 15000 * TREASURE_FACTOR: 12500, .description = sBigMushroomDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2634,6 +2747,7 @@ const struct Item gItemsInfo[] = "that would sell at a\n" "cheap price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2650,6 +2764,7 @@ const struct Item gItemsInfo[] = "that would sell at a\n" "high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2666,6 +2781,7 @@ const struct Item gItemsInfo[] = "that would sell at a\n" "high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2683,6 +2799,7 @@ const struct Item gItemsInfo[] = "Can be sold at a\n" "high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2699,6 +2816,7 @@ const struct Item gItemsInfo[] = "It would sell for a\n" "very high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2715,6 +2833,7 @@ const struct Item gItemsInfo[] = "It would sell for a\n" "high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2732,6 +2851,7 @@ const struct Item gItemsInfo[] = "deep inside the\n" "Shoal Cave."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2748,6 +2868,7 @@ const struct Item gItemsInfo[] = "deep inside the\n" "Shoal Cave."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2761,6 +2882,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 1000 : 200, .description = sShardsDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2774,6 +2896,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 1000 : 200, .description = sShardsDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2787,6 +2910,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 1000 : 200, .description = sShardsDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2800,6 +2924,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 1000 : 200, .description = sShardsDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2816,6 +2941,7 @@ const struct Item gItemsInfo[] = "It is coveted by\n" "collectors."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2833,6 +2959,7 @@ const struct Item gItemsInfo[] = "attracts wild\n" "Pokémon when used."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_FIELD, .fieldUseFunc = ItemUseOutOfBattle_Honey, .flingPower = 30, @@ -2849,6 +2976,7 @@ const struct Item gItemsInfo[] = "It can be sold at\n" "a high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -2865,6 +2993,7 @@ const struct Item gItemsInfo[] = "from this odd stone\n" "occasionally."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -2881,6 +3010,7 @@ const struct Item gItemsInfo[] = "plain feather that\n" "does nothing."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 20, @@ -2897,6 +3027,7 @@ const struct Item gItemsInfo[] = "long ago. It sells\n" "at a high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2913,6 +3044,7 @@ const struct Item gItemsInfo[] = "long ago. It sells\n" "at a high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2929,6 +3061,7 @@ const struct Item gItemsInfo[] = "long ago. It sells\n" "at a high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2945,6 +3078,7 @@ const struct Item gItemsInfo[] = "ago. It sells at\n" "a high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2961,6 +3095,7 @@ const struct Item gItemsInfo[] = "It sells at a\n" "high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2977,6 +3112,7 @@ const struct Item gItemsInfo[] = "It sells at a\n" "high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -2993,6 +3129,7 @@ const struct Item gItemsInfo[] = "It sells at a\n" "high price."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -3009,6 +3146,7 @@ const struct Item gItemsInfo[] = "depicts a Pokémon\n" "from Alola."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_RELIC, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -3028,6 +3166,7 @@ const struct Item gItemsInfo[] = #if I_KEY_FOSSILS >= GEN_4 .price = (I_PRICE >= GEN_7) ? 7000: 1000, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, #else .price = 0, .importance = 1, @@ -3050,6 +3189,7 @@ const struct Item gItemsInfo[] = #if I_KEY_FOSSILS >= GEN_4 .price = (I_PRICE >= GEN_7) ? 7000: 1000, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, #else .price = 0, .importance = 1, @@ -3072,6 +3212,7 @@ const struct Item gItemsInfo[] = #if I_KEY_FOSSILS >= GEN_4 .price = 1000, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, #else .price = 0, .importance = 1, @@ -3091,6 +3232,7 @@ const struct Item gItemsInfo[] = #if I_KEY_FOSSILS >= GEN_4 .price = (I_PRICE >= GEN_7) ? 7000: 1000, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, #else .price = 0, .importance = 1, @@ -3110,6 +3252,7 @@ const struct Item gItemsInfo[] = #if I_KEY_FOSSILS >= GEN_4 .price = (I_PRICE >= GEN_7) ? 7000: 1000, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, #else .price = 0, .importance = 1, @@ -3131,6 +3274,7 @@ const struct Item gItemsInfo[] = "prehistoric Poké-\n" "mon's head."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3147,6 +3291,7 @@ const struct Item gItemsInfo[] = "prehistoric Poké-\n" "mon's collar."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3163,6 +3308,7 @@ const struct Item gItemsInfo[] = "prehistoric Poké-\n" "mon's back."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3179,6 +3325,7 @@ const struct Item gItemsInfo[] = "prehistoric Poké-\n" "mon's wing."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3195,6 +3342,7 @@ const struct Item gItemsInfo[] = "prehistoric Poké-\n" "mon's large jaw."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3211,6 +3359,7 @@ const struct Item gItemsInfo[] = "prehistoric Poké-\n" "mon's skin sail."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3227,6 +3376,7 @@ const struct Item gItemsInfo[] = "ancient, sky-\n" "soaring Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3241,6 +3391,7 @@ const struct Item gItemsInfo[] = .price = 5000, .description = sFossilizedFishDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3257,6 +3408,7 @@ const struct Item gItemsInfo[] = "ancient, land-\n" "roaming Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3270,6 +3422,7 @@ const struct Item gItemsInfo[] = .price = 5000, .description = sFossilizedFishDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_FOSSIL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -3293,6 +3446,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_GROWTH_MULCH), @@ -3315,6 +3469,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_DAMP_MULCH), @@ -3337,6 +3492,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_STABLE_MULCH), @@ -3359,6 +3515,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_GOOEY_MULCH), @@ -3381,6 +3538,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_RICH_MULCH), @@ -3403,6 +3561,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_SURPRISE_MULCH), @@ -3425,6 +3584,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_BOOST_MULCH), @@ -3447,6 +3607,7 @@ const struct Item gItemsInfo[] = .description = sGenericMulchDesc, #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = ITEM_TO_MULCH(ITEM_AMAZE_MULCH), @@ -3466,6 +3627,7 @@ const struct Item gItemsInfo[] = "It assails your\n" "nostrils."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_RedApricorn, @@ -3481,6 +3643,7 @@ const struct Item gItemsInfo[] = "It smells a bit\n" "like grass."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_BlueApricorn, @@ -3496,6 +3659,7 @@ const struct Item gItemsInfo[] = "It has an invigor-\n" "ating scent."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_YellowApricorn, @@ -3511,6 +3675,7 @@ const struct Item gItemsInfo[] = "It has a strange,\n" "aromatic scent."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_GreenApricorn, @@ -3526,6 +3691,7 @@ const struct Item gItemsInfo[] = "It has a nice,\n" "sweet scent."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_PinkApricorn, @@ -3541,6 +3707,7 @@ const struct Item gItemsInfo[] = "It doesn't smell\n" "like anything."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_WhiteApricorn, @@ -3556,6 +3723,7 @@ const struct Item gItemsInfo[] = "It has an inde-\n" "scribable scent."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GROWTH, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_BlackApricorn, @@ -3571,6 +3739,7 @@ const struct Item gItemsInfo[] = "{PKMN} Den to attract\n" "Dynamax Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo .flingPower = 50, @@ -3587,6 +3756,7 @@ const struct Item gItemsInfo[] = "in Galar called\n" "Galarica."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -3604,6 +3774,7 @@ const struct Item gItemsInfo[] = "found in the Isle\n" "of Armor at Galar."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -3621,6 +3792,7 @@ const struct Item gItemsInfo[] = "It can be found in\n" "Galar's Max Lair."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -3640,6 +3812,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_ORANGE_MAIL), @@ -3657,6 +3830,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_HARBOR_MAIL), @@ -3674,6 +3848,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_GLITTER_MAIL), @@ -3691,6 +3866,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_MECH_MAIL), @@ -3708,6 +3884,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_WOOD_MAIL), @@ -3725,6 +3902,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_WAVE_MAIL), @@ -3739,6 +3917,7 @@ const struct Item gItemsInfo[] = .price = 50, .description = sBeadMailDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_BEAD_MAIL), @@ -3756,6 +3935,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_SHADOW_MAIL), @@ -3773,6 +3953,7 @@ const struct Item gItemsInfo[] = "Mail to be held by\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_TROPIC_MAIL), @@ -3787,6 +3968,7 @@ const struct Item gItemsInfo[] = .price = 50, .description = sBeadMailDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_DREAM_MAIL), @@ -3804,6 +3986,7 @@ const struct Item gItemsInfo[] = "Mail to be held\n" "by a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_FAB_MAIL), @@ -3821,6 +4004,7 @@ const struct Item gItemsInfo[] = "drawings of three\n" "Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MAIL, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, .secondaryId = ITEM_TO_MAIL(ITEM_RETRO_MAIL), @@ -3836,6 +4020,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3850,6 +4035,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3864,6 +4050,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3878,6 +4065,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3892,6 +4080,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3906,6 +4095,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3920,6 +4110,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3934,6 +4125,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3948,6 +4140,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3962,6 +4155,7 @@ const struct Item gItemsInfo[] = .price = (I_PRICE >= GEN_7) ? 3000 : 2100, .description = sEvolutionStoneDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_STONE, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3979,6 +4173,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -3996,6 +4191,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -4013,6 +4209,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -4030,6 +4227,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -4047,6 +4245,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -4065,6 +4264,7 @@ const struct Item gItemsInfo[] = "Galar. Makes some\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -4084,6 +4284,7 @@ const struct Item gItemsInfo[] = "held by Dragon-\n" "type Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4101,6 +4302,7 @@ const struct Item gItemsInfo[] = "A peculiar box made\n" "by Silph Co."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4118,6 +4320,7 @@ const struct Item gItemsInfo[] = "Pokémon. It's stiff\n" "and heavy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4135,6 +4338,7 @@ const struct Item gItemsInfo[] = "Pokémon. It's full\n" "of electric energy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4152,6 +4356,7 @@ const struct Item gItemsInfo[] = "Pokémon. It's full\n" "of magma energy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4169,6 +4374,7 @@ const struct Item gItemsInfo[] = "overflowing with\n" "dubious data."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4187,6 +4393,7 @@ const struct Item gItemsInfo[] = "Pokémon. Imbued\n" "with spirit energy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4204,6 +4411,7 @@ const struct Item gItemsInfo[] = "that evolves a\n" "certain Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4222,6 +4430,7 @@ const struct Item gItemsInfo[] = "treat loved by\n" "a certain Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4239,6 +4448,7 @@ const struct Item gItemsInfo[] = "perfumes, loved by\n" "a certain Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4256,6 +4466,7 @@ const struct Item gItemsInfo[] = "that evolves a\n" "certain Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -4273,6 +4484,7 @@ const struct Item gItemsInfo[] = "sweet loved by\n" "Milcery."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -4289,6 +4501,7 @@ const struct Item gItemsInfo[] = "sweet loved by\n" "Milcery."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -4305,6 +4518,7 @@ const struct Item gItemsInfo[] = "sweet loved by\n" "Milcery."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -4321,6 +4535,7 @@ const struct Item gItemsInfo[] = "sweet loved by\n" "Milcery."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -4337,6 +4552,7 @@ const struct Item gItemsInfo[] = "sweet loved by\n" "Milcery."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -4353,6 +4569,7 @@ const struct Item gItemsInfo[] = "sweet loved by\n" "Milcery."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -4369,6 +4586,7 @@ const struct Item gItemsInfo[] = "sweet loved by\n" "Milcery."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -4386,6 +4604,7 @@ const struct Item gItemsInfo[] = "item that prevents\n" "evolution."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -4402,6 +4621,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 0, .description = sNectarDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NECTAR, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, .flingPower = 10, @@ -4416,6 +4636,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 0, .description = sNectarDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NECTAR, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, .flingPower = 10, @@ -4430,6 +4651,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 0, .description = sNectarDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NECTAR, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, .flingPower = 10, @@ -4444,6 +4666,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 0, .description = sNectarDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_NECTAR, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, .flingPower = 10, @@ -4464,6 +4687,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Fire-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIRE, @@ -4483,6 +4707,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Water-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, @@ -4502,6 +4727,7 @@ const struct Item gItemsInfo[] = "the power of Elec-\n" "tric-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ELECTRIC, @@ -4521,6 +4747,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Grass-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GRASS, @@ -4540,6 +4767,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Ice-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ICE, @@ -4559,6 +4787,7 @@ const struct Item gItemsInfo[] = "the power of Fight-\n" "ing-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIGHTING, @@ -4578,6 +4807,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Poison-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_POISON, @@ -4597,6 +4827,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Ground-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GROUND, @@ -4616,6 +4847,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Flying-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FLYING, @@ -4635,6 +4867,7 @@ const struct Item gItemsInfo[] = "the power of Psy\n" "chic-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_PSYCHIC, @@ -4654,6 +4887,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Bug-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_BUG, @@ -4673,6 +4907,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Rock-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ROCK, @@ -4692,6 +4927,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Ghost-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GHOST, @@ -4711,6 +4947,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Dragon-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DRAGON, @@ -4730,6 +4967,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Dark-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DARK, @@ -4749,6 +4987,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Steel-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_STEEL, @@ -4768,6 +5007,7 @@ const struct Item gItemsInfo[] = "the power of\n" "Fairy-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_PLATE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FAIRY, @@ -4806,6 +5046,7 @@ const struct Item gItemsInfo[] = "Techno Blast to\n" "Electric-type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_DRIVE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ELECTRIC, @@ -4824,6 +5065,7 @@ const struct Item gItemsInfo[] = "Techno Blast to\n" "Fire-type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_DRIVE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIRE, @@ -4842,6 +5084,7 @@ const struct Item gItemsInfo[] = "Techno Blast to\n" "Ice-type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_DRIVE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ICE, @@ -4864,6 +5107,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIRE, @@ -4884,6 +5128,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, @@ -4904,6 +5149,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ELECTRIC, @@ -4924,6 +5170,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GRASS, @@ -4944,6 +5191,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ICE, @@ -4964,6 +5212,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIGHTING, @@ -4984,6 +5233,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_POISON, @@ -5004,6 +5254,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GROUND, @@ -5024,6 +5275,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FLYING, @@ -5044,6 +5296,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_PSYCHIC, @@ -5064,6 +5317,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_BUG, @@ -5084,6 +5338,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ROCK, @@ -5104,6 +5359,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GHOST, @@ -5124,6 +5380,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DRAGON, @@ -5144,6 +5401,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DARK, @@ -5164,6 +5422,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_STEEL, @@ -5184,6 +5443,7 @@ const struct Item gItemsInfo[] = "type data. It swaps\n" "Silvally's type."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEMORY, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FAIRY, @@ -5201,6 +5461,7 @@ const struct Item gItemsInfo[] = "hero used it to\n" "halt a disaster."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_RustedSword, @@ -5216,6 +5477,7 @@ const struct Item gItemsInfo[] = "hero used it to\n" "halt a disaster."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_RustedShield, @@ -5234,6 +5496,7 @@ const struct Item gItemsInfo[] = "said to contain an\n" "ancient power."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_RedOrb, @@ -5250,6 +5513,7 @@ const struct Item gItemsInfo[] = "said to contain an\n" "ancient power."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_BlueOrb, @@ -5268,6 +5532,7 @@ const struct Item gItemsInfo[] = "Venusaur to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5283,6 +5548,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_MEGA_STONE, .description = sCharizarditeDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5298,6 +5564,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_MEGA_STONE, .description = sCharizarditeDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5315,6 +5582,7 @@ const struct Item gItemsInfo[] = "Blastoise to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5332,6 +5600,7 @@ const struct Item gItemsInfo[] = "Beedrill to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5349,6 +5618,7 @@ const struct Item gItemsInfo[] = "Pidgeot to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5366,6 +5636,7 @@ const struct Item gItemsInfo[] = "Alakazam to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5383,6 +5654,7 @@ const struct Item gItemsInfo[] = "Slowbro to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5400,6 +5672,7 @@ const struct Item gItemsInfo[] = "Gengar to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5417,6 +5690,7 @@ const struct Item gItemsInfo[] = "Kangaskhan to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5434,6 +5708,7 @@ const struct Item gItemsInfo[] = "Pinsir to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5451,6 +5726,7 @@ const struct Item gItemsInfo[] = "Gyarados to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5468,6 +5744,7 @@ const struct Item gItemsInfo[] = "Aerodactyl to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5483,6 +5760,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_MEGA_STONE, .description = sMewtwoniteDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5498,6 +5776,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_MEGA_STONE, .description = sMewtwoniteDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5515,6 +5794,7 @@ const struct Item gItemsInfo[] = "Ampharos to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5532,6 +5812,7 @@ const struct Item gItemsInfo[] = "Steelix to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5549,6 +5830,7 @@ const struct Item gItemsInfo[] = "Scizor to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5566,6 +5848,7 @@ const struct Item gItemsInfo[] = "Heracross to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5583,6 +5866,7 @@ const struct Item gItemsInfo[] = "Houndoom to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5600,6 +5884,7 @@ const struct Item gItemsInfo[] = "Tyranitar to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5617,6 +5902,7 @@ const struct Item gItemsInfo[] = "Sceptile to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5634,6 +5920,7 @@ const struct Item gItemsInfo[] = "Blaziken to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5651,6 +5938,7 @@ const struct Item gItemsInfo[] = "Swampert to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5668,6 +5956,7 @@ const struct Item gItemsInfo[] = "Gardevoir to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5685,6 +5974,7 @@ const struct Item gItemsInfo[] = "Sableye to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5702,6 +5992,7 @@ const struct Item gItemsInfo[] = "Mawile to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5719,6 +6010,7 @@ const struct Item gItemsInfo[] = "Aggron to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5736,6 +6028,7 @@ const struct Item gItemsInfo[] = "Medicham to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5753,6 +6046,7 @@ const struct Item gItemsInfo[] = "Manectric to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5770,6 +6064,7 @@ const struct Item gItemsInfo[] = "Sharpedo to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5787,6 +6082,7 @@ const struct Item gItemsInfo[] = "Camerupt to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5804,6 +6100,7 @@ const struct Item gItemsInfo[] = "Altaria to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5821,6 +6118,7 @@ const struct Item gItemsInfo[] = "Banette to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5838,6 +6136,7 @@ const struct Item gItemsInfo[] = "Absol to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5855,6 +6154,7 @@ const struct Item gItemsInfo[] = "Glalie to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5872,6 +6172,7 @@ const struct Item gItemsInfo[] = "Salamence to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5889,6 +6190,7 @@ const struct Item gItemsInfo[] = "Metagross to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5906,6 +6208,7 @@ const struct Item gItemsInfo[] = "Latias to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5923,6 +6226,7 @@ const struct Item gItemsInfo[] = "Latios to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5940,6 +6244,7 @@ const struct Item gItemsInfo[] = "Lopunny to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5957,6 +6262,7 @@ const struct Item gItemsInfo[] = "Garchomp to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5974,6 +6280,7 @@ const struct Item gItemsInfo[] = "Lucario to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -5991,6 +6298,7 @@ const struct Item gItemsInfo[] = "Abomasnow to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -6008,6 +6316,7 @@ const struct Item gItemsInfo[] = "Gallade to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -6025,6 +6334,7 @@ const struct Item gItemsInfo[] = "Audino to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -6042,6 +6352,7 @@ const struct Item gItemsInfo[] = "Diancie to Mega\n" "Evolve in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_MEGA_STONE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -6062,6 +6373,7 @@ const struct Item gItemsInfo[] = "power of Normal\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_NORMAL, @@ -6080,6 +6392,7 @@ const struct Item gItemsInfo[] = "power of Fire\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIRE, @@ -6098,6 +6411,7 @@ const struct Item gItemsInfo[] = "power of Water\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, @@ -6116,6 +6430,7 @@ const struct Item gItemsInfo[] = "power of Electric\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ELECTRIC, @@ -6134,6 +6449,7 @@ const struct Item gItemsInfo[] = "power of Grass\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GRASS, @@ -6152,6 +6468,7 @@ const struct Item gItemsInfo[] = "power of Ice\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ICE, @@ -6170,6 +6487,7 @@ const struct Item gItemsInfo[] = "power of Fighting\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIGHTING, @@ -6188,6 +6506,7 @@ const struct Item gItemsInfo[] = "power of Poison\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_POISON, @@ -6206,6 +6525,7 @@ const struct Item gItemsInfo[] = "power of Ground\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GROUND, @@ -6224,6 +6544,7 @@ const struct Item gItemsInfo[] = "power of Flying\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FLYING, @@ -6242,6 +6563,7 @@ const struct Item gItemsInfo[] = "power of Psychic\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_PSYCHIC, @@ -6260,6 +6582,7 @@ const struct Item gItemsInfo[] = "power of Bug\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_BUG, @@ -6278,6 +6601,7 @@ const struct Item gItemsInfo[] = "power of Rock\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ROCK, @@ -6296,6 +6620,7 @@ const struct Item gItemsInfo[] = "power of Ghost\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GHOST, @@ -6314,6 +6639,7 @@ const struct Item gItemsInfo[] = "power of Dragon\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DRAGON, @@ -6332,6 +6658,7 @@ const struct Item gItemsInfo[] = "power of Dark\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DARK, @@ -6350,6 +6677,7 @@ const struct Item gItemsInfo[] = "power of Steel\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_STEEL, @@ -6368,6 +6696,7 @@ const struct Item gItemsInfo[] = "power of Fairy\n" "Type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_GEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FAIRY, @@ -6387,6 +6716,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_NORMAL, @@ -6404,6 +6734,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIRE, @@ -6421,6 +6752,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, @@ -6438,6 +6770,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ELECTRIC, @@ -6455,6 +6788,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GRASS, @@ -6472,6 +6806,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ICE, @@ -6489,6 +6824,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIGHTING, @@ -6506,6 +6842,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_POISON, @@ -6523,6 +6860,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GROUND, @@ -6540,6 +6878,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FLYING, @@ -6557,6 +6896,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_PSYCHIC, @@ -6574,6 +6914,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_BUG, @@ -6591,6 +6932,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ROCK, @@ -6608,6 +6950,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GHOST, @@ -6625,6 +6968,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DRAGON, @@ -6642,6 +6986,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DARK, @@ -6659,6 +7004,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_STEEL, @@ -6676,6 +7022,7 @@ const struct Item gItemsInfo[] = "type moves into\n" "Z-Moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FAIRY, @@ -6693,6 +7040,7 @@ const struct Item gItemsInfo[] = "Volt Tackle\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6710,6 +7058,7 @@ const struct Item gItemsInfo[] = "Last Resort\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6727,6 +7076,7 @@ const struct Item gItemsInfo[] = "Giga Impact\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6744,6 +7094,7 @@ const struct Item gItemsInfo[] = "Psychic into\n" "a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6761,6 +7112,7 @@ const struct Item gItemsInfo[] = "eye's Spirit Sha-\n" "ckle into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6778,6 +7130,7 @@ const struct Item gItemsInfo[] = "roar's Darkest La-\n" "riat into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6795,6 +7148,7 @@ const struct Item gItemsInfo[] = "Sparkling Aria\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6812,6 +7166,7 @@ const struct Item gItemsInfo[] = "Stone Edge\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6829,6 +7184,7 @@ const struct Item gItemsInfo[] = "Play Rough\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6846,6 +7202,7 @@ const struct Item gItemsInfo[] = "Clanging Scales\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6863,6 +7220,7 @@ const struct Item gItemsInfo[] = "Nature's Madness\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, //signature z move @@ -6880,6 +7238,7 @@ const struct Item gItemsInfo[] = "Sunsteel Strike\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6897,6 +7256,7 @@ const struct Item gItemsInfo[] = "Moongeist Beam\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6914,6 +7274,7 @@ const struct Item gItemsInfo[] = "dow's Spectral Thi-\n" "ef into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6931,6 +7292,7 @@ const struct Item gItemsInfo[] = "Raichu's Thunder-\n" "bolt into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6948,6 +7310,7 @@ const struct Item gItemsInfo[] = "a cap's Thunderbolt\n" "into a Z-Move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, // signature z move @@ -6965,6 +7328,7 @@ const struct Item gItemsInfo[] = "fused Necrozma\n" "into a new form."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_Z_CRYSTAL, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = 255, //signature z move @@ -6984,6 +7348,7 @@ const struct Item gItemsInfo[] = "raises the Atk and\n" "Sp. Atk of Pikachu."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -7001,6 +7366,7 @@ const struct Item gItemsInfo[] = "raises Farfetch'd's\n" "critical-hit ratio."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -7018,6 +7384,7 @@ const struct Item gItemsInfo[] = "raises Cubone or\n" "Marowak's Attack."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 90, @@ -7036,6 +7403,7 @@ const struct Item gItemsInfo[] = "raises Chansey's\n" "critical-hit rate."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 40, @@ -7054,6 +7422,7 @@ const struct Item gItemsInfo[] = "raises Ditto's\n" "Defense."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7072,6 +7441,7 @@ const struct Item gItemsInfo[] = "raises the Speed\n" "of Ditto."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7089,6 +7459,7 @@ const struct Item gItemsInfo[] = "raises the Sp. Def\n" "of Clamperl."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -7108,6 +7479,7 @@ const struct Item gItemsInfo[] = "raises the Sp. Atk\n" "of Clamperl."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -7133,6 +7505,7 @@ const struct Item gItemsInfo[] = "Latios & Latias."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -7151,6 +7524,7 @@ const struct Item gItemsInfo[] = "Dragon and Steel-\n" "type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -7169,6 +7543,7 @@ const struct Item gItemsInfo[] = "Dragon and Water-\n" "type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -7187,6 +7562,7 @@ const struct Item gItemsInfo[] = "Dragon and Ghost-\n" "type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -7204,6 +7580,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 20, .description = sSeaIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, @@ -7223,6 +7600,7 @@ const struct Item gItemsInfo[] = "slightly lowers the\n" "foe's accuracy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7238,6 +7616,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 20, .description = sOddIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_PSYCHIC, @@ -7254,6 +7633,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 20, .description = sRockIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ROCK, @@ -7270,6 +7650,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 5, .description = sFullIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7285,6 +7666,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 20, .description = sSeaIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, @@ -7301,6 +7683,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 20, .description = sRoseIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GRASS, @@ -7316,6 +7699,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_DOUBLE_PRIZE, .description = sLuckIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7330,6 +7714,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_REPEL, .description = sPureIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_INCENSE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7349,6 +7734,7 @@ const struct Item gItemsInfo[] = "raises Cool in\n" "Contests."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_CONTEST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7366,6 +7752,7 @@ const struct Item gItemsInfo[] = "raises Beauty in\n" "Contests."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_CONTEST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7383,6 +7770,7 @@ const struct Item gItemsInfo[] = "raises Cute in\n" "Contests."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_CONTEST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7400,6 +7788,7 @@ const struct Item gItemsInfo[] = "raises Smart in\n" "Contests."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_CONTEST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7417,6 +7806,7 @@ const struct Item gItemsInfo[] = "raises Tough in\n" "Contests."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_CONTEST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7436,6 +7826,7 @@ const struct Item gItemsInfo[] = "promotes growth,\n" "but reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EV_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -7454,6 +7845,7 @@ const struct Item gItemsInfo[] = "promotes HP gain,\n" "but reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EV_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = STAT_HP, @@ -7473,6 +7865,7 @@ const struct Item gItemsInfo[] = "promotes Atk gain,\n" "but reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EV_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = STAT_ATK, @@ -7492,6 +7885,7 @@ const struct Item gItemsInfo[] = "promotes Def gain,\n" "but reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EV_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = STAT_DEF, @@ -7512,6 +7906,7 @@ const struct Item gItemsInfo[] = "motes Sp. Atk gain,\n" "but reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EV_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = STAT_SPATK, @@ -7531,6 +7926,7 @@ const struct Item gItemsInfo[] = "motes Sp. Def gain,\n" "but reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EV_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = STAT_SPDEF, @@ -7550,6 +7946,7 @@ const struct Item gItemsInfo[] = "promotes Spd gain,\n" "but reduces Speed."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EV_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = STAT_SPEED, @@ -7572,6 +7969,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Normal-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_NORMAL, @@ -7591,6 +7989,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Fire-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIRE, @@ -7611,6 +8010,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Water-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_WATER, @@ -7630,6 +8030,7 @@ const struct Item gItemsInfo[] = "boosts Electric-\n" "type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ELECTRIC, @@ -7646,6 +8047,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = TYPE_BOOST_PARAM, .description = sRoseIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GRASS, @@ -7666,6 +8068,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Ice-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ICE, @@ -7685,6 +8088,7 @@ const struct Item gItemsInfo[] = "boosts Fighting-\n" "type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FIGHTING, @@ -7704,6 +8108,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Poison-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_POISON, @@ -7724,6 +8129,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Ground-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GROUND, @@ -7743,6 +8149,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Flying-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FLYING, @@ -7759,6 +8166,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = TYPE_BOOST_PARAM, .description = sOddIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_PSYCHIC, @@ -7779,6 +8187,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Bug-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_BUG, @@ -7795,6 +8204,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = TYPE_BOOST_PARAM, .description = sRockIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_ROCK, @@ -7814,6 +8224,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Ghost-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_GHOST, @@ -7833,6 +8244,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Dragon-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DRAGON, @@ -7853,6 +8265,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Dark-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_DARK, @@ -7872,6 +8285,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Steel-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -7893,6 +8307,7 @@ const struct Item gItemsInfo[] = "allows the use of\n" "only one move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7911,6 +8326,7 @@ const struct Item gItemsInfo[] = "allows the use of\n" "only one move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7929,6 +8345,7 @@ const struct Item gItemsInfo[] = "allows the use of\n" "only one move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -7948,6 +8365,7 @@ const struct Item gItemsInfo[] = "inflicts a burn on\n" "holder in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -7965,6 +8383,7 @@ const struct Item gItemsInfo[] = "badly poisons the\n" "holder in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -7984,6 +8403,7 @@ const struct Item gItemsInfo[] = "of Rain Dance if\n" "used by the holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -8001,6 +8421,7 @@ const struct Item gItemsInfo[] = "of Sunny Day if\n" "used by the holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -8018,6 +8439,7 @@ const struct Item gItemsInfo[] = "of Sandstorm if\n" "used by the holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8047,6 +8469,7 @@ const struct Item gItemsInfo[] = "used by the holder."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 40, @@ -8067,6 +8490,7 @@ const struct Item gItemsInfo[] = "Electric Terrain,\n" "but only one time."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8085,6 +8509,7 @@ const struct Item gItemsInfo[] = "Psychic Terrain,\n" "but only one time."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8103,6 +8528,7 @@ const struct Item gItemsInfo[] = "Misty Terrain,\n" "but only one time."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8121,6 +8547,7 @@ const struct Item gItemsInfo[] = "Grassy Terrain,\n" "but only one time."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8141,6 +8568,7 @@ const struct Item gItemsInfo[] = "the holder is hit by\n" "a Water-type move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8160,6 +8588,7 @@ const struct Item gItemsInfo[] = "the holder is hit by\n" "an Electric move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8179,6 +8608,7 @@ const struct Item gItemsInfo[] = "the holder is hit by\n" "a Water-type move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8197,6 +8627,7 @@ const struct Item gItemsInfo[] = "holder is hit by an\n" "Ice-type move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8218,6 +8649,7 @@ const struct Item gItemsInfo[] = "casts a glare to\n" "reduce accuracy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8235,6 +8667,7 @@ const struct Item gItemsInfo[] = "restores any\n" "lowered stat."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8260,6 +8693,7 @@ const struct Item gItemsInfo[] = "from battles."), #endif .pocket = I_EXP_SHARE_ITEM >= GEN_6 ? POCKET_KEY_ITEMS : POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_FIELD, .fieldUseFunc = ItemUseOutOfBattle_ExpShare, .flingPower = 30, @@ -8278,6 +8712,7 @@ const struct Item gItemsInfo[] = "occasionally allows\n" "the first strike."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -8295,6 +8730,7 @@ const struct Item gItemsInfo[] = "calms spirits and\n" "fosters friendship."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8318,6 +8754,7 @@ const struct Item gItemsInfo[] = "of infatuation."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8333,6 +8770,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 10, .description = sKingsRockDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -8348,6 +8786,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_DOUBLE_PRIZE, .description = sLuckIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8362,6 +8801,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_REPEL, .description = sPureIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8379,6 +8819,7 @@ const struct Item gItemsInfo[] = "assures fleeing\n" "from wild Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8397,6 +8838,7 @@ const struct Item gItemsInfo[] = "occasionally\n" "prevents fainting."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8414,6 +8856,7 @@ const struct Item gItemsInfo[] = "boosts Exp. points\n" "earned in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8432,6 +8875,7 @@ const struct Item gItemsInfo[] = "improves the\n" "critical-hit rate."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8451,6 +8895,7 @@ const struct Item gItemsInfo[] = "gradually restores\n" "HP in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8469,6 +8914,7 @@ const struct Item gItemsInfo[] = "restores HP upon\n" "striking the foe."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8488,6 +8934,7 @@ const struct Item gItemsInfo[] = "that boosts the\n" "accuracy of moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8506,6 +8953,7 @@ const struct Item gItemsInfo[] = "boosts the power\n" "of physical moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8525,6 +8973,7 @@ const struct Item gItemsInfo[] = "that ups the power\n" "of special moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8543,6 +8992,7 @@ const struct Item gItemsInfo[] = "the power of super\n" "effective moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8561,6 +9011,7 @@ const struct Item gItemsInfo[] = "of barrier moves\n" "used by the holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8578,6 +9029,7 @@ const struct Item gItemsInfo[] = "but holder loses HP\n" "with each attack."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8595,6 +9047,7 @@ const struct Item gItemsInfo[] = "use of a move that\n" "charges first."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8613,6 +9066,7 @@ const struct Item gItemsInfo[] = "full HP, it endures\n" "KO hits with 1 HP."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8632,6 +9086,7 @@ const struct Item gItemsInfo[] = "after the foe, it'll\n" "boost accuracy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8650,6 +9105,7 @@ const struct Item gItemsInfo[] = "boosts a move used\n" "consecutively."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8667,6 +9123,7 @@ const struct Item gItemsInfo[] = "becomes vulnerable\n" "to Ground moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 130, @@ -8681,6 +9138,7 @@ const struct Item gItemsInfo[] = .holdEffect = HOLD_EFFECT_LAGGING_TAIL, .description = sFullIncenseDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8698,6 +9156,7 @@ const struct Item gItemsInfo[] = "in love, the foe\n" "does too."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8716,6 +9175,7 @@ const struct Item gItemsInfo[] = "Poison-types.\n" "Damages all others."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8733,6 +9193,7 @@ const struct Item gItemsInfo[] = "extends binding\n" "moves like Wrap."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 90, @@ -8750,6 +9211,7 @@ const struct Item gItemsInfo[] = "each turn. May\n" "latch on to foes."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -8767,6 +9229,7 @@ const struct Item gItemsInfo[] = "to switch out\n" "without fail."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8785,6 +9248,7 @@ const struct Item gItemsInfo[] = "ups the power of\n" "HP-stealing moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8802,6 +9266,7 @@ const struct Item gItemsInfo[] = "ups the holder's\n" "critical-hit ratio."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -8818,6 +9283,7 @@ const struct Item gItemsInfo[] = .holdEffectParam = 10, .description = sKingsRockDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = EVO_HELD_ITEM_TYPE, .fieldUseFunc = EVO_HELD_ITEM_FIELD_FUNC, .effect = gItemEffect_EvoItem, @@ -8837,6 +9303,7 @@ const struct Item gItemsInfo[] = "Sp. Def of Pokémon\n" "that can evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 40, @@ -8854,6 +9321,7 @@ const struct Item gItemsInfo[] = "when held, it halves\n" "a Pokémon's weight."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8872,6 +9340,7 @@ const struct Item gItemsInfo[] = "they touch its\n" "holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -8890,6 +9359,7 @@ const struct Item gItemsInfo[] = "float but bursts\n" "if hit by an attack."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8908,6 +9378,7 @@ const struct Item gItemsInfo[] = "foe if they hit the\n" "holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8926,6 +9397,7 @@ const struct Item gItemsInfo[] = "have no effect will\n" "hit the holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -8943,6 +9415,7 @@ const struct Item gItemsInfo[] = "power of binding\n" "moves when held."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8961,6 +9434,7 @@ const struct Item gItemsInfo[] = "user if they're hit\n" "by the foe."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -8980,6 +9454,7 @@ const struct Item gItemsInfo[] = "effective move,\n" "ups Atk and Sp. Atk."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -8998,6 +9473,7 @@ const struct Item gItemsInfo[] = "prevents the use\n" "of status moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -9016,6 +9492,7 @@ const struct Item gItemsInfo[] = "weather damage and\n" "powder moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -9033,6 +9510,7 @@ const struct Item gItemsInfo[] = "Speed if the holder\n" "is intimidated."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -9050,6 +9528,7 @@ const struct Item gItemsInfo[] = "of the active\n" "battle terrain."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -9068,6 +9547,7 @@ const struct Item gItemsInfo[] = "from contact move\n" "effects."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -9085,6 +9565,7 @@ const struct Item gItemsInfo[] = "the holder uses a\n" "sound-based move."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -9102,6 +9583,7 @@ const struct Item gItemsInfo[] = "switch if its stats\n" "are lowered."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 50, @@ -9120,6 +9602,7 @@ const struct Item gItemsInfo[] = "effects of traps\n" "set in the field."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -9138,6 +9621,7 @@ const struct Item gItemsInfo[] = "the user misses\n" "due to Accuracy."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 80, @@ -9155,6 +9639,7 @@ const struct Item gItemsInfo[] = "Trick Room is\n" "active."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 100, @@ -9172,6 +9657,7 @@ const struct Item gItemsInfo[] = "protects from\n" "weather effects."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -12961,6 +13447,7 @@ const struct Item gItemsInfo[] = "prevented for this\n" "items's holder."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -12978,6 +13465,7 @@ const struct Item gItemsInfo[] = "moves and removes\n" "their contact."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -12995,6 +13483,7 @@ const struct Item gItemsInfo[] = "from additional\n" "effects of moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -13013,6 +13502,7 @@ const struct Item gItemsInfo[] = "Multihit strikes\n" "hit more times."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -13029,6 +13519,7 @@ const struct Item gItemsInfo[] = "auspicious wishes.\n" "Causes evolution."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13048,6 +13539,7 @@ const struct Item gItemsInfo[] = "ups Pokémon with\n" "certain Abilities."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -13064,6 +13556,7 @@ const struct Item gItemsInfo[] = "bamboo shoot. Best\n" "sold to gourmands."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -13080,6 +13573,7 @@ const struct Item gItemsInfo[] = "and treasure these\n" "curious coins."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_GimmighoulCoin, @@ -13095,6 +13589,7 @@ const struct Item gItemsInfo[] = "blade of some sort.\n" "Held by Bisharp."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_LeadersCrest, @@ -13110,6 +13605,7 @@ const struct Item gItemsInfo[] = "malicious will.\n" "Causes evolution."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13128,6 +13624,7 @@ const struct Item gItemsInfo[] = "stat increases\n" "but only once."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -13146,6 +13643,7 @@ const struct Item gItemsInfo[] = "the dark path."), .importance = 1, .pocket = POCKET_KEY_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13164,6 +13662,7 @@ const struct Item gItemsInfo[] = "the water path."), .importance = 1, .pocket = POCKET_KEY_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13196,6 +13695,7 @@ const struct Item gItemsInfo[] = "bamboo shoot. Best\n" "sold to gourmands."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 30, @@ -13209,6 +13709,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13221,6 +13722,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13233,6 +13735,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13245,6 +13748,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13257,6 +13761,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13269,6 +13774,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13281,6 +13787,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13293,6 +13800,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13305,6 +13813,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13317,6 +13826,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13329,6 +13839,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13341,6 +13852,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13353,6 +13865,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13365,6 +13878,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13377,6 +13891,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13389,6 +13904,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13401,6 +13917,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13413,6 +13930,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_TeraShard, @@ -13430,6 +13948,7 @@ const struct Item gItemsInfo[] = "that lets Dialga\n" "change form."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -13448,6 +13967,7 @@ const struct Item gItemsInfo[] = "that lets Giratina\n" "change form."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -13466,6 +13986,7 @@ const struct Item gItemsInfo[] = "that lets Palkia\n" "change form."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 60, @@ -13482,6 +14003,7 @@ const struct Item gItemsInfo[] = "makes some Pokémon\n" "evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13499,6 +14021,7 @@ const struct Item gItemsInfo[] = "that makes some\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13516,6 +14039,7 @@ const struct Item gItemsInfo[] = "that makes some\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13534,6 +14058,7 @@ const struct Item gItemsInfo[] = "Attack, but causes\n" "lasting confusion."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .flingPower = 10, @@ -13552,6 +14077,7 @@ const struct Item gItemsInfo[] = "raises the power of\n" "Fairy-type moves."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TYPE_BOOST_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .secondaryId = TYPE_FAIRY, @@ -13569,6 +14095,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13586,6 +14113,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13603,6 +14131,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13622,6 +14151,7 @@ const struct Item gItemsInfo[] = "wield the Rock-\n" "type in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_CornerstoneMask, @@ -13639,6 +14169,7 @@ const struct Item gItemsInfo[] = "wield the Water-\n" "type in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_WellspringMask, @@ -13656,6 +14187,7 @@ const struct Item gItemsInfo[] = "wield the Fire-\n" "type in battle."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SPECIAL_HELD_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_HearthflameMask, @@ -13669,6 +14201,7 @@ const struct Item gItemsInfo[] = .price = 500, .description = sHealthFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_MOCHI, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_HpMochi, @@ -13684,6 +14217,7 @@ const struct Item gItemsInfo[] = .price = 500, .description = sMuscleFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_MOCHI, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_AtkMochi, @@ -13699,6 +14233,7 @@ const struct Item gItemsInfo[] = .price = 500, .description = sResistFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_MOCHI, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_DefMochi, @@ -13714,6 +14249,7 @@ const struct Item gItemsInfo[] = .price = 500, .description = sGeniusFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_MOCHI, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_SpatkMochi, @@ -13729,6 +14265,7 @@ const struct Item gItemsInfo[] = .price = 500, .description = sCleverFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_MOCHI, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_SpdefMochi, @@ -13744,6 +14281,7 @@ const struct Item gItemsInfo[] = .price = 500, .description = sSwiftFeatherDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_MOCHI, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .effect = gItemEffect_SpeedMochi, @@ -13762,6 +14300,7 @@ const struct Item gItemsInfo[] = "all base points of\n" "a Pokémon."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STAT_BOOST_MOCHI, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_ResetEVs, .effect = gItemEffect_ResetMochi, @@ -13795,6 +14334,7 @@ const struct Item gItemsInfo[] = "that makes certain\n" "Pokémon evolve."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_EVOLUTION_ITEM, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_EvolutionStone, .effect = gItemEffect_EvoItem, @@ -13808,6 +14348,7 @@ const struct Item gItemsInfo[] = .price = 0, .description = sTeraShardDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_TERA_SHARD, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_StellarTeraShard, @@ -13820,6 +14361,7 @@ const struct Item gItemsInfo[] = .price = 250, .description = sFullHealDesc, .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_STATUS_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_CURE_STATUS, @@ -13838,6 +14380,7 @@ const struct Item gItemsInfo[] = "that restores HP\n" "by 20 points."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -13860,6 +14403,7 @@ const struct Item gItemsInfo[] = "by 50 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -13882,6 +14426,7 @@ const struct Item gItemsInfo[] = "by 200 points."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_HEALTH_RECOVERY, .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_Medicine, .battleUsage = EFFECT_ITEM_RESTORE_HP, @@ -13906,6 +14451,7 @@ const struct Item gItemsInfo[] = "during one battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_AUX_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, //.effect = currently missing @@ -13928,6 +14474,7 @@ const struct Item gItemsInfo[] = "during one battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_AUX_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, //.effect = currently missing @@ -13950,6 +14497,7 @@ const struct Item gItemsInfo[] = "during one battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_AUX_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, //.effect = currently missing @@ -13973,6 +14521,7 @@ const struct Item gItemsInfo[] = "one battle."), #endif .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_AUX_ITEM, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, //.effect = currently missing @@ -14028,6 +14577,7 @@ const struct Item gItemsInfo[] = "resembling a Poké-.\n" "mon. Can be sold."), .pocket = POCKET_ITEMS, + .sortType = ITEM_TYPE_SELLABLE, .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, .iconPic = gItemIcon_PokeshiDoll, diff --git a/src/item.c b/src/item.c index 4e7e514938..b155cbb903 100644 --- a/src/item.c +++ b/src/item.c @@ -32,8 +32,6 @@ static bool32 CheckPyramidBagHasItem(u16 itemId, u16 count); static bool32 CheckPyramidBagHasSpace(u16 itemId, u16 count); static const u8 *GetItemPluralName(u16); static bool32 DoesItemHavePluralName(u16); -static void BagPocket_GetSetSlotDataGeneric(struct BagPocket *pocket, u32 pocketPos, u16 *itemId, u16 *quantity, bool32 isSetting); -static void BagPocket_GetSetSlotDataPC(struct BagPocket *pocket, u32 pocketPos, u16 *itemId, u16 *quantity, bool32 isSetting); EWRAM_DATA struct BagPocket gBagPockets[POCKETS_COUNT] = {0}; @@ -61,71 +59,72 @@ const struct TmHmIndexKey gTMHMItemMoveIds[NUM_ALL_MACHINES + 1] = #undef UNPACK_TM_ITEM_ID #undef UNPACK_HM_ITEM_ID -static void (*const sBagPocket_GetSetSlotDataFuncs[])(struct BagPocket *pocket, u32 pocketPos, u16 *itemId, u16 *quantity, bool32 isSetting) = +static inline struct ItemSlot NONNULL BagPocket_GetSlotDataGeneric(struct BagPocket *pocket, u32 pocketPos) { - [POCKET_ITEMS] = BagPocket_GetSetSlotDataGeneric, - [POCKET_KEY_ITEMS] = BagPocket_GetSetSlotDataGeneric, - [POCKET_POKE_BALLS] = BagPocket_GetSetSlotDataGeneric, - [POCKET_TM_HM] = BagPocket_GetSetSlotDataGeneric, - [POCKET_BERRIES] = BagPocket_GetSetSlotDataGeneric, - [POCKET_DUMMY] = BagPocket_GetSetSlotDataPC, -}; + return (struct ItemSlot) { + .itemId = pocket->itemSlots[pocketPos].itemId, + .quantity = pocket->itemSlots[pocketPos].quantity ^ gSaveBlock2Ptr->encryptionKey, + }; +} -static void NONNULL BagPocket_GetSetSlotDataGeneric(struct BagPocket *pocket, u32 pocketPos, u16 *itemId, u16 *quantity, bool32 isSetting) +static inline struct ItemSlot NONNULL BagPocket_GetSlotDataPC(struct BagPocket *pocket, u32 pocketPos) { - if (isSetting) + return (struct ItemSlot) { + .itemId = pocket->itemSlots[pocketPos].itemId, + .quantity = pocket->itemSlots[pocketPos].quantity, + }; +} + +static inline void NONNULL BagPocket_SetSlotDataGeneric(struct BagPocket *pocket, u32 pocketPos, struct ItemSlot newSlot) +{ + pocket->itemSlots[pocketPos].itemId = newSlot.itemId; + pocket->itemSlots[pocketPos].quantity = newSlot.quantity ^ gSaveBlock2Ptr->encryptionKey; +} + +static inline void NONNULL BagPocket_SetSlotDataPC(struct BagPocket *pocket, u32 pocketPos, struct ItemSlot newSlot) +{ + pocket->itemSlots[pocketPos].itemId = newSlot.itemId; + pocket->itemSlots[pocketPos].quantity = newSlot.quantity; +} + +struct ItemSlot NONNULL BagPocket_GetSlotData(struct BagPocket *pocket, u32 pocketPos) +{ + switch (pocket->id) { - pocket->itemSlots[pocketPos].itemId = *quantity ? *itemId : ITEM_NONE; // Sets to zero if quantity is zero - pocket->itemSlots[pocketPos].quantity = *quantity ^ gSaveBlock2Ptr->encryptionKey; + case POCKET_ITEMS: + case POCKET_KEY_ITEMS: + case POCKET_POKE_BALLS: + case POCKET_TM_HM: + case POCKET_BERRIES: + return BagPocket_GetSlotDataGeneric(pocket, pocketPos); + case POCKET_DUMMY: + return BagPocket_GetSlotDataPC(pocket, pocketPos); } - else + + return (struct ItemSlot) {0}; // Because compiler complains +} + +void NONNULL BagPocket_SetSlotData(struct BagPocket *pocket, u32 pocketPos, struct ItemSlot newSlot) +{ + if (newSlot.itemId == ITEM_NONE || newSlot.quantity == 0) // Sets to zero if quantity or itemId is zero { - *itemId = pocket->itemSlots[pocketPos].itemId; - *quantity = pocket->itemSlots[pocketPos].quantity ^ gSaveBlock2Ptr->encryptionKey; + newSlot.itemId = ITEM_NONE; + newSlot.quantity = 0; } -} -static void NONNULL BagPocket_GetSetSlotDataPC(struct BagPocket *pocket, u32 pocketPos, u16 *itemId, u16 *quantity, bool32 isSetting) -{ - if (isSetting) + switch (pocket->id) { - pocket->itemSlots[pocketPos].itemId = *quantity ? *itemId : ITEM_NONE; // Sets to zero if quantity is zero - pocket->itemSlots[pocketPos].quantity = *quantity; + case POCKET_ITEMS: + case POCKET_KEY_ITEMS: + case POCKET_POKE_BALLS: + case POCKET_TM_HM: + case POCKET_BERRIES: + BagPocket_SetSlotDataGeneric(pocket, pocketPos, newSlot); + break; + case POCKET_DUMMY: + BagPocket_SetSlotDataPC(pocket, pocketPos, newSlot); + break; } - else - { - *itemId = pocket->itemSlots[pocketPos].itemId; - *quantity = pocket->itemSlots[pocketPos].quantity; - } -} - -static inline void NONNULL BagPocket_GetSlotData(struct BagPocket *pocket, u32 pocketPos, u16 *itemId, u16 *quantity) -{ - sBagPocket_GetSetSlotDataFuncs[pocket->id](pocket, pocketPos, itemId, quantity, FALSE); -} - -static inline void NONNULL BagPocket_SetSlotData(struct BagPocket *pocket, u32 pocketPos, u16 *itemId, u16 *quantity) -{ - sBagPocket_GetSetSlotDataFuncs[pocket->id](pocket, pocketPos, itemId, quantity, TRUE); -} - -void GetBagItemIdAndQuantity(enum Pocket pocketId, u32 pocketPos, u16 *itemId, u16 *quantity) -{ - BagPocket_GetSlotData(&gBagPockets[pocketId], pocketPos, itemId, quantity); -} - -u16 GetBagItemId(enum Pocket pocketId, u32 pocketPos) -{ - u16 itemId, quantity; - BagPocket_GetSlotData(&gBagPockets[pocketId], pocketPos, &itemId, &quantity); - return itemId; -} - -u16 GetBagItemQuantity(enum Pocket pocketId, u32 pocketPos) -{ - u16 itemId, quantity; - BagPocket_GetSlotData(&gBagPockets[pocketId], pocketPos, &itemId, &quantity); - return quantity; } void ApplyNewEncryptionKeyToBagItems(u32 newKey) @@ -200,14 +199,14 @@ bool32 IsBagPocketNonEmpty(enum Pocket pocketId) static bool32 NONNULL BagPocket_CheckHasItem(struct BagPocket *pocket, u16 itemId, u16 count) { - u16 tempItemId, tempQuantity; + struct ItemSlot tempItem; // Check for item slots that contain the item for (u32 i = 0; i < pocket->capacity && count > 0; i++) { - BagPocket_GetSlotData(pocket, i, &tempItemId, &tempQuantity); - if (tempItemId == itemId) - count -= min(count, tempQuantity); + tempItem = BagPocket_GetSlotData(pocket, i); + if (tempItem.itemId == itemId) + count -= min(count, tempItem.quantity); } return count == 0; @@ -257,14 +256,14 @@ bool32 CheckBagHasSpace(u16 itemId, u16 count) static u32 NONNULL BagPocket_GetFreeSpaceForItem(struct BagPocket *pocket, u16 itemId) { u32 spaceForItem = 0; - u16 tempItemId, tempQuantity; + struct ItemSlot tempItem; // Check space in any existing item slots that already contain this item for (u32 i = 0; i < pocket->capacity; i++) { - BagPocket_GetSlotData(pocket, i, &tempItemId, &tempQuantity); - if (tempItemId == ITEM_NONE || tempItemId == itemId) - spaceForItem += (tempItemId ? (MAX_BAG_ITEM_CAPACITY - tempQuantity) : MAX_BAG_ITEM_CAPACITY); + tempItem = BagPocket_GetSlotData(pocket, i); + if (tempItem.itemId == ITEM_NONE || tempItem.itemId == itemId) + spaceForItem += (tempItem.itemId ? (MAX_BAG_ITEM_CAPACITY - tempItem.quantity) : MAX_BAG_ITEM_CAPACITY); } return spaceForItem; @@ -280,17 +279,16 @@ u32 GetFreeSpaceForItemInBag(u16 itemId) static inline bool32 NONNULL CheckSlotAndUpdateCount(struct BagPocket *pocket, u16 itemId, u32 pocketPos, u32 *nextPocketPos, u16 *count, u16 *tempPocketSlotQuantities) { - u16 tempItemId, tempQuantity; - BagPocket_GetSlotData(pocket, pocketPos, &tempItemId, &tempQuantity); - if (tempItemId == ITEM_NONE || tempItemId == itemId) + struct ItemSlot tempItem = BagPocket_GetSlotData(pocket, pocketPos); + if (tempItem.itemId == ITEM_NONE || tempItem.itemId == itemId) { // The quantity already at the slot - zero if an empty slot - if (!tempItemId) - tempQuantity = 0; + if (tempItem.itemId == ITEM_NONE) + tempItem.quantity = 0; // Record slot quantity in tempPocketSlotQuantities, adjust count - tempPocketSlotQuantities[pocketPos] = min(MAX_BAG_ITEM_CAPACITY, *count + tempQuantity); - *count -= min(*count, MAX_BAG_ITEM_CAPACITY - tempQuantity); + tempPocketSlotQuantities[pocketPos] = min(MAX_BAG_ITEM_CAPACITY, *count + tempItem.quantity); + *count -= min(*count, MAX_BAG_ITEM_CAPACITY - tempItem.quantity); // Set the starting index for the next loop to set items (shifted by one) if (!*nextPocketPos) @@ -336,7 +334,7 @@ static bool32 NONNULL BagPocket_AddItem(struct BagPocket *pocket, u16 itemId, u1 for (--itemAddIndex; itemAddIndex < itemLookupIndex; itemAddIndex++) { if (tempPocketSlotQuantities[itemAddIndex] > 0) - BagPocket_SetSlotData(pocket, itemAddIndex, &itemId, &tempPocketSlotQuantities[itemAddIndex]); + BagPocket_SetSlotItemIdAndCount(pocket, itemAddIndex, itemId, tempPocketSlotQuantities[itemAddIndex]); } } @@ -359,21 +357,21 @@ bool32 AddBagItem(u16 itemId, u16 count) static bool32 NONNULL BagPocket_RemoveItem(struct BagPocket *pocket, u16 itemId, u16 count) { u32 itemLookupIndex, itemRemoveIndex = 0, totalQuantity = 0; - u16 tempItemId, tempQuantity; + struct ItemSlot tempItem; u16 *tempPocketSlotQuantities = AllocZeroed(sizeof(u16) * pocket->capacity); for (itemLookupIndex = 0; itemLookupIndex < pocket->capacity && totalQuantity < count; itemLookupIndex++) { - BagPocket_GetSlotData(pocket, itemLookupIndex, &tempItemId, &tempQuantity); - if (tempItemId == itemId) + tempItem = BagPocket_GetSlotData(pocket, itemLookupIndex); + if (tempItem.itemId == itemId) { // Index for the next loop - where we should start removing items if (!itemRemoveIndex) itemRemoveIndex = itemLookupIndex + 1; // Gather quantities (+ 1 to tempPocketSlotQuantities so that even if setting to 0 we know which indices to target) - totalQuantity += tempQuantity; - tempPocketSlotQuantities[itemLookupIndex] = (tempQuantity <= count ? 0 : tempQuantity - count) + 1; + totalQuantity += tempItem.quantity; + tempPocketSlotQuantities[itemLookupIndex] = (tempItem.quantity <= count ? 0 : tempItem.quantity - count) + 1; } } @@ -389,10 +387,7 @@ static bool32 NONNULL BagPocket_RemoveItem(struct BagPocket *pocket, u16 itemId, for (--itemRemoveIndex; itemRemoveIndex < itemLookupIndex; itemRemoveIndex++) { if (tempPocketSlotQuantities[itemRemoveIndex] > 0) - { - tempPocketSlotQuantities[itemRemoveIndex]--; // Reverse the +1 shift - BagPocket_SetSlotData(pocket, itemRemoveIndex, &itemId, &tempPocketSlotQuantities[itemRemoveIndex]); - } + BagPocket_SetSlotItemIdAndCount(pocket, itemRemoveIndex, itemId, tempPocketSlotQuantities[itemRemoveIndex] - 1); } } @@ -415,12 +410,10 @@ bool32 RemoveBagItem(u16 itemId, u16 count) static u8 NONNULL BagPocket_CountUsedItemSlots(struct BagPocket *pocket) { u8 usedSlots = 0; - u16 tempItemId, tempQuantity; for (u32 i = 0; i < pocket->capacity; i++) { - BagPocket_GetSlotData(pocket, i, &tempItemId, &tempQuantity); - if (tempItemId) + if (BagPocket_GetSlotData(pocket, i).itemId != ITEM_NONE) usedSlots++; } return usedSlots; @@ -434,12 +427,12 @@ u8 CountUsedPCItemSlots(void) static bool32 NONNULL BagPocket_CheckPocketForItemCount(struct BagPocket *pocket, u16 itemId, u16 count) { - u16 tempItemId, tempQuantity; + struct ItemSlot tempItem; for (u32 i = 0; i < pocket->capacity; i++) { - BagPocket_GetSlotData(pocket, i, &tempItemId, &tempQuantity); - if (tempItemId == itemId && tempQuantity >= count) + tempItem = BagPocket_GetSlotData(pocket, i); + if (tempItem.itemId == itemId && tempItem.quantity >= count) return TRUE; } return FALSE; @@ -459,20 +452,20 @@ bool32 AddPCItem(u16 itemId, u16 count) static void NONNULL BagPocket_CompactItems(struct BagPocket *pocket) { - u16 itemId, quantity, zero = 0, slotCursor = 0; + struct ItemSlot tempItem; + u32 slotCursor = 0; for (u32 i = 0; i < pocket->capacity; i++) { - BagPocket_GetSlotData(pocket, i, &itemId, &quantity); - if (itemId == ITEM_NONE) + tempItem = BagPocket_GetSlotData(pocket, i); + if (tempItem.itemId == ITEM_NONE) { if (!slotCursor) slotCursor = i + 1; } else if (slotCursor > 0) { - BagPocket_SetSlotData(pocket, slotCursor - 1, &itemId, &quantity); - BagPocket_SetSlotData(pocket, i, &zero, &zero); - slotCursor++; + BagPocket_SetSlotData(pocket, slotCursor++ - 1, tempItem); + BagPocket_SetSlotItemIdAndCount(pocket, i, ITEM_NONE, 0); } } } @@ -482,15 +475,13 @@ void RemovePCItem(u8 index, u16 count) struct BagPocket dummyPocket = DUMMY_PC_BAG_POCKET; // Get id, quantity at slot - u16 tempItemId, tempQuantity; - BagPocket_GetSlotData(&dummyPocket, index, &tempItemId, &tempQuantity); + struct ItemSlot tempItem = BagPocket_GetSlotData(&dummyPocket, index); // Remove quantity - tempQuantity -= count; - BagPocket_SetSlotData(&dummyPocket, index, &tempItemId, &tempQuantity); + BagPocket_SetSlotItemIdAndCount(&dummyPocket, index, tempItem.itemId, tempItem.quantity - count); // Compact if necessary - if (tempQuantity == 0) + if (tempItem.quantity == 0) BagPocket_CompactItems(&dummyPocket); } @@ -518,42 +509,6 @@ void CompactItemsInBagPocket(enum Pocket pocketId) BagPocket_CompactItems(&gBagPockets[pocketId]); } -// Opens the possibility of sorting by other means e.g. ghoulslash's advanced sorting -static inline bool32 ItemIndexCompare(u16 itemA, u16 itemB, enum SortPocket sortPocket) -{ - switch (sortPocket) - { - case SORT_POCKET_BY_ITEM_ID: - return itemA > itemB; - case SORT_POCKET_TM_HM: - return GetItemTMHMIndex(itemA) > GetItemTMHMIndex(itemB); - default: - return FALSE; - } -} - -void SortPocket(enum Pocket pocketId, enum SortPocket sortPocket) -{ - u16 itemId_i, quantity_i, itemId_j, quantity_j; - struct BagPocket *pocket = &gBagPockets[pocketId]; - - for (u32 i = 0; i < pocket->capacity - 1; i++) - { - BagPocket_GetSlotData(pocket, i, &itemId_i, &quantity_i); - for (u32 j = i + 1; j < pocket->capacity; j++) - { - BagPocket_GetSlotData(pocket, j, &itemId_j, &quantity_j); - if (itemId_j && (!itemId_i || ItemIndexCompare(itemId_i, itemId_j, sortPocket))) - { - BagPocket_SetSlotData(pocket, i, &itemId_j, &quantity_j); - BagPocket_SetSlotData(pocket, j, &itemId_i, &quantity_i); - itemId_i = itemId_j; - quantity_i = quantity_j; - } - } - } -} - static inline void NONNULL BagPocket_MoveItemSlot(struct BagPocket *pocket, u32 from, u32 to) { if (from != to) @@ -563,18 +518,14 @@ static inline void NONNULL BagPocket_MoveItemSlot(struct BagPocket *pocket, u32 to--; // Record the values at "from" - u16 fromItemId, fromQuantity, tempItemId, tempQuantity; - BagPocket_GetSlotData(pocket, from, &fromItemId, &fromQuantity); + struct ItemSlot fromSlot = BagPocket_GetSlotData(pocket, from); // Shuffle items between "to" and "from" for (u32 i = from; i != to; i += shift) - { - BagPocket_GetSlotData(pocket, i + shift, &tempItemId, &tempQuantity); - BagPocket_SetSlotData(pocket, i, &tempItemId, &tempQuantity); - } + BagPocket_SetSlotData(pocket, i, BagPocket_GetSlotData(pocket, i + shift)); // Move the saved "from" to "to" - BagPocket_SetSlotData(pocket, to, &fromItemId, &fromQuantity); + BagPocket_SetSlotData(pocket, to, fromSlot); } } @@ -596,13 +547,14 @@ void ClearBag(void) static inline u16 NONNULL BagPocket_CountTotalItemQuantity(struct BagPocket *pocket, u16 itemId) { - u16 tempItemId, tempQuantity, ownedCount = 0; + u32 ownedCount = 0; + struct ItemSlot tempItem; for (u32 i = 0; i < pocket->capacity; i++) { - BagPocket_GetSlotData(pocket, i, &tempItemId, &tempQuantity); - if (tempItemId == itemId) - ownedCount += tempQuantity; + tempItem = BagPocket_GetSlotData(pocket, i); + if (tempItem.itemId == itemId) + ownedCount += tempItem.quantity; } return ownedCount; diff --git a/src/item_menu.c b/src/item_menu.c index d6e3598b58..6d1fb43077 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -89,6 +89,10 @@ enum { ACTION_SHOW, ACTION_GIVE_FAVOR_LADY, ACTION_CONFIRM_QUIZ_LADY, + ACTION_BY_NAME, + ACTION_BY_TYPE, + ACTION_BY_AMOUNT, + ACTION_BY_INDEX, ACTION_DUMMY, }; @@ -218,6 +222,19 @@ static const u8 sText_DepositedVar2Var1s[] = _("Deposited {STR_VAR_2}\n{STR_VAR_ static const u8 sText_NoRoomForItems[] = _("There's no room to\nstore items."); static const u8 sText_CantStoreImportantItems[] = _("Important items\ncan't be stored in\nthe PC!"); +static void Task_LoadBagSortOptions(u8 taskId); +static void ItemMenu_SortByName(u8 taskId); +static void ItemMenu_SortByType(u8 taskId); +static void ItemMenu_SortByAmount(u8 taskId); +static void ItemMenu_SortByIndex(u8 taskId); +static void SortBagItems(u8 taskId); +static void Task_SortFinish(u8 taskId); +static void MergeSort(struct BagPocket *pocket, s32 (*comparator)(enum Pocket, struct ItemSlot, struct ItemSlot)); +static s32 CompareItemsAlphabetically(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2); +static s32 CompareItemsByMost(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2); +static s32 CompareItemsByType(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2); +static s32 CompareItemsByIndex(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2); + static const struct BgTemplate sBgTemplates_ItemMenu[] = { { @@ -271,6 +288,7 @@ static const struct ListMenuTemplate sItemListMenu = .cursorKind = CURSOR_BLACK_ARROW }; +static const u8 sText_NothingToSort[] = _("There's nothing to sort!"); static const struct MenuAction sItemMenuActions[] = { [ACTION_USE] = {gMenuText_Use, {ItemMenu_UseOutOfBattle}}, [ACTION_TOSS] = {gMenuText_Toss, {ItemMenu_Toss}}, @@ -286,6 +304,10 @@ static const struct MenuAction sItemMenuActions[] = { [ACTION_SHOW] = {COMPOUND_STRING("SHOW"), {ItemMenu_Show}}, [ACTION_GIVE_FAVOR_LADY] = {gMenuText_Give2, {ItemMenu_GiveFavorLady}}, [ACTION_CONFIRM_QUIZ_LADY] = {gMenuText_Confirm, {ItemMenu_ConfirmQuizLady}}, + [ACTION_BY_NAME] = {COMPOUND_STRING("Name"), {ItemMenu_SortByName}}, + [ACTION_BY_TYPE] = {COMPOUND_STRING("Type"), {ItemMenu_SortByType}}, + [ACTION_BY_AMOUNT] = {COMPOUND_STRING("Amount"), {ItemMenu_SortByAmount}}, + [ACTION_BY_INDEX] = {COMPOUND_STRING("Index"), {ItemMenu_SortByIndex}}, [ACTION_DUMMY] = {gText_EmptyString2, {NULL}} }; @@ -966,7 +988,6 @@ static void BagMenu_ItemPrintCallback(u8 windowId, u32 itemIndex, u8 y) { if (itemIndex != LIST_CANCEL) { - u16 itemId, itemQuantity; s32 offset; if (gBagMenu->toSwapPos != NOT_SWAPPING) @@ -978,16 +999,16 @@ static void BagMenu_ItemPrintCallback(u8 windowId, u32 itemIndex, u8 y) BagMenu_PrintCursorAtPos(y, COLORID_NONE); } - GetBagItemIdAndQuantity(gBagPosition.pocket, itemIndex, &itemId, &itemQuantity); + struct ItemSlot itemSlot = GetBagItemIdAndQuantity(gBagPosition.pocket, itemIndex); // Draw HM icon - if (gBagPosition.pocket == POCKET_TM_HM && GetItemTMHMIndex(itemId) > NUM_TECHNICAL_MACHINES) + if (gBagPosition.pocket == POCKET_TM_HM && GetItemTMHMIndex(itemSlot.itemId) > NUM_TECHNICAL_MACHINES) BlitBitmapToWindow(windowId, gBagMenuHMIcon_Gfx, 8, y - 1, 16, 16); - if (gBagPosition.pocket != POCKET_KEY_ITEMS && GetItemImportance(itemId) == FALSE) + if (gBagPosition.pocket != POCKET_KEY_ITEMS && GetItemImportance(itemSlot.itemId) == FALSE) { // Print item quantity - ConvertIntToDecimalStringN(gStringVar1, itemQuantity, STR_CONV_MODE_RIGHT_ALIGN, MAX_ITEM_DIGITS); + ConvertIntToDecimalStringN(gStringVar1, itemSlot.quantity, STR_CONV_MODE_RIGHT_ALIGN, MAX_ITEM_DIGITS); StringExpandPlaceholders(gStringVar4, gText_xVar1); offset = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 119); BagMenu_Print(windowId, FONT_NARROW, gStringVar4, offset, y, 0, 0, TEXT_SKIP_DRAW, COLORID_NORMAL); @@ -995,7 +1016,7 @@ static void BagMenu_ItemPrintCallback(u8 windowId, u32 itemIndex, u8 y) else { // Print registered icon - if (gSaveBlock1Ptr->registeredItem != ITEM_NONE && gSaveBlock1Ptr->registeredItem == itemId) + if (gSaveBlock1Ptr->registeredItem != ITEM_NONE && gSaveBlock1Ptr->registeredItem == itemSlot.itemId) BlitBitmapToWindow(windowId, sRegisteredSelect_Gfx, 96, y - 1, 24, 16); } } @@ -1125,16 +1146,17 @@ static void Task_CloseBagMenu(u8 taskId) } } -void UpdatePocketItemList(u8 pocketId) +void UpdatePocketItemList(enum Pocket pocketId) { - u16 i; + if (pocketId >= POCKETS_COUNT) + return; // shouldn't even get here + + struct BagPocket *pocket = &gBagPockets[pocketId]; switch (pocketId) { case POCKET_TM_HM: - SortPocket(pocketId, SORT_POCKET_TM_HM); - break; case POCKET_BERRIES: - SortPocket(pocketId, SORT_POCKET_BY_ITEM_ID); + SortItemsInBag(pocket, SORT_BY_INDEX); break; default: CompactItemsInBagPocket(pocketId); @@ -1143,7 +1165,7 @@ void UpdatePocketItemList(u8 pocketId) gBagMenu->numItemStacks[pocketId] = 0; - for (i = 0; i < gBagPockets[pocketId].capacity && GetBagItemId(pocketId, i); i++) + for (u32 i = 0; i < pocket->capacity && BagPocket_GetSlotData(pocket, i).itemId; i++) gBagMenu->numItemStacks[pocketId]++; if (!gBagMenu->hideCloseBagText) @@ -1263,6 +1285,34 @@ static void Task_BagMenu_HandleInput(u8 taskId) } return; } + else if (JOY_NEW(START_BUTTON)) + { + if ((gBagMenu->numItemStacks[gBagPosition.pocket] - 1) <= 1) //can't sort with 0 or 1 item in bag + { + static const u8 sText_NothingToSort[] = _("There's nothing to sort!"); + PlaySE(SE_FAILURE); + DisplayItemMessage(taskId, 1, sText_NothingToSort, HandleErrorMessage); + break; + } + else + { + struct ItemSlot tempItem; + data[1] = GetItemListPosition(gBagPosition.pocket); + tempItem = GetBagItemIdAndQuantity(gBagPosition.pocket, data[1]); + data[2] = tempItem.quantity; + if (gBagPosition.cursorPosition[gBagPosition.pocket] == gBagMenu->numItemStacks[gBagPosition.pocket]) + break; + else + gSpecialVar_ItemId = tempItem.itemId; + + PlaySE(SE_SELECT); + BagDestroyPocketScrollArrowPair(); + BagMenu_PrintCursor(tListTaskId, COLORID_GRAY_CURSOR); + ListMenuGetScrollAndRow(data[0], scrollPos, cursorPos); + gTasks[taskId].func = Task_LoadBagSortOptions; + return; + } + } break; } @@ -1283,12 +1333,16 @@ static void Task_BagMenu_HandleInput(u8 taskId) gTasks[taskId].func = Task_FadeAndCloseBagMenu; break; default: // A_BUTTON - PlaySE(SE_SELECT); - BagDestroyPocketScrollArrowPair(); - BagMenu_PrintCursor(tListTaskId, COLORID_GRAY_CURSOR); - tListPosition = listPosition; - GetBagItemIdAndQuantity(gBagPosition.pocket, listPosition, &gSpecialVar_ItemId, (u16*)&tQuantity); - sContextMenuFuncs[gBagPosition.location](taskId); + { + struct ItemSlot itemSlot = GetBagItemIdAndQuantity(gBagPosition.pocket, listPosition); + PlaySE(SE_SELECT); + BagDestroyPocketScrollArrowPair(); + BagMenu_PrintCursor(tListTaskId, COLORID_GRAY_CURSOR); + tListPosition = listPosition; + gSpecialVar_ItemId = itemSlot.itemId; + tQuantity = itemSlot.quantity; + sContextMenuFuncs[gBagPosition.location](taskId); + } break; } } @@ -2639,3 +2693,310 @@ static void PrintTMHMMoveData(u16 itemId) CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX); } } + +static const u8 sText_SortItemsHow[] = _("Sort items how?"); +static const u8 sText_ItemsSorted[] = _("Items sorted by {STR_VAR_1}!"); +static const u8 *const sSortTypeStrings[] = +{ + [SORT_ALPHABETICALLY] = COMPOUND_STRING("name"), + [SORT_BY_TYPE] = COMPOUND_STRING("type"), + [SORT_BY_AMOUNT] = COMPOUND_STRING("amount"), + [SORT_BY_INDEX] = COMPOUND_STRING("index") +}; + +static const u8 sBagMenuSortItems[] = +{ + ACTION_BY_NAME, + ACTION_BY_TYPE, + ACTION_BY_AMOUNT, + ACTION_CANCEL, +}; + +static const u8 sBagMenuSortKeyItems[] = +{ + ACTION_BY_NAME, + ACTION_CANCEL, +}; + +static const u8 sBagMenuSortPokeBalls[] = +{ + ACTION_BY_NAME, + ACTION_BY_AMOUNT, + ACTION_DUMMY, + ACTION_CANCEL, +}; + +static const u8 sBagMenuSortBerriesTMsHMs[] = +{ + ACTION_BY_NAME, + ACTION_BY_AMOUNT, + ACTION_BY_INDEX, + ACTION_CANCEL, +}; + +static void AddBagSortSubMenu(void) +{ + switch (gBagPosition.pocket) + { + case POCKET_KEY_ITEMS: + gBagMenu->contextMenuItemsPtr = sBagMenuSortKeyItems; + memcpy(&gBagMenu->contextMenuItemsBuffer, &sBagMenuSortKeyItems, NELEMS(sBagMenuSortKeyItems)); + gBagMenu->contextMenuNumItems = NELEMS(sBagMenuSortKeyItems); + break; + case POCKET_POKE_BALLS: + gBagMenu->contextMenuItemsPtr = sBagMenuSortPokeBalls; + memcpy(&gBagMenu->contextMenuItemsBuffer, &sBagMenuSortPokeBalls, NELEMS(sBagMenuSortPokeBalls)); + gBagMenu->contextMenuNumItems = NELEMS(sBagMenuSortPokeBalls); + break; + case POCKET_BERRIES: + case POCKET_TM_HM: + gBagMenu->contextMenuItemsPtr = sBagMenuSortBerriesTMsHMs; + memcpy(&gBagMenu->contextMenuItemsBuffer, &sBagMenuSortBerriesTMsHMs, NELEMS(sBagMenuSortBerriesTMsHMs)); + gBagMenu->contextMenuNumItems = NELEMS(sBagMenuSortBerriesTMsHMs); + break; + default: + gBagMenu->contextMenuItemsPtr = sBagMenuSortItems; + memcpy(&gBagMenu->contextMenuItemsBuffer, &sBagMenuSortItems, NELEMS(sBagMenuSortItems)); + gBagMenu->contextMenuNumItems = NELEMS(sBagMenuSortItems); + break; + } + + StringExpandPlaceholders(gStringVar4, sText_SortItemsHow); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); + BagMenu_Print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); + + if (gBagMenu->contextMenuNumItems == 2) + PrintContextMenuItems(BagMenu_AddWindow(ITEMWIN_1x2)); + else if (gBagMenu->contextMenuNumItems == 4) + PrintContextMenuItemGrid(BagMenu_AddWindow(ITEMWIN_2x2), 2, 2); + else + PrintContextMenuItemGrid(BagMenu_AddWindow(ITEMWIN_2x3), 2, 3); +} + +static void Task_LoadBagSortOptions(u8 taskId) +{ + AddBagSortSubMenu(); + if (gBagMenu->contextMenuNumItems <= 2) + gTasks[taskId].func = Task_ItemContext_SingleRow; + else + gTasks[taskId].func = Task_ItemContext_MultipleRows; +} + +#define tSortType data[2] +static void ItemMenu_SortByName(u8 taskId) +{ + gTasks[taskId].tSortType = SORT_ALPHABETICALLY; + StringCopy(gStringVar1, sSortTypeStrings[SORT_ALPHABETICALLY]); + gTasks[taskId].func = SortBagItems; +} + +static void ItemMenu_SortByType(u8 taskId) +{ + gTasks[taskId].tSortType = SORT_BY_TYPE; + StringCopy(gStringVar1, sSortTypeStrings[SORT_BY_TYPE]); + gTasks[taskId].func = SortBagItems; +} + +static void ItemMenu_SortByAmount(u8 taskId) +{ + gTasks[taskId].tSortType = SORT_BY_AMOUNT; //greatest->least + StringCopy(gStringVar1, sSortTypeStrings[SORT_BY_AMOUNT]); + gTasks[taskId].func = SortBagItems; +} + +static void ItemMenu_SortByIndex(u8 taskId) +{ + gTasks[taskId].tSortType = SORT_BY_INDEX; + StringCopy(gStringVar1, sSortTypeStrings[SORT_BY_INDEX]); + gTasks[taskId].func = SortBagItems; +} + +static void SortBagItems(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + + RemoveContextWindow(); + + SortItemsInBag(&gBagPockets[gBagPosition.pocket], tSortType); + DestroyListMenuTask(data[0], scrollPos, cursorPos); + UpdatePocketListPosition(gBagPosition.pocket); + LoadBagItemListBuffers(gBagPosition.pocket); + data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollPos, *cursorPos); + ScheduleBgCopyTilemapToVram(0); + + StringCopy(gStringVar1, sSortTypeStrings[tSortType]); + StringExpandPlaceholders(gStringVar4, sText_ItemsSorted); + DisplayItemMessage(taskId, 1, gStringVar4, Task_SortFinish); +} + +#undef tSortType + +static void Task_SortFinish(u8 taskId) +{ + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + RemoveItemMessageWindow(4); + ReturnToItemList(taskId); + } +} + +void SortItemsInBag(struct BagPocket *pocket, enum BagSortOptions type) +{ + switch (type) + { + case SORT_ALPHABETICALLY: + MergeSort(pocket, CompareItemsAlphabetically); + break; + case SORT_BY_AMOUNT: + MergeSort(pocket, CompareItemsByMost); + break; + case SORT_BY_INDEX: + MergeSort(pocket, CompareItemsByIndex); + break; + default: + MergeSort(pocket, CompareItemsByType); + break; + } +} + +static inline __attribute__((always_inline)) void Merge(struct BagPocket *pocket, u32 iLeft, u32 iRight, u32 iEnd, struct ItemSlot *dummySlots, s32 (*comparator)(enum Pocket, struct ItemSlot, struct ItemSlot)) +{ + struct ItemSlot item_i, item_j; + u32 i = iLeft, j = iRight; + for (u32 k = iLeft; k < iEnd; k++) + { + item_i = BagPocket_GetSlotData(pocket, i); + item_j = BagPocket_GetSlotData(pocket, j); + if (i < iRight && (j >= iEnd || comparator(pocket->id, item_i, item_j) < 0)) + { + dummySlots[k] = item_i; + i++; + } + else + { + dummySlots[k] = item_j; + j++; + } + } +} + +// Source: https://en.wikipedia.org/wiki/Merge_sort#Bottom-up_implementation +static void MergeSort(struct BagPocket *pocket, s32 (*comparator)(enum Pocket, struct ItemSlot, struct ItemSlot)) +{ + struct ItemSlot *dummySlots = AllocZeroed(sizeof(struct ItemSlot) * pocket->capacity); + + for (u32 width = 1; width < pocket->capacity; width *= 2) + { + for (u32 i = 0; i < pocket->capacity; i += 2 * width) + Merge(pocket, i, min(i + width, pocket->capacity), min(i + 2 * width, pocket->capacity), dummySlots, comparator); + + for (u32 j = 0; j < pocket->capacity; j++) + BagPocket_SetSlotData(pocket, j, dummySlots[j]); + } + + Free(dummySlots); +} + +static s32 CompareItemsAlphabetically(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2) +{ + const u8 *name1, *name2; + + if (item1.itemId == ITEM_NONE) + return 1; + else if (item2.itemId == ITEM_NONE) + return -1; + + if (pocketId == POCKET_TM_HM) + { + name1 = gMovesInfo[GetTMHMMoveId(GetItemTMHMIndex(item1.itemId))].name; + name2 = gMovesInfo[GetTMHMMoveId(GetItemTMHMIndex(item2.itemId))].name; + } + else + { + name1 = GetItemName(item1.itemId); + name2 = GetItemName(item2.itemId); + } + + for (u32 i = 0; ; ++i) + { + if (name1[i] == EOS && name2[i] != EOS) + return -1; + else if (name1[i] != EOS && name2[i] == EOS) + return 1; + else if (name1[i] == EOS && name2[i] == EOS) + return 0; + + if (name1[i] < name2[i]) + return -1; + else if (name1[i] > name2[i]) + return 1; + } + + return 0; // Will never be reached +} + +static s32 CompareItemsByMost(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2) +{ + if (item1.itemId == ITEM_NONE) + return 1; + else if (item2.itemId == ITEM_NONE) + return -1; + + if (item1.quantity < item2.quantity) + return 1; + else if (item1.quantity > item2.quantity) + return -1; + + return CompareItemsAlphabetically(pocketId, item1, item2); // Items have same quantity so sort alphabetically +} + +static s32 CompareItemsByType(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2) +{ + enum ItemSortType type1 = gItemsInfo[item1.itemId].sortType; + enum ItemSortType type2 = gItemsInfo[item2.itemId].sortType; + + // Null and uncategorized items go last + if (type1 && !type2) + return -1; + else if (type2 && !type1) + return 1; + else if (type1 < type2) + return -1; + else if (type1 > type2) + return 1; + + return CompareItemsAlphabetically(pocketId, item1, item2); // Items are of same type so sort alphabetically +} + +static s32 CompareItemsByIndex(enum Pocket pocketId, struct ItemSlot item1, struct ItemSlot item2) +{ + u16 index1 = 0, index2 = 0; + + if (item1.itemId == ITEM_NONE) + return 1; + else if (item2.itemId == ITEM_NONE) + return -1; + + switch (pocketId) + { + case POCKET_TM_HM: + index1 = GetItemTMHMIndex(item1.itemId); + index2 = GetItemTMHMIndex(item2.itemId); + break; + case POCKET_BERRIES: // To do - requires #7305 + index1 = item1.itemId; + index2 = item2.itemId; + break; + default: + return 0; + } + + if (index1 < index2) + return -1; + else if (index1 > index2) + return 1; + + return 0; // Cannot have multiple stacks of indexed items +} diff --git a/src/menu_helpers.c b/src/menu_helpers.c index e1483c9579..3b97d1f404 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -322,13 +322,12 @@ bool8 MenuHelpers_ShouldWaitForLinkRecv(void) void SetItemListPerPageCount(struct ItemSlot *slots, u8 slotsCount, u8 *pageItems, u8 *totalItems, u8 maxPerPage) { u16 i; - struct ItemSlot *slots_ = slots; // Count the number of non-empty item slots *totalItems = 0; for (i = 0; i < slotsCount; i++) { - if (slots_[i].itemId != ITEM_NONE) + if (slots[i].itemId != ITEM_NONE) (*totalItems)++; } (*totalItems)++; // + 1 for 'Cancel' diff --git a/test/bag.c b/test/bag.c index 6d0620dd6e..fe33d01eee 100644 --- a/test/bag.c +++ b/test/bag.c @@ -1,7 +1,7 @@ #include "global.h" #include "battle.h" #include "event_data.h" -#include "item.h" +#include "item_menu.h" #include "pokemon.h" #include "test/overworld_script.h" #include "test/test.h" @@ -19,6 +19,11 @@ TEST("TMs and HMs are sorted correctly in the bag") ASSUME(GetItemPocket(ITEM_TM01) == POCKET_TM_HM); ASSUME(GetItemPocket(ITEM_HM02) == POCKET_TM_HM); + /* + * Note: I would add a test to make sure that TMs are sorted correctly by move name, + * but downstream users are likely to rearrange TMs so this would just be a nuisance. + */ + RUN_OVERWORLD_SCRIPT( additem ITEM_HM07; additem ITEM_TM25; @@ -30,7 +35,7 @@ TEST("TMs and HMs are sorted correctly in the bag") additem ITEM_HM02; ); - SortPocket(POCKET_TM_HM, SORT_POCKET_TM_HM); + SortItemsInBag(&gBagPockets[POCKET_TM_HM], SORT_BY_INDEX); EXPECT_EQ(pocket->itemSlots[0].itemId, ITEM_TM01); EXPECT_EQ(pocket->itemSlots[1].itemId, ITEM_TM05); @@ -67,7 +72,7 @@ TEST("Berries are sorted correctly in the bag") additem ITEM_CHERI_BERRY; ); - SortPocket(POCKET_BERRIES, SORT_POCKET_BY_ITEM_ID); + SortItemsInBag(&gBagPockets[POCKET_BERRIES], SORT_BY_INDEX); EXPECT_EQ(pocket->itemSlots[0].itemId, ITEM_CHERI_BERRY); EXPECT_EQ(pocket->itemSlots[1].itemId, ITEM_ORAN_BERRY); @@ -78,9 +83,21 @@ TEST("Berries are sorted correctly in the bag") EXPECT_EQ(pocket->itemSlots[6].itemId, ITEM_GANLON_BERRY); EXPECT_EQ(pocket->itemSlots[7].itemId, ITEM_MICLE_BERRY); EXPECT_EQ(pocket->itemSlots[8].itemId, ITEM_NONE); + + SortItemsInBag(&gBagPockets[POCKET_BERRIES], SORT_ALPHABETICALLY); + + EXPECT_EQ(pocket->itemSlots[0].itemId, ITEM_CHARTI_BERRY); + EXPECT_EQ(pocket->itemSlots[1].itemId, ITEM_CHERI_BERRY); + EXPECT_EQ(pocket->itemSlots[2].itemId, ITEM_GANLON_BERRY); + EXPECT_EQ(pocket->itemSlots[3].itemId, ITEM_KELPSY_BERRY); + EXPECT_EQ(pocket->itemSlots[4].itemId, ITEM_MAGOST_BERRY); + EXPECT_EQ(pocket->itemSlots[5].itemId, ITEM_MICLE_BERRY); + EXPECT_EQ(pocket->itemSlots[6].itemId, ITEM_ORAN_BERRY); + EXPECT_EQ(pocket->itemSlots[7].itemId, ITEM_POMEG_BERRY); + EXPECT_EQ(pocket->itemSlots[8].itemId, ITEM_NONE); } -TEST("Items are correctly compacted in the bag") +TEST("Items are correctly sorted and compacted in the bag") { struct BagPocket *pocket = &gBagPockets[POCKET_ITEMS]; memset(pocket->itemSlots, 0, sizeof(gSaveBlock1Ptr->bag.items)); @@ -115,21 +132,31 @@ TEST("Items are correctly compacted in the bag") EXPECT_EQ(pocket->itemSlots[5].quantity, 1); EXPECT_EQ(pocket->itemSlots[6].itemId, ITEM_NONE); - // Try removing the small items, check that everything is compacted correctly + SortItemsInBag(&gBagPockets[POCKET_ITEMS], SORT_ALPHABETICALLY); + + EXPECT_EQ(pocket->itemSlots[0].itemId, ITEM_BIG_MUSHROOM); + EXPECT_EQ(pocket->itemSlots[1].itemId, ITEM_BIG_NUGGET); + EXPECT_EQ(pocket->itemSlots[2].itemId, ITEM_BIG_PEARL); + EXPECT_EQ(pocket->itemSlots[3].itemId, ITEM_NUGGET); + EXPECT_EQ(pocket->itemSlots[4].itemId, ITEM_PEARL); + EXPECT_EQ(pocket->itemSlots[5].itemId, ITEM_TINY_MUSHROOM); + EXPECT_EQ(pocket->itemSlots[6].itemId, ITEM_NONE); + + // Try removing the big items, check that everything is compacted correctly RUN_OVERWORLD_SCRIPT( - removeitem ITEM_NUGGET; - removeitem ITEM_TINY_MUSHROOM; - removeitem ITEM_PEARL; + removeitem ITEM_BIG_NUGGET; + removeitem ITEM_BIG_MUSHROOM; + removeitem ITEM_BIG_PEARL; ); CompactItemsInBagPocket(POCKET_ITEMS); - EXPECT_EQ(pocket->itemSlots[0].itemId, ITEM_BIG_NUGGET); + EXPECT_EQ(pocket->itemSlots[0].itemId, ITEM_NUGGET); EXPECT_EQ(pocket->itemSlots[0].quantity, 1); - EXPECT_EQ(pocket->itemSlots[1].itemId, ITEM_BIG_MUSHROOM); + EXPECT_EQ(pocket->itemSlots[1].itemId, ITEM_PEARL); EXPECT_EQ(pocket->itemSlots[1].quantity, 1); - EXPECT_EQ(pocket->itemSlots[2].itemId, ITEM_BIG_PEARL); + EXPECT_EQ(pocket->itemSlots[2].itemId, ITEM_TINY_MUSHROOM); EXPECT_EQ(pocket->itemSlots[2].quantity, 1); EXPECT_EQ(pocket->itemSlots[3].itemId, ITEM_NONE); EXPECT_EQ(pocket->itemSlots[4].itemId, ITEM_NONE);