From 2c2b807a57561a5cf9cfce88995b37700bc2634c Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 5 Aug 2019 11:48:50 +0200 Subject: [PATCH] Special Def boost for rock types in sandstorm --- src/battle_util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index 403a233eb8..8846107c20 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5749,6 +5749,10 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, break; } + // sandstorm sp.def boost for rock types + if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ROCK) && !usesDefStat) + MulModifier(&modifier, UQ_4_12(1.5)); + return ApplyModifier(modifier, defStat); }