Class: Player

Inherits:
Object
  • Object
show all
Defined in:
lib/herostats/player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlayer

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

#assistsObject

Returns the value of attribute assists.



4
5
6
# File 'lib/herostats/player.rb', line 4

def assists
  @assists
end

#damage_takenObject

Returns the value of attribute damage_taken.



4
5
6
# File 'lib/herostats/player.rb', line 4

def damage_taken
  @damage_taken
end

#deathsObject

Returns the value of attribute deaths.



4
5
6
# File 'lib/herostats/player.rb', line 4

def deaths
  @deaths
end

#expObject

Returns the value of attribute exp.



4
5
6
# File 'lib/herostats/player.rb', line 4

def exp
  @exp
end

#healingObject

Returns the value of attribute healing.



4
5
6
# File 'lib/herostats/player.rb', line 4

def healing
  @healing
end

#heroObject

Returns the value of attribute hero.



4
5
6
# File 'lib/herostats/player.rb', line 4

def hero
  @hero
end

#hero_damageObject

Returns the value of attribute hero_damage.



4
5
6
# File 'lib/herostats/player.rb', line 4

def hero_damage
  @hero_damage
end

#killsObject

Returns the value of attribute kills.



4
5
6
# File 'lib/herostats/player.rb', line 4

def kills
  @kills
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/herostats/player.rb', line 4

def name
  @name
end

#siege_damageObject

Returns the value of attribute siege_damage.



4
5
6
# File 'lib/herostats/player.rb', line 4

def siege_damage
  @siege_damage
end

#talentsObject

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_globeObject



12
13
14
# File 'lib/herostats/player.rb', line 12

def pickup_regen_globe
  @regen_globes += 1
end

#role_statObject



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