#==============================================================================
# Editable Actor Options
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: December 27, 2008
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
# This script allows you to change the actor options of Two Swords Style,
# Fix Equipment, Auto Battle, Super Guard, Pharmacology, and Critical Bonus
# in game, so that actors can learn these special feats in-game instead of
# either having them at the start of the game or not at all
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Instructions:
# Paste this script above Main and below Materials in the Script Editor.
# To change the actor options in game, merely use a call script and write
# this code:
#
# change_actor_options (actor ID, option ID, value)
#
# where: actor ID - the ID of the actor whose options you want to change
# option ID - the ID of the option you want to change, as follows -
# 0 => Two Swords Style
# 1 => Fix Equipment
# 2 => Auto Battle
# 3 => Super Guard
# 4 => Pharmacology
# 5 => Critical Bonus
# value - true or false; whether you want the actor to have the
# ability or not. So true means the actor will have the ability and
# false will mean the actor will not have the ability. If you leave
# value empty, it will toggle the ability - if it's on, it will turn
# off - if it's off it will turn on.
#
# Examples:
#
# change_actor_options (1, 2, true) ## Actor 1 - Auto Battle Turned ON
# change_actor_options (6, 0, false) ## Actor 6 - Two Swords Style turned OFF
# change_actor_options (3, 4) ## Actor 3 - Phamacology toggled
#==============================================================================
#==============================================================================
# ** Game_Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# methods overwritten - two_swords_style, fix_equipment, auto_battle,
# super_guard, pharmacology
# methods aliased - setup, cri
# new instance variables - two_swords_style, fix_equipment, auto_battle,
# super_guard, pharmacology, critical_bonus
#==============================================================================
class Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :two_swords_style
attr_accessor :fix_equipment
attr_accessor :auto_battle
attr_accessor :super_guard
attr_accessor :pharmacology
attr_accessor :critical_bonus
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup
# actor_id : the ID of the actor being set up
#``````````````````````````````````````````````````````````````````````````
# Initialize instance variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_strfyre_stup_actr_edt_options_93n5 setup
def setup (actor_id)
# Run Original Method
modalg_strfyre_stup_actr_edt_options_93n5 (actor_id)
# Initialize new instance variables
@two_swords_style = actor.two_swords_style
@fix_equipment = actor.fix_equipment
@auto_battle = actor.auto_battle
@super_guard = actor.super_guard
@pharmacology = actor.pharmacology
@critical_bonus = actor.critical_bonus
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Critical Ratio
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_strfyr_edt_actr_opt_crit_84nbd cri
def cri
# Run Original Method
n = modalg_strfyr_edt_actr_opt_crit_84nbd
n -= 4 if actor.critical_bonus
n += 4 if @critical_bonus
return n
end
end
#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - change_actor_options
#==============================================================================
class Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Change Actor Options
# actor_id : the ID of the actor to perform the operation on
# option_id : the ID of option to change
# value : value to set that option to
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def change_actor_options (actor_id, option_id, value = -1)
# Get Actor
actor = $game_actors[actor_id]
# Set option by ID. If no value specified, toggle option
case option_id
when 0 # Two Swords Style
actor.change_equip (1, nil) if value != actor.two_swords_style
actor.two_swords_style = value == -1 ? !actor.two_swords_style : value
when 1 # Fix Equipment
actor.fix_equipment = value == -1 ? !actor.fix_equipment : value
when 2 # Auto Battle
actor.auto_battle = value == -1 ? !actor.auto_battle : value
when 3 # Super Guard
actor.super_guard = value == -1 ? !actor.super_guard : value
when 4 # Pharmacology
actor.pharmacology = value == -1 ? !actor.pharmacology : value
when 5 # Critical Bonus
actor.critical_bonus = value == -1 ? !actor.critical_bonus : value
end
end
end