class StudioGame::ClumsyPlayer

Attributes

boost_factor[R]

Public Class Methods

new(name, health=100, boost_factor=2) click to toggle source
Calls superclass method
# File lib/Studiogame/clumsy_player.rb, line 6
def initialize(name, health=100, boost_factor=2)
        super(name, health)
        @boost_factor = boost_factor
end

Public Instance Methods

found_treasure(treasure) click to toggle source
# File lib/Studiogame/clumsy_player.rb, line 15
def found_treasure(treasure)
        @found_treasures[treasure.name] += (treasure.points / 2)
        puts "#{@name} found a #{treasure.name} worth #{treasure.points/2} points."
end
healthpack() click to toggle source
Calls superclass method
# File lib/Studiogame/clumsy_player.rb, line 11
def healthpack
        @boost_factor.times {super}
end