Class: Gemwarrior::SmallHole

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

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

#initializeSmallHole

Returns a new instance of SmallHole.



8
9
10
11
12
13
14
# File 'lib/gemwarrior/entities/items/small_hole.rb', line 8

def initialize
  super

  self.name         = 'small_hole'
  self.name_display = 'Small Hole'
  self.description  = 'Amongst the rubble of the alcove, a small hole, barely big enough for a rodent, exists in an absently-minded way near the bottom of the wall.'
end

Instance Method Details

#use(world) ⇒ Object



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

def use(world)
  if !self.used
    self.used = true

    Audio.play_synth(:uncover_secret)
    puts 'You lower yourself to the ground and attempt to peer in the hole in the wall. Just as you begin to think this is a fruitless endeavor, a pair of bright, beady eyes manifest, and an unexpectedly low voice speaks:'
    Person.new.speak('Hello. I\'m Rockney, of Rockney\'s Hole in the Wall. Pleasure!')

    tunnel_alcove = world.location_by_name('tunnel_alcove')
    tunnel_alcove.items.push(Rockney.new)
    puts world.describe(tunnel_alcove)
  else
    puts 'Rockney appears to still be in the small hole, patiently waiting for you.'
  end

  { type: nil, data: nil }
end