class StudioGame::ClumsyPlayer
Public Class Methods
new(name, health=100)
click to toggle source
Calls superclass method
# File lib/studio_game/clumsy_player.rb, line 6 def initialize(name, health=100) super(name, health) @clumsiness = 2 @health_bonus = 20 end
Public Instance Methods
broken_treasure_points(treasure)
click to toggle source
# File lib/studio_game/clumsy_player.rb, line 11 def broken_treasure_points(treasure) treasure.points / @clumsiness end
found_treasure(treasure)
click to toggle source
Calls superclass method
# File lib/studio_game/clumsy_player.rb, line 14 def found_treasure(treasure) super(Treasure.new(treasure.name, broken_treasure_points(treasure))) end
w00t()
click to toggle source
Calls superclass method
# File lib/studio_game/clumsy_player.rb, line 17 def w00t @health += @health_bonus super puts "#{@name} got a health bonus of #{@health_bonus} for being clumsy!" end