From f15fb1540fe60d4f791cb537406cbd5f3ecdba0a Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 23 Mar 2023 23:16:08 +0100 Subject: [PATCH] Allow Kubfu evolution with Scroll items --- src/data/pokemon/evolution.h | 4 +- src/data/pokemon/item_effects.h | 210 ++++++++++++++++---------------- src/party_menu.c | 3 +- 3 files changed, 112 insertions(+), 105 deletions(-) diff --git a/src/data/pokemon/evolution.h b/src/data/pokemon/evolution.h index 4f09867a6..b76e83a73 100644 --- a/src/data/pokemon/evolution.h +++ b/src/data/pokemon/evolution.h @@ -542,7 +542,9 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] = [SPECIES_DREEPY] = {{EVO_LEVEL, 50, SPECIES_DRAKLOAK}}, [SPECIES_DRAKLOAK] = {{EVO_LEVEL, 60, SPECIES_DRAGAPULT}}, [SPECIES_KUBFU] = {{EVO_DARK_SCROLL, 0, SPECIES_URSHIFU}, - {EVO_WATER_SCROLL, 0, SPECIES_URSHIFU_RAPID_STRIKE_STYLE}}, + {EVO_ITEM, ITEM_SCROLL_OF_DARKNESS, SPECIES_URSHIFU}, + {EVO_WATER_SCROLL, 0, SPECIES_URSHIFU_RAPID_STRIKE_STYLE}, + {EVO_ITEM, ITEM_SCROLL_OF_WATERS, SPECIES_URSHIFU_RAPID_STRIKE_STYLE}}, #endif [SPECIES_RATTATA_ALOLAN] = {{EVO_LEVEL_NIGHT, 20, SPECIES_RATICATE_ALOLAN}}, [SPECIES_SANDSHREW_ALOLAN] = {{EVO_ITEM, ITEM_ICE_STONE, SPECIES_SANDSLASH_ALOLAN}}, diff --git a/src/data/pokemon/item_effects.h b/src/data/pokemon/item_effects.h index 8323801d5..607f57814 100644 --- a/src/data/pokemon/item_effects.h +++ b/src/data/pokemon/item_effects.h @@ -450,125 +450,129 @@ const u8 gItemEffect_TamatoBerry[10] = { const u8 *const gItemEffectTable[ITEMS_COUNT] = { // Medicine - [ITEM_POTION] = gItemEffect_Potion, - [ITEM_SUPER_POTION] = gItemEffect_SuperPotion, - [ITEM_HYPER_POTION] = gItemEffect_HyperPotion, - [ITEM_MAX_POTION] = gItemEffect_MaxPotion, - [ITEM_FULL_RESTORE] = gItemEffect_FullRestore, - [ITEM_REVIVE] = gItemEffect_Revive, - [ITEM_MAX_REVIVE] = gItemEffect_MaxRevive, - [ITEM_FRESH_WATER] = gItemEffect_FreshWater, - [ITEM_SODA_POP] = gItemEffect_SodaPop, - [ITEM_LEMONADE] = gItemEffect_Lemonade, - [ITEM_MOOMOO_MILK] = gItemEffect_MoomooMilk, - [ITEM_ENERGY_POWDER] = gItemEffect_EnergyPowder, - [ITEM_ENERGY_ROOT] = gItemEffect_EnergyRoot, - [ITEM_HEAL_POWDER] = gItemEffect_HealPowder, - [ITEM_REVIVAL_HERB] = gItemEffect_RevivalHerb, - [ITEM_ANTIDOTE] = gItemEffect_Antidote, - [ITEM_PARALYZE_HEAL] = gItemEffect_ParalyzeHeal, - [ITEM_BURN_HEAL] = gItemEffect_BurnHeal, - [ITEM_ICE_HEAL] = gItemEffect_IceHeal, - [ITEM_AWAKENING] = gItemEffect_Awakening, - [ITEM_FULL_HEAL] = gItemEffect_FullHeal, - [ITEM_ETHER] = gItemEffect_Ether, - [ITEM_MAX_ETHER] = gItemEffect_MaxEther, - [ITEM_ELIXIR] = gItemEffect_Elixir, - [ITEM_MAX_ELIXIR] = gItemEffect_MaxElixir, - [ITEM_BERRY_JUICE] = gItemEffect_BerryJuice, - [ITEM_SACRED_ASH] = gItemEffect_SacredAsh, - [ITEM_SWEET_HEART] = gItemEffect_Potion, - [ITEM_MAX_HONEY] = gItemEffect_MaxRevive, + [ITEM_POTION] = gItemEffect_Potion, + [ITEM_SUPER_POTION] = gItemEffect_SuperPotion, + [ITEM_HYPER_POTION] = gItemEffect_HyperPotion, + [ITEM_MAX_POTION] = gItemEffect_MaxPotion, + [ITEM_FULL_RESTORE] = gItemEffect_FullRestore, + [ITEM_REVIVE] = gItemEffect_Revive, + [ITEM_MAX_REVIVE] = gItemEffect_MaxRevive, + [ITEM_FRESH_WATER] = gItemEffect_FreshWater, + [ITEM_SODA_POP] = gItemEffect_SodaPop, + [ITEM_LEMONADE] = gItemEffect_Lemonade, + [ITEM_MOOMOO_MILK] = gItemEffect_MoomooMilk, + [ITEM_ENERGY_POWDER] = gItemEffect_EnergyPowder, + [ITEM_ENERGY_ROOT] = gItemEffect_EnergyRoot, + [ITEM_HEAL_POWDER] = gItemEffect_HealPowder, + [ITEM_REVIVAL_HERB] = gItemEffect_RevivalHerb, + [ITEM_ANTIDOTE] = gItemEffect_Antidote, + [ITEM_PARALYZE_HEAL] = gItemEffect_ParalyzeHeal, + [ITEM_BURN_HEAL] = gItemEffect_BurnHeal, + [ITEM_ICE_HEAL] = gItemEffect_IceHeal, + [ITEM_AWAKENING] = gItemEffect_Awakening, + [ITEM_FULL_HEAL] = gItemEffect_FullHeal, + [ITEM_ETHER] = gItemEffect_Ether, + [ITEM_MAX_ETHER] = gItemEffect_MaxEther, + [ITEM_ELIXIR] = gItemEffect_Elixir, + [ITEM_MAX_ELIXIR] = gItemEffect_MaxElixir, + [ITEM_BERRY_JUICE] = gItemEffect_BerryJuice, + [ITEM_SACRED_ASH] = gItemEffect_SacredAsh, + [ITEM_SWEET_HEART] = gItemEffect_Potion, + [ITEM_MAX_HONEY] = gItemEffect_MaxRevive, // Regional Specialties - [ITEM_PEWTER_CRUNCHIES] = gItemEffect_FullHeal, - [ITEM_RAGE_CANDY_BAR] = gItemEffect_FullHeal, - [ITEM_LAVA_COOKIE] = gItemEffect_FullHeal, - [ITEM_OLD_GATEAU] = gItemEffect_FullHeal, - [ITEM_CASTELIACONE] = gItemEffect_FullHeal, - [ITEM_LUMIOSE_GALETTE] = gItemEffect_FullHeal, - [ITEM_SHALOUR_SABLE] = gItemEffect_FullHeal, - [ITEM_BIG_MALASADA] = gItemEffect_FullHeal, + [ITEM_PEWTER_CRUNCHIES] = gItemEffect_FullHeal, + [ITEM_RAGE_CANDY_BAR] = gItemEffect_FullHeal, + [ITEM_LAVA_COOKIE] = gItemEffect_FullHeal, + [ITEM_OLD_GATEAU] = gItemEffect_FullHeal, + [ITEM_CASTELIACONE] = gItemEffect_FullHeal, + [ITEM_LUMIOSE_GALETTE] = gItemEffect_FullHeal, + [ITEM_SHALOUR_SABLE] = gItemEffect_FullHeal, + [ITEM_BIG_MALASADA] = gItemEffect_FullHeal, // Vitamins - [ITEM_HP_UP] = gItemEffect_HPUp, - [ITEM_PROTEIN] = gItemEffect_Protein, - [ITEM_IRON] = gItemEffect_Iron, - [ITEM_CALCIUM] = gItemEffect_Calcium, - [ITEM_ZINC] = gItemEffect_Zinc, - [ITEM_CARBOS] = gItemEffect_Carbos, - [ITEM_PP_UP] = gItemEffect_PPUp, - [ITEM_PP_MAX] = gItemEffect_PPMax, + [ITEM_HP_UP] = gItemEffect_HPUp, + [ITEM_PROTEIN] = gItemEffect_Protein, + [ITEM_IRON] = gItemEffect_Iron, + [ITEM_CALCIUM] = gItemEffect_Calcium, + [ITEM_ZINC] = gItemEffect_Zinc, + [ITEM_CARBOS] = gItemEffect_Carbos, + [ITEM_PP_UP] = gItemEffect_PPUp, + [ITEM_PP_MAX] = gItemEffect_PPMax, // EV Feathers - [ITEM_HEALTH_FEATHER] = gItemEffect_HpFeather, - [ITEM_MUSCLE_FEATHER] = gItemEffect_AtkFeather, - [ITEM_RESIST_FEATHER] = gItemEffect_DefFeather, - [ITEM_GENIUS_FEATHER] = gItemEffect_SpatkFeather, - [ITEM_CLEVER_FEATHER] = gItemEffect_SpdefFeather, - [ITEM_SWIFT_FEATHER] = gItemEffect_SpeedFeather, + [ITEM_HEALTH_FEATHER] = gItemEffect_HpFeather, + [ITEM_MUSCLE_FEATHER] = gItemEffect_AtkFeather, + [ITEM_RESIST_FEATHER] = gItemEffect_DefFeather, + [ITEM_GENIUS_FEATHER] = gItemEffect_SpatkFeather, + [ITEM_CLEVER_FEATHER] = gItemEffect_SpdefFeather, + [ITEM_SWIFT_FEATHER] = gItemEffect_SpeedFeather, // Candy - [ITEM_RARE_CANDY] = gItemEffect_RareCandy, - [ITEM_EXP_CANDY_XS] = gItemEffect_RareCandy, - [ITEM_EXP_CANDY_S] = gItemEffect_RareCandy, - [ITEM_EXP_CANDY_M] = gItemEffect_RareCandy, - [ITEM_EXP_CANDY_L] = gItemEffect_RareCandy, - [ITEM_EXP_CANDY_XL] = gItemEffect_RareCandy, - //[ITEM_DYNAMAX_CANDY] = gItemEffect_DynamaxCandy, // Todo + [ITEM_RARE_CANDY] = gItemEffect_RareCandy, + [ITEM_EXP_CANDY_XS] = gItemEffect_RareCandy, + [ITEM_EXP_CANDY_S] = gItemEffect_RareCandy, + [ITEM_EXP_CANDY_M] = gItemEffect_RareCandy, + [ITEM_EXP_CANDY_L] = gItemEffect_RareCandy, + [ITEM_EXP_CANDY_XL] = gItemEffect_RareCandy, + //[ITEM_DYNAMAX_CANDY] = gItemEffect_DynamaxCandy, // Todo // Medicinal Flutes - [ITEM_BLUE_FLUTE] = gItemEffect_BlueFlute, - [ITEM_YELLOW_FLUTE] = gItemEffect_YellowFlute, - [ITEM_RED_FLUTE] = gItemEffect_RedFlute, + [ITEM_BLUE_FLUTE] = gItemEffect_BlueFlute, + [ITEM_YELLOW_FLUTE] = gItemEffect_YellowFlute, + [ITEM_RED_FLUTE] = gItemEffect_RedFlute, // X Items - [ITEM_X_ATTACK] = gItemEffect_XAttack, - [ITEM_X_DEFENSE] = gItemEffect_XDefense, - [ITEM_X_SPEED] = gItemEffect_XSpeed, - [ITEM_X_ACCURACY] = gItemEffect_XAccuracy, - [ITEM_X_SP_ATK] = gItemEffect_XSpecialAttack, - [ITEM_X_SP_DEF] = gItemEffect_XSpecialDefense, + [ITEM_X_ATTACK] = gItemEffect_XAttack, + [ITEM_X_DEFENSE] = gItemEffect_XDefense, + [ITEM_X_SPEED] = gItemEffect_XSpeed, + [ITEM_X_ACCURACY] = gItemEffect_XAccuracy, + [ITEM_X_SP_ATK] = gItemEffect_XSpecialAttack, + [ITEM_X_SP_DEF] = gItemEffect_XSpecialDefense, - [ITEM_DIRE_HIT] = gItemEffect_DireHit, - [ITEM_GUARD_SPEC] = gItemEffect_GuardSpec, + [ITEM_DIRE_HIT] = gItemEffect_DireHit, + [ITEM_GUARD_SPEC] = gItemEffect_GuardSpec, - //[ITEM_MAX_MUSHROOMS] = gItemEffect_MaxMushrooms, // Todo + //[ITEM_MAX_MUSHROOMS] = gItemEffect_MaxMushrooms, // Todo // Evolution Items - [ITEM_FIRE_STONE] = gItemEffect_EvoItem, - [ITEM_WATER_STONE] = gItemEffect_EvoItem, - [ITEM_THUNDER_STONE] = gItemEffect_EvoItem, - [ITEM_LEAF_STONE] = gItemEffect_EvoItem, - [ITEM_ICE_STONE] = gItemEffect_EvoItem, - [ITEM_SUN_STONE] = gItemEffect_EvoItem, - [ITEM_MOON_STONE] = gItemEffect_EvoItem, - [ITEM_SHINY_STONE] = gItemEffect_EvoItem, - [ITEM_DUSK_STONE] = gItemEffect_EvoItem, - [ITEM_DAWN_STONE] = gItemEffect_EvoItem, - [ITEM_SWEET_APPLE] = gItemEffect_EvoItem, - [ITEM_TART_APPLE] = gItemEffect_EvoItem, - [ITEM_CRACKED_POT] = gItemEffect_EvoItem, - [ITEM_CHIPPED_POT] = gItemEffect_EvoItem, - [ITEM_GALARICA_CUFF] = gItemEffect_EvoItem, - [ITEM_GALARICA_WREATH] = gItemEffect_EvoItem, + [ITEM_FIRE_STONE] = gItemEffect_EvoItem, + [ITEM_WATER_STONE] = gItemEffect_EvoItem, + [ITEM_THUNDER_STONE] = gItemEffect_EvoItem, + [ITEM_LEAF_STONE] = gItemEffect_EvoItem, + [ITEM_ICE_STONE] = gItemEffect_EvoItem, + [ITEM_SUN_STONE] = gItemEffect_EvoItem, + [ITEM_MOON_STONE] = gItemEffect_EvoItem, + [ITEM_SHINY_STONE] = gItemEffect_EvoItem, + [ITEM_DUSK_STONE] = gItemEffect_EvoItem, + [ITEM_DAWN_STONE] = gItemEffect_EvoItem, + [ITEM_SWEET_APPLE] = gItemEffect_EvoItem, + [ITEM_TART_APPLE] = gItemEffect_EvoItem, + [ITEM_CRACKED_POT] = gItemEffect_EvoItem, + [ITEM_CHIPPED_POT] = gItemEffect_EvoItem, + [ITEM_GALARICA_CUFF] = gItemEffect_EvoItem, + [ITEM_GALARICA_WREATH] = gItemEffect_EvoItem, + [ITEM_AUSPICIOUS_ARMOR] = gItemEffect_EvoItem, + [ITEM_MALICIOUS_ARMOR] = gItemEffect_EvoItem, + [ITEM_SCROLL_OF_DARKNESS] = gItemEffect_EvoItem, + [ITEM_SCROLL_OF_WATERS] = gItemEffect_EvoItem, // Berries - [ITEM_CHERI_BERRY] = gItemEffect_CheriBerry, - [ITEM_CHESTO_BERRY] = gItemEffect_ChestoBerry, - [ITEM_PECHA_BERRY] = gItemEffect_PechaBerry, - [ITEM_RAWST_BERRY] = gItemEffect_RawstBerry, - [ITEM_ASPEAR_BERRY] = gItemEffect_AspearBerry, - [ITEM_LEPPA_BERRY] = gItemEffect_LeppaBerry, - [ITEM_ORAN_BERRY] = gItemEffect_OranBerry, - [ITEM_PERSIM_BERRY] = gItemEffect_PersimBerry, - [ITEM_LUM_BERRY] = gItemEffect_FullHeal, - [ITEM_SITRUS_BERRY] = gItemEffect_SitrusBerry, - [ITEM_POMEG_BERRY] = gItemEffect_PomegBerry, - [ITEM_KELPSY_BERRY] = gItemEffect_KelpsyBerry, - [ITEM_QUALOT_BERRY] = gItemEffect_QualotBerry, - [ITEM_HONDEW_BERRY] = gItemEffect_HondewBerry, - [ITEM_GREPA_BERRY] = gItemEffect_GrepaBerry, - [ITEM_TAMATO_BERRY] = gItemEffect_TamatoBerry, - [LAST_BERRY_INDEX] = NULL, + [ITEM_CHERI_BERRY] = gItemEffect_CheriBerry, + [ITEM_CHESTO_BERRY] = gItemEffect_ChestoBerry, + [ITEM_PECHA_BERRY] = gItemEffect_PechaBerry, + [ITEM_RAWST_BERRY] = gItemEffect_RawstBerry, + [ITEM_ASPEAR_BERRY] = gItemEffect_AspearBerry, + [ITEM_LEPPA_BERRY] = gItemEffect_LeppaBerry, + [ITEM_ORAN_BERRY] = gItemEffect_OranBerry, + [ITEM_PERSIM_BERRY] = gItemEffect_PersimBerry, + [ITEM_LUM_BERRY] = gItemEffect_FullHeal, + [ITEM_SITRUS_BERRY] = gItemEffect_SitrusBerry, + [ITEM_POMEG_BERRY] = gItemEffect_PomegBerry, + [ITEM_KELPSY_BERRY] = gItemEffect_KelpsyBerry, + [ITEM_QUALOT_BERRY] = gItemEffect_QualotBerry, + [ITEM_HONDEW_BERRY] = gItemEffect_HondewBerry, + [ITEM_GREPA_BERRY] = gItemEffect_GrepaBerry, + [ITEM_TAMATO_BERRY] = gItemEffect_TamatoBerry, + [LAST_BERRY_INDEX] = NULL, }; diff --git a/src/party_menu.c b/src/party_menu.c index 6964fa0c5..9185657a7 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5516,7 +5516,8 @@ void ItemUseCB_EvolutionStone(u8 taskId, TaskFunc task) } else { - RemoveBagItem(gSpecialVar_ItemId, 1); + if (ItemId_GetPocket(gSpecialVar_ItemId) != POCKET_KEY_ITEMS) + RemoveBagItem(gSpecialVar_ItemId, 1); FreePartyPointers(); } }