class PAUL::Berserk

Public Class Methods

new(name, health=100) click to toggle source
Calls superclass method PAUL::Player::new
# File lib/PAUL/exercise20ber.rb, line 7
def initialize(name, health=100)
    super(name, health)
    @w00t_count = 0
end

Public Instance Methods

berserk?() click to toggle source
# File lib/PAUL/exercise20ber.rb, line 12
def berserk?
    @w00t_count > 5
end
blam() click to toggle source
Calls superclass method Paul#blam
# File lib/PAUL/exercise20ber.rb, line 22
def blam
    if berserk?
        w00t
    else
        super
    end
end
w00t() click to toggle source
Calls superclass method Paul#w00t
# File lib/PAUL/exercise20ber.rb, line 16
def w00t
    super
    @w00t_count += 1
    puts "#{@name} is berserk!" if berserk?
end