Sha256: 5863e171c654c30b1befeb6606e442199c50c3ab36704c55700c878d88657589

Contents?: true

Size: 1.54 KB

Versions: 12

Compression:

Stored size: 1.54 KB

Contents

# lib/gemwarrior/entities/weapon.rb
# Entity::Item::Weapon base class

require_relative 'item'

module Gemwarrior
  class Weapon < Item
    attr_accessor :atk_lo,
                  :atk_hi,
                  :dex_mod,
                  :is_weapon

    def initialize
      super

      self.atk_lo       = 0
      self.atk_hi       = 0
      self.dex_mod      = 0
      self.takeable     = true
      self.equippable   = true
      self.is_weapon    = true
    end

    def use(world)
      'Save the brandishing of your weapon 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 << "WEAPON?         #{is_weapon}\n".colorize(:white)
      desc_text << "ATTACK_RANGE  : #{atk_lo}-#{atk_hi}\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

12 entries across 12 versions & 1 rubygems

Version Path
gemwarrior-0.15.20 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.19 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.18 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.17 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.16 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.15 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.14 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.13 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.12 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.11 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.10 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.15.9 lib/gemwarrior/entities/weapon.rb