From 64031dd672b17451027a95293866cde5ec1d4775 Mon Sep 17 00:00:00 2001 From: Eduardo Alvaro Quezada D'Ottone Date: Sat, 14 Mar 2020 08:15:36 -0300 Subject: [PATCH] Option for Toxic never missing if user is Poison type. (#304) --- include/constants/battle_config.h | 3 ++- src/battle_script_commands.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 2f025053d..0baf5d4fc 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -57,7 +57,8 @@ // Move settings #define B_FELL_STINGER_STAT_RAISE GEN_6 // Gen6 Atk+2, Gen7 Atk+3. -#define B_SOUND_SUBSTITUTE GEN_6 // Starting from gen6 sound moves bypass Substitute. +#define B_SOUND_SUBSTITUTE GEN_6 // Starting from Gen6 sound moves bypass Substitute. +#define B_TOXIC_NEVER_MISS GEN_6 // Starting from Gen6, if Toxic is used by a Poison type, it will never miss. // Ability settings #define B_ABILITY_POP_UP GEN_6 // Starting from gen5, the pokemon abilities are displayed in a pop-up, when they activate in battle. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index cdffeaf7f..eb4224955 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1197,7 +1197,9 @@ static bool32 AccuracyCalcHelper(u16 move) JumpIfMoveFailed(7, move); return TRUE; } - else if (gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_POISON)) + else if (B_TOXIC_NEVER_MISS >= GEN_6 + && gBattleMoves[move].effect == EFFECT_TOXIC + && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_POISON)) { JumpIfMoveFailed(7, move); return TRUE;