Module necro.game.data.CustomActions
Classes
CustomAction.ActionArgs | |
CustomAction.HotkeyArgs | |
CustomAction.SystemArgs | |
CustomActionDefinition |
Functions
registerAction (args) | Defines a new custom bindable gameplay action. |
registerHotkey (args) | Defines a new custom bindable client hotkey. |
registerSubBeatAction (args) | Defines a new custom bindable sub-beat action, which can be pressed independently of the beatmap. |
registerSystemAction (args) | Defines a new custom system action, which can be invoked via script. |
Classes
- CustomAction.ActionArgs
-
- id string Identifier for the action. Mandatory field, and must be unique within the mod.
- name string Name of the action to display in the controls menu. Defaults to prettified ID.
- keyBinding string|table List of keys to assign to player 1 by default. If nil, disallows binding the action.
- handler fun(entity:Entity,args:any):integer In-turn callback for players or enemies performing this action.
- argSupplier fun(playerID:integer):any Invoked on the client to determine the value of the 'arg' parameter.
- CustomAction.HotkeyArgs
-
- id string Identifier for the hotkey. Mandatory field, and must be unique within the mod.
- name string Name of the hotkey to display in the controls menu. Defaults to prettified ID.
- keyBinding string|table Key or list of keys to assign to this hotkey by default.
- callback fun(playerID:integer) Callback invoked when the hotkey is pressed.
- callbackOrder table Overrides when this hotkey's handler is invoked within a tick.
- perPlayerBinding boolean If true, allows binding the hotkey per-player within the "gameplay controls" menu.
- enableIf fun(playerID:integer):boolean Client-side precondition for enabling the hotkey.
- CustomAction.SystemArgs
-
- id string Identifier for the action. Mandatory field, and must be unique within the mod.
- callback fun(playerID:integer,args:any) Callback invoked when the action is performed.
- callbackOrder table Overrides when this action's handler is invoked within a turn.
- CustomActionDefinition
-
- id string Identifier for the action. Mandatory field, and must be unique within the mod.
- name string Name of the action to display in the controls menu. Defaults to prettified ID.
- keyBinding string|table List of keys to assign to player 1 by default. If nil, disallows binding the action.
- handler fun(entity:Entity,args:any):integer In-turn callback for players or enemies performing this action.
- callback fun(playerID:integer,args:any) Callback invoked in-turn when the action is performed.
- callbackOrder table Overrides when this action's handler is invoked within a turn/tick.
- abilityFlags
integer Bitmask of
Ability.Flag
values, controlling when/how this action can be performed. - clientOnly boolean If true, the action is treated as a client hotkey, called on-tick for the local client.
- perPlayerBinding boolean If true, allows binding the action per-player within the "gameplay controls" menu.
- enableIf fun(playerID:integer):boolean Client-side precondition for enabling the hotkey.
- argSupplier fun(playerID:integer):any Invoked on the client to determine the value of the 'arg' parameter.
Functions
- registerAction (args)
-
Defines a new custom bindable gameplay action.
Parameters:
- args CustomAction.ActionArgs
Returns:
-
any id Returns the unique action ID, for use in
ClientActionBuffer.addAction()
and related functions. - fun(playerID:integer,args:any) perform Performs the custom action for the specified local player.
- registerHotkey (args)
-
Defines a new custom bindable client hotkey.
Parameters:
- args CustomAction.HotkeyArgs
- registerSubBeatAction (args)
-
Defines a new custom bindable sub-beat action, which can be pressed independently of the beatmap.
Parameters:
- args CustomAction.ActionArgs
Returns:
-
any id Returns the unique action ID, for use in
ClientActionBuffer.addAction()
and related functions. - fun(playerID:integer,args:any) perform Performs the custom action for the specified local player.
- registerSystemAction (args)
-
Defines a new custom system action, which can be invoked via script.
Parameters:
- args CustomAction.SystemArgs
Returns:
-
any id Returns the unique action ID, for use in
ClientActionBuffer.addAction()
and related functions. - fun(playerID:integer,args:any) perform Performs the custom action for the specified local player.