Skip to content

CombatAction ​

Inherits: Resource

Inherited by: ActivateQuestCombatAction, CallForHelpAction, ClearTargetAction, ComboAction, DelayAction, FaceTargetAction, KeepDistanceAction, MoveToAllyPositionAction, MoveToPointAction, PlayStingerCombatAction, RetreatAction, SayCombatAction, SetMusicIntensityCombatAction, SetMusicStateCombatAction, SpawnInteractableCombatAction, SpawnNPCCombatAction, SpawnWorldEffectCombatAction, StrafeAction, SwitchToAllyAction, SwitchToEnemyAction, SwitchToHighestThreatAction, TriggerEventCombatAction, UseAbilityAction, UseAbilityAtPointAction, WaitForConditionAction

CombatAction is the base class for all combat actions. Actions represent things an entity can do during combat.

Properties ​

intpriority0
Array[EntityCondition]conditions[]
floataction_cooldown0.0
boolinterrupt_castingfalse

Variables ​

Timercooldown_timer
GameHost.SystemHubsystem_hub

Methods ​

voidset_system_refs( p_system_hub: GameHost.SystemHub )
boolcan_execute( entity: Entity )
voidprocess( _delta: float )
boolexecute( entity: Entity )
voidcleanup()

Property descriptions ​

int priority = 0 ​

Priority of this action (higher = checked first in priority lists)

Array[EntityCondition] conditions = [] ​

Conditions that must be met for this action to execute

float action_cooldown = 0.0 ​

Cooldown for this specific action (independent of ability cooldown)

bool interrupt_casting = false ​

Whether this action should interrupt current casting

Variable descriptions ​

Timer cooldown_timer ​

Internal cooldown timer

GameHost.SystemHub system_hub ​

SystemRefs

Method descriptions ​

void set_system_refs( p_system_hub: GameHost.SystemHub ) ​

Gives the action and its conditions the hub of the game systems.

bool can_execute( entity: Entity ) ​

Check if this action can be executed

void process( _delta: float ) ​

Called every combat tick by the logic that owns the action (cooldowns count on timers: nothing to do here, subclasses may)

bool execute( entity: Entity ) ​

Execute this action

void cleanup() ​

Cleanup any resources