RPG::Weapon

The data class for weapons.

Superclass

Attributes

wtype_id

The weapon type ID.

animation_id

The animation ID when using the weapon.

Method

performance

Evaluates weapon performance. Used by the Ultimate Equipment command.

Returns the total of attack + magic defense + all parameters.

Definition

class RPG::Weapon < RPG::EquipItem
  def initialize
    super
    @wtype_id = 0
    @animation_id = 0
    @features.push(RPG::BaseItem::Feature.new(31, 1, 0))
    @features.push(RPG::BaseItem::Feature.new(22, 0, 0))
  end
  def performance
    params[2] + params[4] + params.inject(0) {|r, v| r += v }
  end
  attr_accessor :wtype_id
  attr_accessor :animation_id
end