# Path: Chains/smashattack.py
# class SMASH_DIRECTION(Enum):
#     UP = 0
#     DOWN = 1
#     LEFT = 2
#     RIGHT = 3
# 
# Path: Chains/shffl.py
# class SHFFL_DIRECTION(Enum):
#     UP = 0
#     DOWN = 1
#     FORWARD = 2
#     BACK = 3
#     NEUTRAL = 4
# 
# Path: Chains/tilt.py
# class TILT_DIRECTION(Enum):
#     UP = 0
#     DOWN = 1
#     FORWARD = 2


import melee
import Chains
from melee.enums import Action, Character, Stage, ProjectileType
from Tactics.tactic import Tactic
from Chains.smashattack import SMASH_DIRECTION
from Chains.shffl import SHFFL_DIRECTION
from Chains.tilt import TILT_DIRECTION
        if opponent_state.character == Character.CPTFALCON:
            smash_now = opponent_state.action_frame in [4, 12, 20, 27]
        if opponent_state.character == Character.MARTH:
            smash_now = opponent_state.action_frame < 6
        if opponent_state.character == Character.DK:
            smash_now = False

        shadowball = False
        if opponent_state.character == Character.MEWTWO:
            for projectile in gamestate.projectiles:
                if projectile.type in [ProjectileType.SHADOWBALL] and projectile.subtype == 0:
                    shadowball = True
                    smash_now = True

        spacing_grace_zone = 2
        if falling_spacie:
            spacing_grace_zone = 8

        # If spacing and timing is right, do an attack
        if abs(smashbot_state.position.x - pivotpoint) < spacing_grace_zone:
            if smashbot_state.action == Action.TURNING:
                if smash_now and not on_side_plat and not falling_spacie:
                    # For marth, it's actually more reliable to run between slashes
                    if opponent_state.character == Character.MARTH:
                        self.keep_running = True
                        self.pickchain(Chains.Run, [opponent_state.position.x > smashbot_state.position.x])
                        return

                    self.chain = None
                    if opponent_state.position.x < smashbot_state.position.x:

# Path: Chains/smashattack.py
# class SMASH_DIRECTION(Enum):
#     UP = 0
#     DOWN = 1
#     LEFT = 2
#     RIGHT = 3
# 
# Path: Chains/shffl.py
# class SHFFL_DIRECTION(Enum):
#     UP = 0
#     DOWN = 1
#     FORWARD = 2
#     BACK = 3
#     NEUTRAL = 4
# 
# Path: Chains/tilt.py
# class TILT_DIRECTION(Enum):
#     UP = 0
#     DOWN = 1
#     FORWARD = 2


# Path: Tactics/challenge.py
import melee
import Chains
from melee.enums import Action, Character, Stage, ProjectileType
from Tactics.tactic import Tactic
from Chains.smashattack import SMASH_DIRECTION
from Chains.shffl import SHFFL_DIRECTION
from Chains.tilt import TILT_DIRECTION

        if opponent_state.character == Character.CPTFALCON:
            smash_now = opponent_state.action_frame in [4, 12, 20, 27]
        if opponent_state.character == Character.MARTH:
            smash_now = opponent_state.action_frame < 6
        if opponent_state.character == Character.DK:
            smash_now = False

        shadowball = False
        if opponent_state.character == Character.MEWTWO:
            for projectile in gamestate.projectiles:
                if projectile.type in [ProjectileType.SHADOWBALL] and projectile.subtype == 0:
                    shadowball = True
                    smash_now = True

        spacing_grace_zone = 2
        if falling_spacie:
            spacing_grace_zone = 8

        # If spacing and timing is right, do an attack
        if abs(smashbot_state.position.x - pivotpoint) < spacing_grace_zone:
            if smashbot_state.action == Action.TURNING:
                if smash_now and not on_side_plat and not falling_spacie:
                    # For marth, it's actually more reliable to run between slashes
                    if opponent_state.character == Character.MARTH:
                        self.keep_running = True
                        self.pickchain(Chains.Run, [opponent_state.position.x > smashbot_state.position.x])
                        return

                    self.chain = None
                    if opponent_state.position.x < smashbot_state.position.x:

                        self.pickchain(Chains.SmashAttack, [0, SMASH_DIRECTION.LEFT])