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 ​
UseStrategyDefinition | definition | |
AbilityInstance | ability_instance | |
CombatManager | combat_manager | |
bool | is_active | false |
Dictionary | runtime_data | {} |
Dictionary | runtime_property_overrides | {} |
PropertyModifierSet | modifiers | PropertyModifierSet.new() |
Methods ​
Variant | apply_modifiers( property_name: String, value: Variant ) |
void | set_runtime_property( property_name: String, value: Variant ) |
void | clear_runtime_property( property_name: String ) |
bool | has_runtime_override( property_name: String ) |
Dictionary | get_all_runtime_overrides() |
void | clear_all_runtime_overrides() |
void | execute_ability( target: Variant ) |
bool | try_interrupt() |
void | force_cancel( user: Entity, target: Variant, reason: String ) |
void | release_input( user: Entity, target: Variant ) |
void | complete_early( user: Entity, target: Variant ) |
Variant | get_property_value( property_name: String ) |
float | get_cast_duration() |
float | get_channel_duration() |
float | get_channel_tick_rate() |
bool | get_immobile_during_cast() |
bool | get_interruptable_cast() |
int | get_interrupt_shield_level() |
float | get_drain_per_second() |
float | get_min_active_duration() |
float | get_max_active_duration() |
int | get_interrupt_shield() |
bool | is_executing() |
Dictionary | get_strategy_summary() |
void | reset() |
void | cleanup_timers() |
Dictionary | to_save_data() |
void | from_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