#=================================
# Syn's Upgrade Customization V4.8 (3/28/07)
# Created by Synthesize
# Help from Raziel, Trickster, Icedmetal57
#
#
# Modified Stats Effects Preview by 2R aka S0L0 (29/07/2007)
#=================================
module Upgrade_Points
Points_Gained = 3
Hp_rise = 12
Sp_rise = 8
Str_rise = 1
Dex_rise = 1
Agi_rise = 1
Int_rise = 1
end
#=================================
# *Create Points*
#=================================
class Game_Actor < Game_Battler
attr_accessor :upgrade_points
alias stat_point_lvlup_game_actor_setup setup
def setup(actor_id)
stat_point_lvlup_game_actor_setup(actor_id)
@upgrade_points = 0
end
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@upgrade_points += Upgrade_Points::Points_Gained
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
$scene = Scene_Upgrade.new
end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end
#=================================
# Begin Upgrade Code
#=================================
class Scene_Upgrade
def initialize(actor_index = 0, command_index = 0)
@actor_index = actor_index
@command_index = command_index
end
def main
@spriteset = Spriteset_Map.new
s1 = "Increase Health"
s2 = "Increase Magic"
s3 = "Increase Strength"
s4 = "Increase Dexterity"
s5 = "Increase Agility"
s6 = "Increase Intellegence"
@command_window = Window_Command.new(260, [s1, s2, s3, s4, s5, s6])
@command_window.x = 46
@command_window.y = 112
@command_window.z = 350
@command_window.opacity = 200
@command_window.active = true
@actor = $game_party.actors[@actor_index]
@status_window = Window_Upgrade.new(@actor)
@status_window.opacity= 200
@status_window.x = 304
@status_window.y = 56
@raise_window = Window_Raise.new
@raise_window.x = 46
@raise_window.y = 56
@raise_window.opacity = 200
@raise_window.visible = false
@actor_window = Window_ActorTab.new(@actor)
@actor_window.x = 304
@actor_window.y = 0
@actor_window.opacity = 200
@actor_window.visible = true
@controls_window = Window_Controls.new
@controls_window.opacity= 200
@controls_window.x = 46
@controls_window.y = 333
@controls_window.visible = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@status_window.dispose
@raise_window.dispose
@controls_window.dispose
@actor_window.dispose
@spriteset.dispose
end
def update
@command_window.update
@raise_window.update
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Upgrade.new(@actor_index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Upgrade.new(@actor_index)
return
end
if @command_window.active
update_command
return
end
end
def update_command
@raise_window.update
@spriteset.update
if Input.press?(Input::UP) or Input.press?(Input::DOWN)
case @command_window.index
when 0
@status_window.refresh(0)
when 1
@status_window.refresh(1)
when 2
@status_window.refresh(2)
when 3
@status_window.refresh(3)
when 4
@status_window.refresh(4)
when 5
@status_window.refresh(5)
end
return
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
if @actor.upgrade_points > 0
if @actor.maxhp >= 9999
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
else
$game_system.se_play($data_system.decision_se)
@actor.maxhp += Upgrade_Points::Hp_rise
@actor.hp += Upgrade_Points::Hp_rise
@actor.upgrade_points -= 1
@raise_window.visible = true
@status_window.update
end
else
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
end
when 1
if @actor.upgrade_points > 0
if @actor.maxsp >= 9999
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
else
$game_system.se_play($data_system.decision_se)
@actor.maxsp += Upgrade_Points::Sp_rise
@actor.sp += Upgrade_Points::Sp_rise
@raise_window.visible = true
@actor.upgrade_points -= 1
@status_window.update
end
else
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
end
when 2
if @actor.upgrade_points > 0
if @actor.str >= 999
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
else
$game_system.se_play($data_system.decision_se)
@actor.str += Upgrade_Points::Str_rise
@raise_window.visible = true
@actor.upgrade_points -= 1
@status_window.update
end
else
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
end
when 3
if @actor.upgrade_points > 0
if @actor.dex >= 999
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
else
$game_system.se_play($data_system.decision_se)
@actor.dex += Upgrade_Points::Dex_rise
@raise_window.visible = true
@actor.upgrade_points -= 1
@status_window.update
end
else
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
end
when 4
if @actor.upgrade_points > 0
if @actor.agi >= 999
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
else
$game_system.se_play($data_system.decision_se)
@actor.agi += Upgrade_Points::Agi_rise
@raise_window.visible = true
@actor.upgrade_points -= 1
@status_window.update
end
else
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
end
when 5
if @actor.upgrade_points > 0
if @actor.int >= 999
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
else
$game_system.se_play($data_system.decision_se)
@actor.int += Upgrade_Points::Int_rise
@raise_window.visible = true
@actor.upgrade_points -= 1
@status_window.update
end
else
@raise_window.visible = false
name = '057-Wrong01'
volume = 100
pitch = 100
Audio.se_play("Audio/SE/" + name, volume, pitch)
end
end
end
end
end
#=================================
# *Status Window*
#=================================
class Window_Upgrade < Window_Base
def initialize(actor)
super(32, 32, 315, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
@actor = actor
self.opacity = 200
refresh(0)
end
def refresh(type)
@type = type
self.contents.clear
draw_actor_graphic(@actor, 122, 60)
draw_actor_class(@actor, 176, 3)
draw_actor_level(@actor, 6, 3)
draw_actor_state(@actor, 95, 48)
if @actor.upgrade_points >= 1
case @type
when 0
self.contents.font.color = system_color
if @actor.hp < 9999
self.contents.draw_text(170, 70, 100, 100, "=>")
end
self.contents.font.color = normal_color
@hp_preview = @actor.hp + Upgrade_Points::Hp_rise
@mhp_preview = @actor.maxhp + Upgrade_Points::Hp_rise
if @actor.hp < 9999
self.contents.draw_text(200, 70, 100, 100, "#{@hp_preview}/#{@mhp_preview}")
end
when 1
self.contents.font.color = system_color
if @actor.sp < 9999
self.contents.draw_text(170, 94, 100, 100, "=>")
end
self.contents.font.color = normal_color
@sp_preview = @actor.sp + Upgrade_Points::Sp_rise
@msp_preview = @actor.maxsp + Upgrade_Points::Sp_rise
if @actor.sp < 9999
self.contents.draw_text(200, 94, 100, 100, "#{@sp_preview}/#{@msp_preview}")
end
when 2
self.contents.font.color = system_color
if @actor.str < 999
self.contents.draw_text(170, 158, 100, 100, "=>")
end
self.contents.font.color = normal_color
@str_preview = @actor.str + Upgrade_Points::Str_rise
if @actor.str < 999
self.contents.draw_text(200, 158, 100, 100, "#{@str_preview}")
end
when 3
self.contents.font.color = system_color
if @actor.dex < 999
self.contents.draw_text(170, 182, 100, 100, "=>")
end
self.contents.font.color = normal_color
@dex_preview = @actor.dex + Upgrade_Points::Dex_rise
if @actor.dex < 999
self.contents.draw_text(200, 182, 100, 100, "#{@dex_preview}")
end
when 4
self.contents.font.color = system_color
if @actor.agi < 999
self.contents.draw_text(170, 206, 100, 100, "=>")
end
self.contents.font.color = normal_color
@agi_preview = @actor.agi + Upgrade_Points::Agi_rise
if @actor.agi < 999
self.contents.draw_text(200, 206, 100, 100, "#{@agi_preview}")
end
when 5
self.contents.font.color = system_color
if @actor.int < 999
self.contents.draw_text(170, 230, 100, 100, "=>")
end
self.contents.font.color = normal_color
@int_preview = @actor.int + Upgrade_Points::Int_rise
if @actor.int < 999
self.contents.draw_text(200, 230, 100, 100, "#{@int_preview}")
end
end
end
draw_actor_hp(@actor, 4, 104, 172)
draw_actor_sp(@actor, 4, 128, 172)
draw_actor_exp(@actor, 4, 152)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 216, 4)
draw_actor_parameter(@actor, 4, 240, 5)
draw_actor_parameter(@actor, 4, 264, 6)
x = contents.text_size("Points:").width
text = "Points:"
text2 = "#{@actor.upgrade_points.to_s}"
self.contents.font.color = system_color
self.contents.draw_text(190, 360, x, 32, text)
self.contents.font.color = normal_color
self.contents.draw_text(200+x, 360, (self.width/2), 32, text2.to_s)
end
def update
refresh(type)
end
end
#--------------------------------------------------------------------------
# Raise Window
#--------------------------------------------------------------------------
class Window_Raise< Window_Base
def initialize
super(0, 0, 260, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 21
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 180, 30, "Attribute Increased.")
end
end
#--------------------------------------------------------------------------
# ActorTab Window
#--------------------------------------------------------------------------
class Window_ActorTab< Window_Base
def initialize(actor)
super(0, 0, 120, 60)
@actor = actor
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 21
refresh
end
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 3)
end
end
#--------------------------------------------------------------------------
# Controls Window
#--------------------------------------------------------------------------
class Window_Controls < Window_Base
def initialize
super(0, 0, 260, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 20
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 30, "Q: Shift <- W: Shift-> ")
end
end