Sha256: bbe5d1accc1eb49b6206e2b341b25cd539c982f17a88bc8dd20a7529410ebc73

Contents?: true

Size: 1006 Bytes

Versions: 24

Compression:

Stored size: 1006 Bytes

Contents

# lib/gemwarrior/entities/item.rb
# Item base class

require_relative 'entity'

module Gemwarrior
  class Item < Entity
    attr_accessor :atk_lo, 
                  :atk_hi, 
                  :takeable, 
                  :useable, 
                  :equippable, 
                  :equipped,
                  :consumable,
                  :use,
                  :used,
                  :number_of_uses

    def use(inventory = nil)
      'That item does not do anything...yet.'
    end

    def describe
      status_text =  name.upcase.colorize(:green)
      status_text << "\n#{description} \n".colorize(:white)
      status_text << "ATTACK: #{atk_lo.to_s.rjust(2)}-#{atk_hi.to_s.rjust(2)} ".colorize(:white) unless atk_lo.nil?
      status_text << "TAKEABLE? #{takeable} ".colorize(:white)
      status_text << "USEABLE? #{useable} ".colorize(:white)
      status_text << "EQUIPPABLE? #{equippable} ".colorize(:white)
      status_text << "\n"
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
gemwarrior-0.9.37 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.36 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.35 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.34 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.33 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.32 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.31 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.30 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.28 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.27 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.26 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.24 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.23 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.22 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.21 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.20 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.19 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.18 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.17 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.16 lib/gemwarrior/entities/item.rb