Class: BattleRoyal::LamePlayer
- Defined in:
- lib/battle_royal/lame_player.rb
Instance Attribute Summary
Attributes inherited from Player
Instance Method Summary collapse
- #found_weapon(weapon) ⇒ Object
-
#initialize(name, health = 100, boost = 1) ⇒ LamePlayer
constructor
A new instance of LamePlayer.
- #power_up ⇒ Object
Methods inherited from Player
#attack, #each_found_weapon, from_csv, #points, #score, #to_s
Methods included from Playable
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_up ⇒ Object
14 15 16 |
# File 'lib/battle_royal/lame_player.rb', line 14 def power_up @boost.times { super } end |