Started by AliveDrive, March 28, 2011, 10:29:21 pm
#==============================================================================# ** Scene_Gameover Menu## Made by AliveDrive# With help from winkio and Game_Guy#------------------------------------------------------------------------------# This class performs game over screen processing.#==============================================================================VARIABLE_X = 1VARIABLE_Y = 2VARIABLE_MAP = 3class Scene_Gameover #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make game over graphic @sprite = Sprite.new @sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name) @help_window = Window_Help.new @help_window.set_text("You will lose " + ($game_party.gold / 2).to_s + " gold if you click Revive.") # Stop playing SE, ME, BGS, and BGM Audio.se_stop Audio.me_stop Audio.bgs_stop Audio.bgm_stop # Play game over ME $game_system.me_play($data_system.gameover_me) # Make command window s0 = "Revive" s1 = "Continue" s2 = "Return to Title" @command_window = Window_Command.new(192, [s0, s1, s2]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 320 # Continue enabled determinant # Check if at least one save file exists # If enabled, make @continue_enabled true; if disabled, make it false @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end # If continue is enabled, move cursor to "Continue" # If disabled, display "Continue" text in gray if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end # Execute transition Graphics.transition # 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 help window @help_window.dispose # Dispose of command window @command_window.dispose # Dispose of gameover graphic @sprite.bitmap.dispose @sprite.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update command window @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 # Revive command_revive when 1 # Continue command_continue when 2 # Return to Title $game_system.se_play($data_system.decision_se) $scene = Scene_Title.new end end end #-------------------------------------------------------------------------- # * Command: Continue #-------------------------------------------------------------------------- def command_continue # 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: Revive #-------------------------------------------------------------------------- def command_revive $game_temp.gameover = false $game_party.gain_gold($game_party.gold / -2) $game_party.actors.each {|a| a.recover_all} $game_map.setup($game_temp.player_new_map_id) $game_temp.player_transferring = true $game_player.refresh $game_map.autoplay $game_map.update $scene = Scene_Map.new return # If battle test if $BTEST $scene = nil end endend
Quote from: Blizzard on September 09, 2011, 02:26:33 amThe permanent solution for your problem would be to stop hanging out with stupid people.
$game_system.map_interpreter.setup(nil, 0)
Quote from: winkioI do not speak to bricks, either as individuals or in wall form.
Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.
Quote from: winkio on June 15, 2011, 07:30:23 pmAh, excellent. You liked my amusing sideshow, yes? I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.