diff --git a/src/data/pokemon/form_change_table_pointers.h b/src/data/pokemon/form_change_table_pointers.h index d44b70dce..d40d332ab 100644 --- a/src/data/pokemon/form_change_table_pointers.h +++ b/src/data/pokemon/form_change_table_pointers.h @@ -23,13 +23,13 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = [SPECIES_ARCEUS_DARK] = sArceusFormChangeTable, [SPECIES_ARCEUS_FAIRY] = sArceusFormChangeTable, [SPECIES_TORNADUS] = sTornadusFormChangeTable, - [SPECIES_TORNADUS_THERIAN] = sTornadusFormChangeTable, + [SPECIES_TORNADUS_THERIAN] = sTornadusTherianFormChangeTable, [SPECIES_THUNDURUS] = sThundurusFormChangeTable, - [SPECIES_THUNDURUS_THERIAN] = sThundurusFormChangeTable, + [SPECIES_THUNDURUS_THERIAN] = sThundurusTherianFormChangeTable, [SPECIES_LANDORUS] = sLandorusFormChangeTable, - [SPECIES_LANDORUS_THERIAN] = sLandorusFormChangeTable, + [SPECIES_LANDORUS_THERIAN] = sLandorusTherianFormChangeTable, [SPECIES_KELDEO] = sKeldeoFormChangeTable, - [SPECIES_KELDEO_RESOLUTE] = sKeldeoFormChangeTable, + [SPECIES_KELDEO_RESOLUTE] = sKeldeoResoluteFormChangeTable, [SPECIES_GENESECT] = sGenesectFormChangeTable, [SPECIES_GENESECT_DOUSE_DRIVE] = sGenesectFormChangeTable, [SPECIES_GENESECT_SHOCK_DRIVE] = sGenesectFormChangeTable, diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index a333d62c1..c224a1a02 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -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 change activates when the item is given to or taken from the selected Pokémon. param1 = item to hold @@ -92,24 +96,40 @@ static const struct FormChange sArceusFormChangeTable[] = { static const struct FormChange sTornadusFormChangeTable[] = { {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_CHANGE_END}, }; static const struct FormChange sThundurusFormChangeTable[] = { {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_CHANGE_END}, }; static const struct FormChange sLandorusFormChangeTable[] = { {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_CHANGE_END}, }; static const struct FormChange sKeldeoFormChangeTable[] = { {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_CHANGE_END}, }; @@ -124,8 +144,7 @@ static const struct FormChange sGenesectFormChangeTable[] = { }; static const struct FormChange sHoopaFormChangeTable[] = { - {FORM_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA}, - {FORM_WITHDRAW, SPECIES_HOOPA}, + // {FORM_ITEM_USE, SPECIES_HOOPA_UNBOUND, ITEM_PRISON_BOTTLE, SPECIES_HOOPA}, {FORM_CHANGE_END}, }; diff --git a/src/pokemon.c b/src/pokemon.c index 658f88519..73df906c2 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8267,8 +8267,6 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg } break; } - if (species != targetSpecies) - break; } } }