mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Fixed enemy parties not reverting to their original form post-battle (#3150)
This commit is contained in:
parent
b08c8f85fc
commit
cf29c9eb69
@ -636,7 +636,7 @@ struct BattleStruct
|
||||
bool8 friskedAbility; // If identifies two mons, show the ability pop-up only once.
|
||||
u8 sameMoveTurns[MAX_BATTLERS_COUNT]; // For Metronome, number of times the same moves has been SUCCESFULLY used.
|
||||
u16 moveEffect2; // For Knock Off
|
||||
u16 changedSpecies[PARTY_SIZE]; // For Zygarde or future forms when multiple mons can change into the same pokemon.
|
||||
u16 changedSpecies[NUM_BATTLE_SIDES][PARTY_SIZE]; // For forms when multiple mons can change into the same pokemon.
|
||||
u8 quickClawBattlerId;
|
||||
struct LostItem itemLost[PARTY_SIZE]; // Player's team that had items consumed or stolen (two bytes per party member)
|
||||
u8 blunderPolicy:1; // should blunder policy activate
|
||||
|
@ -5434,7 +5434,8 @@ static void HandleEndTurn_FinishBattle(void)
|
||||
changedForm = TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_END_BATTLE);
|
||||
|
||||
// Clear original species field
|
||||
gBattleStruct->changedSpecies[i] = SPECIES_NONE;
|
||||
gBattleStruct->changedSpecies[B_SIDE_PLAYER][i] = SPECIES_NONE;
|
||||
gBattleStruct->changedSpecies[B_SIDE_OPPONENT][i] = SPECIES_NONE;
|
||||
|
||||
#if B_RECALCULATE_STATS >= GEN_5
|
||||
// Recalculate the stats of every party member before the end
|
||||
|
@ -10669,7 +10669,7 @@ static void Cmd_various(void)
|
||||
{
|
||||
gBattleStruct->battleBondTransformed[GET_BATTLER_SIDE2(gBattlerAttacker)] |= gBitTable[gBattlerPartyIndexes[gBattlerAttacker]];
|
||||
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species);
|
||||
gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species;
|
||||
gBattleStruct->changedSpecies[GET_BATTLER_SIDE2(gBattlerAttacker)][gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species;
|
||||
gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker;
|
||||
|
@ -10227,8 +10227,8 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method)
|
||||
if (targetSpecies != 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] = gBattleMons[battlerId].species;
|
||||
if (gBattleStruct->changedSpecies[side][monId] == SPECIES_NONE)
|
||||
gBattleStruct->changedSpecies[side][monId] = gBattleMons[battlerId].species;
|
||||
|
||||
TryToSetBattleFormChangeMoves(&party[monId], method);
|
||||
SetMonData(&party[monId], MON_DATA_SPECIES, &targetSpecies);
|
||||
@ -10236,7 +10236,7 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method)
|
||||
RecalcBattlerStats(battlerId, &party[monId]);
|
||||
return TRUE;
|
||||
}
|
||||
else if (gBattleStruct->changedSpecies[monId] != SPECIES_NONE)
|
||||
else if (gBattleStruct->changedSpecies[side][monId] != SPECIES_NONE)
|
||||
{
|
||||
bool8 restoreSpecies = FALSE;
|
||||
|
||||
@ -10252,7 +10252,7 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method)
|
||||
{
|
||||
// Reverts the original species
|
||||
TryToSetBattleFormChangeMoves(&party[monId], method);
|
||||
SetMonData(&party[monId], MON_DATA_SPECIES, &gBattleStruct->changedSpecies[monId]);
|
||||
SetMonData(&party[monId], MON_DATA_SPECIES, &gBattleStruct->changedSpecies[side][monId]);
|
||||
RecalcBattlerStats(battlerId, &party[monId]);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -8507,7 +8507,7 @@ bool32 TryFormChange(u32 monId, u32 side, u16 method)
|
||||
targetSpecies = GetFormChangeTargetSpecies(&party[monId], method, 0);
|
||||
|
||||
if (targetSpecies == SPECIES_NONE && gBattleStruct != NULL)
|
||||
targetSpecies = gBattleStruct->changedSpecies[monId];
|
||||
targetSpecies = gBattleStruct->changedSpecies[side][monId];
|
||||
|
||||
if (targetSpecies != SPECIES_NONE)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user