File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,16 @@ func (p *Player) MVPs() int {
470470 return getInt (p .resourceEntity (), "m_iMVPs." + p .entityIDStr ())
471471}
472472
473+ // TotalDamage returns the total health damage done by the player.
474+ func (p * Player ) TotalDamage () int {
475+ return getInt (p .resourceEntity (), "m_iMatchStats_Damage_Total." + p .entityIDStr ())
476+ }
477+
478+ // UtilityDamage returns the total damage done by the player with grenades.
479+ func (p * Player ) UtilityDamage () int {
480+ return getInt (p .resourceEntity (), "m_iMatchStats_UtilityDamage_Total." + p .entityIDStr ())
481+ }
482+
473483// MoneySpentTotal returns the total amount of money the player has spent in the current match.
474484func (p * Player ) MoneySpentTotal () int {
475485 return getInt (p .resourceEntity (), "m_iTotalCashSpent." + p .entityIDStr ())
Original file line number Diff line number Diff line change @@ -486,6 +486,18 @@ func TestPlayer_MVPs(t *testing.T) {
486486 assert .Equal (t , 4 , pl .MVPs ())
487487}
488488
489+ func TestPlayer_TotalDamage (t * testing.T ) {
490+ pl := playerWithResourceProperty ("m_iMatchStats_Damage_Total" , st.PropertyValue {IntVal : 2900 })
491+
492+ assert .Equal (t , 2900 , pl .TotalDamage ())
493+ }
494+
495+ func TestPlayer_UtilityDamage (t * testing.T ) {
496+ pl := playerWithResourceProperty ("m_iMatchStats_UtilityDamage_Total" , st.PropertyValue {IntVal : 420 })
497+
498+ assert .Equal (t , 420 , pl .UtilityDamage ())
499+ }
500+
489501func TestPlayer_SteamID32 (t * testing.T ) {
490502 pl := & Player {SteamID64 : 76561198012952267 }
491503
You can’t perform that action at this time.
0 commit comments