Skip to main content

ITarget

An interface in Root.Township, Alta.Intelligence.

Something creature AI can target: a creature (through Target) or a player. Gives position, health stats, senses and attacks.

Properties​

MemberWhat it is
Vector3 GroundPosition { get; }Position on the ground used for distances. The transform position in the base Target.
Interactable Interactable { get; }The Interactable on the target, if any.
bool IsAlive { get; }Whether the target is alive.
bool IsInitialized { get; }Whether the target is set up and usable.
string Name { get; }Display name of the target.
Vector3 Position { get; }Current world position.
BasicSenseSet Senses { get; }The target's senses (sight, hearing and so on).
StatManager StatManager { get; }The target's stat manager, from its health object. Can be null.
Transform Transform { get; }The target's transform.

Methods​

MemberWhat it is
IEnumerable<AttackParameters> Attacks()The attacks this target can make. Empty in the base Target.
float GetDistance(ITarget other, float yFlexibility = 0)Distance between ground positions. yFlexibility ignores that much height difference.
float GetSquareDistance(ITarget other, float yFlexibility = 0)Squared distance between ground positions, ignoring up to yFlexibility of height difference.
float GetVelocity()The target's speed. 0 in the base Target.

Used in​

Members of other types that take, return or hold a ITarget:

ActionDecider<TAgent>.AddTarget, ActionDecider<TAgent>.CalculatePreferred, ActionDecider<TAgent>.CalculateRequired, ActionDecider<TAgent>.possibleTargetHashSet, ActionDecider<TAgent>.possibleTargets, ActionDecider<TAgent>.PossibleTargets, ActionDecider<TAgent>.RemoveTarget, ActionTarget<TAgent>.ActionTarget<TAgent>, ActionTarget<TAgent>.Alta.Intelligence.IActionTarget.Target, ActionTarget<TAgent>.Target, Agent.AddTarget, Agent.DoAction, Agent.Hurt, Agent.hurtKeys, Agent.ignoreTimers, Agent.providedTargets, Agent.RemoveTarget, Agent.Target, Agent.tempRemoving, Agent<TThis>.DoAction, Agent<TThis>.Target, BasicSense.Get, Chance.Evaluate, CreateTargetOperation.Formula, DebugResults.results, DistanceSense.Get, DistanceSense.GetInverseLerp, DistanceSquaredSense.Get, Facing2DSense.Get, Facing3DSense.Get, FailTargetOperation.Evaluate, Formula<T>.evaluate, Formula<T>.Evaluate, Formula<T>.Formula<T>, Grounded.Evaluate, HurtSense.Get, IActionDecider.AddTarget, IActionDecider.PossibleTargets, IActionDecider.RemoveTarget, IActionTarget.Target, IAgent.AddTarget, IAgent.DoAction, IAgent.Hurt, IAgent.RemoveTarget, IAgent.Target, InverseLerpSenseSelf.Evaluate, InverseLerpSenseTarget.Evaluate, ITargetExtensions.Exists, ITargetPointer.Target, Lifetime.Evaluate, RaycastGrounded.Evaluate, RVOBlockedValue.Evaluate, SameTarget.Evaluate, Schmeechee.Operation.Evaluate, SeedSpray.Alta.Intelligence.ITargetPointer.Target, SeedSpray.Shooter, Sense.Get, Sense.GetInverseLerp, StatValue.Evaluate, Target.Alta.Intelligence.ITargetPointer.Target and 17 more.