Reverted to separate form change tables for Forces of Nature.

It was causing form changes with holding items to break
This commit is contained in:
Eduardo Quezada D'Ottone 2022-02-26 12:58:49 -03:00
parent e2daf2c258
commit b1227af13b
3 changed files with 25 additions and 8 deletions

View File

@ -23,13 +23,13 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] =
[SPECIES_ARCEUS_DARK] = sArceusFormChangeTable, [SPECIES_ARCEUS_DARK] = sArceusFormChangeTable,
[SPECIES_ARCEUS_FAIRY] = sArceusFormChangeTable, [SPECIES_ARCEUS_FAIRY] = sArceusFormChangeTable,
[SPECIES_TORNADUS] = sTornadusFormChangeTable, [SPECIES_TORNADUS] = sTornadusFormChangeTable,
[SPECIES_TORNADUS_THERIAN] = sTornadusFormChangeTable, [SPECIES_TORNADUS_THERIAN] = sTornadusTherianFormChangeTable,
[SPECIES_THUNDURUS] = sThundurusFormChangeTable, [SPECIES_THUNDURUS] = sThundurusFormChangeTable,
[SPECIES_THUNDURUS_THERIAN] = sThundurusFormChangeTable, [SPECIES_THUNDURUS_THERIAN] = sThundurusTherianFormChangeTable,
[SPECIES_LANDORUS] = sLandorusFormChangeTable, [SPECIES_LANDORUS] = sLandorusFormChangeTable,
[SPECIES_LANDORUS_THERIAN] = sLandorusFormChangeTable, [SPECIES_LANDORUS_THERIAN] = sLandorusTherianFormChangeTable,
[SPECIES_KELDEO] = sKeldeoFormChangeTable, [SPECIES_KELDEO] = sKeldeoFormChangeTable,
[SPECIES_KELDEO_RESOLUTE] = sKeldeoFormChangeTable, [SPECIES_KELDEO_RESOLUTE] = sKeldeoResoluteFormChangeTable,
[SPECIES_GENESECT] = sGenesectFormChangeTable, [SPECIES_GENESECT] = sGenesectFormChangeTable,
[SPECIES_GENESECT_DOUSE_DRIVE] = sGenesectFormChangeTable, [SPECIES_GENESECT_DOUSE_DRIVE] = sGenesectFormChangeTable,
[SPECIES_GENESECT_SHOCK_DRIVE] = sGenesectFormChangeTable, [SPECIES_GENESECT_SHOCK_DRIVE] = sGenesectFormChangeTable,

View File

@ -1,4 +1,8 @@
/* /*
For cycling between forms with the same method and parameters but different target species (eg. Tornadus using the
Reveal Glass to change between its two forms), a separate form change table is required for each form.
Otherwise, only the last form change on the table will trigger.
FORM_ITEM_HOLD: FORM_ITEM_HOLD:
Form change activates when the item is given to or taken from the selected Pokémon. Form change activates when the item is given to or taken from the selected Pokémon.
param1 = item to hold param1 = item to hold
@ -92,24 +96,40 @@ static const struct FormChange sArceusFormChangeTable[] = {
static const struct FormChange sTornadusFormChangeTable[] = { static const struct FormChange sTornadusFormChangeTable[] = {
{FORM_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END},
};
static const struct FormChange sTornadusTherianFormChangeTable[] = {
{FORM_ITEM_USE, SPECIES_TORNADUS, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_TORNADUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sThundurusFormChangeTable[] = { static const struct FormChange sThundurusFormChangeTable[] = {
{FORM_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END},
};
static const struct FormChange sThundurusTherianFormChangeTable[] = {
{FORM_ITEM_USE, SPECIES_THUNDURUS, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_THUNDURUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sLandorusFormChangeTable[] = { static const struct FormChange sLandorusFormChangeTable[] = {
{FORM_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END},
};
static const struct FormChange sLandorusTherianFormChangeTable[] = {
{FORM_ITEM_USE, SPECIES_LANDORUS, ITEM_REVEAL_GLASS}, {FORM_ITEM_USE, SPECIES_LANDORUS, ITEM_REVEAL_GLASS},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
static const struct FormChange sKeldeoFormChangeTable[] = { static const struct FormChange sKeldeoFormChangeTable[] = {
{FORM_MOVE, SPECIES_KELDEO_RESOLUTE, MOVE_SECRET_SWORD, WHEN_LEARNED}, {FORM_MOVE, SPECIES_KELDEO_RESOLUTE, MOVE_SECRET_SWORD, WHEN_LEARNED},
{FORM_CHANGE_END},
};
static const struct FormChange sKeldeoResoluteFormChangeTable[] = {
{FORM_MOVE, SPECIES_KELDEO, MOVE_SECRET_SWORD, WHEN_FORGOTTEN}, {FORM_MOVE, SPECIES_KELDEO, MOVE_SECRET_SWORD, WHEN_FORGOTTEN},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };
@ -124,8 +144,7 @@ static const struct FormChange sGenesectFormChangeTable[] = {
}; };
static const struct FormChange sHoopaFormChangeTable[] = { static const struct FormChange sHoopaFormChangeTable[] = {
{FORM_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA}, // {FORM_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA},
{FORM_WITHDRAW, SPECIES_HOOPA},
{FORM_CHANGE_END}, {FORM_CHANGE_END},
}; };

View File

@ -8267,8 +8267,6 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg
} }
break; break;
} }
if (species != targetSpecies)
break;
} }
} }
} }