mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 09:24:19 +01:00
Move-based mega evolution message for NPCs/recorded battles
This commit is contained in:
parent
f1d97bfad7
commit
cba4b78df6
@ -489,7 +489,6 @@ struct MegaEvolutionData
|
|||||||
u8 battlerId;
|
u8 battlerId;
|
||||||
bool8 playerSelect;
|
bool8 playerSelect;
|
||||||
u8 triggerSpriteId;
|
u8 triggerSpriteId;
|
||||||
bool8 isWishMegaEvo;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Illusion
|
struct Illusion
|
||||||
|
@ -4883,9 +4883,14 @@ static void CheckMegaEvolutionBeforeTurn(void)
|
|||||||
if (gBattleStruct->mega.toEvolve & gBitTable[gActiveBattler]
|
if (gBattleStruct->mega.toEvolve & gBitTable[gActiveBattler]
|
||||||
&& !(gProtectStructs[gActiveBattler].noValidMoves))
|
&& !(gProtectStructs[gActiveBattler].noValidMoves))
|
||||||
{
|
{
|
||||||
|
struct Pokemon *mon;
|
||||||
|
if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT)
|
||||||
|
mon = &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]];
|
||||||
|
else
|
||||||
|
mon = &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]];
|
||||||
gBattleStruct->mega.toEvolve &= ~(gBitTable[gActiveBattler]);
|
gBattleStruct->mega.toEvolve &= ~(gBitTable[gActiveBattler]);
|
||||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||||
if (gBattleStruct->mega.isWishMegaEvo == TRUE)
|
if (GetWishMegaEvolutionSpecies(GetMonData(mon, MON_DATA_SPECIES), GetMonData(mon, MON_DATA_MOVE1), GetMonData(mon, MON_DATA_MOVE2), GetMonData(mon, MON_DATA_MOVE3), GetMonData(mon, MON_DATA_MOVE4)))
|
||||||
BattleScriptExecute(BattleScript_WishMegaEvolution);
|
BattleScriptExecute(BattleScript_WishMegaEvolution);
|
||||||
else
|
else
|
||||||
BattleScriptExecute(BattleScript_MegaEvolution);
|
BattleScriptExecute(BattleScript_MegaEvolution);
|
||||||
|
@ -10109,18 +10109,12 @@ bool32 CanMegaEvolve(u8 battlerId)
|
|||||||
|
|
||||||
// Can Mega Evolve via Mega Stone.
|
// Can Mega Evolve via Mega Stone.
|
||||||
if (holdEffect == HOLD_EFFECT_MEGA_STONE)
|
if (holdEffect == HOLD_EFFECT_MEGA_STONE)
|
||||||
{
|
|
||||||
gBattleStruct->mega.isWishMegaEvo = FALSE;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there is an entry in the evolution table for Wish Mega Evolution.
|
// Check if there is an entry in the evolution table for Wish Mega Evolution.
|
||||||
if (GetWishMegaEvolutionSpecies(species, GetMonData(mon, MON_DATA_MOVE1), GetMonData(mon, MON_DATA_MOVE2), GetMonData(mon, MON_DATA_MOVE3), GetMonData(mon, MON_DATA_MOVE4)))
|
if (GetWishMegaEvolutionSpecies(species, GetMonData(mon, MON_DATA_MOVE1), GetMonData(mon, MON_DATA_MOVE2), GetMonData(mon, MON_DATA_MOVE3), GetMonData(mon, MON_DATA_MOVE4)))
|
||||||
{
|
|
||||||
gBattleStruct->mega.isWishMegaEvo = TRUE;
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
|
|
||||||
// No checks passed, the mon CAN'T mega evolve.
|
// No checks passed, the mon CAN'T mega evolve.
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user