Class: BattleRoyal::LamePlayer

Inherits:
Player
  • Object
show all
Defined in:
lib/battle_royal/lame_player.rb

Instance Attribute Summary

Attributes inherited from Player

#health, #name

Instance Method Summary collapse

Methods inherited from Player

#attack, #each_found_weapon, from_csv, #points, #score, #to_s

Methods included from Playable

#damage, #strong?

Constructor Details

#initialize(name, health = 100, boost = 1) ⇒ LamePlayer

Returns a new instance of LamePlayer.



4
5
6
7
# File 'lib/battle_royal/lame_player.rb', line 4

def initialize(name, health = 100, boost = 1)
  super(name, health)
  @boost = boost
end

Instance Method Details

#found_weapon(weapon) ⇒ Object



9
10
11
12
# File 'lib/battle_royal/lame_player.rb', line 9

def found_weapon(weapon)
  damaged_weapon = Weapon.new(weapon.name, weapon.points / 2)
  super(damaged_weapon)
end

#power_upObject



14
15
16
# File 'lib/battle_royal/lame_player.rb', line 14

def power_up
  @boost.times { super }
end