RPG Maker
 

 Username:
 Password:
   Not a member? Register!

Home > RGSS Script Reference > Game_Actor

Game_Actor


Inherits from: Game_Battler

Description: This class defines an actor, with all of the typical data elements such as level, equipment, and skill progression. This class refers to the global arrays $game_actors and $game_party.

Code


class Game_Actor < Game_Battler
# ------------------------------------   
  attr_reader   :name                     
  attr_reader   :character_name           
  attr_reader   :character_hue            
  attr_reader   :class_id                 
  attr_reader   :weapon_id                
  attr_reader   :armor1_id                
  attr_reader   :armor2_id                
  attr_reader   :armor3_id                
  attr_reader   :armor4_id                
  attr_reader   :level                    
  attr_reader   :exp                      
  attr_reader   :skills                  
# ------------------------------------   
  def initialize(actor_id)
    super()
    setup(actor_id)
  end
# ------------------------------------   
  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
    @class_id = actor.class_id
    @weapon_id = actor.weapon_id
    @armor1_id = actor.armor1_id
    @armor2_id = actor.armor2_id
    @armor3_id = actor.armor3_id
    @armor4_id = actor.armor4_id
    @level = actor.initial_level
    @exp_list = Array.new(101)
    make_exp_list
    @exp = @exp_list[@level]
    @skills = []
    @hp = maxhp
    @sp = maxsp
    for i in 1..@level
      for j in $data_classes[@class_id].learnings
        if j.level == i
          learn_skill(j.skill_id)
        end
      end
    end
    update_auto_state(nil, $data_armors[@armor1_id])
    update_auto_state(nil, $data_armors[@armor2_id])
    update_auto_state(nil, $data_armors[@armor3_id])
    update_auto_state(nil, $data_armors[@armor4_id])
  end
# ------------------------------------   
  def id
    return @actor_id
  end
# ------------------------------------   
  def index
    return $game_party.actors.index(self)
  end
# ------------------------------------   
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    pow_i = 2.4 + actor.exp_inflation / 100.0
    for i in 2..100
      if i > actor.final_level
        @exp_list[i] = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list[i] = @exp_list[i-1] + Integer(n)
      end
    end
  end


# ------------------------------------   
  def element_rate(element_id)
    table = [0,200,150,100,50,0,-100]
    result = table[$data_classes[@class_id].element_ranks[element_id]]
    f = false
    for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
      armor = $data_armors[i]
      if armor != nil
        f |= armor.guard_element_set.include?(element_id)
      end
    end
    if f
      result /= 2
    end
    f = false
    for i in @states
      f |= $data_states[i].guard_element_set.include?(element_id)
    end
    if f
      result /= 2
    end
    return result
  end
# ------------------------------------   
  def state_ranks
    return $data_classes[@class_id].state_ranks
  end
# ------------------------------------   
  def state_guard?(state_id)
    for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
      armor = $data_armors[i]
      if armor != nil
        if armor.guard_state_set.include?(state_id)
          return true
        end
      end
    end
    return false
  end
# ------------------------------------   
  def element_set
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.element_set : []
  end
# ------------------------------------   
  def plus_state_set
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.plus_state_set : []
  end
# ------------------------------------   
  def minus_state_set
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.minus_state_set : []
  end
# ------------------------------------   
  def base_maxhp
    return $data_actors[@actor_id].parameters[0, @level]
  end
# ------------------------------------   
  def base_maxsp
    return $data_actors[@actor_id].parameters[1, @level]
  end
