From 813d1141323d03840342e0b2d5296806be698d02 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 25 Sep 2021 20:58:07 -0300 Subject: [PATCH 1/2] 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 13e8869442..3dc4a1389e 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 cbcd445b7e..a9099c8f8e 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 4f780a5b7a..f1718a7e3e 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 2/2] 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 f1718a7e3e..1a9fca56c1 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,