#============================================================================== # * Game Over Choice by Nefusa * # Version : 1.5 # Engine : RPG Maker XP # Visit : http://nefusa.blogspot.com #=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: # * Description # This script allow you to make a choice in Game Over Scene #=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: # * Instruction # Put this script below Scene_Debug but above Main in script editor #=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=: # * How to use # Edit the configuration below #============================================================================== # * Terms of use # - You may use and edit this scripts as long as you not claim it yours. # - You may use this scripts for commercial project and non-commercial project. # - I'll be glad if you give me a free copy of your game if you use this script # in your commercial project. # - If you want to credit me, just put "Nefusa" in your credit. #============================================================================== # * Configuration #============================================================================== module Nefusa module GOC TITLE_COMMAND = "Return To Title" # Return To Title Command LOAD_COMMAND = "Load Game" # Load Game Command SHUTDOWN_COMMAND = "Shutdown" # Shutdown Command end end #============================================================================== # * Advanced Area # Don't try to change the script below if you not understand #============================================================================== #============================================================================== # * Scene_Gameover class #============================================================================== class Scene_Gameover #-------------------------------------------------------------------------- # * Aliasing Main Processing #-------------------------------------------------------------------------- alias main_main main #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main #------------------------------------------------------------------------ # * Make command window #------------------------------------------------------------------------ s1 = Nefusa::GOC::TITLE_COMMAND s2 = Nefusa::GOC::LOAD_COMMAND s3 = Nefusa::GOC::SHUTDOWN_COMMAND @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 @command_window.visible = false @command_window.active = false #------------------------------------------------------------------------ # Continue enabled determinant #------------------------------------------------------------------------ @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end #------------------------------------------------------------------------ # If continue is enabled and else #------------------------------------------------------------------------ if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end main_main #------------------------------------------------------------------------ # * Dispose of command window #------------------------------------------------------------------------ @command_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update #------------------------------------------------------------------------ # * Update command window #------------------------------------------------------------------------ @command_window.visible = true @command_window.active = true @command_window.update #------------------------------------------------------------------------ # * If C button was pressed #------------------------------------------------------------------------ if Input.trigger?(Input::C) #---------------------------------------------------------------------- # * Branch by command window cursor position #---------------------------------------------------------------------- case @command_window.index when 0 # Return to Title choice command_title when 1 # Load Game choice command_load when 2 # Shutdown choice command_shutdown end end end #-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- def command_title #------------------------------------------------------------------------ # * Play decision SE #------------------------------------------------------------------------ $game_system.se_play($data_system.decision_se) #------------------------------------------------------------------------ # * Fade out BGM, BGS, and ME #------------------------------------------------------------------------ Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) #------------------------------------------------------------------------ # * Switch to title screen #------------------------------------------------------------------------ $scene = Scene_Title.new end #-------------------------------------------------------------------------- # * Command: Continue #-------------------------------------------------------------------------- def command_load #------------------------------------------------------------------------ # * If continue is disabled #------------------------------------------------------------------------ unless @continue_enabled #---------------------------------------------------------------------- # * Play buzzer SE #---------------------------------------------------------------------- $game_system.se_play($data_system.buzzer_se) return end #------------------------------------------------------------------------ # * Play decision SE #------------------------------------------------------------------------ $game_system.se_play($data_system.decision_se) #------------------------------------------------------------------------ # * Switch to load screen #------------------------------------------------------------------------ $scene = Scene_Load.new end #-------------------------------------------------------------------------- # * Command: Shutdown #-------------------------------------------------------------------------- def command_shutdown #------------------------------------------------------------------------ # * Play decision SE #------------------------------------------------------------------------ $game_system.se_play($data_system.decision_se) #------------------------------------------------------------------------ # * Fade out BGM, BGS, and ME #------------------------------------------------------------------------ Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) #------------------------------------------------------------------------ # * Shutdown #------------------------------------------------------------------------ $scene = nil end end #============================================================================== # * END #==============================================================================