Class: Gemwarrior::Herb
- 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
Instance Method Summary collapse
-
#initialize ⇒ Herb
constructor
A new instance of Herb.
- #use(player = nil) ⇒ Object
Methods inherited from Item
Methods inherited from Entity
Constructor Details
#initialize ⇒ Herb
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 |