diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 29b7b57503..8f8d30b568 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -126,6 +126,7 @@ #define B_POWDER_GRASS GEN_7 // In Gen6+, Grass-type Pokémon are immune to powder and spore moves. #define B_STEEL_RESISTANCES GEN_7 // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves. #define B_PRANKSTER_DARK_TYPES GEN_7 // In Gen7+, Prankster-elevated status moves do not affect Dark type Pokémon. +#define B_SHEER_COLD_IMMUNITY GEN_7 // In Gen7+, Ice-types are immune to Sheer Cold // Turn count settings #define B_BINDING_TURNS GEN_7 // In Gen5+, binding moves last for 4-5 turns instead of 2-5 turns. (With Grip Claw, 7 and 5 turns respectively.) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 1c4073706c..fbe25b01c5 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -1216,6 +1216,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_OHKO: + if (B_SHEER_COLD_IMMUNITY >= GEN_7 + && move == MOVE_SHEER_COLD + && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE)) + return 0; if (!ShouldTryOHKO(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, accuracy, move)) score -= 10; break; diff --git a/src/battle_util.c b/src/battle_util.c index 7e2320500c..736e654ac5 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8945,6 +8945,10 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat RecordAbilityBattle(battlerDef, ABILITY_LEVITATE); } } + else if (B_SHEER_COLD_IMMUNITY >= GEN_7 && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE)) + { + modifier = UQ_4_12(0.0); + } // Thousand Arrows ignores type modifiers for flying mons if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)