class StudioGame::BerserkPlayer

Public Class Methods

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

Public Instance Methods

berserk?() click to toggle source
# File lib/Studiogame/berserk_player.rb, line 9
def berserk?
  @healthpack_count > 5
end
healthpack() click to toggle source
Calls superclass method
# File lib/Studiogame/berserk_player.rb, line 13
def healthpack
  super
  puts "#{@name} is berserk!" if berserk?
  @healthpack_count +=1
end
hit() click to toggle source
Calls superclass method
# File lib/Studiogame/berserk_player.rb, line 19
def hit
  if berserk?
    healthpack
  else
    super
  end
end