Table of Contents

Class DamageTracker

Namespace
Uncreated.Warfare.Util.DamageTracking
Assembly
Uncreated.Warfare.dll
public class DamageTracker
Inheritance
DamageTracker
Derived
Inherited Members

Constructors

DamageTracker(string)

public DamageTracker(string context)

Parameters

context string

Properties

Contributors

public PlayerContributionTracker.ContributorEnumerator Contributors { get; }

Property Value

PlayerContributionTracker.ContributorEnumerator

LastKnownDamageInstigator

The player who is the last known person to have damaged this object. Will not be null even if the object's most recent damage was not from a player.

public CSteamID? LastKnownDamageInstigator { get; }

Property Value

CSteamID?

LatestDamageCause

public EDamageOrigin? LatestDamageCause { get; }

Property Value

EDamageOrigin?

LatestDamageInstigator

The very last player to damage the object, if the latest damaged was from a player. Will be null if the object's most recent damage was not from a player.

public CSteamID? LatestDamageInstigator { get; }

Property Value

CSteamID?

LatestInstigatorWeapon

This can be an item or vehicle (ex. a vehicle explodes next to this vehicle).

public Asset? LatestInstigatorWeapon { get; }

Property Value

Asset

Remarks

It may not necessarily be a weapon if its an item. Could be melee, explosive consumable, landmine, C4 charge, etc.

TimeLastDamaged

public DateTime TimeLastDamaged { get; }

Property Value

DateTime

TotalWorkDone

public float TotalWorkDone { get; }

Property Value

float

Methods

ClearDamage()

Invoked when damage becomes irrelevant, like when the object is repaired.

public virtual void ClearDamage()

GetDamageContribution(CSteamID, DateTime, out float)

public float GetDamageContribution(CSteamID playerId, DateTime after, out float total)

Parameters

playerId CSteamID
after DateTime
total float

Returns

float

GetDamageContribution(CSteamID, out float)

public float GetDamageContribution(CSteamID playerId, out float total)

Parameters

playerId CSteamID
total float

Returns

float

GetDamageContributionPercentage(CSteamID)

public float GetDamageContributionPercentage(CSteamID playerId)

Parameters

playerId CSteamID

Returns

float

GetDamageContributionPercentage(CSteamID, DateTime)

public float GetDamageContributionPercentage(CSteamID playerId, DateTime after)

Parameters

playerId CSteamID
after DateTime

Returns

float

RecordDamage(EDamageOrigin)

public virtual void RecordDamage(EDamageOrigin cause)

Parameters

cause EDamageOrigin

RecordDamage(CSteamID, ushort, EDamageOrigin, bool)

public virtual void RecordDamage(CSteamID playerId, ushort damage, EDamageOrigin cause, bool isFriendly)

Parameters

playerId CSteamID
damage ushort
cause EDamageOrigin
isFriendly bool

RecordDamage(WarfarePlayer, ushort, EDamageOrigin, bool)

public virtual void RecordDamage(WarfarePlayer onlineInstigator, ushort damage, EDamageOrigin cause, bool isFriendly)

Parameters

onlineInstigator WarfarePlayer
damage ushort
cause EDamageOrigin
isFriendly bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

UpdateLatestInstigatorWeapon(Asset?)

public void UpdateLatestInstigatorWeapon(Asset? asset)

Parameters

asset Asset