Sha256: e27b3d9bd2d916b3ab942cdfc290e64a840fbfb5d5522eca4af8cf08d8dc0323

Contents?: true

Size: 1.29 KB

Versions: 23

Compression:

Stored size: 1.29 KB

Contents

# lib/gemwarrior/entities/items/pond.rb
# Entity::Item::Pond

require_relative '../item'

module Gemwarrior
  class Pond < Item
    # CONTACTS
    NEEDED_ITEMS = ['dehumidifier', 'feather', 'gun', 'stalactite']

    def initialize
      super

      self.name         = 'pond'
      self.name_display = 'Pond'
      self.description  = 'This tiny pool of water self-ripples every minute or so. Small, floating insects buzz around merrily. A small plaque lays at the foot, reading: "If the right objects curious doth possess, touch the water\'s surface and you\'ll get redress."'
    end

    def use(world)
      puts 'You gently place your fingers on the pond\'s rippling surface.'

      if (NEEDED_ITEMS - world.player.inventory.items.map(&:name)).empty?
        puts 'The pond water explodes with a force that knocks you back onto the ground. When you come to, you notice the depression in the ground where the pond once was now has a new curious object!'
        self.description = 'A barren depression in the ground is all that is left of the pond.'
        return { type: 'item', data: 'Opalaser' }
      else
        puts 'You graze your fingers within the pond for a moment, feeling the coolness. You feel zen.'
        return { type: nil, data: nil }
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
gemwarrior-0.14.4 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.14.3 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.14.2 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.14.1 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.14.0 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.13.2 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.13.1 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.13.0 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.8 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.7 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.6 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.5 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.4 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.3 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.2 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.1 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.12.0 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.11.5 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.11.4 lib/gemwarrior/entities/items/pond.rb
gemwarrior-0.11.3 lib/gemwarrior/entities/items/pond.rb