#include "macros/btlcmd.inc"


_000:
    IfMovedThisTurn BTLSCR_SIDE_EFFECT_MON, _025
    CheckSubstitute BTLSCR_SIDE_EFFECT_MON, _045
    CheckIgnorableAbility CHECK_HAVE, BTLSCR_SIDE_EFFECT_MON, ABILITY_INNER_FOCUS, _026
    CompareVarToValue OPCODE_NEQ, BTLVAR_SIDE_EFFECT_TYPE, SIDE_EFFECT_TYPE_INDIRECT, _020
    CheckIgnorableAbility CHECK_HAVE, BTLSCR_SIDE_EFFECT_MON, ABILITY_SHIELD_DUST, _025

_020:
    UpdateMonData OPCODE_FLAG_ON, BTLSCR_SIDE_EFFECT_MON, BATTLEMON_VOLATILE_STATUS, VOLATILE_CONDITION_FLINCH

_025:
    End 

_026:
    CompareVarToValue OPCODE_EQU, BTLVAR_CURRENT_MOVE, MOVE_FAKE_OUT, _036
    CompareVarToValue OPCODE_NEQ, BTLVAR_SIDE_EFFECT_TYPE, SIDE_EFFECT_TYPE_DIRECT, _044

_036:
    // {0} won’t flinch because of its {1}!
    PrintMessage pl_msg_00000368_00737, TAG_NICKNAME_ABILITY, BTLSCR_SIDE_EFFECT_MON, BTLSCR_SIDE_EFFECT_MON
    Wait 
    WaitButtonABTime 30

_044:
    End 

_045:
    CompareVarToValue OPCODE_NEQ, BTLVAR_SIDE_EFFECT_TYPE, SIDE_EFFECT_TYPE_DIRECT, _054
    UpdateVar OPCODE_FLAG_ON, BTLVAR_MOVE_STATUS_FLAGS, MOVE_STATUS_FAILED

_054:
    End 
