RPG::Enemy::Action

Data class for enemy [Actions].

Superclass

Referrer

Attributes

kind

Type of action.

0: Basic
1: Skill
basic

When set to a [Basic] action, defines it further.

0: Attack
1: Guard
2: Escape
3: Do Nothing
skill_id

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

condition_type

The type of condition.

0: Always
1: Turn No.
2: HP
3: MP
4: State
5: Party Level
6: Switch
condition_param1
condition_param2

A condition parameter. Shared by all types.

For example, if the condition is [HP], then condition_param1 will be the minimum value and condition_param2 will be the maximum value.

rating

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

Methods

skill?

Determines if kind is skill or not. Returns true if kind is 1.

Definition

module RPG
  class Enemy
    class Action
      def initialize
        @kind = 0
        @basic = 0
        @skill_id = 1
        @condition_type = 0
        @condition_param1 = 0
        @condition_param2 = 0
        @rating = 5
      end
      def skill?
        return @kind == 1
      end
      attr_accessor :kind
      attr_accessor :basic
      attr_accessor :skill_id
      attr_accessor :condition_type
      attr_accessor :condition_param1
      attr_accessor :condition_param2
      attr_accessor :rating
    end
  end
end
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)