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