Ghostcommand Defs
Based on game build 714014 | Last updated: 2026-03-05
Overview
ghostcommand_defs.lua defines the command structures (as Lua tables) for Wendy’s ghost action spells. These commands power the UI and spell execution logic for unsummoning, riling up, soothing, escaping, attacking at a location, scaring, and haunting with her ghost (Abigail). It centralizes command definitions, animation sets, cooldown checks, and the spell function bindings that interact with the spellbook, aoespell, aoetargeting, ghostlybond, and skilltreeupdater components. The module exports two functions (GetGhostCommandsFor and GetBaseCommands) to provide dynamic command sets based on the owner’s state and activated skills.
Usage example
local commands = require("prefabs/ghostcommand_defs").GetGhostCommandsFor(ThePlayer)
for _, cmd in ipairs(commands) do
print("Command:", cmd.label)
if cmd.onselect then
cmd.onselect(some_ghost_instrument)
end
end
Dependencies & tags
Components used:
spellbook(for spell name, action, and spell function assignment)aoespell(for assigningspellfn)aoetargeting(for reticule configuration and targeting)ghostlybond(for behaviour change and recall)health(to check if ghost is alive)skilltreeupdater(to conditionally enable skill-based commands)playercontroller(for AOETargeting entry point)spellbookcooldowns(for cooldown checks and management)
Tags:
- Adds
unsummoning_spell(temporary, only onunsummoncommand selection)
Properties
No public properties are exposed directly by this module. It only returns a table of exported functions.
Main functions
GetGhostCommandsFor(owner)
- Description: Constructs and returns the full list of ghost commands available to the given
owner(typically the player). It includes base commands (unsummon,rile/soothe), plus any skill-activated commands fromSKILLTREE_COMMAND_DEFS. Selects betweenRILE_UP_ACTIONandSOOTHE_ACTIONbased on whetherownerhas thehas_aggressive_followertag. - Parameters:
owner(Entity instance) — the entity that owns the ghost and commands. - Returns:
table— a list of command definition tables (each with fields likelabel,onselect,execute,anims,widget_scale, etc.). - Error states: If
SKILLTREE_COMMAND_DEFSentries are malformed (e.g., missinglabelbut nested incorrectly), it may silently skip them.
GetBaseCommands()
- Description: Returns the static list of base commands that are always available (regardless of skills or tags), currently only the
unsummoncommand. - Parameters: None.
- Returns:
table— a list containing the singleBASECOMMANDSentry.
Events & listeners
- Pushes:
spellupdateneeded— fired byGhostChangeBehaviourto signal the UI or game state that command availability may have changed after behaviour change. - Listens to: None — this module does not register event listeners itself. Event interaction is handled via component callbacks (e.g.,
onselectfunctions interact with components).