Sha256: 7eb2f2aa27fd4d27d5c72277c79d85b1531223ca949da7b07e3327b704048061

Contents?: true

Size: 840 Bytes

Versions: 16

Compression:

Stored size: 840 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.consumable   = 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

16 entries across 16 versions & 1 rubygems

Version Path
gemwarrior-0.9.18 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.17 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.16 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.15 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.14 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.13 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.12 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.10 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.9 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.8 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.7 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.6 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.5 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.4 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.3 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.9.2 lib/gemwarrior/entities/items/herb.rb