Class: WSGame::BerserkPlayer

Inherits:
Player
  • Object
show all
Defined in:
lib/wsgame/class_player_berserk.rb

Instance Method Summary collapse

Constructor Details

#initialize(pname, phealth) ⇒ BerserkPlayer

Returns a new instance of BerserkPlayer.



8
9
10
11
12
# File 'lib/wsgame/class_player_berserk.rb', line 8

def initialize(pname,phealth)
 super(pname,phealth)	
	
	@cnt_w00t = 0 
end

Instance Method Details

#blammObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/wsgame/class_player_berserk.rb', line 15

def blamm
 if @cnt_w00t > 3
  self.w00t
  puts "#{@pname} is BERSERK!!!!"
else
  super
end

  #@cnt_w00t > 3 ?  self.w00t : super
end

#w00tObject



26
27
28
29
# File 'lib/wsgame/class_player_berserk.rb', line 26

def w00t
@cnt_w00t +=1
super
end