# ▽△▽ XRXSv47. MeLT_GameOver. ゲームコンティニュー ▽△▽ # # publish 2010/ 5/ 3 # update - / 3a # #============================================================================== # カスタマイズポイント #============================================================================== module XRXSV47 # # コンティニューMapID, X座標, Y座標を記憶する変数ID # (※設定してください、いずれかが 0 だと常に初期位置になります) # ContinueMap_VariableID = 0 ContinueX_VariableID = 0 ContinueY_VariableID = 0 # # オンにするスイッチID( 0 を指定するとこの機能は使われません) # GameOverSwitchID = 0 # # ◆全回復 時に自動的に位置を記憶する? # FullRecoverPointSave = true # # ◆セーブ画面を開く 時に自動的に位置を記憶する? # SavePointSave = true # # コンティニューコマンド文字 # Commands = ["ゲームを続ける。","データをロードする。"] # # コマンドをオープンせずに決定したら続行する? # NoCommandMode = false # # ゲームオーバー画面自体をスキップして続行する?(DQ) # SceneSkip = false # # 所持金ダウン% # GoldCut = 0 # # フェード時間 (ゲームオーバー画面表示時 VX標準 : 180) # 決定時              : 120) # FadeInDuration = 40 FadeOUtDuration = 60 # # 全回復タイプ # 0 : 全員 # 1 : 先頭のみ # 2 : ID1アクターのみ # RecoverType = 1 # # ダウングラフィックのファイル名式 # DownFilename_S = "$%s-%s-2" DownFileDirection = 8 end #============================================================================== # 復活位置の自動記憶 #============================================================================== class Game_Interpreter if XRXSV47::ContinueMap_VariableID >= 1 and XRXSV47::ContinueX_VariableID >= 1 and XRXSV47::ContinueY_VariableID >= 1 def save_retry_position! $game_variables[XRXSV47::ContinueMap_VariableID] = $game_map.map_id $game_variables[XRXSV47::ContinueX_VariableID] = $game_player.x $game_variables[XRXSV47::ContinueY_VariableID] = $game_player.y end if XRXSV47::FullRecoverPointSave alias xrxsv47_command_314 command_314 def command_314 save_retry_position! return xrxsv47_command_314 end end if XRXSV47::SavePointSave alias xrxsv47_command_352 command_352 def command_352 save_retry_position! return xrxsv47_command_352 end end end end #============================================================================== # ゲームオーバー演出済みの記憶 #============================================================================== class Game_Temp attr_accessor :gameover_effect_done end #============================================================================== # ■ Scene_Gameover #============================================================================== class Scene_Gameover < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 * #-------------------------------------------------------------------------- def start super unless XRXSV47::SceneSkip create_gameover_graphic @character_sprite = Sprite_GameOverCharacter.new @command_window = Window_GameOverSelect.new end $game_map.interpreter.clear unless $game_temp.gameover_effect_done unless XRXSV47::SceneSkip RPG::BGM.stop RPG::BGS.stop $data_system.gameover_me.play end $game_party.lose_gold($game_party.gold * XRXSV47::GoldCut / 100) case XRXSV47::RecoverType when 1 set = [$game_party.members[0]] when 2 set = [$game_actors[1]] else set = $game_party.members end for actor in set.compact actor.recover_all end @count = 0 else @character_sprite.down! @count = 56 end if XRXSV47::GameOverSwitchID >= 1 $game_switches[XRXSV47::GameOverSwitchID] = true end $game_temp.gameover_effect_done = false if XRXSV47::SceneSkip @count = 1 process_continue end end #-------------------------------------------------------------------------- # ● 終了処理 * #-------------------------------------------------------------------------- def terminate super unless XRXSV47::SceneSkip dispose_gameover_graphic @character_sprite.dispose @command_window.dispose end $scene = nil if $BTEST end #-------------------------------------------------------------------------- # ● フレーム更新 * #-------------------------------------------------------------------------- def update super if @count <= 56 @count += 1 case @count when 1 Sound.play_actor_collapse when 12 @character_sprite.direction = 6 when 24 @character_sprite.direction = 8 when 36 @character_sprite.direction = 4 when 48 @character_sprite.down! when 57 @command_window.open unless XRXSV47::NoCommandMode end else @command_window.update if Input.trigger?(Input::C) Sound.play_decision case (XRXSV47::NoCommandMode ? 0 : @command_window.index) when 0 @command_window.close process_continue when 1 @command_window.visible = false snapshot_for_background @command_window.visible = true $scene = Scene_ContinueLoad.new(false, false, false) end end end end #-------------------------------------------------------------------------- # コンティニュー #-------------------------------------------------------------------------- def process_continue map_id = $game_variables[XRXSV47::ContinueMap_VariableID] x = $game_variables[XRXSV47::ContinueX_VariableID] y = $game_variables[XRXSV47::ContinueY_VariableID] if map_id.to_i == 0 or x.to_i == 0 or y.to_i == 0 map_id = $data_system.start_map_id x = $data_system.start_x y = $data_system.start_y end $game_map.setup(map_id) $game_player.moveto(x, y) $game_player.refresh $scene = Scene_Map.new Graphics.fadeout(XRXSV47::FadeOUtDuration) $game_map.autoplay end #-------------------------------------------------------------------------- # ● トランジション実行 * #-------------------------------------------------------------------------- def perform_transition Graphics.transition(XRXSV47::FadeInDuration) end end #============================================================================== # 専用ファイルシーン #============================================================================== class Scene_ContinueLoad < Scene_File def return_scene $game_temp.gameover_effect_done = true $scene = Scene_Gameover.new end end #============================================================================== # ゲームオーバーコマンド #============================================================================== class Window_GameOverSelect < Window_Command def initialize super(288, XRXSV47::Commands) self.x = (Graphics.width - self.width ) / 2 self.y = (Graphics.height - self.height) / 2 self.openness = 0 end end #============================================================================== # Sprite_GameOverCharacter #============================================================================== class Sprite_GameOverCharacter < Sprite_Base #-------------------------------------------------------------------------- # ▽ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(viewport = nil) super(viewport) @character_name = $game_player.character_name @character_index = $game_player.character_index @direction = 2 @pattern = 1 refresh self.x = Graphics.width / 2 self.y = 352 self.z = 101 @shadow_sprite = Sprite_Base.new @shadow_sprite.bitmap = Cache.system("BattleFloor") @shadow_sprite.zoom_x = 0.25 @shadow_sprite.zoom_y = 0.25 @shadow_sprite.x = self.x @shadow_sprite.y = self.y + 18 @shadow_sprite.z = 99 @shadow_sprite.opacity = 128 @shadow_sprite.ox = @shadow_sprite.bitmap.width / 2 @shadow_sprite.oy = @shadow_sprite.bitmap.height end def dispose @shadow_sprite.dispose super end #-------------------------------------------------------------------------- # リフレッシュ #-------------------------------------------------------------------------- def refresh if @character_name bitmap = Cache.character(@character_name) sign = @character_name[/^[\!\$]./] if sign and sign.include?('$') @cw = bitmap.width / 3 @ch = bitmap.height / 4 else @cw = bitmap.width / 12 @ch = bitmap.height / 8 end self.ox = @cw / 2 self.oy = @ch self.bitmap = bitmap update_src_rect else self.bitmap = nil end end #-------------------------------------------------------------------------- # 転送元矩形の更新 #-------------------------------------------------------------------------- def update_src_rect index = @character_index sx = (index % 4 * 3 + @pattern) * @cw sy = (index / 4 * 4 + (@direction - 2) / 2) * @ch self.src_rect.set(sx, sy, @cw, @ch) end #-------------------------------------------------------------------------- # 表示内容の変更 #-------------------------------------------------------------------------- def direction=(n) @direction = n update_src_rect end def down! begin name = sprintf(XRXSV47::DownFilename_S, $game_player.character_name, ($game_player.character_index+1).to_s) Cache.character(name) @character_name = name @character_index = 0 @direction = XRXSV47::DownFileDirection rescue @character_name = nil end refresh end end