class StudioGame::BerserkPlayer

Public Class Methods

new(name, health=100, w00ted_times=0) click to toggle source
Calls superclass method
# File lib/studio_game/berserk_player.rb, line 4
def initialize(name, health=100, w00ted_times=0)
  super(name, health)
  @w00ted_times = w00ted_times
end

Public Instance Methods

berserk?() click to toggle source
# File lib/studio_game/berserk_player.rb, line 9
def berserk?
  @w00ted_times > 5
end
blam() click to toggle source
Calls superclass method
# File lib/studio_game/berserk_player.rb, line 21
def blam
  if berserk?
    w00t()
  else
    super
  end
end
w00t() click to toggle source
Calls superclass method
# File lib/studio_game/berserk_player.rb, line 13
def w00t
  super
  @w00ted_times += 1
  if berserk?
    puts "#{@player_name} is berserk!"
  end
end