utils #

Overview #

The utils.lua module provides various utility functions for handling game state, attacks, and movements in a Lua-based game scripting environment. These functions are essential for implementing game logic and responding to different game conditions.

Function List #

  1. IsWSpunish
  2. IsSpecialStatus
  3. GetTimeUntilImpact
  4. IsGettingWallSplatted
  5. IsCrouching
  6. IsGettingGroundHit
  7. IsCrouchBack
  8. IsGettingCounterHit
  9. IsAttackUnblockable
  10. IsAirborne
  11. IsPowerCrush
  12. CanCounter
  13. IsAttackStarting
  14. IsAttackLow
  15. IsAttackMid
  16. IsAttackHigh
  17. IsAttackThrow
  18. IsOnGround
  19. IsBlocking
  20. IsGettingHit
  21. IsPunish
  22. IsMoveChanged
  23. IsWhileStanding
  24. IsStartedBeingThrown
  25. GetActiveFrames
  26. getFa
  27. IsAttackWhiffing
  28. is_Whiffing
  29. get_combo
  30. is_starting_attack

IsWSpunish #

Description: Checks if the player can punish an opponent's attack during a crouch state.

Usage:

local result = utils.IsWSpunish(self, enemy)

Parameters:

  • self (table): The player object.
  • enemy (table): The opponent's attack details.

Returns:

  • true if the player can punish; otherwise, false.

Example:

local canPunish = utils.IsWSpunish(player, opponent)
print(canPunish) -- Output: true or false

IsSpecialStatus #

Description: Checks if the player is in a special status like knockdown or juggle.

Usage:

