class BattleRoyal::AdvantagedPlayer
Public Class Methods
new(name, health = 100)
click to toggle source
Calls superclass method
# File lib/battle_royal/advantaged_player.rb, line 4 def initialize(name, health = 100) super(name, health) @power_up_count = 0 end
Public Instance Methods
advantaged?()
click to toggle source
# File lib/battle_royal/advantaged_player.rb, line 9 def advantaged? @power_up_count > 5 end
damage()
click to toggle source
Calls superclass method
# File lib/battle_royal/advantaged_player.rb, line 19 def damage advantaged? ? power_up : super end
power_up()
click to toggle source
Calls superclass method
# File lib/battle_royal/advantaged_player.rb, line 13 def power_up super @power_up_count += 1 puts "#{@name} is advantaged!" if advantaged? end