Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/herostats/player.rb
Instance Attribute Summary collapse
-
#assists ⇒ Object
Returns the value of attribute assists.
-
#damage_taken ⇒ Object
Returns the value of attribute damage_taken.
-
#deaths ⇒ Object
Returns the value of attribute deaths.
-
#exp ⇒ Object
Returns the value of attribute exp.
-
#healing ⇒ Object
Returns the value of attribute healing.
-
#hero ⇒ Object
Returns the value of attribute hero.
-
#hero_damage ⇒ Object
Returns the value of attribute hero_damage.
-
#kills ⇒ Object
Returns the value of attribute kills.
-
#name ⇒ Object
Returns the value of attribute name.
-
#siege_damage ⇒ Object
Returns the value of attribute siege_damage.
-
#talents ⇒ Object
Returns the value of attribute talents.
Instance Method Summary collapse
-
#initialize ⇒ Player
constructor
A new instance of Player.
- #pickup_regen_globe ⇒ Object
- #role_stat ⇒ Object
- #select_talent(talent) ⇒ Object
Constructor Details
#initialize ⇒ Player
Returns a new instance of Player.
6 7 8 9 10 |
# File 'lib/herostats/player.rb', line 6 def initialize @talents = [] @kills = 0 @regen_globes = 0 end |
Instance Attribute Details
#assists ⇒ Object
Returns the value of attribute assists.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def assists @assists end |
#damage_taken ⇒ Object
Returns the value of attribute damage_taken.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def damage_taken @damage_taken end |
#deaths ⇒ Object
Returns the value of attribute deaths.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def deaths @deaths end |
#exp ⇒ Object
Returns the value of attribute exp.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def exp @exp end |
#healing ⇒ Object
Returns the value of attribute healing.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def healing @healing end |
#hero ⇒ Object
Returns the value of attribute hero.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def hero @hero end |
#hero_damage ⇒ Object
Returns the value of attribute hero_damage.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def hero_damage @hero_damage end |
#kills ⇒ Object
Returns the value of attribute kills.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def kills @kills end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def name @name end |
#siege_damage ⇒ Object
Returns the value of attribute siege_damage.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def siege_damage @siege_damage end |
#talents ⇒ Object
Returns the value of attribute talents.
4 5 6 |
# File 'lib/herostats/player.rb', line 4 def talents @talents end |
Instance Method Details
#pickup_regen_globe ⇒ Object
12 13 14 |
# File 'lib/herostats/player.rb', line 12 def pickup_regen_globe @regen_globes += 1 end |
#role_stat ⇒ Object
20 21 22 23 24 |
# File 'lib/herostats/player.rb', line 20 def role_stat return healing unless healing == 0 return damage_taken unless damage_taken == 0 nil end |
#select_talent(talent) ⇒ Object
16 17 18 |
# File 'lib/herostats/player.rb', line 16 def select_talent(talent) @talents.push(talent) end |