Class: StudioGame::ClumsyPlayer

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

Instance Attribute Summary collapse

Attributes inherited from Player

#health, #name

Instance Method Summary collapse

Methods inherited from Player

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

Methods included from Playable

#blam, #strong?

Constructor Details

#initialize(name, health) ⇒ ClumsyPlayer

Returns a new instance of ClumsyPlayer.



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

def initialize(name, health)
  super(name, health)
  @w00t_bonus_factor = 5
end

Instance Attribute Details

#w00t_bonus_factorObject (readonly)

Returns the value of attribute w00t_bonus_factor.



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

def w00t_bonus_factor
  @w00t_bonus_factor
end

Instance Method Details

#found_treasure(treasure) ⇒ Object



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

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

#w00tObject



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

def w00t
  @w00t_bonus_factor.times { super }
end