Class: Gemwarrior::Bed

Inherits:
Item show all
Defined in:
lib/gemwarrior/entities/items/bed.rb

Instance Attribute Summary

Attributes inherited from Item

#atk_hi, #atk_lo, #consumable, #equippable, #equipped, #takeable, #useable, #used

Attributes inherited from Entity

#description, #name

Instance Method Summary collapse

Methods inherited from Item

#describe

Methods inherited from Entity

#status

Constructor Details

#initializeBed

Returns a new instance of Bed.



8
9
10
11
12
13
14
15
16
17
# File 'lib/gemwarrior/entities/items/bed.rb', line 8

def initialize
  self.name         = 'bed'
  self.description  = 'The place where you sleep when you are not adventuring.'
  self.atk_lo       = nil
  self.atk_hi       = nil
  self.takeable     = false
  self.useable      = true
  self.equippable   = false
  self.equipped     = false
end

Instance Method Details

#use(player = nil) ⇒ Object



19
20
21
22
23
24
# File 'lib/gemwarrior/entities/items/bed.rb', line 19

def use(player = nil)
  Animation::run({:phrase => '** ZZZZZ **'})
  puts 'You unmake the bed, get under the covers, close your eyes, and begin to think about all the things you need to do today. You realize sleep is not one of them and quickly get back up, remake the bed, and get on about your day.'
  puts '>> You regain a few hit points.'
  {:type => 'rest', :data => 5}
end