Struct PluginCombatTarget
- Namespace
- AcDream.Plugin.Abstractions
- Assembly
- AcDream.Plugin.Abstractions.dll
One hostile creature near the player, with everything a plugin needs to pick a target: where it is, how hurt it is, and how fresh that knowledge is.
public readonly record struct PluginCombatTarget : IEquatable<PluginCombatTarget>
- Implements
- Inherited Members
Constructors
PluginCombatTarget(uint, string, uint, float, float, bool, float)
One hostile creature near the player, with everything a plugin needs to pick a target: where it is, how hurt it is, and how fresh that knowledge is.
public PluginCombatTarget(uint ObjectId, string Name, uint WeenieClassId, float Distance, float RelativeAngleDegrees, bool IsHealthKnown, float HealthFraction)
Parameters
ObjectIduintThe creature's object id.
NamestringThe creature's display name.
WeenieClassIduintThe creature's class id.
DistancefloatStraight-line distance from the player in metres, height included.
RelativeAngleDegreesfloatHow far the creature sits off the direction the player faces, in degrees from -180 to 180; zero is straight ahead.
IsHealthKnownboolTrue when the server has told the client this creature's health at least once. While it is false
HealthFractionreads as full.HealthFractionfloatThe creature's health as a share of its maximum, from 0 to 1.
Properties
Distance
Straight-line distance from the player in metres, height included.
public float Distance { get; init; }
Property Value
HasShield
True when the creature has something the client counts as armor equipped.
public bool HasShield { get; init; }
Property Value
HealthFraction
The creature's health as a share of its maximum, from 0 to 1.
public float HealthFraction { get; init; }
Property Value
HealthRevision
Monotonic revision of the last server health update.
public long HealthRevision { get; init; }
Property Value
Incarnation
The client's re-use counter for this object id, which tells a fresh creature apart from an earlier one that carried the same id.
public ushort Incarnation { get; init; }
Property Value
IsDead
True once the client has been told this creature died. Unlike a health reading of zero this does not need the creature to be selected or its health ever to have been asked for, so it is the dependable answer to "is this thing still worth attacking".
public bool IsDead { get; init; }
Property Value
IsHealthKnown
True when the server has told the client this creature's health at least
once. While it is false HealthFraction reads as full.
public bool IsHealthKnown { get; init; }
Property Value
MaximumHealth
Spawn/appraisal maximum HP, or zero until the host knows it.
public int MaximumHealth { get; init; }
Property Value
Name
The creature's display name.
public string Name { get; init; }
Property Value
ObjectId
The creature's object id.
public uint ObjectId { get; init; }
Property Value
RelativeAngleDegrees
How far the creature sits off the direction the player faces, in degrees from -180 to 180; zero is straight ahead.
public float RelativeAngleDegrees { get; init; }
Property Value
SecondsSinceHealthUpdate
How long ago the last health update for this creature arrived, in seconds; positive infinity when none ever has.
public double SecondsSinceHealthUpdate { get; init; }
Property Value
SpeciesId
The creature's species, or zero when the client does not know it.
public int SpeciesId { get; init; }
Property Value
SpeciesName
The species' display name, or an empty string when the host cannot resolve one.
public string SpeciesName { get; init; }
Property Value
WeenieClassId
The creature's class id.
public uint WeenieClassId { get; init; }