Fix Disguise reverting on switch out
Make Mimikyu's disguise stay busted when it's switched out.
This commit is contained in:
parent
4d1c63e3d3
commit
63faa6e3a9
2 changed files with 33 additions and 1 deletions
|
@ -124,6 +124,7 @@ u16 GetWishMegaEvolutionSpecies(u16 preEvoSpecies, u16 moveId1, u16 moveId2, u16
|
|||
bool32 CanMegaEvolve(u8 battlerId);
|
||||
void UndoMegaEvolution(u32 monId);
|
||||
void UndoFormChange(u32 monId, u32 side);
|
||||
void UndoFormChangeOnSwitch(u32 monId, u32 side);
|
||||
bool32 DoBattlersShareType(u32 battler1, u32 battler2);
|
||||
bool32 CanBattlerGetOrLoseItem(u8 battlerId, u16 itemId);
|
||||
struct Pokemon *GetIllusionMonPtr(u32 battlerId);
|
||||
|
|
|
@ -492,7 +492,7 @@ void HandleAction_Switch(void)
|
|||
if (gBattleResults.playerSwitchesCounter < 255)
|
||||
gBattleResults.playerSwitchesCounter++;
|
||||
|
||||
UndoFormChange(gBattlerPartyIndexes[gBattlerAttacker], GetBattlerSide(gBattlerAttacker));
|
||||
UndoFormChangeOnSwitch(gBattlerPartyIndexes[gBattlerAttacker], GetBattlerSide(gBattlerAttacker));
|
||||
}
|
||||
|
||||
void HandleAction_UseItem(void)
|
||||
|
@ -8353,6 +8353,37 @@ void UndoFormChange(u32 monId, u32 side)
|
|||
}
|
||||
}
|
||||
|
||||
// Same as UndoFormChange but doesn't revert Mimikyu
|
||||
void UndoFormChangeOnSwitch(u32 monId, u32 side)
|
||||
{
|
||||
u32 i, currSpecies;
|
||||
struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty;
|
||||
static const u16 species[][2] = // changed form id, default form id
|
||||
{
|
||||
{SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH},
|
||||
{SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN},
|
||||
{SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED},
|
||||
{SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE},
|
||||
{SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN},
|
||||
{SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO},
|
||||
{SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE},
|
||||
{SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET},
|
||||
{SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW},
|
||||
{SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI},
|
||||
};
|
||||
|
||||
currSpecies = GetMonData(&party[monId], MON_DATA_SPECIES, NULL);
|
||||
for (i = 0; i < ARRAY_COUNT(species); i++)
|
||||
{
|
||||
if (currSpecies == species[i][0])
|
||||
{
|
||||
SetMonData(&party[monId], MON_DATA_SPECIES, &species[i][1]);
|
||||
CalculateMonStats(&party[monId]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool32 DoBattlersShareType(u32 battler1, u32 battler2)
|
||||
{
|
||||
s32 i;
|
||||
|
|
Loading…
Reference in a new issue