Class: Gemwarrior::Couch
- Defined in:
- lib/gemwarrior/entities/items/couch.rb
Instance Attribute Summary
Attributes inherited from Item
Attributes inherited from Entity
#consumable, #describe, #describe_detailed, #description, #display_shopping_cart, #equippable, #equipped, #name, #name_display, #number_of_uses, #takeable, #talkable, #useable, #useable_battle, #used, #used_again
Instance Method Summary collapse
-
#initialize ⇒ Couch
constructor
A new instance of Couch.
- #use(world) ⇒ Object
Methods inherited from Item
Methods inherited from Entity
Constructor Details
#initialize ⇒ Couch
Returns a new instance of Couch.
8 9 10 11 12 13 14 |
# File 'lib/gemwarrior/entities/items/couch.rb', line 8 def initialize super self.name = 'couch' self.name_display = 'Couch' self.description = 'Ever wanted to sit on a cloud? Now is your chance.' end |
Instance Method Details
#use(world) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gemwarrior/entities/items/couch.rb', line 16 def use(world) if world.player.at_full_hp? puts 'You "sit" on the impossibly soft surface of the furniture, but even after a few minutes of this seemingly heavenly hedonism you don\'t feel significantly better and decide to get up again.' { type: nil, data: nil } else puts 'Your body comes to rest somewhere below the surface of the cloudy apparatus, almost as if it were floating *amongst* the couch. The feeling is heavenly, and you actually feel somewhat better after getting back up.' puts '>> You regain a few hit points.'.colorize(:green) { type: 'rest', data: 4 } end end |