#============================================================================== # ■ XP-RGSS-58 デバッグ++ [Ver.1.4.0] by Claimh #------------------------------------------------------------------------------ =begin デバッグ画面を使って色々な情報を書き換えることができるようになります。 [追加機能] ・セルフスイッチの操作(全マップ&全イベント) ・アイテム/武器/防具の所持数変更 ・パーティー変更(最大4人、パーティー拡張があれば5人以上も可能) ・アクター編集 - ステータス編集 - スキルの習得・忘却 - 熟練度レベル&得意属性・不得意属性の操作(要・熟練度システム) - スキルレベルの操作(要・スキルアップデート) ・マップ移動(ブックマークを使って移動地点の指定が可能) ・音楽再生(BGM/BGS/ME/SE) ・用語辞典の表示設定変更(要・用語辞典) ・ワールドマップの表示設定変更(要・ワールドマップ) ・クエストの状態変更(要・クエストシステム) ・その他情報操作 - 所持金、セーブ回数の変更 - セーブ禁止、メニュー禁止、エンカウント禁止の操作 - 天候の操作 - 用語辞典の初期化(要・用語辞典) - ワールドマップの初期化(要・ワールドマップ) - クエストデータの初期化(要・クエストシステム) [前提条件] ・Window_Select(Ver.2.5.0以上)の導入が必須 ・要・XXとなっているスクリプトよりは下のセッションに配置する必要がある [補足] ・用語辞典、ワールドマップ、クエストの初期化は スクリプト上の設定データに戻す行為です。(差分を入れ込むとかではないです) また、用語辞典初期化時には用語辞典の自動更新は動きません。 =end #============================================================================== module DebugPlus # ブックマーク (マップ移動時の移動ポイント。未設定なら中央に移動) MAP_BOOKMARK = { # マップID => [x, y] 1 => [1,6] } end #============================================================================== # ■ Window_DebugMenu #============================================================================== class Window_DebugMenu < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 416, 32) @enable_L_R = false # L / Rボタン無効 @commands = ["スイッチ", "セルフSW", "変数", "アイテム", "武器", "防具", "パーティー", "アクター", "MAP移動", "音楽"] @commands.push("用語辞典") if defined?(Dictionary) @commands.push("World Map") if defined?(WorldMap) @commands.push("クエスト") if defined?(Quest) @commands.push("その他") @item_max = @commands.size index_refresh(0, true) end def max_i return @item_max - 1 end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help text = [ "スイッチ切り替え(C:ON/OFF切り替え)", "セルフスイッチ切り替え(C:ON/OFF切り替え)", "変数変更(← →:増減)", "アイテム所持数変更(← →:増減)", "武器所持数変更(← →:増減)", "防具所持数変更(← →:増減)", "パーティーメンバー変更(C:ON/OFF切り替え)", "アクター編集(← →:増減、C:ON/OFF切り替え)", "マップ移動(C:マップ移動)", "音楽(C:Play X:Fade Y:Stop Z:Change Ctrl+⇔:Vol Alt+⇔:Pitch A:Reset)" ] text.push("用語辞典表示設定(C:ON/OFF切り替え)") if defined?(Dictionary) text.push("ワールドマップ表示設定(A:REGION表示切替、C:TOWN表示切替)") if defined?(WorldMap) text.push("クエストの状態変更(A:EV⇔ギルド切り替え)") if defined?(Quest) text.push("その他の変更を行います(← →:増減、C:ON/OFF切り替え)") @help_window.set_text(text[@index]) end end #============================================================================== # ■ Window_DebugSwlist #============================================================================== class Window_DebugSwlist < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 488, 416, 32) @commands = [] for i in 1...$data_system.switches.size @commands.push(sprintf("スイッチ [%04d] %s", i, $data_system.switches[i])) end @item_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 320, 32, @commands[index]) status = $game_switches[index+1] ? "[ON]" : "[OFF]" self.contents.draw_text(x+380, y, 100, 32, status) end #-------------------------------------------------------------------------- # ● 選択中SWの変更 #-------------------------------------------------------------------------- def change_sw $game_switches[@index+1] = !$game_switches[@index+1] $game_map.refresh refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) change_sw return true end super return false end end #============================================================================== # ■ SubScene_DebugSelfSw : サブシーンクラス #============================================================================== class SubScene_DebugSelfSw attr_reader :active # アクティブフラグ attr_reader :index # Indexは空定義 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @maps_window = Window_DebugSelfSwMaps.new @events_window = Window_DebugSelfSwEvents.new @list_window = Window_DebugSelfSwList.new # @old_index = 0 @old_events_index = 0 # # maps, events -> curret map id で refresh済み # listだけeventsを元にリフレッシュが必要 @events_window.index = 0 #一度index=0に @list_window.data_refresh($game_map.map_id, @events_window.current_event_id) # @events_window.index = -1 end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose @maps_window.dispose @events_window.dispose @list_window.dispose end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def visible=(flag) @maps_window.visible = flag @events_window.visible = flag @list_window.visible = flag return unless flag @events_window.data_refresh($game_map.map_id) @list_window.data_refresh($game_map.map_id, @events_window.current_event_id) end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def active=(flag) @maps_window.active = flag @active = flag return unless flag @maps_window.set_current_map # index0でなくcurrent mapに end #-------------------------------------------------------------------------- # ● Index変更 #-------------------------------------------------------------------------- def index=(i) if i == 0 @maps_window.set_current_map # index0でなくcurrent mapに else @maps_window.index = i @events_window.index = i @list_window.index = i end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if @maps_window.active return update_maps elsif @events_window.active return update_events elsif @list_window.active return update_lists end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_maps @maps_window.update if @maps_window.index != @old_index @old_index = @maps_window.index @events_window.data_refresh(@maps_window.current_map_id) @list_window.data_refresh(@maps_window.current_map_id, @events_window.start_event_id) end if Input.trigger?(Input::C) unless @maps_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) @maps_window.active = false @events_window.active = true @events_window.index = 0 if @events_window.index < 0 return true end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_events @events_window.update if @events_window.index != @old_events_index @old_events_index = @events_window.index @list_window.data_refresh(@maps_window.current_map_id, @events_window.current_event_id) end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @events_window.active = false @maps_window.active = true return true end if Input.trigger?(Input::C) unless @events_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) @events_window.active = false @list_window.active = true @list_window.index = 0 if @list_window.index < 0 return true end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_lists return true if @list_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @list_window.active = false @events_window.active = true return true end return true end end class DebugMapInfo attr_reader :id attr_reader :name def initialize(id,name) @id = id @name = name end end #============================================================================== # ■ Window_DebugSelfSwMaps #============================================================================== class Window_DebugSelfSwMaps < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 480, 128, 32) @commands = [] map_info = load_data("Data/MapInfos.rxdata") for i in 1...999 next if map_info[i].nil? @commands.push(DebugMapInfo.new(i, map_info[i].name)) end # @column_max = 2 @item_max = @commands.size set_current_map index_refresh(-1, true) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) text = sprintf("[%03d] %s", @commands[index].id, @commands[index].name) self.contents.draw_text(x+4, y, 320, 32, text) end #-------------------------------------------------------------------------- # ● 選択中のマップID #-------------------------------------------------------------------------- def current_map_id return @commands[@index].id end #-------------------------------------------------------------------------- # ● 現在のマップにIndexを設定 #-------------------------------------------------------------------------- def set_current_map for i in 0...@commands.size if @commands[i].id == $game_map.map_id self.index = i return end end @index = 0 # ありえないけど。 p "error[set_current_map]: couldn't data-create" end end #============================================================================== # ■ Window_DebugSelfSwEvents #============================================================================== class Window_DebugSelfSwEvents < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 128, 480, 192, 32) # @column_max = 2 data_refresh($game_map.map_id) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh(map_id) @commands = [] map = load_data(sprintf("Data/Map%03d.rxdata", map_id)) for i in 1...999 next if map.events[i].nil? @commands.push(map.events[i]) end @item_max = @commands.size self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) text = sprintf("[%03d] %s", @commands[index].id, @commands[index].name) self.contents.draw_text(x+4, y, 320, 32, text) end #-------------------------------------------------------------------------- # ● 選択中のイベントID #-------------------------------------------------------------------------- def current_event_id return @commands[@index].id end #-------------------------------------------------------------------------- # ● 先頭イベントID #-------------------------------------------------------------------------- def start_event_id return @commands[0].id end end #============================================================================== # ■ Window_DebugSelfSwList #============================================================================== class Window_DebugSelfSwList < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 320, 480, 96, 32) @commands = ["A", "B", "C", "D"] @item_max = @commands.size @column_max = 2 self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh(map_id, event_id) @map_id = map_id @event_id = event_id self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) return if @map_id.nil? x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 200, 32, @commands[index]) status = $game_self_switches[[@map_id, @event_id, @commands[index]]] ? "[ON]" : "[OFF]" self.contents.draw_text(x+140, y, 100, 32, status) end #-------------------------------------------------------------------------- # ● 選択中SWの変更 #-------------------------------------------------------------------------- def change_sw flag = !$game_self_switches[[@map_id, @event_id, @commands[@index]]] $game_self_switches[[@map_id, @event_id, @commands[@index]]] = flag $game_map.refresh refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) change_sw return true end super return false end end #============================================================================== # ■ Window_DebugVlist #============================================================================== class Window_DebugVlist < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 488, 416, 32) @commands = [] for i in 1...$data_system.switches.size @commands.push(sprintf("変数 [%04d] %s", i, $data_system.variables[i])) end @item_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 320, 32, @commands[index]) self.contents.draw_text(x+300, y, 140, 32, $game_variables[index+1].to_s, 2) end #-------------------------------------------------------------------------- # ● 選択中変数に加算 #-------------------------------------------------------------------------- def add(v) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_variables[@index+1] += v $game_map.refresh refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.repeat?(Input::RIGHT) add(1) return true end if Input.repeat?(Input::LEFT) add(-1) return true end super return false end end #============================================================================== # ■ Window_DebugItem #============================================================================== class Window_DebugItem < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 488, 416, 32) data_refresh self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh @commands = [] for i in 1...$data_items.size @commands.push($data_items[i]) end @item_max = @commands.size self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 所持数 #-------------------------------------------------------------------------- def num(index) return $game_party.item_number(@commands[index].id) end #-------------------------------------------------------------------------- # ● 所持数変更 #-------------------------------------------------------------------------- def gain(v) $game_party.gain_item(@commands[@index].id, v) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) draw_item_name(@commands[index], x+4, y) self.contents.draw_text(x+300, y, 140, 32, num(index).to_s, 2) end #-------------------------------------------------------------------------- # ● 選択中変数に加算 #-------------------------------------------------------------------------- def add(v) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) gain(v) refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.repeat?(Input::RIGHT) add(1) return true end if Input.repeat?(Input::LEFT) add(-1) return true end super return false end end #============================================================================== # ■ Window_DebugWeapon #============================================================================== class Window_DebugWeapon < Window_DebugItem #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh @commands = [] for i in 1...$data_weapons.size @commands.push($data_weapons[i]) end @item_max = @commands.size self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 所持数 #-------------------------------------------------------------------------- def num(index) return $game_party.weapon_number(@commands[index].id) end #-------------------------------------------------------------------------- # ● 所持数変更 #-------------------------------------------------------------------------- def gain(v) $game_party.gain_weapon(@commands[@index].id, v) end end #============================================================================== # ■ Window_DebugArmor #============================================================================== class Window_DebugArmor < Window_DebugItem #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh @commands = [] for i in 1...$data_armors.size @commands.push($data_armors[i]) end @item_max = @commands.size self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 所持数 #-------------------------------------------------------------------------- def num(index) return $game_party.armor_number(@commands[index].id) end #-------------------------------------------------------------------------- # ● 所持数変更 #-------------------------------------------------------------------------- def gain(v) $game_party.gain_armor(@commands[@index].id, v) end end #============================================================================== # ■ Window_DebugParty #============================================================================== class Window_DebugParty < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 488, 416, 32) @commands = [] for i in 1...$data_actors.size @commands.push($data_actors[i]) end @item_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● @actors.inlude? 代用 # actor : アクター #-------------------------------------------------------------------------- def actor_include?(actor) if defined?(Party_Extend) return true if $game_party.actor_include?(actor) return true if $game_party.subactor_include?(actor) else for s_actor in $game_party.actors next if s_actor.nil? return true if actor.id == s_actor.id end end return false end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 320, 32, @commands[index].name) status = actor_include?(@commands[index]) ? "[加入済み]" : "[未加入]" self.contents.draw_text(x+340, y, 140, 32, status) end #-------------------------------------------------------------------------- # ● 選択中SWの変更 #-------------------------------------------------------------------------- def change_sw if actor_include?(@commands[@index]) if $game_party.actors.size < 2 $game_system.se_play($data_system.buzzer_se) return end $game_party.remove_actor(@commands[@index].id) else party_max = defined?(Party_Extend) ? Party_Extend::MAIN_MEMBER + Party_Extend::SUB_MEMBER : 4 if $game_party.actors.size >= party_max $game_system.se_play($data_system.buzzer_se) return end $game_party.add_actor(@commands[@index].id) end # $game_system.se_play($data_system.decision_se) refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end change_sw return true end super return false end end #============================================================================== # ■ SubScene_DebugActor : サブシーンクラス #============================================================================== class SubScene_DebugActor attr_reader :active # アクティブフラグ attr_reader :index # Indexは空定義 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @actors_window = Window_DebugActors.new @menu_window = Window_DebugActorMenu.new @windows = [ Window_DebugActorStatus.new, Window_DebugActorSkill.new ] @windows.push(Window_DebugActorAttr.new) if defined?(SysUpdate) @windows.push(Window_DebugActorSkillLv.new) if defined?(SkillUpdate) # @old_index = 0 @old_actors_index = 0 end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose @actors_window.dispose @menu_window.dispose for win in @windows win.dispose end end #-------------------------------------------------------------------------- # ● 編集ウィンドウIndex #-------------------------------------------------------------------------- def edit_index return @menu_window.index < 0 ? 0 : @menu_window.index end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def visible=(flag) # リストとメニューだけは連動 @actors_window.visible = flag @menu_window.visible = flag if flag # その他(Edit)は有効なもののみ cur_window.visible = flag for win in @windows win.set_actor(@actors_window.actor) end else for win in @windows win.visible = flag end end end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def active=(flag) @actors_window.active = flag @active = flag end #-------------------------------------------------------------------------- # ● Index変更 #-------------------------------------------------------------------------- def index=(i) @actors_window.index = i return if i >= 0 @menu_window.index = i for win in @windows win.index = i end end #---------------------------------------------------------------------------- # ● 表示中ウィンドウ #---------------------------------------------------------------------------- def cur_window return @windows[edit_index] end #---------------------------------------------------------------------------- # ● 表示中ウィンドウの有効化切り替え #---------------------------------------------------------------------------- def cur_window_active(flag) cur_window.active = flag index = cur_window.index for win in @windows win.set_actor(@actors_window.actor) end cur_window.index = index return unless flag cur_window.index = 0 if cur_window.index < 0 end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if @actors_window.active return update_actors elsif @menu_window.active return update_menu elsif @windows[edit_index].active return update_edit end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_actors @actors_window.update if Input.trigger?(Input::C) unless @actors_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) @actors_window.active = false @menu_window.active = true @menu_window.index = 0 if @menu_window.index < 0 return true end if @actors_window.index != @old_actors_index @old_actors_index = @actors_window.index for win in @windows win.set_actor(@actors_window.actor) end end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_menu @menu_window.update if @menu_window.index != @old_index @windows[@old_index].visible = false @old_index = @menu_window.index @windows[@old_index].visible = true @windows[@old_index].index = -1 end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @menu_window.active = false @actors_window.active = true return true end if Input.trigger?(Input::C) unless @menu_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) @menu_window.active = false cur_window_active(true) return true end return true end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_edit return true if cur_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) cur_window_active(false) @menu_window.active = true return true end return true end end #============================================================================== # ■ Window_DebugActors #============================================================================== class Window_DebugActors < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 480, 64, 32) index_refresh(-1, true) self.active = false self.visible = false end #-------------------------------------------------------------------------- # ● 選択中アクター #-------------------------------------------------------------------------- def refresh @commands = [] for actor in $game_party.actors @commands.push(actor.name) end @column_max = @commands.size @item_max = @commands.size super end #-------------------------------------------------------------------------- # ● 選択中アクター #-------------------------------------------------------------------------- def actor return $game_party.actors[0] if @index < 0 return $game_party.actors[@index] end end #============================================================================== # ■ Window_DebugActorMenu #============================================================================== class Window_DebugActorMenu < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 64, 480, 64, 32) @commands = ["ステータス", "スキル"] @commands.push("熟練度") if defined?(SysUpdate) @commands.push("スキルLv") if defined?(SkillUpdate) @column_max = @commands.size @item_max = @commands.size index_refresh(-1, true) self.active = false self.visible = false end def max_i return @item_max - 1 end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help text = ["ステータス編集を行います", "スキルの習得・忘却をします"] text.push("熟練度編集を行います") if defined?(SysUpdate) text.push("スキルレベル編集を行います") if defined?(SkillUpdate) @help_window.set_text(TEXT[@index]) end end #============================================================================== # ■ Window_DebugActorStatus #============================================================================== class Window_DebugActorStatus < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 128, 480, 288, 32) @commands = ["レベル", "最大#{$data_system.words.hp}", "最大#{$data_system.words.sp}", $data_system.words.str, $data_system.words.dex, $data_system.words.agi, $data_system.words.int] @item_max = @commands.size set_actor($game_party.actors[0]) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● アクター設定 #-------------------------------------------------------------------------- def set_actor(actor) @actor = actor index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 200, 32, @commands[index]) case index when 0; text = @actor.level when 1; text = @actor.maxhp when 2; text = @actor.maxsp when 3; text = @actor.str when 4; text = @actor.dex when 5; text = @actor.agi when 6; text = @actor.int end self.contents.draw_text(x+300, y, 140, 32, text.to_s, 2) end #-------------------------------------------------------------------------- # ● 選択中変数に加算 #-------------------------------------------------------------------------- def add(v) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) case index when 0; @actor.level += v when 1; @actor.maxhp += v when 2; @actor.maxsp += v when 3; @actor.str += v when 4; @actor.dex += v when 5; @actor.agi += v when 6; @actor.int += v end refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.repeat?(Input::RIGHT) add(1) return true end if Input.repeat?(Input::LEFT) add(-1) return true end super return false end end #============================================================================== # ■ Window_DebugActorSkill #============================================================================== class Window_DebugActorSkill < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 128, 480, 288, 32) @commands = [] for i in 1...$data_skills.size @commands.push($data_skills[i]) end @item_max = @commands.size set_actor($game_party.actors[0]) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) draw_item_name(@commands[index], x+4, y) status = @actor.skill_learn?(@commands[index].id) ? "[習得済み]" : "[未修得]" self.contents.draw_text(x+340, y, 140, 32, status) end #-------------------------------------------------------------------------- # ● アクター設定 #-------------------------------------------------------------------------- def set_actor(actor) @actor = actor self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 選択中スキルの習得・忘却 #-------------------------------------------------------------------------- def change_learn if @actor.skill_learn?(@commands[@index].id) @actor.forget_skill(@commands[@index].id) else @actor.learn_skill(@commands[@index].id) end refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) change_learn return true end super return false end end #============================================================================== # ■ Window_DebugActorAttr #============================================================================== if defined?(SysUpdate) class Window_DebugActorAttr < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 128, 480, 288, 32) @commands = SysUpdate::ELEMENTS @item_max = @commands.size set_actor($game_party.actors[0]) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● アクター設定 #-------------------------------------------------------------------------- def set_actor(actor) @actor = actor self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) attr_id = @commands[index] draw_attr_icon_pm(@actor, attr_id, x+4, y+4) self.contents.draw_text(x+40, y, 200, 32, $data_system.elements[attr_id]) self.contents.draw_text(x+300, y, 140, 32, @actor.attr[attr_id].level.to_s, 2) end #-------------------------------------------------------------------------- # ● 選択中変数に加算 #-------------------------------------------------------------------------- def add(v) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) # レベルセット @actor.attr[@commands[index]].level += v refresh end #-------------------------------------------------------------------------- # ● 選択中変数に加算 #-------------------------------------------------------------------------- def change_taste unless current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) actor_attr = @actor.attr[@commands[index]] # 得意不得意の変更 actor_attr.taste = (actor_attr.taste + 1) % 3 refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.repeat?(Input::RIGHT) add(1) return true end if Input.repeat?(Input::LEFT) add(-1) return true end if Input.trigger?(Input::C) change_taste return true end super return false end end end # defined?(SysUpdate) #============================================================================== # ■ Window_DebugActorSkillLv #============================================================================== if defined?(SkillUpdate) class Window_DebugActorSkillLv < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 128, 480, 288, 32) set_actor($game_party.actors[0]) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● アクター設定 #-------------------------------------------------------------------------- def set_actor(actor) @actor = actor @commands = [] for skill_id in actor.skills @commands.push($data_skills[skill_id]) end @item_max = @commands.size self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) draw_item_name(@commands[index], x+4, y) level = @actor.skill[@commands[index].id].level self.contents.draw_text(x+300, y, 140, 32, level.to_s, 2) end #-------------------------------------------------------------------------- # ● 選択中変数に加算 #-------------------------------------------------------------------------- def add(v) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) # レベルセット @actor.skill[@commands[index].id].level = @actor.skill[@commands[index].id].level + v refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.repeat?(Input::RIGHT) add(1) return true end if Input.repeat?(Input::LEFT) add(-1) return true end super return false end end end # defined?(SkillUpdate) #============================================================================== # ■ Window_DebugMapJump #============================================================================== class Window_DebugMapJump < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 488, 416, 32) @commands = [] map_info = load_data("Data/MapInfos.rxdata") for i in 1...999 next if map_info[i].nil? @commands.push(DebugMapInfo.new(i, map_info[i].name)) end # @column_max = 2 @item_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) text = sprintf("[%03d] %s", @commands[index].id, @commands[index].name) self.contents.draw_text(x+4, y, 320, 32, text) end #-------------------------------------------------------------------------- # ● 指定マップへ移動 #-------------------------------------------------------------------------- def map_jump pos = calc_position # マップをリロード $game_map.setup(@commands[@index].id) $game_player.moveto(pos[0], pos[1]) $game_player.turn_down $game_player.straighten # マップへ移動 $game_map.autoplay $game_map.update $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ● 移動地点の計算 #-------------------------------------------------------------------------- def calc_position pos = DebugPlus::MAP_BOOKMARK[@commands[@index].id] if pos.nil? map = load_data(sprintf("Data/Map%03d.rxdata", @commands[@index].id)) pos = [map.width / 2, map.height / 2] end return pos end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) map_jump return true end super return false end end #============================================================================== # ■ Window_DebugMusic #============================================================================== class Window_DebugMusic < Window_Select BGM=0;BGS=1;ME=2;SE=3 ADD=5 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 488, 416, 32) @volume = 100 @pitch = 100 change_mode(BGM) index_refresh(-1, true) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● モード変更 #-------------------------------------------------------------------------- def change_mode(mode) @mode = mode rtp = [] case @mode when BGM; @path="Audio/BGM/"; rtp=RTP_BGM when BGS; @path="Audio/BGS/"; rtp=RTP_BGS when ME; @path="Audio/ME/"; rtp=RTP_ME when SE; @path="Audio/SE/"; rtp=RTP_SE end @commands = audio_grep(@path) + rtp @item_max = @commands.size end #-------------------------------------------------------------------------- # ● AudioフォルダのGrep #-------------------------------------------------------------------------- def audio_grep(path) list = Dir.glob(path+"*") file_list = [] for l in list next if FileTest.directory?(l) # ディレクトリは無視 filename = File.basename(l) # ファイル名の抽出 case File.extname(filename).downcase # 拡張子チェック when ".ogg", ".wma",".mp3", ".wav" when ".mid"; next if @mode == BGS or @mode == SE # BGS/SEはmidi再生不可 else; next # 対応していないフォーマットはスルー end file_list.push(filename) end return file_list end #-------------------------------------------------------------------------- # ● Audioファイル再生/停止 ※Game_Systemは使わない #-------------------------------------------------------------------------- def play case @mode when BGM; Audio.bgm_play(@path+current_item, @volume, @pitch) when BGS; Audio.bgs_play(@path+current_item, @volume, @pitch) when ME; Audio.me_play(@path+current_item, @volume, @pitch) when SE; Audio.se_play(@path+current_item, @volume, @pitch) end end def fade case @mode when BGM; Audio.bgm_fade(1000) when BGS; Audio.bgs_fade(1000) when ME; Audio.me_fade(1000) when SE; Audio.se_stop # SEはフェードせず停止 end end def stop case @mode when BGM; Audio.bgm_stop when BGS; Audio.bgs_stop when ME; Audio.me_stop when SE; Audio.se_stop end end def all_stop @volume = 100 @pitch = 100 Audio.bgm_stop Audio.bgs_stop Audio.me_stop Audio.se_stop end def volume(add) @volume = [[@volume+add, 0].max, 100].min play end def pitch(add) @pitch = [[@pitch+add, 50].max, 150].min play end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.press?(Input::CTRL) and Input.trigger?(Input::C) p "file=#{(@path+current_item)}", "volume=#{@volume}", "pitch=#{@pitch}" return true end if Input.trigger?(Input::A) all_stop $game_system.bgm_play($game_system.playing_bgm) return true end if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end play return true end if Input.trigger?(Input::X) fade return true end if Input.trigger?(Input::Y) stop return true end if Input.trigger?(Input::Z) $game_system.se_play($data_system.decision_se) change_mode((@mode+1)%4) index_refresh(0, true) return true end if Input.press?(Input::CTRL) volume(ADD) if Input.repeat?(Input::RIGHT) volume(-ADD) if Input.repeat?(Input::LEFT) return true end if Input.press?(Input::ALT) pitch(ADD) if Input.repeat?(Input::RIGHT) pitch(-ADD) if Input.repeat?(Input::LEFT) return true end super return false end #-------------------------------------------------------------------------- # ● RTPのファイル名 #-------------------------------------------------------------------------- RTP_BGM = [ "001-Battle01.mid", "002-Battle02.mid", "003-Battle03.mid", "004-Battle04.mid", "005-Boss01.mid", "006-Boss02.mid", "007-Boss03.mid", "008-Boss04.mid", "009-LastBoss01.mid", "010-LastBoss02.mid", "011-LastBoss03.mid", "012-Theme01.mid", "013-Theme02.mid", "014-Theme03.mid", "015-Theme04.mid", "016-Theme05.mid", "017-Theme06.mid", "018-Field01.mid", "019-Field02.mid", "020-Field03.mid", "021-Field04.mid", "022-Field05.mid", "023-Town01.mid", "024-Town02.mid", "025-Town03.mid", "026-Town04.mid", "027-Town05.mid", "028-Town06.mid", "029-Town07.mid", "030-Town08.mid", "031-Castle01.mid", "032-Church01.mid", "033-Ship01.mid", "034-Heaven01.mid", "035-Dungeon01.mid", "036-Dungeon02.mid", "037-Dungeon03.mid", "038-Dungeon04.mid", "039-Dungeon05.mid", "040-Dungeon06.mid", "041-Dungeon07.mid", "042-Dungeon08.mid", "043-Positive01.mid", "044-Positive02.mid", "045-Positive03.mid", "046-Positive04.mid", "047-Positive05.mid", "048-Positive06.mid", "049-Positive07.mid", "050-Positive08.mid", "051-Positive09.mid", "052-Negative01.mid", "053-Negative02.mid", "054-Negative03.mid", "055-Negative04.mid", "056-Negative05.mid", "057-Negative06.mid", "058-Slow01.mid", "059-Slow02.mid", "060-Slow03.mid", "061-Slow04.mid", "062-Slow05.mid", "063-Slow06.mid", "064-Slow07.mid" ] RTP_BGS = [ "001-Wind01.ogg", "002-Wind02.ogg", "003-Wind03.ogg", "004-Wind04.ogg", "005-Rain01.ogg", "006-Rain02.ogg", "007-Rain03.ogg", "008-Wave01.ogg", "009-Wave02.ogg", "010-River01.ogg", "011-Waterfall01.ogg", "012-Waterfall02.ogg", "013-Fire01.ogg", "014-Fire02.ogg", "015-Quake01.ogg", "016-Drips01.ogg", "017-Creature01.ogg", "018-Darkness01.ogg", "019-People01.ogg", "020-People02.ogg", ] RTP_ME = [ "001-Victory01.mid", "002-Victory02.mid", "003-Victory03.mid", "004-Victory04.mid", "005-Defeat01.mid", "006-Defeat02.mid", "007-Fanfare01.mid", "008-Fanfare02.mid", "009-Fanfare03.mid", "010-Item01.mid", "011-Item02.mid", "012-Gag01.mid", "013-Gag02.mid", "014-Inn01.mid", "015-Mystery01.mid", "016-Shock01.mid" ] RTP_SE = [ "001-System01.ogg", "002-System02.ogg", "003-System03.ogg", "004-System04.ogg", "005-System05.ogg", "006-System06.ogg", "007-System07.ogg", "008-System08.ogg", "009-System09.ogg", "010-System10.ogg", "011-System11.ogg", "012-System12.ogg", "013-Move01.ogg", "014-Move02.ogg", "015-Jump01.ogg", "016-Jump02.ogg", "017-Jump03.ogg", "018-Teleport01.ogg", "019-Teleport02.ogg", "020-Teleport03.ogg", "021-Dive01.ogg", "022-Dive02.ogg", "023-Dive03.ogg", "024-Door01.ogg", "025-Door02.ogg", "026-Door03.ogg", "027-Door04.ogg", "028-Door05.ogg", "029-Door06.ogg", "030-Door07.ogg", "031-Door08.ogg", "032-Switch01.ogg", "033-Switch02.ogg", "034-Switch03.ogg", "035-Switch04.ogg", "036-Switch05.ogg", "037-Switch06.ogg", "038-Switch07.ogg", "039-Switch08.ogg", "040-Knock01.ogg", "041-Knock02.ogg", "042-Knock03.ogg", "043-Knock04.ogg", "044-Chest01.ogg", "045-Push01.ogg", "046-Book01.ogg", "047-Book02.ogg", "048-Explosion01.ogg", "049-Explosion02.ogg", "050-Explosion03.ogg", "051-Explosion04.ogg", "052-Cannon01.ogg", "053-Cannon02.ogg", "054-Cannon03.ogg", "055-Right01.ogg", "056-Right02.ogg", "057-Wrong01.ogg", "058-Wrong02.ogg", "059-Applause01.ogg", "060-Cheer01.ogg", "061-Thunderclap01.ogg", "062-Swing01.ogg", "063-Swing02.ogg", "064-Swing03.ogg", "065-Swing04.ogg", "066-Animal01.ogg", "067-Animal02.ogg", "068-Animal03.ogg", "069-Animal04.ogg", "070-Animal05.ogg", "071-Animal06.ogg", "072-Animal07.ogg", "073-Animal08.ogg", "074-Small01.ogg", "075-Small02.ogg", "076-Small03.ogg", "077-Small04.ogg", "078-Small05.ogg", "079-Monster01.ogg", "080-Monster02.ogg", "081-Monster03.ogg", "082-Monster04.ogg", "083-Monster05.ogg", "084-Monster06.ogg", "085-Monster07.ogg", "086-Action01.ogg", "087-Action02.ogg", "088-Action03.ogg", "089-Attack01.ogg", "090-Attack02.ogg", "091-Attack03.ogg", "092-Attack04.ogg", "093-Attack05.ogg", "094-Attack06.ogg", "095-Attack07.ogg", "096-Attack08.ogg", "097-Attack09.ogg", "098-Attack10.ogg", "099-Attack11.ogg", "100-Attack12.ogg", "101-Attack13.ogg", "102-Attack14.ogg", "103-Attack15.ogg", "104-Attack16.ogg", "105-Heal01.ogg", "106-Heal02.ogg", "107-Heal03.ogg", "108-Heal04.ogg", "109-Heal05.ogg", "110-Heal06.ogg", "111-Heal07.ogg", "112-Heal08.ogg", "113-Remedy01.ogg", "114-Remedy02.ogg", "115-Raise01.ogg", "116-Raise02.ogg", "117-Fire01.ogg", "118-Fire02.ogg", "119-Fire03.ogg", "120-Ice01.ogg", "121-Ice02.ogg", "122-Ice03.ogg", "123-Thunder01.ogg", "124-Thunder02.ogg", "125-Thunder03.ogg", "126-Water01.ogg", "127-Water02.ogg", "128-Water03.ogg", "129-Earth01.ogg", "130-Earth02.ogg", "131-Earth03.ogg", "132-Wind01.ogg", "133-Wind02.ogg", "134-Wind03.ogg", "135-Light01.ogg", "136-Light02.ogg", "137-Light03.ogg", "138-Darkness01.ogg", "139-Darkness02.ogg", "140-Darkness03.ogg", "141-Burst01.ogg", "142-Burst02.ogg", "143-Support01.ogg", "144-Support02.ogg", "145-Support03.ogg", "146-Support04.ogg", "147-Support05.ogg", "148-Support06.ogg", "149-Support07.ogg", "150-Support08.ogg", "151-Support09.ogg", "152-Support10.ogg", "153-Support11.ogg", "154-Support12.ogg", "155-Support13.ogg", "156-Support14.ogg", "157-Skill01.ogg", "158-Skill02.ogg", "159-Skill03.ogg", "160-Skill04.ogg", "161-Skill05.ogg", "162-Skill06.ogg", "163-Skill07.ogg", "164-Skill08.ogg", "165-Skill09.ogg", "166-Skill10.ogg", "167-Skill11.ogg", "168-Skill12.ogg", "169-Skill13.ogg", "170-Skill14.ogg", "171-Skill15.ogg", "172-Skill16.ogg", "173-Skill17.ogg", "174-Skill18.ogg", "175-Skill19.ogg", "176-Skill20.ogg", "177-Skill21.ogg", "178-Skill22.ogg", "179-Skill23.ogg", "180-Skill24.ogg" ] end if defined?(Dictionary) #============================================================================== # ■ SubScene_DebugDictionary : サブシーンクラス #============================================================================== class SubScene_DebugDictionary attr_reader :active # アクティブフラグ attr_reader :index # Indexは空定義 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @menu_window = Window_DebugDictMenu.new @list_window = Window_DebugDictList.new # @old_index = 0 end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose @menu_window.dispose @list_window.dispose end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def visible=(flag) @menu_window.visible = flag @list_window.visible = flag return unless flag @list_window.data_refresh(0) end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def active=(flag) @menu_window.active = flag @active = flag end #-------------------------------------------------------------------------- # ● Index変更 #-------------------------------------------------------------------------- def index=(i) @menu_window.index = i return if i >= 0 @list_window.index = i end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if @menu_window.active return update_menu elsif @list_window.active return update_list end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_menu return true if @menu_window.update if @menu_window.index != @old_index @old_index = @menu_window.index @list_window.data_refresh(@menu_window.index) end if Input.trigger?(Input::C) unless @menu_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) @menu_window.active = false @list_window.active = true @list_window.index = 0 if @list_window.index < 0 return true end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_list return true if @list_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @list_window.active = false @menu_window.active = true return true end return true end end #============================================================================== # ■ Window_DebugDictMenu #============================================================================== class Window_DebugDictMenu < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 480, 128, 32) @commands = Dictionary::CATEGORY @column_max = 2 @item_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end end #============================================================================== # ■ Window_DebugDictList #============================================================================== class Window_DebugDictList < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 128, 480, 288, 32) data_refresh self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh(category=0) @commands = [] for id in $game_system.dictionary[category].keys @commands.push($game_system.dictionary[category][id]) end @item_max = @commands.size self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 320, 32, @commands[index].name.delete("\\n").delete("\\")) status = @commands[index].show_flg ? "[表示]" : "[非表示]" self.contents.draw_text(x+350, y, 120, 32, status) end #-------------------------------------------------------------------------- # ● 用語の表示・非表示を変更 #-------------------------------------------------------------------------- def change_sw @commands[@index].show_flg = !@commands[@index].show_flg refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) change_sw return true end super return false end end end # defined?(Dictionary) if defined?(WorldMap) #============================================================================== # ■ SubScene_DebugWorldMap : サブシーンクラス #============================================================================== class SubScene_DebugWorldMap attr_reader :active # アクティブフラグ attr_reader :index # Indexは空定義 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @region_window = Window_DebugWorldRegion.new @town_window = Window_DebugWorldTown.new # @old_index = 0 end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose @region_window.dispose @town_window.dispose end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def visible=(flag) @region_window.visible = flag @town_window.visible = flag return unless flag @region_window.data_refresh @town_window.data_refresh(0) end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def active=(flag) @region_window.active = flag @active = flag end #-------------------------------------------------------------------------- # ● Index変更 #-------------------------------------------------------------------------- def index=(i) @region_window.index = i return if i >= 0 @town_window.index = i end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if @region_window.active return update_region elsif @town_window.active return update_town end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_region return true if @region_window.update if @region_window.index != @old_index @old_index = @region_window.index @town_window.data_refresh(@region_window.index) end if Input.trigger?(Input::C) unless @region_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) @region_window.active = false @town_window.active = true @town_window.index = 0 if @town_window.index < 0 return true end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_town return true if @town_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @town_window.active = false @region_window.active = true return true end return true end end #============================================================================== # ■ Window_DebugWorldRegion #============================================================================== class Window_DebugWorldRegion < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 480, 192, 32) data_refresh self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh @commands = [] for id in $game_system.worldmap.ids @commands.push($game_system.worldmap[id]) end @item_max = @commands.size index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 320, 32, @commands[index].region_name) status = @commands[index].visible ? "[表示]" : "[非表示]" self.contents.draw_text(x+350, y, 120, 32, status) end #-------------------------------------------------------------------------- # ● 表示・非表示を変更 #-------------------------------------------------------------------------- def change_sw @commands[@index].visible = !@commands[@index].visible refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::A) $game_system.se_play($data_system.decision_se) change_sw return true end super return false end end #============================================================================== # ■ Window_DebugWorldTown #============================================================================== class Window_DebugWorldTown < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 192, 480, 224, 32) data_refresh($game_system.worldmap.ids[0]) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh(region=0) @commands = [] for id in $game_system.worldmap[region].ids @commands.push($game_system.worldmap[region][id]) end @item_max = @commands.size self.top_row = 0 index_refresh(-1, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 320, 32, @commands[index].town_name) status = @commands[index].visible ? "[表示]" : "[非表示]" self.contents.draw_text(x+350, y, 120, 32, status) end #-------------------------------------------------------------------------- # ● 表示・非表示を変更 #-------------------------------------------------------------------------- def change_sw @commands[@index].visible = !@commands[@index].visible refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if Input.trigger?(Input::C) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) change_sw return true end super return false end end end # defined?(WorldMap) if defined?(Quest) #============================================================================== # ■ SubScene_DebugQuest : サブシーンクラス #============================================================================== class SubScene_DebugQuest attr_reader :active # アクティブフラグ attr_reader :index # Indexは空定義 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @type_window = Window_DebugQuestType.new @quest_window = Window_DebugQuestList.new @edit_window = Window_DebugQuestEdit.new @info_window = Window_DebugQuestInfo.new @quest_window.help_window = @info_window # @old_index = 0 @quest_window.data_refresh(0) end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- def dispose @type_window.dispose @quest_window.dispose @edit_window.dispose @info_window.dispose end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def visible=(flag) @type_window.visible = flag @quest_window.visible = flag @edit_window.visible = flag unless flag @info_window.visible = flag return unless flag @type_window.index_refresh(0, true) @quest_window.data_refresh(@type_window.index) end #-------------------------------------------------------------------------- # ● 表示切替 #-------------------------------------------------------------------------- def active=(flag) @quest_window.active = flag @active = flag end #-------------------------------------------------------------------------- # ● Index変更 #-------------------------------------------------------------------------- def index=(i) @type_window.index = i if i < 0 @quest_window.index = i else @quest_window.data_refresh(@type_window.index, i) end end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if @quest_window.active return update_quest elsif @edit_window.active return update_edit end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_quest @quest_window.update if Input.trigger?(Input::A) $game_system.se_play($data_system.decision_se) @type_window.index = (@type_window.index + 1) % 2 @quest_window.data_refresh(@type_window.index, 0) elsif Input.trigger?(Input::C) unless @quest_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return true end $game_system.se_play($data_system.decision_se) @quest_window.active = false @edit_window.active = true @edit_window.visible = true @edit_window.index = 0 return true end return false end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update_edit @edit_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @edit_window.active = false @edit_window.visible = false @quest_window.active = true return true elsif Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) case @edit_window.index when 0; @quest_window.current_item.visible = !@quest_window.current_item.visible when 1; @quest_window.current_item.view_res = !@quest_window.current_item.view_res when 2; @quest_window.current_item.view_cond = !@quest_window.current_item.view_cond when 3; @quest_window.current_item.quest_start when 4; @quest_window.current_item.quest_clear(true, false) # 強制 when 5; @quest_window.current_item.quest_fail(true, false) # 強制 when 6; @quest_window.current_item.reset end @quest_window.refresh @quest_window.update_help $scene.refresh_other return true end return false end end #============================================================================== # ■ Window_DebugQuestType #============================================================================== class Window_DebugQuestType < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 480, 64, 32) @commands = ["EVクエスト", "ギルドクエスト"] @item_max = @column_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end end #============================================================================== # ■ Window_DebugQuestList #============================================================================== class Window_DebugQuestList < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 64, 480, 288, 32) data_refresh self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● リスト初期化 #-------------------------------------------------------------------------- def data_refresh(type=0, i=-1) @commands = [] for id in $game_system.quest.ids data = $game_system.quest[id] case type when 0; @commands.push(data) if !data.enable when 1; @commands.push(data) if data.enable end end @item_max = @commands.size self.top_row = 0 index_refresh(i, true) end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) quest = item(index) x = index_pos_x(index) y = index_pos_y(index) self.contents.draw_text(x+4, y, 320, 32, Quest.conv_text(quest.name)) text = quest.playing ? "[進行中]" : quest.clear ? "[クリア済み]" : quest.fail ? "[失敗]": "[未開始]" self.contents.draw_text(x+330, y, 120, 32, text) end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help @help_window.refresh(current_item) end end #============================================================================== # ■ Window_DebugQuestEdit #============================================================================== class Window_DebugQuestEdit < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(440, 64, 200, 288, 32) self.z = 200 @commands = [ "表示切替", "報酬表示切替", "進捗表示切替", "進捗中", "クリア済み", "失敗", "リセット" ] @item_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end end #============================================================================== # ■ Window_DebugQuestInfo #============================================================================== class Window_DebugQuestInfo < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 352, 480, 64) self.contents = Bitmap.new(width - 32, height - 32) self.visible = false end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(data) self.contents.clear return if data.nil? self.contents.draw_text(0, 0, 160, 32, data.visible ? "一覧 [表示]" : "一覧 [非表示]") self.contents.draw_text(150, 0, 160, 32, data.view_res ? "報酬 [表示]" : "報酬 [非表示]") self.contents.draw_text(300, 0, 160, 32, data.view_cond ? "進捗 [表示]" : "進捗 [非表示]") end end end # defined?(Quest) #============================================================================== # ■ DebugPlusOther #============================================================================== module DebugPlusOther M_MONEY = 0 # 所持金 M_SAVE_CNT = 1 # セーブ回数 M_SAVE_DISABLE = 2 # セーブ禁止 M_MENU_DISABLE = 3 # メニュー禁止 M_ENC_DISABLE = 4 # エンカウント禁止 M_WEATHER = 5 # 天候変更 M_DICTIONARY = 10 # 用語辞典初期化 M_WORLDMAP = 11 # ワールドマップ初期化 M_QUEST_DATA = 12 # クエストデータの全初期化 WEATER = ["[晴れ]", "[雨]", "[嵐]", "[雪]"] module_function #-------------------------------------------------------------------------- # ● リスト生成 #-------------------------------------------------------------------------- def make_other_list @list = [] @list.push(DebugOther.new(M_MONEY)) @list.push(DebugOther.new(M_SAVE_CNT)) @list.push(DebugOther.new(M_SAVE_DISABLE)) @list.push(DebugOther.new(M_MENU_DISABLE)) @list.push(DebugOther.new(M_ENC_DISABLE)) @list.push(DebugOther.new(M_WEATHER)) @list.push(DebugOther.new(M_DICTIONARY)) if defined?(Dictionary) @list.push(DebugOther.new(M_WORLDMAP)) if defined?(WorldMap) @list.push(DebugOther.new(M_QUEST_DATA)) if defined?(Quest) return @list end end class DebugOther include DebugPlusOther attr_reader :type # 種類 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(type, variable=false) @type = type end #-------------------------------------------------------------------------- # ● 変数操作あり? #-------------------------------------------------------------------------- def variable? case @type when M_MONEY, M_SAVE_CNT return true end return false end #-------------------------------------------------------------------------- # ● 操作実行 #-------------------------------------------------------------------------- def execute(v=0) case @type when M_MONEY; $game_party.gain_gold(v) when M_SAVE_CNT; $game_system.save_count += v when M_SAVE_DISABLE;$game_system.save_disabled = !$game_system.save_disabled when M_MENU_DISABLE;$game_system.menu_disabled = !$game_system.menu_disabled when M_WEATHER; $game_screen.weather(($game_screen.weather_type+1) % 4, 1, 0) when M_ENC_DISABLE; $game_system.encounter_disabled = !$game_system.encounter_disabled when M_DICTIONARY; $game_system.dictionary.reset when M_WORLDMAP; $game_system.worldmap.reset when M_QUEST_DATA; $game_system.quest.reset(false) end end #-------------------------------------------------------------------------- # ● テキスト表示 #-------------------------------------------------------------------------- def draw_text(bitmap, x, y) case @type when M_MONEY; txt = "所持金" when M_SAVE_CNT; txt = "セーブ回数" when M_SAVE_DISABLE;txt = "セーブ禁止" when M_MENU_DISABLE;txt = "メニュー禁止" when M_ENC_DISABLE; txt = "エンカウント禁止" when M_WEATHER; txt = "天候変更" when M_DICTIONARY; txt = "用語辞典の初期化" when M_WORLDMAP; txt = "ワールドマップの初期化" when M_QUEST_DATA; txt = "クエストデータの全初期化" end bitmap.draw_text(x+4, y, 320, 32, txt) # case @type when M_MONEY bitmap.draw_text(x+240, y, 200, 32, $game_party.gold.to_s, 2) when M_SAVE_CNT bitmap.draw_text(x+240, y, 200, 32, $game_system.save_count.to_s, 2) when M_SAVE_DISABLE bitmap.draw_text(x+380, y, 100, 32, $game_system.save_disabled ? "[ON]" : "[OFF]") when M_MENU_DISABLE bitmap.draw_text(x+380, y, 100, 32, $game_system.menu_disabled ? "[ON]" : "[OFF]") when M_ENC_DISABLE bitmap.draw_text(x+380, y, 100, 32, $game_system.encounter_disabled ? "[ON]" : "[OFF]") when M_WEATHER bitmap.draw_text(x+380, y, 100, 32, WEATER[$game_screen.weather_type]) end end end #============================================================================== # ■ Window_DebugOther #============================================================================== class Window_DebugOther < Window_Select #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(160, 0, 488, 416, 32) @commands = DebugPlusOther.make_other_list @item_max = @commands.size index_refresh(-1, true) self.visible = false self.active = false end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) x = index_pos_x(index) y = index_pos_y(index) @commands[index].draw_text(self.contents, x, y) end #-------------------------------------------------------------------------- # ● 選択中変数に加算 #-------------------------------------------------------------------------- def execute(v=0) unless current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) v *= 1000 if Input.press?(Input::CTRL) v *= 100 if Input.press?(Input::ALT) @commands[@index].execute(v) refresh end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update if @commands[@index].variable? if Input.repeat?(Input::RIGHT) execute(1) return true elsif Input.repeat?(Input::LEFT) execute(-1) return true end elsif Input.trigger?(Input::C) execute return true end super return false end end #============================================================================== # ■ Scene_Debug #============================================================================== class Scene_Debug #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main start # 開始処理 Graphics.transition # トランジション実行 loop do Graphics.update # ゲーム画面を更新 Input.update # 入力情報を更新 update # フレーム更新 break if $scene != self # 画面が切り替わったらループを中断 end Graphics.update Graphics.freeze # トランジション準備 terminate # 終了処理 end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start @help_window = Window_Help.new @help_window.y = 416 @menu_window = Window_DebugMenu.new # @windows = [ Window_DebugSwlist.new, SubScene_DebugSelfSw.new, Window_DebugVlist.new, Window_DebugItem.new, Window_DebugWeapon.new, Window_DebugArmor.new, Window_DebugParty.new, SubScene_DebugActor.new, Window_DebugMapJump.new, Window_DebugMusic.new ] @windows.push(SubScene_DebugDictionary.new) if defined?(Dictionary) @windows.push(SubScene_DebugWorldMap.new) if defined?(WorldMap) @windows.push(SubScene_DebugQuest.new) if defined?(Quest) @windows.push(Window_DebugOther.new) # cur_window.visible = true @menu_window.help_window = @help_window # @old_index = @menu_window.index end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate @help_window.dispose @menu_window.dispose for win in @windows win.dispose end end #---------------------------------------------------------------------------- # ● 表示中ウィンドウ #---------------------------------------------------------------------------- def cur_window return @windows[@menu_window.index] end #---------------------------------------------------------------------------- # ● OtherWindowのリフレッシュ(お金更新用) #---------------------------------------------------------------------------- def refresh_other @windows[@windows.size-1].refresh end #---------------------------------------------------------------------------- # ● 表示中ウィンドウの有効化切り替え #---------------------------------------------------------------------------- def cur_window_active(flag) cur_window.active = flag cur_window.index = flag ? 0 : -1 end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update if @menu_window.active update_menu elsif cur_window.active update_window end end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update_menu @menu_window.update if @menu_window.index != @old_index @windows[@old_index].visible = false @old_index = @menu_window.index @windows[@old_index].visible = true @windows[@old_index].index = 0 @windows[@old_index].index = -1 end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) unless @menu_window.current_index_active? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) cur_window_active(true) @menu_window.active = false return end end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update_window return if cur_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) cur_window_active(false) @menu_window.active = true return end end end