Class: Gemwarrior::Pond
- 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
#atk_hi, #atk_lo, #equippable, #equipped, #reuse, #takeable, #useable
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize ⇒ Pond
constructor
A new instance of Pond.
- #use(player = nil) ⇒ Object
Methods inherited from Item
Methods inherited from Entity
Constructor Details
#initialize ⇒ Pond
Returns a new instance of Pond.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gemwarrior/entities/items/pond.rb', line 11 def initialize self.name = '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."' self.atk_lo = nil self.atk_hi = nil self.takeable = false self.useable = true self.equippable = false self.equipped = false end |
Instance Method Details
#use(player = nil) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gemwarrior/entities/items/pond.rb', line 22 def use(player = nil) puts 'You gently place your fingers on the pond\'s rippling surface.' binding.pry if (NEEDED_ITEMS - 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 |