#============================================================================== # ■ VXAce-RGSS-44 デバッグ++ [Ver.1.2.0] by Claimh #------------------------------------------------------------------------------ =begin デバッグ画面の機能拡張をします。 [追加機能] ・セルフスイッチの操作(現在マップ上の全イベント) ・アイテム/武器/防具の所持数変更 ・パーティー変更 ・アクター編集 - ステータス編集 - スキルの習得・忘却 ・マップ移動(移動地点の指定も可能) ・音楽再生(BGM/BGS/ME/SE) ・その他情報操作 - 所持金、セーブ回数、戦闘回数の変更 - セーブ禁止、メニュー禁止、エンカウント禁止、並び替え禁止の操作 - 天候の操作 - 解像度の変更 [他スクリプトとの連動機能] ・熟練度システム - 熟練度レベル変更、得意属性・不得意属性の操作 ・用語辞典 - 全初期化、表示設定変更 ・ワールドマップ - 全初期化、表示設定変更 ・クエストシステム - 全初期化、クエスト状態変更、クエストランク変更 ・精霊システム - 精霊の加入状態の変更、精霊のステータス編集 ・フィールドマップ - 全初期化、ルート表示変更 =end #============================================================================== module DebugPP # 項目有効/無効 SPEC = { "スイッチ" => true, "変数" => true, "セルフSW" => true, "アイテム" => true, "武器" => true, "防具" => true, "パーティー" => true, "ステータス" => true, "スキル" => true, "MAP移動" => true, "ミュージック" => true, "システム" => true, "熟練度" => true, # 「熟練度システム」未導入時は無効化される "用語辞典" => true, # 「用語辞典」未導入時は無効化される "WorldMap" => true, # 「ワールドマップ」未導入時は無効化される "クエスト" => true, # 「クエストシステム」未導入時は無効化される "精霊" => true, # 「精霊システム」未導入時は無効化される "FieldMap" => true, # 「フィールドマップ」未導入時は無効化される } # MAP移動時の位置(設定無し時は中央) MAP = { # マップID => [x座標, y座標] 1 => [5, 5], 3 => [10, 5] } # ミュージックでRTPも含む RTP_MUSIC = true end module DebugPP # DebugPP.spec(n) def self.spec(n) return false if SPEC[n].nil? SPEC[n] end end class Game_System #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_writer :save_count # セーブ回数 end #============================================================================== # ■ Window_DebugCommand #============================================================================== class Window_DebugCommand < Window_Command #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(height) @window_height = height super(0, 0) end #-------------------------------------------------------------------------- # ● ウィンドウ高さの取得 #-------------------------------------------------------------------------- def window_height h = super h > @window_height ? @window_height : h end #-------------------------------------------------------------------------- # ● 表示行数の取得 #-------------------------------------------------------------------------- def visible_line_number n = (@window_height - standard_padding * 2) / item_height n > item_max ? item_max : n end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_main_commands add_original_commands add_command("システム", :ok, true, system_text) if DebugPP.spec("システム") end #-------------------------------------------------------------------------- # ● 主要コマンドをリストに追加 # ハンドラは全て:okで登録する #-------------------------------------------------------------------------- def add_main_commands add_command("スイッチ", :ok, true, switch_text) if DebugPP.spec("スイッチ") add_command("変数", :ok, true, variable_text) if DebugPP.spec("変数") add_command("セルフSW", :ok, true, self_sw_text) if DebugPP.spec("セルフSW") add_command(Vocab::item, :ok, true, item_text) if DebugPP.spec("アイテム") add_command(Vocab::weapon, :ok, true, weapon_text) if DebugPP.spec("武器") add_command(Vocab::armor, :ok, true, armor_text) if DebugPP.spec("防具") add_command("パーティー", :ok, true, party_text) if DebugPP.spec("パーティー") add_command(Vocab::status, :ok, true, actor_text) if DebugPP.spec("ステータス") add_command(Vocab::skill, :ok, true, skill_text) if DebugPP.spec("スキル") add_command("MAP移動", :ok, true, map_text) if DebugPP.spec("MAP移動") add_command("ミュージック", :ok, true, music_text) if DebugPP.spec("ミュージック") end #-------------------------------------------------------------------------- # ● 独自コマンドの追加用 #-------------------------------------------------------------------------- def add_original_commands add_command("熟練度", :ok, true, expert_text) if defined?(SysUpdate) and DebugPP.spec("熟練度") add_command("用語辞典", :ok, true, dictionary_text) if defined?(Dictionary) and DebugPP.spec("用語辞典") add_command("World Map", :ok, true, world_map_text) if defined?(WorldMap) and DebugPP.spec("WorldMap") add_command("クエスト", :ok, true, quest_text) if defined?(Quest) and DebugPP.spec("クエスト") add_command("精霊", :ok, true, spirit_text) if defined?(Spirits) and DebugPP.spec("精霊") add_command("Field Map", :ok, true, fieldmap_text) if defined?(FieldMap) and DebugPP.spec("FieldMap") end #-------------------------------------------------------------------------- # ● 説明文 #-------------------------------------------------------------------------- def switch_text ["スイッチの状態を変更します。", "C (Enter) : ON / OFF"] end def variable_text ["変数の値を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"] end def self_sw_text ["セルフスイッチの状態を変更します。", "C (Enter) : ON / OFF"] end def item_text ["アイテムの所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"] end def weapon_text ["武器の所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"] end def armor_text ["防具の所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"] end def party_text ["加入メンバーを変更します。", "C (Enter) : 加入 / 脱退"] end def actor_text ["アクターのステータスを変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"] end def skill_text ["アクターの習得スキルを変更します。", "C (Enter) : 習得 / 忘却"] end def map_text ["マップを移動します。", "C (Enter) : 移動"] end def music_text ["音楽を変更します。", "C (Enter) : 再生 / Y : 停止 / X : MAP音復帰"] end def system_text ["その他、色々変更します。", "C (Enter) : 変更"] end #-------------------------------------------------------------------------- # ● 説明文(拡張) #-------------------------------------------------------------------------- def expert_text ["アクターの熟練度を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動 / X : 好み変更"] end def dictionary_text ["用語の表示状態を変更します。", "C (Enter) : ON / OFF"] end def world_map_text ["場所の表示状態を変更します。", "X : Region / C (Enter) : Town --> ON / OFF"] end def quest_text ["クエストの状態を変更します。", "C (Enter) : 変更"] end def spirit_text ["精霊の加入状態を変更します。", "C (Enter) : 加入 / 脱退"] end def fieldmap_text ["ルートの表示状態を変更します。", "C (Enter) : ON / OFF"] end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help call_handler(:update) ext = current_ext text = ext.nil? ? "" : (ext[0] + "\n" + ext[1]) @help_window.set_text(text) end end #============================================================================== # ■ Window_DebugInputNum #============================================================================== class Window_DebugInputNum < Window_HorzCommand #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :item_window attr_accessor :max attr_accessor :min attr_accessor :sign #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect, num=0) @num_max = 8 @num = [] @max = 99999999 @sign = false @pm_sign = true @min = 0 super(rect.x, rect.y) area(rect) self.num = num deactivate.hide end #-------------------------------------------------------------------------- # ● エリア変更 #-------------------------------------------------------------------------- def area(rect) @area = rect self.x = @area.x + (@area.width - window_width ) / 2 self.y = @area.y + (@area.height - window_height) / 2 self end #-------------------------------------------------------------------------- # ● 項目数変更(Windowサイズ更新) #-------------------------------------------------------------------------- def num_max=(n) return if n == @num_max or n == 0 @num_max = n self.x = @area.x + (@area.width - window_width ) / 2 self.width = window_width create_contents clac_maxmin self.num = 0 unselect end #-------------------------------------------------------------------------- # ● 数字更新 #-------------------------------------------------------------------------- def num=(n) @num.clear @pm_sign = (n >= 0) if @sign n = n.abs @num_max.times do |i| @num[@num_max-1-i] = n % 10 n = (n / 10).truncate end refresh end #-------------------------------------------------------------------------- # ● 最大値計算 #-------------------------------------------------------------------------- def clac_maxmin @max = @min = 0 @num_max.times {|i| @max += 9 * exp(i)} end #-------------------------------------------------------------------------- # ● 10のべき乗計算 #-------------------------------------------------------------------------- def exp(n) r = 1 n.times {|i| r *= 10} r end #-------------------------------------------------------------------------- # ● 数字 #-------------------------------------------------------------------------- def num r = 0 @num_max.times {|i| r += @num[@num_max-1-i] * exp(i)} r *= -1 if @sign and !@pm_sign r end #-------------------------------------------------------------------------- # ● 項目の幅を取得 #-------------------------------------------------------------------------- def item_width 15 end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width (item_width + spacing) * col_max + standard_padding * 2 end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max @sign ? (@num_max + 1) : @num_max end #-------------------------------------------------------------------------- # ● 符号除くindex #-------------------------------------------------------------------------- def s_index(index = @index) @sign ? (index-1) : index end #-------------------------------------------------------------------------- # ● 横に項目が並ぶときの空白の幅を取得 #-------------------------------------------------------------------------- def spacing 2 end #-------------------------------------------------------------------------- # ● 終端選択 #-------------------------------------------------------------------------- def select_last select(col_max - 1) self end #-------------------------------------------------------------------------- # ● カーソルを下に移動 #-------------------------------------------------------------------------- def cursor_down(wrap = false) if @sign and @index == 0 @pm_sign = !@pm_sign else @num[s_index] = (@num[s_index] + 10 - 1) % 10 end redraw_current_item Sound.play_cursor end #-------------------------------------------------------------------------- # ● カーソルを上に移動 #-------------------------------------------------------------------------- def cursor_up(wrap = false) if @sign and @index == 0 @pm_sign = !@pm_sign else @num[s_index] = (@num[s_index] + 1) % 10 end redraw_current_item Sound.play_cursor end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command(0, :sign) if @sign @num_max.times {|i| add_command(0, :num)} end #-------------------------------------------------------------------------- # ● 選択項目の有効状態を取得 #-------------------------------------------------------------------------- def current_item_enabled? n = self.num n >= @min and n <= @max end #-------------------------------------------------------------------------- # ● 背景色 1 の取得 #-------------------------------------------------------------------------- def back_color Color.new(0, 0, 0, 64) end #-------------------------------------------------------------------------- # ● 背景の描画 #-------------------------------------------------------------------------- def draw_back(rect) contents.fill_rect(rect, back_color) end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) draw_back(rect) change_color(normal_color, command_enabled?(index)) if @sign and index == 0 draw_text(rect, (@pm_sign ? " " : "-"), 2) else draw_text(rect, @num[s_index(index)], 2) end end #-------------------------------------------------------------------------- # ● アイテムウィンドウの設定 #-------------------------------------------------------------------------- def item_window=(item_window) @item_window = item_window n = item_window.nil? ? 0 : item_window.num_max s = item_window.nil? ? false : item_window.sign if @sign != s @num_max = 0 @sign = s end self.num_max = n update end end #============================================================================== # ■ Window_DebugBase #============================================================================== class Window_DebugBase < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @max_n = max_n super(rect.x, rect.y, rect.width, rect.height) refresh deactivate.hide end #-------------------------------------------------------------------------- # ● 決定やキャンセルなどのハンドリング処理 #-------------------------------------------------------------------------- def process_handling return unless open? && active return process_ok if ok_enabled? && Input.trigger?(:C) return process_cancel if cancel_enabled? && Input.trigger?(:B) return process_pagedown if handle?(:pagedown) && Input.trigger?(:R) return process_pageup if handle?(:pageup) && Input.trigger?(:L) return process_a if handle?(:a) && Input.trigger?(:A) return process_x if handle?(:x) && Input.trigger?(:X) end def process_a Sound.play_ok call_handler(:a) end def process_x Sound.play_ok call_handler(:x) end #-------------------------------------------------------------------------- # ● カーソルを右に移動 #-------------------------------------------------------------------------- def cursor_right(wrap = false) if col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?)) select((index + 1) % item_max) elsif col_max == 1 && index >= 0 if (index + 100) > (item_max - 1) select(item_max - 1) else select((index + 100) % item_max) end end end #-------------------------------------------------------------------------- # ● カーソルを左に移動 #-------------------------------------------------------------------------- def cursor_left(wrap = false) if col_max >= 2 && (index > 0 || (wrap && horizontal?)) select((index - 1 + item_max) % item_max) elsif col_max == 1 && index >= 0 if (index - 100) < 0 select(0) else select((index - 100 + item_max) % item_max) end end end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max 0 end #-------------------------------------------------------------------------- # ● 選択項目の有効状態を取得 #-------------------------------------------------------------------------- def current_item_enabled? !citem.nil? end #-------------------------------------------------------------------------- # ● IDの取得 #-------------------------------------------------------------------------- def id(i) i + 1 end def cid; id(@index); end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) nil end def citem; item(@index); end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) "" end def cname; name(@index); end #-------------------------------------------------------------------------- # ● アイテム状態の取得 #-------------------------------------------------------------------------- def status(i) item(i) end def cstatus; status(@index); end #-------------------------------------------------------------------------- # ● ステータステキスト #-------------------------------------------------------------------------- def status_text(i) status(i) ? "[ON]" : "[OFF]" end #-------------------------------------------------------------------------- # ● 名前の描画 #-------------------------------------------------------------------------- def draw_index_name(rect, index) draw_text(rect, name(index)) end #-------------------------------------------------------------------------- # ● ステータスの描画 #-------------------------------------------------------------------------- def draw_index_status(rect, index) draw_text(rect, status_text(index), 2) end #-------------------------------------------------------------------------- # ● 項目の描画 id : name #-------------------------------------------------------------------------- def draw_item_id_name(index) id_text = sprintf("%04d:", id(index)) id_width = text_size(id_text).width rect = item_rect_for_text(index) change_color(normal_color) draw_text(rect, id_text) rect.x += id_width rect.width -= id_width + 60 draw_index_name(rect, index) end #-------------------------------------------------------------------------- # ● 項目の描画 id : name [ON/OFF] #-------------------------------------------------------------------------- def draw_item_id_name_sw(index) id_text = sprintf("%04d:", id(index)) id_width = text_size(id_text).width rect = item_rect_for_text(index) change_color(normal_color) draw_text(rect, id_text) rect.x += id_width rect.width -= id_width + 60 draw_index_name(rect, index) rect.width += 60 draw_index_status(rect, index) end #-------------------------------------------------------------------------- # ● 項目の描画 id : name num #-------------------------------------------------------------------------- def draw_item_id_name_num(index) id_text = sprintf("%04d:", id(index)) id_width = text_size(id_text).width rect = item_rect_for_text(index) change_color(normal_color) draw_text(rect, id_text) rect.x += id_width rect.width -= id_width + 60 draw_index_name(rect, index) rect.width += 60 draw_text(rect, number(index), 2) end #-------------------------------------------------------------------------- # ● 数値の最大桁数取得 #-------------------------------------------------------------------------- def num_max 8 end def max_n num_max end #-------------------------------------------------------------------------- # ● 数値の符号 #-------------------------------------------------------------------------- def sign false end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n=0) end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok change redraw_current_item end #-------------------------------------------------------------------------- # ● 数値の取得/設定 #-------------------------------------------------------------------------- def number(i=@index) item(i) end def number=(n) change(n) redraw_current_item end end #============================================================================== # ■ Window_DebugBaseCommand #============================================================================== class Window_DebugBaseCommand < Window_Command #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @area = rect super(rect.x, rect.y) refresh deactivate.hide.unselect end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width @area.width end #-------------------------------------------------------------------------- # ● ウィンドウ高さの取得 #-------------------------------------------------------------------------- def window_height @area.height end #-------------------------------------------------------------------------- # ● 決定やキャンセルなどのハンドリング処理 #-------------------------------------------------------------------------- def process_handling return unless open? && active return process_ok if ok_enabled? && Input.trigger?(:C) return process_cancel if cancel_enabled? && Input.trigger?(:B) return process_pagedown if handle?(:pagedown) && Input.trigger?(:R) return process_pageup if handle?(:pageup) && Input.trigger?(:L) return process_a if handle?(:a) && Input.trigger?(:A) return process_x if handle?(:x) && Input.trigger?(:X) end def process_a Sound.play_ok call_handler(:a) end def process_x Sound.play_ok call_handler(:x) end #-------------------------------------------------------------------------- # ● カーソルを右に移動 #-------------------------------------------------------------------------- def cursor_right(wrap = false) if col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?)) select((index + 1) % item_max) elsif col_max == 1 && index >= 0 if (index + 100) > (item_max - 1) select(item_max - 1) else select((index + 100) % item_max) end end end #-------------------------------------------------------------------------- # ● カーソルを左に移動 #-------------------------------------------------------------------------- def cursor_left(wrap = false) if col_max >= 2 && (index > 0 || (wrap && horizontal?)) select((index - 1 + item_max) % item_max) elsif col_max == 1 && index >= 0 if (index - 100) < 0 select(0) else select((index - 100 + item_max) % item_max) end end end #-------------------------------------------------------------------------- # ● 数値の最大桁数取得 #-------------------------------------------------------------------------- def num_max 0 end #-------------------------------------------------------------------------- # ● 数値の符号 #-------------------------------------------------------------------------- def sign false end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok change redraw_current_item end end #============================================================================== # ■ Window_DebugBaseHorzCommand #============================================================================== class Window_DebugBaseHorzCommand < Window_HorzCommand #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @window_width = rect.width super(rect.x, rect.y) refresh deactivate.hide.unselect end #-------------------------------------------------------------------------- # ● 桁数の取得 #-------------------------------------------------------------------------- def col_max item_max end #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- def window_width @window_width end #-------------------------------------------------------------------------- # ● 数値の最大桁数取得 #-------------------------------------------------------------------------- def num_max 0 end #-------------------------------------------------------------------------- # ● 数値の符号 #-------------------------------------------------------------------------- def sign false end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok change redraw_current_item end end #============================================================================== # ■ Window_DebugSwitch #============================================================================== class Window_DebugSwitch < Window_DebugBase #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $data_system.switches.size-1 end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_switches[id(i)] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) $data_system.switches[id(i)] end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change $game_switches[cid] = !$game_switches[cid] end end #============================================================================== # ■ Window_DebugVariable #============================================================================== class Window_DebugVariable < Window_DebugBase #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $data_system.variables.size-1 end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_variables[id(i)] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) $data_system.variables[id(i)] end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_num(index) end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n) $game_variables[cid] = n end #-------------------------------------------------------------------------- # ● 数値のmaxmin値取得 #-------------------------------------------------------------------------- def min -99999999 end def max 99999999 end #-------------------------------------------------------------------------- # ● 数値の符号 #-------------------------------------------------------------------------- def sign min < 0 end #-------------------------------------------------------------------------- # ● 数値の符号 #-------------------------------------------------------------------------- def sign true end end #============================================================================== # ■ Window_DebugMapSelfSw #============================================================================== class Window_DebugMapSelfSw < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect, map_id=$game_map.map_id) @map_id = map_id @map = load_data(sprintf("Data/Map%03d.rvdata2", @map_id)) super(rect) end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max @map.events.size end #-------------------------------------------------------------------------- # ● イベントID #-------------------------------------------------------------------------- def id(i) @map.events.keys[i] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) @map.events[id(i)] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def name(i) @map.events[id(i)].name end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name(index) end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_event(@map_id, cid) end end #============================================================================== # ■ Window_DebugSelfSwitch #============================================================================== class Window_DebugSelfSwitch < Window_DebugBaseHorzCommand KEY = ["A", "B", "C", "D"] #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect, map_id=$game_map.map_id, ev_id=1) @map_id = map_id @ev_id = ev_id super(rect) end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max KEY.size end #-------------------------------------------------------------------------- # ● ハッシュキー #-------------------------------------------------------------------------- def key(i) [@map_id, @ev_id, KEY[i]] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_self_switches[key(i)] end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change k = key(@index) $game_self_switches[k] = !$game_self_switches[k] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) KEY[i] end #-------------------------------------------------------------------------- # ● コマンド名の取得 #-------------------------------------------------------------------------- def command_name(index) @list[index][:name] + (item(index) ? "[ON]" : "[OFF]") end #-------------------------------------------------------------------------- # ● コマンドの有効状態を取得 #-------------------------------------------------------------------------- def command_enabled?(index) item(index) end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list item_max.times {|i| add_command(name(i), :ok) } end #-------------------------------------------------------------------------- # ● イベントの設定 #-------------------------------------------------------------------------- def set_event(map_id, ev_id) @map_id = map_id @ev_id = ev_id refresh end end #============================================================================== # ■ Window_DebugItem #============================================================================== class Window_DebugItem < Window_DebugBase #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $data_items.size-1 end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $data_items[id(i)] end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n) d = citem n -= $game_party.item_number(d) $game_party.gain_item(d, n) end #-------------------------------------------------------------------------- # ● 名前の描画 #-------------------------------------------------------------------------- def draw_index_name(rect, index) draw_item_name(item(index), rect.x, rect.y) end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name(index) draw_item_number(item_rect_for_text(index), item(index)) end #-------------------------------------------------------------------------- # ● アイテム個数を描画 #-------------------------------------------------------------------------- def draw_item_number(rect, item) draw_text(rect, sprintf(":%#{@max_n}d", $game_party.item_number(item)), 2) end #-------------------------------------------------------------------------- # ● 数値の最大桁数取得 #-------------------------------------------------------------------------- def num_max Math.log10(max).to_i + 1 end #-------------------------------------------------------------------------- # ● 数値のmaxmin値取得 #-------------------------------------------------------------------------- def min 0 end def max $game_party.max_item_number(citem) end def max_n m = [] 0..item_max.times {|i| m.push(Math.log10($game_party.max_item_number(item(i))).to_i + 1)} m.max end #-------------------------------------------------------------------------- # ● 数値の取得/設定 #-------------------------------------------------------------------------- def number $game_party.item_number(citem) end def number=(n) change(n) redraw_current_item end end #============================================================================== # ■ Window_DebugWeapon #============================================================================== class Window_DebugWeapon < Window_DebugItem #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $data_weapons.size-1 end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $data_weapons[id(i)] end end #============================================================================== # ■ Window_DebugArmor #============================================================================== class Window_DebugArmor < Window_DebugItem #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $data_armors.size-1 end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $data_armors[id(i)] end end #============================================================================== # ■ Window_DebugParty #============================================================================== class Window_DebugParty < Window_DebugBase #-------------------------------------------------------------------------- # ● 歩行グラフィックの描画 #-------------------------------------------------------------------------- def draw_line_character(character_name, character_index, x, y, enabled=true) return unless character_name bitmap = Cache.character(character_name) sign = character_name[/^[\!\$]./] if sign && sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end y += (line_height - ch) / 2 if ch < line_height n = character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, [ch, line_height].min) contents.blt(x, y, bitmap, src_rect, enabled ? 255 : translucent_alpha) cw end #-------------------------------------------------------------------------- # ● アクターの歩行グラフィック描画 #-------------------------------------------------------------------------- def draw_actor_line_graphic(actor, x, y, enabled=true) draw_line_character(actor.character_name, actor.character_index, x, y, enabled) end #-------------------------------------------------------------------------- # ● 項目数の取得<精霊システムあり用> #-------------------------------------------------------------------------- def item_max_actors $data_actors.inject(0) {|r, a| r + (a.nil? ? 0 : (Spirits.spirit?(a.id) ? 0 : 1)) } end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max return item_max_actors if defined?(Spirits) $data_actors.size - 1 end #-------------------------------------------------------------------------- # ● アクターIDの取得<精霊システムあり用> #-------------------------------------------------------------------------- def aid(i) $data_actors.select {|a| !a.nil? and !Spirits.spirit?(a.id)}[i].id end #-------------------------------------------------------------------------- # ● アクターIDの取得 #-------------------------------------------------------------------------- def id(i) return aid(i) if defined?(Spirits) i + 1 end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_actors[id(i)] end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change if status(@index) $game_party.remove_actor(cid) else $game_party.add_actor(cid) end end #-------------------------------------------------------------------------- # ● アイテム状態の取得 #-------------------------------------------------------------------------- def status(i) $game_party.members.include?(item(i)) end def cstate; status(@index); end #-------------------------------------------------------------------------- # ● ステータステキスト #-------------------------------------------------------------------------- def status_text(index) status(index) ? "[加入]" : "[未加入]" end #-------------------------------------------------------------------------- # ● 名前の描画 #-------------------------------------------------------------------------- def draw_index_name(rect, index) draw_actor_line_graphic(item(index), rect.x, rect.y) draw_actor_name(item(index), rect.x + 34, rect.y, rect.width) end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end end #============================================================================== # ■ Window_DebugActor #============================================================================== class Window_DebugActor < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) r = rect.dup r.width = 160 super(r) end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $data_actors.size - 1 end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_actors[i+1] end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) actor = item(index) rect = item_rect_for_text(index) if defined?(Spirits) and actor.spirit? draw_spirit_name(actor, rect.x, rect.y, rect.width) else draw_actor_name(actor, rect.x, rect.y, rect.width) end end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_actor(citem) unless @index < 0 end end #============================================================================== # ■ Window_DebugActorStatus #============================================================================== class Window_DebugActorStatus < Window_DebugBaseCommand #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @actor = $game_actors[1] super(rect) end #-------------------------------------------------------------------------- # ● アクター設定 #-------------------------------------------------------------------------- def set_actor(actor) return if @actor == actor @actor = actor refresh end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command(Vocab::level, :ok, true, 2) # レベル add_command(Vocab::param(0), :ok, true, 4) # 最大HP add_command(Vocab::param(1), :ok, true, 4) # 最大MP add_command(Vocab::param(2), :ok, true, 3) # 攻撃力 add_command(Vocab::param(3), :ok, true, 3) # 防御力 add_command(Vocab::param(4), :ok, true, 3) # 魔法力 add_command(Vocab::param(5), :ok, true, 3) # 魔法防御 add_command(Vocab::param(6), :ok, true, 3) # 敏捷性 add_command(Vocab::param(7), :ok, true, 3) # 運 end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) super draw_text(item_rect_for_text(index), status_val(index), 2) end def status_val(index) return 0 if @actor.nil? case index when 0; return @actor.level else; return @actor.param(index-1) end end #-------------------------------------------------------------------------- # ● 数値の最大桁数取得 #-------------------------------------------------------------------------- def num_max current_ext end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n=0) case index when 0; @actor.change_level(n, false) else; @actor.add_param(index-1, n - status_val(index)) end end #-------------------------------------------------------------------------- # ● 数値の取得/設定 #-------------------------------------------------------------------------- def number status_val(@index) end def number=(n) change(n) if @index == 0 contents.clear draw_all_items else redraw_current_item end end end #============================================================================== # ■ Window_DebugActorSkill #============================================================================== class Window_DebugActorSkill < Window_DebugActorStatus #-------------------------------------------------------------------------- # ● アクター設定 #-------------------------------------------------------------------------- def set_actor(actor) return if @actor == actor @actor = actor refresh_enabled end #-------------------------------------------------------------------------- # ● 半透明描画用のアルファ値を取得 #-------------------------------------------------------------------------- def translucent_alpha return 80 end #-------------------------------------------------------------------------- # ● 許可状態だけ変更 #-------------------------------------------------------------------------- def refresh_enabled item_max.times do |i| next if @actor.nil? enabled = @actor.skill_learn?(item(i)) if @list[i][:enabled] != enabled @list[i][:enabled] = enabled redraw_item(i) end end end #-------------------------------------------------------------------------- # ● 選択項目の有効状態を取得 #-------------------------------------------------------------------------- def current_item_enabled? !citem.nil? end #-------------------------------------------------------------------------- # ● アイテム取得 #-------------------------------------------------------------------------- def item(i) $data_skills[i+1] end def citem; item(@index); end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list n = ($data_skills.size - 1) n.times {|i| add_command(item(i).id, :ok, @actor.skill_learn?(item(i)))} end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) enabled = command_enabled?(index) change_color(normal_color, enabled) rect = item_rect_for_text(index) draw_item_name(item(index), rect.x, rect.y, enabled, rect.width-24) end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change if command_enabled?(@index) @actor.forget_skill(citem.id) else @actor.learn_skill(citem.id) end @list[@index][:enabled] = @actor.skill_learn?(citem) end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok change redraw_current_item end end #============================================================================== # ■ Window_DebugMap #============================================================================== class Window_DebugMap < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @map = $data_mapinfos.sort {|a,b| a[1].order - b[1].order} super(rect) end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max @map.size end #-------------------------------------------------------------------------- # ● マップIDの取得 #-------------------------------------------------------------------------- def id(i) @map[i][0] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) @map[i][1] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) item(i).name end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name(index) end #-------------------------------------------------------------------------- # ● 決定ハンドラの呼び出し #-------------------------------------------------------------------------- def call_ok_handler ok super end #-------------------------------------------------------------------------- # ● 移動位置 #-------------------------------------------------------------------------- def move_point(i) pos = DebugPP::MAP[id(i)] return pos unless pos.nil? data = load_data(sprintf("Data/Map%03d.rvdata2", id(i))) [(data.width / 2).truncate, (data.height / 2).truncate] end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok pos = move_point(@index) $game_player.reserve_transfer(cid, pos[0], pos[1], $game_player.direction) $game_temp.fade_type = 1 # 白 end end #============================================================================== # ■ Window_DebugMusicCtg #============================================================================== class Window_DebugMusicCtg < Window_DebugBaseHorzCommand #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list ["BGM", "BGS", "ME", "SE"].each {|n| add_command(n, :ok) } end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_ctg(@index) end end #============================================================================== # ■ Window_DebugMusic #============================================================================== class Window_DebugMusic < Window_DebugBase BGM=0;BGS=1;ME=2;SE=3 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @ctg = BGM data_refresh super(rect) end #-------------------------------------------------------------------------- # ● データ初期化 #-------------------------------------------------------------------------- def data_refresh @list = [] 4.times do |i| @list[i] = rtp_audio(i) + audio_grep(i) end end #-------------------------------------------------------------------------- # ● データ初期化 #-------------------------------------------------------------------------- def set_ctg(ctg) return if @ctg == ctg @ctg = ctg create_contents draw_all_items self.top_row = 0 unselect end #-------------------------------------------------------------------------- # ● RTP-Audio #-------------------------------------------------------------------------- def rtp_audio(i) return [] unless DebugPP::RTP_MUSIC case i when BGM return ["Airship.ogg","Battle1.ogg","Battle2.ogg","Battle3.ogg", "Battle4.ogg","Battle5.ogg","Battle6.ogg","Battle7.ogg", "Battle8.ogg","Battle9.ogg", "Dungeon1.ogg","Dungeon2.ogg","Dungeon3.ogg","Dungeon4.ogg", "Dungeon5.ogg","Dungeon6.ogg","Dungeon7.ogg","Dungeon8.ogg", "Dungeon9.ogg", "Field1.ogg","Field2.ogg","Field3.ogg","Field4.ogg", "Scene1.ogg","Scene2.ogg","Scene3.ogg","Scene4.ogg", "Scene5.ogg","Scene6.ogg","Ship.ogg", "Theme1.ogg","Theme2.ogg","Theme3.ogg","Theme4.ogg","Theme5.ogg", "Town1.ogg","Town2.ogg","Town3.ogg","Town4.ogg","Town5.ogg", "Town6.ogg","Town7.ogg"] when BGS return ["Clock.ogg","Darkness.ogg","Drips.ogg","Fire.ogg","Quake.ogg", "Rain.ogg","River.ogg","Sea.ogg","Storm.ogg","Wind.ogg"] when ME return ["Fanfare1.ogg","Fanfare2.ogg","Fanfare3.ogg","Gag.ogg", "Gameover1.ogg","Gameover2.ogg","Inn.ogg","Item.ogg","Mystery.ogg", "Organ.ogg","Shock.ogg","Victory1.ogg","Victory2.ogg"] when SE return ["Absorb1.ogg","Absorb2.ogg","Applause1.ogg","Applause2.ogg", "Attack1.ogg","Attack2.ogg","Attack3.ogg","Autodoor.ogg", "Barrier.ogg","Battle1.ogg","Battle2.ogg","Battle3.ogg", "Bell1.ogg","Bell2.ogg","Bell3.ogg","Bite.ogg","Blind.ogg", "Blow1.ogg","Blow2.ogg","Blow3.ogg","Blow4.ogg","Blow5.ogg", "Blow6.ogg","Blow7.ogg","Blow8.ogg","Book1.ogg","Book2.ogg", "Bow1.ogg","Bow2.ogg","Bow3.ogg","Bow4.ogg","Break.ogg", "Breath.ogg","Buzzer1.ogg","Buzzer2.ogg", "Cancel1.ogg","Cancel2.ogg","Cat.ogg","Chest.ogg", "Chicken.ogg","Chime1.ogg","Chime2.ogg", "Close1.ogg","Close2.ogg","Close3.ogg","Coin.ogg", "Collapse1.ogg","Collapse2.ogg","Collapse3.ogg","Collapse4.ogg", "Confuse.ogg","Cow.ogg","Crash.ogg","Crossbow.ogg","Crow.ogg", "Cry1.ogg","Cry2.ogg","Cursor1.ogg","Cursor2.ogg", "Damage1.ogg","Damage2.ogg","Damage3.ogg","Damage4.ogg","Damage5.ogg", "Darkness1.ogg","Darkness2.ogg","Darkness3.ogg","Darkness4.ogg", "Darkness5.ogg","Darkness6.ogg","Darkness7.ogg","Darkness8.ogg", "Decision1.ogg","Decision2.ogg","Decision3.ogg", "Devil1.ogg","Devil2.ogg","Devil3.ogg","Disappointment.ogg", "Dive.ogg","Dog.ogg","Down1.ogg","Down2.ogg","Down3.ogg","Down4.ogg", "Earth1.ogg","Earth2.ogg","Earth3.ogg","Earth4.ogg","Earth5.ogg", "Earth6.ogg","Earth7.ogg","Earth8.ogg", "Earth9.ogg", "Equip1.ogg","Equip2.ogg","Equip3.ogg","Evasion1.ogg","Evasion2.ogg", "Explosion1.ogg","Explosion2.ogg","Explosion3.ogg","Explosion4.ogg", "Explosion5.ogg","Explosion6.ogg","Explosion7.ogg","Fall.ogg", "Fire1.ogg","Fire2.ogg","Fire3.ogg","Fire4.ogg","Fire5.ogg", "Fire6.ogg","Fire7.ogg","Fire8.ogg","Fire9.ogg", "Flash1.ogg","Flash2.ogg","Flash3.ogg","Fog1.ogg","Fog2.ogg", "Frog.ogg","Gun1.ogg","Gun2.ogg", "Hammer.ogg","Heal1.ogg","Heal2.ogg","Heal3.ogg","Heal4.ogg", "Heal5.ogg","Heal6.ogg","Heal7.ogg","Horse.ogg", "Ice1.ogg","Ice2.ogg","Ice3.ogg","Ice4.ogg","Ice5.ogg","Ice6.ogg", "Ice7.ogg","Ice8.ogg","Ice9.ogg","Ice10.ogg","Ice11.ogg", "Item1.ogg","Item2.ogg","Item3.ogg","Jump1.ogg","Jump2.ogg", "Key.ogg","Knock.ogg","Laser.ogg","Load.ogg", "Machine.ogg","Magic1.ogg","Magic2.ogg","Magic3.ogg", "Magic4.ogg","Magic5.ogg","Magic6.ogg","Magic7.ogg","Miss.ogg", "Monster1.ogg","Monster2.ogg","Monster3.ogg","Monster4.ogg", "Monster5.ogg","Monster6.ogg","Monster7.ogg","Move.ogg", "Noise.ogg","Open1.ogg","Open2.ogg","Open3.ogg","Open4.ogg","Open5.ogg", "Paralyze1.ogg","Paralyze2.ogg","Paralyze3.ogg","Parry.ogg", "Phone.ogg","Poison.ogg","Pollen.ogg","Powerup.ogg","Push.ogg", "Raise1.ogg","Raise2.ogg","Raise3.ogg","Recovery.ogg", "Reflection.ogg","Resonance.ogg","Run.ogg", "Saint1.ogg","Saint2.ogg","Saint3.ogg","Saint4.ogg","Saint5.ogg", "Saint6.ogg","Saint7.ogg","Saint8.ogg","Saint9.ogg","Sand.ogg", "Save.ogg","Scream.ogg","Sheep.ogg","Shop.ogg", "Shot1.ogg","Shot2.ogg","Shot3.ogg","Silence.ogg", "Skill1.ogg","Skill2.ogg","Skill3.ogg", "Slash1.ogg","Slash2.ogg","Slash3.ogg","Slash4.ogg","Slash5.ogg", "Slash6.ogg","Slash7.ogg","Slash8.ogg","Slash9.ogg", "Slash10.ogg","Slash11.ogg","Slash12.ogg","Sleep.ogg", "Sound1.ogg","Sound2.ogg","Sound3.ogg","Stare.ogg","Starlight.ogg", "Switch1.ogg","Switch2.ogg","Switch3.ogg", "Sword1.ogg","Sword2.ogg","Sword3.ogg","Sword4.ogg","Sword5.ogg", "Teleport.ogg","Thunder1.ogg","Thunder2.ogg","Thunder3.ogg", "Thunder4.ogg","Thunder5.ogg","Thunder6.ogg","Thunder7.ogg", "Thunder8.ogg","Thunder9.ogg","Thunder10.ogg", "Thunder11.ogg","Thunder12.ogg","Twine.ogg", "Up1.ogg","Up2.ogg","Up3.ogg","Up4.ogg", "Water1.ogg","Water2.ogg","Water3.ogg","Water4.ogg", "Water5.ogg","Water6.ogg", "Wind1.ogg","Wind2.ogg","Wind3.ogg","Wind4.ogg","Wind5.ogg", "Wind6.ogg","Wind7.ogg","Wind8.ogg","Wind9.ogg","Wind10.ogg", "Wind11.ogg","Wolf.ogg"] end return [] end #-------------------------------------------------------------------------- # ● Audioフォルダのパス #-------------------------------------------------------------------------- def path(i) case i when BGM; return "Audio/BGM/" when BGS; return "Audio/BGS/" when ME; return "Audio/ME/" when SE; return "Audio/SE/" end end def filter(i) case i when BGM; return "*.{ogg,wma,mp3,wav,mid}" when BGS; return "*.{ogg,wma,mp3,wav}" when ME; return "*.{ogg,wma,mp3,wav,mid}" when SE; return "*.{ogg,wma,mp3,wav}" end end #-------------------------------------------------------------------------- # ● AudioフォルダのGrep #-------------------------------------------------------------------------- def audio_grep(i) list = Dir.glob(path(i)+filter(i)) file_list = [] list.select {|l| !FileTest.directory?(l)}.collect {|l| File.basename(l)} end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max @list[@ctg].size end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) @list[@ctg][i] end def citem; item(@index); end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_text(item_rect_for_text(index), item(index)) end #-------------------------------------------------------------------------- # ● 決定やキャンセルなどのハンドリング処理 #-------------------------------------------------------------------------- def process_handling return unless open? && active super return stop if Input.trigger?(:Y) return replay if Input.trigger?(:X) end #-------------------------------------------------------------------------- # ● 決定ボタンが押されたときの処理 #-------------------------------------------------------------------------- def process_ok if current_item_enabled? #~ Sound.play_ok # Musicでは鳴らさない Input.update deactivate call_ok_handler else Sound.play_buzzer end end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok return if citem.nil? pth = path(@ctg)+citem case @ctg when BGM; Audio.bgm_play(pth) when BGS; Audio.bgs_play(pth) when ME; Audio.me_play(pth) when SE; Audio.se_play(pth) end end def stop(i=@ctg) case i when BGM; Audio.bgm_stop when BGS; Audio.bgs_stop when ME; Audio.me_stop when SE; Audio.se_stop end end def replay RPG::BGM.last.replay RPG::BGS.last.replay end end #============================================================================== # ■ Window_DebugSystem #============================================================================== class Window_DebugSystem < Window_DebugBaseCommand #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_main_commands add_original_commands end #-------------------------------------------------------------------------- # ● 主要コマンドをリストに追加 #-------------------------------------------------------------------------- def add_main_commands add_command("お金", :input) add_command("セーブ回数", :input) add_command("戦闘回数", :input) add_command("セーブ禁止", :ok) add_command("メニュー禁止", :ok) add_command("エンカウント禁止", :ok) add_command("並び替え禁止", :ok) add_command("天候(type)", :input) add_command("天候(power)", :input) add_command("全アイテム入手", :ok) add_command("解像度", :ok) end #-------------------------------------------------------------------------- # ● 独自コマンドの追加用 #-------------------------------------------------------------------------- def add_original_commands add_command("用語辞典初期化", :ok, true, :dictionary) if defined?(Dictionary) add_command("ワールドマップ初期化", :ok, true, :worldmap) if defined?(WorldMap) add_command("クエストランク", :input, true, :quest_rank) if defined?(Quest) add_command("クエスト初期化", :ok, true, :quest) if defined?(Quest) add_command("フィールドマップ初期化", :ok, true, :fieldmap) if defined?(FieldMap) end #-------------------------------------------------------------------------- # ● 数取得 #-------------------------------------------------------------------------- def item(index) case index when 0; return $game_party.gold when 1; return $game_system.save_count when 2; return $game_system.battle_count when 3; return $game_system.save_disabled when 4; return $game_system.menu_disabled when 5; return $game_system.encounter_disabled when 6; return $game_system.formation_disabled else case @list[index][:ext] when :quest_rank; return $game_party.quest_rank end end return 0 end #-------------------------------------------------------------------------- # ● テキスト #-------------------------------------------------------------------------- def text(index) case index when 0,1,2; return item(index) when 3,4,5,6; return item(index) ? "[禁止]" : "[許可]" when 7; case $game_map.screen.weather_type when :none; return "[晴]" when :rain; return "[雨]" when :storm; return "[嵐]" when :snow; return "[雪]" else; return "[?]" end when 8; return $game_map.screen.weather_power.to_s when 10; return Graphics.width == 640 ? "640×480" : "544×416" else case @list[index][:ext] when :quest_rank; return Quest::RANK[item(index)] + "(#{item(index)})" end end return "" end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) super(index) draw_text(item_rect_for_text(index), text(index), 2) end #-------------------------------------------------------------------------- # ● 数値の最大桁数取得 #-------------------------------------------------------------------------- def num_max Math.log10(max).to_i + 1 end #-------------------------------------------------------------------------- # ● 数値の符号 #-------------------------------------------------------------------------- def sign false end #-------------------------------------------------------------------------- # ● 数値のmaxmin値取得 #-------------------------------------------------------------------------- def min case @index when 8; return 0 else case @list[@index][:ext] when :quest_rank; return 1 end end 0 end def max case @index when 0; return $game_party.max_gold when 7; return 3 when 8; return 9 else case @list[@index][:ext] when :quest_rank; return 10 end end 99999999 end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n=0) case @index when 0; $game_party.gain_gold(n - $game_party.gold) when 1; $game_system.save_count = n when 2; $game_system.battle_count = n when 3; $game_system.save_disabled = n when 4; $game_system.menu_disabled = n when 5; $game_system.encounter_disabled = n when 6; $game_system.formation_disabled = n when 7; type = [:none, :rain, :storm, :snow][n] $game_map.screen.change_weather(type, $game_map.screen.weather_power, 0) when 8; $game_map.screen.change_weather($game_map.screen.weather_type, n, 0) when 9; all_item when 10;resize_screen else case @list[@index][:ext] when :dictionary; $game_system.dictionary.reset when :worldmap; $game_system.worldmap.reset when :quest_rank; $game_party.quest_rank = n when :quest; $game_system.quest.reset when :fieldmap; $game_system.init_fieldmap end end end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok change(!number) redraw_current_item end #-------------------------------------------------------------------------- # ● 数値の取得/設定 #-------------------------------------------------------------------------- def number item(@index) end def number=(n) change(n) redraw_current_item end #-------------------------------------------------------------------------- # ● OK時の処理 : all item #-------------------------------------------------------------------------- def all_item n = $data_items.size - 1 n.times {|i| $game_party.gain_item($data_items[i+1], 1)} n = $data_weapons.size - 1 n.times {|i| $game_party.gain_item($data_weapons[i+1], 1)} n = $data_armors.size - 1 n.times {|i| $game_party.gain_item($data_armors[i+1], 1)} end #-------------------------------------------------------------------------- # ● OK時の処理 : win_resize #-------------------------------------------------------------------------- def resize_screen if Graphics.width == 640 Graphics.resize_screen(544, 416) else Graphics.resize_screen(640, 480) end call_handler(:exit) end end #============================================================================== # ■ Window_DebugActorExpert #============================================================================== class Window_DebugActorExpert < Window_DebugActorStatus #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list SysUpdate::ELEMENTS.each {|e| add_command(e, :ok, true, 2)} end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) element_id = command_name(index) rect = item_rect_for_text(index) draw_attr_icon_pm(@actor, element_id, rect.x, rect.y) rect.x += 26 rect.width -= 26 draw_text(rect, SysUpdate.attr_name(element_id)) attr = @actor.attr[element_id] draw_text(rect, attr.lv_limit, 2) rect.width -= 30 draw_text(rect, "/", 2) rect.width -= 20 draw_text(rect, attr.level, 2) end #-------------------------------------------------------------------------- # ● 数値の最大桁数取得 #-------------------------------------------------------------------------- def num_max 2 end #-------------------------------------------------------------------------- # ● 数値の最大値取得 #-------------------------------------------------------------------------- def min 1 end def max @actor.attr[command_name(@index)].lv_limit end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n) @actor.attr[command_name(@index)].level = n end #-------------------------------------------------------------------------- # ● 数値の取得/設定 #-------------------------------------------------------------------------- def number @actor.attr[command_name(@index)].level end def number=(n) change(n) redraw_current_item end #-------------------------------------------------------------------------- # ● 得意状態変更 #-------------------------------------------------------------------------- def change_taste attr = @actor.attr[command_name(@index)] attr.taste = (attr.taste + 1) % 3 redraw_current_item end end #============================================================================== # ■ Window_DebugDictCtg #============================================================================== class Window_DebugDictCtg < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) r = rect.dup r.width = 120 super(r) end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $game_system.dictionary.size end #-------------------------------------------------------------------------- # ● 用語カテゴリIDの取得 #-------------------------------------------------------------------------- def id(i) $game_system.dictionary.keys[i] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_system.dictionary[id(i)] end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_text(item_rect_for_text(index), item(index).name) end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_ctg(cid) end end #============================================================================== # ■ Window_DebugDictionary #============================================================================== class Window_DebugDictionary < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @ctg = $game_system.dictionary.keys[0] super end #-------------------------------------------------------------------------- # ● カテゴリ設定 #-------------------------------------------------------------------------- def set_ctg(ctg) return if @ctg == ctg @ctg = ctg create_contents refresh self.top_row = 0 unselect end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $game_system.dictionary[@ctg].size end #-------------------------------------------------------------------------- # ● 用語IDの取得 #-------------------------------------------------------------------------- def id(i) $game_system.dictionary[@ctg].keys[i] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_system.dictionary[@ctg][id(i)] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) item(i).name.split(/\\n/)[0] end #-------------------------------------------------------------------------- # ● アイテム状態の取得 #-------------------------------------------------------------------------- def status(i) item(i).show_flg end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n=0) $game_system.dictionary[@ctg][cid].show_flg = !citem.show_flg end end #============================================================================== # ■ Window_DebugWorldRegion #============================================================================== class Window_DebugWorldRegion < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) r = rect.dup r.height /= 2 super(r) end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max WorldMap::REGION.size end #-------------------------------------------------------------------------- # ● 用語カテゴリIDの取得 #-------------------------------------------------------------------------- def id(i) $game_system.worldmap.ids[i] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_system.worldmap[id(i)] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) item(i).region_name end #-------------------------------------------------------------------------- # ● アイテム状態の取得 #-------------------------------------------------------------------------- def status(i) item(i).visible end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_ctg(cid) unless @index < 0 end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n=0) $game_system.worldmap[cid].visible = !cstatus end end #============================================================================== # ■ Window_DebugWorldTown #============================================================================== class Window_DebugWorldTown < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @ctg = $game_system.worldmap.ids[0] super(rect) end #-------------------------------------------------------------------------- # ● カテゴリ設定 #-------------------------------------------------------------------------- def set_ctg(ctg) return if @ctg == ctg @ctg = ctg create_contents refresh self.top_row = 0 unselect end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max $game_system.worldmap[@ctg].ids.size end #-------------------------------------------------------------------------- # ● タウンIDの取得 #-------------------------------------------------------------------------- def id(i) $game_system.worldmap[@ctg].ids[i] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_system.worldmap[@ctg][id(i)] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) item(i).town_name end #-------------------------------------------------------------------------- # ● アイテム状態の取得 #-------------------------------------------------------------------------- def status(i) item(i).visible end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n=0) $game_system.worldmap[@ctg][cid].visible = !cstatus end end #============================================================================== # ■ Window_DebugQuestCtg #============================================================================== class Window_DebugQuestCtg < Window_DebugBaseHorzCommand #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list ["イベントクエスト", "ギルドクエスト"].each {|n| add_command(n, :ok) } end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_ctg(@index) end end #============================================================================== # ■ Window_DebugQuest #============================================================================== class Window_DebugQuest < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @ctg = 0 data_refresh super(rect) end #-------------------------------------------------------------------------- # ● カテゴリデータ集計 #-------------------------------------------------------------------------- def data_refresh @commands = [] $game_system.quest.ids.each do |id| data = $game_system.quest[id] case @ctg when 0; @commands.push(data) if !data.enable when 1; @commands.push(data) if data.enable end end end #-------------------------------------------------------------------------- # ● カテゴリ設定 #-------------------------------------------------------------------------- def set_ctg(ctg) return if @ctg == ctg @ctg = ctg data_refresh create_contents refresh self.top_row = 0 unselect end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max @commands.size end #-------------------------------------------------------------------------- # ● クエストIDの取得 #-------------------------------------------------------------------------- def id(i) @commands[i].id end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) @commands[i] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) Quest.conv_text(item(i).name) end #-------------------------------------------------------------------------- # ● ステータステキスト #-------------------------------------------------------------------------- def status_text(index) quest = item(index) quest.playing ? "[進行中(開始)]" : quest.clear ? "[クリア済み]" : quest.fail ? "[失敗]": "[未開始]" end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_id(cid) end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok redraw_current_item @help_window.refresh end end #============================================================================== # ■ Window_DebugQuestStatus #============================================================================== class Window_DebugQuestStatus < Window_DebugBaseHorzCommand #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @id = nil super(rect) end #-------------------------------------------------------------------------- # ● クエストID設定 #-------------------------------------------------------------------------- def set_id(id) return if @id == id @id = id return contents.clear if id.nil? refresh end #-------------------------------------------------------------------------- # ● コマンド名の取得 #-------------------------------------------------------------------------- def command_name(index) super + (command_enabled?(index) ? "[ON]" : "[OFF]") end #-------------------------------------------------------------------------- # ● コマンドの有効状態を取得 #-------------------------------------------------------------------------- def command_enabled?(index) return false if @id.nil? case index when 0; return $game_system.quest[@id].visible when 1; return $game_system.quest[@id].view_res when 2; return $game_system.quest[@id].view_cond end end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command("一覧", :ok) add_command("報酬", :ok) add_command("進捗", :ok) end end #============================================================================== # ■ Window_DebugQuestCmd #============================================================================== class Window_DebugQuestCmd < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @commands = [ "進捗中(開始)", "クリア済み", "失敗", "表示切替", "報酬表示切替", "進捗表示切替", "リセット" ] rect.width = 160 rect.x = Graphics.width - rect.width super(rect) end #-------------------------------------------------------------------------- # ● ウィンドウの表示 #-------------------------------------------------------------------------- def show #~ self.visible = true self end #-------------------------------------------------------------------------- # ● ウィンドウの非表示 #-------------------------------------------------------------------------- def hide #~ self.visible = false self end #-------------------------------------------------------------------------- # ● ウィンドウのアクティブ化 #-------------------------------------------------------------------------- def activate self.visible = true self.active = true self end #-------------------------------------------------------------------------- # ● ウィンドウの非アクティブ化 #-------------------------------------------------------------------------- def deactivate self.visible = false self.active = false self end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max @commands.size end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) @commands[i] end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_text(item_rect_for_text(index), item(index)) end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help # 何もしない end #-------------------------------------------------------------------------- # ● OK時の処理 #-------------------------------------------------------------------------- def ok case @index when 0; @help_window.citem.quest_start when 1; @help_window.citem.quest_clear(true, false) # 強制 when 2; @help_window.citem.quest_fail(true, false) # 強制 when 3; @help_window.citem.visible = !@help_window.citem.visible when 4; @help_window.citem.view_res = !@help_window.citem.view_res when 5; @help_window.citem.view_cond = !@help_window.citem.view_cond when 6; @help_window.citem.reset end hide @help_window.activate.ok end end #============================================================================== # ■ Window_DebugSpirit #============================================================================== class Window_DebugSpirit < Window_DebugBase #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max Spirits::SPIRIT_ACTOR.size end #-------------------------------------------------------------------------- # ● 精霊IDの取得 #-------------------------------------------------------------------------- def id(i) Spirits::SPIRIT_ACTOR.keys[i] end #-------------------------------------------------------------------------- # ● アクターIDの取得 #-------------------------------------------------------------------------- def aid(i) Spirits.actor_id(id(i)) end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_actors[aid(i)] end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change if status(@index) $game_party.remove_spirit(cid) else $game_party.add_spirit(cid) end end #-------------------------------------------------------------------------- # ● アイテム状態の取得 #-------------------------------------------------------------------------- def status(i) $game_party.include_spirit?(id(i)) end #-------------------------------------------------------------------------- # ● ステータステキスト #-------------------------------------------------------------------------- def status_text(i) status(i) ? "[加入]" : "[未加入]" end #-------------------------------------------------------------------------- # ● 名前の描画 #-------------------------------------------------------------------------- def draw_index_name(rect, index) draw_actor_line_graphic(item(index), rect.x, rect.y) draw_spirit_name(item(index), rect.x + 34, rect.y) end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end end #============================================================================== # ■ Window_DebugFieldMaps #============================================================================== class Window_DebugFieldMaps < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) r = rect.dup r.height = line_height * 2 + standard_padding * 2 super(r) end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max FieldMap::RT.keys.size end #-------------------------------------------------------------------------- # ● マップIDの取得 #-------------------------------------------------------------------------- def id(i) FieldMap::RT.keys[i] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) true end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) load_data(sprintf("Data/Map%03d.rvdata2", id(i))).display_name end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name(index) end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの更新 #-------------------------------------------------------------------------- def update_help @help_window.set_ctg(cid) unless @index < 0 end end #============================================================================== # ■ Window_DebugFieldMapRoute #============================================================================== class Window_DebugFieldMapRoute < Window_DebugBase #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(rect) @ctg = FieldMap::RT.keys[0] super(rect) end #-------------------------------------------------------------------------- # ● カテゴリ設定 #-------------------------------------------------------------------------- def set_ctg(ctg) return if @ctg == ctg @ctg = ctg create_contents refresh self.top_row = 0 unselect end #-------------------------------------------------------------------------- # ● 項目数の取得 #-------------------------------------------------------------------------- def item_max FieldMap::RT[@ctg].keys.size end #-------------------------------------------------------------------------- # ● ルートIDの取得 #-------------------------------------------------------------------------- def id(i) FieldMap::RT[@ctg].keys[i] end #-------------------------------------------------------------------------- # ● アイテムの取得 #-------------------------------------------------------------------------- def item(i) $game_system.field[@ctg].route[id(i)] end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def map_name(ev_id) if FieldMap.tr_include?(@ctg, ev_id) return "中継地点[#{ev_id}]" elsif FieldMap.ev_include?(@ctg, ev_id) map_id = $game_system.field[@ctg].place[ev_id].target_map_id return load_data(sprintf("Data/Map%03d.rvdata2", map_id)).display_name else return "nil[#{ev_id}]" end end #-------------------------------------------------------------------------- # ● アイテム名の取得 #-------------------------------------------------------------------------- def name(i) from_ev_id = $game_system.field[@ctg].route[id(i)].from_ev_id to_ev_id = $game_system.field[@ctg].route[id(i)].to_ev_id return map_name(from_ev_id) + " → " + map_name(to_ev_id) end #-------------------------------------------------------------------------- # ● アイテム状態の取得 #-------------------------------------------------------------------------- def status(i) item(i).enable? end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) draw_item_id_name_sw(index) end #-------------------------------------------------------------------------- # ● アイテムの変更 #-------------------------------------------------------------------------- def change(n=0) cstatus ? citem.disable : citem.enable end end #============================================================================== # ■ Scene_Debug #------------------------------------------------------------------------------ #  デバッグ画面の処理を行うクラスです。 #============================================================================== class Scene_Debug < Scene_MenuBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super init_sub_windows create_help_window create_cmd_window create_number_window create_main_windows create_original_windows create_system_window if DebugPP.spec("システム") @sub[@cmd_window.index].each {|w| w.show} end #-------------------------------------------------------------------------- # ● 主要コマンド用ウィンドウを生成 #-------------------------------------------------------------------------- def create_main_windows create_switch_window if DebugPP.spec("スイッチ") create_variable_window if DebugPP.spec("変数") create_selfsw_window if DebugPP.spec("セルフSW") create_item_window if DebugPP.spec("アイテム") create_weapon_window if DebugPP.spec("武器") create_armor_window if DebugPP.spec("防具") create_party_window if DebugPP.spec("パーティー") create_actor_window if DebugPP.spec("ステータス") create_skill_window if DebugPP.spec("スキル") create_map_window if DebugPP.spec("MAP移動") create_music_window if DebugPP.spec("ミュージック") end #-------------------------------------------------------------------------- # ● オリジナルコマンド用ウィンドウを生成 #-------------------------------------------------------------------------- def create_original_windows create_expert_window if defined?(SysUpdate) and DebugPP.spec("熟練度") create_dict_window if defined?(Dictionary) and DebugPP.spec("用語辞典") create_worldmap_window if defined?(WorldMap) and DebugPP.spec("WorldMap") create_quest_window if defined?(Quest) and DebugPP.spec("クエスト") create_spirit_window if defined?(Spirits) and DebugPP.spec("精霊") create_fieldmap_window if defined?(FieldMap) and DebugPP.spec("FieldMap") end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super #$game_map.refresh end #-------------------------------------------------------------------------- # ● 子Window情報の初期化 #-------------------------------------------------------------------------- def init_sub_windows @sub = [] @sub_i = 0 end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new @help_window.y = Graphics.height - @help_window.height end #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_cmd_window @cmd_window = Window_DebugCommand.new(@help_window.y) @cmd_window.set_handler(:ok, method(:enable_sub_window)) @cmd_window.set_handler(:cancel, method(:return_scene)) @cmd_window.set_handler(:update, method(:change_sub_window)) @cmd_window.help_window = @help_window end #-------------------------------------------------------------------------- # ● コマンド・ヘルプ以外のエリア #-------------------------------------------------------------------------- def area Rect.new(@cmd_window.width, 0, Graphics.width - @cmd_window.width, @help_window.y) end #-------------------------------------------------------------------------- # ● 子Window参照 #-------------------------------------------------------------------------- def sub @sub[@cmd_window.index][@sub_i] end #-------------------------------------------------------------------------- # ● 子Window領域 #-------------------------------------------------------------------------- def sub_area w = sub Rect.new(w.x, w.y, w.width, w.height) end #-------------------------------------------------------------------------- # ● 子Window差し替え #-------------------------------------------------------------------------- def change_sub_window @sub.size.times do |i| i == @cmd_window.index ? @sub[i].each {|w| w.show} : @sub[i].each {|w| w.hide} end end #-------------------------------------------------------------------------- # ● 子Window有効化 #-------------------------------------------------------------------------- def enable_sub_window sub.activate.select(0) @num_window.item_window = sub end #-------------------------------------------------------------------------- # ● 子Window無効化(all) #-------------------------------------------------------------------------- def disable_sub_window @sub[@cmd_window.index].each {|w| w.deactivate.unselect} @num_window.item_window = nil end #-------------------------------------------------------------------------- # ● 子WindowのOK処理 #-------------------------------------------------------------------------- def ok_sub_window sub.activate.ok end #-------------------------------------------------------------------------- # ● 子WindowのOK処理(前の子Windowへ) #-------------------------------------------------------------------------- def ok_prev_sub_window sub.ok prev_sub_window end #-------------------------------------------------------------------------- # ● 子WindowのOK処理(次の子Windowへ) #-------------------------------------------------------------------------- def next_sub_window sub.deactivate @sub_i += 1 sub.activate sub.select(0) if sub.index < 0 end #-------------------------------------------------------------------------- # ● 子WindowのOK処理(前の子Windowへ) #-------------------------------------------------------------------------- def prev_sub_window sub.deactivate @sub_i -= 1 sub.activate sub.select(0) if sub.index < 0 end #-------------------------------------------------------------------------- # ● 子WindowのCancel処理 #-------------------------------------------------------------------------- def cancel_sub_window disable_sub_window @cmd_window.activate end #-------------------------------------------------------------------------- # ● 数値ウィンドウの作成 #-------------------------------------------------------------------------- def create_number_window @num_window = Window_DebugInputNum.new(area) @num_window.z = 1000 @num_window.set_handler(:ok, method(:ok_num_window)) @num_window.set_handler(:cancel, method(:cancel_num_window)) end #-------------------------------------------------------------------------- # ● 数値Windowの有効化 #-------------------------------------------------------------------------- def enable_num_window @num_window.show.activate.select_last.num = sub.number end #-------------------------------------------------------------------------- # ● 数値Windowの有効化 #-------------------------------------------------------------------------- def enable_num_window_resize @num_window.show.activate.area(sub_area).sign = sub.sign @num_window.show.activate.area(sub_area).num_max = sub.num_max @num_window.select_last.num = sub.number end #-------------------------------------------------------------------------- # ● 数値Windowの有効化 #-------------------------------------------------------------------------- def enable_num_window_resize_maxmin @num_window.show.activate.area(sub_area).sign = sub.sign @num_window.show.activate.area(sub_area).num_max = sub.num_max @num_window.select_last.max = sub.max @num_window.select_last.min = sub.min @num_window.select_last.num = sub.number end #-------------------------------------------------------------------------- # ● 数値Window無効化 #-------------------------------------------------------------------------- def disable_num_window @num_window.hide.deactivate.area(area) end #-------------------------------------------------------------------------- # ● 数値WindowのOK処理 #-------------------------------------------------------------------------- def ok_num_window sub.number = @num_window.num sub.activate disable_num_window end #-------------------------------------------------------------------------- # ● 数値WindowのCancel処理 #-------------------------------------------------------------------------- def cancel_num_window disable_num_window sub.activate end #-------------------------------------------------------------------------- # ● スイッチWindow作成 #-------------------------------------------------------------------------- def create_switch_window @switch_window = Window_DebugSwitch.new(area) @switch_window.set_handler(:ok, method(:ok_sub_window)) @switch_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@switch_window]) end #-------------------------------------------------------------------------- # ● 変数Window作成 #-------------------------------------------------------------------------- def create_variable_window @variable_window = Window_DebugVariable.new(area) @variable_window.set_handler(:ok, method(:enable_num_window_resize_maxmin)) @variable_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@variable_window]) end #-------------------------------------------------------------------------- # ● セルフスイッチWindow作成 #-------------------------------------------------------------------------- def create_selfsw_window rect = area @selfsw_window = Window_DebugSelfSwitch.new(rect) rect.height = rect.height - @selfsw_window.height @selfsw_window.y = rect.height @selfsw_window.set_handler(:ok, method(:ok_sub_window)) @selfsw_window.set_handler(:cancel, method(:prev_sub_window)) @ss_map_window = Window_DebugMapSelfSw.new(rect) @ss_map_window.set_handler(:ok, method(:next_sub_window)) @ss_map_window.set_handler(:cancel, method(:cancel_sub_window)) @ss_map_window.help_window = @selfsw_window @sub.push([@ss_map_window, @selfsw_window]) end #-------------------------------------------------------------------------- # ● アイテムWindow作成 #-------------------------------------------------------------------------- def create_item_window @item_window = Window_DebugItem.new(area) @item_window.set_handler(:ok, method(:enable_num_window_resize_maxmin)) @item_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@item_window]) end #-------------------------------------------------------------------------- # ● 武器Window作成 #-------------------------------------------------------------------------- def create_weapon_window @weapon_window = Window_DebugWeapon.new(area) @weapon_window.set_handler(:ok, method(:enable_num_window_resize_maxmin)) @weapon_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@weapon_window]) end #-------------------------------------------------------------------------- # ● 防具Window作成 #-------------------------------------------------------------------------- def create_armor_window @armor_window = Window_DebugArmor.new(area) @armor_window.set_handler(:ok, method(:enable_num_window_resize_maxmin)) @armor_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@armor_window]) end #-------------------------------------------------------------------------- # ● パーティーWindow作成 #-------------------------------------------------------------------------- def create_party_window @party_window = Window_DebugParty.new(area) @party_window.set_handler(:ok, method(:ok_sub_window)) @party_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@party_window]) end #-------------------------------------------------------------------------- # ● アクターステータスWindow作成 #-------------------------------------------------------------------------- def create_actor_window rect = area @actor_window = Window_DebugActor.new(rect) @actor_window.set_handler(:ok, method(:next_sub_window)) @actor_window.set_handler(:cancel, method(:cancel_sub_window)) rect.x += @actor_window.width rect.width -= @actor_window.width @actor_st_window = Window_DebugActorStatus.new(rect) @actor_st_window.set_handler(:ok, method(:enable_num_window_resize)) @actor_st_window.set_handler(:cancel, method(:prev_sub_window)) @actor_window.help_window = @actor_st_window @sub.push([@actor_window, @actor_st_window]) end #-------------------------------------------------------------------------- # ● スキルWindow作成 #-------------------------------------------------------------------------- def create_skill_window rect = area @skill_window = Window_DebugActor.new(rect) @skill_window.set_handler(:ok, method(:next_sub_window)) @skill_window.set_handler(:cancel, method(:cancel_sub_window)) rect.x += @skill_window.width rect.width -= @skill_window.width @skills_window = Window_DebugActorSkill.new(rect) @skills_window.set_handler(:ok, method(:ok_sub_window)) @skills_window.set_handler(:cancel, method(:prev_sub_window)) @skill_window.help_window = @skills_window @sub.push([@skill_window, @skills_window]) end #-------------------------------------------------------------------------- # ● MapWindow作成 #-------------------------------------------------------------------------- def create_map_window @map_window = Window_DebugMap.new(area) @map_window.set_handler(:ok, method(:return_scene)) @map_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@map_window]) end #-------------------------------------------------------------------------- # ● ミュージックWindow作成 #-------------------------------------------------------------------------- def create_music_window rect = area @music_ctg_window = Window_DebugMusicCtg.new(rect) rect.y += @music_ctg_window.height rect.height -= @music_ctg_window.height @music_ctg_window.set_handler(:ok, method(:next_sub_window)) @music_ctg_window.set_handler(:cancel, method(:cancel_sub_window)) @mugic_window = Window_DebugMusic.new(rect) @mugic_window.set_handler(:ok, method(:ok_sub_window)) @mugic_window.set_handler(:cancel, method(:prev_sub_window)) @music_ctg_window.help_window = @mugic_window @sub.push([@music_ctg_window, @mugic_window]) end #-------------------------------------------------------------------------- # ● システムWindow作成 #-------------------------------------------------------------------------- def create_system_window @system_window = Window_DebugSystem.new(area) @system_window.set_handler(:ok, method(:ok_sub_window)) @system_window.set_handler(:input, method(:enable_num_window_resize_maxmin)) @system_window.set_handler(:cancel, method(:cancel_sub_window)) @system_window.set_handler(:exit, method(:return_scene)) @sub.push([@system_window]) end #-------------------------------------------------------------------------- # ● 熟練度Window作成 #-------------------------------------------------------------------------- def create_expert_window rect = area @exp_act_window = Window_DebugActor.new(rect) @exp_act_window.set_handler(:ok, method(:next_sub_window)) @exp_act_window.set_handler(:cancel, method(:cancel_sub_window)) rect.x += @exp_act_window.width rect.width -= @exp_act_window.width @expert_window = Window_DebugActorExpert.new(rect) @expert_window.set_handler(:ok, method(:enable_num_window_resize_maxmin)) @expert_window.set_handler(:cancel, method(:prev_sub_window)) @expert_window.set_handler(:x, method(:change_taste)) @exp_act_window.help_window = @expert_window @sub.push([@exp_act_window, @expert_window]) end def change_taste sub.change_taste end #-------------------------------------------------------------------------- # ● 用語辞典Window作成 #-------------------------------------------------------------------------- def create_dict_window rect = area @dict_ctg_window = Window_DebugDictCtg.new(rect) @dict_ctg_window.set_handler(:ok, method(:next_sub_window)) @dict_ctg_window.set_handler(:cancel, method(:cancel_sub_window)) rect.x += @dict_ctg_window.width rect.width -= @dict_ctg_window.width @dictionary_window = Window_DebugDictionary.new(rect) @dictionary_window.set_handler(:ok, method(:ok_sub_window)) @dictionary_window.set_handler(:cancel, method(:prev_sub_window)) @dict_ctg_window.help_window = @dictionary_window @sub.push([@dict_ctg_window, @dictionary_window]) end #-------------------------------------------------------------------------- # ● ワールドマップWindow作成 #-------------------------------------------------------------------------- def create_worldmap_window rect = area @wd_region_window = Window_DebugWorldRegion.new(rect) @wd_region_window.set_handler(:ok, method(:next_sub_window)) @wd_region_window.set_handler(:cancel, method(:cancel_sub_window)) @wd_region_window.set_handler(:x, method(:ok_sub_window)) rect.y += @wd_region_window.height rect.height -= @wd_region_window.height @wd_town_window = Window_DebugWorldTown.new(rect) @wd_town_window.set_handler(:ok, method(:ok_sub_window)) @wd_town_window.set_handler(:cancel, method(:prev_sub_window)) @wd_region_window.help_window = @wd_town_window @sub.push([@wd_region_window, @wd_town_window]) end #-------------------------------------------------------------------------- # ● クエストWindow作成 #-------------------------------------------------------------------------- def create_quest_window rect = area @qt_ctg_window = Window_DebugQuestCtg.new(rect) @qt_ctg_window.set_handler(:ok, method(:next_sub_window)) @qt_ctg_window.set_handler(:cancel, method(:cancel_sub_window)) rect.y += @qt_ctg_window.height rect.height -= @qt_ctg_window.height @qt_st_window = Window_DebugQuestStatus.new(rect) @qt_st_window.y = rect.y + rect.height - @qt_st_window.height rect.height -= @qt_st_window.height @quest_window = Window_DebugQuest.new(rect) @quest_window.set_handler(:ok, method(:next_sub_window)) @quest_window.set_handler(:cancel, method(:prev_sub_window)) @qt_cmd_window = Window_DebugQuestCmd.new(rect) @qt_cmd_window.set_handler(:ok, method(:ok_prev_sub_window)) @qt_cmd_window.set_handler(:cancel, method(:prev_sub_window)) @qt_ctg_window.help_window = @quest_window @quest_window.help_window = @qt_st_window @qt_cmd_window.help_window = @quest_window @sub.push([@qt_ctg_window, @quest_window, @qt_cmd_window, @qt_st_window]) end #-------------------------------------------------------------------------- # ● 精霊Window作成 #-------------------------------------------------------------------------- def create_spirit_window @spirit_window = Window_DebugSpirit.new(area) @spirit_window.set_handler(:ok, method(:ok_sub_window)) @spirit_window.set_handler(:cancel, method(:cancel_sub_window)) @sub.push([@spirit_window]) end #-------------------------------------------------------------------------- # ● フィールドマップWindow作成 #-------------------------------------------------------------------------- def create_fieldmap_window rect = area @fieldmaps_window = Window_DebugFieldMaps.new(rect) @fieldmaps_window.set_handler(:ok, method(:next_sub_window)) @fieldmaps_window.set_handler(:cancel, method(:cancel_sub_window)) rect.y += @fieldmaps_window.height rect.height -= @fieldmaps_window.height @fieldmap_rt_window = Window_DebugFieldMapRoute.new(rect) @fieldmap_rt_window.set_handler(:ok, method(:ok_sub_window)) @fieldmap_rt_window.set_handler(:cancel, method(:prev_sub_window)) @fieldmaps_window.help_window = @fieldmap_rt_window @sub.push([@fieldmaps_window, @fieldmap_rt_window]) end end