diff --git a/include/data/mart_items.h b/include/data/mart_items.h new file mode 100644 index 0000000000..d84bb60a5f --- /dev/null +++ b/include/data/mart_items.h @@ -0,0 +1,236 @@ +#include "constants/items.h" + +typedef struct { + u16 itemID; + u16 unk_02; +} PokeMartCommonItem; + +const PokeMartCommonItem PokeMartCommonItems[] = { + { ITEM_POKE_BALL, 0x1 }, + { ITEM_GREAT_BALL, 0x3 }, + { ITEM_ULTRA_BALL, 0x4 }, + { ITEM_POTION, 0x1 }, + { ITEM_SUPER_POTION, 0x2 }, + { ITEM_HYPER_POTION, 0x4 }, + { ITEM_MAX_POTION, 0x5 }, + { ITEM_FULL_RESTORE, 0x6 }, + { ITEM_REVIVE, 0x3 }, + { ITEM_ANTIDOTE, 0x1 }, + { ITEM_PARLYZ_HEAL, 0x1 }, + { ITEM_AWAKENING, 0x2 }, + { ITEM_BURN_HEAL, 0x2 }, + { ITEM_ICE_HEAL, 0x2 }, + { ITEM_FULL_HEAL, 0x4 }, + { ITEM_ESCAPE_ROPE, 0x2 }, + { ITEM_REPEL, 0x2 }, + { ITEM_SUPER_REPEL, 0x3 }, + { ITEM_MAX_REPEL, 0x4 } +}; + +const u16 JubilifeMartSpecialties[] = { + ITEM_AIR_MAIL, + ITEM_HEAL_BALL, + 0xffff +}; + +const u16 OreburghMartSpecialties[] = { + ITEM_TUNNEL_MAIL, + ITEM_HEAL_BALL, + ITEM_NET_BALL, + 0xffff +}; + +const u16 FloaromaMartSpecialties[] = { + ITEM_BLOOM_MAIL, + ITEM_HEAL_BALL, + ITEM_NET_BALL, + 0xffff +}; + +const u16 EternaMartSpecialties[] = { + ITEM_AIR_MAIL, + ITEM_HEAL_BALL, + ITEM_NET_BALL, + ITEM_NEST_BALL, + 0xffff +}; + +const u16 EternaHerbShopStock[] = { + ITEM_HEAL_POWDER, + ITEM_ENERGYPOWDER, + ITEM_ENERGY_ROOT, + ITEM_REVIVAL_HERB, + 0xffff +}; + +const u16 HearthomeMartSpecialties[] = { + ITEM_HEART_MAIL, + ITEM_HEAL_BALL, + ITEM_NET_BALL, + ITEM_NEST_BALL, + 0xffff +}; + +const u16 SolaceonMartSpecialties[] = { + ITEM_AIR_MAIL, + ITEM_NET_BALL, + ITEM_NEST_BALL, + ITEM_DUSK_BALL, + 0xffff +}; + +const u16 PastoriaMartSpecialties[] = { + ITEM_AIR_MAIL, + ITEM_NEST_BALL, + ITEM_DUSK_BALL, + ITEM_QUICK_BALL, + 0xffff +}; + +const u16 VeilstoneDeptStoreStock_1F_RIGHT[] = { + ITEM_POTION, + ITEM_SUPER_POTION, + ITEM_HYPER_POTION, + ITEM_MAX_POTION, + ITEM_REVIVE, + ITEM_ANTIDOTE, + ITEM_PARLYZ_HEAL, + ITEM_BURN_HEAL, + ITEM_ICE_HEAL, + ITEM_AWAKENING, + ITEM_FULL_HEAL, + 0xffff +}; + +const u16 VeilstoneDeptStoreStock_1F_LEFT[] = { + ITEM_POKE_BALL, + ITEM_GREAT_BALL, + ITEM_ULTRA_BALL, + ITEM_ESCAPE_ROPE, + ITEM_POKE_DOLL, + ITEM_REPEL, + ITEM_SUPER_REPEL, + ITEM_MAX_REPEL, + ITEM_GRASS_MAIL, + ITEM_FLAME_MAIL, + ITEM_BUBBLE_MAIL, + ITEM_SPACE_MAIL, + 0xffff +}; + +const u16 VeilstoneDeptStoreStock_2F_UP[] = { + ITEM_X_SPEED, + ITEM_X_ATTACK, + ITEM_X_DEFENSE, + ITEM_GUARD_SPEC_, + ITEM_DIRE_HIT, + ITEM_X_ACCURACY, + ITEM_X_SPECIAL, + ITEM_X_SP__DEF, + 0xffff +}; + +const u16 VeilstoneDeptStoreStock_2F_MID[] = { + ITEM_PROTEIN, + ITEM_IRON, + ITEM_CALCIUM, + ITEM_ZINC, + ITEM_CARBOS, + ITEM_HP_UP, + 0xffff +}; + +const u16 VeilstoneDeptStoreStock_3F_UP[] = { + ITEM_TM83, + ITEM_TM17, + ITEM_TM54, + ITEM_TM20, + ITEM_TM33, + ITEM_TM16, + ITEM_TM70, + 0xffff +}; + +const u16 VeilstoneDeptStoreStock_3F_DOWN[] = { + ITEM_TM38, + ITEM_TM25, + ITEM_TM14, + ITEM_TM22, + ITEM_TM52, + ITEM_TM15, + 0xffff +}; + +const u16 CelesticMartSpecialties[] = { + ITEM_AIR_MAIL, + ITEM_DUSK_BALL, + ITEM_QUICK_BALL, + ITEM_TIMER_BALL, + 0xffff +}; + +const u16 SnowpointMartSpecialties[] = { + ITEM_SNOW_MAIL, + ITEM_DUSK_BALL, + ITEM_QUICK_BALL, + ITEM_TIMER_BALL, + 0xffff +}; + +const u16 CanalaveMartSpecialties[] = { + ITEM_AIR_MAIL, + ITEM_QUICK_BALL, + ITEM_TIMER_BALL, + ITEM_REPEAT_BALL, + 0xffff +}; + +const u16 SunyshoreMartSpecialties[] = { + ITEM_STEEL_MAIL, + ITEM_LUXURY_BALL, + 0xffff +}; + +const u16 PokemonLeagueMartSpecialties[] = { + ITEM_HEAL_BALL, + ITEM_NET_BALL, + ITEM_NEST_BALL, + ITEM_DUSK_BALL, + ITEM_QUICK_BALL, + ITEM_TIMER_BALL, + ITEM_REPEAT_BALL, + ITEM_LUXURY_BALL, + 0xffff +}; + +const u16 VeilstoneDeptStoreStock_B1F_DOWN_LEFT[] = { + ITEM_FIGY_BERRY, + ITEM_WIKI_BERRY, + ITEM_MAGO_BERRY, + ITEM_AGUAV_BERRY, + ITEM_IAPAPA_BERRY, + 0xffff +}; + +const u16 *PokeMartSpecialties[] = { + JubilifeMartSpecialties, + OreburghMartSpecialties, + FloaromaMartSpecialties, + EternaMartSpecialties, + EternaHerbShopStock, + HearthomeMartSpecialties, + SolaceonMartSpecialties, + PastoriaMartSpecialties, + VeilstoneDeptStoreStock_1F_RIGHT, + VeilstoneDeptStoreStock_1F_LEFT, + VeilstoneDeptStoreStock_2F_UP, + VeilstoneDeptStoreStock_2F_MID, + VeilstoneDeptStoreStock_3F_UP, + VeilstoneDeptStoreStock_3F_DOWN, + CelesticMartSpecialties, + SnowpointMartSpecialties, + CanalaveMartSpecialties, + SunyshoreMartSpecialties, + PokemonLeagueMartSpecialties, + VeilstoneDeptStoreStock_B1F_DOWN_LEFT +}; \ No newline at end of file diff --git a/src/unk_02046AD4.c b/src/unk_02046AD4.c index 7f435cf030..4ba04a68e7 100644 --- a/src/unk_02046AD4.c +++ b/src/unk_02046AD4.c @@ -13,240 +13,7 @@ #include "unk_02046AD4.h" #include "overlay007/ov7_0224CD28.h" -typedef struct { - u16 unk_00; - u16 unk_02; -} UnkStruct_020EBAFC; - -const UnkStruct_020EBAFC Unk_020EBAFC[] = { - { 0x4, 0x1 }, - { 0x3, 0x3 }, - { 0x2, 0x4 }, - { 0x11, 0x1 }, - { 0x1A, 0x2 }, - { 0x19, 0x4 }, - { 0x18, 0x5 }, - { 0x17, 0x6 }, - { 0x1C, 0x3 }, - { 0x12, 0x1 }, - { 0x16, 0x1 }, - { 0x15, 0x2 }, - { 0x13, 0x2 }, - { 0x14, 0x2 }, - { 0x1B, 0x4 }, - { 0x4E, 0x2 }, - { 0x4F, 0x2 }, - { 0x4C, 0x3 }, - { 0x4D, 0x4 } -}; - -const u16 Unk_020EB978[] = { - 0x92, - 0xE, - 0xffff -}; - -const u16 Unk_020EB98C[] = { - 0x8D, - 0xE, - 0x6, - 0xffff -}; - -const u16 Unk_020EB984[] = { - 0x8C, - 0xE, - 0x6, - 0xffff -}; - -const u16 Unk_020EB9D0[] = { - 0x92, - 0xE, - 0x6, - 0x8, - 0xffff -}; - -const u16 Unk_020EB994[] = { - 0x24, - 0x22, - 0x23, - 0x25, - 0xffff -}; - -const u16 Unk_020EB9DA[] = { - 0x8F, - 0xE, - 0x6, - 0x8, - 0xffff -}; - -const u16 Unk_020EB9C6[] = { - 0x92, - 0x6, - 0x8, - 0xD, - 0xffff -}; - -const u16 Unk_020EB9A8[] = { - 0x92, - 0x8, - 0xD, - 0xF, - 0xffff -}; - -const u16 Unk_020EBACA[] = { - 0x11, - 0x1A, - 0x19, - 0x18, - 0x1C, - 0x12, - 0x16, - 0x13, - 0x14, - 0x15, - 0x1B, - 0xffff -}; - -const u16 Unk_020EBAE2[] = { - 0x4, - 0x3, - 0x2, - 0x4E, - 0x3F, - 0x4F, - 0x4C, - 0x4D, - 0x89, - 0x8A, - 0x8B, - 0x91, - 0xffff -}; - -const u16 Unk_020EBAB8[] = { - 0x3B, - 0x39, - 0x3A, - 0x37, - 0x38, - 0x3C, - 0x3D, - 0x3E, - 0xffff -}; - -const u16 Unk_020EB9FC[] = { - 0x2E, - 0x2F, - 0x31, - 0x34, - 0x30, - 0x2D, - 0xffff -}; - -const u16 Unk_020EBA66[] = { - 0x19A, - 0x158, - 0x17D, - 0x15B, - 0x168, - 0x157, - 0x18D, - 0xffff -}; - -const u16 Unk_020EBA18[] = { - 0x16D, - 0x160, - 0x155, - 0x15D, - 0x17B, - 0x156, - 0xffff -}; - -const u16 Unk_020EB9B2[] = { - 0x92, - 0xD, - 0xF, - 0xA, - 0xffff -}; - -const u16 Unk_020EB9BC[] = { - 0x90, - 0xD, - 0xF, - 0xA, - 0xffff -}; - -const u16 Unk_020EB99E[] = { - 0x92, - 0xF, - 0xA, - 0x9, - 0xffff -}; - -const u16 Unk_020EB97E[] = { - 0x8E, - 0xB, - 0xffff -}; - -const u16 Unk_020EBAA6[] = { - 0xE, - 0x6, - 0x8, - 0xD, - 0xF, - 0xA, - 0x9, - 0xB, - 0xffff -}; - -const u16 Unk_020EB9E4[] = { - 0x9F, - 0xA0, - 0xA1, - 0xA2, - 0xA3, - 0xffff -}; - -const u16 *Unk_02100B1C[] = { - Unk_020EB978, - Unk_020EB98C, - Unk_020EB984, - Unk_020EB9D0, - Unk_020EB994, - Unk_020EB9DA, - Unk_020EB9C6, - Unk_020EB9A8, - Unk_020EBACA, - Unk_020EBAE2, - Unk_020EBAB8, - Unk_020EB9FC, - Unk_020EBA66, - Unk_020EBA18, - Unk_020EB9B2, - Unk_020EB9BC, - Unk_020EB99E, - Unk_020EB97E, - Unk_020EBAA6, - Unk_020EB9E4 -}; +#include "data/mart_items.h" const u16 Unk_020EB9F0[] = { 0x7, @@ -402,9 +169,9 @@ BOOL sub_02046AD4 (UnkStruct_0203E724 * param0) break; } - for (v4 = 0; v4 < (NELEMS(Unk_020EBAFC)); v4++) { - if (v1 >= Unk_020EBAFC[v4].unk_02) { - v0[v3] = Unk_020EBAFC[v4].unk_00; + for (v4 = 0; v4 < (NELEMS(PokeMartCommonItems)); v4++) { + if (v1 >= PokeMartCommonItems[v4].unk_02) { + v0[v3] = PokeMartCommonItems[v4].itemID; v3++; } } @@ -426,7 +193,7 @@ BOOL sub_02046B9C (UnkStruct_0203E724 * param0) v1 = 0; } - ov7_0224CDA4(param0->unk_28, param0->unk_34, (u16 *)Unk_02100B1C[v0], 0, v1); + ov7_0224CDA4(param0->unk_28, param0->unk_34, (u16 *)PokeMartSpecialties[v0], 0, v1); return 1; }