diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 7dc250834..06e4be4f3 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -320,11 +320,11 @@ #define FORM_CHANGE_ITEM_HOLD 1 #define FORM_CHANGE_ITEM_USE 2 #define FORM_CHANGE_MOVE 3 // Todo -#define FORM_CHANGE_WITHDRAW 4 // -#define FORM_CHANGE_BATTLE_BEGIN 5 -#define FORM_CHANGE_BATTLE_END 6 -#define FORM_CHANGE_BATTLE_SWITCH 7 -#define FORM_CHANGE_BATTLE_FAINT 8 +#define FORM_CHANGE_WITHDRAW 4 // Daycare done, Todo PC +#define FORM_CHANGE_FAINT 5 +#define FORM_CHANGE_BATTLE_BEGIN 6 +#define FORM_CHANGE_BATTLE_END 7 +#define FORM_CHANGE_BATTLE_SWITCH 8 #define FORM_CHANGE_PRIMAL_REVERSION 9 #define MON_PIC_WIDTH 64 diff --git a/src/battle_main.c b/src/battle_main.c index f58c0d43b..9d08a4e8c 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3247,7 +3247,7 @@ void FaintClearSetData(void) gBattleMons[gActiveBattler].type3 = TYPE_MYSTERY; Ai_UpdateFaintData(gActiveBattler); - TryFormChange(gBattlerPartyIndexes[gActiveBattler], GET_BATTLER_SIDE(gActiveBattler), FORM_CHANGE_BATTLE_FAINT); + TryFormChange(gBattlerPartyIndexes[gActiveBattler], GET_BATTLER_SIDE(gActiveBattler), FORM_CHANGE_FAINT); if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) UndoMegaEvolution(gBattlerPartyIndexes[gActiveBattler]); diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 7342256ec..b936808b6 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -116,20 +116,20 @@ static const struct FormChange sArceusFormChangeTable[] = { static const struct FormChange sDarmanitanFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_DARMANITAN}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_DARMANITAN}, + {FORM_CHANGE_FAINT, SPECIES_DARMANITAN}, {FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN}, {FORM_CHANGE_END}, }; static const struct FormChange sDarmanitanGalarianFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_DARMANITAN_GALARIAN}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_DARMANITAN_GALARIAN}, + {FORM_CHANGE_FAINT, SPECIES_DARMANITAN_GALARIAN}, {FORM_CHANGE_BATTLE_END, SPECIES_DARMANITAN_GALARIAN}, {FORM_CHANGE_END}, }; static const struct FormChange sMeloettaFormChangeTable[] = { - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MELOETTA}, + {FORM_CHANGE_FAINT, SPECIES_MELOETTA}, {FORM_CHANGE_BATTLE_END, SPECIES_MELOETTA}, {FORM_CHANGE_END}, }; @@ -170,14 +170,14 @@ static const struct FormChange sGenesectFormChangeTable[] = { #if P_GEN_6_POKEMON == TRUE static const struct FormChange sGreninjaBattleBondFormChangeTable[] = { - {FORM_CHANGE_BATTLE_FAINT, SPECIES_GRENINJA_BATTLE_BOND}, + {FORM_CHANGE_FAINT, SPECIES_GRENINJA_BATTLE_BOND}, {FORM_CHANGE_BATTLE_END, SPECIES_GRENINJA_BATTLE_BOND}, {FORM_CHANGE_END}, }; static const struct FormChange sAegislashFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_AEGISLASH}, + {FORM_CHANGE_FAINT, SPECIES_AEGISLASH}, {FORM_CHANGE_BATTLE_END, SPECIES_AEGISLASH}, {FORM_CHANGE_END}, }; @@ -205,7 +205,7 @@ static const struct FormChange sOricorioFormChangeTable[] = { }; static const struct FormChange sWishiwashiFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_WISHIWASHI}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_WISHIWASHI}, + {FORM_CHANGE_FAINT, SPECIES_WISHIWASHI}, {FORM_CHANGE_BATTLE_END, SPECIES_WISHIWASHI}, {FORM_CHANGE_END}, }; @@ -233,50 +233,50 @@ static const struct FormChange sSilvallyFormChangeTable[] = { }; static const struct FormChange sMimikyuFormChangeTable[] = { - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MIMIKYU}, + {FORM_CHANGE_FAINT, SPECIES_MIMIKYU}, {FORM_CHANGE_BATTLE_END, SPECIES_MIMIKYU}, {FORM_CHANGE_END}, }; static const struct FormChange sMiniorRedFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_RED}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MINIOR_CORE_RED}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_RED}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_RED}, {FORM_CHANGE_END}, }; static const struct FormChange sMiniorBlueFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_BLUE}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MINIOR_CORE_BLUE}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_BLUE}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_BLUE}, {FORM_CHANGE_END}, }; static const struct FormChange sMiniorGreenFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_GREEN}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MINIOR_CORE_GREEN}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_GREEN}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_GREEN}, {FORM_CHANGE_END}, }; static const struct FormChange sMiniorIndigoFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_INDIGO}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MINIOR_CORE_INDIGO}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_INDIGO}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_INDIGO}, {FORM_CHANGE_END}, }; static const struct FormChange sMiniorOrangeFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_ORANGE}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MINIOR_CORE_ORANGE}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_ORANGE}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_ORANGE}, {FORM_CHANGE_END}, }; static const struct FormChange sMiniorVioletFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_VIOLET}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MINIOR_CORE_VIOLET}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_VIOLET}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_VIOLET}, {FORM_CHANGE_END}, }; static const struct FormChange sMiniorYellowFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MINIOR_CORE_YELLOW}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MINIOR_CORE_YELLOW}, + {FORM_CHANGE_FAINT, SPECIES_MINIOR_CORE_YELLOW}, {FORM_CHANGE_BATTLE_END, SPECIES_MINIOR_CORE_YELLOW}, {FORM_CHANGE_END}, }; @@ -286,14 +286,14 @@ static const struct FormChange sMiniorYellowFormChangeTable[] = { #if P_GEN_8_POKEMON == TRUE static const struct FormChange sCramorantFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_CRAMORANT}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_CRAMORANT}, + {FORM_CHANGE_FAINT, SPECIES_CRAMORANT}, {FORM_CHANGE_BATTLE_END, SPECIES_CRAMORANT}, {FORM_CHANGE_END}, }; static const struct FormChange sMorpekoFormChangeTable[] = { {FORM_CHANGE_BATTLE_SWITCH, SPECIES_MORPEKO}, - {FORM_CHANGE_BATTLE_FAINT, SPECIES_MORPEKO}, + {FORM_CHANGE_FAINT, SPECIES_MORPEKO}, {FORM_CHANGE_BATTLE_END, SPECIES_MORPEKO}, {FORM_CHANGE_END}, }; diff --git a/src/field_poison.c b/src/field_poison.c index fcb47acdb..68a345919 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -128,7 +128,10 @@ s32 DoPoisonFieldEffect(void) // Apply poison damage hp = GetMonData(pokemon, MON_DATA_HP); if (hp == 0 || --hp == 0) + { + TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_FAINT); numFainted++; + } SetMonData(pokemon, MON_DATA_HP, &hp); numPoisoned++; diff --git a/src/pokemon.c b/src/pokemon.c index ced0f67b9..c296e1413 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8404,7 +8404,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 break; case FORM_CHANGE_WITHDRAW: case FORM_CHANGE_BATTLE_SWITCH: - case FORM_CHANGE_BATTLE_FAINT: + case FORM_CHANGE_FAINT: targetSpecies = formChanges[i].targetSpecies; break; }