diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 89d2292cc..354dde4f0 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8498,6 +8498,13 @@ BattleScript_ObliviousPreventsAttraction:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_FlinchPrevention:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSXPREVENTSFLINCHING + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + BattleScript_OwnTempoPrevents:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 5fd70159b..4134a87dc 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -169,6 +169,7 @@ extern const u8 BattleScript_BRNPrevention[]; extern const u8 BattleScript_PRLZPrevention[]; extern const u8 BattleScript_PSNPrevention[]; extern const u8 BattleScript_ObliviousPreventsAttraction[]; +extern const u8 BattleScript_FlinchPrevention[]; extern const u8 BattleScript_OwnTempoPrevents[]; extern const u8 BattleScript_SoundproofProtected[]; extern const u8 BattleScript_AbilityNoSpecificStatLoss[]; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ef8c5a764..f64b57d66 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2941,7 +2941,17 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_FLINCH: if (battlerAbility == ABILITY_INNER_FOCUS) { - gBattlescriptCurrInstr++; + if (primary == TRUE || certain == MOVE_EFFECT_CERTAIN) + { + gLastUsedAbility = ABILITY_INNER_FOCUS; + gBattlerAbility = gEffectBattler; + RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS); + gBattlescriptCurrInstr = BattleScript_FlinchPrevention; + } + else + { + gBattlescriptCurrInstr++; + } } else {