# ------------------------------------   
  def base_str
    n = $data_actors[@actor_id].parameters[2, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.str_plus : 0
    n += armor1 != nil ? armor1.str_plus : 0
    n += armor2 != nil ? armor2.str_plus : 0
    n += armor3 != nil ? armor3.str_plus : 0
    n += armor4 != nil ? armor4.str_plus : 0
    return [[n, 1].max, 999].min
  end
# ------------------------------------   
  def base_dex
    n = $data_actors[@actor_id].parameters[3, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [[n, 1].max, 999].min
  end
# ------------------------------------   
  def base_agi
    n = $data_actors[@actor_id].parameters[4, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.agi_plus : 0
    n += armor1 != nil ? armor1.agi_plus : 0
    n += armor2 != nil ? armor2.agi_plus : 0
    n += armor3 != nil ? armor3.agi_plus : 0
    n += armor4 != nil ? armor4.agi_plus : 0
    return [[n, 1].max, 999].min
  end
# ------------------------------------   
  def base_int
    n = $data_actors[@actor_id].parameters[5, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.int_plus : 0
    n += armor1 != nil ? armor1.int_plus : 0
    n += armor2 != nil ? armor2.int_plus : 0
    n += armor3 != nil ? armor3.int_plus : 0
    n += armor4 != nil ? armor4.int_plus : 0
    return [[n, 1].max, 999].min
  end
# ------------------------------------   
  def base_atk
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.atk : 0
  end
# ------------------------------------   
  def base_pdef
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    pdef1 = weapon != nil ? weapon.pdef : 0
    pdef2 = armor1 != nil ? armor1.pdef : 0
    pdef3 = armor2 != nil ? armor2.pdef : 0
    pdef4 = armor3 != nil ? armor3.pdef : 0
    pdef5 = armor4 != nil ? armor4.pdef : 0
    return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
  end
# ------------------------------------   
  def base_mdef
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    mdef1 = weapon != nil ? weapon.mdef : 0
    mdef2 = armor1 != nil ? armor1.mdef : 0
    mdef3 = armor2 != nil ? armor2.mdef : 0
    mdef4 = armor3 != nil ? armor3.mdef : 0
    mdef5 = armor4 != nil ? armor4.pdef : 0
    return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
  end
# ------------------------------------   
  def base_eva
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    eva1 = armor1 != nil ? armor1.eva : 0
    eva2 = armor2 != nil ? armor2.eva : 0
    eva3 = armor3 != nil ? armor3.eva : 0
    eva4 = armor4 != nil ? armor4.eva : 0
    return eva1 + eva2 + eva3 + eva4
  end
# ------------------------------------   
  def animation1_id
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.animation1_id : 0
  end
# ------------------------------------   
  def animation2_id
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.animation2_id : 0
  end
# ------------------------------------   
  def class_name
    return $data_classes[@class_id].name
  end
# ------------------------------------   
  def exp_s
    return @exp_list[@level+1] > 0 ? @exp.to_s : "-------"
  end
# ------------------------------------   
  def next_exp_s
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------"
  end
# ------------------------------------   
  def next_rest_exp_s
    return @exp_list[@level+1] > 0 ?
      (@exp_list[@level+1] - @exp).to_s : "-------"
  end
# ------------------------------------   
  def update_auto_state(old_armor, new_armor)
    if old_armor != nil and old_armor.auto_state_id != 0
      remove_state(old_armor.auto_state_id, true)
    end
    if new_armor != nil and new_armor.auto_state_id != 0
      add_state(new_armor.auto_state_id, true)
    end
  end
# ------------------------------------   
  def equip_fix?(equip_type)
    case equip_type
    when 0  
      return $data_actors[@actor_id].weapon_fix
    when 1  
      return $data_actors[@actor_id].armor1_fix
    when 2  
      return $data_actors[@actor_id].armor2_fix
    when 3  
      return $data_actors[@actor_id].armor3_fix
    when 4  
      return $data_actors[@actor_id].armor4_fix
    end
    return false
  end
# ------------------------------------   
  def equip(equip_type, id)
    case equip_type
    when 0  
      if id == 0 or $game_party.weapon_number(id) > 0
        $game_party.gain_weapon(@weapon_id, 1)
        @weapon_id = id
        $game_party.lose_weapon(id, 1)
      end
    when 1  
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor1_id], $data_armors[id])
        $game_party.gain_armor(@armor1_id, 1)
        @armor1_id = id
        $game_party.lose_armor(id, 1)
      end
    when 2  
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor2_id], $data_armors[id])
        $game_party.gain_armor(@armor2_id, 1)
        @armor2_id = id
        $game_party.lose_armor(id, 1)
      end
    when 3  
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor3_id], $data_armors[id])
        $game_party.gain_armor(@armor3_id, 1)
        @armor3_id = id
        $game_party.lose_armor(id, 1)
      end
    when 4  
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor4_id], $data_armors[id])
        $game_party.gain_armor(@armor4_id, 1)
        @armor4_id = id
        $game_party.lose_armor(id, 1)
      end
    end
  end
