The Unit that holds the Ability.
Used in script callbacks to have access to extra methods and properties.
Summary
Section titled “Summary”Properties
Inherited Properties from Unit
-
The current position of the unit. […]
-
The Family of the unit. […]
-
The Team this unit belongs to. […]
-
The Entity that spawned this unit. […]
- corpse_on_die
booleanWhether the unit should leave a corpse when it dies. […]
Methods
- play_animation
(animation: string)Plays an animation on the unit that overrides the unit's current animation. […]
Inherited Methods from Unit
- find_targets_in_range
(find_targets: FindTargets) → { Unit }Find targets within a given radius of this unit. […]
- add_excluded
(excluded: Unit)Excludes the
excludedunit from this unit'sUnitInRangeandfind_targets_in_rangeresults. […] - remove_excluded
(excluded: Unit)Allows the
excludedunit to be included in this unit'sUnitInRangeandfind_targets_in_rangeresults again. […] -
Get the current value of a Stat for this unit, after applying any active buffs. […]
- buff
(buff: StatBuffDefinition)Applies a buff to this unit. […]
- buff_health
(buff: HealthBuffDefinition)Applies a buff to the health of this unit. […]
- remove_buffs_from
(owner: Entity)Removes all buffs from this unit that were granted by the given owner. […]
-
Damages this unit. […]
-
Instantly kills this unit. […]
-
Heals this unit. […]
- get_ability
(ability: string) → Ability?Gets a unique ability from this unit by an ability ID. […]
- insert_ability
(ability: string, source: Entity?) → AbilityAdds a unique ability to this unit, by ID. […]
- add_ability
(ability: string, source: Entity?) → AbilityUnconditionally adds an ability to this unit. […]
- get_or_insert_ability
(ability: string, source: Entity?) → AbilityGets a unique ability from this unit by an ability ID, if present. […]
- stack_ability
(ability: string, stack: number, source: Entity?) → AbilityConvenience method that gets or inserts an ability to this unit, and automatically sets (if newly added) or increments (if already inserted) its [Ability. […]
- remove_abilities_from
(owner: Entity)Removes all abilities from this unit that were granted by the given owner. […]
- set_steering
(...: SteeringBehavior)
Inherited Methods from Entity
- despawn
()Despawns this entity. […]
- is_ability
() → booleanWhether this entity is an Ability. […]
- as_ability
() → Ability?Typecasts this entity to an Ability, if possible. […]
- to_ability
() → AbilityForces this entity into an Ability type. […]
- is_unit
() → booleanWhether this entity is a Unit. […]
-
Typecasts this entity to a Unit, if possible. […]
-
Forces this entity into a Unit type. […]
Methods
Section titled “Methods”play_animation
Section titled “play_animation”AbilityHolder:play_animation(animation: string)
Plays an animation on the unit that overrides the unit's current animation.
Plays an animation on the unit that overrides the unit's current animation.
Parameters
- animation Required
stringThe name of the animation to play, as defined in the unit's definition.