Sha256: e9eaf63d0c64e8a0f02c3b2696f2c06adac654fac99a2101fc35603020b9f9bd

Contents?: true

Size: 1.03 KB

Versions: 48

Compression:

Stored size: 1.03 KB

Contents

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

require_relative '../item'

module Gemwarrior
  class Herb < Item
    def initialize
      super

      self.name           = 'herb'
      self.name_display   = 'Herb'
      self.description    = 'Green and leafy, this wild herb looks edible.'
      self.takeable       = true
      self.consumable     = true
      self.useable_battle = true
    end

    def use(world)
      puts 'You place the entire, smallish plant 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.'
      if world.player.at_full_hp?
        puts '>> The herb has no medicinal effect, as you already feel perfectly healthy, but it was kind of tasty.'
        { type: nil, data: nil }
      else
        hp_healed = rand(3..5)
        puts ">> You regain #{hp_healed} hit points.".colorize(:green)
        { type: 'health', data: hp_healed }
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
gemwarrior-0.15.20 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.19 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.18 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.17 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.16 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.15 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.14 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.13 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.12 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.11 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.10 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.9 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.8 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.7 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.6 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.5 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.4 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.3 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.2 lib/gemwarrior/entities/items/herb.rb
gemwarrior-0.15.1 lib/gemwarrior/entities/items/herb.rb