Class: StudioGameOAS::ClumsyPlayer
- Inherits:
-
Player
- Object
- Player
- StudioGameOAS::ClumsyPlayer
show all
- Defined in:
- lib/studio_game_oas/clumsy_player.rb
Instance Attribute Summary
Attributes inherited from Player
#health, #name
Instance Method Summary
collapse
Methods inherited from Player
#<=>, #each_found_treasure, parse_player, #points, #score, #to_s
Methods included from Playable
#blam, #strong?
Constructor Details
#initialize(name, health = 100, boost_factor = 1) ⇒ ClumsyPlayer
Returns a new instance of ClumsyPlayer.
8
9
10
11
|
# File 'lib/studio_game_oas/clumsy_player.rb', line 8
def initialize(name, health=100, boost_factor=1)
super(name, health)
@boost_factor = boost_factor
end
|
Instance Method Details
#boost_factor ⇒ Object
14
15
16
|
# File 'lib/studio_game_oas/clumsy_player.rb', line 14
def boost_factor
@boost_factor
end
|
#found_treasure(treasure) ⇒ Object
23
24
25
26
|
# File 'lib/studio_game_oas/clumsy_player.rb', line 23
def found_treasure(treasure)
broken_treasure = Treasure.new(treasure.name, treasure.points / 2)
super(broken_treasure)
end
|
#w00t ⇒ Object
18
19
20
|
# File 'lib/studio_game_oas/clumsy_player.rb', line 18
def w00t
@boost_factor.times { super }
end
|