> For the complete documentation index, see [llms.txt](https://enls.gitbook.io/rgss-reference-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enls.gitbook.io/rgss-reference-manual/game-library/rpgxp-data-structures/rpg-weapon.md).

# RPG::Weapon

## Superclass

* [Object](/rgss-reference-manual/standard-library/built-in-classes/object.md)

## Attributes

### id

The weapon ID.

### name

The weapon name.

### icon\_name

The weapon's icon graphic file name.

### description

The weapon description.

### animation1\_id

The animation ID when using the weapon.

### animation2\_id

The animation ID when on the receiving end of the weapon.

### price

The weapon's price.

### atk

The weapon's attack power.

### pdef

The weapon's physical defense rating.

### mdef

The weapon's magic defense rating.

### str\_plus

The weapon's strength bonus.

### dex\_plus

The weapon's dexterity bonus.

### agi\_plus

The weapon's agility bonus.

### int\_plus

The weapon's intelligence bonus.

### element\_set

The weapon's element. An Elemental ID array.

### plus\_state\_set

States to add. A State ID array.

### minus\_state\_set

States to cancel. A State ID array.

## Definition

```ruby
module RPG
  class Weapon
    def initialize
      @id = 0
      @name = ""
      @icon_name = ""
      @description = ""
      @animation1_id = 0
      @animation2_id = 0
      @price = 0
      @atk = 0
      @pdef = 0
      @mdef = 0
      @str_plus = 0
      @dex_plus = 0
      @agi_plus = 0
      @int_plus = 0
      @element_set = []
      @plus_state_set = []
      @minus_state_set = []
    end
    attr_accessor :id
    attr_accessor :name
    attr_accessor :icon_name
    attr_accessor :description
    attr_accessor :animation1_id
    attr_accessor :animation2_id
    attr_accessor :price
    attr_accessor :atk
    attr_accessor :pdef
    attr_accessor :mdef
    attr_accessor :str_plus
    attr_accessor :dex_plus
    attr_accessor :agi_plus
    attr_accessor :int_plus
    attr_accessor :element_set
    attr_accessor :plus_state_set
    attr_accessor :minus_state_set
  end
end
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://enls.gitbook.io/rgss-reference-manual/game-library/rpgxp-data-structures/rpg-weapon.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
