Renamed form change defines to be consistant with which function calls which

This commit is contained in:
Eduardo Quezada 2022-11-05 22:02:25 -03:00
parent 8f289714b2
commit 99536089cf
6 changed files with 284 additions and 284 deletions

View File

@ -9,7 +9,7 @@
#define DAY 1 #define DAY 1
#define NIGHT 2 #define NIGHT 2
#define FORM_CHANGE_END 0 // Form table terminator #define FORM_CHANGE_TERMINATOR 0
// Form change that activates when the specified item is given to or taken from the selected Pokémon. // Form change that activates when the specified item is given to or taken from the selected Pokémon.
// param1: item to hold. // param1: item to hold.
@ -45,13 +45,13 @@
// param1: item to hold, optional // param1: item to hold, optional
// param2: a move that will be replaced, optional // param2: a move that will be replaced, optional
// param3: a new move to replace it with, optional // param3: a new move to replace it with, optional
#define FORM_CHANGE_BATTLE_BEGIN 6 #define FORM_CHANGE_BEGIN_BATTLE 6
// Form change that activates at the end of a battle. If species is not specified and it's on the player's side, it will try to use the value saved in gBattleStruct->changedSpecies from a previous form change. // Form change that activates at the end of a battle. If species is not specified and it's on the player's side, it will try to use the value saved in gBattleStruct->changedSpecies from a previous form change.
// param1: item to hold, optional // param1: item to hold, optional
// param2: a move that will be replaced, optional // param2: a move that will be replaced, optional
// param3: a new move to replace it with, optional // param3: a new move to replace it with, optional
#define FORM_CHANGE_BATTLE_END 7 #define FORM_CHANGE_END_BATTLE 7
// Form change that activates when the Pokémon is switched out in battle. // Form change that activates when the Pokémon is switched out in battle.
// - No parameters. // - No parameters.
@ -68,14 +68,14 @@
// Form change that activates when the mon has the defined item. // Form change that activates when the mon has the defined item.
// If it's on the player's side, it also requires ITEM_MEGA_RING in the user's bag and for the player to trigger it by pressing START before selecting a move. // If it's on the player's side, it also requires ITEM_MEGA_RING in the user's bag and for the player to trigger it by pressing START before selecting a move.
// param1: item to hold. // param1: item to hold.
#define FORM_CHANGE_MEGA_EVOLUTION_ITEM 10 #define FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM 10
// Form change that activates when the mon has the defined move. // Form change that activates when the mon has the defined move.
// If it's on the player's side, it also requires ITEM_MEGA_RING in the user's bag and for the player to trigger it by pressing START before selecting a move. // If it's on the player's side, it also requires ITEM_MEGA_RING in the user's bag and for the player to trigger it by pressing START before selecting a move.
// param1: move to have. // param1: move to have.
#define FORM_CHANGE_MEGA_EVOLUTION_MOVE 11 #define FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE 11
// Form change that activates automatically when entering battle with the specified item. // Form change that activates automatically when entering battle with the specified item.
// If the item is a Red Orb, it uses the Omega Symbol for the animation and icon. Otherwise, it defaults to the Alpha symbol. // If the item is a Red Orb, it uses the Omega Symbol for the animation and icon. Otherwise, it defaults to the Alpha symbol.
// param1: item to hold. // param1: item to hold.
#define FORM_CHANGE_PRIMAL_REVERSION 12 #define FORM_CHANGE_BATTLE_PRIMAL_REVERSION 12

View File

@ -602,9 +602,9 @@ static void CB2_InitBattleInternal(void)
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
// Player's side // Player's side
TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_BATTLE_BEGIN); TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_BEGIN_BATTLE);
// Opponent's side // Opponent's side
TryFormChange(i, B_SIDE_OPPONENT, FORM_CHANGE_BATTLE_BEGIN); TryFormChange(i, B_SIDE_OPPONENT, FORM_CHANGE_BEGIN_BATTLE);
} }
gBattleCommunication[MULTIUSE_STATE] = 0; gBattleCommunication[MULTIUSE_STATE] = 0;
@ -3682,7 +3682,7 @@ static void TryDoEventsBeforeFirstTurn(void)
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
{ {
if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB
&& GetBattleFormChangeTargetSpecies(i, FORM_CHANGE_PRIMAL_REVERSION) != SPECIES_NONE) && GetBattleFormChangeTargetSpecies(i, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE)
{ {
gBattlerAttacker = i; gBattlerAttacker = i;
BattleScriptExecute(BattleScript_PrimalReversion); BattleScriptExecute(BattleScript_PrimalReversion);
@ -5202,7 +5202,7 @@ static void HandleEndTurn_FinishBattle(void)
#endif #endif
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
bool32 changedForm = TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_BATTLE_END); bool32 changedForm = TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_END_BATTLE);
DoBurmyFormChange(i); DoBurmyFormChange(i);
// Clear original species field // Clear original species field
gBattleStruct->changedSpecies[i] = SPECIES_NONE; gBattleStruct->changedSpecies[i] = SPECIES_NONE;

View File

@ -8965,10 +8965,10 @@ static void Cmd_various(void)
if (gBattlescriptCurrInstr[3] == 0) if (gBattlescriptCurrInstr[3] == 0)
{ {
//Checks regular Mega Evolution //Checks regular Mega Evolution
u16 megaSpecies = GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_MEGA_EVOLUTION_ITEM); u16 megaSpecies = GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM);
//Checks Wish Mega Evolution //Checks Wish Mega Evolution
if (megaSpecies == SPECIES_NONE) if (megaSpecies == SPECIES_NONE)
megaSpecies = GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_MEGA_EVOLUTION_MOVE); megaSpecies = GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE);
gBattleMons[gActiveBattler].species = megaSpecies; gBattleMons[gActiveBattler].species = megaSpecies;
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species);
@ -9001,7 +9001,7 @@ static void Cmd_various(void)
// Change species. // Change species.
if (gBattlescriptCurrInstr[3] == 0) if (gBattlescriptCurrInstr[3] == 0)
{ {
gBattleMons[gActiveBattler].species = GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_PRIMAL_REVERSION); gBattleMons[gActiveBattler].species = GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_BATTLE_PRIMAL_REVERSION);
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species);
BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]], sizeof(gBattleMons[gActiveBattler].species), &gBattleMons[gActiveBattler].species); BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]], sizeof(gBattleMons[gActiveBattler].species), &gBattleMons[gActiveBattler].species);
@ -9720,7 +9720,7 @@ static void Cmd_various(void)
return; return;
case VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL: case VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL:
{ {
if (GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_PRIMAL_REVERSION) == SPECIES_NONE) if (GetBattleFormChangeTargetSpecies(gActiveBattler, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) == SPECIES_NONE)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
else else
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
@ -14241,7 +14241,7 @@ static void Cmd_handleballthrow(void)
{ {
BtlController_EmitBallThrowAnim(BUFFER_A, BALL_3_SHAKES_SUCCESS); BtlController_EmitBallThrowAnim(BUFFER_A, BALL_3_SHAKES_SUCCESS);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_BATTLE_END); TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE);
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow; gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem); SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
@ -14295,7 +14295,7 @@ static void Cmd_handleballthrow(void)
if (IsCriticalCapture()) if (IsCriticalCapture())
gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = TRUE; gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = TRUE;
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_BATTLE_END); TryBattleFormChange(gBattlerTarget, FORM_CHANGE_END_BATTLE);
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow; gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem); SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem);

