Sha256: c75edc25794da7ed272dbbc7e1cb91a8367f2708b49f91dae3c8f20b0b3e9b2d

Contents?: true

Size: 1.34 KB

Versions: 33

Compression:

Stored size: 1.34 KB

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_detailed
      desc_text =  "\"#{name_display}\"\n".colorize(:yellow)
      desc_text << "(#{name})\n".colorize(:green)
      desc_text << "#{description}\n".colorize(:white)
      desc_text << "ARMOR?      #{is_armor}\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 << "TALKABLE?   #{talkable}\n".colorize(:white)
      desc_text << "CONSUMABLE? #{consumable}\n".colorize(:white)
      desc_text << "EQUIPPABLE? #{equippable}\n".colorize(:white)
      desc_text << "EQUIPPED?   #{equipped}\n".colorize(:white)
      desc_text << "USED?       #{used}\n".colorize(:white)
      desc_text << "USED AGAIN? #{used_again}\n".colorize(:white)
      desc_text << "USES LEFT?  #{number_of_uses}\n".colorize(:white) unless number_of_uses.nil?
      desc_text
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
gemwarrior-0.15.20 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.19 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.18 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.17 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.16 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.15 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.14 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.13 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.12 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.11 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.10 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.9 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.8 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.7 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.6 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.5 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.4 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.3 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.2 lib/gemwarrior/entities/armor.rb
gemwarrior-0.15.1 lib/gemwarrior/entities/armor.rb