Class: Gemwarrior::Ladder
- Defined in:
- lib/gemwarrior/entities/items/ladder.rb
Instance Attribute Summary
Attributes inherited from Item
#atk_hi, #atk_lo, #consumable, #equippable, #equipped, #takeable, #useable, #used
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize ⇒ Ladder
constructor
A new instance of Ladder.
- #use(player = nil) ⇒ Object
Methods inherited from Item
Methods inherited from Entity
Constructor Details
#initialize ⇒ Ladder
Returns a new instance of Ladder.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/gemwarrior/entities/items/ladder.rb', line 8 def initialize self.name = 'ladder' self.description = 'Rickety and crudely-fashioned, this ladder descends down into the dropoff, hopefully heading towards something...anything.' 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
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gemwarrior/entities/items/ladder.rb', line 19 def use(player = nil) puts 'You grab onto the shaky, rough-hewn, wooden ladder with all your might and start to descend, being extra careful not to loose your grip, which with every moment becomes shakier and shakier.' puts # stats player.movements_made += 1 Animation::run({ :phrase => '*** THUMP ***' }) puts 'The last couple of steps are more slippery than you anticipated, so you end up fumbling them, falling a few feet onto the hard ground below. When you regain your composure, you notice your conveyance for descending is now far above you and it is, unfortunately, your closest known exit.' puts {:type => 'move_dangerous', :data => 'Metal Tunnel (South Entrance)'} end |