Class: Gemwarrior::Pond

Inherits:
Item show all
Defined in:
lib/gemwarrior/entities/items/pond.rb

Constant Summary collapse

NEEDED_ITEMS =

CONTACTS

['dehumidifier', 'feather', 'gun', 'stalactite']

Instance Attribute Summary

Attributes inherited from Item

#is_armor, #is_weapon

Attributes inherited from Entity

#consumable, #describe, #describe_detailed, #description, #display_shopping_cart, #equippable, #equipped, #name, #name_display, #number_of_uses, #takeable, #talkable, #useable, #useable_battle, #used, #used_again

Instance Method Summary collapse

Methods inherited from Item

#describe_detailed

Methods inherited from Entity

#puts

Constructor Details

#initializePond

Returns a new instance of Pond.



11
12
13
14
15
16
17
# File 'lib/gemwarrior/entities/items/pond.rb', line 11

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

Instance Method Details

#use(world) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gemwarrior/entities/items/pond.rb', line 19

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?
    Audio.play_synth(:uncover_secret)
    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