Sha256: d60798ef681caf88cf4df561f4998d7956780a8ffe6702121845ec93d2fd9116

Contents?: true

Size: 1.07 KB

Versions: 15

Compression:

Stored size: 1.07 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,
                  :is_weapon

    def initialize
      super

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

    def use(world)
      'Save the using 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 << "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 << "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/weapon.rb
gemwarrior-0.12.7 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.12.6 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.12.5 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.12.4 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.12.3 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.12.2 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.12.1 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.12.0 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.11.5 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.11.4 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.11.3 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.11.2 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.11.1 lib/gemwarrior/entities/weapon.rb
gemwarrior-0.11.0 lib/gemwarrior/entities/weapon.rb