local result = utils.IsSpecialStatus(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is in a special status; otherwise, false.

Example:

local specialStatus = utils.IsSpecialStatus(player)
print(specialStatus) -- Output: true or false

GetTimeUntilImpact #

Description: Calculates the number of frames until an attack impacts the opponent.

Usage:

local time = utils.GetTimeUntilImpact(attacker)

Parameters:

  • attacker (table): The attacker object.

Returns:

  • The number of frames until impact.

Example:

local timeUntilImpact = utils.GetTimeUntilImpact(attack)
print(timeUntilImpact) -- Output: number of frames

IsGettingWallSplatted #

Description: Checks if the player is currently wall splatted.

Usage:

local result = utils.IsGettingWallSplatted(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is wall splatted; otherwise, false.

Example:

local isWallSplatted = utils.IsGettingWallSplatted(player)
print(isWallSplatted) -- Output: true or false

IsCrouching #

Description: Checks if the player is in a crouching state.

Usage:

local result = utils.IsCrouching(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is crouching; otherwise, false.

Example:

local isCrouching = utils.IsCrouching(player)
print(isCrouching) -- Output: true or false

IsGettingGroundHit #

Description: Checks if the player is grounded and hit.

Usage:

local result = utils.IsGettingGroundHit(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is grounded and hit; otherwise, false.

Example:

local isGroundHit = utils.IsGettingGroundHit(player)
print(isGroundHit) -- Output: true or false

IsCrouchBack #

Description: Checks if the player is in a crouch-back state.

Usage:

local result = utils.IsCrouchBack(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is crouch-back; otherwise, false.

Example:

local isCrouchBack = utils.IsCrouchBack(player)
print(isCrouchBack) -- Output: true or false

IsGettingCounterHit #

Description: Checks if the player is receiving a counter hit.

Usage:

local result = utils.IsGettingCounterHit(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is getting counter hit; otherwise, false.

Example:

local isCounterHit = utils.IsGettingCounterHit(player)
print(isCounterHit) -- Output: true or false

IsAttackUnblockable #

Description: Checks if the attack is unblockable.

Usage:

local result = utils.IsAttackUnblockable(self)

Parameters:

  • self (table): The attack object.

Returns:

  • true if the attack is unblockable; otherwise, false.

Example:

local isUnblockable = utils.IsAttackUnblockable(attack)
print(isUnblockable) -- Output: true or false

IsAirborne #

Description: Checks if the attacker is airborne.

Usage:

local result = utils.IsAirborne(attacker)

Parameters:

  • attacker (table): The attacker object.

Returns:

  • true if the attacker is airborne; otherwise, false.

Example:

local isAirborne = utils.IsAirborne(attacker)
print(isAirborne) -- Output: true or false

IsPowerCrush #

Description: Checks if the move is a Power Crush.

Usage:

local result = utils.IsPowerCrush(self)

Parameters:

  • self (table): The move object.

Returns:

  • true if the move is a Power Crush; otherwise, false.

Example:

local isPowerCrush = utils.IsPowerCrush(move)
print(isPowerCrush) -- Output: true or false

CanCounter #

Description: Determines if a counterattack can be performed based on various conditions.

Usage:

local result = utils.CanCounter(frames, attacker, receiver, airborneOpp)

Parameters:

  • frames (number): The number of frames the attack has.
  • attacker (table): The attacker object.
  • receiver (table): The receiver object.
  • airborneOpp (boolean): If the opponent is airborne.

Returns:

  • true if a counterattack is possible; otherwise, false.

Example:

local canCounter = utils.CanCounter(frames, attacker, receiver, airborneOpp)
print(canCounter) -- Output: true or false

IsAttackStarting #

Description: Checks if an attack is starting based on the move timer and startup frames.

Usage:

local result = utils.IsAttackStarting(self)

Parameters:

  • self (table): The attack object.

Returns:

  • true if the attack is starting; otherwise, false.

Example:

local isAttackStarting = utils.IsAttackStarting(attack)
print(isAttackStarting) -- Output: true or false

IsAttackLow #

Description: Checks if the attack is a low attack.

Usage:

local result = utils.IsAttackLow(self)

Parameters:

  • self (table): The attack object.

Returns:

  • `true

if the attack is low; otherwise,false`.

Example:

local isLow = utils.IsAttackLow(attack)
print(isLow) -- Output: true or false

IsAttackMid #

Description: Checks if the attack is a mid attack.

Usage:

local result = utils.IsAttackMid(self)

Parameters:

  • self (table): The attack object.

Returns:

  • true if the attack is mid; otherwise, false.

Example:

local isMid = utils.IsAttackMid(attack)
print(isMid) -- Output: true or false

IsAttackHigh #

Description: Checks if the attack is a high attack.

Usage:

local result = utils.IsAttackHigh(self)

Parameters:

  • self (table): The attack object.

Returns:

  • true if the attack is high; otherwise, false.

Example:

local isHigh = utils.IsAttackHigh(attack)
print(isHigh) -- Output: true or false

IsAttackThrow #

Description: Checks if the attack is a throw.

Usage:

local result = utils.IsAttackThrow(self)

Parameters:

  • self (table): The attack object.

Returns:

  • true if the attack is a throw; otherwise, false.

Example:

local isThrow = utils.IsAttackThrow(attack)
print(isThrow) -- Output: true or false

IsOnGround #

Description: Checks if the player is on the ground.

Usage:

local result = utils.IsOnGround(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is on the ground; otherwise, false.

Example:

local isOnGround = utils.IsOnGround(player)
print(isOnGround) -- Output: true or false

IsBlocking #

Description: Checks if the player is blocking.

Usage:

local result = utils.IsBlocking(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is blocking; otherwise, false.

Example:

local isBlocking = utils.IsBlocking(player)
print(isBlocking) -- Output: true or false

IsGettingHit #

Description: Checks if the player is getting hit.

Usage:

local result = utils.IsGettingHit(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is getting hit; otherwise, false.

Example:

local isGettingHit = utils.IsGettingHit(player)
print(isGettingHit) -- Output: true or false

IsPunish #

Description: Determines if the player is in a position to punish an attack.

Usage:

local result = utils.IsPunish(self, attacker)

Parameters:

  • self (table): The player object.
  • attacker (table): The attacker object.

Returns:

  • true if the player can punish the attack; otherwise, false.

Example:

local canPunish = utils.IsPunish(player, attacker)
print(canPunish) -- Output: true or false

IsMoveChanged #

Description: Checks if the move has changed.

Usage:

local result = utils.IsMoveChanged(self)

Parameters:

  • self (table): The move object.

Returns:

  • true if the move has changed; otherwise, false.

Example:

local moveChanged = utils.IsMoveChanged(move)
print(moveChanged) -- Output: true or false

IsWhileStanding #

Description: Checks if the player is in a while-standing state.

Usage:

local result = utils.IsWhileStanding(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player is while standing; otherwise, false.

Example:

local isWhileStanding = utils.IsWhileStanding(player)
print(isWhileStanding) -- Output: true or false

IsStartedBeingThrown #

Description: Checks if the player has started being thrown.

Usage:

local result = utils.IsStartedBeingThrown(self)

Parameters:

  • self (table): The player object.

Returns:

  • true if the player has started being thrown; otherwise, false.

Example:

local startedBeingThrown = utils.IsStartedBeingThrown(player)
print(startedBeingThrown) -- Output: true or false

GetActiveFrames #

Description: Gets the active frames of the current attack or move.

Usage:

local frames = utils.GetActiveFrames(self)

Parameters:

  • self (table): The attack or move object.

Returns:

  • The number of active frames.

Example:

local activeFrames = utils.GetActiveFrames(attack)
print(activeFrames) -- Output: number of active frames

getFa #

Description: Retrieves the Frame Advantage (FA) of the current move.

Usage:

local fa = utils.getFa(self)

Parameters:

  • self (table): The move object.

Returns:

  • The Frame Advantage value.

Example:

local fa = utils.getFa(move)
print(fa) -- Output: Frame Advantage value

IsAttackWhiffing #

Description: Checks if the attack is whiffing.

Usage:

local result = utils.IsAttackWhiffing(self)

Parameters:

  • self (table): The attack object.

Returns:

  • true if the attack is whiffing; otherwise, false.

Example:

local isWhiffing = utils.IsAttackWhiffing(attack)
print(isWhiffing) -- Output: true or false

is_Whiffing #

Description: Checks if the move is whiffing.

Usage:

local result = utils.is_Whiffing(self)

Parameters:

  • self (table): The move object.

Returns:

  • true if the move is whiffing; otherwise, false.

Example:

local isWhiffing = utils.is_Whiffing(move)
print(isWhiffing) -- Output: true or false

get_combo #

Description: Retrieves the current combo state.

Usage:

local combo = utils.get_combo(self)

Parameters:

  • self (table): The player object.

Returns:

  • The current combo state.

Example:

local comboState = utils.get_combo(player)
print(comboState) -- Output: combo state

is_starting_attack #

Description: Checks if the attack is starting based on the move timer and startup frames.

Usage:

local result = utils.is_starting_attack(self)

Parameters:

  • self (table): The attack object.

Returns:

  • true if the attack is starting; otherwise, false.

Example:

local isStartingAttack = utils.is_starting_attack(attack)
print(isStartingAttack) -- Output: true or false