##################### トランジション速度を変更して実行 ##################### # # # マップ上で実行されるトランジションを通常とは違う速度で実行可能になります # # # # イベントで「トランジション実行」を行う代わりに、 # # スクリプトで「transition_set(60, "001-Blind01")」と言ったように、 # # 実行にかけるフレーム数とトランジションファイル名を指定してください。 # # マップ上以外ではこの命令は無視されます。 # # # ############################################################################ #============================================================================== # ■ Interpreter #============================================================================== class Interpreter #-------------------------------------------------------------------------- # ◎ 追加:フレーム数を指定したトランジションの実行 # frame : トランジション実行にかける時間(単位:フレーム) # name : トランジションファイル(省略した場合クロスフェード) #-------------------------------------------------------------------------- def transition_set(frame, name = "") if $scene.is_a?(Scene_Map) $scene.transition_set(frame, name) end return end end #============================================================================== # ■ Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # ◎ 追加:独自トランジションの設定 #-------------------------------------------------------------------------- def transition_set(speed, name) # トランジション速度設定 @trans_speed_set = speed # トランジションファイルの指定 $game_temp.transition_name = name # トランジションフラグを有効化 $game_temp.transition_processing = true end #-------------------------------------------------------------------------- # ○ メイン処理 #-------------------------------------------------------------------------- alias trans_main main def main # トランジション速度の設定 @trans_speed_set = 0 # 呼び戻し trans_main end #-------------------------------------------------------------------------- # ● フレーム更新 (再定義) #-------------------------------------------------------------------------- def update # ループ loop do # マップ、インタプリタ、プレイヤーの順に更新 # (この更新順序は、イベントを実行する条件が満たされているときに # プレイヤーに一瞬移動する機会を与えないなどの理由で重要) $game_map.update $game_system.map_interpreter.update $game_player.update # システム (タイマー)、画面を更新 $game_system.update $game_screen.update # プレイヤーの場所移動中でなければループを中断 unless $game_temp.player_transferring break end # 場所移動を実行 transfer_player # トランジション処理中の場合、ループを中断 if $game_temp.transition_processing break end end # スプライトセットを更新 @spriteset.update # メッセージウィンドウを更新 @message_window.update # ゲームオーバーの場合 if $game_temp.gameover # ゲームオーバー画面に切り替え $scene = Scene_Gameover.new return end # タイトル画面に戻す場合 if $game_temp.to_title # タイトル画面に切り替え $scene = Scene_Title.new return end # トランジション処理中の場合 if $game_temp.transition_processing # トランジション処理中フラグをクリア $game_temp.transition_processing = false # トランジション実行 # ☆ココから変更 if $game_temp.transition_name == "" speed = @trans_speed_set != 0 ? @trans_speed_set : 20 Graphics.transition(speed) else speed = @trans_speed_set != 0 ? @trans_speed_set : 40 Graphics.transition(speed, "Graphics/Transitions/" + $game_temp.transition_name) end # ☆ココまで変更 end # メッセージウィンドウ表示中の場合 if $game_temp.message_window_showing return end # エンカウント カウントが 0 で、エンカウントリストが空ではない場合 if $game_player.encounter_count == 0 and $game_map.encounter_list != [] # イベント実行中かエンカウント禁止中でなければ unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # トループを決定 n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # トループが有効なら if $data_troops[troop_id] != nil # バトル呼び出しフラグをセット $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end # B ボタンが押された場合 if Input.trigger?(Input::B) # イベント実行中かメニュー禁止中でなければ unless $game_system.map_interpreter.running? or $game_system.menu_disabled # メニュー呼び出しフラグと SE 演奏フラグをセット $game_temp.menu_calling = true $game_temp.menu_beep = true end end # デバッグモードが ON かつ F9 キーが押されている場合 if $DEBUG and Input.press?(Input::F9) # デバッグ呼び出しフラグをセット $game_temp.debug_calling = true end # プレイヤーの移動中ではない場合 unless $game_player.moving? # 各種画面の呼び出しを実行 if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end end end end