Damage History¶
After a player receives damage it is stored by the game in an array of the following struct. The information in that struct is final and changing it does not affect the game.
DamageHistoryStruct¶
DamageHistoryStruct
string attackerName
Name of the attacker
string attackerPetName
Name of the titan
vector origin
Position of the victim
float damage
The amount of damage inflicted
int damageType
A value from the Damage Flags
int damageSourceId
Damage souce ID from the gun ( damage-source-id-overview )
entity attacker
Entity of the attacker
int attackerEHandle
float attackerHealthPercent
How much health the attacker has in %
float time
When the damage was inflicted
array
Array of mods on the attacking gun
bool victimIsTitan
true
if the victim died in the Titan
bool rodeoDamage
true
if the damage was inflicted in rodeo mode
Getting the info from the entity¶
You can get the damage history for any player entity with player.e.recentDamageHistory
, this is of the type array<DamageHistoryStruct>
and gets automatically updated by the game. The higher the index the older the DamageHistoryStruct
is ( so to get the most recent struct you do player.e.recentDamageHistory[ 0 ]
).
Getter functions¶
array
-
entity player
The player you want the damage history from. -
float time
How old the damage history can be in seconds. -
Returns: All
DamageHistoryStruct
found in the given time frame.
Setter functions¶
DamageHistoryStruct function StoreDamageHistoryAndUpdate( entity storeEnt, float maxTime, float damage, vector damageOrigin, int damageType, int damageSourceId, entity attacker = null, array
void function UpdateDamageHistory( entity player, float maxTime, float time )
Removes all DamageHistoryStruct
in the time frame time - maxTime
-
entity player
The player you want to update the damage history from. -
float maxTime
How old the damage history can maximally be -
float time
How old the damage history can be in seconds.
Built in Checks¶
float function GetLastDamageTime( entity player )
bool function WasRecentlyHitByEntity( entity player, entity ent, float hitTime )
bool function WasRecentlyHitForDamage( entity player, float damageAmount, float hitTime )
bool function WasRecentlyHitForDamageType( entity player, float damageType, float hitTime )
float function GetTotalDamageTaken( entity player )
float function GetTotalDamageTakenInTime( entity player, float hitTime )
array
float function GetTotalDamageTakenByPlayer( entity player, entity attacker )
array
bool function WasRecentlyHitByDamageSourceId( entity player, int damageSourceId, float hitTime )
AssistingPlayerStruct function GetLatestAssistingPlayerInfo( entity ent )
Note
AssistingPlayerStruct
entity player
int damageSourceId
float assistTime
array
string function GetLastDamageSourceStringForAttacker( entity victim, entity attacker )
float function TotalDamageOverTime_BlendedOut( entity soul, float start, float end )
void function ClearRecentDamageHistory( entity player )