Class: Gemwarrior::Rope

Inherits:
Item show all
Defined in:
lib/gemwarrior/entities/items/rope.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

#initializeRope

Returns a new instance of Rope.



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

def initialize
  super

  self.name         = 'rope'
  self.name_display = 'Rope'
  self.description  = 'For some reason, a sturdy rope hangs down from a small opening in the metal tunnel\'s ceiling. It appears to hold your weight when taut.'
end

Instance Method Details

#use(world) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gemwarrior/entities/items/rope.rb', line 16

def use(world)
  puts 'You hold on to the rope with both hands and begin to climb upwards towards the small opening in the ceiling.'
  puts

  puts 'After a few minutes you pull yourself up onto a field of pure driven snow. Without warning, the rope and opening in the floor vanish.'
  puts
  
  # stats
  world.player.movements_made += 1

  { type: 'move', data: 'Snow Fields (Southeast)' }
end