# ------------------------------------  
  def equippable?(item)
    if item.is_a?(RPG::Weapon)
      if $data_classes[@class_id].weapon_set.include?(item.id)
        return true
      end
    end
    if item.is_a?(RPG::Armor)
      if $data_classes[@class_id].armor_set.include?(item.id)
        return true
      end
    end
    return false
  end
# ------------------------------------   
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    while @exp < @exp_list[@level]
      @level -= 1
    end
  end
# ------------------------------------   
  def level=(level)
    level = [[level, $data_actors[@actor_id].final_level].min, 1].max
    self.exp = @exp_list[level]
  end
# ------------------------------------ 
  def learn_skill(skill_id)
    if skill_id > 0 and not skill_learn?(skill_id)
      @skills.push(skill_id)
      @skills.sort!
    end
  end
# ------------------------------------   
  def forget_skill(skill_id)
    @skills.delete(skill_id)
  end
# ------------------------------------   
  def skill_learn?(skill_id)
    return @skills.include?(skill_id)
  end
# ------------------------------------ 
  def skill_can_use?(skill_id)
    if not skill_learn?(skill_id)
      return false
    end
    return super
  end
# ------------------------------------   
  def name=(name)
    @name = name
  end
# ------------------------------------   
  def class_id=(class_id)
    if $data_classes[class_id] != nil
      @class_id = class_id
      unless equippable?($data_weapons[@weapon_id])
        equip(0, 0)
      end
      unless equippable?($data_armors[@armor1_id])
        equip(1, 0)
      end
      unless equippable?($data_armors[@armor2_id])
        equip(2, 0)
      end
      unless equippable?($data_armors[@armor3_id])
        equip(3, 0)
      end
      unless equippable?($data_armors[@armor4_id])
        equip(4, 0)
      end
    end
  end
# ------------------------------------   
  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
# ------------------------------------   
  def screen_x
    if self.index != nil
      return self.index * 160 + 80
    else
      return 0
    end
  end
# ------------------------------------   
  def screen_y
    return 464
  end
# ------------------------------------ 
  def screen_z
    if self.index != nil
      return 4 - self.index
    else
      return 0
    end
  end
end

Properties


Name: The actor's name.

Character_Name: The file from which the sprite is drawn.

Character_Hue: The hue modification of the actor's sprite. This can be changed in the "actor" section of the database by clicking on the character graphic and using the slider at the bottom of the window.

Battler_Name: The file from which the actor's battle image is drawn.

Battler_Hue: The hue modification of the actor's battle image. This can be changed in the "actor" section of the database by clicking on the battle graphic and using the slider at the bottom of the window.

Class_ID: The actor's class ID, as found in $game_classes

Weapon_ID: The actor's currently equipped weapon.

Armor1_ID: The actor's currently equipped shield.

Armor2_ID: The actor's currently equipped helmet.

Armor3_ID: The actor's currently equipped armor.

Armor4_ID: The actor's currently equipped accessory.

Level: The actor's current level

EXP: The actor's current experience points.

Skills: An array containing the actor's list of skills.

Exp_List: The actor's list of EXP requirements to gain each level. Note that @exp_list[0] and @exp_list[100] must always be zero.

HP: The actor's current HP.

SP: The actor's current SP.

Methods


Initialize

Arguments:
Actor_ID: The ID of the actor as found in $data_actors.
Local Variables: None

How it Works: Sets up the actor by calling Game_Battler#Initialize to set up those attributes common to both actors and monsters, then calling the Game_Actor#Setup method to set up the attributes unique to actors.

Setup

Arguments:
Actor_ID: The ID of the actor as found in $data_actors
Local Variables:
Actor: Used to pinpoint the array index of $data_actors from which to get the actor data.

How it Works: Sets up those attributes that are unique to actors. The loop at the end of this method iterates through the actor's array of skills for each level between 1 and its starting level. If the level requirement for that skill is equal to the current value of the loop control variable for level, that skill is added to the actor's @skills array.

ID

Arguments: None
Local Variables: None

How it Works: Returns the current value of the @actor_id instance variable.

Index

Arguments: None
Local Variables: None

How it Works: Returns the actor's relative position in the party. If the actor isn't in the party, this method returns 0.

Make_Exp_List

Arguments: None
Local Variables:
Actor: Used to pinpoint the array index of $data_actors from which to get the actor data.

