Sha256: 5c3fc56171b184cf98411f52322dc0e8350a2adb830fb193094b171bdfd86433

Contents?: true

Size: 1.26 KB

Versions: 9

Compression:

Stored size: 1.26 KB

Contents

# lib/gemwarrior/entities/items/ladder.rb
# Item::Ladder

require_relative '../item'

module Gemwarrior
  class Ladder < Item
    # CONSTANTS
    USE_TEXT = '*** THUMP ***'

    def initialize
      super

      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
    end

    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: USE_TEXT)

      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
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gemwarrior-0.10.8 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.10.7 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.10.6 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.10.5 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.10.4 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.10.2 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.10.1 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.10.0 lib/gemwarrior/entities/items/ladder.rb
gemwarrior-0.9.39 lib/gemwarrior/entities/items/ladder.rb