Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Marth counter
if character == Character.MARTH and action == Action.MARTH_COUNTER:
return True
if character == Character.MARTH and action == Action.MARTH_COUNTER_FALLING:
return True
# Turns out that the actions we'd call a "roll" are fairly few. Let's just
# hardcode them since it's just more cumbersome to do otherwise
rolls = [Action.SPOTDODGE, Action.ROLL_FORWARD, Action.ROLL_BACKWARD, \
Action.NEUTRAL_TECH, Action.FORWARD_TECH, Action.BACKWARD_TECH, \
Action.GROUND_GETUP, Action.TECH_MISS_UP, Action.TECH_MISS_DOWN, \
Action.EDGE_GETUP_SLOW, Action.EDGE_GETUP_QUICK, Action.EDGE_ROLL_SLOW, \
Action.EDGE_ROLL_QUICK, Action.GROUND_ROLL_FORWARD_UP, Action.GROUND_ROLL_BACKWARD_UP, \
Action.GROUND_ROLL_FORWARD_DOWN, Action.GROUND_ROLL_BACKWARD_DOWN, Action.SHIELD_BREAK_FLY, \
Action.SHIELD_BREAK_FALL, Action.SHIELD_BREAK_DOWN_U, Action.SHIELD_BREAK_DOWN_D, \
Action.SHIELD_BREAK_STAND_U, Action.SHIELD_BREAK_STAND_D, Action.TAUNT_RIGHT, Action.TAUNT_LEFT, Action.SHIELD_BREAK_TEETER]
return action in rolls
self.player[i].hitstun_frames_left = self.player[i+4].hitstun_frames_left
self.player[i].charging_smash = self.player[i+4].charging_smash
self.player[i].jumps_left = self.player[i+4].jumps_left
self.player[i].on_ground = self.player[i+4].on_ground
self.player[i].speed_air_x_self = self.player[i+4].speed_air_x_self
self.player[i].speed_y_self = self.player[i+4].speed_y_self
self.player[i].speed_x_attack = self.player[i+4].speed_x_attack
self.player[i].speed_y_attack = self.player[i+4].speed_y_attack
self.player[i].speed_ground_x_self = self.player[i+4].speed_ground_x_self
self.player[i].x = self.player[i+4].x
self.player[i].y = self.player[i+4].y
self.player[i].percent = self.player[i+4].percent
self.player[i].facing = self.player[i+4].facing
# The pre-warning occurs when we first start a dash dance.
if self.player[i].action == Action.DASHING and self.player[i].prev_action not in [Action.DASHING, Action.TURNING]:
self.player[i].moonwalkwarning = True
# Take off the warning if the player does an action other than dashing
if self.player[i].action != Action.DASHING:
self.player[i].moonwalkwarning = False
#TODO: This needs updating in order to support >2 players
xdist = self.ai_state.x - self.opponent_state.x
ydist = self.ai_state.y - self.opponent_state.y
self.distance = math.sqrt( (xdist**2) + (ydist**2) )
self.fixiasa()
self.fixframeindexing()
return True
if label == "stage":
self.stage = unpack('> 16
def isbmove(self, character, action):
# If we're missing it, don't call it a B move
if action == Action.UNKNOWN_ANIMATION:
return False
# Don't consider peach float to be a B move
# But the rest of her float aerials ARE
if character == Character.PEACH and action in [Action.LASER_GUN_PULL, \
Action.NEUTRAL_B_CHARGING, Action.NEUTRAL_B_ATTACKING]:
return False
# Peach smashes also shouldn't be B moves
if character == Character.PEACH and action in [Action.SWORD_DANCE_2_MID, Action.SWORD_DANCE_1, \
Action.SWORD_DANCE_2_HIGH]:
return False
if Action.LASER_GUN_PULL.value <= action.value:
return True
return False
def isroll(self, character, action):
# Marth counter
if character == Character.MARTH and action == Action.MARTH_COUNTER:
return True
if character == Character.MARTH and action == Action.MARTH_COUNTER_FALLING:
return True
# Turns out that the actions we'd call a "roll" are fairly few. Let's just
# hardcode them since it's just more cumbersome to do otherwise
rolls = [Action.SPOTDODGE, Action.ROLL_FORWARD, Action.ROLL_BACKWARD, \
Action.NEUTRAL_TECH, Action.FORWARD_TECH, Action.BACKWARD_TECH, \
Action.GROUND_GETUP, Action.TECH_MISS_UP, Action.TECH_MISS_DOWN, \
Action.EDGE_GETUP_SLOW, Action.EDGE_GETUP_QUICK, Action.EDGE_ROLL_SLOW, \
Action.EDGE_ROLL_QUICK, Action.GROUND_ROLL_FORWARD_UP, Action.GROUND_ROLL_BACKWARD_UP, \
Action.GROUND_ROLL_FORWARD_DOWN, Action.GROUND_ROLL_BACKWARD_DOWN, Action.SHIELD_BREAK_FLY, \
Action.SHIELD_BREAK_FALL, Action.SHIELD_BREAK_DOWN_U, Action.SHIELD_BREAK_DOWN_D, \
Action.SHIELD_BREAK_STAND_U, Action.SHIELD_BREAK_STAND_D, Action.TAUNT_RIGHT, Action.TAUNT_LEFT, Action.SHIELD_BREAK_TEETER]
return action in rolls
def isroll(self, character, action):
# Marth counter
if character == Character.MARTH and action == Action.MARTH_COUNTER:
return True
if character == Character.MARTH and action == Action.MARTH_COUNTER_FALLING:
return True
# Turns out that the actions we'd call a "roll" are fairly few. Let's just
# hardcode them since it's just more cumbersome to do otherwise
rolls = [Action.SPOTDODGE, Action.ROLL_FORWARD, Action.ROLL_BACKWARD, \
Action.NEUTRAL_TECH, Action.FORWARD_TECH, Action.BACKWARD_TECH, \
Action.GROUND_GETUP, Action.TECH_MISS_UP, Action.TECH_MISS_DOWN, \
Action.EDGE_GETUP_SLOW, Action.EDGE_GETUP_QUICK, Action.EDGE_ROLL_SLOW, \
Action.EDGE_ROLL_QUICK, Action.GROUND_ROLL_FORWARD_UP, Action.GROUND_ROLL_BACKWARD_UP, \
Action.GROUND_ROLL_FORWARD_DOWN, Action.GROUND_ROLL_BACKWARD_DOWN, Action.SHIELD_BREAK_FLY, \
Action.SHIELD_BREAK_FALL, Action.SHIELD_BREAK_DOWN_U, Action.SHIELD_BREAK_DOWN_D, \
Action.SHIELD_BREAK_STAND_U, Action.SHIELD_BREAK_STAND_D, Action.TAUNT_RIGHT, Action.TAUNT_LEFT, Action.SHIELD_BREAK_TEETER]
return action in rolls