Sha256: 2bf11bafe3a1dba012950ab2717cb09bc28972effaa7c2e856186dcca940e451

Contents?: true

Size: 862 Bytes

Versions: 12

Compression:

Stored size: 862 Bytes

Contents

# lib/gemwarrior/entities/items/apple.rb
# Entity::Item::Apple

require_relative '../item'

module Gemwarrior
  class Apple < Item
    def initialize
      super

      self.name         = 'apple'
      self.name_display = 'Apple'
      self.description  = 'Reddish-orangeish in color, this fruit looks sweet, but it is heavy and feels more like a rock you would sooner not bite into.'
      self.takeable     = true
    end

    def use(world)
      if !self.used
        puts 'You attempt to consume the apple, but stop midway through your first bite. Something tells you this is not a good idea, and you stop.'
        puts
        self.used = true
      else
        puts 'Remembering the odd feeling you got the last time you attempted to use the apple, you refrain.'
        { type: nil, data: nil }
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gemwarrior-0.15.20 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.19 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.18 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.17 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.16 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.15 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.14 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.13 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.12 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.11 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.10 lib/gemwarrior/entities/items/apple.rb
gemwarrior-0.15.9 lib/gemwarrior/entities/items/apple.rb