#==============================================================================
# ** Unarmed Stats & Development
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2006-10-22
#------------------------------------------------------------------------------
# * Requirements :
#
# Trickster's Curve Calculator Module (Dynamic Stat Development)
#------------------------------------------------------------------------------
# * Description
#
# This script was designed to do allow you to develope actors atk, mdef,
# pdef and eva in a varitey of ways. A, you can set unarmed growth of your
# stats, that progresses as your character does, same as other stats. B,
# you can define unarmed and armed growth of your stats, that will happen
# with or without equipment. C, you now have access to boost atk, pdef,
# mdef and eva through script calls. These bonuses will be added after the
# unarmed / armed grows have been added. As a bonus, this script also grants
# access to the default stat bonuses, such as maxp, maxsp, str, etc.
#------------------------------------------------------------------------------
# * Instructions
#
# Place The Script Below the SDK and Above Main.
# To Customize your stat growths, refer to the customization instructions.
# To modify actor's stats with call scripts, refer to syntax.
#------------------------------------------------------------------------------
# * Customization
#
#
# ** Unarmed Stat Growth **
#
# Stat Growth Type (0 : Basic Slope Formula, 1 : Curve Generated Formula)
# - Unarmed_Stat_Growth_Type = n
#
# Stat Growth Setup
# - Unarmed_Stat_Values = {'stat_name' => {actor_id => <values>, ...}, ...}
#
# Replace Values With :
# Type 0 : [base_value, growth_value]
# Type 1 : [min_value, max_value, early, late]
#
# ** Normal Stat Growth **
#
# Stat Growth Type (0 : Basic Slope Formula, 1 : Curve Generated Formula)
# - Normal_Stat_Growth_Type = n
#
# Stat Growth Setup
# - Normal_Stat_Values = {'stat_name' => {actor_id => <values>, ...}, ...}
#
# Replace Values With :
# Type 0 : [base_value, growth_value]
# Type 1 : [min_value, max_value, early, late]
#
#------------------------------------------------------------------------------
# * Syntax :
#
# Altering Actor's Stat Plus Bonus
# - actor = $game_actors[<actor_id>]
# - or -
# actor = $game_party.actors[index]
#
# actor.<keyword> <operator> <numberic>
#
# Replace <keyword> with :
# - maxhp_plus to change maxhp bonus
# - maxsp_plus to change maxsp bonus
# - pdef_plus to change pdef bonus
# - mdef_plus to change mdef bonus
# - str_plus to change str bonus
# - dex_plus to change dex bonus
# - agi_plus to change agi bonus
# - int_plus to change int bonus
# - atk_plus to change atk bonus
# - eva_plus to change eva bonus
#
# Replace <operator> with :
# - += to add to bonus
# - -= to subtract bonus
# - /= to divide bonus
# - *= to multiple bonus
# - = to set bonus
#
# Replace <numberic> with a number
#------------------------------------------------------------------------------
# * Credits :
#
# Thanks to Trickster For His Curve Generator
#==============================================================================
#==============================================================================
# ** Unarmed_Stats
#==============================================================================
module Unarmed_Stats
#--------------------------------------------------------------------------
# * Formulas
#
# ~ Type 0 : Basic Slope Formula
# Formula : stat = base_value + growth_value * level
#
# ~ Type 1 : Stat Curve
# Formula : See Trickster's Curve Generator
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Unarmed Stat Growth Type
#
# ~ 0 : Basic Slope Formula , 1 : Stat Curve
#--------------------------------------------------------------------------
Unarmed_Stat_Growth_Type = 0
#--------------------------------------------------------------------------
# * Unarmed Stat Growth
#
# ~ Basic Setup
# Unarmed_Stat_Values = {
# 'stat_name' => {
# actor_id => <values>,
# ...
# },
# ...
# }
#
# ~ Replace <values> With :
# Type 0 : [base_value, growth_value]
# Type 1 : [min_value, max_value, early, late]
#
# Use 0 as actor id to act for all actors, unless specified
#--------------------------------------------------------------------------
Unarmed_Stat_Values = {
'atk' => {1 => [0,1]},
'pdef' => {},
'mdef' => {},
'eva' => {}
}
#--------------------------------------------------------------------------
# * Normal Stat Growth Type
#
# ~ 0 : Basic Slope Formula , 1 : Stat Curve
#--------------------------------------------------------------------------
Normal_Stat_Growth_Type = 0
#--------------------------------------------------------------------------
# * Normal Stat Growth
#
# ~ Basic Formula
# Normal_Stat_Values = {
# 'stat_name' => {
# actor_id => <values>,
# ...
# },
# ...
# }
#
# ~ Replace <values> With :
# Type 0 : [base_value, growth_value]
# Type 1 : [min_value, max_value, early, late]
#
# Use 0 as actor id to act for all actors, unless specified
#--------------------------------------------------------------------------
Normal_Stat_Values = {
'atk' => {},
'pdef' => {},
'mdef' => {},
'eva' => {}
}
#--------------------------------------------------------------------------
# * Generate Slope Curve
#--------------------------------------------------------------------------
def self.generate_slope_curve(stat_name, actor_id, type, con)
# Gets Values
# If Actor ID Specified
if con[stat_name].has_key?(actor_id)
values = con[stat_name][actor_id]
# If Default 0 Specified
elsif con[stat_name].has_key?(0)
values = con[stat_name][0]
# None Specified
else
# Return Blank Array
return Array.new(100, 0)
end
# If Slope Formula
if type == 0
# Creates Array of Stats
curve = [values[0]]
99.times { curve << (values[1] + curve.last) }
# Return Curve
return curve
# If Stat Curve
elsif type == 1
# Return Curve Generated Stats
return Curve_Calculator.generate_curve(0, 99, values[0],
values[1], values[2], values[3])
end
# Return Blank Array
return Array.new(100, 0)
end
#--------------------------------------------------------------------------
# * Generate Unarmed Slope Curve
#--------------------------------------------------------------------------
def self.generate_unarmed_slope_curve(stat_name, actor_id)
# Return Slope Curve
return self.generate_slope_curve(stat_name, actor_id,
Unarmed_Stat_Growth_Type, Unarmed_Stat_Values)
end
#--------------------------------------------------------------------------
# * Generate Normal Slope Curve
#--------------------------------------------------------------------------
def self.generate_normal_slope_curve(stat_name, actor_id)
# Return Slope Curve
return self.generate_slope_curve(stat_name, actor_id,
Normal_Stat_Growth_Type, Normal_Stat_Values)
end
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :maxhp_plus, :maxsp_plus, :str_plus, :dex_plus, :atk_plus
attr_accessor :pdef_plus, :mdef_plus, :agi_plus, :int_plus, :eva_plus
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_unarmedstats_gmactr_setup setup
alias seph_unarmedstats_gmactr_bpdef base_pdef
alias seph_unarmedstats_gmactr_bmdef base_mdef
alias seph_unarmedstats_gmactr_batk base_atk
alias seph_unarmedstats_gmactr_beva base_eva
#--------------------------------------------------------------------------
# * Setup
#--------------------------------------------------------------------------
def setup(actor_id)
# Original Setup
seph_unarmedstats_gmactr_setup(actor_id)
# Basic Stat Plus Additions
@atk_plus, @pdef_plus, @mdef_plus, @eva_plus = 0, 0, 0, 0
# Sets Up Unarmed Stat Curves
@unarmed_stats_atk = Unarmed_Stats.generate_unarmed_slope_curve('atk',
@actor_id)
@unarmed_stats_pdef = Unarmed_Stats.generate_unarmed_slope_curve('pdef',
@actor_id)
@unarmed_stats_mdef = Unarmed_Stats.generate_unarmed_slope_curve('mdef',
@actor_id)
@unarmed_stats_eva = Unarmed_Stats.generate_unarmed_slope_curve('eva',
@actor_id)
# Sets Up Normal Stat Curves
@normal_stats_atk = Unarmed_Stats.generate_normal_slope_curve('atk',
@actor_id)
@normal_stats_pdef = Unarmed_Stats.generate_normal_slope_curve('pdef',
@actor_id)
@normal_stats_mdef = Unarmed_Stats.generate_normal_slope_curve('mdef',
@actor_id)
@normal_stats_eva = Unarmed_Stats.generate_normal_slope_curve('eva',
@actor_id)
end
#--------------------------------------------------------------------------
# * Atk
#--------------------------------------------------------------------------
def base_atk
# Gets Original Value
n = seph_unarmedstats_gmactr_batk
# If Unarmed
if @weapon_id == 0
# Add Unarmed Value
n += @unarmed_stats_atk[@level]
end
# Adds Normal Value
n += @normal_stats_atk[@level]
# Adds Atk Plus Bonus
n += @atk_plus
# Returns Value
return n
end
#--------------------------------------------------------------------------
# * Pdef
#--------------------------------------------------------------------------
def base_pdef
# Gets Original Value
n = seph_unarmedstats_gmactr_bpdef
# If Unarmed
if @armor1_id == 0 && @armor2_id == 0 && @armor3_id == 0 &&
@armor4_id == 0 && @weapon_id == 0
# Add Unarmed Value
n += @unarmed_stats_pdef[@level]
end
# Adds Normal Value
n += @normal_stats_pdef[@level]
# Adds Pdef Plus Bonus
n += @pdef_plus
# Returns Value
return n
end
#--------------------------------------------------------------------------
# * Mdef
#--------------------------------------------------------------------------
def base_mdef
# Gets Original Value
n = seph_unarmedstats_gmactr_bmdef
# If Unarmed
if @armor1_id == 0 && @armor2_id == 0 && @armor3_id == 0 &&
@armor4_id == 0 && @weapon_id == 0
# Add Unarmed Value
n += @unarmed_stats_mdef[@level]
end
# Adds Normal Value
n += @normal_stats_mdef[@level]
# Adds Mdef Plus Bonus
n += @mdef_plus
# Returns Value
return n
end
#--------------------------------------------------------------------------
# * Eva
#--------------------------------------------------------------------------
def base_eva
# Gets Original Value
n = seph_unarmedstats_gmactr_beva
# If Unarmed
if @armor1_id == 0 && @armor2_id == 0 && @armor3_id == 0 &&
@armor4_id == 0
# Add Unarmed Value
n += @unarmed_stats_eva[@level]
end
# Adds Normal Value
n += @normal_stats_eva[@level]
# Adds Eva Plus Bonus
n += @eva_plus
# Returns Value
return n
end
end