1. Beschreibung
Das Script erschafft nach dem Kampf ein Fenster, in dem Erfahrungsbalken hochlaufen.
Dieselben Erfahrungsbalken sind auch im Status Menu zu finden.
Bei einem LevelUp wir ein Fenster mit den Veränderungen der Werte eingefügt.
Die Farbe der Erfahrungsbalken kann selbst bestimmt werden.
Man kann die Levelbalken nach dem Kampf in einem Options Menu ein- und ausstellen.
Ausserhalb kann der selbe Vorgang wie nach dem Kampf mit dem Script-Befehl:
$scene.display_level_up(erfahrung) aufgerufen werden. Wobei erfahrung die
Erfahrungsmenge angibt. Die Erfahrung muss nicht über ein weiteres Event verteilt werden.
2.Screenshots
(http://download.lima-city.de/dauerzocer/LevelUp.jpg)
(http://download.lima-city.de/dauerzocer/LevelBalken.jpg)
3.Script
#
#LevelUp Script
#Author: dauerzocer
#Version: 2.5
#Datum: 14.6.2008
#-------------------------------------------------------------------------------------------------------------------------------
#Beschreibung:
# - Das Script erschafft nach dem Kampf ein Fenster, in dem Erfahrungsbalken hochlaufen.
# - Dieselben Erfahrungsbalken sind auch im Status Menu zu finden.
# - Bei einem LevelUp wir ein Fenster mit den Veränderungen der Werte eingefügt.
# - Die Farbe der Erfahrungsbalken kann selbst bestimmt werden.
# - Man kann die Levelbalken nach dem Kampf in einem Options Menu ein- und ausstellen.
# - Ausserhalb kann der selbe Vorgang wie nach dem Kampf mit dem Script-Befehl:
# $scene.display_level_up(erfahrung) aufgerufen werden. Wobei erfahrung die
# Erfahrungsmenge angibt. Die Erfahrung muss nicht über ein weiteres Event verteilt werden.
#--------------------------------------------------------------------------------------------------------------------------------
module LevelUp
Fensterx = 544 #Breite des Spielfensters
Fenstery = 416 #Höhe des Spielfensters
Message =124 #Höhe des im Kampf verwendeten Message Windows
Erfahrung = "Erf" #Abkürzung für Erfahrung
Erfahrungs_Farbe = 3 #Farbe für den linken Teil des Erfahrungs Balkens
Erfahrungs_Farbe2 = 4 #Farbe für den rechten Teil des Erfahrungs Balkens
Einstellungen = "Optionen" #Vokabular für Einstellungen im Menu
end
#--------------------------------------------------------------------------------------------------------------------------------
class Scene_Map < Scene_Base
def update_erf(main = false)
Graphics.update unless main # ????????
Input.update unless main # ???????
$game_system.update # ???????
@spriteset.update # ???????????
@message_window.update # ?????????????
end
def display_level_up(erfahrung)
@message_window = Window_BattleMessage.new
exp = erfahrung
if $erfahrungs_balken_verteilung == false
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp, true)
if (last_level != actor.level) then
$lvlup = Window_LevelUp.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery-LevelUp::Message)
$lvlup.anzeigen(actor, last_level)
Input.update
until(Input.trigger?(Input::C))
update_erf
end
$lvlup.dispose
$lvlup = nil
end
end
else
verteilen = 0
@message_window.visible = false
$erfahrung = Window_Erfahrung.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery)
$erfahrung.anzeigen
while verteilen < exp
Input.update
if Input.trigger?(Input::cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /] then
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp - verteilen -1, true)
if (last_level != actor.level) then
@message_window.visible = true
$lvlup = Window_LevelUp.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery-LevelUp::Message)
$lvlup.anzeigen(actor, last_level)
Input.update
until(Input.trigger?(Input::C))
update_erf
end
$lvlup.dispose
$lvlup = nil
@message_window.visible = false
end
end
verteilen = exp
end
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(1, true)
if (last_level != actor.level) then
@message_window.visible = true
$lvlup = Window_LevelUp.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery-LevelUp::Message)
$lvlup.anzeigen(actor, last_level)
Input.update
until(Input.trigger?(Input::C))
update_erf
end
$lvlup.dispose
$lvlup = nil
@message_window.visible = false
end
end
verteilen += 1
Sound.play_cursor
$erfahrung.update
end
$erfahrung.dispose
$erfahrung = nil
end
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Scene_Battle < Scene_Base
def display_level_up
exp = $game_troop.exp_total
if $erfahrungs_balken_verteilung == false
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp, true)
if (last_level != actor.level) then
$lvlup = Window_LevelUp.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery-LevelUp::Message)
$lvlup.anzeigen(actor, last_level)
Input.update
until(Input.trigger?(Input::C))
update_basic
end
$lvlup.dispose
$lvlup = nil
end
end
else
verteilen = 0
@message_window.visible = false
$erfahrung = Window_Erfahrung.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery)
$erfahrung.anzeigen
while verteilen < exp
Input.update
if Input.trigger?(Input::cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /] then
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp - verteilen -1, true)
if (last_level != actor.level) then
@message_window.visible = true
$lvlup = Window_LevelUp.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery-LevelUp::Message)
$lvlup.anzeigen(actor, last_level)
Input.update
until(Input.trigger?(Input::C))
update_basic
end
$lvlup.dispose
$lvlup = nil
@message_window.visible = false
end
end
verteilen = exp
end
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(1, true)
if (last_level != actor.level) then
@message_window.visible = true
$lvlup = Window_LevelUp.new(0,0,LevelUp::Fensterx,LevelUp::Fenstery-LevelUp::Message)
$lvlup.anzeigen(actor, last_level)
Input.update
until(Input.trigger?(Input::C))
update_basic
end
$lvlup.dispose
$lvlup = nil
@message_window.visible = false
end
end
verteilen += 1
Sound.play_cursor
$erfahrung.update
end
$erfahrung.dispose
$erfahrung = nil
end
wait_for_message
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Scene_Menu < Scene_Base
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
s7 = LevelUp::Einstellungen
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s7, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # ??????? 0 ????
@command_window.draw_item(0, false) # ????????
@command_window.draw_item(1, false) # ???????
@command_window.draw_item(2, false) # ??????
@command_window.draw_item(3, false) # ?????????
end
if $game_system.save_disabled # ????????
@command_window.draw_item(4, false) # ???????
end
end
def update_command_selection
if Input.trigger?(Input::cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /]
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # ????
$scene = Scene_Item.new
when 1,2,3 # ????????????
start_actor_selection
when 4 # ???
$scene = Scene_File.new(true, false, false)
when 5
$scene = Scene_Optionen.new
when 6 # ?????
$scene = Scene_End.new
end
end
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Scene_Optionen_Erfahrung < Scene_Base
def start
super
create_menu_background
check_levelbalken
create_command_window
@help_window = Window_Help.new
@help_window.set_text("Levelbalken")
end
def check_levelbalken
if $erfahrungs_balken_verteilung == false
@check = false
else
@check = true
end
def post_start
super
open_command_window
end
def pre_terminate
super
@help_window.dispose
close_command_window
end
def terminate
super
dispose_command_window
dispose_menu_background
end
def return_scene
$scene = Scene_Optionen.new
end
def update
super
update_menu_background
@command_window.update
if Input.trigger?(Input::cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /]
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
case @command_window.index
when 0
if @check == false
$erfahrungs_balken_verteilung = true
Sound.play_decision
return_scene
else
Sound.play_buzzer
end
when 1
if @check == true
$erfahrungs_balken_verteilung = false
Sound.play_decision
$scene = Scene_Optionen.new
else
Sound.play_buzzer
end
end
end
end
end
def update_menu_background
super
@menuback_sprite.tone.set(0, 0, 0, 128)
end
def create_command_window
s1 = "An"
s2 = "Aus"
@command_window = Window_Command.new(172, [s1, s2])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = (416 - @command_window.height) / 2
if @check == false
@command_window.draw_item(1, false)
elsif @check == true
@command_window.draw_item(0, false)
end
@command_window.openness = 0
end
def dispose_command_window
@command_window.dispose
end
def open_command_window
@command_window.open
begin
@command_window.update
Graphics.update
end until @command_window.openness == 255
end
def close_command_window
@command_window.close
begin
@command_window.update
Graphics.update
end until @command_window.openness == 0
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Scene_End < Scene_Base
def return_scene
$scene = Scene_Menu.new(6)
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Scene_Optionen < Scene_Base
def start
super
create_menu_background
create_command_window
@help_window = Window_Help.new
@command_window.help_window = @help_window
@help_window.set_text("Levelbalken nach dem Kampf ein oder ausstellen.")
end
def post_start
super
open_command_window
end
def pre_terminate
super
close_command_window
end
def terminate
super
@help_window.dispose
dispose_command_window
dispose_menu_background
end
def return_scene
$scene = Scene_Menu.new(5)
end
def update
super
@help_window.update
update_menu_background
@command_window.update
if Input.trigger?(Input::cool.gif\" style=\"vertical-align:middle\" emoid=\"B)\" border=\"0\" alt=\"cool.gif\" /]
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
case @command_window.index
when 0
Sound.play_decision
$scene = Scene_Optionen_Erfahrung.new
end
end
end
def update_menu_background
super
@menuback_sprite.tone.set(0, 0, 0, 128)
end
def create_command_window
s1 = "Erf Verteilung"
@command_window = Window_Command.new(250, [s1])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = (416 - @command_window.height) / 2
@command_window.openness = 0
end
def dispose_command_window
@command_window.dispose
end
def open_command_window
@command_window.open
begin
@command_window.update
Graphics.update
end until @command_window.openness == 255
end
def close_command_window
@command_window.close
begin
@command_window.update
Graphics.update
end until @command_window.openness == 0
end
end
class Scene_End < Scene_Base
def return_scene
$scene = Scene_Menu.new(6)
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Window_LevelUp < Window_Base
def anzeigen(charakter, altes_level)
neue_level = charakter.level-altes_level
draw_actor_face(charakter, 25, 25, size = 96)
draw_actor_name(charakter, 150, 25)
draw_actor_class(charakter, 250, 25)
draw_actor_level(charakter, 350,75)
draw_actor_level_edit(charakter, 150,75,neue_level)
draw_differenz(300,75,charakter.level, altes_level)
draw_actor_hp(charakter, 350,100 , width = 120)
draw_actor_hp_edit(charakter, 150, 100, altes_level, width = 120)
draw_differenz(300,100, charakter.maxhp_level(charakter.level), charakter.maxhp_level(altes_level))
draw_actor_mp_edit(charakter, 150, 125, altes_level, width = 120)
draw_actor_mp(charakter, 350,125, width = 120)
draw_differenz(300,125, charakter.maxmp_level(charakter.level), charakter.maxmp_level(altes_level))
draw_actor_atk_edit(charakter, 150, 150, altes_level)
draw_actor_atk_edit(charakter, 350, 150, charakter.level)
draw_differenz(300,150, charakter.atk_level(charakter.level), charakter.atk_level(altes_level))
draw_actor_def_edit(charakter, 150, 175, altes_level)
draw_actor_def_edit(charakter, 350, 175, charakter.level)
draw_differenz(300,175, charakter.def_level(charakter.level), charakter.def_level(altes_level))
draw_actor_spi_edit(charakter, 150 , 200 , altes_level)
draw_actor_spi_edit(charakter, 350 , 200 , charakter.level)
draw_differenz(300,200, charakter.spi_level(charakter.level), charakter.spi_level(altes_level))
draw_actor_agi_edit(charakter, 150 , 225 , altes_level)
draw_actor_agi_edit(charakter, 350 , 225 , charakter.level)
draw_differenz(300,225, charakter.agi_level(charakter.level), charakter.agi_level(altes_level))
draw_pfeile
end
def draw_pfeile
draw_pfeil(300,235)
draw_pfeil(300,85)
draw_pfeil(300,110)
draw_pfeil(300,135)
draw_pfeil(300,160)
draw_pfeil(300,185)
draw_pfeil(300,210)
end
def draw_differenz(x, y, wert1, wert2)
differenz = wert1-wert2
meine_farbe = Color.new(0,255,255)
self.contents.font.color = meine_farbe
self.contents.draw_text(x, y, 32, WLH, "+")
self.contents.draw_text(x+15,y, 32, WLH, differenz)
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Window_Erfahrung < Window_Base
def anzeigen
@gruppen_größe = $game_party.existing_members.size
durchgang = 0
loop do
charakter_anzeigen(durchgang)
durchgang +=1
break if durchgang >= @gruppen_größe
end
end
def charakter_anzeigen(char_nummer)
if LevelUp::Fenstery/@gruppen_größe > 80 then
draw_actor_face($game_party.existing_members[char_nummer], 25, char_nummer*(LevelUp::Fenstery/@gruppen_größe-5), size = 80)
end
draw_actor_name($game_party.existing_members[char_nummer], 150, char_nummer*(LevelUp::Fenstery/@gruppen_größe))
draw_actor_class($game_party.existing_members[char_nummer], 150, (char_nummer*(LevelUp::Fenstery/@gruppen_größe))+25)
draw_actor_level($game_party.existing_members[char_nummer], 150, (char_nummer*(LevelUp::Fenstery/@gruppen_größe))+50)
draw_actor_erfahrung($game_party.existing_members[char_nummer], 300, (char_nummer*(LevelUp::Fenstery/@gruppen_größe))+25)
end
def update
super
erneuern
end
def erneuern
Graphics.update
self.contents.clear
anzeigen
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Window_Base
def draw_actor_erfahrung(actor, x , y, width =120)
draw_actor_erfahrung_gauge(actor, x, y, width = 120)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, LevelUp::Erfahrung)
xr = x + width
if width < 120
self.contents.draw_text(xr - 40, y, 40, WLH, actor.aktuelle_erfahrung, 2)
else
self.contents.draw_text(xr - 90, y, 40, WLH,actor. aktuelle_erfahrung, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
self.contents.draw_text(xr - 40, y, 40, WLH, actor.erfahrung_für_level, 2)
end
end
def draw_actor_erfahrung_gauge(actor, x, y, width = 120)
gw = width * actor.aktuelle_erfahrung / actor.erfahrung_für_level
gc1 = text_color(LevelUp::Erfahrungs_Farbe)
gc2 = text_color(LevelUp::Erfahrungs_Farbe2)
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
def draw_actor_level_edit(actor, x, y, z)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, WLH, actor.level - z, 2)
end
def draw_pfeil(x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, "-->")
end
def draw_actor_hp_edit(actor, x, y, level, width = 120)
draw_actor_hp_gauge_edit(actor, x, y, level, width = 120)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
self.contents.font.color = hp_color(actor)
xr = x + width
if width < 120
self.contents.draw_text(xr - 40, y, 40, WLH, actor.hp, 2)
else
self.contents.draw_text(xr - 90, y, 40, WLH, actor.hp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxhp_level(level), 2)
end
end
def draw_actor_hp_gauge_edit(actor, x, y, level, width = 120)
gw = width * actor.hp / actor.maxhp_level(level)
gc1 = hp_gauge_color1
gc2 = hp_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
def draw_actor_mp_edit(actor, x, y, level, width = 120)
draw_actor_mp_gauge_edit(actor, x, y, level, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
self.contents.font.color = mp_color(actor)
xr = x + width
if width < 120
self.contents.draw_text(xr - 40, y, 40, WLH, actor.mp, 2)
else
self.contents.draw_text(xr - 90, y, 40, WLH, actor.mp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxmp_level(level), 2)
end
end
def draw_actor_mp_gauge_edit(actor, x, y, level, width = 120)
gw = width * actor.mp / [actor.maxmp_level(level), 1].max
gc1 = mp_gauge_color1
gc2 = mp_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
def draw_actor_atk_edit(actor, x , y , level)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::atk)
self.contents.font.color = normal_color
self.contents.draw_text(x + 64, y, 24, WLH, actor.atk_level(level), 2)
end
def draw_actor_def_edit(actor, x , y , level)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::def)
self.contents.font.color = normal_color
self.contents.draw_text(x + 64, y, 24, WLH, actor.def_level(level), 2)
end
def draw_actor_spi_edit(actor, x , y , level)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::spi)
self.contents.font.color = normal_color
self.contents.draw_text(x + 64, y, 24, WLH, actor.spi_level(level), 2)
end
def draw_actor_agi_edit(actor, x , y , level)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::agi)
self.contents.font.color = normal_color
self.contents.draw_text(x + 64, y, 24, WLH, actor.agi_level(level), 2)
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Window_Status < Window_Base
def draw_basic_info(x, y)
draw_actor_level(@actor, x, y + WLH * 0)
draw_actor_state(@actor, x, y + WLH * 1)
draw_actor_hp(@actor, x, y + WLH * 2)
draw_actor_mp(@actor, x, y + WLH * 3)
draw_actor_erfahrung(@actor, x , y + WLH * 4)
end
end
#--------------------------------------------------------------------------------------------------------------------------------
class Game_Actor
def maxhp_level(level)
return actor.parameters[0, level]
end
def maxmp_level(level)
return actor.parameters[1,level]
end
def atk_level(level)
n = actor.parameters[2, level]
for item in equips.compact do n += item.atk end
return n
end
def def_level(level)
n = actor.parameters[3, level]
for item in equips.compact do n += item.def end
return n
end
def spi_level(level)
n = actor.parameters[4, level]
for item in equips.compact do n += item.spi end
return n
end
def agi_level(level)
n = actor.parameters[5, level]
for item in equips.compact do n += item.agi end
return n
end
def erfahrung_für_level
return @exp_list[@level+1] - @exp_list[@level]
end
def aktuelle_erfahrung
return exp_s - @exp_list[@level]
end
end
4. Demo
Demo Download (http://download.lima-city.de/dauerzocer/Script.exe)
ja so ungefähr.
ich hatte schonmal soeins
das war allerdings für den xp
ich habs im vx probiert aber da öffnet sich das fenster nicht.
kann dass vielleicht jemand für den vx umbauen???
#=================================
# Syn's Upgrade Customization V4.8.61 (3/28/07)
# Created by Synthesize
# Help from Raziel, Trickster, Icedmetal57
#=================================
module Upgrade_Points
Points_Gained = 4 # Amount of points gained upon leveling.
Hp_rise = 20 # The amount of HP to raise per point
Sp_rise = 15 # The amount of SP to raise per point
Str_rise = 1 # The amount of STR to raise
Dex_rise = 1 # The amount of DEX to raise
Agi_rise = 1 # The amount of AGI to raise
Int_rise = 1 # The amount of INT to raise
Error_sound = '057-Wrong01' # Change the sound effect when Upgrade Points equals zero.
end
#=================================
# *Begin Script*
#=================================
#=================================
# *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
# Level up
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
@upgrade_points += Upgrade_Points::Points_Gained
$scene = Scene_Upgrade.new
# Learn skill
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
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end
#=================================
# Begin Upgrade Code
#=================================
class Scene_Upgrade
#--------------------------------------------------------------------------
# Object Initalize
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
end
def main
@spriteset = Spriteset_Map.new
s1 = "Erhöht die MaxHP um #{Upgrade_Points::Hp_rise} "
s2 = "Erhöht die MaxMP um #{Upgrade_Points::Sp_rise} "
s3 = "Erhöht die Stärke um #{Upgrade_Points::Str_rise} "
s4 = "Erhöht das Geschick um #{Upgrade_Points::Dex_rise} "
s5 = "Erhöht die Agilität um #{Upgrade_Points::Agi_rise} "
s6 = "Erhöht die Intelligenz um #{Upgrade_Points::Int_rise} "
# Set Command Window Data
@command_window = Window_Command.new(260, [s1, s2, s3, s4, s5, s6])
@command_window.x = 46
@command_window.y = 112
@command_window.z = 9999
@command_window.opacity = 200
@command_window.active = true
@command_window.update
# Set Player Data
@actor = $game_party.actors[@actor_index]
@status_window = Window_Upgrade.new(@actor)
@status_window.opacity= 200
@status_window.x = 304
@status_window.y = 56
@status_window.z = 9999
# Set Raise Window Data
@raise_window = Window_Raise.new
@raise_window.x = 46
@raise_window.y = 56
@raise_window.z = 9999
@raise_window.opacity = 200
@raise_window.visible = false
# Set Actor Tab Window Data
@actor_window = Window_ActorTab.new(@actor)
@actor_window.x = 304
@actor_window.y = 0
@actor_window.z = 9999
@actor_window.opacity = 200
@actor_window.visible = true
# Set Controls Window
@controls_window = Window_Controls.new
@controls_window.opacity= 200
@controls_window.x = 46
@controls_window.y = 333
@controls_window.z = 9999
@controls_window.visible = true
# Graphics Transition
Graphics.transition
# Main Loop
loop do
# Update Graphics
Graphics.update
# Update Input
Input.update
# Renew
update
# Discontinue Loop
if $scene != self
break
end
end
# Prepare Transition
Graphics.freeze
# Dispose Windows
@command_window.dispose
@status_window.dispose
@raise_window.dispose
@controls_window.dispose
@spriteset.dispose
@actor_window.dispose
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
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 is active: call update_command
if @command_window.active
update_command
return
# End IF
end
# End Def
end
#=================================
# *Update Command*
#=================================
def update_command
#@raise_window.update
if Input.trigger?(Input::B)
# Play Cancel SE
$game_system.se_play($data_system.cancel_se)
# Load Map
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0
if @actor.upgrade_points > 0 and @actor.maxhp < 9999
$game_system.se_play($data_system.decision_se)
@actor.maxhp += Upgrade_Points::Hp_rise
@actor.hp += Upgrade_Points::Hp_rise
@actor.upgrade_points -= 1
@status_window.refresh
@raise_window.visible = true
else
@raise_window.visible = false
$game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
end
when 1
if @actor.upgrade_points > 0 and @actor.maxsp < 9999
$game_system.se_play($data_system.decision_se)
@actor.maxsp += Upgrade_Points::Sp_rise
@actor.sp += Upgrade_Points::Sp_rise
@actor.upgrade_points -= 1
@status_window.refresh
@raise_window.visible = true
else
@raise_window.visible = false
$game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
end
when 2
if @actor.upgrade_points > 0 and @actor.str < 9999
$game_system.se_play($data_system.decision_se)
@actor.str += Upgrade_Points::Str_rise
@actor.upgrade_points -= 1
@status_window.refresh
@raise_window.visible = true
else
@raise_window.visible = false
$game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
end
when 3
if @actor.upgrade_points > 0 and @actor.dex < 9999
$game_system.se_play($data_system.decision_se)
@actor.dex += Upgrade_Points::Dex_rise
@actor.upgrade_points -= 1
@status_window.refresh
@raise_window.visible = true
else
@raise_window.visible = false
$game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
end
when 4
if @actor.upgrade_points > 0 and @actor.agi < 9999
$game_system.se_play($data_system.decision_se)
@actor.agi += Upgrade_Points::Agi_rise
@actor.upgrade_points -= 1
@status_window.refresh
@raise_window.visible = true
else
@raise_window.visible = false
$game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
end
when 5
if @actor.upgrade_points > 0 and @actor.int < 9999
$game_system.se_play($data_system.decision_se)
@actor.int += Upgrade_Points::Int_rise
@actor.upgrade_points -= 1
@status_window.refresh
@raise_window.visible = true
else
@raise_window.visible = false
$game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
end
end
end
end
end
#============================================================
# Begin Windows
#============================================================
#=================================
# *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" # Font used in Raise Window
self.contents.font.size = 18 # Font Size in Raise Window
@actor = actor
self.opacity = 200
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
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
self.contents.font.color = system_color
if @actor.hp < 9999
self.contents.draw_text(170, 70, 100, 100, "=>")
end
if @actor.sp < 9999
self.contents.draw_text(170, 94, 100, 100, "=>")
end
if @actor.str < 999
self.contents.draw_text(170, 158, 100, 100, "=>")
end
if @actor.dex < 999
self.contents.draw_text(170, 182, 100, 100, "=>")
end
if @actor.agi < 999
self.contents.draw_text(170, 206, 100, 100, "=>")
end
if @actor.int < 999
self.contents.draw_text(170, 230, 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
@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
@str_preview = @actor.str + Upgrade_Points::Str_rise
if @actor.str < 999
self.contents.draw_text(200, 158, 100, 100, "#{@str_preview}")
end
@dex_preview = @actor.dex + Upgrade_Points::Dex_rise
if @actor.dex < 999
self.contents.draw_text(200, 182, 100, 100, "#{@dex_preview}")
end
@agi_preview = @actor.agi + Upgrade_Points::Agi_rise
if @actor.agi < 999
self.contents.draw_text(200, 206, 100, 100, "#{@agi_preview}")
end
@int_preview = @actor.int + Upgrade_Points::Int_rise
if @actor.int < 999
self.contents.draw_text(200, 230, 100, 100, "#{@int_preview}")
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 = "Punkte:"
text2 = "#{@actor.upgrade_points}"
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
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" # Font used in Raise Window
self.contents.font.size = 21 # Font Size in Raise Window
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 180, 30, "Attribut erhöht.")
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" # Font used in Raise Window
self.contents.font.size = 21 # Font Size in Raise Window
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" # Font used in Raise Window
self.contents.font.size = 20 # Font Size in Raise Window
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 200, 30, "Q: Taste <- W: Taste-> ")
end
end
#=================================