📜
RGSS Reference Manual
  • RGSS Reference Manual
  • RGSS Specifications
  • Ruby Syntax
    • Syntax and Expressions
    • Variables and Constants
    • Literals
    • Operator Expressions
    • Control Structures
    • Method Calls
    • Class and Method Definitions
  • Standard Library
    • Built-in Functions
    • Built-in Variables
    • Built-in Classes
      • Object
        • Array
        • Exception
        • FalseClass
        • Hash
        • IO
          • File
        • MatchData
        • Module
          • Class
        • NilClass
        • Numeric
          • Integer
            • Bignum
            • Fixnum
          • Float
        • Range
        • Proc
        • Regexp
        • String
        • Symbol
        • Time
        • TrueClass
    • Built-in Modules
      • Comparable
      • Enumerable
      • Errno
      • FileTest
      • GC
      • Kernel
      • Marshal
      • Math
    • Built-in Exception Classes
  • Game Library
    • RGSS Built-in Functions
    • RGSS Built-in Classes
      • Bitmap
      • Color
      • Font
      • Plane
      • Rect
      • Sprite
      • Table
      • Tilemap
      • Tone
      • Viewport
      • Window
      • RGSSError
      • RPG::Sprite
      • RPG::Weather
    • RGSS Built-in Modules
      • Audio
      • Graphics
      • Input
      • RPG
      • RPG::Cache
    • RPGXP Data Structures
      • RPG::Map
      • RPG::MapInfo
      • RPG::Event
      • RPG::Event::Page
      • RPG::Event::Page::Condition
      • RPG::Event::Page::Graphic
      • RPG::EventCommand
      • RPG::MoveRoute
      • RPG::MoveCommand
      • RPG::Actor
      • RPG::Class
      • RPG::Class::Learning
      • RPG::Skill
      • RPG::Item
      • RPG::Weapon
      • RPG::Armor
      • RPG::Enemy
      • RPG::Enemy::Action
      • RPG::Troop
      • RPG::Troop::Member
      • RPG::Troop::Page
      • RPG::Troop::Page::Condition
      • RPG::State
      • RPG::Animation
      • RPG::Animation::Frame
      • RPG::Animation::Timing
      • RPG::Tileset
      • RPG::CommonEvent
      • RPG::System
      • RPG::System::Words
      • RPG::System::TestBattler
      • RPG::AudioFile
  • Appendix
    • Regular Expression
    • sprintf Format
Powered by GitBook
On this page
  • Superclass
  • Attributes
  • id
  • name
  • battler_name
  • battler_hue
  • maxhp
  • maxsp
  • str
  • dex
  • agi
  • int
  • atk
  • pdef
  • mdef
  • eva
  • animation1_id
  • animation2_id
  • element_ranks
  • state_ranks
  • actions
  • exp
  • gold
  • item_id
  • weapon_id
  • armor_id
  • treasure_prob
  • Inner Class
  • Definition
  1. Game Library
  2. RPGXP Data Structures

RPG::Enemy

Data class for enemies.

PreviousRPG::ArmorNextRPG::Enemy::Action

Last updated 1 year ago

Superclass

Attributes

id

The enemy ID.

name

The enemy name.

battler_name

The enemy's battler graphic file name.

battler_hue

The adjustment value for the battler graphic's hue (0..360).

maxhp

The enemy's max HP.

maxsp

The enemy's max SP.

str

The enemy's strength.

dex

The enemy's dexterity.

agi

The enemy's agility.

int

The enemy's intelligence.

atk

The enemy's attack power.

pdef

The enemy's physical defense rating.

mdef

The enemy's magic defense rating.

eva

The enemy's evasion rating.

animation1_id

The battle animation ID.

animation2_id

The target animation ID.

element_ranks

state_ranks

actions

exp

The enemy's experience.

gold

The enemy's gold.

item_id

The ID of the item used as treasure.

weapon_id

The ID of the weapon used as treasure.

armor_id

The ID of the armor used as treasure.

treasure_prob

The probability of treasure being left behind.

Inner Class

Definition

module RPG
  class Enemy
    def initialize
      @id = 0
      @name = ""
      @battler_name = ""
      @battler_hue = 0
      @maxhp = 500
      @maxsp = 500
      @str = 50
      @dex = 50
      @agi = 50
      @int = 50
      @atk = 100
      @pdef = 100
      @mdef = 100
      @eva = 0
      @animation1_id = 0
      @animation2_id = 0
      @element_ranks = Table.new(1)
      @state_ranks = Table.new(1)
      @actions = [RPG::Enemy::Action.new]
      @exp = 0
      @gold = 0
      @item_id = 0
      @weapon_id = 0
      @armor_id = 0
      @treasure_prob = 100
    end
    attr_accessor :id
    attr_accessor :name
    attr_accessor :battler_name
    attr_accessor :battler_hue
    attr_accessor :maxhp
    attr_accessor :maxsp
    attr_accessor :str
    attr_accessor :dex
    attr_accessor :agi
    attr_accessor :int
    attr_accessor :atk
    attr_accessor :pdef
    attr_accessor :mdef
    attr_accessor :eva
    attr_accessor :animation1_id
    attr_accessor :animation2_id
    attr_accessor :element_ranks
    attr_accessor :state_ranks
    attr_accessor :actions
    attr_accessor :exp
    attr_accessor :gold
    attr_accessor :item_id
    attr_accessor :weapon_id
    attr_accessor :armor_id
    attr_accessor :treasure_prob
  end
end

Level of elemental effectiveness. 1-dimensional array using element IDs as subscripts (), with 6 levels (0: A, 1: B, 2: C, 3: D, 4: E, 5: F).

Level of status effectiveness. 1-dimensional array using status IDs as subscripts (), with 6 levels (0: A, 1: B, 2: C, 3: D, 4: E, 5: F).

The enemy's actions. An array.

Object
Table
Table
RPG::Enemy::Action
RPG::Enemy::Action