class StudioGame::BerserkPlayer
Public Class Methods
new(name, health=100)
click to toggle source
Calls superclass method
# File lib/studio_game/berserk_player.rb, line 6 def initialize(name, health=100) super(name, health) @w00t_counter = 0 end
Public Instance Methods
berserk?()
click to toggle source
# File lib/studio_game/berserk_player.rb, line 11 def berserk? @w00t_counter > 5 end
blam()
click to toggle source
Calls superclass method
# File lib/studio_game/berserk_player.rb, line 25 def blam if berserk? puts "Ooops! Player #{@name} went beserk! And instead of being blammed, he will be w00ted! (current w00t count: #{@w00t_counter})" w00t else super end end
w00t()
click to toggle source
Calls superclass method
# File lib/studio_game/berserk_player.rb, line 15 def w00t super @w00t_counter += 1 if berserk? puts "Watch out! player #{@name} has been w00ted #{@w00t_counter} times." else puts "Current w00t count of player #{@name}: #{@w00t_counter}" end end