#============================================================================== # ○特定のイベントを再生します #作成者:riru/ガラス細工の夢幻 #http://garasuzaikunomugen.web.fc2.com/index.html #============================================================================== #RIRU_SKIT_WINDOW_MASSAGE = "ウィンドウの上の部分に入れたい文章を代入" RIRU_SKIT_WINDOW_MASSAGE = "再生したいイベントを選んでください" #リストに収納するイベント OMAKE_SKIT_LIST = [] #~ OMAKE_SKIT_LIST[ID] = [順序,マップID,イベントID,"題名",消去スイッチID,消去変数ID] OMAKE_SKIT_LIST[0] = [1,5,5,"題名",18,0] #------------------------------------------------------------------------------ # ○イベントの選択シーン #============================================================================== class Scene_Skit_select < Scene_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :list # 実行内容 #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @help_window = Window_Skithelp.new @skit_window = Window_Skit.new @skit_window.active = true end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @help_window.dispose @skit_window.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super update_menu_background @skit_window.update if @skit_window.active decide_skit_selection end end #-------------------------------------------------------------------------- # ● スキットの決定 #-------------------------------------------------------------------------- def decide_skit_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) i = @skit_window.index s_id = OMAKE_SKIT_LIST[i][4] v_id = OMAKE_SKIT_LIST[i][5] $game_switches[s_id] = false if s_id != 0 if v_id != 0 $riru_skit_variables = $game_variables[v_id] $game_variables[v_id] = 0 end map_id = OMAKE_SKIT_LIST[i][1] event_id = OMAKE_SKIT_LIST[i][2] map = load_data(sprintf("Data/Map%03d.rvdata", map_id)) @event = Game_Event.new(map_id, map.events[event_id]) @event.skit_start(@event.list,map_id,event_id) s_id = OMAKE_SKIT_LIST[i][4] v_id = OMAKE_SKIT_LIST[i][5] $game_switches[s_id] = true if s_id != 0 $game_variables[v_id] = $riru_skit_variables if v_id != 0 end end end #============================================================================== # ■ Window_Skit #------------------------------------------------------------------------------ #  スキット選択ウィンドウです。 #============================================================================== class Window_Skit < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 # x : ウィンドウの X 座標 # y : ウィンドウの Y 座標 #-------------------------------------------------------------------------- def initialize super(0, WLH+32, 544, 416-(WLH+32)) @column_max = 2 #@shop_goods = $game_temp.shop_goods refresh self.index = 0 end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh @item_max = OMAKE_SKIT_LIST.size j = -1 create_contents for i in 0...@item_max j += 1 enabled = $game_self_switches[[OMAKE_SKIT_LIST[i][1], OMAKE_SKIT_LIST[i][2], "A"]] draw_item(j,i,enabled) end end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index,id,enabled = true) name = OMAKE_SKIT_LIST[id][3] rect = item_rect(index) self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect, "#{OMAKE_SKIT_LIST[id][0]}:#{name}",0) end end #============================================================================== # ■ Window_Skithelp #------------------------------------------------------------------------------ #  説明文を表示するウィンドウです。 #============================================================================== class Window_Skithelp < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # x : ウィンドウの X 座標 # y : ウィンドウの Y 座標 # actor : アクター #-------------------------------------------------------------------------- def initialize @width = 300 super(0, 0, @width, WLH+32) refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.draw_text(0, y, @width - 32, WLH, RIRU_SKIT_WINDOW_MASSAGE,1) end def update super refresh end end #============================================================================== # ■ Game_Event #------------------------------------------------------------------------------ #  イベントを扱うクラスです。条件判定によるイベントページ切り替えや、並列処理 # イベント実行などの機能を持っており、Game_Map クラスの内部で使用されます。 #============================================================================== class Game_Event < Game_Character #-------------------------------------------------------------------------- # ● イベント起動 #-------------------------------------------------------------------------- def skit_start(list,map_id,event_id) @list = list return if @list.size <= 1 # 実行内容が空? @starting = true lock if @trigger < 3 $game_map.interpreter.skitsetup(@list,map_id,event_id) # イベントをセットアップ end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● イベントのセットアップ # list : 実行内容 # event_id : イベント ID #-------------------------------------------------------------------------- def skitsetup(list,map_id, event_id = 0) clear # インタプリタの内部状態をクリア @map_id = map_id # マップ ID を記憶 @original_event_id = event_id # イベント ID を記憶 @event_id = event_id # イベント ID を記憶 @list = list # 実行内容を記憶 @index = 0 # インデックスを初期化 cancel_menu_call # メニュー呼び出しの取り消し $scene = Scene_Map.new end end