Sha256: a592836a7da070b4de6373330f53204fef7806368a5afcdc0dca51fd612c676a

Contents?: true

Size: 945 Bytes

Versions: 15

Compression:

Stored size: 945 Bytes

Contents

# lib/gemwarrior/entities/armor.rb
# Entity::Item::Armor base class

require_relative 'item'

module Gemwarrior
  class Armor < Item
    attr_accessor :defense

    def initialize
      super

      self.equippable = true
      self.defense    = 0
      self.is_armor   = true
    end

    def use(world)
      'Save the donning of this piece of armor for battle.'
    end

    def describe
      desc_text =  "\"#{name_display}\"\n".colorize(:yellow)
      desc_text << "(#{name})\n".colorize(:green)
      desc_text << "#{description}\n".colorize(:white)
      desc_text << "DEFENSE:    #{defense}\n".colorize(:white)
      desc_text << "TAKEABLE?   #{takeable}\n".colorize(:white)
      desc_text << "USEABLE?    #{useable}\n".colorize(:white)
      desc_text << "EQUIPPABLE? #{equippable}\n".colorize(:white)
      desc_text << "EQUIPPED?   #{equipped}\n".colorize(:white)
      desc_text
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gemwarrior-0.12.8 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.7 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.6 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.5 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.4 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.3 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.2 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.1 lib/gemwarrior/entities/armor.rb
gemwarrior-0.12.0 lib/gemwarrior/entities/armor.rb
gemwarrior-0.11.5 lib/gemwarrior/entities/armor.rb
gemwarrior-0.11.4 lib/gemwarrior/entities/armor.rb
gemwarrior-0.11.3 lib/gemwarrior/entities/armor.rb
gemwarrior-0.11.2 lib/gemwarrior/entities/armor.rb
gemwarrior-0.11.1 lib/gemwarrior/entities/armor.rb
gemwarrior-0.11.0 lib/gemwarrior/entities/armor.rb