Skip to content

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 ​

boolhas_auto_targettrue
boolcan_target_deadfalse
boolrequires_line_of_sighttrue
floatmax_range3.0
boolrequires_targeting_inputfalse
ReputationLevel.FactionRelationshiptarget_collision_layerReputationLevel.FactionRelationship.HOSTILE
floattarget_collision_radius0.0
boolhas_markerfalse
AbilityMarkerLocationmarker_locationAbilityMarkerLocation.MOUSE
Stringmarker_texture
boolmarker_is_friendlyfalse
floatmarker_x0.0
floatmarker_z0.0
floatmarker_offset0.0
TargetStrategyDefinition.AbilityTargetStrategytarget_type

Methods ​

Dictionaryvalidate_target( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant )
Variantget_auto_target( strategy_instance: TargetStrategyInstance, user: Variant )
boolget_requires_line_of_sight()
Variantget_property_value( strategy_instance: TargetStrategyInstance, property_name: String )
Dictionaryvalidate_basic_entity_requirements( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant )
Dictionaryvalidate_interactable_requirements( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant )
Dictionaryvalidate_point_target( strategy_instance: TargetStrategyInstance, target: Variant, user: Variant )
boolis_valid_enemy( user: Variant, target: Variant )
boolis_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