Table of Contents

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

ObjectId uint

The creature's object id.

Name string

The creature's display name.

WeenieClassId uint

The creature's class id.

Distance float

Straight-line distance from the player in metres, height included.

RelativeAngleDegrees float

How far the creature sits off the direction the player faces, in degrees from -180 to 180; zero is straight ahead.

IsHealthKnown bool

True when the server has told the client this creature's health at least once. While it is false HealthFraction reads as full.

HealthFraction float

The 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

float

HasShield

True when the creature has something the client counts as armor equipped.

public bool HasShield { get; init; }

Property Value

bool

HealthFraction

The creature's health as a share of its maximum, from 0 to 1.

public float HealthFraction { get; init; }

Property Value

float

HealthRevision

Monotonic revision of the last server health update.

public long HealthRevision { get; init; }

Property Value

long

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

ushort

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

bool

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

bool

MaximumHealth

Spawn/appraisal maximum HP, or zero until the host knows it.

public int MaximumHealth { get; init; }

Property Value

int

Name

The creature's display name.

public string Name { get; init; }

Property Value

string

ObjectId

The creature's object id.

public uint ObjectId { get; init; }

Property Value

uint

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

float

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

double

SpeciesId

The creature's species, or zero when the client does not know it.

public int SpeciesId { get; init; }

Property Value

int

SpeciesName

The species' display name, or an empty string when the host cannot resolve one.

public string SpeciesName { get; init; }

Property Value

string

WeenieClassId

The creature's class id.

public uint WeenieClassId { get; init; }

Property Value

uint