Module: StudioGame::Playable

Included in:
Character
Defined in:
lib/studio_game/playable.rb

Instance Method Summary collapse

Instance Method Details

#heal_damage(heal) ⇒ Object



7
8
9
10
# File 'lib/studio_game/playable.rb', line 7

def heal_damage(heal)
  self.hp += heal
  puts "#{name} healed #{heal}pts of HP."
end

#strong?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/studio_game/playable.rb', line 3

def strong?
  hp > 50
end

#take_damage(damage) ⇒ Object



12
13
14
15
# File 'lib/studio_game/playable.rb', line 12

def take_damage(damage)
  self.hp -= damage
  puts "#{name} took #{damage}pts of damage."
end