TargetStrategyDefinition ​
Inherits: Resource
Inherited by: AimedTargetStrategyDefinition, AllyTargetStrategyDefinition, AnyEntityTargetStrategyDefinition, EnemyTargetStrategyDefinition, MultiPointTargetStrategyDefinition, NoTargetStrategyDefinition, PointTargetStrategyDefinition, SelfTargetStrategyDefinition
TargetStrategyDefinition contains all logic for ability targeting strategies. Subclasses implement specific targeting patterns (self, enemy, ally, point, etc.). TargetStrategyInstance holds only runtime state and delegates logic to this definition.
Properties ​
bool | has_auto_target | true |
bool | can_target_dead | false |
bool | requires_line_of_sight | true |
float | max_range | 3.0 |
bool | requires_targeting_input | false |
ReputationLevel.FactionRelationship | target_collision_layer | ReputationLevel.FactionRelationship.HOSTILE |
float | target_collision_radius | 0.0 |
bool | has_marker | false |
AbilityMarkerLocation | marker_location | AbilityMarkerLocation.MOUSE |
String | marker_texture | |
bool | marker_is_friendly | false |
float | marker_x | 0.0 |
float | marker_z | 0.0 |
float | marker_offset | 0.0 |
TargetStrategyDefinition.AbilityTargetStrategy | target_type |
Methods ​
Dictionary | validate_target( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) |
Variant | get_auto_target( strategy_instance: TargetStrategyInstance, user: Variant ) |
bool | get_requires_line_of_sight() |
Variant | get_property_value( strategy_instance: TargetStrategyInstance, property_name: String ) |
Dictionary | validate_basic_entity_requirements( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) |
Dictionary | validate_interactable_requirements( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) |
Dictionary | validate_point_target( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) |
bool | is_valid_enemy( user: Variant, target: Variant ) |
bool | is_valid_ally( user: Variant, target: Variant, can_target_self: bool ) |
Enumerations ​
enum AbilityTargetStrategy ​
The options of ability target strategy: enemy, ally, any entity, self, point, multi point, none, aimed.
- ENEMY =
0 - ALLY =
1 - ANY_ENTITY =
2 - SELF =
3 - POINT =
4 - MULTI_POINT =
5 - NONE =
6 - AIMED =
7
enum AbilityMarkerLocation ​
The options of ability marker location: mouse, user.
- MOUSE =
0 - USER =
1
Property descriptions ​
bool has_auto_target = true ​
Whether this strategy can automatically select a target without player input
bool can_target_dead = false ​
Whether dead entities can be valid targets for this strategy
bool requires_line_of_sight = true ​
If line of sight is required
float max_range = 3.0 ​
Maximum distance from caster that targets can be selected (0 = unlimited)
bool requires_targeting_input = false ​
Whether this strategy requires manual player targeting input (overrides auto-targeting)
ReputationLevel.FactionRelationship target_collision_layer = ReputationLevel.FactionRelationship.HOSTILE ​
Faction relationship filter for valid targets (hostile, friendly, neutral)
float target_collision_radius = 0.0 ​
Radius around target point for collision detection (0 = point targeting)
bool has_marker = false ​
Whether to display a targeting marker/cursor for this strategy
AbilityMarkerLocation marker_location = AbilityMarkerLocation.MOUSE ​
Where the targeting marker should be positioned
String marker_texture ​
Texture identifier for the targeting marker
bool marker_is_friendly = false ​
Whether the marker indicates a friendly target (affects marker color/style)
float marker_x = 0.0 ​
X offset for marker positioning relative to marker_location
float marker_z = 0.0 ​
Z offset for marker positioning relative to marker_location
float marker_offset = 0.0 ​
Additional offset applied to marker positioning
TargetStrategyDefinition.AbilityTargetStrategy target_type ​
The type of targeting strategy this definition represents
Method descriptions ​
Dictionary validate_target( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) ​
Virtual method for target validation - override in subclasses to implement specific validation logic
Variant get_auto_target( strategy_instance: TargetStrategyInstance, user: Variant ) ​
Virtual method for auto-target selection - override in subclasses to implement specific auto-targeting
bool get_requires_line_of_sight() ​
Virtual method for line of sight requirement
Variant get_property_value( strategy_instance: TargetStrategyInstance, property_name: String ) ​
Virtual method for property getters with runtime override support - override in subclasses
Dictionary validate_basic_entity_requirements( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) ​
Validates basic requirements for entity targets (range, death, etc.)
Dictionary validate_interactable_requirements( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) ​
Validates a targetable interactable (a destructible, a ward, a turret) the way an entity is validated: targetable, has stats, not dead, in range and in line of sight (an object behind a wall cannot be targeted). The strategy adds its own faction rule
Dictionary validate_point_target( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant ) ​
Validates point targets (position and range)
bool is_valid_enemy( user: Variant, target: Variant ) ​
Check if target is a valid enemy based on faction relationships
bool is_valid_ally( user: Variant, target: Variant, can_target_self: bool ) ​
Check if target is a valid ally based on faction relationships