How it Works: This method creates each actor's EXP progression table. It first sets @exp_list[1] to 0, since level 1 always requires 0 EXP. Next, the method sets the value of pow_i, which is equal to 2.4 + the actor's EXP inflation value (the right-hand slider in the EXP curve setup window), divided by 100. pow_i is then used in calcuating each subsequent level's EXP requirement as a function of the last level's requirement. Note that actor.exp_basis is the value of the left-hand slider in the EXP curve setup window. If the current level being processed is higher than the actor's highest possible level, then the value for that level is set to 0, which is a sentry value for "can't gain any more levels" if it appears in array index 2 or greater.

Element_Rate

Arguments:
Element_ID: The element ID of the element for which the resistance table is being created.
Local Variables:
Table: An array of the six elemental damage multipliers from A-F. By default, this array contains the values [0,200,150,100,50,0,-100]. The first 0 is a buffer value.
Result: The elemental damage multiplier that is returned to the caller.
f: A boolean value that is true if any of the actor's equipped items or status effects grant defense to that element. If f is true, the damage multiplier is divided by 2. Note that f is evaluated twice, once for equipped items, then reset and evaluated for status effects, so if both equipment and status effects defend against the element, the damage multiplier will be divided by 4.

How it Works: This method returns the current damage multiplier for this actor with regard to the element passed to it.

State_Ranks

Arguments: None
Local Variables: None

How it Works: Returns the array of status resistance values for the class.

State_Guard

Arguments:
State_ID: The ID of the status ailment to check for defense.
Local Variables: None

How it Works: Checks to see if any of the actor's equipment provides defense against the status ailment passed to this method. Returns true if it does.

Element_Set

Arguments: None
Local Variables: None

How it Works: Sets the element for the weapon's attack. Returns an empty array if the actor has no weapon equipped.

Plus_State_Set

Arguments: None
Local Variables: None

How it Works: Sets the positive status changes for the weapon's attack. Returns an empty array if the actor has no weapon equipped.

Minus_State_Set

Arguments: None
Local Variables: None

How it Works: Sets the negative status changes for the weapon's attack. Returns an empty array if the actor has no weapon equipped.

Base_MaxHP

Arguments: None
Local Variables: None

How it Works: Returns the actor's base Maximum HP. The return value of this method does not include the effects of any status effects or base statistic changes resulting from events.

Base_MaxSP

Arguments: None
Local Variables: None

How it Works: Returns the actor's base Maximum SP. The return value of this method does not include the effects of any status effects or base statistic changes resulting from events.

Base_Str

Arguments: None
Local Variables:
n: The running total of the value as it adds each element.

How it Works: Returns the actor's base Strength, including equipment modifications, but not modifications from status effects or base statistic changes resulting from events.

Base_Dex

Arguments: None
Local Variables:
n: The running total of the value as it adds each element.

How it Works: Returns the actor's base Dexterity, including equipment modifications, but not modifications from status effects or base statistic changes resulting from events.

Base_Agi

Arguments: None
Local Variables:
n: The running total of the value as it adds each element.

How it Works: Returns the actor's base Agility, including equipment modifications, but not modifications from status effects or base statistic changes resulting from events.

Base_Int

Arguments: None
Local Variables:
n: The running total of the value as it adds each element.

How it Works: Returns the actor's base Intelligence, including equipment modifications, but not modifications from status effects or base statistic changes resulting from events.

Base_atk

Arguments: None
Local Variables: None

How it Works: Returns the attack power of the currently equipped weapon, or 0 if no weapon is equipped. Note that attack power isn't the sole determinant of damage, as in previous Maker products.

Base_pdef

Arguments: None
Local Variables: None

How it Works: Returns the composite physical defense value of all of the actor's equipment.

Base_mdef

Arguments: None
Local Variables: None

How it Works: Returns the composite magic defense value of all of the actor's equipment.

Base_eva

Arguments: None
Local Variables: None

How it Works: Returns the composite evasion value of all of the actor's equipment.

Animation1_ID

Arguments: None
Local Variables: None

How it Works: Returns the attacker animation for the actor's currently equipped weapon.

Animation2_ID

Arguments: None
Local Variables: None

How it Works: Returns the target animation for the actor's currently equipped weapon.

Class_Name

Arguments: None
Local Variables: None

How it Works: Return's the actor's current class.

EXP_s

Arguments: None
Local Variables: None

