Class: Game_Actor

Inherits:
Game_Battler show all
Defined in:
scripts/00600 Script_RMXP/00600 Game_Battler.rb

Overview

Describe a player

Instance Attribute Summary collapse

Attributes inherited from Game_Battler

#animation_hit, #animation_id, #battler_hue, #blink, #critical, #damage, #hidden, #hp, #sp, #states, #white_flash

Instance Method Summary collapse

Methods inherited from Game_Battler

#agi, #atk, #dead?, #dex, #eva, #exist?, #hit, #int, #mdef, #pdef, #str

Constructor Details

#initialize(actor_id) ⇒ Game_Actor

Initialize a new Game_Actor

Parameters:

  • actor_id (Integer)

    the id of the actor in the database



174
175
176
177
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 174

def initialize(actor_id)
  super()
  setup(actor_id)
end

Instance Attribute Details

#battler_name (readonly)

Returns the value of attribute battler_name.



167
168
169
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 167

def battler_name
  @battler_name
end

#character_hue (readonly)

Returns the value of attribute character_hue.



166
167
168
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 166

def character_hue
  @character_hue
end

#character_name (readonly)

Returns the value of attribute character_name.



165
166
167
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 165

def character_name
  @character_name
end

#exp

Returns the value of attribute exp.



169
170
171
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 169

def exp
  @exp
end

#level

Returns the value of attribute level.



168
169
170
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 168

def level
  @level
end

#name

Returns the value of attribute name.



164
165
166
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 164

def name
  @name
end

#skills (readonly)

Returns the value of attribute skills.



170
171
172
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 170

def skills
  @skills
end

Instance Method Details

#idInteger

id of the Game_Actor in the database

Returns:



193
194
195
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 193

def id
  return @actor_id
end

#indexInteger?

index of the Game_Actor in the $game_party.

Returns:



199
200
201
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 199

def index
  return $game_party.actors.index(self)
end

#screen_x

Deprecated.

will be removed.



229
230
231
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 229

def screen_x
  return 0
end

#screen_y

Deprecated.

will be removed.



234
235
236
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 234

def screen_y
  return 464
end

#screen_z

Deprecated.

will be removed.



239
240
241
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 239

def screen_z
  return 0
end

#set_graphic(character_name, character_hue, battler_name, battler_hue)

Update the graphics of the Game_Actor

Parameters:

  • character_name (String)

    name of the character in Graphics/Characters

  • character_hue (0)

    ignored by the cache

  • battler_name (String)

    name of the battler in Graphics/Battlers

  • battler_hue (0)

    ignored by the cache



221
222
223
224
225
226
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 221

def set_graphic(character_name, character_hue, battler_name, battler_hue)
  @character_name = character_name
  @character_hue = character_hue
  @battler_name = battler_name
  @battler_hue = battler_hue
end

#setup(actor_id)

setup the Game_Actor object

Parameters:

  • actor_id (Integer)

    the id of the actor in the database



181
182
183
184
185
186
187
188
189
# File 'scripts/00600 Script_RMXP/00600 Game_Battler.rb', line 181

def setup(actor_id)
  actor = $data_actors[actor_id]
  @actor_id = actor_id
  @name = actor.name
  @character_name = actor.character_name
  @character_hue = actor.character_hue
  @battler_name = actor.battler_name
  @battler_hue = actor.battler_hue
end