Character Script Function #

duck_whiff_punish #

Description: Handles the punishment when the enemy whiffs an attack while the player ducks. If the frames parameter is less than 13, this function simulates pressing the left and right hand buttons for 3 frames each.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for determining the punishment timing.

Usage Example:

    duck_whiff_punish = function(self, enemy, frames)
        print("duck_whiff_punish:" .. frames)
        --Ignore the next attack Combo1 Start
        if frames < 13 then
            executeMacro(0, Input.L_HAND, 3, InputType.KEY_PRESS)
            executeMacro(0, Input.R_HAND, 3, InputType.KEY_PRESS)
            return
        elseif frames < 25 then
            executeMacro(0, Input.L_KICK + Input.R_HAND, 1, InputType.KEY_PRESS)
            return
        end
    end,

Notes:

  • If frames is less than 13, the function simulates a response by pressing the left and right hand buttons.

air_counters #

Description: Handles counters against airborne enemies. This function is currently not implemented.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for determining the counter timing.

Usage Example:

    air_counters = function(self, enemy, frames)
        print("self move_id" .. self.move_id)
    end,

Notes:

  • This function can be extended to handle specific counter actions against enemies in the air.

high_counters #

Description: Handles counters against high attacks. This function is currently not implemented.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for determining the counter timing.

Usage Example:

    high_counters = function(self, enemy, frames)
        print("self move_id" .. self.move_id)
    end,

Notes:

  • This function can be extended to handle specific counter actions against high attacks.

low_counters #

Description: Handles counters against low attacks. This function is currently not implemented.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for determining the counter timing.

Usage Example:

    low_counters = function(self, enemy, frames)
        print("self move_id" .. self.move_id)
    end,

Notes:

  • This function can be extended to handle specific counter actions against low attacks.

mid_counters #

Description: Handles counters against mid attacks. This function is currently not implemented.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for determining the counter timing.

Usage Example:

    mid_counters = function(self, enemy, frames)
        print("self move_id" .. self.move_id)
    end,

Notes:

  • This function can be extended to handle specific counter actions against mid attacks.

onAttackCounter #

Description: Handles actions when an attack counter is triggered. This function is currently not implemented.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for determining the counter timing.

Usage Example:

    onAttackCounter = function(self, enemy, frames)
        print("self move_id" .. self.move_id)
    end,

Notes:

  • This function can be extended to handle specific actions when an attack counter is triggered.

onAttackSuccess #

Description: Handles actions when an attack is successful. This function is currently not implemented.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for determining the success timing.

Usage Example:

    onAttackSuccess = function(self, enemy, frames)
        print("self move_id" .. self.move_id)
    end,

Notes:

  • This function can be extended to handle specific actions when an attack is successful.

OnInitAttackProc #

Description: Handles initialization of attack processing. This function outputs the player's information and can be used for status processing.

Parameters:

  • self: The player object calling the function.
  • enemy: The enemy's snapshot information (of type PlayerSnapshot).
  • frames: The number of frames to use for initialization timing.

Usage Example:

    OnInitAttackProc = function(self, enemy, frames)
        print("self move_id" .. self.move_id)
    end,

Notes:

  • Use this function to output and process player and enemy information.
  • self contains the player's current state and attributes.
  • enemy is a snapshot of the enemy's current state.

PlayerSnapshot Structure #

Description: Represents the snapshot of a player's current state and attributes.

Fields:

  • move_timer: Timer for the current move.
  • move_id: Identifier for the current move.
  • simple_state: Simple state of the player.
  • attack_type: Type of attack currently used.
  • startup: Startup time of the current move.
  • startup_end: End time of the startup phase.
  • attack_damage: Damage dealt by the current attack.
  • complex_state: Complex state of the player.
  • damage_taken: Amount of damage taken.
  • recovery: Recovery time after the move.
  • frames_til_next_move: Frames until the next move.
  • char_id: Identifier for the character.
  • distance: Distance from the enemy.
  • jump_flag: Flag indicating if the player is jumping.
  • throw_tech: Throwing technique used.
  • input_direction: Direction of input.
  • input_attack: Attack input.
  • stun_state: Stun state of the player.
  • hit_outcome: Outcome of the hit.
  • facing: Direction the player is facing.