From bb94d302ae812348ccd69feaf007f2dae116c511 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Wed, 20 Dec 2023 03:33:08 -0600 Subject: [PATCH] Add Meteorite form change functionality (#3770) Co-authored-by: Bassoonian --- src/data/items.h | 4 ++-- src/data/pokemon/form_change_tables.h | 22 ++++++++++++++++++++++ src/data/pokemon/species_info/gen_3.h | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index 85fa2dc893..beee14c48d 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -9048,8 +9048,8 @@ const struct Item gItems[] = .description = sMeteoriteDesc, .importance = 1, .pocket = POCKET_KEY_ITEMS, - .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .type = ITEM_USE_PARTY_MENU, + .fieldUseFunc = ItemUseOutOfBattle_FormChange, }, [ITEM_MAGMA_EMBLEM] = diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 3720770a1f..2411783728 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -385,6 +385,28 @@ static const struct FormChange sRayquazaFormChangeTable[] = { }; #endif //P_FAMILY_RAYQUAZA +#if P_FAMILY_DEOXYS +static const struct FormChange sDeoxysNormalFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_ATTACK, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; + +static const struct FormChange sDeoxysAttackFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_DEFENSE, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; + +static const struct FormChange sDeoxysDefenseFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_SPEED, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; + +static const struct FormChange sDeoxysSpeedFormChangeTable[] = { + {FORM_CHANGE_ITEM_USE, SPECIES_DEOXYS_NORMAL, ITEM_METEORITE}, + {FORM_CHANGE_TERMINATOR}, +}; +#endif //P_FAMILY_DEOXYS + #if P_FAMILY_BURMY static const struct FormChange sBurmyFormChangeTable[] = { {FORM_CHANGE_END_BATTLE_TERRAIN, SPECIES_BURMY_PLANT_CLOAK, BATTLE_TERRAIN_GRASS}, diff --git a/src/data/pokemon/species_info/gen_3.h b/src/data/pokemon/species_info/gen_3.h index b0606381ed..5864449505 100644 --- a/src/data/pokemon/species_info/gen_3.h +++ b/src/data/pokemon/species_info/gen_3.h @@ -8176,6 +8176,7 @@ const struct SpeciesInfo gSpeciesInfoGen3[] = PALETTES(DeoxysNormal), ICON(DeoxysNormal, 0), LEARNSETS(DeoxysNormal), + .formChangeTable = sDeoxysNormalFormChangeTable, }, [SPECIES_DEOXYS_ATTACK] = @@ -8199,6 +8200,7 @@ const struct SpeciesInfo gSpeciesInfoGen3[] = PALETTES(DeoxysAttack), ICON(DeoxysAttack, 0), LEARNSETS(DeoxysAttack), + .formChangeTable = sDeoxysAttackFormChangeTable, }, [SPECIES_DEOXYS_DEFENSE] = @@ -8222,6 +8224,7 @@ const struct SpeciesInfo gSpeciesInfoGen3[] = PALETTES(DeoxysDefense), ICON(DeoxysDefense, 0), LEARNSETS(DeoxysDefense), + .formChangeTable = sDeoxysDefenseFormChangeTable, }, [SPECIES_DEOXYS_SPEED] = @@ -8245,6 +8248,7 @@ const struct SpeciesInfo gSpeciesInfoGen3[] = PALETTES(DeoxysSpeed), ICON(DeoxysSpeed, 0), LEARNSETS(DeoxysSpeed), + .formChangeTable = sDeoxysSpeedFormChangeTable, }, #endif //P_FAMILY_DEOXYS