> 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-enemy-action.md).

# RPG::Enemy::Action

Data class for enemy \[Actions].

## Superclass

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

## Referrer

* [RPG::Enemy](/rgss-reference-manual/game-library/rpgxp-data-structures/rpg-enemy.md)

## Attributes

### kind

Type of action (0: basic, 1: skill).

### basic

When set to a \[Basic] action, defines it further (0: attack, 1: defend, 2: escape, 3: do nothing).

### skill\_id

When set to a \[Skill], the ID of that skill.

### condition\_turn\_acondition\_turn\_b

a and b values specified in the \[Turn] condition. To be input in the form a + bx.

When the turn is not specified as a condition, a = 0 and b = 1.

### condition\_hp

Percentage specified in the \[HP] condition.

When HP is not specified as a condition, this value is set to 100.

### condition\_level

Standard level specified in the \[Level] condition.

When the level is not specified as a condition, this value is set to 1.

### condition\_switch\_id

Switch ID specified in the \[Switch] condition.

When the switch ID is not specified as a condition, this value is set to 0. Consequently, it is essential to check whether this value is 0.

### rating

The action's rating (1..10).

## Definition

```ruby
module RPG
  class Enemy
    class Action
      def initialize
        @kind = 0
        @basic = 0
        @skill_id = 1
        @condition_turn_a = 0
        @condition_turn_b = 1
        @condition_hp = 100
        @condition_level = 1
        @condition_switch_id = 0
        @rating = 5
      end
      attr_accessor :kind
      attr_accessor :basic
      attr_accessor :skill_id
      attr_accessor :condition_turn_a
      attr_accessor :condition_turn_b
      attr_accessor :condition_hp
      attr_accessor :condition_level
      attr_accessor :condition_switch_id
      attr_accessor :rating
    end
  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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
