#============================================================================== # ** Scene_Gameover #------------------------------------------------------------------------------ # This class performs game over screen processing. #------------------------------------------------------------------------------ # Modified by Tigerseye for the Respawning script system. For information on # how to use this script and modify it to allow different respawning # locations, visit http://rmxp.tigerseye.uk.com/tutorial_system3.shtml # Good luck! #============================================================================== class Scene_Gameover #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main @transferring = false # Make game over graphic @sprite = Sprite.new @sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name) # Make choice window #-------------------------------------------------------------------------- # Here are the choices that will be displayed in the box that is shown on # the gameover screen. Just change the strings to change what the options # are. Bear in mind, however, that this will only change the text - it # won't have any effect on the command that takes place when each command # is selected. #-------------------------------------------------------------------------- s1 = "Continue from last inn" s2 = "Return to title" s3 = "End game" @choice_window = Window_Command.new(392, [s1, s2, s3]) @choice_window.back_opacity = 160 @choice_window.x = 320 - @choice_window.width / 2 @choice_window.y = 308 # Stop BGM and BGS $game_system.bgm_play(nil) $game_system.bgs_play(nil) # Play game over ME $game_system.me_play($data_system.gameover_me) # Execute transition Graphics.transition(120) # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of choice window @choice_window.dispose # Dispose of game over graphic @sprite.bitmap.dispose @sprite.dispose # Execute transition Graphics.transition(20) # Prepare for transition Graphics.freeze # If battle test if $BTEST $scene = nil end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update command window @choice_window.update # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @choice_window.index when 0 # New game command_respawn when 1 # Continue command_title when 2 # End game command_shutdown end end end #-------------------------------------------------------------------------- # * Command: Respawn (TO SPECIFIED LOCATION) #-------------------------------------------------------------------------- # This command respawns to a location specified by three game variables. # You can change which variables it looks at by modifying the numbers in # the square brackets below. #-------------------------------------------------------------------------- def command_respawn # Change the values in the square brackets to change which in-game # variable is used for which attribute. At the moment, there is no error # catching, so if the map ID specified in said variable doesn't exist, # the game will crash. Use with care! #------------------------------------------------------------------------ respawn_map_id = $game_variables[1] respawn_map_x = $game_variables[2] respawn_map_y = $game_variables[3] #------------------------------------------------------------------------ # Play decision SE $game_system.se_play($data_system.decision_se) # Fade ME Audio.me_stop # Recover party for actor in $game_party.actors actor.recover_all end $game_map.setup(respawn_map_id) # Move player to initial position $game_player.moveto(respawn_map_x, respawn_map_y) # Refresh player $game_player.refresh # Run automatic change for BGM and BGS set with map $game_map.autoplay # Update map (run parallel process event) $game_map.update # Switch to map screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Command: Return to title #-------------------------------------------------------------------------- def command_title # Play decision SE $game_system.se_play($data_system.decision_se) # Fade out BGM, BGS, and ME Audio.me_fade(800) # Shutdown $scene = Scene_Title.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.me_fade(800) # Shutdown $scene = nil end end