How it Works: Returns the actor's current experience points in string format for display on the status screen. If the actor cannot gain any more levels, as signified by a value of 0 in @exp_list[@level+1], the method returns "-------" instead.

Next_EXP_s

Arguments: None
Local Variables: None

How it Works: Returns the total amount of experience points the actor needs to reach the next level in string format for display on the status screen. If the actor cannot gain any more levels, as signified by a value of 0 in @exp_list[@level+1], the method returns "-------" instead.

Next_Rest_EXP_s

Arguments: None
Local Variables: None

How it Works: Returns number of experience points remaining before the actor reaches the next level in string format for display on the status screen. If the actor cannot gain any more levels, as signified by a value of 0 in @exp_list[@level+1], the method returns "-------" instead.

Update_Auto_State

Arguments:
Old_Armor: The armor that was unequipped (0 if none)
New_Armor: The armor that was equipped in its place (0 if none)
Local Variables: None

How it Works: Removes the automatically inflicted status effects from a piece of equipment that was removed and adds the automatically inflicted status effects from a newly-equipped piece of equipment.

Equip_Fix?

Arguments:
Equip_Type: The equipment slot to check (0 = weapon, 1 = shield, 2 = helmet, 3 = armor, 4 = accessory).
Local Variables: None

How it Works: Checks to see if the equipment slot referenced by equip_type is locked for the current actor.

Equip

Arguments:
Equip_Type: The equipment slot being equipped (0 = weapon, 1 = shield, 2 = helmet, 3 = armor, 4 = accessory)
ID: The ID of the equipment being equipped (0 if unequipping)
Local Variables: None

How it Works: Equips the equipment of ID id to the equipment slot referenced in equip_type as long as the party has at least one copy of that piece of equipment. If the party does, the party first gains one copy of the piece of equipment being replaced. The value of @xxx_id where "xxx" is the type of equipment being equipped, is changed to reflect that the actor's current equipment has been changed. Then, one copy of that piece of equipment is removed from the party's stock. Finally, if equip_type is between 1 and 4 (i.e. shield, helmet, armor, or accessory), then a call to update_auto_states is made to change any automatic status effects.

Equippable?

Arguments:
Item: The item to check
Local Variables: None

How it Works: Checks to see whether the actor's current class can equip an item by comparing the weapon's ID to the class's weapon_set or armor_set array. If there's a match, true is returned.

Exp=

Arguments:
Exp: The experience point value to set.
Local Variables: None

How it Works: Allows the current EXP value to be set directly. The first while loop continues increasing the actor's level until the current EXP is no longer greater than the requirement for the next level. After that, the next loop adds any new skills that were learned as a result of levelling up. The final loop decreases the actor's level until the EXP requirement for the current level is less than the actor's EXP. Note that losing levels in this way does not cause the actor to lose skills for which he no longer meets the level requirement.

Level=

Arguments:
Level: The level to set.
Local Variables: None

How it Works: Allows the current level to be set directly. The actor's level is first set to the minimum of the level passed to the method and the actor's maximum allowed level, then set to the maximum of that value and 1. To correctly set the actor's EXP, the Exp= method is called with the minimum EXP value needed for the actor's new level.

Learn_Skill

Arguments:
Skill_ID: The ID of the skill to be learned.
Local Variables: None

How it Works: Makes the actor learn the skill with the specified ID if he hasn't learned it already. The call to @Skill.sort! sorts the actor's skill list.

Forget_Skill

Arguments:
Skill_ID: The ID of the skill to be removed.
Local Variables: None

How it Works: Makes the actor forget the skill with the specified ID if he knows it.

Skill_Learn?

Arguments:
Skill_ID: The ID of the skill to be checked.

Local Variables: None

How it Works: Returns true if the skill with the specified ID is included in the actor's array of learned skills.

Skill_Can_Use?

Arguments:
Skill_ID: The ID of the skill to be checked.
Local Variables: None

How it Works: Returns false if the actor doesn't know the skill with the specified ID. If the actor does know the skill, this method calls its superclass method, Game_Battler#Skill_Can_Use? to check if the actor can't use the skill for additional reasons, such as not having enough SP, being paralyzed, or the skill can't be used because its Usability setting prohibits it at the current time.

Name=

Arguments:
Name: The actor's new name.
Local Variables: None

How it Works: Changes the actor's name to the name passed to this method.

