Skip to content

Character Common Functions

Common.setIASA(iasaFlag)

Attempts to enable IASA (interrupt-as-soon-as) for the current animation, taking the object state into account. Unlike modifying the interruptible animation stat directly, it does not allow IASA to be enabled during an airdash cancel that has not hit anything yet.
Can always disable IASA.

Kind: global function

ParamDescription
iasaFlagTrue to enable IASA, false to disable ;

Common.generateDashDust()

Helper function to generate dash dust effects.

Kind: global function

Common.generateAirdashVfx(angle) ⇒

Helper function to generate air dash effects.

Kind: global function
Returns: The generate Vfx instance.

ParamDescription
angleThe angle of the air dash.

Common.setHurtMediumAngle(value)

Adjust the hurt medium angle threshold for transitioning to tumble.

Kind: global function

ParamDescription
valueThe angle to use as the threshold.

Common.performLedgeJump()

Initiates the jumping part of a ledge jump

Kind: global function

Common.applyLedgeJumpSpeed()

Applies ledge jump speed immediately using character's ledge jump stats

Kind: global function

Common.performActionWhenFalse(action, condition)

Performs the action exactly once, as soon as the condition fails.

Kind: global function

ParamDescription
actionA void function that is executed when the timer fires.
conditionA boolean function that is checked every frame.

Common.lingerOnFrameDuringHitstun()

Intended to be used only on hurt animations. The frame that this runs on will be held for a length of time dependent on the remaining frames in the animation and the length of hitstun.

For example, suppose you have 12 frames of hitstun remaining and you have 5 frames remaining in your animation. It will hold on this frame for the difference, 7 frames, before resuming and completing the animation at the same time that hitstun ends.

Kind: global function

Common.allowJumpToCrouchOut()

Call in the timeline. From this frame on in the current animation, if player is not holding DOWN the character will automatically jump to the crouch_out animation. Intended to be used during crouch_in only.

Kind: global function

Common.allowJumpToCrouchIn()

Call in the timeline. From this frame on in the current animation, if player is not holding DOWN the character will automatically jump to the crouch_out animation. Intended to be used during crouch_out only.

Kind: global function

Common.playRandomShieldHitSound()

Play a random Shield Hit Sound

Kind: global function

Common.setAutocancel(autocancelFlag)

Attempts to enable/disable autocancel for the current animation, taking the object state into account. Does not allow autocancel to be set if the object is doing an airdash cancel that has not hit anything yet. Can always disable autocancel.

Kind: global function

ParamDescription
autocancelFlagPass as true to enable autocancel, false to disable.

Common.onButtonsPressed(buttons, callback) ⇒

Helper method for triggering a callback when a combination of buttons are pressed at the same time. Supports checking multiple buttons using bitwise operations.

Kind: global function
Returns: Reference to the timer uid so the timer may be removed via self.removeTimer().

ParamDescription
buttonsThe button(s) to listen for (See Buttons class).
callbackThe method to execute when the buttons are pressed at the same time.

Common.onButtonsHeld(buttons, callback) ⇒

Helper method for triggering a callback when a combination of buttons are held at the same time. Supports checking multiple buttons using bitwise operations.

Kind: global function
Returns: Reference to the timer uid so the timer may be removed via self.removeTimer().

ParamDescription
buttonsThe button(s) to listen for (See Buttons class).
callbackThe method to execute when the buttons are held at the same time.

Common.onButtonsReleased(buttons, callback) ⇒

Helper method for triggering a callback when a combination of buttons are released. Supports checking multiple buttons using bitwise operations. Do not call this function multiple times within the same animation, as its implementation relies on a shared store to remember any previously held buttons.

Kind: global function
Returns: Reference to the timer uid so the timer may be removed via self.removeTimer().

ParamDescription
buttonsThe button(s) to listen for (See Buttons class).
callbackThe method to execute when the buttons are released.

Common.onButtonsNotHeld(buttons, callback) ⇒

Helper method for triggering a callback when a combination of buttons are not held. Supports checking multiple buttons using bitwise operations.

Kind: global function
Returns: Reference to the timer uid so the timer may be removed via self.removeTimer().

ParamDescription
buttonsThe button(s) to listen for (See Buttons class).
callbackThe method to execute when the buttons are no longer held.