Skip to content

ASAbilitySpec

PT | EN
Inherits: RefCounted

Runtime instance of an ability.

Description

[ASAbilitySpec] represents an unlocked ability. It stores runtime state and provides methods to query execution data like cooldowns and costs.

Methods

ReturnName
voidadd_sub_spec( spec: ASAbilitySpec)
Adds a sub-ability spec to this parent spec’s lifecycle.
ASAbilityget_ability( ) const
Returns the ability resource.
ASEffectSpec[]get_active_effects( ) const
Returns all active effect instances created and managed by this specific ability execution.
floatget_cooldown_duration( ) const
Returns the base cooldown duration defined in the ability.
floatget_cooldown_remaining( ) const
Returns the time remaining for the cooldown on the owner ASC.
floatget_cost_amount( attribute: StringName) const
Returns the cost for a specific attribute.
intget_current_phase_index( ) const
Returns the index of the currently active phase.
floatget_duration_remaining( ) const
Returns the time remaining in seconds for the current phase or ability duration.
ASEffect[]get_effects_for_target( target_type: int) const
Returns effects filtered by their target type ([constant ASEffect.TARGET_SELF] or [constant ASEffect.TARGET_OTHERS]).
boolget_is_active( ) const
Returns true if the ability is currently running.
intget_level( ) const
Returns the level of this instance.
ASComponentget_owner( ) const
Returns the component that owns this spec.
ASAbilitySpec[]get_sub_specs( ) const
Returns the list of active sub-specs (phases or sub-abilities) managed by this spec.
floatget_total_duration( ) const
Returns the initial total duration of the ability instance as calculated at activation.
voidinit( ability: ASAbility, level: int = 1)
Initializes the spec.
boolis_on_cooldown( ) const
Returns true if the ability tag is currently on cooldown.
voidremove_sub_spec( spec: ASAbilitySpec)
Removes a sub-ability spec.
voidset_duration_remaining( duration: float)
Manually modifies the remaining duration. Can be used for duration extensions or reductions.
voidset_is_active( active: bool)
Sets the active state.
voidset_level( level: int)
Sets the instance level.
voidset_total_duration( duration: float)
Sets the total expected duration for this instance. This value is used as the reference for progress calculations.
booltick( delta: float)
Advances the internal timers of the spec. Returns true if the duration has expired or the ability logic has signaled completion.