Class=

Arguments:
Class: The actor's new class.
Local Variables: None

How it Works: Changes the actor's class to the class passed to this method. The unless equippable? statements check to see if the actor's new class can equip the equipment the actor currently has equipped. These statements will unequip any equipment that the actor's new class isn't allowed to equip.

Learn_Skill

Arguments:
Skill_ID: The ID of the skill to be learned.
Local Variables: None

How it Works: Makes the actor learn the skill with the specified ID if he hasn't learned it already. The call to @Skill.sort! sorts the actor's skill list.

Forget_Skill

Arguments:
Skill_ID: The ID of the skill to be removed.
Local Variables: None

How it Works: Makes the actor forget the skill with the specified ID if he knows it.

Skill_Learn?

Arguments:
Skill_ID: The ID of the skill to be checked.
Local Variables: None

How it Works: Returns true if the skill with the specified ID is included in the actor's array of learned skills.

Skill_Can_Use?

Arguments:
Skill_ID: The ID of the skill to be checked.
Local Variables: None

How it Works: Returns false if the actor doesn't know the skill with the specified ID. If the actor does know the skill, this method calls its superclass method, Game_Battler#Skill_Can_Use? to check if the actor can't use the skill for additional reasons, such as not having enough SP, being paralyzed, or the skill can't be used because its Usability setting prohibits it at the current time.

Name=

Arguments:
Name: The actor's new name.
Local Variables: None

How it Works: Changes the actor's name to the name passed to this method.

Set_Graphic

Arguments:
Character_Name: The sprite graphic's filename
Character_Hue: The sprite graphic's hue modification
Battler_Name: The battle image's filename
Battler_Hue: The battle image's hue modification
Local Variables: None

How it Works: Changes the actor's graphics properties to those passed to this method.

Screen_X

Arguments: None
Local Variables: None

How it Works: Returns the X coordinate of the actor's battle image on the battle screen. By default, this is equal to 160 x index + 80, where index is the actor's relative position in the party. This method returns 0 if the actor isn't in the party.

Screen_Y

Arguments: None
Local Variables: None

How it Works: Returns the Y coordinate of the actor's battle image on the battle screen. By default, this is 464 for all actors in the party.

Screen_Z

Arguments: None
Local Variables: None

How it Works: Returns the Z-index of the actor's battle image on the battle screen. By default, this is (4 - index), where index is the actor's relative position in the party. 
Syntax
@
@@
$
alias
[array index]
attr_accessor
attr_reader
attr_writer
class
def
do
ensure
for
if
[iterator]
key => value
new
next
nil
redo
require
return
rescue
self
super
undef
unless
until
while
yield

Classes
Arrow_Actor
Arrow_Base
Arrow_Enemy
Game_Actor
Game_Actors
Game_BattleAct
Game_Battler
Game_Character
Game_Common
Game_Enemy
Game_Event
Game_Map
Game_Party
Game_Picture
Game_Player
Game_Screen
Game_SlfSwitch
Game_Switches
Game_System
Game_Troop
Game_Variables
Interpreter
Scene_Debug
Scene_End
Scene_Equip
Scene_File
Scene_Gameover
Scene_Item
Scene_Load
Scene_Map
Scene_Menu
Scene_Name
Scene_Save
Scene_Shop
Scene_Skill
Scene_Status
Scene_Title
Sprite_Battler
Sprite_Character
Sprite_Picture
Sprite_Timer
Spriteset_Battle
Spriteset_Map
Window_Base
Window_Battleresult
Window_Battlestatus
Window_Command
Window_DebugLeft
Window_DebugRight
Window_EquipItem
Window_EquipLeft
Window_EquipRight
Window_Gold
Window_Help
Window_InputNumb
Window_Item
Window_MenuStatus
Window_Message
Window_NameEdit
Window_NameInput
Window_PartyCom
Window_PlayTime
Window_SaveFile
Window_Selectable
Window_ShopBuy
Window_ShopCom
Window_ShopNum
Window_ShopSell
Window_ShopStatus
Window_Skill
Window_SkillStatus
Window_Status
Window_Steps
Window_Target

Other
Class Hierarchy
Global Variables


RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the Terms of Use.
©2004 - 2008 RPG RPG Revolution, All Rights Reserved. Contact Us · Privacy Policy · Legal Disclaimer
eXTReMe Tracker