Module: DiabloGame::Playable
- Included in:
- Hero
- Defined in:
- lib/diablo_game/playable_mixin.rb
Instance Method Summary collapse
Instance Method Details
#dead? ⇒ Boolean
14 15 16 |
# File 'lib/diablo_game/playable_mixin.rb', line 14 def dead? @health <= 0 end |
#heal ⇒ Object
9 10 11 12 |
# File 'lib/diablo_game/playable_mixin.rb', line 9 def heal @health += 15 puts "#{@name} was healed. Health is now: #{@health}" end |
#hit ⇒ Object
4 5 6 7 |
# File 'lib/diablo_game/playable_mixin.rb', line 4 def hit @health -= 30 puts "#{@name} was hit! Health is now: #{@health}" end |