Skip to content

UseStrategyInstance ​

Inherits: RefCounted

Runtime instance of a use strategy that references a UseStrategyDefinition for configuration. Contains only runtime state and data - all logic is delegated to the definition. Follows the same pattern as AbilityInstance -> AbilityDefinition relationship.

Variables ​

UseStrategyDefinitiondefinition
AbilityInstanceability_instance
CombatManagercombat_manager
boolis_activefalse
Dictionaryruntime_data{}
Dictionaryruntime_property_overrides{}
PropertyModifierSetmodifiersPropertyModifierSet.new()

Methods ​

Variantapply_modifiers( property_name: String, value: Variant )
voidset_runtime_property( property_name: String, value: Variant )
voidclear_runtime_property( property_name: String )
boolhas_runtime_override( property_name: String )
Dictionaryget_all_runtime_overrides()
voidclear_all_runtime_overrides()
voidexecute_ability( target: Variant )
booltry_interrupt()
voidforce_cancel( user: Entity, target: Variant, reason: String )
voidrelease_input( user: Entity, target: Variant )
voidcomplete_early( user: Entity, target: Variant )
Variantget_property_value( property_name: String )
floatget_cast_duration()
floatget_channel_duration()
floatget_channel_tick_rate()
boolget_immobile_during_cast()
boolget_interruptable_cast()
intget_interrupt_shield_level()
floatget_drain_per_second()
floatget_min_active_duration()
floatget_max_active_duration()
intget_interrupt_shield()
boolis_executing()
Dictionaryget_strategy_summary()
voidreset()
voidcleanup_timers()
Dictionaryto_save_data()
voidfrom_save_data( save_data: Dictionary )

Signals ​

use_strategy_completed( target: Variant ) ​

Emitted when the use strategy completes its execution

Variable descriptions ​

UseStrategyDefinition definition ​

Reference to the immutable use strategy definition (contains all logic)

AbilityInstance ability_instance ​

The ability instance that owns this use strategy instance

CombatManager combat_manager ​

Combat Manager system

bool is_active = false ​

Whether the strategy is currently active/executing

Dictionary runtime_data = ​

Runtime data specific to the use strategy type (timers, VFX arrays, etc.)

Dictionary runtime_property_overrides = ​

Runtime overrides for definition properties (only set when modified by effects)

PropertyModifierSet modifiers = PropertyModifierSet.new() ​

Modifiers on the numeric properties (cast time, range, drain ...): they stack and can be taken away by their source

Method descriptions ​

Variant apply_modifiers( property_name: String, value: Variant ) ​

A numeric property with the modifiers applied (other kinds of value pass through)

void set_runtime_property( property_name: String, value: Variant ) ​

Set a runtime property override (for stat effects modifying strategy properties)

void clear_runtime_property( property_name: String ) ​

Clear a runtime property override (reverts to definition value)

bool has_runtime_override( property_name: String ) ​

Check if a property has a runtime override

Dictionary get_all_runtime_overrides() ​

Get all runtime overrides (for debugging/save states)

void clear_all_runtime_overrides() ​

Clear all runtime overrides

void execute_ability( target: Variant ) ​

Main entry point called by AbilityInstance - delegates to definition

bool try_interrupt() ​

Try to interrupt - delegates to definition

void force_cancel( user: Entity, target: Variant, reason: String ) ​

Force cancel - delegates to definition

void release_input( user: Entity, target: Variant ) ​

The key that started the ability was released

void complete_early( user: Entity, target: Variant ) ​

Complete early (for PowerUp abilities) - delegates to definition

Variant get_property_value( property_name: String ) ​

Get property value with runtime override support - delegates to definition

float get_cast_duration() ​

Convenience getters for common properties

float get_channel_duration() ​

The current value of channel duration: the one of the definition, unless a modifier changed it.

float get_channel_tick_rate() ​

The current value of channel tick rate: the one of the definition, unless a modifier changed it.

bool get_immobile_during_cast() ​

The current value of immobile during cast: the one of the definition, unless a modifier changed it.

bool get_interruptable_cast() ​

The current value of interruptable cast: the one of the definition, unless a modifier changed it.

int get_interrupt_shield_level() ​

The current value of interrupt shield level: the one of the definition, unless a modifier changed it.

float get_drain_per_second() ​

The current value of drain per second: the one of the definition, unless a modifier changed it.

float get_min_active_duration() ​

The current value of min active duration: the one of the definition, unless a modifier changed it.

float get_max_active_duration() ​

The current value of max active duration: the one of the definition, unless a modifier changed it.

int get_interrupt_shield() ​

Get current interrupt shield level (for UI or debugging)

bool is_executing() ​

Check if strategy is currently executing

Dictionary get_strategy_summary() ​

Get current strategy state summary

void reset() ​

Reset instance state (for reuse)

void cleanup_timers() ​

Cleanup all timers (delegates to definition for strategy-specific cleanup)

Dictionary to_save_data() ​

Save runtime state to dictionary

void from_save_data( save_data: Dictionary ) ​

Load runtime state from dictionary