View File

@ -9654,12 +9654,12 @@ bool32 DoesSpeciesUseHoldItemToChangeForm(u16 species, u16 heldItemId)
if (formChanges != NULL) if (formChanges != NULL)
{ {
for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++)
{ {
switch (formChanges[i].method) switch (formChanges[i].method)
{ {
case FORM_CHANGE_MEGA_EVOLUTION_ITEM: case FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM:
case FORM_CHANGE_PRIMAL_REVERSION: case FORM_CHANGE_BATTLE_PRIMAL_REVERSION:
case FORM_CHANGE_ITEM_HOLD: case FORM_CHANGE_ITEM_HOLD:
if (formChanges[i].param1 == heldItemId) if (formChanges[i].param1 == heldItemId)
return TRUE; return TRUE;
@ -9710,7 +9710,7 @@ bool32 CanMegaEvolve(u8 battlerId)
itemId = GetMonData(mon, MON_DATA_HELD_ITEM); itemId = GetMonData(mon, MON_DATA_HELD_ITEM);
// Check if there is an entry in the evolution table for regular Mega Evolution. // Check if there is an entry in the evolution table for regular Mega Evolution.
if (GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_MEGA_EVOLUTION_ITEM) != SPECIES_NONE) if (GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM) != SPECIES_NONE)
{ {
#if B_ENABLE_DEBUG == TRUE #if B_ENABLE_DEBUG == TRUE
if (B_ENABLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId]) if (B_ENABLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId])
@ -9731,7 +9731,7 @@ bool32 CanMegaEvolve(u8 battlerId)
} }
// 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 (GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_MEGA_EVOLUTION_MOVE) != SPECIES_NONE) if (GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE) != SPECIES_NONE)
{ {
gBattleStruct->mega.isWishMegaEvo = TRUE; gBattleStruct->mega.isWishMegaEvo = TRUE;
return TRUE; return TRUE;
@ -9766,18 +9766,18 @@ u16 GetBattleFormChangeTargetSpecies(u8 battlerId, u16 method)
heldItem = gBattleMons[battlerId].item; heldItem = gBattleMons[battlerId].item;
ability = GetBattlerAbility(battlerId); ability = GetBattlerAbility(battlerId);
for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++)
{ {
if (method == formChanges[i].method && species != formChanges[i].targetSpecies) if (method == formChanges[i].method && species != formChanges[i].targetSpecies)
{ {
switch (method) switch (method)
{ {
case FORM_CHANGE_MEGA_EVOLUTION_ITEM: case FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM:
case FORM_CHANGE_PRIMAL_REVERSION: case FORM_CHANGE_BATTLE_PRIMAL_REVERSION:
if (heldItem == formChanges[i].param1) if (heldItem == formChanges[i].param1)
targetSpecies = formChanges[i].targetSpecies; targetSpecies = formChanges[i].targetSpecies;
break; break;
case FORM_CHANGE_MEGA_EVOLUTION_MOVE: case FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE:
if (gBattleMons[battlerId].moves[0] == formChanges[i].param1 if (gBattleMons[battlerId].moves[0] == formChanges[i].param1
|| gBattleMons[battlerId].moves[1] == formChanges[i].param1 || gBattleMons[battlerId].moves[1] == formChanges[i].param1
|| gBattleMons[battlerId].moves[2] == formChanges[i].param1 || gBattleMons[battlerId].moves[2] == formChanges[i].param1
@ -9856,7 +9856,7 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method)
RecalcBattlerStats(battlerId, &party[monId]); RecalcBattlerStats(battlerId, &party[monId]);
return TRUE; return TRUE;
} }
else if ((method == FORM_CHANGE_BATTLE_END || method == FORM_CHANGE_FAINT) else if ((method == FORM_CHANGE_END_BATTLE || method == FORM_CHANGE_FAINT)
&& gBattleStruct->changedSpecies[monId] != SPECIES_NONE) && gBattleStruct->changedSpecies[monId] != SPECIES_NONE)
{ {
TryToSetBattleFormChangeMoves(&party[monId], method); TryToSetBattleFormChangeMoves(&party[monId], method);

View File

@ -1,336 +1,336 @@
static const struct FormChange sVenusaurFormChangeTable[] = { static const struct FormChange sVenusaurFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_VENUSAUR_MEGA, ITEM_VENUSAURITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_VENUSAUR_MEGA, ITEM_VENUSAURITE},
{FORM_CHANGE_FAINT, SPECIES_VENUSAUR}, {FORM_CHANGE_FAINT, SPECIES_VENUSAUR},
{FORM_CHANGE_BATTLE_END, SPECIES_VENUSAUR}, {FORM_CHANGE_END_BATTLE, SPECIES_VENUSAUR},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sCharizardFormChangeTable[] = { static const struct FormChange sCharizardFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_X, ITEM_CHARIZARDITE_X}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_X, ITEM_CHARIZARDITE_X},
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_Y, ITEM_CHARIZARDITE_Y}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CHARIZARD_MEGA_Y, ITEM_CHARIZARDITE_Y},
{FORM_CHANGE_FAINT, SPECIES_CHARIZARD}, {FORM_CHANGE_FAINT, SPECIES_CHARIZARD},
{FORM_CHANGE_BATTLE_END, SPECIES_CHARIZARD}, {FORM_CHANGE_END_BATTLE, SPECIES_CHARIZARD},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sBlastoiseFormChangeTable[] = { static const struct FormChange sBlastoiseFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_BLASTOISE_MEGA, ITEM_BLASTOISINITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLASTOISE_MEGA, ITEM_BLASTOISINITE},
{FORM_CHANGE_FAINT, SPECIES_BLASTOISE}, {FORM_CHANGE_FAINT, SPECIES_BLASTOISE},
{FORM_CHANGE_BATTLE_END, SPECIES_BLASTOISE}, {FORM_CHANGE_END_BATTLE, SPECIES_BLASTOISE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sBeedrillFormChangeTable[] = { static const struct FormChange sBeedrillFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_BEEDRILL_MEGA, ITEM_BEEDRILLITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BEEDRILL_MEGA, ITEM_BEEDRILLITE},
{FORM_CHANGE_FAINT, SPECIES_BEEDRILL}, {FORM_CHANGE_FAINT, SPECIES_BEEDRILL},
{FORM_CHANGE_BATTLE_END, SPECIES_BEEDRILL}, {FORM_CHANGE_END_BATTLE, SPECIES_BEEDRILL},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sPidgeotFormChangeTable[] = { static const struct FormChange sPidgeotFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_PIDGEOT_MEGA, ITEM_PIDGEOTITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PIDGEOT_MEGA, ITEM_PIDGEOTITE},
{FORM_CHANGE_FAINT, SPECIES_PIDGEOT}, {FORM_CHANGE_FAINT, SPECIES_PIDGEOT},
{FORM_CHANGE_BATTLE_END, SPECIES_PIDGEOT}, {FORM_CHANGE_END_BATTLE, SPECIES_PIDGEOT},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAlakazamFormChangeTable[] = { static const struct FormChange sAlakazamFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_ALAKAZAM_MEGA, ITEM_ALAKAZITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALAKAZAM_MEGA, ITEM_ALAKAZITE},
{FORM_CHANGE_FAINT, SPECIES_ALAKAZAM}, {FORM_CHANGE_FAINT, SPECIES_ALAKAZAM},
{FORM_CHANGE_BATTLE_END, SPECIES_ALAKAZAM}, {FORM_CHANGE_END_BATTLE, SPECIES_ALAKAZAM},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSlowbroFormChangeTable[] = { static const struct FormChange sSlowbroFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_SLOWBRO_MEGA, ITEM_SLOWBRONITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SLOWBRO_MEGA, ITEM_SLOWBRONITE},
{FORM_CHANGE_FAINT, SPECIES_SLOWBRO}, {FORM_CHANGE_FAINT, SPECIES_SLOWBRO},
{FORM_CHANGE_BATTLE_END, SPECIES_SLOWBRO}, {FORM_CHANGE_END_BATTLE, SPECIES_SLOWBRO},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGengarFormChangeTable[] = { static const struct FormChange sGengarFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_GENGAR_MEGA, ITEM_GENGARITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GENGAR_MEGA, ITEM_GENGARITE},
{FORM_CHANGE_FAINT, SPECIES_GENGAR}, {FORM_CHANGE_FAINT, SPECIES_GENGAR},
{FORM_CHANGE_BATTLE_END, SPECIES_GENGAR}, {FORM_CHANGE_END_BATTLE, SPECIES_GENGAR},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sKangaskhanFormChangeTable[] = { static const struct FormChange sKangaskhanFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_KANGASKHAN_MEGA, ITEM_KANGASKHANITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_KANGASKHAN_MEGA, ITEM_KANGASKHANITE},
{FORM_CHANGE_FAINT, SPECIES_KANGASKHAN}, {FORM_CHANGE_FAINT, SPECIES_KANGASKHAN},
{FORM_CHANGE_BATTLE_END, SPECIES_KANGASKHAN}, {FORM_CHANGE_END_BATTLE, SPECIES_KANGASKHAN},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sPinsirFormChangeTable[] = { static const struct FormChange sPinsirFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_PINSIR_MEGA, ITEM_PINSIRITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_PINSIR_MEGA, ITEM_PINSIRITE},
{FORM_CHANGE_FAINT, SPECIES_PINSIR}, {FORM_CHANGE_FAINT, SPECIES_PINSIR},
{FORM_CHANGE_BATTLE_END, SPECIES_PINSIR}, {FORM_CHANGE_END_BATTLE, SPECIES_PINSIR},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGyaradosFormChangeTable[] = { static const struct FormChange sGyaradosFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_GYARADOS_MEGA, ITEM_GYARADOSITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GYARADOS_MEGA, ITEM_GYARADOSITE},
{FORM_CHANGE_FAINT, SPECIES_GYARADOS}, {FORM_CHANGE_FAINT, SPECIES_GYARADOS},
{FORM_CHANGE_BATTLE_END, SPECIES_GYARADOS}, {FORM_CHANGE_END_BATTLE, SPECIES_GYARADOS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAerodactylFormChangeTable[] = { static const struct FormChange sAerodactylFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_AERODACTYL_MEGA, ITEM_AERODACTYLITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AERODACTYL_MEGA, ITEM_AERODACTYLITE},
{FORM_CHANGE_FAINT, SPECIES_AERODACTYL}, {FORM_CHANGE_FAINT, SPECIES_AERODACTYL},
{FORM_CHANGE_BATTLE_END, SPECIES_AERODACTYL}, {FORM_CHANGE_END_BATTLE, SPECIES_AERODACTYL},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMewtwoFormChangeTable[] = { static const struct FormChange sMewtwoFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_X, ITEM_MEWTWONITE_X}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_X, ITEM_MEWTWONITE_X},
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_Y, ITEM_MEWTWONITE_Y}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEWTWO_MEGA_Y, ITEM_MEWTWONITE_Y},
{FORM_CHANGE_FAINT, SPECIES_MEWTWO}, {FORM_CHANGE_FAINT, SPECIES_MEWTWO},
{FORM_CHANGE_BATTLE_END, SPECIES_MEWTWO}, {FORM_CHANGE_END_BATTLE, SPECIES_MEWTWO},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAmpharosFormChangeTable[] = { static const struct FormChange sAmpharosFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_AMPHAROS_MEGA, ITEM_AMPHAROSITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AMPHAROS_MEGA, ITEM_AMPHAROSITE},
{FORM_CHANGE_FAINT, SPECIES_AMPHAROS}, {FORM_CHANGE_FAINT, SPECIES_AMPHAROS},
{FORM_CHANGE_BATTLE_END, SPECIES_AMPHAROS}, {FORM_CHANGE_END_BATTLE, SPECIES_AMPHAROS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSteelixFormChangeTable[] = { static const struct FormChange sSteelixFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_STEELIX_MEGA, ITEM_STEELIXITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_STEELIX_MEGA, ITEM_STEELIXITE},
{FORM_CHANGE_FAINT, SPECIES_STEELIX}, {FORM_CHANGE_FAINT, SPECIES_STEELIX},
{FORM_CHANGE_BATTLE_END, SPECIES_STEELIX}, {FORM_CHANGE_END_BATTLE, SPECIES_STEELIX},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sScizorFormChangeTable[] = { static const struct FormChange sScizorFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_SCIZOR_MEGA, ITEM_SCIZORITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCIZOR_MEGA, ITEM_SCIZORITE},
{FORM_CHANGE_FAINT, SPECIES_SCIZOR}, {FORM_CHANGE_FAINT, SPECIES_SCIZOR},
{FORM_CHANGE_BATTLE_END, SPECIES_SCIZOR}, {FORM_CHANGE_END_BATTLE, SPECIES_SCIZOR},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sHeracrossFormChangeTable[] = { static const struct FormChange sHeracrossFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_HERACROSS_MEGA, ITEM_HERACRONITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HERACROSS_MEGA, ITEM_HERACRONITE},
{FORM_CHANGE_FAINT, SPECIES_HERACROSS}, {FORM_CHANGE_FAINT, SPECIES_HERACROSS},
{FORM_CHANGE_BATTLE_END, SPECIES_HERACROSS}, {FORM_CHANGE_END_BATTLE, SPECIES_HERACROSS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sHoundoomFormChangeTable[] = { static const struct FormChange sHoundoomFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_HOUNDOOM_MEGA, ITEM_HOUNDOOMINITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_HOUNDOOM_MEGA, ITEM_HOUNDOOMINITE},
{FORM_CHANGE_FAINT, SPECIES_HOUNDOOM}, {FORM_CHANGE_FAINT, SPECIES_HOUNDOOM},
{FORM_CHANGE_BATTLE_END, SPECIES_HOUNDOOM}, {FORM_CHANGE_END_BATTLE, SPECIES_HOUNDOOM},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sTyranitarFormChangeTable[] = { static const struct FormChange sTyranitarFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_TYRANITAR_MEGA, ITEM_TYRANITARITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_TYRANITAR_MEGA, ITEM_TYRANITARITE},
{FORM_CHANGE_FAINT, SPECIES_TYRANITAR}, {FORM_CHANGE_FAINT, SPECIES_TYRANITAR},
{FORM_CHANGE_BATTLE_END, SPECIES_TYRANITAR}, {FORM_CHANGE_END_BATTLE, SPECIES_TYRANITAR},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSceptileFormChangeTable[] = { static const struct FormChange sSceptileFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_SCEPTILE_MEGA, ITEM_SCEPTILITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SCEPTILE_MEGA, ITEM_SCEPTILITE},
{FORM_CHANGE_FAINT, SPECIES_SCEPTILE}, {FORM_CHANGE_FAINT, SPECIES_SCEPTILE},
{FORM_CHANGE_BATTLE_END, SPECIES_SCEPTILE}, {FORM_CHANGE_END_BATTLE, SPECIES_SCEPTILE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sBlazikenFormChangeTable[] = { static const struct FormChange sBlazikenFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_BLAZIKEN_MEGA, ITEM_BLAZIKENITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BLAZIKEN_MEGA, ITEM_BLAZIKENITE},
{FORM_CHANGE_FAINT, SPECIES_BLAZIKEN}, {FORM_CHANGE_FAINT, SPECIES_BLAZIKEN},
{FORM_CHANGE_BATTLE_END, SPECIES_BLAZIKEN}, {FORM_CHANGE_END_BATTLE, SPECIES_BLAZIKEN},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSwampertFormChangeTable[] = { static const struct FormChange sSwampertFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_SWAMPERT_MEGA, ITEM_SWAMPERTITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SWAMPERT_MEGA, ITEM_SWAMPERTITE},
{FORM_CHANGE_FAINT, SPECIES_SWAMPERT}, {FORM_CHANGE_FAINT, SPECIES_SWAMPERT},
{FORM_CHANGE_BATTLE_END, SPECIES_SWAMPERT}, {FORM_CHANGE_END_BATTLE, SPECIES_SWAMPERT},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSableyeFormChangeTable[] = { static const struct FormChange sSableyeFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_SABLEYE_MEGA, ITEM_SABLENITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SABLEYE_MEGA, ITEM_SABLENITE},
{FORM_CHANGE_FAINT, SPECIES_SABLEYE}, {FORM_CHANGE_FAINT, SPECIES_SABLEYE},
{FORM_CHANGE_BATTLE_END, SPECIES_SABLEYE}, {FORM_CHANGE_END_BATTLE, SPECIES_SABLEYE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSharpedoFormChangeTable[] = { static const struct FormChange sSharpedoFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_SHARPEDO_MEGA, ITEM_SHARPEDONITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SHARPEDO_MEGA, ITEM_SHARPEDONITE},
{FORM_CHANGE_FAINT, SPECIES_SHARPEDO}, {FORM_CHANGE_FAINT, SPECIES_SHARPEDO},
{FORM_CHANGE_BATTLE_END, SPECIES_SHARPEDO}, {FORM_CHANGE_END_BATTLE, SPECIES_SHARPEDO},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sManectricFormChangeTable[] = { static const struct FormChange sManectricFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_MANECTRIC_MEGA, ITEM_MANECTITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MANECTRIC_MEGA, ITEM_MANECTITE},
{FORM_CHANGE_FAINT, SPECIES_MANECTRIC}, {FORM_CHANGE_FAINT, SPECIES_MANECTRIC},
{FORM_CHANGE_BATTLE_END, SPECIES_MANECTRIC}, {FORM_CHANGE_END_BATTLE, SPECIES_MANECTRIC},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sCameruptFormChangeTable[] = { static const struct FormChange sCameruptFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_CAMERUPT_MEGA, ITEM_CAMERUPTITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_CAMERUPT_MEGA, ITEM_CAMERUPTITE},
{FORM_CHANGE_FAINT, SPECIES_CAMERUPT}, {FORM_CHANGE_FAINT, SPECIES_CAMERUPT},
{FORM_CHANGE_BATTLE_END, SPECIES_CAMERUPT}, {FORM_CHANGE_END_BATTLE, SPECIES_CAMERUPT},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGlalieFormChangeTable[] = { static const struct FormChange sGlalieFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_GLALIE_MEGA, ITEM_GLALITITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GLALIE_MEGA, ITEM_GLALITITE},
{FORM_CHANGE_FAINT, SPECIES_GLALIE}, {FORM_CHANGE_FAINT, SPECIES_GLALIE},
{FORM_CHANGE_BATTLE_END, SPECIES_GLALIE}, {FORM_CHANGE_END_BATTLE, SPECIES_GLALIE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMawileFormChangeTable[] = { static const struct FormChange sMawileFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_MAWILE_MEGA, ITEM_MAWILITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MAWILE_MEGA, ITEM_MAWILITE},
{FORM_CHANGE_FAINT, SPECIES_MAWILE}, {FORM_CHANGE_FAINT, SPECIES_MAWILE},
{FORM_CHANGE_BATTLE_END, SPECIES_MAWILE}, {FORM_CHANGE_END_BATTLE, SPECIES_MAWILE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMedichamFormChangeTable[] = { static const struct FormChange sMedichamFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_MEDICHAM_MEGA, ITEM_MEDICHAMITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_MEDICHAM_MEGA, ITEM_MEDICHAMITE},
{FORM_CHANGE_FAINT, SPECIES_MEDICHAM}, {FORM_CHANGE_FAINT, SPECIES_MEDICHAM},
{FORM_CHANGE_BATTLE_END, SPECIES_MEDICHAM}, {FORM_CHANGE_END_BATTLE, SPECIES_MEDICHAM},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAltariaFormChangeTable[] = { static const struct FormChange sAltariaFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_ALTARIA_MEGA, ITEM_ALTARIANITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ALTARIA_MEGA, ITEM_ALTARIANITE},
{FORM_CHANGE_FAINT, SPECIES_ALTARIA}, {FORM_CHANGE_FAINT, SPECIES_ALTARIA},
{FORM_CHANGE_BATTLE_END, SPECIES_ALTARIA}, {FORM_CHANGE_END_BATTLE, SPECIES_ALTARIA},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAbsolFormChangeTable[] = { static const struct FormChange sAbsolFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_ABSOL_MEGA, ITEM_ABSOLITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABSOL_MEGA, ITEM_ABSOLITE},
{FORM_CHANGE_FAINT, SPECIES_ABSOL}, {FORM_CHANGE_FAINT, SPECIES_ABSOL},
{FORM_CHANGE_BATTLE_END, SPECIES_ABSOL}, {FORM_CHANGE_END_BATTLE, SPECIES_ABSOL},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sBanetteFormChangeTable[] = { static const struct FormChange sBanetteFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_BANETTE_MEGA, ITEM_BANETTITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_BANETTE_MEGA, ITEM_BANETTITE},
{FORM_CHANGE_FAINT, SPECIES_BANETTE}, {FORM_CHANGE_FAINT, SPECIES_BANETTE},
{FORM_CHANGE_BATTLE_END, SPECIES_BANETTE}, {FORM_CHANGE_END_BATTLE, SPECIES_BANETTE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAggronFormChangeTable[] = { static const struct FormChange sAggronFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_AGGRON_MEGA, ITEM_AGGRONITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AGGRON_MEGA, ITEM_AGGRONITE},
{FORM_CHANGE_FAINT, SPECIES_AGGRON}, {FORM_CHANGE_FAINT, SPECIES_AGGRON},
{FORM_CHANGE_BATTLE_END, SPECIES_AGGRON}, {FORM_CHANGE_END_BATTLE, SPECIES_AGGRON},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGardevoirFormChangeTable[] = { static const struct FormChange sGardevoirFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_GARDEVOIR_MEGA, ITEM_GARDEVOIRITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARDEVOIR_MEGA, ITEM_GARDEVOIRITE},
{FORM_CHANGE_FAINT, SPECIES_GARDEVOIR}, {FORM_CHANGE_FAINT, SPECIES_GARDEVOIR},
{FORM_CHANGE_BATTLE_END, SPECIES_GARDEVOIR}, {FORM_CHANGE_END_BATTLE, SPECIES_GARDEVOIR},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSalamenceFormChangeTable[] = { static const struct FormChange sSalamenceFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_SALAMENCE_MEGA, ITEM_SALAMENCITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_SALAMENCE_MEGA, ITEM_SALAMENCITE},
{FORM_CHANGE_FAINT, SPECIES_SALAMENCE}, {FORM_CHANGE_FAINT, SPECIES_SALAMENCE},
{FORM_CHANGE_BATTLE_END, SPECIES_SALAMENCE}, {FORM_CHANGE_END_BATTLE, SPECIES_SALAMENCE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMetagrossFormChangeTable[] = { static const struct FormChange sMetagrossFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_METAGROSS_MEGA, ITEM_METAGROSSITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_METAGROSS_MEGA, ITEM_METAGROSSITE},
{FORM_CHANGE_FAINT, SPECIES_METAGROSS}, {FORM_CHANGE_FAINT, SPECIES_METAGROSS},
{FORM_CHANGE_BATTLE_END, SPECIES_METAGROSS}, {FORM_CHANGE_END_BATTLE, SPECIES_METAGROSS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sLatiasFormChangeTable[] = { static const struct FormChange sLatiasFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_LATIAS_MEGA, ITEM_LATIASITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIAS_MEGA, ITEM_LATIASITE},
{FORM_CHANGE_FAINT, SPECIES_LATIAS}, {FORM_CHANGE_FAINT, SPECIES_LATIAS},
{FORM_CHANGE_BATTLE_END, SPECIES_LATIAS}, {FORM_CHANGE_END_BATTLE, SPECIES_LATIAS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sLatiosFormChangeTable[] = { static const struct FormChange sLatiosFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_LATIOS_MEGA, ITEM_LATIOSITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LATIOS_MEGA, ITEM_LATIOSITE},
{FORM_CHANGE_FAINT, SPECIES_LATIOS}, {FORM_CHANGE_FAINT, SPECIES_LATIOS},
{FORM_CHANGE_BATTLE_END, SPECIES_LATIOS}, {FORM_CHANGE_END_BATTLE, SPECIES_LATIOS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sKyogreFormChangeTable[] = { static const struct FormChange sKyogreFormChangeTable[] = {
{FORM_CHANGE_PRIMAL_REVERSION, SPECIES_KYOGRE_PRIMAL, ITEM_BLUE_ORB}, {FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_KYOGRE_PRIMAL, ITEM_BLUE_ORB},
{FORM_CHANGE_BATTLE_END, SPECIES_KYOGRE}, {FORM_CHANGE_END_BATTLE, SPECIES_KYOGRE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGroudonFormChangeTable[] = { static const struct FormChange sGroudonFormChangeTable[] = {
{FORM_CHANGE_PRIMAL_REVERSION, SPECIES_GROUDON_PRIMAL, ITEM_RED_ORB}, {FORM_CHANGE_BATTLE_PRIMAL_REVERSION, SPECIES_GROUDON_PRIMAL, ITEM_RED_ORB},
{FORM_CHANGE_BATTLE_END, SPECIES_GROUDON}, {FORM_CHANGE_END_BATTLE, SPECIES_GROUDON},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sRayquazaFormChangeTable[] = { static const struct FormChange sRayquazaFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_MOVE, SPECIES_RAYQUAZA_MEGA, MOVE_DRAGON_ASCENT}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE, SPECIES_RAYQUAZA_MEGA, MOVE_DRAGON_ASCENT},
{FORM_CHANGE_FAINT, SPECIES_RAYQUAZA}, {FORM_CHANGE_FAINT, SPECIES_RAYQUAZA},
{FORM_CHANGE_BATTLE_END, SPECIES_RAYQUAZA}, {FORM_CHANGE_END_BATTLE, SPECIES_RAYQUAZA},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
#if P_GEN_4_POKEMON == TRUE #if P_GEN_4_POKEMON == TRUE
static const struct FormChange sLopunnyFormChangeTable[] = { static const struct FormChange sLopunnyFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_LOPUNNY_MEGA, ITEM_LOPUNNITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LOPUNNY_MEGA, ITEM_LOPUNNITE},
{FORM_CHANGE_FAINT, SPECIES_LOPUNNY}, {FORM_CHANGE_FAINT, SPECIES_LOPUNNY},
{FORM_CHANGE_BATTLE_END, SPECIES_LOPUNNY}, {FORM_CHANGE_END_BATTLE, SPECIES_LOPUNNY},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGarchompFormChangeTable[] = { static const struct FormChange sGarchompFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_GARCHOMP_MEGA, ITEM_GARCHOMPITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GARCHOMP_MEGA, ITEM_GARCHOMPITE},
{FORM_CHANGE_FAINT, SPECIES_GARCHOMP}, {FORM_CHANGE_FAINT, SPECIES_GARCHOMP},
{FORM_CHANGE_BATTLE_END, SPECIES_GARCHOMP}, {FORM_CHANGE_END_BATTLE, SPECIES_GARCHOMP},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sLucarioFormChangeTable[] = { static const struct FormChange sLucarioFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_LUCARIO_MEGA, ITEM_LUCARIONITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_LUCARIO_MEGA, ITEM_LUCARIONITE},
{FORM_CHANGE_FAINT, SPECIES_LUCARIO}, {FORM_CHANGE_FAINT, SPECIES_LUCARIO},
{FORM_CHANGE_BATTLE_END, SPECIES_LUCARIO}, {FORM_CHANGE_END_BATTLE, SPECIES_LUCARIO},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAbomasnowFormChangeTable[] = { static const struct FormChange sAbomasnowFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_ABOMASNOW_MEGA, ITEM_ABOMASITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_ABOMASNOW_MEGA, ITEM_ABOMASITE},
{FORM_CHANGE_FAINT, SPECIES_ABOMASNOW}, {FORM_CHANGE_FAINT, SPECIES_ABOMASNOW},
{FORM_CHANGE_BATTLE_END, SPECIES_ABOMASNOW}, {FORM_CHANGE_END_BATTLE, SPECIES_ABOMASNOW},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGalladeFormChangeTable[] = { static const struct FormChange sGalladeFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_GALLADE_MEGA, ITEM_GALLADITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_GALLADE_MEGA, ITEM_GALLADITE},
{FORM_CHANGE_FAINT, SPECIES_GALLADE}, {FORM_CHANGE_FAINT, SPECIES_GALLADE},
{FORM_CHANGE_BATTLE_END, SPECIES_GALLADE}, {FORM_CHANGE_END_BATTLE, SPECIES_GALLADE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGiratinaFormChangeTable[] = { static const struct FormChange sGiratinaFormChangeTable[] = {
{FORM_CHANGE_ITEM_HOLD, SPECIES_GIRATINA, ITEM_NONE}, {FORM_CHANGE_ITEM_HOLD, SPECIES_GIRATINA, ITEM_NONE},
{FORM_CHANGE_ITEM_HOLD, SPECIES_GIRATINA_ORIGIN, ITEM_GRISEOUS_ORB}, {FORM_CHANGE_ITEM_HOLD, SPECIES_GIRATINA_ORIGIN, ITEM_GRISEOUS_ORB},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sShayminFormChangeTable[] = { static const struct FormChange sShayminFormChangeTable[] = {
{FORM_CHANGE_ITEM_USE, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY}, {FORM_CHANGE_ITEM_USE, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY},
// {FORM_CHANGE_WITHDRAW, SPECIES_SHAYMIN}, // {FORM_CHANGE_WITHDRAW, SPECIES_SHAYMIN},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sArceusFormChangeTable[] = { static const struct FormChange sArceusFormChangeTable[] = {
@ -369,62 +369,62 @@ static const struct FormChange sArceusFormChangeTable[] = {
{FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_DARK, ITEM_DARKINIUM_Z, ABILITY_MULTITYPE}, {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_DARK, ITEM_DARKINIUM_Z, ABILITY_MULTITYPE},
{FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_PIXIE_PLATE, ABILITY_MULTITYPE}, {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_PIXIE_PLATE, ABILITY_MULTITYPE},
{FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_FAIRIUM_Z, ABILITY_MULTITYPE}, {FORM_CHANGE_ITEM_HOLD, SPECIES_ARCEUS_FAIRY, ITEM_FAIRIUM_Z, ABILITY_MULTITYPE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
#endif #endif
#if P_GEN_5_POKEMON == TRUE #if P_GEN_5_POKEMON == TRUE
static const struct FormChange sAudinoFormChangeTable[] = { static const struct FormChange sAudinoFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_AUDINO_MEGA, ITEM_AUDINITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_AUDINO_MEGA, ITEM_AUDINITE},
{FORM_CHANGE_FAINT, SPECIES_AUDINO}, {FORM_CHANGE_FAINT, SPECIES_AUDINO},
{FORM_CHANGE_BATTLE_END, SPECIES_AUDINO}, {FORM_CHANGE_END_BATTLE, SPECIES_AUDINO},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sDarmanitanFormChangeTable[] = { static const struct FormChange sDarmanitanFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN, ABILITY_ZEN_MODE, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN, ABILITY_ZEN_MODE, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_ZEN_MODE, ABILITY_ZEN_MODE, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_ZEN_MODE, ABILITY_ZEN_MODE, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_FAINT, SPECIES_DARMANITAN}, {FORM_CHANGE_FAINT, SPECIES_DARMANITAN},
{FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN}, {FORM_CHANGE_END_BATTLE, SPECIES_DARMANITAN},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sDarmanitanGalarianFormChangeTable[] = { static const struct FormChange sDarmanitanGalarianFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_GALARIAN, ABILITY_ZEN_MODE, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_GALARIAN, ABILITY_ZEN_MODE, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_ZEN_MODE_GALARIAN, ABILITY_ZEN_MODE, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_DARMANITAN_ZEN_MODE_GALARIAN, ABILITY_ZEN_MODE, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_FAINT, SPECIES_DARMANITAN_GALARIAN}, {FORM_CHANGE_FAINT, SPECIES_DARMANITAN_GALARIAN},
{FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN_GALARIAN}, {FORM_CHANGE_END_BATTLE, SPECIES_DARMANITAN_GALARIAN},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMeloettaFormChangeTable[] = { static const struct FormChange sMeloettaFormChangeTable[] = {
{FORM_CHANGE_FAINT, SPECIES_MELOETTA}, {FORM_CHANGE_FAINT, SPECIES_MELOETTA},
{FORM_CHANGE_BATTLE_END, SPECIES_MELOETTA}, {FORM_CHANGE_END_BATTLE, SPECIES_MELOETTA},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sTornadusFormChangeTable[] = { static const struct FormChange sTornadusFormChangeTable[] = {
{FORM_CHANGE_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_ITEM_USE, SPECIES_TORNADUS, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_TORNADUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sThundurusFormChangeTable[] = { static const struct FormChange sThundurusFormChangeTable[] = {
{FORM_CHANGE_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_ITEM_USE, SPECIES_THUNDURUS, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_THUNDURUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sLandorusFormChangeTable[] = { static const struct FormChange sLandorusFormChangeTable[] = {
{FORM_CHANGE_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_ITEM_USE, SPECIES_LANDORUS, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_LANDORUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sKeldeoFormChangeTable[] = { static const struct FormChange sKeldeoFormChangeTable[] = {
// {FORM_CHANGE_MOVE, SPECIES_KELDEO_RESOLUTE, MOVE_SECRET_SWORD, WHEN_LEARNED}, // {FORM_CHANGE_MOVE, SPECIES_KELDEO_RESOLUTE, MOVE_SECRET_SWORD, WHEN_LEARNED},
// {FORM_CHANGE_MOVE, SPECIES_KELDEO, MOVE_SECRET_SWORD, WHEN_FORGOTTEN}, // {FORM_CHANGE_MOVE, SPECIES_KELDEO, MOVE_SECRET_SWORD, WHEN_FORGOTTEN},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sGenesectFormChangeTable[] = { static const struct FormChange sGenesectFormChangeTable[] = {
@ -433,48 +433,48 @@ static const struct FormChange sGenesectFormChangeTable[] = {
{FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_SHOCK_DRIVE, ITEM_SHOCK_DRIVE}, {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_SHOCK_DRIVE, ITEM_SHOCK_DRIVE},
{FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_BURN_DRIVE, ITEM_BURN_DRIVE}, {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_BURN_DRIVE, ITEM_BURN_DRIVE},
{FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_CHILL_DRIVE, ITEM_CHILL_DRIVE}, {FORM_CHANGE_ITEM_HOLD, SPECIES_GENESECT_CHILL_DRIVE, ITEM_CHILL_DRIVE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
#endif #endif
#if P_GEN_6_POKEMON == TRUE #if P_GEN_6_POKEMON == TRUE
static const struct FormChange sGreninjaBattleBondFormChangeTable[] = { static const struct FormChange sGreninjaBattleBondFormChangeTable[] = {
{FORM_CHANGE_FAINT, SPECIES_GRENINJA_BATTLE_BOND}, {FORM_CHANGE_FAINT, SPECIES_GRENINJA_BATTLE_BOND},
{FORM_CHANGE_BATTLE_END, SPECIES_GRENINJA_BATTLE_BOND}, {FORM_CHANGE_END_BATTLE, SPECIES_GRENINJA_BATTLE_BOND},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sAegislashFormChangeTable[] = { static const struct FormChange sAegislashFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH},
{FORM_CHANGE_FAINT, SPECIES_AEGISLASH}, {FORM_CHANGE_FAINT, SPECIES_AEGISLASH},
{FORM_CHANGE_BATTLE_END, SPECIES_AEGISLASH}, {FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sXerneasFormChangeTable[] = { static const struct FormChange sXerneasFormChangeTable[] = {
{FORM_CHANGE_BATTLE_BEGIN, SPECIES_XERNEAS_ACTIVE}, {FORM_CHANGE_BEGIN_BATTLE, SPECIES_XERNEAS_ACTIVE},
{FORM_CHANGE_BATTLE_END, SPECIES_XERNEAS, }, {FORM_CHANGE_END_BATTLE, SPECIES_XERNEAS, },
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sZygardePowerConstructFormChangeTable[] = { static const struct FormChange sZygardePowerConstructFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_ZYGARDE_COMPLETE, ABILITY_POWER_CONSTRUCT, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_ZYGARDE_COMPLETE, ABILITY_POWER_CONSTRUCT, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_FAINT}, {FORM_CHANGE_FAINT},
{FORM_CHANGE_BATTLE_END}, {FORM_CHANGE_END_BATTLE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sDiancieFormChangeTable[] = { static const struct FormChange sDiancieFormChangeTable[] = {
{FORM_CHANGE_MEGA_EVOLUTION_ITEM, SPECIES_DIANCIE_MEGA, ITEM_DIANCITE}, {FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM, SPECIES_DIANCIE_MEGA, ITEM_DIANCITE},
{FORM_CHANGE_FAINT, SPECIES_DIANCIE}, {FORM_CHANGE_FAINT, SPECIES_DIANCIE},
{FORM_CHANGE_BATTLE_END, SPECIES_DIANCIE}, {FORM_CHANGE_END_BATTLE, SPECIES_DIANCIE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sHoopaFormChangeTable[] = { static const struct FormChange sHoopaFormChangeTable[] = {
{FORM_CHANGE_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA}, {FORM_CHANGE_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA},
{FORM_CHANGE_WITHDRAW, SPECIES_HOOPA}, {FORM_CHANGE_WITHDRAW, SPECIES_HOOPA},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
#endif #endif
@ -484,15 +484,15 @@ static const struct FormChange sOricorioFormChangeTable[] = {
{FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_POM_POM, ITEM_YELLOW_NECTAR}, {FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_POM_POM, ITEM_YELLOW_NECTAR},
{FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_PAU, ITEM_PINK_NECTAR}, {FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_PAU, ITEM_PINK_NECTAR},
{FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_SENSU, ITEM_PURPLE_NECTAR}, {FORM_CHANGE_ITEM_USE, SPECIES_ORICORIO_SENSU, ITEM_PURPLE_NECTAR},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sWishiwashiFormChangeTable[] = { static const struct FormChange sWishiwashiFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_WISHIWASHI_SCHOOL, ABILITY_SCHOOLING, HP_HIGHER_THAN, 25}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_WISHIWASHI_SCHOOL, ABILITY_SCHOOLING, HP_HIGHER_THAN, 25},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_WISHIWASHI, ABILITY_SCHOOLING, HP_LOWER_EQ_THAN, 25}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_WISHIWASHI, ABILITY_SCHOOLING, HP_LOWER_EQ_THAN, 25},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_WISHIWASHI}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_WISHIWASHI},
{FORM_CHANGE_FAINT, SPECIES_WISHIWASHI}, {FORM_CHANGE_FAINT, SPECIES_WISHIWASHI},
{FORM_CHANGE_BATTLE_END, SPECIES_WISHIWASHI}, {FORM_CHANGE_END_BATTLE, SPECIES_WISHIWASHI},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sSilvallyFormChangeTable[] = { static const struct FormChange sSilvallyFormChangeTable[] = {
@ -514,13 +514,13 @@ static const struct FormChange sSilvallyFormChangeTable[] = {
{FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_DRAGON, ITEM_DRAGON_MEMORY, ABILITY_RKS_SYSTEM}, {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_DRAGON, ITEM_DRAGON_MEMORY, ABILITY_RKS_SYSTEM},
{FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_DARK, ITEM_DARK_MEMORY, ABILITY_RKS_SYSTEM}, {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_DARK, ITEM_DARK_MEMORY, ABILITY_RKS_SYSTEM},
{FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_FAIRY, ITEM_FAIRY_MEMORY, ABILITY_RKS_SYSTEM}, {FORM_CHANGE_ITEM_HOLD, SPECIES_SILVALLY_FAIRY, ITEM_FAIRY_MEMORY, ABILITY_RKS_SYSTEM},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMimikyuFormChangeTable[] = { static const struct FormChange sMimikyuFormChangeTable[] = {
{FORM_CHANGE_FAINT, SPECIES_MIMIKYU}, {FORM_CHANGE_FAINT, SPECIES_MIMIKYU},
{FORM_CHANGE_BATTLE_END, SPECIES_MIMIKYU}, {FORM_CHANGE_END_BATTLE, SPECIES_MIMIKYU},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMiniorRedFormChangeTable[] = { static const struct FormChange sMiniorRedFormChangeTable[] = {
@ -528,56 +528,56 @@ static const struct FormChange sMiniorRedFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_RED, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_RED, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_RED}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_RED},
{FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_RED}, {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_RED},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_RED}, {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_RED},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMiniorBlueFormChangeTable[] = { static const struct FormChange sMiniorBlueFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_BLUE, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_BLUE, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_BLUE, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_BLUE, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_BLUE}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_BLUE},
{FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_BLUE}, {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_BLUE},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_BLUE}, {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_BLUE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMiniorGreenFormChangeTable[] = { static const struct FormChange sMiniorGreenFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_GREEN, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_GREEN, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_GREEN, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_GREEN, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_GREEN}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_GREEN},
{FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_GREEN}, {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_GREEN},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_GREEN}, {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_GREEN},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMiniorIndigoFormChangeTable[] = { static const struct FormChange sMiniorIndigoFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_INDIGO, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_INDIGO, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_INDIGO, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_INDIGO, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_INDIGO}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_INDIGO},
{FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_INDIGO}, {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_INDIGO},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_INDIGO}, {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_INDIGO},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMiniorOrangeFormChangeTable[] = { static const struct FormChange sMiniorOrangeFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_ORANGE, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_ORANGE, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_ORANGE, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_ORANGE, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_ORANGE}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_ORANGE},
{FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_ORANGE}, {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_ORANGE},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_ORANGE}, {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_ORANGE},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMiniorVioletFormChangeTable[] = { static const struct FormChange sMiniorVioletFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_VIOLET, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_VIOLET, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_VIOLET, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_VIOLET, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_VIOLET}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_VIOLET},
{FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_VIOLET}, {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_VIOLET},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_VIOLET}, {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_VIOLET},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMiniorYellowFormChangeTable[] = { static const struct FormChange sMiniorYellowFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_YELLOW, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_METEOR_YELLOW, ABILITY_SHIELDS_DOWN, HP_HIGHER_THAN, 50},
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_YELLOW, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_MINIOR_CORE_YELLOW, ABILITY_SHIELDS_DOWN, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_YELLOW}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_YELLOW},
{FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_YELLOW}, {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_YELLOW},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_YELLOW}, {FORM_CHANGE_END_BATTLE, SPECIES_MINIOR_CORE_YELLOW},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
#endif #endif
@ -587,33 +587,33 @@ static const struct FormChange sCramorantFormChangeTable[] = {
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GORGING, ABILITY_GULP_MISSILE, HP_LOWER_EQ_THAN, 50}, {FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GORGING, ABILITY_GULP_MISSILE, HP_LOWER_EQ_THAN, 50},
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CRAMORANT}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_CRAMORANT},
{FORM_CHANGE_FAINT, SPECIES_CRAMORANT}, {FORM_CHANGE_FAINT, SPECIES_CRAMORANT},
{FORM_CHANGE_BATTLE_END, SPECIES_CRAMORANT}, {FORM_CHANGE_END_BATTLE, SPECIES_CRAMORANT},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sMorpekoFormChangeTable[] = { static const struct FormChange sMorpekoFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MORPEKO}, {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MORPEKO},
{FORM_CHANGE_FAINT, SPECIES_MORPEKO}, {FORM_CHANGE_FAINT, SPECIES_MORPEKO},
{FORM_CHANGE_BATTLE_END, SPECIES_MORPEKO}, {FORM_CHANGE_END_BATTLE, SPECIES_MORPEKO},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sZacianFormChangeTable[] = { static const struct FormChange sZacianFormChangeTable[] = {
{FORM_CHANGE_BATTLE_BEGIN, SPECIES_ZACIAN_CROWNED_SWORD, ITEM_RUSTED_SWORD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BLADE}, {FORM_CHANGE_BEGIN_BATTLE, SPECIES_ZACIAN_CROWNED_SWORD, ITEM_RUSTED_SWORD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BLADE},
{FORM_CHANGE_BATTLE_END, SPECIES_ZACIAN, ITEM_RUSTED_SWORD, MOVE_BEHEMOTH_BLADE, MOVE_IRON_HEAD}, {FORM_CHANGE_END_BATTLE, SPECIES_ZACIAN, ITEM_RUSTED_SWORD, MOVE_BEHEMOTH_BLADE, MOVE_IRON_HEAD},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sZamazentaFormChangeTable[] = { static const struct FormChange sZamazentaFormChangeTable[] = {
{FORM_CHANGE_BATTLE_BEGIN, SPECIES_ZAMAZENTA_CROWNED_SHIELD, ITEM_RUSTED_SHIELD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BASH}, {FORM_CHANGE_BEGIN_BATTLE, SPECIES_ZAMAZENTA_CROWNED_SHIELD, ITEM_RUSTED_SHIELD, MOVE_IRON_HEAD, MOVE_BEHEMOTH_BASH},
{FORM_CHANGE_BATTLE_END, SPECIES_ZAMAZENTA, ITEM_RUSTED_SHIELD, MOVE_BEHEMOTH_BASH, MOVE_IRON_HEAD}, {FORM_CHANGE_END_BATTLE, SPECIES_ZAMAZENTA, ITEM_RUSTED_SHIELD, MOVE_BEHEMOTH_BASH, MOVE_IRON_HEAD},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
static const struct FormChange sEnamorusFormChangeTable[] = { static const struct FormChange sEnamorusFormChangeTable[] = {
{FORM_CHANGE_ITEM_USE, SPECIES_ENAMORUS, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_ENAMORUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_ITEM_USE, SPECIES_ENAMORUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_CHANGE_ITEM_USE, SPECIES_ENAMORUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_TERMINATOR},
}; };
#endif #endif

View File

@ -8498,7 +8498,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
heldItem = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM, NULL); heldItem = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM, NULL);
ability = GetAbilityBySpecies(species, GetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, NULL)); ability = GetAbilityBySpecies(species, GetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, NULL));
for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++)
{ {
if (method == formChanges[i].method && species != formChanges[i].targetSpecies) if (method == formChanges[i].method && species != formChanges[i].targetSpecies)
{ {
@ -8534,8 +8534,8 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
if (BoxMonKnowsMove(boxMon, formChanges[i].param1) != formChanges[i].param2) if (BoxMonKnowsMove(boxMon, formChanges[i].param1) != formChanges[i].param2)
targetSpecies = formChanges[i].targetSpecies; targetSpecies = formChanges[i].targetSpecies;
break; break;
case FORM_CHANGE_BATTLE_BEGIN: case FORM_CHANGE_BEGIN_BATTLE:
case FORM_CHANGE_BATTLE_END: case FORM_CHANGE_END_BATTLE:
if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE) if (heldItem == formChanges[i].param1 || formChanges[i].param1 == ITEM_NONE)
targetSpecies = formChanges[i].targetSpecies; targetSpecies = formChanges[i].targetSpecies;
break; break;
@ -8558,7 +8558,7 @@ bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method)
if (formChanges != NULL) if (formChanges != NULL)
{ {
for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++)
{ {
if (method == formChanges[i].method && species != formChanges[i].targetSpecies) if (method == formChanges[i].method && species != formChanges[i].targetSpecies)
return TRUE; return TRUE;
@ -8681,10 +8681,10 @@ void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method)
const struct FormChange *formChanges = gFormChangeTablePointers[species]; const struct FormChange *formChanges = gFormChangeTablePointers[species];
if (formChanges == NULL if (formChanges == NULL
|| (method != FORM_CHANGE_BATTLE_BEGIN && method != FORM_CHANGE_BATTLE_END)) || (method != FORM_CHANGE_BEGIN_BATTLE && method != FORM_CHANGE_END_BATTLE))
return; return;
for (i = 0; formChanges[i].method != FORM_CHANGE_END; i++) for (i = 0; formChanges[i].method != FORM_CHANGE_TERMINATOR; i++)
{ {
if (formChanges[i].method == method if (formChanges[i].method == method
&& formChanges[i].param2 && formChanges[i].param2