From 9a31fdf7becd6e1e3e59ee5f0b9589469f81837f Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 26 Feb 2022 11:38:08 -0300 Subject: [PATCH 1/4] Updated Applin, Sinistea and Galarian Slowpoke evolution data --- src/data/pokemon/evolution.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/pokemon/evolution.h b/src/data/pokemon/evolution.h index b431b88a3b..093fcce98b 100644 --- a/src/data/pokemon/evolution.h +++ b/src/data/pokemon/evolution.h @@ -467,15 +467,15 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] = [SPECIES_YAMPER] = {{EVO_LEVEL, 25, SPECIES_BOLTUND}}, [SPECIES_ROLYCOLY] = {{EVO_LEVEL, 18, SPECIES_CARKOL}}, [SPECIES_CARKOL] = {{EVO_LEVEL, 34, SPECIES_COALOSSAL}}, - [SPECIES_APPLIN] = {{EVO_ITEM, ITEM_NONE, SPECIES_FLAPPLE}, - {EVO_ITEM, ITEM_NONE, SPECIES_APPLETUN}}, + [SPECIES_APPLIN] = {{EVO_ITEM, ITEM_TART_APPLE, SPECIES_FLAPPLE}, + {EVO_ITEM, ITEM_SWEET_APPLE, SPECIES_APPLETUN}}, [SPECIES_SILICOBRA] = {{EVO_LEVEL, 36, SPECIES_SANDACONDA}}, [SPECIES_ARROKUDA] = {{EVO_LEVEL, 26, SPECIES_BARRASKEWDA}}, [SPECIES_TOXEL] = {{EVO_LEVEL_NATURE_AMPED, 30, SPECIES_TOXTRICITY}, {EVO_LEVEL_NATURE_LOW_KEY, 30, SPECIES_TOXTRICITY_LOW_KEY}}, [SPECIES_SIZZLIPEDE] = {{EVO_LEVEL, 28, SPECIES_CENTISKORCH}}, [SPECIES_CLOBBOPUS] = {{EVO_MOVE, MOVE_TAUNT, SPECIES_GRAPPLOCT}}, - [SPECIES_SINISTEA] = {{EVO_ITEM, ITEM_NONE, SPECIES_POLTEAGEIST}}, + [SPECIES_SINISTEA] = {{EVO_ITEM, ITEM_CRACKED_POT, SPECIES_POLTEAGEIST}}, [SPECIES_HATENNA] = {{EVO_LEVEL, 32, SPECIES_HATTREM}}, [SPECIES_HATTREM] = {{EVO_LEVEL, 42, SPECIES_HATTERENE}}, [SPECIES_IMPIDIMP] = {{EVO_LEVEL, 32, SPECIES_MORGREM}}, @@ -505,8 +505,8 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] = [SPECIES_GRIMER_ALOLAN] = {{EVO_LEVEL, 38, SPECIES_MUK_ALOLAN}}, [SPECIES_MEOWTH_GALARIAN] = {{EVO_LEVEL, 28, SPECIES_PERRSERKER}}, [SPECIES_PONYTA_GALARIAN] = {{EVO_LEVEL, 40, SPECIES_RAPIDASH_GALARIAN}}, - [SPECIES_SLOWPOKE_GALARIAN] = {{EVO_ITEM, ITEM_NONE, SPECIES_SLOWBRO_GALARIAN}, - {EVO_ITEM, ITEM_NONE, SPECIES_SLOWKING_GALARIAN}}, + [SPECIES_SLOWPOKE_GALARIAN] = {{EVO_ITEM, ITEM_GALARICA_CUFF, SPECIES_SLOWBRO_GALARIAN}, + {EVO_ITEM, ITEM_GALARICA_WREATH, SPECIES_SLOWKING_GALARIAN}}, [SPECIES_FARFETCHD_GALARIAN] = {{EVO_LEVEL, 0, SPECIES_SIRFETCHD}}, [SPECIES_MR_MIME_GALARIAN] = {{EVO_LEVEL, 42, SPECIES_MR_RIME}}, [SPECIES_CORSOLA_GALARIAN] = {{EVO_LEVEL, 38, SPECIES_CURSOLA}}, @@ -534,5 +534,5 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] = [SPECIES_PUMPKABOO_LARGE] = {{EVO_TRADE, 0, SPECIES_GOURGEIST_LARGE}}, [SPECIES_PUMPKABOO_SUPER] = {{EVO_TRADE, 0, SPECIES_GOURGEIST_SUPER}}, [SPECIES_ROCKRUFF_OWN_TEMPO] = {{EVO_LEVEL_DUSK, 25, SPECIES_LYCANROC_DUSK}}, - [SPECIES_SINISTEA_ANTIQUE] = {{EVO_ITEM, ITEM_NONE, SPECIES_POLTEAGEIST_ANTIQUE}}, + [SPECIES_SINISTEA_ANTIQUE] = {{EVO_ITEM, ITEM_CHIPPED_POT, SPECIES_POLTEAGEIST_ANTIQUE}}, }; From 755b31bee0a500a963f5c4de137c9b8c9953b03f Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 26 Feb 2022 12:19:38 -0300 Subject: [PATCH 2/4] Enable form change for the Forces of Nature --- include/constants/pokemon_config.h | 4 +-- src/data/pokemon/form_change_table_pointers.h | 10 +++--- src/data/pokemon/form_change_tables.h | 35 +++++-------------- 3 files changed, 15 insertions(+), 34 deletions(-) diff --git a/include/constants/pokemon_config.h b/include/constants/pokemon_config.h index 257c06b7c0..91561ab7c1 100644 --- a/include/constants/pokemon_config.h +++ b/include/constants/pokemon_config.h @@ -159,8 +159,8 @@ //FORM_ITEM_USE #define ITEM_GRACIDEA 10125 - // #define ITEM_REVEAL_GLASS 10126 - // #define ITEM_PRISON_BOTTLE 10127 + #define ITEM_REVEAL_GLASS 10126 + #define ITEM_PRISON_BOTTLE 10127 #define ITEM_RED_NECTAR 10128 #define ITEM_YELLOW_NECTAR 10129 #define ITEM_PINK_NECTAR 10130 diff --git a/src/data/pokemon/form_change_table_pointers.h b/src/data/pokemon/form_change_table_pointers.h index 39fcc7aee2..d44b70dce8 100644 --- a/src/data/pokemon/form_change_table_pointers.h +++ b/src/data/pokemon/form_change_table_pointers.h @@ -3,7 +3,7 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] = [SPECIES_GIRATINA] = sGiratinaFormChangeTable, [SPECIES_GIRATINA_ORIGIN] = sGiratinaFormChangeTable, [SPECIES_SHAYMIN] = sShayminFormChangeTable, - [SPECIES_SHAYMIN_SKY] = sShayminSkyFormChangeTable, + [SPECIES_SHAYMIN_SKY] = sShayminFormChangeTable, [SPECIES_ARCEUS] = sArceusFormChangeTable, [SPECIES_ARCEUS_FIGHTING] = sArceusFormChangeTable, [SPECIES_ARCEUS_FLYING] = sArceusFormChangeTable, @@ -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] = sTornadusTherianFormChangeTable, + [SPECIES_TORNADUS_THERIAN] = sTornadusFormChangeTable, [SPECIES_THUNDURUS] = sThundurusFormChangeTable, - [SPECIES_THUNDURUS_THERIAN] = sThundurusTherianFormChangeTable, + [SPECIES_THUNDURUS_THERIAN] = sThundurusFormChangeTable, [SPECIES_LANDORUS] = sLandorusFormChangeTable, - [SPECIES_LANDORUS_THERIAN] = sLandorusTherianFormChangeTable, + [SPECIES_LANDORUS_THERIAN] = sLandorusFormChangeTable, [SPECIES_KELDEO] = sKeldeoFormChangeTable, - [SPECIES_KELDEO_RESOLUTE] = sKeldeoResoluteFormChangeTable, + [SPECIES_KELDEO_RESOLUTE] = sKeldeoFormChangeTable, [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 f980f14b89..a333d62c18 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -47,10 +47,6 @@ static const struct FormChange sGiratinaFormChangeTable[] = { static const struct FormChange sShayminFormChangeTable[] = { {FORM_ITEM_USE_TIME, SPECIES_SHAYMIN_SKY, ITEM_GRACIDEA, DAY}, - {FORM_CHANGE_END}, -}; - -static const struct FormChange sShayminSkyFormChangeTable[] = { {FORM_WITHDRAW, SPECIES_SHAYMIN}, {FORM_CHANGE_END}, }; @@ -95,41 +91,25 @@ 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_ITEM_USE, SPECIES_TORNADUS_THERIAN, ITEM_REVEAL_GLASS}, + {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_ITEM_USE, SPECIES_THUNDURUS_THERIAN, ITEM_REVEAL_GLASS}, + {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_ITEM_USE, SPECIES_LANDORUS_THERIAN, ITEM_REVEAL_GLASS}, + {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}, }; @@ -144,7 +124,8 @@ static const struct FormChange sGenesectFormChangeTable[] = { }; 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}, }; From e2daf2c258bb9a9971a76a12d978e0f530aaa0f6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 26 Feb 2022 12:23:37 -0300 Subject: [PATCH 3/4] Fixed bug where switching between 2 forms with the same method would cause only one to change --- src/pokemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pokemon.c b/src/pokemon.c index 73df906c28..658f88519a 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -8267,6 +8267,8 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *mon, u16 method, u32 arg } break; } + if (species != targetSpecies) + break; } } } From b1227af13b27ee235c0f23dac7a0864577fd76f5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sat, 26 Feb 2022 12:58:49 -0300 Subject: [PATCH 4/4] Reverted to separate form change tables for Forces of Nature. It was causing form changes with holding items to break --- src/data/pokemon/form_change_table_pointers.h | 8 +++---- src/data/pokemon/form_change_tables.h | 23 +++++++++++++++++-- src/pokemon.c | 2 -- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/data/pokemon/form_change_table_pointers.h b/src/data/pokemon/form_change_table_pointers.h index d44b70dce8..d40d332abf 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 a333d62c18..c224a1a028 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 658f88519a..73df906c28 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; } } }