Class: StudioGame::BerserkPlayer
- Inherits:
-
Player
- Object
- Player
- StudioGame::BerserkPlayer
show all
- Defined in:
- lib/studio_game/berserk_player.rb
Instance Attribute Summary
Attributes inherited from Player
#health, #name, #score, #show
Instance Method Summary
collapse
Methods inherited from Player
#<=>, #each_found_treasure, #found_treasure, #points, #random_stuff, #to_s, #treasure_bag
Methods included from Playable
#strong?
Constructor Details
#initialize(name, initial_health) ⇒ BerserkPlayer
Returns a new instance of BerserkPlayer.
7
8
9
10
|
# File 'lib/studio_game/berserk_player.rb', line 7
def initialize(name,initial_health)
super(name,initial_health)
@w00t_count = 0
end
|
Instance Method Details
#berserk? ⇒ Boolean
12
13
14
15
16
17
18
|
# File 'lib/studio_game/berserk_player.rb', line 12
def berserk?
if @w00t_count > 5
true
else
false
end
end
|
#blam ⇒ Object
30
31
32
33
34
|
# File 'lib/studio_game/berserk_player.rb', line 30
def blam
if self.berserk?
w00t
end
end
|
#w00t ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'lib/studio_game/berserk_player.rb', line 20
def w00t
super
@w00t_count += 1
if self.berserk?
puts "I am berserk #{self.name} and you are only making it worse!!!\n\n"
end
end
|