How to use the melee.enums.Character.ZELDA function in melee

To help you get started, we’ve selected a few melee examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github altf4 / libmelee / melee / gamestate.py View on Github external
self.player[i].off_stage = True
                else:
                    self.player[i].off_stage = False

                # Keep track of a player's invulnerability due to respawn or ledge grab
                self.player[i].invulnerability_left = max(0, self.player[i].invulnerability_left - 1)
                if self.player[i].action == Action.ON_HALO_WAIT:
                    self.player[i].invulnerability_left = 120
                # Don't give invulnerability to the first descent
                if self.player[i].action == Action.ON_HALO_DESCENT and self.frame > 150:
                    self.player[i].invulnerability_left = 120
                if self.player[i].action == Action.EDGE_CATCHING and self.player[i].action_frame == 1:
                    self.player[i].invulnerability_left = 36

                # Which character are we right now?
                if self.player[i].character in [Character.SHEIK, Character.ZELDA]:
                    if self.player[i].transformed == self.player[i].iszelda:
                        self.player[i].character = Character.SHEIK
                    else:
                        self.player[i].character = Character.ZELDA
                # If the player is transformed, then copy over the sub-character attributes
                if self.player[i].transformed:
                    self.player[i].action = self.player[i+4].action
                    self.player[i].action_counter = self.player[i+4].action_counter
                    self.player[i].action_frame = self.player[i+4].action_frame
                    self.player[i].invulnerable = self.player[i+4].invulnerable
                    self.player[i].hitlag_frames_left = self.player[i+4].hitlag_frames_left
                    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
github altf4 / libmelee / melee / gamestate.py View on Github external
# Keep track of a player's invulnerability due to respawn or ledge grab
                self.player[i].invulnerability_left = max(0, self.player[i].invulnerability_left - 1)
                if self.player[i].action == Action.ON_HALO_WAIT:
                    self.player[i].invulnerability_left = 120
                # Don't give invulnerability to the first descent
                if self.player[i].action == Action.ON_HALO_DESCENT and self.frame > 150:
                    self.player[i].invulnerability_left = 120
                if self.player[i].action == Action.EDGE_CATCHING and self.player[i].action_frame == 1:
                    self.player[i].invulnerability_left = 36

                # Which character are we right now?
                if self.player[i].character in [Character.SHEIK, Character.ZELDA]:
                    if self.player[i].transformed == self.player[i].iszelda:
                        self.player[i].character = Character.SHEIK
                    else:
                        self.player[i].character = Character.ZELDA
                # If the player is transformed, then copy over the sub-character attributes
                if self.player[i].transformed:
                    self.player[i].action = self.player[i+4].action
                    self.player[i].action_counter = self.player[i+4].action_counter
                    self.player[i].action_frame = self.player[i+4].action_frame
                    self.player[i].invulnerable = self.player[i+4].invulnerable
                    self.player[i].hitlag_frames_left = self.player[i+4].hitlag_frames_left
                    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