Sha256: 7f3f01049f40bdd196ba4aa099435f133afc5f152471fc418eb97a038a395470

Contents?: true

Size: 970 Bytes

Versions: 7

Compression:

Stored size: 970 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

    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

7 entries across 7 versions & 1 rubygems

Version Path
gemwarrior-0.9.10 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.9 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.8 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.7 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.6 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.5 lib/gemwarrior/entities/item.rb
gemwarrior-0.9.4 lib/gemwarrior/entities/item.rb