Class: StudioGame::ClumsyPlayer

Inherits:
Player
  • Object
show all
Defined in:
lib/studio_game/clumsy_player.rb

Instance Attribute Summary

Attributes inherited from Player

#health, #name

Instance Method Summary collapse

Methods inherited from Player

#<=>, #each_found_treasure, from_csv, #points, #score, #to_s, #total_treasures

Methods included from Playable

#blam, #strong?

Constructor Details

#initialize(name, health = 100, boost = 10) ⇒ ClumsyPlayer

Returns a new instance of ClumsyPlayer.



6
7
8
9
10
# File 'lib/studio_game/clumsy_player.rb', line 6

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

Instance Method Details

#boost_factorObject



21
22
23
# File 'lib/studio_game/clumsy_player.rb', line 21

def boost_factor
   @boost_factor
end

#found_treasure(treasure) ⇒ Object



16
17
18
19
# File 'lib/studio_game/clumsy_player.rb', line 16

def found_treasure(treasure)
   new_treasure = Treasure.new(treasure.name, treasure.points/2)
   super(new_treasure)
end

#w00tObject



12
13
14
# File 'lib/studio_game/clumsy_player.rb', line 12

def w00t
   @boost_factor.times {super}      
end