Class: HoN::PlayerStats
Instance Method Summary collapse
- #assists ⇒ Object
-
#buybacks ⇒ Object
The (total? average?) amount of hero buybacks.
-
#concede_votes ⇒ Object
The amount of times the player has tried to concede.
-
#concedes ⇒ Object
The total amount of games conceded.
- #deaths ⇒ Object
-
#disconnects ⇒ Object
The amount of times the player has disconnected from a game.
-
#games ⇒ Object
The total amount of games played.
- #heroes ⇒ Object
- #idle_time ⇒ Object
-
#initialize(nickname, *options) ⇒ PlayerStats
constructor
A new instance of PlayerStats.
- #inspect ⇒ Object
- #kdr ⇒ Object
-
#kicked ⇒ Object
The amount of times the player has been kicked from a game.
-
#kills ⇒ Object
The total amount of heroes the player has killed.
-
#losses ⇒ Object
The total amount of defeats.
- #nickname ⇒ Object
-
#psr ⇒ Object
The players Public Skill Rating.
-
#public_games ⇒ Object
The amount of public games the player has played (non-matchmaking games).
-
#total_damage ⇒ Object
The total amount of damage the player has dealt to heroes.
-
#total_exp ⇒ Object
The total amount of experience the player has gained.
- #total_gold_lost ⇒ Object
-
#total_hero_gold ⇒ Object
The total amount of gold consumed from killing enemy heroes.
- #win_percentage ⇒ Object
-
#wins ⇒ Object
The total amount of victories.
Methods inherited from Stats
Constructor Details
#initialize(nickname, *options) ⇒ PlayerStats
Returns a new instance of PlayerStats.
6 7 8 9 10 11 12 13 |
# File 'lib/hon/player.rb', line 6 def initialize nickname, * @nickname = nickname @statistics = Hash.new retrieve_statistics retrieve_heroes if .include? :heroes raise PlayerError, "Player not found" if @statistics.empty? end |
Instance Method Details
#assists ⇒ Object
93 94 95 |
# File 'lib/hon/player.rb', line 93 def assists @statistics[:acc_heroassists] end |
#buybacks ⇒ Object
The (total? average?) amount of hero buybacks.
49 50 51 |
# File 'lib/hon/player.rb', line 49 def buybacks @statistics[:acc_buybacks] end |
#concede_votes ⇒ Object
The amount of times the player has tried to concede.
44 45 46 |
# File 'lib/hon/player.rb', line 44 def concede_votes @statistics[:acc_concedevotes] end |
#concedes ⇒ Object
The total amount of games conceded.
39 40 41 |
# File 'lib/hon/player.rb', line 39 def concedes @statistics[:acc_concedes] end |
#deaths ⇒ Object
97 98 99 |
# File 'lib/hon/player.rb', line 97 def deaths @statistics[:acc_deaths] end |
#disconnects ⇒ Object
The amount of times the player has disconnected from a game.
54 55 56 |
# File 'lib/hon/player.rb', line 54 def disconnects @statistics[:acc_discos] end |
#games ⇒ Object
The total amount of games played.
24 25 26 |
# File 'lib/hon/player.rb', line 24 def games @statistics[:acc_games_played] end |
#heroes ⇒ Object
117 118 119 |
# File 'lib/hon/player.rb', line 117 def heroes @heroes or {} end |
#idle_time ⇒ Object
105 106 107 |
# File 'lib/hon/player.rb', line 105 def idle_time @statistics[:acc_secs_dead] end |
#inspect ⇒ Object
15 16 17 |
# File 'lib/hon/player.rb', line 15 def inspect %{<#{self.class} @nickname="#{nickname}" @games=#{games} @wins=#{wins} @losses=#{losses}>} end |
#kdr ⇒ Object
113 114 115 |
# File 'lib/hon/player.rb', line 113 def kdr (kills.to_f / deaths.to_f).round 1 end |
#kicked ⇒ Object
The amount of times the player has been kicked from a game.
59 60 61 |
# File 'lib/hon/player.rb', line 59 def kicked @statistics[:acc_kicked] end |
#kills ⇒ Object
The total amount of heroes the player has killed.
74 75 76 |
# File 'lib/hon/player.rb', line 74 def kills @statistics[:acc_herokills] end |
#losses ⇒ Object
The total amount of defeats.
34 35 36 |
# File 'lib/hon/player.rb', line 34 def losses @statistics[:acc_losses] end |
#nickname ⇒ Object
19 20 21 |
# File 'lib/hon/player.rb', line 19 def nickname @statistics[:nickname] end |
#psr ⇒ Object
The players Public Skill Rating.
64 65 66 |
# File 'lib/hon/player.rb', line 64 def psr @statistics[:acc_pub_skill] end |
#public_games ⇒ Object
The amount of public games the player has played (non-matchmaking games).
69 70 71 |
# File 'lib/hon/player.rb', line 69 def public_games @statistics[:acc_pub_count] end |
#total_damage ⇒ Object
The total amount of damage the player has dealt to heroes.
79 80 81 |
# File 'lib/hon/player.rb', line 79 def total_damage @statistics[:acc_herodmg] end |
#total_exp ⇒ Object
The total amount of experience the player has gained.
84 85 86 |
# File 'lib/hon/player.rb', line 84 def total_exp @statistics[:acc_heroexp] end |
#total_gold_lost ⇒ Object
101 102 103 |
# File 'lib/hon/player.rb', line 101 def total_gold_lost @statistics[:acc_goldlost2death] end |
#total_hero_gold ⇒ Object
The total amount of gold consumed from killing enemy heroes.
89 90 91 |
# File 'lib/hon/player.rb', line 89 def total_hero_gold @statistics[:acc_herokillsgold] end |
#win_percentage ⇒ Object
109 110 111 |
# File 'lib/hon/player.rb', line 109 def win_percentage (wins.to_f / games.to_f * 100).round 1 end |
#wins ⇒ Object
The total amount of victories.
29 30 31 |
# File 'lib/hon/player.rb', line 29 def wins @statistics[:acc_wins] end |