From 08bd8f84035916cf352b655e160510ced49bf05c Mon Sep 17 00:00:00 2001 From: ExpoSeed <> Date: Wed, 3 Mar 2021 15:34:22 -0600 Subject: [PATCH 01/17] Support form changes with PE --- src/data/items.h | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index cd3a23f5b..292f6bed5 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1501,8 +1501,13 @@ const struct Item gItems[] = .holdEffectParam = 0, .description = sRedNectarDesc, .pocket = POCKET_ITEMS, - .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Placeholder + #ifdef POKEMON_EXPANSION + .type = ITEM_USE_PARTY_MENU, + .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + #else + .type = ITEM_USE_BAG_MENU, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + #endif }, [ITEM_YELLOW_NECTAR] = @@ -1513,8 +1518,13 @@ const struct Item gItems[] = .holdEffectParam = 0, .description = sYellowNectarDesc, .pocket = POCKET_ITEMS, - .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Placeholder + #ifdef POKEMON_EXPANSION + .type = ITEM_USE_PARTY_MENU, + .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + #else + .type = ITEM_USE_BAG_MENU, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + #endif }, [ITEM_PINK_NECTAR] = @@ -1525,8 +1535,13 @@ const struct Item gItems[] = .holdEffectParam = 0, .description = sPinkNectarDesc, .pocket = POCKET_ITEMS, - .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Placeholder + #ifdef POKEMON_EXPANSION + .type = ITEM_USE_PARTY_MENU, + .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + #else + .type = ITEM_USE_BAG_MENU, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + #endif }, [ITEM_PURPLE_NECTAR] = @@ -1537,8 +1552,13 @@ const struct Item gItems[] = .holdEffectParam = 0, .description = sPurpleNectarDesc, .pocket = POCKET_ITEMS, - .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Placeholder + #ifdef POKEMON_EXPANSION + .type = ITEM_USE_PARTY_MENU, + .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + #else + .type = ITEM_USE_BAG_MENU, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + #endif }, [ITEM_RARE_BONE] = @@ -5335,9 +5355,14 @@ const struct Item gItems[] = .price = 0, .holdEffect = HOLD_EFFECT_GRACIDEA, .description = sGracideaDesc, - .pocket = POCKET_ITEMS, - .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .pocket = POCKET_KEY_ITEMS, + #ifdef POKEMON_EXPANSION + .type = ITEM_USE_PARTY_MENU, + .fieldUseFunc = ItemUseOutOfBattle_FormChange, + #else + .type = ITEM_USE_BAG_MENU, + .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + #endif }, [ITEM_BUG_MEMORY] = From f682e409f05ff7a46b3fec39daf3b849f26039e8 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 4 Sep 2021 08:19:57 -0400 Subject: [PATCH 02/17] update mental herb desc --- src/data/text/item_descriptions.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/data/text/item_descriptions.h b/src/data/text/item_descriptions.h index c102b4116..83edfdbdb 100644 --- a/src/data/text/item_descriptions.h +++ b/src/data/text/item_descriptions.h @@ -1041,10 +1041,17 @@ static const u8 sSootheBellDesc[] = _( "calms spirits and\n" "fosters friendship."); +#ifdef BATTLE_ENGINE static const u8 sMentalHerbDesc[] = _( "A hold item that\n" - "snaps Pokémon out\n" + "snaps POKéMON out\n" "of infatuation."); +#else +static const u8 sMentalHerbDesc[] = _( + "Snaps Pokémon out\n" + "of move-binding\n" + "effects."); +#endif static const u8 sChoiceBandDesc[] = _( "Raises a move's\n" From 3066e09e6806f337bd297fa601d21018c624d479 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 4 Sep 2021 08:43:33 -0400 Subject: [PATCH 03/17] decap pokemon in mental herb --- src/data/text/item_descriptions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/text/item_descriptions.h b/src/data/text/item_descriptions.h index 83edfdbdb..941ff50bb 100644 --- a/src/data/text/item_descriptions.h +++ b/src/data/text/item_descriptions.h @@ -1044,7 +1044,7 @@ static const u8 sSootheBellDesc[] = _( #ifdef BATTLE_ENGINE static const u8 sMentalHerbDesc[] = _( "A hold item that\n" - "snaps POKéMON out\n" + "snaps Pokémon out\n" "of infatuation."); #else static const u8 sMentalHerbDesc[] = _( From 376b65f6bf2a71eadbe89f46a478d3de307a3c3f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 4 Sep 2021 15:36:47 -0300 Subject: [PATCH 04/17] Update hold_effects.h --- include/constants/hold_effects.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index 3afad4f55..13e886944 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -134,6 +134,7 @@ #define HOLD_EFFECT_LUMINOUS_MOSS 142 #define HOLD_EFFECT_SNOWBALL 143 #define HOLD_EFFECT_WEAKNESS_POLICY 144 +#define HOLD_EFFECT_PRIMAL_ORB 145 // Gen7 hold effects #define HOLD_EFFECT_PROTECTIVE_PADS 154 From 136fbb58623f40657a7e96f828d7aef2b366ec37 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Mon, 20 Sep 2021 21:33:50 -0400 Subject: [PATCH 05/17] fix swapped descs --- src/data/text/item_descriptions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/text/item_descriptions.h b/src/data/text/item_descriptions.h index 941ff50bb..98328b374 100644 --- a/src/data/text/item_descriptions.h +++ b/src/data/text/item_descriptions.h @@ -1041,7 +1041,7 @@ static const u8 sSootheBellDesc[] = _( "calms spirits and\n" "fosters friendship."); -#ifdef BATTLE_ENGINE +#ifndef BATTLE_ENGINE static const u8 sMentalHerbDesc[] = _( "A hold item that\n" "snaps Pokémon out\n" From 4aeeb713939af8701dd4ac1c69b156cd02bcbbc9 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 24 Sep 2021 08:57:10 -0400 Subject: [PATCH 06/17] dream ball checks comatose --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7580d0ef0..216934229 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9958,7 +9958,7 @@ static void Cmd_handleballthrow(void) break; case ITEM_DREAM_BALL: #if I_DREAM_BALL_MODIFIER >= GEN_8 - if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP) + if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE)) ballMultiplier = 40; #else ballMultiplier = 10; From 9ab29e993c6b3d29c404b25ffef07ae303f3313f Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 24 Sep 2021 08:58:51 -0400 Subject: [PATCH 07/17] add battle engine define check --- src/battle_script_commands.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 216934229..f9f7c4fb9 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9958,8 +9958,12 @@ static void Cmd_handleballthrow(void) break; case ITEM_DREAM_BALL: #if I_DREAM_BALL_MODIFIER >= GEN_8 + #ifdef BATTLE_ENGINE if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE)) + #else + if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP) ballMultiplier = 40; + #endif #else ballMultiplier = 10; #endif From ab08ef18f7403f5344e4cfb20eb9ba874a529de5 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 25 Sep 2021 20:42:34 -0300 Subject: [PATCH 08/17] Update battle_script_commands.c --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f9f7c4fb9..79fa8ce55 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9959,7 +9959,7 @@ static void Cmd_handleballthrow(void) case ITEM_DREAM_BALL: #if I_DREAM_BALL_MODIFIER >= GEN_8 #ifdef BATTLE_ENGINE - if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE)) + if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP || GetBattlerAbility(gBattlerTarget) == ABILITY_COMATOSE) #else if (gBattleMons[gBattlerTarget].status1 & STATUS1_SLEEP) ballMultiplier = 40; From 813d1141323d03840342e0b2d5296806be698d02 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 25 Sep 2021 20:58:07 -0300 Subject: [PATCH 09/17] Synced include/constants/hold_effects.h with the BE --- include/constants/hold_effects.h | 8 +++++++- src/battle_util.c | 4 ++-- src/data/items.h | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index 13e886944..3dc4a1389 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -29,7 +29,7 @@ #define HOLD_EFFECT_EXP_SHARE 25 #define HOLD_EFFECT_QUICK_CLAW 26 #define HOLD_EFFECT_FRIENDSHIP_UP 27 -#define HOLD_EFFECT_CURE_ATTRACT 28 +#define HOLD_EFFECT_MENTAL_HERB 28 #define HOLD_EFFECT_CHOICE_BAND 29 #define HOLD_EFFECT_FLINCH 30 #define HOLD_EFFECT_BUG_POWER 31 @@ -154,4 +154,10 @@ #define HOLD_EFFECT_CHOICE(holdEffect)((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SCARF || holdEffect == HOLD_EFFECT_CHOICE_SPECS)) +// Terrain seed params +#define HOLD_EFFECT_PARAM_ELECTRIC_TERRAIN 0 +#define HOLD_EFFECT_PARAM_GRASSY_TERRAIN 1 +#define HOLD_EFFECT_PARAM_MISTY_TERRAIN 2 +#define HOLD_EFFECT_PARAM_PSYCHIC_TERRAIN 3 + #endif // GUARD_HOLD_EFFECTS_H diff --git a/src/battle_util.c b/src/battle_util.c index cbcd445b7..a9099c8f8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3666,7 +3666,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) effect = ITEM_STATUS_CHANGE; } break; - case HOLD_EFFECT_CURE_ATTRACT: + case HOLD_EFFECT_MENTAL_HERB: if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION) { gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION); @@ -3769,7 +3769,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) effect = ITEM_EFFECT_OTHER; } break; - case HOLD_EFFECT_CURE_ATTRACT: + case HOLD_EFFECT_MENTAL_HERB: if (gBattleMons[battlerId].status2 & STATUS2_INFATUATION) { gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION); diff --git a/src/data/items.h b/src/data/items.h index 4f780a5b7..f1718a7e3 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -2640,7 +2640,7 @@ const struct Item gItems[] = .name = _("Mental Herb"), .itemId = ITEM_MENTAL_HERB, .price = 4000, - .holdEffect = HOLD_EFFECT_CURE_ATTRACT, + .holdEffect = HOLD_EFFECT_MENTAL_HERB, .description = sMentalHerbDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, From a49676ab5517eb332c39cd99a65d1778b804dd1d Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 25 Sep 2021 21:09:38 -0300 Subject: [PATCH 10/17] Set the right holdEffectParam to the terrain seeds --- src/data/items.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/items.h b/src/data/items.h index f1718a7e3..1a9fca56c 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -6939,6 +6939,7 @@ const struct Item gItems[] = .itemId = ITEM_ELECTRIC_SEED, .price = 4000, .holdEffect = HOLD_EFFECT_SEEDS, + .holdEffectParam = HOLD_EFFECT_PARAM_ELECTRIC_TERRAIN, .description = sElectricSeedDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -6951,6 +6952,7 @@ const struct Item gItems[] = .itemId = ITEM_GRASSY_SEED, .price = 4000, .holdEffect = HOLD_EFFECT_SEEDS, + .holdEffectParam = HOLD_EFFECT_PARAM_GRASSY_TERRAIN, .description = sGrassySeedDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -6963,6 +6965,7 @@ const struct Item gItems[] = .itemId = ITEM_MISTY_SEED, .price = 4000, .holdEffect = HOLD_EFFECT_SEEDS, + .holdEffectParam = HOLD_EFFECT_PARAM_MISTY_TERRAIN, .description = sMistySeedDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -6975,6 +6978,7 @@ const struct Item gItems[] = .itemId = ITEM_PSYCHIC_SEED, .price = 4000, .holdEffect = HOLD_EFFECT_SEEDS, + .holdEffectParam = HOLD_EFFECT_PARAM_PSYCHIC_TERRAIN, .description = sPsychicSeedDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, From 4fbe4da7d02ccf5c266cf648805f5f5be46f84ca Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 26 Sep 2021 18:46:34 -0300 Subject: [PATCH 11/17] Sitrus Berry Gen4+ heal. Credit to SBird1337 --- include/constants/item_config.h | 1 + include/constants/item_effects.h | 7 ++++--- src/data/pokemon/item_effects.h | 4 ++++ src/pokemon.c | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/constants/item_config.h b/include/constants/item_config.h index 4df5fab18..59f3ceb39 100644 --- a/include/constants/item_config.h +++ b/include/constants/item_config.h @@ -17,6 +17,7 @@ #define I_KEY_FOSSILS GEN_7 // In Gen4+, all Gen 3 fossils became regular items. #define I_KEY_ESCAPE_ROPE GEN_7 // In Gen8, Escape Rope became a Key Item. Keep in mind, this will make it free to buy in marts. #define I_LEGACY_HEALING_ITEMS GEN_7 // In Gen7+, certain healing items recover less HP than they used to. +#define I_SITRUS_BERRY_HEAL GEN_7 // In Gen4+, Sitrus Berry was changed from healing 30 HP to healing 25% of Max HP. // Ball config #define I_LURE_BALL_MODIFIER GEN_7 // In Gen7+, Lure Ball's catch multiplier is x5 instead of x3. diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h index 0a96b9e44..ee7461c4f 100644 --- a/include/constants/item_effects.h +++ b/include/constants/item_effects.h @@ -55,9 +55,10 @@ #define ITEM_EFFECT_ARG_START 6 // Special HP recovery amounts for ITEM4_HEAL_HP -#define ITEM6_HEAL_HP_FULL ((u8) -1) -#define ITEM6_HEAL_HP_HALF ((u8) -2) -#define ITEM6_HEAL_HP_LVL_UP ((u8) -3) +#define ITEM6_HEAL_HP_FULL ((u8) -1) +#define ITEM6_HEAL_HP_HALF ((u8) -2) +#define ITEM6_HEAL_HP_LVL_UP ((u8) -3) +#define ITEM6_HEAL_HP_QUARTER ((u8) -4) // Special PP recovery amounts for ITEM4_HEAL_PP #define ITEM6_HEAL_PP_FULL 0x7F diff --git a/src/data/pokemon/item_effects.h b/src/data/pokemon/item_effects.h index 9fc10dbd0..60e577238 100644 --- a/src/data/pokemon/item_effects.h +++ b/src/data/pokemon/item_effects.h @@ -440,7 +440,11 @@ const u8 gItemEffect_LumBerry[6] = { const u8 gItemEffect_SitrusBerry[7] = { [4] = ITEM4_HEAL_HP, +#if I_SITRUS_BERRY_HEAL >= GEN_4 + [6] = ITEM6_HEAL_HP_QUARTER, +#else [6] = 30, // Amount of HP to recover +#endif }; #define EV_BERRY_FRIENDSHIP_CHANGE \ diff --git a/src/pokemon.c b/src/pokemon.c index ae9f02500..e9c50fb66 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4989,6 +4989,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov case ITEM6_HEAL_HP_LVL_UP: dataUnsigned = gBattleScripting.levelUpHP; break; + case ITEM6_HEAL_HP_QUARTER: + dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL) / 4; + if (dataUnsigned == 0) + dataUnsigned = 1; + break; } // Only restore HP if not at max health From 91feaecb04e2e567042d4de5db911f4384263578 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 26 Sep 2021 23:45:39 -0300 Subject: [PATCH 12/17] Hold effect update --- src/data/items.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index 1a9fca56c..83a8482f3 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1852,8 +1852,13 @@ const struct Item gItems[] = .name = _("Sitrus Berry"), .itemId = ITEM_SITRUS_BERRY, .price = 20, - .holdEffect = HOLD_EFFECT_RESTORE_HP, - .holdEffectParam = 30, + #if I_SITRUS_BERRY_HEAL >= GEN 4 + .holdEffect = HOLD_EFFECT_RESTORE_PCT_HP, + .holdEffectParam = 25, + #else + .holdEffect = HOLD_EFFECT_RESTORE_HP, + .holdEffectParam = 30, + #endif .description = sSitrusBerryDesc, .pocket = POCKET_BERRIES, .type = ITEM_USE_PARTY_MENU, From ff24b15241ac32c3ffb4ad39e9681b02f7907dfd Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 27 Sep 2021 00:00:24 -0300 Subject: [PATCH 13/17] derp --- src/data/items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/items.h b/src/data/items.h index 83a8482f3..23d79b3da 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1852,7 +1852,7 @@ const struct Item gItems[] = .name = _("Sitrus Berry"), .itemId = ITEM_SITRUS_BERRY, .price = 20, - #if I_SITRUS_BERRY_HEAL >= GEN 4 + #if I_SITRUS_BERRY_HEAL >= GEN_4 .holdEffect = HOLD_EFFECT_RESTORE_PCT_HP, .holdEffectParam = 25, #else From de358946694d70037437ba843276bcff990fca95 Mon Sep 17 00:00:00 2001 From: ultima-soul Date: Mon, 27 Sep 2021 14:26:07 -0700 Subject: [PATCH 14/17] Enable Mental Herb description toggling based on B_MENTAL_HERB config. --- src/data/text/item_descriptions.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/text/item_descriptions.h b/src/data/text/item_descriptions.h index 98328b374..bf34c8f44 100644 --- a/src/data/text/item_descriptions.h +++ b/src/data/text/item_descriptions.h @@ -1041,16 +1041,16 @@ static const u8 sSootheBellDesc[] = _( "calms spirits and\n" "fosters friendship."); -#ifndef BATTLE_ENGINE -static const u8 sMentalHerbDesc[] = _( - "A hold item that\n" - "snaps Pokémon out\n" - "of infatuation."); -#else +#if defined(BATTLE_ENGINE) && B_MENTAL_HERB >= GEN_5 static const u8 sMentalHerbDesc[] = _( "Snaps Pokémon out\n" "of move-binding\n" "effects."); +#else +static const u8 sMentalHerbDesc[] = _( + "A hold item that\n" + "snaps Pokémon out\n" + "of infatuation."); #endif static const u8 sChoiceBandDesc[] = _( From c3087de7121404bf245d961374ad7855b4fc1f9e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Tue, 28 Sep 2021 22:13:39 -0300 Subject: [PATCH 15/17] Fixed Coba Berry's typing --- src/data/items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/items.h b/src/data/items.h index 1a9fca56c..37e3d467e 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -2374,7 +2374,7 @@ const struct Item gItems[] = .itemId = ITEM_COBA_BERRY, .price = 20, .holdEffect = HOLD_EFFECT_RESIST_BERRY, - .holdEffectParam = TYPE_FIGHTING, + .holdEffectParam = TYPE_FLYING, .description = sCobaBerryDesc, .pocket = POCKET_BERRIES, .type = ITEM_USE_BAG_MENU, From 50ab03e9c1a879c836b92ba5cc38a27a12ae04db Mon Sep 17 00:00:00 2001 From: ultima-soul Date: Sun, 3 Oct 2021 09:39:26 -0700 Subject: [PATCH 16/17] Assign FORM_ITEM_USE constants to secondaryId for appropriate items. --- src/data/items.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index 37e3d467e..c5f405451 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1191,12 +1191,12 @@ const struct Item gItems[] = .itemId = ITEM_ESCAPE_ROPE, .description = sEscapeRopeDesc, #if I_KEY_ESCAPE_ROPE >= GEN_8 - .price = 0, - .importance = 1, - .pocket = POCKET_KEY_ITEMS, + .price = 0, + .importance = 1, + .pocket = POCKET_KEY_ITEMS, #else - .price = 1000, - .pocket = POCKET_ITEMS, + .price = 1000, + .pocket = POCKET_ITEMS, #endif .type = ITEM_USE_FIELD, .fieldUseFunc = ItemUseOutOfBattle_EscapeRope, @@ -1504,6 +1504,7 @@ const struct Item gItems[] = #ifdef POKEMON_EXPANSION .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + .secondaryId = FORM_ITEM_USE, #else .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -1521,6 +1522,7 @@ const struct Item gItems[] = #ifdef POKEMON_EXPANSION .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + .secondaryId = FORM_ITEM_USE, #else .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -1538,6 +1540,7 @@ const struct Item gItems[] = #ifdef POKEMON_EXPANSION .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + .secondaryId = FORM_ITEM_USE, #else .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -1555,6 +1558,7 @@ const struct Item gItems[] = #ifdef POKEMON_EXPANSION .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange_ConsumedOnUse, + .secondaryId = FORM_ITEM_USE, #else .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, @@ -5355,6 +5359,7 @@ const struct Item gItems[] = #ifdef POKEMON_EXPANSION .type = ITEM_USE_PARTY_MENU, .fieldUseFunc = ItemUseOutOfBattle_FormChange, + .secondaryId = FORM_ITEM_USE_TIME, #else .type = ITEM_USE_BAG_MENU, .fieldUseFunc = ItemUseOutOfBattle_CannotUse, From fd9b2eddbef25ea952bd9ffc0a084192ff121c12 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 4 Oct 2021 19:05:47 -0300 Subject: [PATCH 17/17] Update src/data/items.h Co-authored-by: ultima-soul <33333039+ultima-soul@users.noreply.github.com> --- src/data/items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/items.h b/src/data/items.h index 23d79b3da..63760acfe 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1852,7 +1852,7 @@ const struct Item gItems[] = .name = _("Sitrus Berry"), .itemId = ITEM_SITRUS_BERRY, .price = 20, - #if I_SITRUS_BERRY_HEAL >= GEN_4 + #if defined(BATTLE_ENGINE) && I_SITRUS_BERRY_HEAL >= GEN_4 .holdEffect = HOLD_EFFECT_RESTORE_PCT_HP, .holdEffectParam = 25, #else