From dde65d5cea2e8a89cdd91e24483bae5557ac4cfc Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 13 Feb 2022 01:07:42 -0300 Subject: [PATCH] =?UTF-8?q?Config=20for=20Sheer=20Cold=20being=20less=20ac?= =?UTF-8?q?curate=20when=20not=20used=20by=20Ice=20type=20Pok=C3=A9mon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/constants/battle_config.h | 1 + src/battle_script_commands.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 4aa4bebddf..ab70634a8c 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -159,6 +159,7 @@ #define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss. #define B_MINIMIZE_DMG_ACC GEN_7 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. #define B_BLIZZARD_HAIL GEN_7 // In Gen4+, Blizzard bypasses accuracy checks if it's hailing. +#define B_SHEER_COLD_ACC GEN_7 // In Gen7+, Sheer Cold's base chance of hitting is reduced to 20% if the user isn't Ice-typed. // Other move settings #define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 00be0d2f25..75357dbedc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10728,6 +10728,10 @@ static void Cmd_tryKO(void) else { u16 odds = gBattleMoves[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); + #if B_SHEER_COLD_ACC >= GEN_7 + if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) + odds -= 10; + #endif if (Random() % 100 + 1 < odds && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) lands = TRUE; }