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
Param | Description |
---|---|
iasaFlag | True to enable IASA, false to disable ; |
Common.generateDashDust()
Helper function to generate dash dust effects.
Common.generateAirdashVfx(angle) ⇒
Helper function to generate air dash effects.
Kind: global function
Returns: The generate Vfx instance.
Param | Description |
---|---|
angle | The angle of the air dash. |
Common.setHurtMediumAngle(value)
Adjust the hurt medium angle threshold for transitioning to tumble.
Kind: global function
Param | Description |
---|---|
value | The angle to use as the threshold. |
Common.performLedgeJump()
Initiates the jumping part of a ledge jump
Common.applyLedgeJumpSpeed()
Applies ledge jump speed immediately using character's ledge jump stats
Common.performActionWhenFalse(action, condition)
Performs the action exactly once, as soon as the condition fails.
Kind: global function
Param | Description |
---|---|
action | A void function that is executed when the timer fires. |
condition | A 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.
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.
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.
Common.playRandomShieldHitSound()
Play a random Shield Hit Sound
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
Param | Description |
---|---|
autocancelFlag | Pass 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().
Param | Description |
---|---|
buttons | The button(s) to listen for (See Buttons class). |
callback | The 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().
Param | Description |
---|---|
buttons | The button(s) to listen for (See Buttons class). |
callback | The 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().
Param | Description |
---|---|
buttons | The button(s) to listen for (See Buttons class). |
callback | The 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().
Param | Description |
---|---|
buttons | The button(s) to listen for (See Buttons class). |
callback | The method to execute when the buttons are no longer held. |