#============================================================================== # ■ VX-RGSS-2-ev TitleCustom【イベントデモ】 by Claimh #------------------------------------------------------------------------------ # EVENT_DEMO or AOP_DEMOが有効のときに使用します。 #------------------------------------------------------------------------------ # 指定されたマップに移動し、 # デモンストレーションとしてのイベントを動作させることができます。 #------------------------------------------------------------------------------ # [イベントの組み方] # 移動先のイベントは自動実行にしてください。(でないとユーザ操作できてしまう) # イベントの自動送りはできません(他のスクリプト等でなんとかしてください) # [イベントの終了方法] # イベントコマンドで title_demo_end を実行する # (Bボタンが追われた場合もタイトルに戻ります) #------------------------------------------------------------------------------ # [アナザーオープニング] # 通常とは異なったデモンストレーションを実行させることができます。 # ●アナザーオープニングを有効にする # AnotherOpening.enable # ●アナザーオープニングを無効にする # AnotherOpening.disable #============================================================================== module Title_Custom #-------------------------------------------------------------------------- # ● イベントデモ演出 #-------------------------------------------------------------------------- # イベントデモマップID ED_MAP_ID = 2 # パーティー位置 ED_START_X = 10 # X軸方向 ED_START_Y = 5 # Y軸方向 #-------------------------------------------------------------------------- # ● アナザーオープニング #-------------------------------------------------------------------------- # 情報保存用のファイル AOP_FILE = "aop.rxdata" # イベントデモマップID AOP_MAP_ID = 3 # パーティー位置 AOP_START_X = 10 # X軸方向 AOP_START_Y = 5 # Y軸方向 end class Scene_Title #-------------------------------------------------------------------------- # ● イベントデモ表示フェーズ:総合フレーム更新 #-------------------------------------------------------------------------- def update_phase_event_demo case @local_phase when 0; event_phase_startup # 表示準備 when 1; event_phase_end # 表示終了 end end #-------------------------------------------------------------------------- # ● イベントデモ表示フェーズ:表示準備 #-------------------------------------------------------------------------- def event_phase_startup # アナザーOP起動 if Title_Custom::AOP_DEMO and @another_op map_id = Title_Custom::AOP_MAP_ID start_posx = Title_Custom::AOP_START_X start_posy = Title_Custom::AOP_START_Y # 通常イベントデモ起動 elsif Title_Custom::EVENT_DEMO map_id = Title_Custom::ED_MAP_ID start_posx = Title_Custom::ED_START_X start_posy = Title_Custom::ED_START_Y else @local_phase = 1 # 終了フェーズに移動 return end # BGM を停止 all_music_fade(800) $game_party.setup_starting_members # 初期パーティ $game_map.setup(map_id) # 初期位置のマップ $game_player.moveto(start_posx, start_posy) $game_player.refresh $scene = Scene_Map.new Graphics.fadeout(60) Graphics.wait(40) Graphics.frame_count = 0 RPG::BGM.stop $game_map.autoplay # イベントデモ実行フラグON $game_system.event_demo = true end #-------------------------------------------------------------------------- # ● イベントデモ表示フェーズ:表示終了 #-------------------------------------------------------------------------- def event_phase_end if (Title_Custom::EVENT_DEMO or Title_Custom::AOP_DEMO) # イベントデモ実行フラグOFF $game_system.event_demo = false end @frame_count = 0 # フレームカウント初期化 @local_phase = 0 # ローカルフェーズの初期化 change_phase # 次のフェーズに移動 # 次のフェーズにトランジション実行があるか? Graphics.freeze unless next_phase_transition?(@phase) all_music_fade(400) # BGMフェードアウト end end #-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-# # イベントデモ特有処理START # #-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-# if Title_Custom::EVENT_DEMO or Title_Custom::AOP_DEMO #============================================================================== # ■ Game_System #============================================================================== class Game_System #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :event_demo # イベントデモ表示中フラグ #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias init_title initialize def initialize init_title @event_demo = false end end #============================================================================== # ■ Scene_Map #============================================================================== class Scene_Map alias event_demo_update update def update event_demo_update if $game_system.event_demo if Input.trigger?(Input::B) $scene = Scene_Title.new(true) end end end end #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● タイトルデモの終了 #-------------------------------------------------------------------------- def title_demo_end $scene = Scene_Title.new(true) end end end # Title_Custom::EVENT_DEMO or Title_Custom::AOP_DEMO #-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-# # イベントデモ特有処理END # #-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-# ## AnotherOP用 module AnotherOpening #### module function #### def self.enable? return false unless FileTest.exist?(Title_Custom::AOP_FILE) file = File.open(Title_Custom::AOP_FILE, "rb") aop = Marshal.load(file) file.close return aop.enable end def self.enable file = File.open(Title_Custom::AOP_FILE, "wb") Marshal.dump(AOP.new(true), file) file.close end def self.disable file = File.open(Title_Custom::AOP_FILE, "wb") Marshal.dump(AOP.new(false), file) file.close end ## local class class AOP attr_accessor :enable def initialize(flag) @enable = flag end end end