Form change when switching out

This commit is contained in:
Eduardo Quezada 2022-10-20 17:56:56 -03:00
parent b74f0777da
commit d8cc7f7abe
3 changed files with 33 additions and 15 deletions

View File

@ -323,7 +323,8 @@
#define FORM_CHANGE_MOVE 3 #define FORM_CHANGE_MOVE 3
#define FORM_CHANGE_WITHDRAW 4 #define FORM_CHANGE_WITHDRAW 4
#define FORM_CHANGE_BATTLE_BEGIN 5 #define FORM_CHANGE_BATTLE_BEGIN 5
#define FORM_CHANGE_BATTLE_END 6 #define FORM_CHANGE_BATTLE_SWITCH 6
#define FORM_CHANGE_BATTLE_END 7
#define MON_PIC_WIDTH 64 #define MON_PIC_WIDTH 64
#define MON_PIC_HEIGHT 64 #define MON_PIC_HEIGHT 64

View File

@ -518,7 +518,7 @@ void HandleAction_Switch(void)
if (gBattleResults.playerSwitchesCounter < 255) if (gBattleResults.playerSwitchesCounter < 255)
gBattleResults.playerSwitchesCounter++; gBattleResults.playerSwitchesCounter++;
UndoFormChange(gBattlerPartyIndexes[gBattlerAttacker], GetBattlerSide(gBattlerAttacker), TRUE); BattleFormChange(gBattlerPartyIndexes[gBattlerAttacker], GetBattlerSide(gBattlerAttacker), FORM_CHANGE_BATTLE_SWITCH);
} }
void HandleAction_UseItem(void) void HandleAction_UseItem(void)

View File

@ -22,6 +22,10 @@ FORM_CHANGE_WITHDRAW:
Form change activates when the Pokémon is withdrawn from the PC or Daycare. Form change activates when the Pokémon is withdrawn from the PC or Daycare.
no parameters no parameters
FORM_CHANGE_SWITCH:
Form change activates when the Pokémon is switched out in battle.
no parameters
FORM_CHANGE_BATTLE_BEGIN: FORM_CHANGE_BATTLE_BEGIN:
Form change activates when the Pokémon is sent out at the beginning of a battle Form change activates when the Pokémon is sent out at the beginning of a battle
param1 = item to hold, optional param1 = item to hold, optional
@ -99,11 +103,13 @@ static const struct FormChange sArceusFormChangeTable[] = {
#if P_GEN_5_POKEMON == TRUE #if P_GEN_5_POKEMON == TRUE
static const struct FormChange sDarmanitanFormChangeTable[] = { static const struct FormChange sDarmanitanFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_DARMANITAN},
{FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN}, {FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sDarmanitanGalarianFormChangeTable[] = { static const struct FormChange sDarmanitanGalarianFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_DARMANITAN_GALARIAN},
{FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN_GALARIAN}, {FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN_GALARIAN},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
@ -154,6 +160,7 @@ static const struct FormChange sGreninjaBattleBondFormChangeTable[] = {
}; };
static const struct FormChange sAegislashFormChangeTable[] = { static const struct FormChange sAegislashFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH},
{FORM_CHANGE_BATTLE_END, SPECIES_AEGISLASH}, {FORM_CHANGE_BATTLE_END, SPECIES_AEGISLASH},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
@ -180,6 +187,7 @@ static const struct FormChange sOricorioFormChangeTable[] = {
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sWishiwashiFormChangeTable[] = { static const struct FormChange sWishiwashiFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_WISHIWASHI},
{FORM_CHANGE_BATTLE_END, SPECIES_WISHIWASHI}, {FORM_CHANGE_BATTLE_END, SPECIES_WISHIWASHI},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
@ -212,30 +220,37 @@ static const struct FormChange sMimikyuFormChangeTable[] = {
}; };
static const struct FormChange sMiniorRedFormChangeTable[] = { static const struct FormChange sMiniorRedFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_RED},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_RED}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_RED},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sMiniorBlueFormChangeTable[] = { static const struct FormChange sMiniorBlueFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_BLUE},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_BLUE}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_BLUE},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sMiniorGreenFormChangeTable[] = { static const struct FormChange sMiniorGreenFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_GREEN},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_GREEN}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_GREEN},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sMiniorIndigoFormChangeTable[] = { static const struct FormChange sMiniorIndigoFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_INDIGO},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_INDIGO}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_INDIGO},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sMiniorOrangeFormChangeTable[] = { static const struct FormChange sMiniorOrangeFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_ORANGE},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_ORANGE}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_ORANGE},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sMiniorVioletFormChangeTable[] = { static const struct FormChange sMiniorVioletFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_VIOLET},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_VIOLET}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_VIOLET},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sMiniorYellowFormChangeTable[] = { static const struct FormChange sMiniorYellowFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_YELLOW},
{FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_YELLOW}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_YELLOW},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
@ -244,11 +259,13 @@ static const struct FormChange sMiniorYellowFormChangeTable[] = {
#if P_GEN_8_POKEMON == TRUE #if P_GEN_8_POKEMON == TRUE
static const struct FormChange sCramorantFormChangeTable[] = { static const struct FormChange sCramorantFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CRAMORANT},
{FORM_CHANGE_BATTLE_END, SPECIES_CRAMORANT}, {FORM_CHANGE_BATTLE_END, SPECIES_CRAMORANT},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sMorpekoFormChangeTable[] = { static const struct FormChange sMorpekoFormChangeTable[] = {
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_MORPEKO},
{FORM_CHANGE_BATTLE_END, SPECIES_MORPEKO}, {FORM_CHANGE_BATTLE_END, SPECIES_MORPEKO},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };