diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8bba93286..e8b45cc3d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7833,10 +7833,9 @@ BattleScript_MegaEvolutionAfeterString: waitmessage B_WAIT_TIME_LONG setbyte gIsCriticalHit, 0 handlemegaevo BS_ATTACKER, 0 - handlemegaevo BS_ATTACKER, 1 playanimation BS_ATTACKER, B_ANIM_MEGA_EVOLUTION waitanimation - handlemegaevo BS_ATTACKER, 2 + handlemegaevo BS_ATTACKER, 1 printstring STRINGID_MEGAEVOEVOLVED waitmessage B_WAIT_TIME_LONG switchinabilities BS_ATTACKER diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 360cef125..486772257 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8679,37 +8679,27 @@ static void HandleScriptMegaPrimal(u32 caseId, u32 battlerId, bool32 isMega) // Change species. if (caseId == 0) { - u16 newSpecies; if (isMega) { - //Checks regular Mega Evolution - newSpecies = GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM); - //Checks Wish Mega Evolution - if (newSpecies == SPECIES_NONE) - newSpecies = GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE); + if (!TryBattleFormChange(battlerId, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM)) + TryBattleFormChange(battlerId, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE); } else - newSpecies = GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_BATTLE_PRIMAL_REVERSION); + TryBattleFormChange(battlerId, FORM_CHANGE_BATTLE_PRIMAL_REVERSION); - gBattleMons[battlerId].species = newSpecies; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[battlerId].species); BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[battlerId]], sizeof(gBattleMons[battlerId].species), &gBattleMons[battlerId].species); MarkBattlerForControllerExec(battlerId); } - // Change stats. - else if (caseId == 1) - { - RecalcBattlerStats(battlerId, mon); - if (isMega) - gBattleStruct->mega.alreadyEvolved[position] = TRUE; - } // Update healthbox and elevation and play cry. else { UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId], mon, HEALTHBOX_ALL); if (side == B_SIDE_OPPONENT) SetBattlerShadowSpriteCallback(battlerId, gBattleMons[battlerId].species); + if (isMega) + gBattleStruct->mega.alreadyEvolved[position] = TRUE; } } diff --git a/src/battle_util.c b/src/battle_util.c index 9a8954fd5..aba70e377 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -10071,11 +10071,17 @@ bool32 CanMegaEvolve(u8 battlerId) bool32 IsBattlerMegaEvolved(u8 battlerId) { + // While Transform does copy stats and visuals, it shouldn't be counted as true Mega Evolution. + if (gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED) + return FALSE; return (gSpeciesInfo[gBattleMons[battlerId].species].flags & SPECIES_FLAG_MEGA_EVOLUTION); } bool32 IsBattlerPrimalReverted(u8 battlerId) { + // While Transform does copy stats and visuals, it shouldn't be counted as true Primal Revesion. + if (gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED) + return FALSE; return (gSpeciesInfo[gBattleMons[battlerId].species].flags & SPECIES_FLAG_PRIMAL_REVERSION); } @@ -10145,6 +10151,18 @@ u16 GetBattleFormChangeTargetSpecies(u8 battlerId, u16 method) return targetSpecies; } +bool32 CanBattlerFormChange(u8 battlerId, u16 method) +{ + // Can't change form if transformed. + if (gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED) + return FALSE; + // Mega Evolved Pokémon should always revert to normal upon fainting or ending the battle. + if (IsBattlerMegaEvolved(battlerId) + && (method == FORM_CHANGE_FAINT || method == FORM_CHANGE_END_BATTLE)) + return TRUE; + return DoesSpeciesHaveFormChangeMethod(gBattleMons[battlerId].species, method); +} + bool32 TryBattleFormChange(u8 battlerId, u16 method) { u8 monId = gBattlerPartyIndexes[battlerId]; @@ -10152,14 +10170,12 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method) struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; u16 targetSpecies; - // Can't change form if transformed. - if (gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED) - return FALSE; - - if (!DoesSpeciesHaveFormChangeMethod(gBattleMons[battlerId].species, method)) + if (!CanBattlerFormChange(battlerId, method)) return FALSE; targetSpecies = GetBattleFormChangeTargetSpecies(battlerId, method); + if (targetSpecies == SPECIES_NONE) + targetSpecies = GetFormChangeTargetSpecies(&party[monId], method, 0); if (targetSpecies != SPECIES_NONE) { // Saves the original species on the first form change for the player. @@ -10172,27 +10188,26 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method) RecalcBattlerStats(battlerId, &party[monId]); return TRUE; } - - targetSpecies = GetFormChangeTargetSpecies(&party[monId], method, 0); - if (targetSpecies != SPECIES_NONE) + else if (gBattleStruct->changedSpecies[monId] != SPECIES_NONE) { - // Saves the original species on the first form change for the player. - if (side == B_SIDE_PLAYER && gBattleStruct->changedSpecies[monId] == SPECIES_NONE) - gBattleStruct->changedSpecies[monId] = targetSpecies; + bool8 restoreSpecies = FALSE; - TryToSetBattleFormChangeMoves(&party[monId], method); - SetMonData(&party[monId], MON_DATA_SPECIES, &targetSpecies); - gBattleMons[battlerId].species = targetSpecies; - RecalcBattlerStats(battlerId, &party[monId]); - return TRUE; - } - else if ((method == FORM_CHANGE_END_BATTLE || method == FORM_CHANGE_FAINT) - && gBattleStruct->changedSpecies[monId] != SPECIES_NONE) - { - TryToSetBattleFormChangeMoves(&party[monId], method); - SetMonData(&party[monId], MON_DATA_SPECIES, &gBattleStruct->changedSpecies[monId]); - RecalcBattlerStats(battlerId, &party[monId]); - return TRUE; + // Mega Evolved Pokémon should always revert to normal upon fainting or ending the battle, so no need to add it to the form change tables. + if (IsBattlerMegaEvolved(battlerId) && (method == FORM_CHANGE_FAINT || method == FORM_CHANGE_END_BATTLE)) + restoreSpecies = TRUE; + + // Unlike Megas, Primal Reversion isn't canceled on fainting. + else if (IsBattlerPrimalReverted(battlerId) && (method == FORM_CHANGE_END_BATTLE)) + restoreSpecies = TRUE; + + if (restoreSpecies) + { + // Reverts the original species + TryToSetBattleFormChangeMoves(&party[monId], method); + SetMonData(&party[monId], MON_DATA_SPECIES, &gBattleStruct->changedSpecies[monId]); + RecalcBattlerStats(battlerId, &party[monId]); + return TRUE; + } } return FALSE; diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 5050b488b..9787d2a9b 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -1,287 +1,207 @@ static const struct FormChange sVenusaurFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_VENUSAUR_MEGA, ITEM_VENUSAURITE}, - {FORM_CHANGE_FAINT, SPECIES_VENUSAUR}, - {FORM_CHANGE_END_BATTLE, SPECIES_VENUSAUR}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sCharizardFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_X, ITEM_CHARIZARDITE_X}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_Y, ITEM_CHARIZARDITE_Y}, - {FORM_CHANGE_FAINT, SPECIES_CHARIZARD}, - {FORM_CHANGE_END_BATTLE, SPECIES_CHARIZARD}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sBlastoiseFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLASTOISE_MEGA, ITEM_BLASTOISINITE}, - {FORM_CHANGE_FAINT, SPECIES_BLASTOISE}, - {FORM_CHANGE_END_BATTLE, SPECIES_BLASTOISE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sBeedrillFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BEEDRILL_MEGA, ITEM_BEEDRILLITE}, - {FORM_CHANGE_FAINT, SPECIES_BEEDRILL}, - {FORM_CHANGE_END_BATTLE, SPECIES_BEEDRILL}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sPidgeotFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PIDGEOT_MEGA, ITEM_PIDGEOTITE}, - {FORM_CHANGE_FAINT, SPECIES_PIDGEOT}, - {FORM_CHANGE_END_BATTLE, SPECIES_PIDGEOT}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAlakazamFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALAKAZAM_MEGA, ITEM_ALAKAZITE}, - {FORM_CHANGE_FAINT, SPECIES_ALAKAZAM}, - {FORM_CHANGE_END_BATTLE, SPECIES_ALAKAZAM}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sSlowbroFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SLOWBRO_MEGA, ITEM_SLOWBRONITE}, - {FORM_CHANGE_FAINT, SPECIES_SLOWBRO}, - {FORM_CHANGE_END_BATTLE, SPECIES_SLOWBRO}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sGengarFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GENGAR_MEGA, ITEM_GENGARITE}, - {FORM_CHANGE_FAINT, SPECIES_GENGAR}, - {FORM_CHANGE_END_BATTLE, SPECIES_GENGAR}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sKangaskhanFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_KANGASKHAN_MEGA, ITEM_KANGASKHANITE}, - {FORM_CHANGE_FAINT, SPECIES_KANGASKHAN}, - {FORM_CHANGE_END_BATTLE, SPECIES_KANGASKHAN}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sPinsirFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PINSIR_MEGA, ITEM_PINSIRITE}, - {FORM_CHANGE_FAINT, SPECIES_PINSIR}, - {FORM_CHANGE_END_BATTLE, SPECIES_PINSIR}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sGyaradosFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GYARADOS_MEGA, ITEM_GYARADOSITE}, - {FORM_CHANGE_FAINT, SPECIES_GYARADOS}, - {FORM_CHANGE_END_BATTLE, SPECIES_GYARADOS}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAerodactylFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AERODACTYL_MEGA, ITEM_AERODACTYLITE}, - {FORM_CHANGE_FAINT, SPECIES_AERODACTYL}, - {FORM_CHANGE_END_BATTLE, SPECIES_AERODACTYL}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMewtwoFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_X, ITEM_MEWTWONITE_X}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_Y, ITEM_MEWTWONITE_Y}, - {FORM_CHANGE_FAINT, SPECIES_MEWTWO}, - {FORM_CHANGE_END_BATTLE, SPECIES_MEWTWO}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAmpharosFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AMPHAROS_MEGA, ITEM_AMPHAROSITE}, - {FORM_CHANGE_FAINT, SPECIES_AMPHAROS}, - {FORM_CHANGE_END_BATTLE, SPECIES_AMPHAROS}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sSteelixFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_STEELIX_MEGA, ITEM_STEELIXITE}, - {FORM_CHANGE_FAINT, SPECIES_STEELIX}, - {FORM_CHANGE_END_BATTLE, SPECIES_STEELIX}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sScizorFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCIZOR_MEGA, ITEM_SCIZORITE}, - {FORM_CHANGE_FAINT, SPECIES_SCIZOR}, - {FORM_CHANGE_END_BATTLE, SPECIES_SCIZOR}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sHeracrossFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HERACROSS_MEGA, ITEM_HERACRONITE}, - {FORM_CHANGE_FAINT, SPECIES_HERACROSS}, - {FORM_CHANGE_END_BATTLE, SPECIES_HERACROSS}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sHoundoomFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HOUNDOOM_MEGA, ITEM_HOUNDOOMINITE}, - {FORM_CHANGE_FAINT, SPECIES_HOUNDOOM}, - {FORM_CHANGE_END_BATTLE, SPECIES_HOUNDOOM}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sTyranitarFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_TYRANITAR_MEGA, ITEM_TYRANITARITE}, - {FORM_CHANGE_FAINT, SPECIES_TYRANITAR}, - {FORM_CHANGE_END_BATTLE, SPECIES_TYRANITAR}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sSceptileFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCEPTILE_MEGA, ITEM_SCEPTILITE}, - {FORM_CHANGE_FAINT, SPECIES_SCEPTILE}, - {FORM_CHANGE_END_BATTLE, SPECIES_SCEPTILE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sBlazikenFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLAZIKEN_MEGA, ITEM_BLAZIKENITE}, - {FORM_CHANGE_FAINT, SPECIES_BLAZIKEN}, - {FORM_CHANGE_END_BATTLE, SPECIES_BLAZIKEN}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sSwampertFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SWAMPERT_MEGA, ITEM_SWAMPERTITE}, - {FORM_CHANGE_FAINT, SPECIES_SWAMPERT}, - {FORM_CHANGE_END_BATTLE, SPECIES_SWAMPERT}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sSableyeFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SABLEYE_MEGA, ITEM_SABLENITE}, - {FORM_CHANGE_FAINT, SPECIES_SABLEYE}, - {FORM_CHANGE_END_BATTLE, SPECIES_SABLEYE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sSharpedoFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SHARPEDO_MEGA, ITEM_SHARPEDONITE}, - {FORM_CHANGE_FAINT, SPECIES_SHARPEDO}, - {FORM_CHANGE_END_BATTLE, SPECIES_SHARPEDO}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sManectricFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MANECTRIC_MEGA, ITEM_MANECTITE}, - {FORM_CHANGE_FAINT, SPECIES_MANECTRIC}, - {FORM_CHANGE_END_BATTLE, SPECIES_MANECTRIC}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sCameruptFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CAMERUPT_MEGA, ITEM_CAMERUPTITE}, - {FORM_CHANGE_FAINT, SPECIES_CAMERUPT}, - {FORM_CHANGE_END_BATTLE, SPECIES_CAMERUPT}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sGlalieFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GLALIE_MEGA, ITEM_GLALITITE}, - {FORM_CHANGE_FAINT, SPECIES_GLALIE}, - {FORM_CHANGE_END_BATTLE, SPECIES_GLALIE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMawileFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MAWILE_MEGA, ITEM_MAWILITE}, - {FORM_CHANGE_FAINT, SPECIES_MAWILE}, - {FORM_CHANGE_END_BATTLE, SPECIES_MAWILE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMedichamFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEDICHAM_MEGA, ITEM_MEDICHAMITE}, - {FORM_CHANGE_FAINT, SPECIES_MEDICHAM}, - {FORM_CHANGE_END_BATTLE, SPECIES_MEDICHAM}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAltariaFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALTARIA_MEGA, ITEM_ALTARIANITE}, - {FORM_CHANGE_FAINT, SPECIES_ALTARIA}, - {FORM_CHANGE_END_BATTLE, SPECIES_ALTARIA}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAbsolFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABSOL_MEGA, ITEM_ABSOLITE}, - {FORM_CHANGE_FAINT, SPECIES_ABSOL}, - {FORM_CHANGE_END_BATTLE, SPECIES_ABSOL}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sBanetteFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BANETTE_MEGA, ITEM_BANETTITE}, - {FORM_CHANGE_FAINT, SPECIES_BANETTE}, - {FORM_CHANGE_END_BATTLE, SPECIES_BANETTE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAggronFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AGGRON_MEGA, ITEM_AGGRONITE}, - {FORM_CHANGE_FAINT, SPECIES_AGGRON}, - {FORM_CHANGE_END_BATTLE, SPECIES_AGGRON}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sGardevoirFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARDEVOIR_MEGA, ITEM_GARDEVOIRITE}, - {FORM_CHANGE_FAINT, SPECIES_GARDEVOIR}, - {FORM_CHANGE_END_BATTLE, SPECIES_GARDEVOIR}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sSalamenceFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SALAMENCE_MEGA, ITEM_SALAMENCITE}, - {FORM_CHANGE_FAINT, SPECIES_SALAMENCE}, - {FORM_CHANGE_END_BATTLE, SPECIES_SALAMENCE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sMetagrossFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_METAGROSS_MEGA, ITEM_METAGROSSITE}, - {FORM_CHANGE_FAINT, SPECIES_METAGROSS}, - {FORM_CHANGE_END_BATTLE, SPECIES_METAGROSS}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sLatiasFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIAS_MEGA, ITEM_LATIASITE}, - {FORM_CHANGE_FAINT, SPECIES_LATIAS}, - {FORM_CHANGE_END_BATTLE, SPECIES_LATIAS}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sLatiosFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIOS_MEGA, ITEM_LATIOSITE}, - {FORM_CHANGE_FAINT, SPECIES_LATIOS}, - {FORM_CHANGE_END_BATTLE, SPECIES_LATIOS}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sKyogreFormChangeTable[] = { {FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_KYOGRE_PRIMAL, ITEM_BLUE_ORB}, - {FORM_CHANGE_END_BATTLE, SPECIES_KYOGRE}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sGroudonFormChangeTable[] = { {FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_GROUDON_PRIMAL, ITEM_RED_ORB}, - {FORM_CHANGE_END_BATTLE, SPECIES_GROUDON}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sRayquazaFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE, SPECIES_RAYQUAZA_MEGA, MOVE_DRAGON_ASCENT}, - {FORM_CHANGE_FAINT, SPECIES_RAYQUAZA}, - {FORM_CHANGE_END_BATTLE, SPECIES_RAYQUAZA}, {FORM_CHANGE_TERMINATOR}, }; @@ -300,36 +220,26 @@ static const struct FormChange sBurmyFormChangeTable[] = { static const struct FormChange sLopunnyFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LOPUNNY_MEGA, ITEM_LOPUNNITE}, - {FORM_CHANGE_FAINT, SPECIES_LOPUNNY}, - {FORM_CHANGE_END_BATTLE, SPECIES_LOPUNNY}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sGarchompFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARCHOMP_MEGA, ITEM_GARCHOMPITE}, - {FORM_CHANGE_FAINT, SPECIES_GARCHOMP}, - {FORM_CHANGE_END_BATTLE, SPECIES_GARCHOMP}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sLucarioFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LUCARIO_MEGA, ITEM_LUCARIONITE}, - {FORM_CHANGE_FAINT, SPECIES_LUCARIO}, - {FORM_CHANGE_END_BATTLE, SPECIES_LUCARIO}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sAbomasnowFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABOMASNOW_MEGA, ITEM_ABOMASITE}, - {FORM_CHANGE_FAINT, SPECIES_ABOMASNOW}, - {FORM_CHANGE_END_BATTLE, SPECIES_ABOMASNOW}, {FORM_CHANGE_TERMINATOR}, }; static const struct FormChange sGalladeFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GALLADE_MEGA, ITEM_GALLADITE}, - {FORM_CHANGE_FAINT, SPECIES_GALLADE}, - {FORM_CHANGE_END_BATTLE, SPECIES_GALLADE}, {FORM_CHANGE_TERMINATOR}, }; @@ -388,8 +298,6 @@ static const struct FormChange sArceusFormChangeTable[] = { #if P_GEN_5_POKEMON == TRUE static const struct FormChange sAudinoFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AUDINO_MEGA, ITEM_AUDINITE}, - {FORM_CHANGE_FAINT, SPECIES_AUDINO}, - {FORM_CHANGE_END_BATTLE, SPECIES_AUDINO}, {FORM_CHANGE_TERMINATOR}, }; @@ -478,8 +386,6 @@ static const struct FormChange sZygardePowerConstructFormChangeTable[] = { static const struct FormChange sDiancieFormChangeTable[] = { {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_DIANCIE_MEGA, ITEM_DIANCITE}, - {FORM_CHANGE_FAINT, SPECIES_DIANCIE}, - {FORM_CHANGE_END_BATTLE, SPECIES_DIANCIE}, {FORM_CHANGE_TERMINATOR}, }; diff --git a/src/pokemon.c b/src/pokemon.c index f01e72dcd..e11014120 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8659,7 +8659,6 @@ bool32 ShouldShowFemaleDifferences(u16 species, u32 personality) return (gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; } -// Returns species that it transformed into. If it didn't, returns SPECIES_NONE. bool32 TryFormChange(u32 monId, u32 side, u16 method) { struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty;