#==============================================================================
# ** Scene_Gameover
#==============================================================================
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.
#--------------------------------------------------------------------------
s1 = "Wake up"
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
#------------------------------------------------------------------------
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