# 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/shieldaction.py
# class SHIELD_ACTION(Enum):
#     PSSHINE = 0
#     PSUTILT = 1
#     PSDTILT = 2
#     PSJAB = 3


import melee
import Chains
import math
from melee.enums import Action, Button, Character
from Tactics.tactic import Tactic
from Chains.smashattack import SMASH_DIRECTION
from Chains.shffl import SHFFL_DIRECTION
from Chains.shieldaction import SHIELD_ACTION
            speed = opponent_state.speed_y_attack
            gravity = self.framedata.characterdata[opponent_state.character]["Gravity"]
            termvelocity = self.framedata.characterdata[opponent_state.character]["TerminalVelocity"]
            if not opponent_state.on_ground and not firefox:
                # Loop through each frame and count the distances
                for i in range(framesleft):
                    speed -= gravity
                    # We can't go faster than termvelocity downwards
                    speed = max(speed, -termvelocity)
                    height += speed

            distance = abs(endposition - smashbot_endposition)
            x = 1
            # If we are really close to the edge, wavedash straight down
            if melee.stages.EDGE_GROUND_POSITION[gamestate.stage] - abs(smashbot_state.position.x) < 3:
                x = 0
            # This makes Smashbot wavedash down if he shines the opponent outwards near the ledge.
            if abs(opponent_state.position.x) + 41 > melee.stages.EDGE_GROUND_POSITION[gamestate.stage] and abs(opponent_state.position.x) > abs(smashbot_state.position.x):
                x = 0

            if not slideoff and distance < 14.5 and -5 < height < 8:
                # If Smashbot is in the corner and below usmash kill %, he will opt to waveshine them back towards center rather than usmash
                if abs(smashbot_state.position.x) + 42 > melee.stages.EDGE_GROUND_POSITION[gamestate.stage] and opponent_state.percent < 89 and abs(opponent_state.position.x) < abs(smashbot_state.position.x) and gamestate.distance < 9.9:
                    self.pickchain(Chains.Waveshine, [x])
                    return
                if facing:
                    self.chain = None
                    # Do the upsmash
                    # NOTE: If we get here, we want to delete the chain and start over
                    #   Since the amount we need to charge may have changed

# 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/shieldaction.py
# class SHIELD_ACTION(Enum):
#     PSSHINE = 0
#     PSUTILT = 1
#     PSDTILT = 2
#     PSJAB = 3


# Path: Tactics/punish.py
import melee
import Chains
import math
from melee.enums import Action, Button, Character
from Tactics.tactic import Tactic
from Chains.smashattack import SMASH_DIRECTION
from Chains.shffl import SHFFL_DIRECTION
from Chains.shieldaction import SHIELD_ACTION

            speed = opponent_state.speed_y_attack
            gravity = self.framedata.characterdata[opponent_state.character]["Gravity"]
            termvelocity = self.framedata.characterdata[opponent_state.character]["TerminalVelocity"]
            if not opponent_state.on_ground and not firefox:
                # Loop through each frame and count the distances
                for i in range(framesleft):
                    speed -= gravity
                    # We can't go faster than termvelocity downwards
                    speed = max(speed, -termvelocity)
                    height += speed

            distance = abs(endposition - smashbot_endposition)
            x = 1
            # If we are really close to the edge, wavedash straight down
            if melee.stages.EDGE_GROUND_POSITION[gamestate.stage] - abs(smashbot_state.position.x) < 3:
                x = 0
            # This makes Smashbot wavedash down if he shines the opponent outwards near the ledge.
            if abs(opponent_state.position.x) + 41 > melee.stages.EDGE_GROUND_POSITION[gamestate.stage] and abs(opponent_state.position.x) > abs(smashbot_state.position.x):
                x = 0

            if not slideoff and distance < 14.5 and -5 < height < 8:
                # If Smashbot is in the corner and below usmash kill %, he will opt to waveshine them back towards center rather than usmash
                if abs(smashbot_state.position.x) + 42 > melee.stages.EDGE_GROUND_POSITION[gamestate.stage] and opponent_state.percent < 89 and abs(opponent_state.position.x) < abs(smashbot_state.position.x) and gamestate.distance < 9.9:
                    self.pickchain(Chains.Waveshine, [x])
                    return
                if facing:
                    self.chain = None
                    # Do the upsmash
                    # NOTE: If we get here, we want to delete the chain and start over
                    #   Since the amount we need to charge may have changed

                    self.pickchain(Chains.SmashAttack, [framesleft-framesneeded-1, SMASH_DIRECTION.UP])