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
contextstring
Properties
Contributors
public PlayerContributionTracker.ContributorEnumerator Contributors { get; }
Property Value
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
TotalWorkDone
public float TotalWorkDone { get; }
Property Value
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
Returns
GetDamageContribution(CSteamID, out float)
public float GetDamageContribution(CSteamID playerId, out float total)
Parameters
playerIdCSteamIDtotalfloat
Returns
GetDamageContributionPercentage(CSteamID)
public float GetDamageContributionPercentage(CSteamID playerId)
Parameters
playerIdCSteamID
Returns
GetDamageContributionPercentage(CSteamID, DateTime)
public float GetDamageContributionPercentage(CSteamID playerId, DateTime after)
Parameters
playerIdCSteamIDafterDateTime
Returns
RecordDamage(EDamageOrigin)
public virtual void RecordDamage(EDamageOrigin cause)
Parameters
causeEDamageOrigin
RecordDamage(CSteamID, ushort, EDamageOrigin, bool)
public virtual void RecordDamage(CSteamID playerId, ushort damage, EDamageOrigin cause, bool isFriendly)
Parameters
RecordDamage(WarfarePlayer, ushort, EDamageOrigin, bool)
public virtual void RecordDamage(WarfarePlayer onlineInstigator, ushort damage, EDamageOrigin cause, bool isFriendly)
Parameters
onlineInstigatorWarfarePlayerdamageushortcauseEDamageOriginisFriendlybool
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
assetAsset