UseStrategyDefinition ​
Inherits: Resource
Inherited by: CastUseStrategyDefinition, ChannelUseStrategyDefinition, InstantUseStrategyDefinition, ToggleUseStrategyDefinition
UseStrategyDefinition contains all logic for ability usage strategies. Subclasses implement specific timing patterns (instant, cast, channel, toggle). UseStrategyInstance holds only runtime state and delegates logic to this definition.
Properties ​
AnimationSelectionAbility | on_cast_animation | |
EntityVoiceSFXSelection | voice_cast_sfx | |
SFXSelection | on_cast_sfx | |
VFXSelection | cast_vfx | |
VFXSelectionTelegraph | ability_telegraph | |
AbilityUseStrategy | use_type |
Methods ​
void | execute_strategy( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) |
void | complete_early( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) |
Variant | get_property_value( strategy_instance: UseStrategyInstance, property_name: String ) |
bool | try_interrupt( strategy_instance: UseStrategyInstance ) |
void | force_cancel( strategy_instance: UseStrategyInstance, user: Entity, target: Variant, reason: String ) |
void | complete_timing_pattern( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) |
void | cancel_timing_pattern( strategy_instance: UseStrategyInstance, user: Entity, target: Variant, message: String ) |
void | cleanup_timing_resources( strategy_instance: UseStrategyInstance, user: Entity ) |
void | cleanup_base_resources( strategy_instance: UseStrategyInstance ) |
void | handle_completion_presentation( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) |
void | handle_initial_presentation( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) |
void | face_target( user: Entity, target: Variant ) |
Array[VFX] | show_vfx( vfx_manager: VFXManager, user: Entity, target: Variant ) |
Array[VFX] | show_telegraph_vfx( vfx_manager: VFXManager, user: Entity, target: Variant ) |
Array[VFX] | show_telegraph_vfx_with_timer( vfx_manager: VFXManager, user: Entity, target: Variant, timer: Timer = null ) |
void | play_voice_sfx( user: Entity ) |
void | play_cast_sfx( user: Entity ) |
void | play_ability_animation( strategy_instance: UseStrategyInstance, user: Entity ) |
String | get_weapon_animation_tag( strategy_instance: UseStrategyInstance, user: Entity, category: AnimationSelectionAbility.AbilityCategory, hand_preference: AnimationSelectionAbility.HandPreference ) |
void | apply_casting_slow( strategy_instance: UseStrategyInstance, user: Entity, speed_multiplier: float ) |
void | remove_casting_slow( strategy_instance: UseStrategyInstance, user: Entity ) |
void | on_input_released( _strategy_instance: UseStrategyInstance, _user: Entity, _target: Variant ) |
Enumerations ​
enum AbilityUseStrategy ​
The options of ability use strategy: instant, cast, channel, toggle.
- INSTANT =
0 - CAST =
1 - CHANNEL =
2 - TOGGLE =
3
Property descriptions ​
AnimationSelectionAbility on_cast_animation ​
Animation played when the ability completes execution
EntityVoiceSFXSelection voice_cast_sfx ​
Voice sound effect played when the ability completes
SFXSelection on_cast_sfx ​
Sound effect played when the ability completes execution
VFXSelection cast_vfx ​
Visual effect shown when the ability completes execution
VFXSelectionTelegraph ability_telegraph ​
Visual telegraph effect that shows the ability's area/target before execution
AbilityUseStrategy use_type ​
The type of use strategy this definition represents (instant, cast, channel, toggle)
Method descriptions ​
void execute_strategy( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) ​
Virtual method for strategy execution - override in subclasses to implement timing patterns
void complete_early( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) ​
Virtual method for early completion - override in subclasses that support it (like PowerUp abilities)
Variant get_property_value( strategy_instance: UseStrategyInstance, property_name: String ) ​
Virtual method for property getters with runtime override support - override in subclasses
bool try_interrupt( strategy_instance: UseStrategyInstance ) ​
Try to interrupt the strategy execution - respects interrupt shields and settings
void force_cancel( strategy_instance: UseStrategyInstance, user: Entity, target: Variant, reason: String ) ​
Force cancellation regardless of shields or settings
void complete_timing_pattern( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) ​
Complete the timing pattern - called when strategy execution finishes successfully
void cancel_timing_pattern( strategy_instance: UseStrategyInstance, user: Entity, target: Variant, message: String ) ​
Cancel the timing pattern - called when strategy execution is interrupted or cancelled
void cleanup_timing_resources( strategy_instance: UseStrategyInstance, user: Entity ) ​
Clean up strategy-specific timing resources - virtual method for subclasses
void cleanup_base_resources( strategy_instance: UseStrategyInstance ) ​
Clean up base resources used by all strategies
void handle_completion_presentation( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) ​
Handle completion presentation effects (VFX, SFX, animations)
void handle_initial_presentation( strategy_instance: UseStrategyInstance, user: Entity, target: Variant ) ​
Handle initial presentation (used by subclasses for preparation phases)
void face_target( user: Entity, target: Variant ) ​
Face the entity toward the target appropriately
Array[VFX] show_vfx( vfx_manager: VFXManager, user: Entity, target: Variant ) ​
Create and show VFX using VFXSelection
Array[VFX] show_telegraph_vfx( vfx_manager: VFXManager, user: Entity, target: Variant ) ​
Create and show telegraph VFX
Array[VFX] show_telegraph_vfx_with_timer( vfx_manager: VFXManager, user: Entity, target: Variant, timer: Timer = null ) ​
Create and show telegraph VFX with timer integration
void play_voice_sfx( user: Entity ) ​
Play voice sound effect
void play_cast_sfx( user: Entity ) ​
Play cast sound effect
void play_ability_animation( strategy_instance: UseStrategyInstance, user: Entity ) ​
Play ability animation for completion effects
String get_weapon_animation_tag( strategy_instance: UseStrategyInstance, user: Entity, category: AnimationSelectionAbility.AbilityCategory, hand_preference: AnimationSelectionAbility.HandPreference ) ​
Get the weapon animation tag from the entity This is the core data-driven animation resolution method First checks Entity.get_animation_tags() (works for NPCs with definition tags) Falls back to equipment lookup for entities with actual weapons (Players)
void apply_casting_slow( strategy_instance: UseStrategyInstance, user: Entity, speed_multiplier: float ) ​
Slows the user for the length of a cast or channel (multiplier 0.4 = 40 % of the normal speed; 1 = no change). Taken back by remove_casting_slow
void remove_casting_slow( strategy_instance: UseStrategyInstance, user: Entity ) ​
Takes the slow of casting off the user again.
void on_input_released( _strategy_instance: UseStrategyInstance, _user: Entity, _target: Variant ) ​
The key or button that started the ability was released (strategies that wait for the release, like a drawn bow, act on it; the others ignore it)