Class: Gemwarrior::Herb

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

Instance Attribute Summary

Attributes inherited from Item

#atk_hi, #atk_lo, #equippable, #equipped, #reuse, #takeable, #useable

Attributes inherited from Entity

#description, #name

Instance Method Summary collapse

Methods inherited from Item

#describe

Methods inherited from Entity

#status

Constructor Details

#initializeHerb

Returns a new instance of Herb.



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

def initialize
  self.name         = 'herb'
  self.description  = 'Green and leafy, this wild herb looks edible.'
  self.atk_lo       = nil
  self.atk_hi       = nil
  self.takeable     = true
  self.useable      = true
  self.equippable   = false
  self.equipped     = false
end

Instance Method Details

#use(player = nil) ⇒ Object



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

def use(player = nil)
  puts 'You place the herb in your mouth, testing its texture. The mysterious herb is easily chewable, and you are able to swallow it without much effort. Slight tingles travel up and down your spine.'
  puts '>> You regain a few hit points.'
  {:type => 'health', :data => rand(3..5)}
end