# RPG::Enemy::Action

## Superclass

* [Object](https://enls.gitbook.io/rgss-reference-manual/standard-library/built-in-classes/object)

## Referrer

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

## 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
```
