From 671cbabc3daa2fe217e26fa1598778f2c418ab7f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 4 Nov 2021 17:18:26 -0300 Subject: [PATCH] Added a battle config for the Soul Dew --- include/constants/battle_config.h | 1 + src/battle_util.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 41fee089d..792d12a9b 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -166,6 +166,7 @@ #define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1. #define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. +#define B_SOUL_DEW_BOOST GEN_7 // In Gens3-6, Soul Dew boosts the power of Lati@s' stats. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. diff --git a/src/battle_util.c b/src/battle_util.c index 5a9d47df9..f2b186002 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8059,7 +8059,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe MulModifier(&modifier, holdEffectModifier); break; case HOLD_EFFECT_SOUL_DEW: - if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER)) + if (((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) + && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && B_SOUL_DEW_BOOST <= GEN_6) + || ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) + && (moveType == TYPE_PSYCHIC || moveType == TYPE_DRAGON) && B_SOUL_DEW_BOOST >= GEN_7)) MulModifier(&modifier, holdEffectModifier); break; case HOLD_EFFECT_GEMS: