Sha256: 384ce970684f0ec77ce556d8abedc130de62d09243b98978ce209a10ef25278a

Contents?: true

Size: 808 Bytes

Versions: 4

Compression:

Stored size: 808 Bytes

Contents

# lib/gemwarrior/entities/items/herb.rb
# Item::Herb

require_relative '../item'

module Gemwarrior
  class Herb < Item
    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

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gemwarrior-0.9.1 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.0 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.8.8 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.8.7 lib/gemwarrior/entities/items/herb.rb