class Scene_Title
#--------------------------------------------------------------------------
# * Main Database
#--------------------------------------------------------------------------
alias stats_main_database main_database
def main_database
stats_main_database
$data_actors.each {|actor| actor.setup_stats if actor != nil}
end
end
module RPG
class Actor
#--------------------------------------------------------------------------
# * Include Stats
#--------------------------------------------------------------------------
include Stats
#--------------------------------------------------------------------------
# * Setup Stats
#--------------------------------------------------------------------------
def setup_stats
# Setup New Table
parameters = Level_Table.new(10, final_level < 100 ? 100 : final_level+1)
# Run Through and Copy From Parameters
@parameters.ysize.times do |y|
@parameters.xsize.times do |x|
parameters[x, y] = @parameters[x, y]
end
end
# Setup New Parameters
@parameters = parameters
# Get Curves
hp = Hp_Curve_Actor[id].nil? ? Hp_Curve_Class[class_id] : Hp_Curve_Actor[id]
sp = Sp_Curve_Actor[id].nil? ? Sp_Curve_Class[class_id] : Sp_Curve_Actor[id]
str = Str_Curve_Actor[id].nil? ? Str_Curve_Class[class_id] : Str_Curve_Actor[id]
dex = Dex_Curve_Actor[id].nil? ? Dex_Curve_Class[class_id] : Dex_Curve_Actor[id]
agi = Agi_Curve_Actor[id].nil? ? Agi_Curve_Class[class_id] : Agi_Curve_Actor[id]
int = Int_Curve_Actor[id].nil? ? Int_Curve_Class[class_id] : Int_Curve_Actor[id]
atk = Atk_Curve_Actor[id].nil? ? Atk_Curve_Class[class_id] : Atk_Curve_Actor[id]
pdef = PDef_Curve_Actor[id].nil? ? PDef_Curve_Class[class_id] : PDef_Curve_Actor[id]
mdef = MDef_Curve_Actor[id].nil? ? MDef_Curve_Class[class_id] : MDef_Curve_Actor[id]
eva = Eva_Curve_Actor[id].nil? ? Eva_Curve_Class[class_id] : Eva_Curve_Actor[id]
# Setup Stats Array
stats = %w( hp sp str dex agi int atk pdef mdef eva )
# Run Through each Stat
stats.each do |stat|
eval("#{stat} = Level_Generation.new(*#{stat})") if eval(stat) != nil
end
# Run Through Each Level
(1..final_level).each do |level|
# Run Through each stat
stats.each_with_index do |stat, index|
if eval(stat) == nil and index <= 5
@parameters[index, level] = @parameters[index, 99] if level > 99
next
elsif eval(stat) == nil and index > 5
@parameters[index, level] = 0
else
eval("@parameters[index, level] = #{stat}.get_stat(level)")
end
end
end
end