查看: 3385|回复: 3

[已经解决] 请问VA中有超级DEBUG脚本么?

[复制链接]
梦石
0
星屑
82
在线时间
26 小时
注册时间
2010-12-3
回帖
13
发表于 2015-5-18 02:54:07 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
{:2_264:}
请问VA VX 中 有类似
https://rpg.blue/forum.php?mod=viewthread&tid=371014
的超级DEBUG脚本么?
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-5-18 10:17:27 | 显示全部楼层
本帖最后由 tseyik 于 2015-5-18 16:28 编辑

有.
d6993524d56a060e7a3fde105d270b8e.png
焼きノリ1
  1. =begin
  2. #==============================================================================
  3. [名前]    YakiNoriBaseScripts
  4. [作者]    焼きノリ
  5. [配布元]  まったりツクール雑貨 http://mata-tuku.ldblog.jp/
  6. #------------------------------------------------------------------------------
  7. [更新履歴]
  8. ・2012/08/26 公開
  9. ・2012/09/09 Window_Selectableにメソッド追加
  10. ・2014/04/20 利用者にとってあまり意味のないメソッドの削除
  11. ・2015/03/25 method_defined?をエイリアスして機能の拡張
  12. ・2015/04/01 RGSS3用にメソッドをいくつか追加
  13. #==============================================================================

  14. #------------------------------------------------------------------------------
  15. [対応]
  16. ・RGSS2、RGSS3両方可能
  17. #------------------------------------------------------------------------------

  18. #------------------------------------------------------------------------------
  19. [機能]
  20. ・焼きノリが制作したスクリプトを使う際に必要になります。

  21. ・RGSS3のみ、TPの割合を取得するメソッドを正しい処理に再定義しています。

  22. #------------------------------------------------------------------------------

  23. #------------------------------------------------------------------------------
  24. [使用方法]
  25. ・必ず、拙作の他のスクリプトの一番上に配置してください。
  26. #------------------------------------------------------------------------------

  27. [再定義箇所]
  28. ・RGSS3のみ Game_BattlerBase の tp_rate
  29. #------------------------------------------------------------------------------
  30.   [○ : 新規定義,  ◎ : エイリアス定義,  ● : 再定義]
  31. #------------------------------------------------------------------------------
  32. =end
  33. $YkNr_Scripts ||= {}
  34. $YkNr_Scripts[:YakiNoriBaseScripts] = true
  35. #※このスクリプトを使用しない場合は、↑を false にすること

  36. if $YkNr_Scripts[:YakiNoriBaseScripts]
  37. #==============================================================================
  38. # ■ YakiNori
  39. #------------------------------------------------------------------------------
  40. #     拙作の各自作スクリプトで使用するメソッドの集まりです。
  41. #==============================================================================
  42. module YakiNori
  43.   #--------------------------------------------------------------------------
  44.   # ○ 定数用モジュールに定義されている定数をフリーズ
  45.   #      このメソッドのみ、定数モジュールより先に定義する
  46.   #--------------------------------------------------------------------------
  47.   def self.freeze_all_constants(mod)
  48.     _const_modules = "#{mod.name}::Const"
  49.     eval("#{_const_modules}.constants").each do |const|
  50.       _constant = "#{_const_modules}::#{const}"
  51.       eval("#{_constant}.freeze") if !eval("#{_constant}.frozen?")
  52.     end
  53.   end
  54. #==============================================================================
  55. # ■ 定数用モジュール
  56. #==============================================================================
  57. module Const
  58. end
  59. freeze_all_constants(self)  # 定数をフリーズ
  60. #==============================================================================
  61. # ■ インスタンスメソッド用モジュール
  62. #------------------------------------------------------------------------------
  63. #      このモジュールをインクルードすることで、ここで定義したメソッドが使用可能。
  64. #==============================================================================
  65. module Instance
  66. end
  67. #==============================================================================
  68. # ■ 拡張モジュール用モジュール
  69. #------------------------------------------------------------------------------
  70. #      このモジュールに自作スクリプトで使用するモジュールを集結させます
  71. #==============================================================================
  72.   module BaseExModules
  73.     # オブジェクトクラスにインクルード
  74.     Object.__send__ :include, self
  75.   end
  76. #==============================================================================
  77. # ■ 特異メソッド
  78. #==============================================================================
  79.   #--------------------------------------------------------------------------
  80.   # ○ 拡張モジュール用モジュールに定義されているか取得
  81.   #      引数は、RGSS,RGSS2では文字列に、RGSS3はシンボル値を渡してください
  82.   #--------------------------------------------------------------------------
  83.   def self.include_module?(module_name_sym)
  84.     BaseExModules.constants.include?(module_name_sym)
  85.   end
  86. end


  87. #==============================================================================
  88. # ■ Kernel
  89. #==============================================================================
  90. module Kernel
  91.   #--------------------------------------------------------------------------
  92.   # ○ RPGVXAce かどうか
  93.   #--------------------------------------------------------------------------
  94.   def vxace?
  95.     # Ruby 1.9 以降とそれ以前では、実行結果が違う
  96.     return false if public_methods.all? {|item| item.is_a?(String)}
  97.     return false if !defined?(Graphics.play_movie)
  98.     return defined?(BasicObject)
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ○ RGSSのバージョンを取得
  102.   #--------------------------------------------------------------------------
  103.   def rgss_version
  104.     _version = {2 => false, 3 => false}
  105.     _version[vxace? ? 3 : 2] = true
  106.     return _version
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ○ 定数
  110.   #--------------------------------------------------------------------------
  111.   RGSS = rgss_version; RGSS.freeze
  112. end

  113. #==============================================================================
  114. # ■ Module
  115. #==============================================================================
  116. class Module < Object
  117.   #--------------------------------------------------------------------------
  118.   # ◎ インスタンスメソッドが定義されているか判定
  119.   #--------------------------------------------------------------------------
  120.   alias method_defined_from_all? :method_defined?
  121.   def method_defined?(method_name, all = true)
  122.     if all
  123.       method_defined_from_all?(method_name)
  124.     else
  125.       method_name = RGSS[3] ? method_name.to_sym : method_name.to_s
  126.       instance_methods(false).include?(method_name)
  127.     end
  128.   end
  129. end


  130. #==============================================================================
  131. # ■ Game_CharacterBase
  132. #==============================================================================
  133. class Game_CharacterBase
  134.   #--------------------------------------------------------------------------
  135.   # ○ 正面にイベントが存在するか取得
  136.   #--------------------------------------------------------------------------
  137.   def exist_event_front?
  138.     x2 = $game_map.round_x_with_direction(@x, @direction)
  139.     y2 = $game_map.round_y_with_direction(@y, @direction)
  140.     return !$game_map.events_xy(x2, y2).empty?
  141.   end
  142. end

  143. #==============================================================================
  144. # ■ Game_Map
  145. #==============================================================================
  146. class Game_Map
  147.   #--------------------------------------------------------------------------
  148.   # ○ エディター上のマップ名を取得
  149.   #--------------------------------------------------------------------------
  150.   def editor_name
  151.     $data_mapinfos[map_id].name
  152.   end
  153. end

  154. #==============================================================================
  155. # ■ Game_Event
  156. #==============================================================================
  157. class Game_Event < Game_Character
  158.   #--------------------------------------------------------------------------
  159.   # ○ イベント名の取得
  160.   #--------------------------------------------------------------------------
  161.   def name
  162.     @event.name
  163.   end
  164. end

  165. #==============================================================================
  166. # ■ Window_Base
  167. #==============================================================================
  168. class Window_Base < Window
  169.   #--------------------------------------------------------------------------
  170.   # ○ ゲージの描画 (外枠付)
  171.   #     rate   : 割合(1.0 で満タン)
  172.   #     color1 : グラデーション 左端
  173.   #     color2 : グラデーション 右端
  174.   #--------------------------------------------------------------------------
  175.   def draw_gauge_ex(x, y, width, rate, color1, color2)
  176.     fill_w = ((width-2) * rate).to_i
  177.     gauge_y = y + line_height - 8
  178.     contents.fill_rect(x, gauge_y, width, 8, gauge_back_color)
  179.     contents.gradient_fill_rect(x+1, gauge_y+1, fill_w, 6, color1, color2)
  180.   end
  181. end

  182. #==============================================================================
  183. # ■ Window_Selectable
  184. #==============================================================================
  185. class Window_Selectable < Window_Base
  186.   #--------------------------------------------------------------------------
  187.   # ○ 現在の列の取得
  188.   #--------------------------------------------------------------------------
  189.   def column
  190.     index % col_max
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ○ 行と列から項目の位置を取得
  194.   #--------------------------------------------------------------------------
  195.   def index_pos(row, column)
  196.     row * col_max + (column - 1)
  197.   end
  198. end

  199. #==============================================================================
  200. # □ ここから VX Ace のみ
  201. #==============================================================================
  202. if RGSS[3]

  203. #==============================================================================
  204. # ■ Game_BattlerBase
  205. #==============================================================================
  206. class Game_BattlerBase
  207.   #--------------------------------------------------------------------------
  208.   # ● TP の割合を取得
  209.   #--------------------------------------------------------------------------
  210.   def tp_rate
  211.     @tp.to_f / max_tp
  212.   end
  213. end

  214. #==============================================================================
  215. # ■ Game_Unit
  216. #==============================================================================
  217. class Game_Unit
  218.   #--------------------------------------------------------------------------
  219.   # ○ 合計値を計算
  220.   #--------------------------------------------------------------------------
  221.   def hp_sum;  members.inject(0) {|r, m| r += m.hp };     end      # HP
  222.   def mp_sum;  members.inject(0) {|r, m| r += m.mp };     end      # MP
  223.   def tp_sum;  members.inject(0) {|r, m| r += m.tp };     end      # TP
  224.   def mhp_sum; members.inject(0) {|r, m| r += m.mhp };    end      # 最大HP
  225.   def mmp_sum; members.inject(0) {|r, m| r += m.mmp };    end      # 最大MP
  226.   def mtp_sum; members.inject(0) {|r, m| r += m.max_tp }; end      # 最大TP
  227.   #--------------------------------------------------------------------------
  228.   # ○ 割合を計算
  229.   #--------------------------------------------------------------------------
  230.   def hp_rate; members.size == 0 ? 1 : hp_sum.to_f / mhp_sum; end  # HP
  231.   def mp_rate; members.size == 0 ? 1 : mp_sum.to_f / mmp_sum; end  # MP
  232.   def tp_rate; members.size == 0 ? 1 : tp_sum.to_f / mtp_sum; end  # TP
  233.   #--------------------------------------------------------------------------
  234.   # ○ 攻撃力の平均値を計算
  235.   #--------------------------------------------------------------------------
  236.   def atk
  237.     return 1 if members.size == 0
  238.     members.inject(0) {|r, member| r += member.atk } / members.size
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ○ 防御力の平均値を計算
  242.   #--------------------------------------------------------------------------
  243.   def def
  244.     return 1 if members.size == 0
  245.     members.inject(0) {|r, member| r += member.def } / members.size
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ○ 魔法力の平均値を計算
  249.   #--------------------------------------------------------------------------
  250.   def mat
  251.     return 1 if members.size == 0
  252.     members.inject(0) {|r, member| r += member.mat } / members.size
  253.   end
  254.   #--------------------------------------------------------------------------
  255.   # ○ 魔法防御の平均値を計算
  256.   #--------------------------------------------------------------------------
  257.   def mdf
  258.     return 1 if members.size == 0
  259.     members.inject(0) {|r, member| r += member.mdf } / members.size
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ○ 運の平均値を計算
  263.   #--------------------------------------------------------------------------
  264.   def luk
  265.     return 1 if members.size == 0
  266.     members.inject(0) {|r, member| r += member.luk } / members.size
  267.   end
  268. end

  269. #==============================================================================
  270. # □ ここまで VX Ace のみ / ここから VX のみ
  271. #==============================================================================
  272. elsif !RGSS[3]

  273. #--------------------------------------------------------------------------
  274. # ○ $data_mapinfos のロード
  275. #--------------------------------------------------------------------------
  276. $data_mapinfos ||= load_data("Data/MapInfos.rvdata")

  277. #==============================================================================
  278. # ■ Game_Map
  279. #==============================================================================
  280. class Game_Map
  281.   #--------------------------------------------------------------------------
  282.   # ◎ マップ名を取得
  283.   #--------------------------------------------------------------------------
  284.   alias name editor_name
  285. end

  286. #==============================================================================
  287. # ■ Window_Base
  288. #==============================================================================
  289. class Window_Base < Window
  290.   #--------------------------------------------------------------------------
  291.   # ○ テキスト描画色の変更
  292.   #     enabled : 有効フラグ。false のとき半透明で描画
  293.   #--------------------------------------------------------------------------
  294.   def change_color(color, enabled = true)
  295.     contents.font.color.set(color)
  296.     contents.font.color.alpha = translucent_alpha unless enabled
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ○ テキストの描画
  300.   #     args : Bitmap#draw_text と同じ
  301.   #--------------------------------------------------------------------------
  302.   def draw_text(*args)
  303.     contents.draw_text(*args)
  304.   end
  305. end

  306. #==============================================================================
  307. # ■ Game_Temp
  308. #==============================================================================
  309. class Game_Temp
  310.   #--------------------------------------------------------------------------
  311.   # ○ 公開インスタンス変数
  312.   #--------------------------------------------------------------------------
  313.   attr_accessor :previous_scene # 現在のひとつ前の画面(文字列)
  314.   #--------------------------------------------------------------------------
  315.   # ◎ オブジェクト初期化
  316.   #--------------------------------------------------------------------------
  317.   alias yknr_LogDisable_initialize initialize
  318.   def initialize
  319.     yknr_LogDisable_initialize
  320.     @previous_scene = ""
  321.   end
  322. end

  323. #==============================================================================
  324. # ■ Scene_Base
  325. #==============================================================================
  326. class Scene_Base
  327.   #--------------------------------------------------------------------------
  328.   # ○ 終了処理
  329.   #--------------------------------------------------------------------------
  330.   def terminate
  331.     # 現在の画面を保存
  332.     $game_temp.previous_scene = self.class.name
  333.   end
  334. end

  335. end # !RGSS[3]

  336. end # $YkNr_Scripts
复制代码
  
焼きノリ2
  1. =begin
  2. #==============================================================================
  3. [名前]    拡張デバッグ機能_本体
  4. [作者]    焼きノリ
  5. [配布元]  まったりツクール雑貨 http://mata-tuku.ldblog.jp/
  6. #------------------------------------------------------------------------------
  7. [更新履歴]
  8. ・2012/09/10 公開
  9. ・2014/06/07 デバッグシーンからバトルシーンに戻ってくると TP が初期化されるバグの修正
  10. ・2014/06/07 その他, 各処理の改善
  11. #==============================================================================

  12. #------------------------------------------------------------------------------
  13. [対応]
  14. ・RGSS3のみ可能
  15. #------------------------------------------------------------------------------

  16. #------------------------------------------------------------------------------
  17. [機能]
  18. ・デフォルトのデバッグ機能を拡張し、
  19.   変数、スイッチ以外にもデバッグの対象にすることができるようになります。
  20. ・戦闘中でもデバッグメニューを開けるようになります。
  21.   戦闘中に開いた場合、そのターンに選択した戦闘行動はキャンセルされ、
  22.   パーティの先頭から選択し直しになります。
  23. #------------------------------------------------------------------------------

  24. #------------------------------------------------------------------------------
  25. [使用方法]
  26. ・テストモード時に「F9」を押せば、そのまま使えます。
  27. ・このスクリプトはただの本体ですので、これだけでは使えません。
  28.   別途で「拡張デバッグ機能_カスタマイズ」が必要です。
  29. ・このスクリプトのカスタマイズ項目で、
  30.   指定キーを押下中の、値の増減値を設定できます。
  31. #------------------------------------------------------------------------------

  32. #------------------------------------------------------------------------------
  33. [再定義箇所]
  34. ・Scene_Debug の start, help_text
  35. ・Window_DebugLeft の initialize, window_height, mode, top_id, refresh, draw_item
  36. ・Window_DebugRight の initialize, update, draw_item
  37. #------------------------------------------------------------------------------
  38.   [○ : 新規定義,  ◎ : エイリアス定義,  ● : 再定義]
  39. #------------------------------------------------------------------------------
  40. =end
  41. $YkNr_Scripts ||= {}
  42. $YkNr_Scripts[:ExDebugScene] = true
  43. #※このスクリプトを使用しない場合は、↑を false にすること

  44. if $YkNr_Scripts[:ExDebugScene] && $TEST
  45. #==============================================================================
  46. # ■ ExDebugData
  47. #------------------------------------------------------------------------------
  48. #    デバッグメニューのカテゴリ名とヘルプテキストを設定するモジュールです。
  49. #==============================================================================
  50. module YakiNori::BaseExModules::ExDebugData
  51. #==============================================================================
  52. # ■ 定数モジュール
  53. #==============================================================================
  54. module Const
  55.   #==============================================================================
  56.   # ▼ カスタマイズ
  57.   #==============================================================================
  58.   # 値の増減値のレート(例:50 #=> 50倍)
  59.   MultiplyRateNum = 50
  60.   # 増減値レートを判定するボタンのシンボル値
  61.   MultiplyRateInput = :A
  62.   #==============================================================================
  63.   # ▲ カスタマイズここまで
  64.   #==============================================================================
  65.   SwitchString = {true => "[O N]", false => "[OFF]"}
  66.   CommandSymbol = []
  67.   CommandName = {}
  68.   HelpDescription = {}
  69. end
  70. end

  71. #==============================================================================
  72. # ■ BattleManager
  73. #==============================================================================
  74. module BattleManager
  75.   #--------------------------------------------------------------------------
  76.   # ○ コマンド入力中判定
  77.   #--------------------------------------------------------------------------
  78.   def self.inputting?
  79.     @phase == :input
  80.   end
  81. end

  82. #==============================================================================
  83. # ■ Game_Battler
  84. #==============================================================================
  85. class Game_Battler < Game_BattlerBase
  86.   #--------------------------------------------------------------------------
  87.   # ◎ 戦闘開始処理
  88.   #--------------------------------------------------------------------------
  89.   alias yknr_Game_BattlerExDebugScene_on_battle_start :on_battle_start
  90.   def on_battle_start
  91.     if SceneManager.scene_is?(Scene_Battle)
  92.       if !SceneManager.scene.returned_from_scene_debug?
  93.         yknr_Game_BattlerExDebugScene_on_battle_start
  94.       end
  95.     end
  96.   end
  97. end

  98. #==============================================================================
  99. # ■ Window_DebugCategory
  100. #------------------------------------------------------------------------------
  101. #    デバッグメニューのメイン項目を表示します。
  102. #==============================================================================
  103. class Window_DebugCategory < Window_Command
  104.   #--------------------------------------------------------------------------
  105.   # ○ インクルード
  106.   #--------------------------------------------------------------------------
  107.   include YakiNori::BaseExModules::ExDebugData::Const
  108.   #--------------------------------------------------------------------------
  109.   # ○ オブジェクト初期化
  110.   #--------------------------------------------------------------------------
  111.   def initialize
  112.     super(0, 0)
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ○ ウィンドウ幅の取得
  116.   #--------------------------------------------------------------------------
  117.   def window_width
  118.     Graphics.width
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # ○ 表示行数の取得
  122.   #--------------------------------------------------------------------------
  123.   def visible_line_number
  124.     return 5
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ○ 桁数の取得
  128.   #--------------------------------------------------------------------------
  129.   def col_max
  130.     return 2
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ○ 横に項目が並ぶときの空白の幅を取得
  134.   #--------------------------------------------------------------------------
  135.   def spacing
  136.     return 8
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ○ ウィンドウ内容の幅を計算
  140.   #--------------------------------------------------------------------------
  141.   def contents_width
  142.     (item_width + spacing) * col_max - spacing
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ○ コマンドリストの作成
  146.   #--------------------------------------------------------------------------
  147.   def make_command_list
  148.     CommandSymbol.each do |sym|
  149.       add_command(CommandName[sym], sym, enabled_command(sym)) if !sym.nil?
  150.     end
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ○ コマンドが有効状態か判定
  154.   #--------------------------------------------------------------------------
  155.   def enabled_command(symbol)
  156.     true
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ○ カーソルを 1 ページ後ろに移動
  160.   #--------------------------------------------------------------------------
  161.   def cursor_pagedown
  162.   end
  163.   #--------------------------------------------------------------------------
  164.   # ○ カーソルを 1 ページ前に移動
  165.   #--------------------------------------------------------------------------
  166.   def cursor_pageup
  167.   end
  168. end

  169. #==============================================================================
  170. # ■ Window_DebugLeft
  171. #==============================================================================
  172. class Window_DebugLeft < Window_Selectable
  173.   #--------------------------------------------------------------------------
  174.   # ○ インクルード
  175.   #--------------------------------------------------------------------------
  176.   include YakiNori::BaseExModules::ExDebugData::Const
  177.   #--------------------------------------------------------------------------
  178.   # ○ 公開インスタンス変数
  179.   #--------------------------------------------------------------------------
  180.   attr_accessor  :mode                     # モード
  181.   #--------------------------------------------------------------------------
  182.   # ● オブジェクト初期化
  183.   #--------------------------------------------------------------------------
  184.   def initialize(x, y)
  185.     super(x, y, window_width, window_height)
  186.     @mode = nil
  187.     @item_max = 0
  188.     refresh
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● ウィンドウ高さの取得
  192.   #--------------------------------------------------------------------------
  193.   def window_height
  194.     fitting_height(10)
  195.   end
  196.   #--------------------------------------------------------------------------
  197.   # ● 先頭に表示する ID の取得
  198.   #--------------------------------------------------------------------------
  199.   def top_id
  200.     index * 10 + 1
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● リフレッシュ
  204.   #--------------------------------------------------------------------------
  205.   def refresh
  206.     @item_max = ex_item_max
  207.     create_contents
  208.     draw_all_items
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● 項目の描画
  212.   #--------------------------------------------------------------------------
  213.   def draw_item(index)
  214.     return if @mode.nil?
  215.     draw_text(item_rect_for_text(index), ex_draw_item(index))
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ○ 拡張用:項目数の取得
  219.   #--------------------------------------------------------------------------
  220.   def ex_item_max
  221.     return 0
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ○ 拡張用:項目の描画の内容を取得
  225.   #--------------------------------------------------------------------------
  226.   def ex_draw_item(index)
  227.     return ""
  228.   end
  229. end

  230. #==============================================================================
  231. # ■ Window_DebugRight
  232. #==============================================================================
  233. class Window_DebugRight < Window_Selectable
  234.   #--------------------------------------------------------------------------
  235.   # ○ インクルード
  236.   #--------------------------------------------------------------------------
  237.   include YakiNori::BaseExModules::ExDebugData::Const
  238.   #--------------------------------------------------------------------------
  239.   # ● オブジェクト初期化
  240.   #--------------------------------------------------------------------------
  241.   def initialize(x, y, width)
  242.     super(x, y, width, fitting_height(item_max))
  243.     @mode = nil
  244.     @top_id = 1
  245.     refresh
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ● 項目の描画
  249.   #--------------------------------------------------------------------------
  250.   def draw_item(index)
  251.     return if @mode.nil? || @top_id < 0
  252.    
  253.     data_id = @top_id + index
  254.     text = ex_draw_item(index, data_id)
  255.     text[:name] = "[!] 未使用項目---------" if text[:name].nil?
  256.    
  257.     id_text = sprintf("%04d:", data_id)
  258.     id_width = text_size(id_text).width
  259.     rect = item_rect_for_text(index)
  260.     change_color(normal_color)
  261.     draw_text(rect, id_text)
  262.     rect.x += id_width
  263.     rect.width -= id_width + 60
  264.     draw_text(rect, text[:name])
  265.     rect.width += 60
  266.     draw_text(rect, text[:status], 2)
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # ● フレーム更新
  270.   #--------------------------------------------------------------------------
  271.   def update
  272.     super
  273.     ex_update_debug if active
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ○ 拡張用:項目の描画の内容を取得
  277.   #--------------------------------------------------------------------------
  278.   def ex_draw_item(index, data_id)
  279.     return {:name => nil, :status => ""}
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ○ 拡張用:モード別にフレーム更新
  283.   #--------------------------------------------------------------------------
  284.   def ex_update_debug
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ○ 方向キーによる値の更新
  288.   #--------------------------------------------------------------------------
  289.   def update_value_input(value)
  290.     rate = Input.press?(MultiplyRateInput) ? MultiplyRateNum : 1
  291.     value += 1  * rate if Input.repeat?(:RIGHT)
  292.     value -= 1  * rate if Input.repeat?(:LEFT)
  293.     value += 10 * rate if Input.repeat?(:R)
  294.     value -= 10 * rate if Input.repeat?(:L)
  295.     value
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ○ 指定キー押下時にブザー音の再生
  299.   #--------------------------------------------------------------------------
  300.   def trigger_buzzer(input_symbol)
  301.     trigger = false
  302.     case input_symbol
  303.     when :enter
  304.       trigger = Input.trigger?(:C)
  305.     when :direction
  306.       trigger = [:RIGHT, :LEFT, :R, :L].any? {|key| Input.trigger?(key)}
  307.     end
  308.     Sound.play_buzzer if trigger
  309.   end
  310. end

  311. #==============================================================================
  312. # ■ Scene_Battle
  313. #==============================================================================
  314. class Scene_Battle < Scene_Base
  315.   @@called_debug = false # デバッグシーンから戻ってきたか
  316.   #--------------------------------------------------------------------------
  317.   # ○ デバッグシーンから戻ってきたか判定
  318.   #--------------------------------------------------------------------------
  319.   def returned_from_scene_debug?
  320.     @@called_debug
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # ◎ フレーム更新
  324.   #--------------------------------------------------------------------------
  325.   alias yknr_Scene_BattleExDebugScene_update :update
  326.   def update
  327.     yknr_Scene_BattleExDebugScene_update
  328.     update_call_debug
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ◎ 戦闘開始
  332.   #--------------------------------------------------------------------------
  333.   alias yknr_Scene_BattleExDebugScene_battle_start :battle_start
  334.   def battle_start
  335.     if @@called_debug
  336.       battle_start_from_debug
  337.     else
  338.       yknr_Scene_BattleExDebugScene_battle_start
  339.     end
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ○ デバッグシーンから戻ってきたときの戦闘開始
  343.   #--------------------------------------------------------------------------
  344.   def battle_start_from_debug
  345.     $game_party.on_battle_start
  346.     $game_troop.on_battle_start
  347.     start_party_command_selection
  348.     @@called_debug = false
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # ○ F9 キーによるデバッグ呼び出し判定
  352.   #--------------------------------------------------------------------------
  353.   def update_call_debug
  354.     if enabled_call_scene_debug? && Input.press?(:F9)
  355.       SceneManager.call(Scene_Debug)
  356.       @@called_debug = true
  357.     end
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ○ デバッグシーンが呼び出し可能か判定
  361.   #--------------------------------------------------------------------------
  362.   def enabled_call_scene_debug?
  363.     return false if !$TEST
  364.     return false if $game_troop.interpreter.running?
  365.     return false if $game_message.visible
  366.     return false if !BattleManager.inputting?
  367.     return false if @skill_window.visible
  368.     return false if @item_window.visible
  369.     return false if @actor_window.visible
  370.     return false if @enemy_window.visible
  371.     return true
  372.   end
  373. end

  374. #==============================================================================
  375. # ■ Scene_Debug
  376. #==============================================================================
  377. class Scene_Debug < Scene_MenuBase
  378.   #--------------------------------------------------------------------------
  379.   # ○ インクルード
  380.   #--------------------------------------------------------------------------
  381.   include YakiNori::BaseExModules::ExDebugData::Const
  382.   #--------------------------------------------------------------------------
  383.   # ● 開始処理
  384.   #--------------------------------------------------------------------------
  385.   def start
  386.     super
  387.     create_all_window
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ○ 全ウィンドウの作成
  391.   #--------------------------------------------------------------------------
  392.   def create_all_window
  393.     create_category_window
  394.     create_left_window
  395.     create_right_window
  396.     create_debug_help_window
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ○ カテゴリーウィンドウの作成
  400.   #--------------------------------------------------------------------------
  401.   def create_category_window
  402.     @category_window = Window_DebugCategory.new
  403.     @category_window.y = Graphics.height - @category_window.height
  404.     @category_window.set_handler(:ok,     method(:on_category_ok))
  405.     @category_window.set_handler(:cancel, method(:return_scene))
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # ◎ 左ウィンドウの作成
  409.   #--------------------------------------------------------------------------
  410.   alias yknr_Scene_DebugExDebugScene_create_left_window :create_left_window
  411.   def create_left_window
  412.     yknr_Scene_DebugExDebugScene_create_left_window
  413.     @left_window.set_handler(:cancel, method(:on_left_cancel))
  414.     @left_window.height = @category_window.y
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ◎ 右ウィンドウの作成
  418.   #--------------------------------------------------------------------------
  419.   alias yknr_Scene_DebugExDebugScene_create_right_window :create_right_window
  420.   def create_right_window
  421.     yknr_Scene_DebugExDebugScene_create_right_window
  422.     @right_window.height = @category_window.y
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ◎ ヘルプウィンドウの作成
  426.   #--------------------------------------------------------------------------
  427.   alias yknr_Scene_DebugExDebugScene_c_d_h_w :create_debug_help_window
  428.   def create_debug_help_window
  429.     yknr_Scene_DebugExDebugScene_c_d_h_w
  430.     cw = @category_window
  431.     @debug_help_window.move(0, cw.y, cw.width, cw.height)
  432.     @debug_help_window.create_contents
  433.     @debug_help_window.hide
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # ○ カテゴリー[決定]
  437.   #--------------------------------------------------------------------------
  438.   def on_category_ok
  439.     @left_window.mode = @category_window.current_symbol
  440.     @left_window.refresh
  441.     @left_window.activate.select(0)
  442.     @debug_help_window.show
  443.     @category_window.hide
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ○ 左[キャンセル]
  447.   #--------------------------------------------------------------------------
  448.   def on_left_cancel
  449.     @left_window.mode = nil
  450.     @left_window.unselect
  451.     @left_window.refresh
  452.     @right_window.refresh
  453.     @category_window.show.activate
  454.     @debug_help_window.hide
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● ヘルプ文字列の取得
  458.   #--------------------------------------------------------------------------
  459.   def help_text
  460.     text = HelpDescription[@left_window.mode]
  461.     text.nil? ? "not text" : text
  462.   end
  463.   #--------------------------------------------------------------------------
  464.   # ○ 背景の作成
  465.   #--------------------------------------------------------------------------
  466.   def create_background
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ○ 背景の解放
  470.   #--------------------------------------------------------------------------
  471.   def dispose_background
  472.   end
  473. end

  474. end # $YkNr_Scripts
复制代码
  
焼きノリ3
  1. =begin
  2. #==============================================================================
  3. [名前]    拡張デバッグ機能_カスタマイズ
  4. [作者]    焼きノリ
  5. [配布元]  まったりツクール雑貨 http://mata-tuku.ldblog.jp/
  6. #------------------------------------------------------------------------------
  7. [更新履歴]
  8. ・2012/09/10 公開
  9. ・2012/09/16 パーティ並び替えメソッド名に不備があり、エラーが出ていたので修正
  10. ・2012/09/19 レベル、経験値が変更できずエラーになっていたので修正
  11. ・2012/09/23 スキルの習得設定でエラーが出ていたので修正
  12. ・2014/06/07 各処理の改善
  13. #==============================================================================

  14. #------------------------------------------------------------------------------
  15. [対応]
  16. ・RGSS3のみ可能
  17. #------------------------------------------------------------------------------

  18. #------------------------------------------------------------------------------
  19. [機能]
  20. ・デバッグの項目の入れ替えなどのカスタマイズが可能できます。
  21. ・以下をデバッグで操作できるようにします。
  22.   [マップ、変数、スイッチ、セルフスイッチ、
  23.    アクター、トループ、アイテム、武器、防具、システム]
  24. #------------------------------------------------------------------------------

  25. #------------------------------------------------------------------------------
  26. [使用方法]
  27. ・拙作のスクリプト「拡張デバッグ機能_本体」が無いと動作しません。
  28. ・「拡張デバッグ機能_本体」のすぐ下に導入してください。
  29. #------------------------------------------------------------------------------

  30. #------------------------------------------------------------------------------
  31. [再定義箇所]
  32. ・Window_DebugRight の ex_draw_item, ex_update_debug, update_variable_mode
  33. #------------------------------------------------------------------------------
  34.   [○ : 新規定義,  ◎ : エイリアス定義,  ● : 再定義]
  35. #------------------------------------------------------------------------------
  36. =end
  37. if $YkNr_Scripts[:ExDebugScene] && $TEST
  38. #==============================================================================
  39. # ■ ExDebugData
  40. #------------------------------------------------------------------------------
  41. #    デバッグメニューのカテゴリ名とヘルプテキストを設定するモジュールです。
  42. #==============================================================================
  43. module YakiNori::BaseExModules::ExDebugData
  44. #==============================================================================
  45. # ■ 定数モジュール
  46. #==============================================================================
  47. module Const
  48.   #==============================================================================
  49.   # ▼ カスタマイズ
  50.   #==============================================================================
  51.   # 項目のシンボル値
  52.   #   ここのシンボル値を並び替えることで、
  53.   #   デバッグメニューの項目を並び替えることができます。
  54.   CommandSymbol = [
  55.     :map,
  56.     :variable,
  57.     :switch,
  58.     :self_switch,
  59.     :actor,
  60.     :troop,
  61.     :gold,
  62.     :items,
  63.     :weapons,
  64.     :armors,
  65.     :system,
  66.   ]
  67.   # 項目の名前
  68.   CommandName = {
  69.     :map         => "マップ移動",
  70.     :variable    => "変数操作",
  71.     :switch      => "スイッチ操作",
  72.     :self_switch => "セルフスイッチ操作",
  73.     :actor       => "アクター操作",
  74.     :troop       => "エネミー操作",
  75.     :gold        => "所持金操作",
  76.     :items       => "アイテム所持数操作",
  77.     :weapons     => "武器所持数操作",
  78.     :armors      => "防具所持数操作",
  79.     :system      => "システム操作",
  80.   }
  81.   
  82.   # 値の設定のヘルプテキスト
  83.   help_variable = "左右キー: 1 ずつ増減\n" + "LRキー: 10 ずつ増減\n" +
  84.   "#{MultiplyRateInput}キー押下中:" + "それぞれの増加量を #{MultiplyRateNum} 倍"
  85.   # [スイッチ / フラグ]の設定のヘルプテキスト
  86.   help_switch = "決定キー: [ON / OFF] 切り替え"
  87.   # 項目のヘルプテキスト
  88.   HelpDescription = {
  89.     :map         => "行きたいマップを選択してください。\n" +
  90.                     "移動後の座標は、「イベントID:1」の上です。\n" +
  91.                     "イベントが存在しない場合は、マップの左上に移動します。",
  92.     :variable    => help_variable,
  93.     :switch      => help_switch,
  94.     :self_switch => help_switch + "\n" +
  95.                     "左右キー: セルフスイッチの切り替え",
  96.     :actor       => help_variable + "\n" +
  97.                     "決定キー: 設定のオン/オフ(一部項目の選択時のみ)",
  98.     :troop       => help_variable + "\n" +
  99.                     "決定キー: 設定のオン/オフ(一部項目の選択時のみ)",
  100.     :gold        => "",
  101.     :items       => help_variable,
  102.     :weapons     => help_variable,
  103.     :armors      => help_variable,
  104.     :system      => help_switch,
  105.   }
  106.   # 職業変更時に経験値を引き継ぐか
  107.   TransferEXP = true
  108.   # パーティ参加時に自動的に並び替えを行うか
  109.   AddPartyAutoSort = true
  110.   # マップ移動後にシーンを終了するか
  111.   ReturnSceneMovedMap = true
  112.   #==============================================================================
  113.   # ▲ カスタマイズここまで
  114.   #==============================================================================
  115.   # Actorクラスから呼び出すメソッド名のシンボル値
  116.   ActorStatusSymbol = [
  117.     :index,       # 0
  118.     :level,       # 1
  119.     :exp,         # 2
  120.     :hp,          # 3
  121.     :mp,          # 4
  122.     :tp,          # 5
  123.     :param_plus,  # 6
  124.     :class_id,    # 7
  125.     :states,      # 8
  126.     :skills,      # 9
  127.   ]
  128.   # 表示する文字列
  129.   ActorStatusString = {
  130.     ActorStatusSymbol[0]  => "PartyMember",
  131.     ActorStatusSymbol[1]  => "Level",
  132.     ActorStatusSymbol[2]  => "EXP",
  133.     ActorStatusSymbol[3]  => "HP",
  134.     ActorStatusSymbol[4]  => "MP",
  135.     ActorStatusSymbol[5]  => "TP",
  136.     ActorStatusSymbol[6]  => "AddParams",
  137.     ActorStatusSymbol[7]  => "Class",
  138.     ActorStatusSymbol[8]  => "States",
  139.     ActorStatusSymbol[9]  => "Skills",
  140.   }
  141.   # Enemyクラスから呼び出すメソッド名のシンボル値
  142.   EnemyStatusSymbol = [
  143.     :hp,       # 0
  144.     :mp,       # 1
  145.     :tp,       # 2
  146.     :states,   # 3
  147.   ]
  148.   # 表示する文字列
  149.   EnemyStatusString = {
  150.     EnemyStatusSymbol[0]  => "HP",
  151.     EnemyStatusSymbol[1]  => "MP",
  152.     EnemyStatusSymbol[2]  => "TP",
  153.     EnemyStatusSymbol[3]  => "States",
  154.   }
  155.   # Game_Systemクラスから呼び出すメソッド名のシンボル値
  156.   SystemStatusSymbol = [
  157.     :save_disabled,      # 0
  158.     :menu_disabled,      # 1
  159.     :encounter_disabled, # 2
  160.     :formation_disabled, # 3
  161.   ]
  162.   # 表示する文字列
  163.   SystemStatusString = {
  164.     SystemStatusSymbol[0]  => "セーブ禁止",
  165.     SystemStatusSymbol[1]  => "メニュー禁止",
  166.     SystemStatusSymbol[2]  => "エンカウント禁止",
  167.     SystemStatusSymbol[3]  => "並び替え禁止",
  168.   }
  169. end
  170. YakiNori.freeze_all_constants(self)  # 定数をフリーズ
  171. #==============================================================================
  172. # ■ 特異メソッド
  173. #==============================================================================
  174.   #--------------------------------------------------------------------------
  175.   # ○ 全マップのIDの配列を取得
  176.   #--------------------------------------------------------------------------
  177.   def self.all_map_id
  178.     _result = [0]
  179.     _tgt_id = 1
  180.     _hit_data_cnt = 0
  181.     while _hit_data_cnt < $data_mapinfos.size
  182.       map_path = sprintf("Data/Map%03d.rvdata2", _tgt_id)
  183.       # テスト用なので、ファイルの存在さえ取得できればよい
  184.       if FileTest.exist?(map_path) && FileTest.file?(map_path)
  185.         _result.push(_tgt_id)
  186.         _hit_data_cnt += 1 # ヒットカウントの加算
  187.       end
  188.       _tgt_id += 1 # 次のマップID
  189.     end
  190.     _result.compact!
  191.     _result.sort! { |a, b| a <=> b }
  192.     _result
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ○ マップ移動処理
  196.   #--------------------------------------------------------------------------
  197.   def self.execute_move_map(map_id)
  198.     new_x = 0
  199.     new_y = 0
  200.     map_data = load_data(sprintf("Data/Map%03d.rvdata2", map_id))
  201.     event = map_data.events[1]
  202.     if !event.nil?
  203.       new_x = event.x
  204.       new_y = event.y
  205.     end
  206.     $game_player.reserve_transfer(map_id, new_x, new_y)
  207.     $game_player.perform_transfer
  208.     SceneManager.return if Const::ReturnSceneMovedMap
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ○ パーティの並び替え(アクターID順)
  212.   #--------------------------------------------------------------------------
  213.   def self.sort_party_by_id
  214.     if $game_party.members.size > 1
  215.       swaped = true
  216.       while swaped
  217.         swaped = false
  218.         $game_party.members.each_index do |this_idx|
  219.           next_idx = this_idx + 1
  220.           this_actor = $game_party.members[this_idx]
  221.           next_actor = $game_party.members[next_idx]
  222.           if this_actor.id > next_actor.id
  223.             $game_party.swap_order(this_idx, next_idx)
  224.             swaped = true
  225.           end
  226.           break if next_idx == $game_party.members.size - 1
  227.         end
  228.       end
  229.     end
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ○ アクターモード時のレベル項目の更新
  233.   #--------------------------------------------------------------------------
  234.   def self.update_status_mode_level(actor, value)
  235.     actor.change_level(value, false)
  236.     actor.init_exp
  237.     actor.class.learnings.each do |learning|
  238.       if learning.level <= actor.level
  239.         actor.learn_skill(learning.skill_id)
  240.       elsif  learning.level > actor.level
  241.         actor.forget_skill(learning.skill_id)
  242.       end
  243.     end
  244.   end
  245.   #--------------------------------------------------------------------------
  246.   # ○ アクターモード時の経験値項目の更新
  247.   #--------------------------------------------------------------------------
  248.   def self.update_status_mode_exp(actor, value)
  249.     actor.change_exp(value, false)
  250.   end
  251. end

  252. #==============================================================================
  253. # ■ Window_DebugCategory
  254. #==============================================================================
  255. class Window_DebugCategory < Window_Command
  256.   #--------------------------------------------------------------------------
  257.   # ● コマンドが有効状態か判定
  258.   #--------------------------------------------------------------------------
  259.   def enabled_command(symbol)
  260.     case symbol
  261.     when :map
  262.       return !$game_party.in_battle
  263.     when :self_switch
  264.       return !$game_party.in_battle && !$game_map.events.empty?
  265.     when :troop
  266.       return $game_party.in_battle
  267.     else
  268.       return true
  269.     end
  270.   end
  271. end


  272. #==============================================================================
  273. # ■ Window_DebugLeft
  274. #==============================================================================
  275. class Window_DebugLeft < Window_Selectable
  276.   #--------------------------------------------------------------------------
  277.   # ◎ 拡張用:項目数の取得
  278.   #--------------------------------------------------------------------------
  279.   alias yknr_Window_DebugLeftExDebugCstmScene_ex_item_max :ex_item_max
  280.   def ex_item_max
  281.     case @mode
  282.     when :map
  283.       return $BTEST ? 1 : ($data_mapinfos.size + 9) / 10
  284.     when :variable
  285.       return ($data_system.variables.size - 1 + 9) / 10
  286.     when :switch
  287.       return ($data_system.switches.size - 1 + 9) / 10
  288.     when :self_switch
  289.       return ($game_map.events.size + 9) / 10
  290.     when :actor
  291.       return $data_actors.size - 1
  292.     when :troop
  293.       return $game_troop.members.size
  294.     when :items
  295.       return ($data_items.size - 1 + 9) / 10
  296.     when :weapons
  297.       return ($data_weapons.size - 1 + 9) / 10
  298.     when :armors
  299.       return ($data_armors.size - 1 + 9) / 10
  300.     when :system
  301.       return 1
  302.     else
  303.       yknr_Window_DebugLeftExDebugCstmScene_ex_item_max
  304.     end
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # ◎ 拡張用:項目の描画の内容を取得
  308.   #--------------------------------------------------------------------------
  309.   alias yknr_Window_DebugLeftExDebugCstmScene_ex_draw_item :ex_draw_item
  310.   def ex_draw_item(index)
  311.     n = index * 10
  312.     case @mode
  313.     when :map
  314.       return sprintf("[%04d-%04d]", n+1, n+10)
  315.     when :variable
  316.       return sprintf("[%04d-%04d]", n+1, n+10)
  317.     when :switch
  318.       return sprintf("[%04d-%04d]", n+1, n+10)
  319.     when :self_switch
  320.       return sprintf("[%04d-%04d]", n+1, n+10)
  321.     when :actor
  322.       return sprintf("[%02d]#{$game_actors[index + 1].name}", index + 1)
  323.     when :troop
  324.       return sprintf("[%02d]#{$game_troop.members[index].name}", index+ 1)
  325.     when :items
  326.       return sprintf("[%04d-%04d]", n+1, n+10)
  327.     when :weapons
  328.       return sprintf("[%04d-%04d]", n+1, n+10)
  329.     when :armors
  330.       return sprintf("[%04d-%04d]", n+1, n+10)
  331.     when :system
  332.       return "Systems"
  333.     else
  334.       yknr_Window_DebugLeftExDebugCstmScene_ex_draw_item
  335.     end
  336.   end
  337. end

  338. #==============================================================================
  339. # ■ Window_DebugRight
  340. #==============================================================================
  341. class Window_DebugRight < Window_Selectable
  342.   #--------------------------------------------------------------------------
  343.   # ◎ オブジェクト初期化
  344.   #--------------------------------------------------------------------------
  345.   alias yknr_Window_DebugRightExDebugCstmScene_initialize :initialize
  346.   def initialize(x, y, width)
  347.     @self_index = "A"
  348.     @all_maps_id = $BTEST ? [] : ExDebugData.all_map_id
  349.     @details_window = nil
  350.     yknr_Window_DebugRightExDebugCstmScene_initialize(x, y, width)
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● 拡張用:項目の描画の内容を取得
  354.   #--------------------------------------------------------------------------
  355.   def ex_draw_item(index, data_id)
  356.     name   = nil
  357.     status = ""
  358.     case @mode
  359.     when :map
  360.       map_id = @all_maps_id[data_id]
  361.       name   = map_id.nil? ?  nil :
  362.         $data_mapinfos[map_id].nil? ? nil : $data_mapinfos[map_id].name
  363.       status = map_id.nil? ?  "" :
  364.         $data_mapinfos[map_id].nil? ? ""  : sprintf("ID[%03d]", map_id)
  365.     when :variable
  366.       name   = $data_system.variables[data_id]
  367.       status = $game_variables[data_id]
  368.     when :switch
  369.       name   = $data_system.switches[data_id]
  370.       status = SwitchString[$game_switches[data_id]]
  371.     when :self_switch
  372.       event  = $game_map.events[data_id]
  373.       params = [$game_map.map_id, data_id, @self_index]
  374.       name   = event.nil? ? nil : event.name
  375.       status = @self_index + SwitchString[$game_self_switches[params]]
  376.     when :actor
  377.       symbol = ActorStatusSymbol[index]
  378.       name   = ActorStatusString[symbol]
  379.       actor = $game_actors[(data_id - index) / 10 + 1]
  380.       if !actor.nil? && !name.nil?
  381.         if [:exp].include?(symbol)
  382.           status = (actor.exp - actor.current_level_exp).to_s + " / "
  383.           status += (actor.next_level_exp - actor.current_level_exp).to_s
  384.         elsif [:class_id, :states, :skills, :param_plus].include?(symbol)
  385.           status = "Enter to Details"
  386.         elsif [:index].include?(symbol)
  387.           status = SwitchString[$game_party.members.include?(actor)]
  388.         elsif [:hp, :mp, :tp, :level].include?(symbol)
  389.           status = actor.send(symbol).to_s + " / "
  390.           status += actor.send("m" + symbol.to_s).to_s if [:hp, :mp].include?(symbol)
  391.           status += "100" if symbol == :tp
  392.           status += actor.max_level.to_s if symbol == :level
  393.         end
  394.       end
  395.     when :troop
  396.       symbol = EnemyStatusSymbol[index]
  397.       name   = EnemyStatusString[symbol]
  398.       enemy  = $game_troop.members[(data_id - index) / 10]
  399.       if !enemy.nil? && !name.nil?
  400.         if [:states].include?(symbol)
  401.           status = "Enter to Details"
  402.         elsif [:hp, :mp, :tp].include?(symbol)
  403.           status = enemy.send(symbol).to_s + " / "
  404.           status += enemy.send("m" + symbol.to_s).to_s if [:hp, :mp].include?(symbol)
  405.           status += "100" if symbol == :tp
  406.         end
  407.       end
  408.     when :items
  409.       name   = $data_items[data_id].nil? ? nil : $data_items[data_id].name
  410.       status = $game_party.item_number($data_items[data_id])
  411.     when :weapons
  412.       name   = $data_weapons[data_id].nil? ? nil : $data_weapons[data_id].name
  413.       status = $game_party.item_number($data_weapons[data_id])
  414.     when :armors
  415.       name   = $data_armors[data_id].nil? ? nil : $data_armors[data_id].name
  416.       status = $game_party.item_number($data_armors[data_id])
  417.     when :system
  418.       symbol = SystemStatusSymbol[data_id]
  419.       name   = SystemStatusString[symbol]
  420.       status = symbol.nil? ? "" : SwitchString[$game_system.send(symbol)]
  421.     end
  422.     return {:name => name, :status => status}
  423.   end
  424.   #--------------------------------------------------------------------------
  425.   # ● 拡張用:モード別にフレーム更新
  426.   #--------------------------------------------------------------------------
  427.   def ex_update_debug
  428.     case @mode
  429.     when :map
  430.       update_map_mode
  431.     when :variable
  432.       update_variable_mode
  433.     when :switch
  434.       update_switch_mode
  435.     when :self_switch
  436.       update_self_switch_mode
  437.     when :actor
  438.       update_actor_mode
  439.     when :troop
  440.       update_troop_mode
  441.     when :items
  442.       update_items_mode($data_items)
  443.     when :weapons
  444.       update_items_mode($data_weapons)
  445.     when :armors
  446.       update_items_mode($data_armors)
  447.     when :system
  448.       update_system_mode
  449.     end
  450.   end
  451.   #--------------------------------------------------------------------------
  452.   # ◎ スイッチモード時の更新
  453.   #--------------------------------------------------------------------------
  454.   alias yknr_Window_DebugRightExDebugCstmScene_u_s_m :update_switch_mode
  455.   def update_switch_mode
  456.     if current_id >= $data_system.switches.size
  457.       trigger_buzzer(:enter)
  458.     else
  459.       yknr_Window_DebugRightExDebugCstmScene_u_s_m
  460.     end
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # ● 変数モード時の更新
  464.   #--------------------------------------------------------------------------
  465.   def update_variable_mode
  466.     return unless $game_variables[current_id].is_a?(Numeric)
  467.     if current_id >= $data_system.variables.size
  468.       trigger_buzzer(:direction)
  469.     else
  470.       value = update_value_input($game_variables[current_id])
  471.       if $game_variables[current_id] != value
  472.         $game_variables[current_id] = value
  473.         Sound.play_cursor
  474.         redraw_current_item
  475.       end
  476.     end
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ○ セルフスイッチモード時の更新
  480.   #--------------------------------------------------------------------------
  481.   def update_self_switch_mode
  482.     if current_id > $game_map.events.size
  483.       trigger_buzzer(:enter)
  484.     else
  485.       params = [$game_map.map_id, current_id, @self_index]
  486.       next_self_switch = {"A" => "B", "B" => "C", "C" => "D", "D" => "A"}
  487.       if Input.trigger?(:C)
  488.         Sound.play_ok
  489.         $game_self_switches[params] = !$game_self_switches[params]
  490.         redraw_current_item
  491.       else
  492.         value = @self_index
  493.         value = next_self_switch[value]       if Input.repeat?(:RIGHT)
  494.         value = next_self_switch.index(value) if Input.repeat?(:LEFT)
  495.         if @self_index != value
  496.           @self_index = value
  497.           Sound.play_cursor
  498.           refresh
  499.         end
  500.       end
  501.     end
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ○ マップモード時の更新
  505.   #--------------------------------------------------------------------------
  506.   def update_map_mode
  507.     if current_id > ($BTEST ? 0 : $data_mapinfos.size)
  508.       trigger_buzzer(:enter)
  509.     else
  510.       if Input.trigger?(:C)
  511.         Sound.play_load
  512.         map_id = @all_maps_id[current_id]
  513.         ExDebugData.execute_move_map(map_id)
  514.       end
  515.     end
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ○ アクターモード時の更新
  519.   #--------------------------------------------------------------------------
  520.   def update_actor_mode
  521.     actor_id = current_id / 10 + 1
  522.     if index >= ActorStatusString.size
  523.       trigger_buzzer(:enter)
  524.     else
  525.       actor = $game_actors[actor_id]
  526.       symbol = ActorStatusSymbol[index]
  527.       if actor.respond_to?(symbol)
  528.         if [:class_id, :states, :skills,:param_plus].include?(symbol)
  529.           update_battler_setup_details(actor, symbol)
  530.         elsif [:index].include?(symbol)
  531.           if Input.trigger?(:C)
  532.             Sound.play_ok
  533.             if $game_party.members.include?(actor)
  534.               $game_party.remove_actor(actor_id)
  535.             else
  536.               $game_party.add_actor(actor_id)
  537.               ExDebugData.sort_party_by_id if AddPartyAutoSort
  538.             end
  539.             redraw_current_item
  540.           end
  541.         else
  542.           update_battler_value(actor, symbol)
  543.         end
  544.       end
  545.     end
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ○ トループモード時の更新
  549.   #--------------------------------------------------------------------------
  550.   def update_troop_mode
  551.     enemy_index = current_id / 10
  552.     if index >= EnemyStatusString.size
  553.       trigger_buzzer(:enter)
  554.     else
  555.       enemy = $game_troop.members[enemy_index]
  556.       symbol = EnemyStatusSymbol[index]
  557.       if enemy.respond_to?(symbol)
  558.         if [:states].include?(symbol)
  559.           update_battler_setup_details(enemy, symbol)
  560.         else
  561.           update_battler_value(enemy, symbol)
  562.         end
  563.       end
  564.     end
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ○ アイテムモード時の更新
  568.   #--------------------------------------------------------------------------
  569.   def update_items_mode(data)
  570.     if current_id >= data.size
  571.       trigger_buzzer(:direction)
  572.     else
  573.       last_num = $game_party.item_number(data[current_id])
  574.       value = update_value_input(last_num)
  575.       if last_num != value
  576.         $game_party.gain_item(data[current_id], value - last_num)
  577.         Sound.play_cursor
  578.         redraw_current_item
  579.       end
  580.     end
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ○ システムモード時の更新
  584.   #--------------------------------------------------------------------------
  585.   def update_system_mode
  586.     if current_id >= SystemStatusSymbol.size
  587.       trigger_buzzer(:enter)
  588.     else
  589.       if Input.trigger?(:C)
  590.         Sound.play_ok
  591.         symbol = SystemStatusSymbol[current_id]
  592.         $game_system.send(symbol.to_s + "=", !$game_system.send(symbol))
  593.         redraw_current_item
  594.       end
  595.     end
  596.   end
  597.   #--------------------------------------------------------------------------
  598.   # ○ アクター,トループモード時の共通処理:値の更新
  599.   #--------------------------------------------------------------------------
  600.   def update_battler_value(battler, symbol)
  601.     value = update_value_input(battler.send(symbol))
  602.     if battler.send(symbol) != value
  603.       if [:level, :exp].include?(symbol)
  604.         ExDebugData.send("update_status_mode_#{symbol}", battler, value)
  605.         Sound.play_cursor
  606.         refresh
  607.       else
  608.         battler.send(symbol.to_s + "=", value)
  609.         Sound.play_cursor
  610.         redraw_current_item
  611.       end
  612.     end
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ○ アクター,トループモード時の共通処理:詳細ウィンドウのセットアップ
  616.   #--------------------------------------------------------------------------
  617.   def update_battler_setup_details(battler, symbol)
  618.     if Input.trigger?(:C)
  619.       Sound.play_ok
  620.       @details_window.setup(symbol, battler)
  621.       deactivate
  622.     end
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # ○ 詳細ウィンドウの設定
  626.   #-------------------------------------------------------------------------
  627.   def details_window=(details_window)
  628.     @details_window = details_window
  629.   end
  630. end

  631. #==============================================================================
  632. # ■ Window_DebugDetails
  633. #------------------------------------------------------------------------------
  634. #    デバッグメニューのパラメータの詳細を表示します。
  635. #    アクター項目、トループ項目で使用されます。
  636. #==============================================================================
  637. class Window_DebugDetails < Window_Selectable
  638.   #--------------------------------------------------------------------------
  639.   # ○ インクルード
  640.   #--------------------------------------------------------------------------
  641.   include YakiNori::BaseExModules::ExDebugData::Const
  642.   #--------------------------------------------------------------------------
  643.   # ○ オブジェクト初期化
  644.   #-------------------------------------------------------------------------
  645.   def initialize
  646.     super(0, 0, Graphics.width, fitting_height(visible_line_number))
  647.     deactivate
  648.     self.openness = 0
  649.     self.back_opacity += 32 if RGSS[3]
  650.     @mode = nil
  651.     @battler = nil
  652.     @data_class_id = 0
  653.     @data_add_params = []
  654.     @data_states_id = []
  655.     @data_skills_id = []
  656.     select(0)
  657.     refresh
  658.   end
  659.   #--------------------------------------------------------------------------
  660.   # ○ 表示行数の取得
  661.   #--------------------------------------------------------------------------
  662.   def visible_line_number
  663.     [(item_max / col_max.to_f).ceil, 10.35].min
  664.   end
  665.   #--------------------------------------------------------------------------
  666.   # ○ 項目数の取得
  667.   #--------------------------------------------------------------------------
  668.   def item_max
  669.     case @mode
  670.     when :class_id
  671.       $data_classes.size - 1
  672.     when :states
  673.       $data_states.size - 1
  674.     when :skills
  675.       $data_skills.size - 1
  676.     when :param_plus
  677.       $data_system.terms.params.size
  678.     else
  679.       return 1
  680.     end
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ○ 桁数の取得
  684.   #--------------------------------------------------------------------------
  685.   def col_max
  686.     return @mode == :param_plus ? 1 : 3
  687.   end
  688.   #--------------------------------------------------------------------------
  689.   # ○ 横に項目が並ぶときの空白の幅を取得
  690.   #--------------------------------------------------------------------------
  691.   def spacing
  692.     return 8
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ○ 決定処理の有効状態を取得
  696.   #--------------------------------------------------------------------------
  697.   def ok_enabled?
  698.     @mode != :param_plus && !@mode.nil?
  699.   end
  700.   #--------------------------------------------------------------------------
  701.   # ○ 決定ボタンが押されたときの処理
  702.   #--------------------------------------------------------------------------
  703.   def process_ok
  704.     case @mode
  705.     when :class_id
  706.       if @data_class_id != current_class_id
  707.         last_class_id = @data_class_id
  708.         @data_class_id = current_class_id
  709.         redraw_item(last_class_id - 1)
  710.       end
  711.     when :states
  712.       if @data_states_id.include?(current_state_id)
  713.         @data_states_id.delete(current_state_id)
  714.       else
  715.         @data_states_id.push(current_state_id)
  716.       end
  717.     when :skills
  718.       if @data_skills_id.include?(current_skill_id)
  719.         @data_skills_id.delete(current_skill_id)
  720.       else
  721.         @data_skills_id.push(current_skill_id)
  722.       end
  723.     end
  724.     redraw_item(index)
  725.    
  726.     Sound.play_ok
  727.     Input.update
  728.     call_ok_handler
  729.   end
  730.   #--------------------------------------------------------------------------
  731.   # ○ キャンセルボタンが押されたときの処理
  732.   #--------------------------------------------------------------------------
  733.   def process_cancel
  734.     case @mode
  735.     when :class_id
  736.       if @battler.class_id != @data_class_id
  737.         @battler.change_class(@data_class_id, TransferEXP)
  738.       end
  739.     when :states
  740.       states_id = @battler.states.collect {|state| state.id}
  741.       if states_id.sort != @data_states_id.sort
  742.         @battler.clear_states
  743.         @data_states_id.each {|state_id| @battler.add_state(state_id)}
  744.       end
  745.     when :skills
  746.       skills_id = @battler.skills.collect {|skill| skill.id}
  747.       if skills_id.sort != @data_skills_id.sort
  748.         @battler.skills.each {|skill| @battler.forget_skill(skill.id)}
  749.         @data_skills_id.each {|skill_id| @battler.learn_skill(skill_id)}
  750.       end
  751.     when :param_plus
  752.       params = get_add_params_data(@battler)
  753.       if params != @data_add_params
  754.         @data_add_params.each_with_index do |value, id|
  755.           @battler.add_param(id, value - params[id])
  756.         end
  757.       end
  758.     end
  759.     super
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   # ○ 項目の描画
  763.   #--------------------------------------------------------------------------
  764.   def draw_item(index)
  765.     return if @mode.nil?
  766.     rect = item_rect_for_text(index)
  767.     data_index = index + 1
  768.     text = ""
  769.     enabled = true
  770.     case @mode
  771.     when :class_id
  772.       enabled = @data_class_id == data_index
  773.       text = $data_classes[data_index].name
  774.     when :states
  775.       enabled = @data_states_id.include?(data_index)
  776.       draw_icon($data_states[data_index].icon_index, rect.x, rect.y, enabled)
  777.       rect.x += 24
  778.       rect.width -= 24
  779.       text = $data_states[data_index].name
  780.     when :skills
  781.       enabled = @data_skills_id.include?(data_index)
  782.       draw_icon($data_skills[data_index].icon_index, rect.x, rect.y, enabled)
  783.       rect.x += 24
  784.       rect.width -= 24
  785.       text = $data_skills[data_index].name
  786.     when :param_plus
  787.       return if @battler.nil?
  788.       
  789.       text = $data_system.terms.params[index]
  790.       text += " " while text.size < 6
  791.       base = @battler.param_base(index)
  792.       equip = @battler.equips.compact.inject(0) {|r, v| r += v.params[index] }
  793.       add = @data_add_params[index]
  794.       total = [base + equip + add, @battler.param_min(index)].max
  795.       total = [total, @battler.param_max(index)].min
  796.       text += total.to_s
  797.       text += " = base:" + base.to_s
  798.       text += " + equip:" + equip.to_s
  799.       text += " + grow:" + add.to_s
  800.     end
  801.     change_color(normal_color, enabled)
  802.     draw_text(rect, text)
  803.   end
  804.   #--------------------------------------------------------------------------
  805.   # ○ 選択中 ID の取得
  806.   #--------------------------------------------------------------------------
  807.   def current_id
  808.     index + 1
  809.   end
  810.   #--------------------------------------------------------------------------
  811.   # ○ 選択中 ステートID の取得
  812.   #--------------------------------------------------------------------------
  813.   def current_state_id
  814.     $data_states[current_id].id
  815.   end
  816.   #--------------------------------------------------------------------------
  817.   # ○ 選択中 職業ID の取得
  818.   #--------------------------------------------------------------------------
  819.   def current_class_id
  820.     $data_classes[current_id].id
  821.   end
  822.   #--------------------------------------------------------------------------
  823.   # ○ 選択中スキルID の取得
  824.   #--------------------------------------------------------------------------
  825.   def current_skill_id
  826.     $data_skills[current_id].id
  827.   end
  828.   #--------------------------------------------------------------------------
  829.   # ○ フレーム更新
  830.   #--------------------------------------------------------------------------
  831.   def update
  832.     super
  833.     update_input_reset
  834.     update_input_param if @mode == :param_plus
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ○ 加算能力値の更新
  838.   #--------------------------------------------------------------------------
  839.   def update_input_reset
  840.     if Input.trigger?(:X)
  841.       Sound.play_cancel
  842.       reset_data(@battler)
  843.     end
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # ○ 加算能力値の更新
  847.   #--------------------------------------------------------------------------
  848.   def update_input_param
  849.     add = 0
  850.     rate = Input.press?(MultiplyRateInput) ? MultiplyRateNum : 1
  851.     add += 1  * rate if Input.repeat?(:RIGHT)
  852.     add -= 1  * rate if Input.repeat?(:LEFT)
  853.     add += 10 * rate if Input.repeat?(:R)
  854.     add -= 10 * rate if Input.repeat?(:L)
  855.     if !add.zero?
  856.       Sound.play_cursor
  857.       @data_add_params[index] += add
  858.       redraw_item(index)
  859.     end
  860.   end
  861.   #--------------------------------------------------------------------------
  862.   # ○ セットアップ
  863.   #--------------------------------------------------------------------------
  864.   def setup(mode, battler)
  865.     @mode = mode
  866.     self.height = fitting_height(visible_line_number)
  867.     create_contents
  868.     reset_data(battler)
  869.     select(0)
  870.     show.activate.open
  871.   end
  872.   #--------------------------------------------------------------------------
  873.   # ○ 編集データのリセット
  874.   #--------------------------------------------------------------------------
  875.   def reset_data(battler)
  876.     actor_data(battler) if battler.is_a?(Game_Actor)
  877.     enemy_data(battler) if battler.is_a?(Game_Enemy)
  878.     refresh
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # ○ アクターの設定
  882.   #--------------------------------------------------------------------------
  883.   def actor_data(actor)
  884.     @battler = actor
  885.     @data_class_id  = actor ? actor.class_id : 0
  886.     @data_states_id = actor ? actor.states.collect {|state| state.id} : []
  887.     @data_skills_id = actor ? actor.skills.collect {|skill| skill.id} : []
  888.     @data_add_params = get_add_params_data(actor) if actor
  889.   end
  890.   #--------------------------------------------------------------------------
  891.   # ○ エネミーの設定
  892.   #--------------------------------------------------------------------------
  893.   def enemy_data(enemy)
  894.     @battler = enemy
  895.     @data_class_id  = 0
  896.     @data_states_id = enemy ? enemy.states.collect {|state| state.id} : []
  897.     @data_skills_id = []
  898.     @data_add_params = get_add_params_data(enemy) if enemy
  899.   end
  900.   #--------------------------------------------------------------------------
  901.   # ○ 通常能力値の加算値の取得
  902.   #--------------------------------------------------------------------------
  903.   def get_add_params_data(battler)
  904.     prms = $data_system.terms.params
  905.     equips = battler.equips.compact
  906.     prms.collect do |prm|
  907.       param_id = prms.index(prm)
  908.       equip_param = equips.inject(0) {|r, item| r += item.params[param_id] }
  909.       battler.param_plus(param_id) - equip_param
  910.     end
  911.   end
  912. end

  913. #==============================================================================
  914. # ■ Window_DebugNumber
  915. #------------------------------------------------------------------------------
  916. #    デバッグメニューでの値の表示,設定をします。
  917. #==============================================================================
  918. class Window_DebugNumber < Window_NumberInput
  919.   #--------------------------------------------------------------------------
  920.   # ○ オブジェクト初期化
  921.   #--------------------------------------------------------------------------
  922.   def initialize
  923.     super(nil)
  924.     @category_window = nil
  925.     @process_ok_method = nil
  926.     @process_cancel_method = nil
  927.   end
  928.   #--------------------------------------------------------------------------
  929.   # ○ 入力処理の開始
  930.   #--------------------------------------------------------------------------
  931.   def start(number, max_number)
  932.     @digits_max = max_number.to_s.size
  933.     @number = number
  934.     @number = [[@number, 0].max, 10 ** @digits_max - 1].min
  935.     @index = 0
  936.     update_placement
  937.     create_contents
  938.     refresh
  939.     activate.open
  940.   end
  941.   #--------------------------------------------------------------------------
  942.   # ○ ウィンドウ位置の更新
  943.   #--------------------------------------------------------------------------
  944.   def update_placement
  945.     self.width = @digits_max * 20 + padding * 2
  946.     self.height = fitting_height(1)
  947.     self.x = Graphics.width - width
  948.     self.y = @category_window.y - height
  949.   end
  950.   #--------------------------------------------------------------------------
  951.   # ○ 決定ボタンが押されたときの処理
  952.   #--------------------------------------------------------------------------
  953.   def process_ok
  954.     Sound.play_ok
  955.     @process_ok_method.call(@number) if @process_ok_method
  956.   end
  957.   #--------------------------------------------------------------------------
  958.   # ○ キャンセルボタンが押されたときの処理
  959.   #--------------------------------------------------------------------------
  960.   def process_cancel
  961.     Sound.play_cancel
  962.     @process_cancel_method.call(@number) if @process_ok_method
  963.   end
  964.   #--------------------------------------------------------------------------
  965.   # ○ カテゴリーウィンドウの設定
  966.   #--------------------------------------------------------------------------
  967.   def category_window=(window)
  968.     @category_window = window
  969.   end
  970.   #--------------------------------------------------------------------------
  971.   # ○ 決定ボタンが押されたときに実行するメソッドの設定
  972.   #--------------------------------------------------------------------------
  973.   def set_process_ok_method=(method)
  974.     @process_ok_method = method
  975.   end
  976.   #--------------------------------------------------------------------------
  977.   # ○ キャンセルボタンが押されたときに実行するメソッドの設定
  978.   #--------------------------------------------------------------------------
  979.   def set_process_cancel_method=(method)
  980.     @process_cancel_method = method
  981.   end
  982. end

  983. #==============================================================================
  984. # ■ Scene_Debug
  985. #==============================================================================
  986. class Scene_Debug < Scene_MenuBase
  987.   #--------------------------------------------------------------------------
  988.   # ◎ 全ウィンドウの作成
  989.   #--------------------------------------------------------------------------
  990.   alias yknr_Scene_DebugExDebugCstmScene_create_all_window :create_all_window
  991.   def create_all_window
  992.     yknr_Scene_DebugExDebugCstmScene_create_all_window
  993.     create_details_window
  994.     create_number_window
  995.   end
  996.   #--------------------------------------------------------------------------
  997.   # ○ 詳細ウィンドウの作成
  998.   #--------------------------------------------------------------------------
  999.   def create_details_window
  1000.     @details_window = Window_DebugDetails.new
  1001.     @details_window.set_handler(:cancel, method(:on_states_cancel))
  1002.     @right_window.details_window = @details_window
  1003.   end
  1004.   #--------------------------------------------------------------------------
  1005.   # ○ 値操作ウィンドウの作成
  1006.   #--------------------------------------------------------------------------
  1007.   def create_number_window
  1008.     @number_window = Window_DebugNumber.new
  1009.     @number_window.set_process_ok_method = method(:on_number_ok)
  1010.     @number_window.set_process_cancel_method = method(:on_number_cancel)
  1011.     @number_window.category_window = @category_window
  1012.   end
  1013.   #--------------------------------------------------------------------------
  1014.   # ○ 詳細[キャンセル]
  1015.   #--------------------------------------------------------------------------
  1016.   def on_states_cancel
  1017.     @details_window.deactivate.close
  1018.     @right_window.refresh
  1019.     @right_window.activate
  1020.   end
  1021.   #--------------------------------------------------------------------------
  1022.   # ○ 値操作[決定]
  1023.   #--------------------------------------------------------------------------
  1024.   def on_number_ok(number)
  1025.     case @category_window.current_symbol
  1026.     when :gold
  1027.       $game_party.gain_gold(number - $game_party.gold)
  1028.     end
  1029.     @category_window.activate
  1030.     @number_window.deactivate.close
  1031.   end
  1032.   #--------------------------------------------------------------------------
  1033.   # ○ 値操作[キャンセル]
  1034.   #--------------------------------------------------------------------------
  1035.   def on_number_cancel(number)
  1036.     @category_window.activate
  1037.     @number_window.deactivate.close
  1038.   end
  1039.   #--------------------------------------------------------------------------
  1040.   # ◎ カテゴリー[決定]
  1041.   #--------------------------------------------------------------------------
  1042.   alias yknr_Scene_DebugExDebugCstmScene_on_category_ok :on_category_ok
  1043.   def on_category_ok
  1044.     case @category_window.current_symbol
  1045.     when :gold
  1046.       @category_window.deactivate
  1047.       @number_window.start($game_party.gold, $game_party.max_gold)
  1048.     else
  1049.       yknr_Scene_DebugExDebugCstmScene_on_category_ok
  1050.     end
  1051.   end
  1052. end

  1053. end # $YkNr_Scripts
复制代码

img3.jpg
Code Crush
  1. #==============================================================================
  2. # ■ VXAce-RGSS-44 デバッグ++ [Ver.1.1.0]             by Claimh
  3. #------------------------------------------------------------------------------
  4. =begin
  5. デバッグ画面の機能拡張をします。

  6. [追加機能]
  7. ・セルフスイッチの操作(現在マップ上の全イベント)
  8. ・アイテム/武器/防具の所持数変更
  9. ・パーティー変更
  10. ・アクター編集
  11.   - ステータス編集
  12.   - スキルの習得・忘却
  13. ・マップ移動(移動地点の指定も可能)
  14. ・音楽再生(BGM/BGS/ME/SE)
  15. ・その他情報操作
  16.   - 所持金、セーブ回数、戦闘回数の変更
  17.   - セーブ禁止、メニュー禁止、エンカウント禁止、並び替え禁止の操作
  18.   - 天候の操作
  19.   - 解像度の変更

  20. [他スクリプトとの連動機能]
  21. ・熟練度システム
  22.   - 熟練度レベル変更、得意属性・不得意属性の操作
  23. ・用語辞典
  24.   - 全初期化、表示設定変更
  25. ・ワールドマップ
  26.   - 全初期化、表示設定変更
  27. ・クエストシステム
  28.   - 全初期化、クエスト状態変更、クエストランク変更
  29. ・精霊システム
  30.   - 精霊の加入状態の変更、精霊のステータス編集
  31. =end
  32. #==============================================================================

  33. module DebugPP
  34.   # 項目有効/無効
  35.   SPEC = {
  36.     "スイッチ"     => true,
  37.     "変数"         => true,
  38.     "セルフSW"     => true,
  39.     "アイテム"     => true,
  40.     "武器"         => true,
  41.     "防具"         => true,
  42.     "パーティー"   => true,
  43.     "ステータス"   => true,
  44.     "スキル"       => true,
  45.     "MAP移動"      => true,
  46.     "ミュージック" => true,
  47.     "システム"     => true,
  48.     "熟練度"       => true,  # 「熟練度システム」未導入時は無効化される
  49.     "用語辞典"     => true,  # 「用語辞典」未導入時は無効化される
  50.     "WorldMap"     => true,  # 「ワールドマップ」未導入時は無効化される
  51.     "クエスト"     => true,  # 「クエストシステム」未導入時は無効化される
  52.     "精霊"         => true,  # 「精霊システム」未導入時は無効化される
  53.   }

  54.   # MAP移動時の位置(設定無し時は中央)
  55.   MAP = {
  56.    # マップID => [x座標, y座標]
  57.    1 => [5, 5],
  58.    3 => [10, 5]
  59.   }

  60.   # ミュージックでRTPも含む
  61.   RTP_MUSIC = true
  62. end


  63. module DebugPP
  64.   # DebugPP.spec(n)
  65.   def self.spec(n)
  66.     return false if SPEC[n].nil?
  67.     SPEC[n]
  68.   end
  69. end


  70. class Game_System
  71.   #--------------------------------------------------------------------------
  72.   # ● 公開インスタンス変数
  73.   #--------------------------------------------------------------------------
  74.   attr_writer   :save_count               # セーブ回数
  75. end


  76. #==============================================================================
  77. # ■ Window_DebugCommand
  78. #==============================================================================
  79. class Window_DebugCommand < Window_Command
  80.   #--------------------------------------------------------------------------
  81.   # ● オブジェクト初期化
  82.   #--------------------------------------------------------------------------
  83.   def initialize(height)
  84.     @window_height = height
  85.     super(0, 0)
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● ウィンドウ高さの取得
  89.   #--------------------------------------------------------------------------
  90.   def window_height
  91.     h = super
  92.     h > @window_height ? @window_height : h
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 表示行数の取得
  96.   #--------------------------------------------------------------------------
  97.   def visible_line_number
  98.     n = (@window_height - standard_padding * 2) / item_height
  99.     n > item_max ? item_max : n
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● コマンドリストの作成
  103.   #--------------------------------------------------------------------------
  104.   def make_command_list
  105.     add_main_commands
  106.     add_original_commands
  107.     add_command("システム",     :ok, true, system_text)   if DebugPP.spec("システム")
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 主要コマンドをリストに追加
  111.   #      ハンドラは全て:okで登録する
  112.   #--------------------------------------------------------------------------
  113.   def add_main_commands
  114.     add_command("スイッチ",     :ok, true, switch_text)   if DebugPP.spec("スイッチ")
  115.     add_command("変数",         :ok, true, variable_text) if DebugPP.spec("変数")
  116.     add_command("セルフSW",     :ok, true, self_sw_text)  if DebugPP.spec("セルフSW")
  117.     add_command(Vocab::item,    :ok, true, item_text)     if DebugPP.spec("アイテム")
  118.     add_command(Vocab::weapon,  :ok, true, weapon_text)   if DebugPP.spec("武器")
  119.     add_command(Vocab::armor,   :ok, true, armor_text)    if DebugPP.spec("防具")
  120.     add_command("パーティー",   :ok, true, party_text)    if DebugPP.spec("パーティー")
  121.     add_command(Vocab::status,  :ok, true, actor_text)    if DebugPP.spec("ステータス")
  122.     add_command(Vocab::skill,   :ok, true, skill_text)    if DebugPP.spec("スキル")
  123.     add_command("MAP移動",      :ok, true, map_text)      if DebugPP.spec("MAP移動")
  124.     add_command("ミュージック", :ok, true, music_text)    if DebugPP.spec("ミュージック")
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 独自コマンドの追加用
  128.   #--------------------------------------------------------------------------
  129.   def add_original_commands
  130.     add_command("熟練度",       :ok, true, expert_text)     if defined?(SysUpdate)  and DebugPP.spec("熟練度")
  131.     add_command("用語辞典",     :ok, true, dictionary_text) if defined?(Dictionary) and DebugPP.spec("用語辞典")
  132.     add_command("World Map",    :ok, true, world_map_text)  if defined?(WorldMap)   and DebugPP.spec("WorldMap")
  133.     add_command("クエスト",     :ok, true, quest_text)      if defined?(Quest)      and DebugPP.spec("クエスト")
  134.     add_command("精霊",         :ok, true, spirit_text)     if defined?(Spirits)    and DebugPP.spec("精霊")
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 説明文
  138.   #--------------------------------------------------------------------------
  139.   def switch_text
  140.     ["スイッチの状態を変更します。", "C (Enter) : ON / OFF"]
  141.   end
  142.   def variable_text
  143.     ["変数の値を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
  144.   end
  145.   def self_sw_text
  146.     ["セルフスイッチの状態を変更します。", "C (Enter) : ON / OFF"]
  147.   end
  148.   def item_text
  149.     ["アイテムの所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
  150.   end
  151.   def weapon_text
  152.     ["武器の所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
  153.   end
  154.   def armor_text
  155.     ["防具の所持数を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
  156.   end
  157.   def party_text
  158.     ["加入メンバーを変更します。", "C (Enter) : 加入 / 脱退"]
  159.   end
  160.   def actor_text
  161.     ["アクターのステータスを変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動"]
  162.   end
  163.   def skill_text
  164.     ["アクターの習得スキルを変更します。", "C (Enter) : 習得 / 忘却"]
  165.   end
  166.   def map_text
  167.     ["マップを移動します。", "C (Enter) : 移動"]
  168.   end
  169.   def music_text
  170.     ["音楽を変更します。", "C (Enter) : 再生 / Y : 停止 / X : MAP音復帰"]
  171.   end
  172.   def system_text
  173.     ["その他、色々変更します。", "C (Enter) : 変更"]
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ● 説明文(拡張)
  177.   #--------------------------------------------------------------------------
  178.   def expert_text
  179.     ["アクターの熟練度を変更します。", "↑ : +1 / ↓ : +1 / ⇔ 桁移動 / X : 好み変更"]
  180.   end
  181.   def dictionary_text
  182.     ["用語の表示状態を変更します。", "C (Enter) : ON / OFF"]
  183.   end
  184.   def world_map_text
  185.     ["場所の表示状態を変更します。", "X : Region / C (Enter) : Town --> ON / OFF"]
  186.   end
  187.   def quest_text
  188.     ["クエストの状態を変更します。", "C (Enter) : 変更"]
  189.   end
  190.   def spirit_text
  191.     ["精霊の加入状態を変更します。", "C (Enter) : 加入 / 脱退"]
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # ● ヘルプウィンドウの更新
  195.   #--------------------------------------------------------------------------
  196.   def update_help
  197.     call_handler(:update)
  198.     ext = current_ext
  199.     text = ext.nil? ? "" : (ext[0] + "\n" + ext[1])
  200.     @help_window.set_text(text)
  201.   end
  202. end


  203. #==============================================================================
  204. # ■ Window_DebugInputNum
  205. #==============================================================================
  206. class Window_DebugInputNum < Window_HorzCommand
  207.   #--------------------------------------------------------------------------
  208.   # ● 公開インスタンス変数
  209.   #--------------------------------------------------------------------------
  210.   attr_reader    :item_window
  211.   attr_accessor  :max
  212.   attr_accessor  :min
  213.   attr_accessor  :sign
  214.   #--------------------------------------------------------------------------
  215.   # ● オブジェクト初期化
  216.   #--------------------------------------------------------------------------
  217.   def initialize(rect, num=0)
  218.     @num_max = 8
  219.     @num = []
  220.     @max = 99999999
  221.     @sign = false
  222.     @pm_sign = true
  223.     @min = 0
  224.     super(rect.x, rect.y)
  225.     area(rect)
  226.     self.num = num
  227.     deactivate.hide
  228.   end
  229.   #--------------------------------------------------------------------------
  230.   # ● エリア変更
  231.   #--------------------------------------------------------------------------
  232.   def area(rect)
  233.     @area = rect
  234.     self.x = @area.x + (@area.width  - window_width ) / 2
  235.     self.y = @area.y + (@area.height - window_height) / 2
  236.     self
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● 項目数変更(Windowサイズ更新)
  240.   #--------------------------------------------------------------------------
  241.   def num_max=(n)
  242.     return if n == @num_max or n == 0
  243.     @num_max = n
  244.     self.x = @area.x + (@area.width  - window_width ) / 2
  245.     self.width = window_width
  246.     create_contents
  247.     clac_maxmin
  248.     self.num = 0
  249.     unselect
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● 数字更新
  253.   #--------------------------------------------------------------------------
  254.   def num=(n)
  255.     @num.clear
  256.     @pm_sign = (n >= 0) if @sign
  257.     n = n.abs
  258.     @num_max.times do |i|
  259.       @num[@num_max-1-i] = n % 10
  260.       n = (n / 10).truncate
  261.     end
  262.     refresh
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 最大値計算
  266.   #--------------------------------------------------------------------------
  267.   def clac_maxmin
  268.     @max = @min = 0
  269.     @num_max.times {|i| @max += 9 * exp(i)}
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ● 10のべき乗計算
  273.   #--------------------------------------------------------------------------
  274.   def exp(n)
  275.     r = 1
  276.     n.times {|i| r *= 10}
  277.     r
  278.   end
  279.   #--------------------------------------------------------------------------
  280.   # ● 数字
  281.   #--------------------------------------------------------------------------
  282.   def num
  283.     r = 0
  284.     @num_max.times {|i| r += @num[@num_max-1-i] * exp(i)}
  285.     r *= -1 if @sign and !@pm_sign
  286.     r
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # ● 項目の幅を取得
  290.   #--------------------------------------------------------------------------
  291.   def item_width
  292.     15
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● ウィンドウ幅の取得
  296.   #--------------------------------------------------------------------------
  297.   def window_width
  298.     (item_width + spacing) * col_max + standard_padding * 2
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # ● 桁数の取得
  302.   #--------------------------------------------------------------------------
  303.   def col_max
  304.     @sign ? (@num_max + 1) : @num_max
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # ● 符号除くindex
  308.   #--------------------------------------------------------------------------
  309.   def s_index(index = @index)
  310.     @sign ? (index-1) : index
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # ● 横に項目が並ぶときの空白の幅を取得
  314.   #--------------------------------------------------------------------------
  315.   def spacing
  316.     2
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # ● 終端選択
  320.   #--------------------------------------------------------------------------
  321.   def select_last
  322.     select(col_max - 1)
  323.     self
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● カーソルを下に移動
  327.   #--------------------------------------------------------------------------
  328.   def cursor_down(wrap = false)
  329.     if @sign and @index == 0
  330.       @pm_sign = !@pm_sign
  331.     else
  332.       @num[s_index] = (@num[s_index] + 10 - 1) % 10
  333.     end
  334.     redraw_current_item
  335.     Sound.play_cursor
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # ● カーソルを上に移動
  339.   #--------------------------------------------------------------------------
  340.   def cursor_up(wrap = false)
  341.     if @sign and @index == 0
  342.       @pm_sign = !@pm_sign
  343.     else
  344.       @num[s_index] = (@num[s_index] + 1) % 10
  345.     end
  346.     redraw_current_item
  347.     Sound.play_cursor
  348.   end
  349.   #--------------------------------------------------------------------------
  350.   # ● コマンドリストの作成
  351.   #--------------------------------------------------------------------------
  352.   def make_command_list
  353.     add_command(0, :sign) if @sign
  354.     @num_max.times {|i| add_command(0, :num)}
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   # ● 選択項目の有効状態を取得
  358.   #--------------------------------------------------------------------------
  359.   def current_item_enabled?
  360.     n = self.num
  361.     n >= @min and n <= @max
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ● 背景色 1 の取得
  365.   #--------------------------------------------------------------------------
  366.   def back_color
  367.     Color.new(0, 0, 0, 64)
  368.   end
  369.   #--------------------------------------------------------------------------
  370.   # ● 背景の描画
  371.   #--------------------------------------------------------------------------
  372.   def draw_back(rect)
  373.     contents.fill_rect(rect, back_color)
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 項目の描画
  377.   #--------------------------------------------------------------------------
  378.   def draw_item(index)
  379.     rect = item_rect(index)
  380.     draw_back(rect)
  381.     change_color(normal_color, command_enabled?(index))
  382.     if @sign and index == 0
  383.       draw_text(rect, (@pm_sign ? " " : "-"), 2)
  384.     else
  385.       draw_text(rect, @num[s_index(index)], 2)
  386.     end
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ● アイテムウィンドウの設定
  390.   #--------------------------------------------------------------------------
  391.   def item_window=(item_window)
  392.     @item_window = item_window
  393.     n = item_window.nil? ? 0 : item_window.num_max
  394.     s = item_window.nil? ? false : item_window.sign
  395.     if @sign != s
  396.       @num_max = 0
  397.       @sign = s
  398.     end
  399.     self.num_max = n
  400.     update
  401.   end
  402. end


  403. #==============================================================================
  404. # ■ Window_DebugBase
  405. #==============================================================================
  406. class Window_DebugBase < Window_Selectable
  407.   #--------------------------------------------------------------------------
  408.   # ● オブジェクト初期化
  409.   #--------------------------------------------------------------------------
  410.   def initialize(rect)
  411.     @max_n = max_n
  412.     super(rect.x, rect.y, rect.width, rect.height)
  413.     refresh
  414.     deactivate.hide
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ● 決定やキャンセルなどのハンドリング処理
  418.   #--------------------------------------------------------------------------
  419.   def process_handling
  420.     return unless open? && active
  421.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  422.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  423.     return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
  424.     return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)
  425.     return process_a        if handle?(:a)        && Input.trigger?(:A)
  426.     return process_x        if handle?(:x)        && Input.trigger?(:X)
  427.   end
  428.   def process_a
  429.     Sound.play_ok
  430.     call_handler(:a)
  431.   end
  432.   def process_x
  433.     Sound.play_ok
  434.     call_handler(:x)
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ● カーソルを右に移動
  438.   #--------------------------------------------------------------------------
  439.   def cursor_right(wrap = false)
  440.     if col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?))
  441.       select((index + 1) % item_max)
  442.     elsif col_max == 1 && index >= 0
  443.       if (index + 100) > (item_max - 1)
  444.         select(item_max - 1)
  445.       else
  446.         select((index + 100) % item_max)
  447.       end
  448.     end
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ● カーソルを左に移動
  452.   #--------------------------------------------------------------------------
  453.   def cursor_left(wrap = false)
  454.     if col_max >= 2 && (index > 0 || (wrap && horizontal?))
  455.       select((index - 1 + item_max) % item_max)
  456.     elsif col_max == 1 && index >= 0
  457.       if (index - 100) < 0
  458.         select(0)
  459.       else
  460.         select((index - 100 + item_max) % item_max)
  461.       end
  462.     end
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● 項目数の取得
  466.   #--------------------------------------------------------------------------
  467.   def item_max
  468.     0
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # ● 選択項目の有効状態を取得
  472.   #--------------------------------------------------------------------------
  473.   def current_item_enabled?
  474.     !citem.nil?
  475.   end
  476.   #--------------------------------------------------------------------------
  477.   # ● IDの取得
  478.   #--------------------------------------------------------------------------
  479.   def id(i)
  480.     i + 1
  481.   end
  482.   def cid; id(@index); end
  483.   #--------------------------------------------------------------------------
  484.   # ● アイテムの取得
  485.   #--------------------------------------------------------------------------
  486.   def item(i)
  487.     nil
  488.   end
  489.   def citem; item(@index); end
  490.   #--------------------------------------------------------------------------
  491.   # ● アイテム名の取得
  492.   #--------------------------------------------------------------------------
  493.   def name(i)
  494.     ""
  495.   end
  496.   def cname; name(@index); end
  497.   #--------------------------------------------------------------------------
  498.   # ● アイテム状態の取得
  499.   #--------------------------------------------------------------------------
  500.   def status(i)
  501.     item(i)
  502.   end
  503.   def cstatus; status(@index); end
  504.   #--------------------------------------------------------------------------
  505.   # ● ステータステキスト
  506.   #--------------------------------------------------------------------------
  507.   def status_text(i)
  508.     status(i) ? "[ON]" : "[OFF]"
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● 名前の描画
  512.   #--------------------------------------------------------------------------
  513.   def draw_index_name(rect, index)
  514.     draw_text(rect, name(index))
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● ステータスの描画
  518.   #--------------------------------------------------------------------------
  519.   def draw_index_status(rect, index)
  520.     draw_text(rect, status_text(index), 2)
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # ● 項目の描画     id : name
  524.   #--------------------------------------------------------------------------
  525.   def draw_item_id_name(index)
  526.     id_text = sprintf("%04d:", id(index))
  527.     id_width = text_size(id_text).width
  528.     rect = item_rect_for_text(index)
  529.    
  530.     change_color(normal_color)
  531.     draw_text(rect, id_text)
  532.    
  533.     rect.x += id_width
  534.     rect.width -= id_width + 60
  535.     draw_index_name(rect, index)
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # ● 項目の描画     id : name    [ON/OFF]
  539.   #--------------------------------------------------------------------------
  540.   def draw_item_id_name_sw(index)
  541.     id_text = sprintf("%04d:", id(index))
  542.     id_width = text_size(id_text).width
  543.     rect = item_rect_for_text(index)
  544.    
  545.     change_color(normal_color)
  546.     draw_text(rect, id_text)
  547.    
  548.     rect.x += id_width
  549.     rect.width -= id_width + 60
  550.     draw_index_name(rect, index)
  551.    
  552.     rect.width += 60
  553.     draw_index_status(rect, index)
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● 項目の描画     id : name    num
  557.   #--------------------------------------------------------------------------
  558.   def draw_item_id_name_num(index)
  559.     id_text = sprintf("%04d:", id(index))
  560.     id_width = text_size(id_text).width
  561.     rect = item_rect_for_text(index)
  562.    
  563.     change_color(normal_color)
  564.     draw_text(rect, id_text)
  565.    
  566.     rect.x += id_width
  567.     rect.width -= id_width + 60
  568.     draw_index_name(rect, index)
  569.    
  570.     rect.width += 60
  571.     draw_text(rect, number(index), 2)
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # ● 数値の最大桁数取得
  575.   #--------------------------------------------------------------------------
  576.   def num_max
  577.     8
  578.   end
  579.   def max_n
  580.     num_max
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ● 数値の符号
  584.   #--------------------------------------------------------------------------
  585.   def sign
  586.     false
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ● アイテムの変更
  590.   #--------------------------------------------------------------------------
  591.   def change(n=0)
  592.   end
  593.   #--------------------------------------------------------------------------
  594.   # ● OK時の処理
  595.   #--------------------------------------------------------------------------
  596.   def ok
  597.     change
  598.     redraw_current_item
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # ● 数値の取得/設定
  602.   #--------------------------------------------------------------------------
  603.   def number(i=@index)
  604.     item(i)
  605.   end
  606.   def number=(n)
  607.     change(n)
  608.     redraw_current_item
  609.   end
  610. end

  611. #==============================================================================
  612. # ■ Window_DebugBaseCommand
  613. #==============================================================================
  614. class Window_DebugBaseCommand < Window_Command
  615.   #--------------------------------------------------------------------------
  616.   # ● オブジェクト初期化
  617.   #--------------------------------------------------------------------------
  618.   def initialize(rect)
  619.     @area = rect
  620.     super(rect.x, rect.y)
  621.     refresh
  622.     deactivate.hide.unselect
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # ● ウィンドウ幅の取得
  626.   #--------------------------------------------------------------------------
  627.   def window_width
  628.     @area.width
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # ● ウィンドウ高さの取得
  632.   #--------------------------------------------------------------------------
  633.   def window_height
  634.     @area.height
  635.   end
  636.   #--------------------------------------------------------------------------
  637.   # ● 決定やキャンセルなどのハンドリング処理
  638.   #--------------------------------------------------------------------------
  639.   def process_handling
  640.     return unless open? && active
  641.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  642.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  643.     return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
  644.     return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)
  645.     return process_a        if handle?(:a)        && Input.trigger?(:A)
  646.     return process_x        if handle?(:x)        && Input.trigger?(:X)
  647.   end
  648.   def process_a
  649.     Sound.play_ok
  650.     call_handler(:a)
  651.   end
  652.   def process_x
  653.     Sound.play_ok
  654.     call_handler(:x)
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ● カーソルを右に移動
  658.   #--------------------------------------------------------------------------
  659.   def cursor_right(wrap = false)
  660.     if col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?))
  661.       select((index + 1) % item_max)
  662.     elsif col_max == 1 && index >= 0
  663.       if (index + 100) > (item_max - 1)
  664.         select(item_max - 1)
  665.       else
  666.         select((index + 100) % item_max)
  667.       end
  668.     end
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # ● カーソルを左に移動
  672.   #--------------------------------------------------------------------------
  673.   def cursor_left(wrap = false)
  674.     if col_max >= 2 && (index > 0 || (wrap && horizontal?))
  675.       select((index - 1 + item_max) % item_max)
  676.     elsif col_max == 1 && index >= 0
  677.       if (index - 100) < 0
  678.         select(0)
  679.       else
  680.         select((index - 100 + item_max) % item_max)
  681.       end
  682.     end
  683.   end
  684.   #--------------------------------------------------------------------------
  685.   # ● 数値の最大桁数取得
  686.   #--------------------------------------------------------------------------
  687.   def num_max
  688.     0
  689.   end
  690.   #--------------------------------------------------------------------------
  691.   # ● 数値の符号
  692.   #--------------------------------------------------------------------------
  693.   def sign
  694.     false
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ● OK時の処理
  698.   #--------------------------------------------------------------------------
  699.   def ok
  700.     change
  701.     redraw_current_item
  702.   end
  703. end


  704. #==============================================================================
  705. # ■ Window_DebugBaseHorzCommand
  706. #==============================================================================
  707. class Window_DebugBaseHorzCommand < Window_HorzCommand
  708.   #--------------------------------------------------------------------------
  709.   # ● オブジェクト初期化
  710.   #--------------------------------------------------------------------------
  711.   def initialize(rect)
  712.     @window_width = rect.width
  713.     super(rect.x, rect.y)
  714.     refresh
  715.     deactivate.hide.unselect
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # ● 桁数の取得
  719.   #--------------------------------------------------------------------------
  720.   def col_max
  721.     item_max
  722.   end
  723.   #--------------------------------------------------------------------------
  724.   # ● ウィンドウ幅の取得
  725.   #--------------------------------------------------------------------------
  726.   def window_width
  727.     @window_width
  728.   end
  729.   #--------------------------------------------------------------------------
  730.   # ● 数値の最大桁数取得
  731.   #--------------------------------------------------------------------------
  732.   def num_max
  733.     0
  734.   end
  735.   #--------------------------------------------------------------------------
  736.   # ● 数値の符号
  737.   #--------------------------------------------------------------------------
  738.   def sign
  739.     false
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # ● OK時の処理
  743.   #--------------------------------------------------------------------------
  744.   def ok
  745.     change
  746.     redraw_current_item
  747.   end
  748. end


  749. #==============================================================================
  750. # ■ Window_DebugSwitch
  751. #==============================================================================
  752. class Window_DebugSwitch < Window_DebugBase
  753.   #--------------------------------------------------------------------------
  754.   # ● 項目数の取得
  755.   #--------------------------------------------------------------------------
  756.   def item_max
  757.     $data_system.switches.size-1
  758.   end
  759.   #--------------------------------------------------------------------------
  760.   # ● アイテムの取得
  761.   #--------------------------------------------------------------------------
  762.   def item(i)
  763.     $game_switches[id(i)]
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ● アイテム名の取得
  767.   #--------------------------------------------------------------------------
  768.   def name(i)
  769.     $data_system.switches[id(i)]
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 項目の描画
  773.   #--------------------------------------------------------------------------
  774.   def draw_item(index)
  775.     draw_item_id_name_sw(index)
  776.   end
  777.   #--------------------------------------------------------------------------
  778.   # ● アイテムの変更
  779.   #--------------------------------------------------------------------------
  780.   def change
  781.     $game_switches[cid] = !$game_switches[cid]
  782.   end
  783. end


  784. #==============================================================================
  785. # ■ Window_DebugVariable
  786. #==============================================================================
  787. class Window_DebugVariable < Window_DebugBase
  788.   #--------------------------------------------------------------------------
  789.   # ● 項目数の取得
  790.   #--------------------------------------------------------------------------
  791.   def item_max
  792.     $data_system.variables.size-1
  793.   end
  794.   #--------------------------------------------------------------------------
  795.   # ● アイテムの取得
  796.   #--------------------------------------------------------------------------
  797.   def item(i)
  798.     $game_variables[id(i)]
  799.   end
  800.   #--------------------------------------------------------------------------
  801.   # ● アイテム名の取得
  802.   #--------------------------------------------------------------------------
  803.   def name(i)
  804.     $data_system.variables[id(i)]
  805.   end
  806.   #--------------------------------------------------------------------------
  807.   # ● 項目の描画
  808.   #--------------------------------------------------------------------------
  809.   def draw_item(index)
  810.     draw_item_id_name_num(index)
  811.   end
  812.   #--------------------------------------------------------------------------
  813.   # ● アイテムの変更
  814.   #--------------------------------------------------------------------------
  815.   def change(n)
  816.     $game_variables[cid] = n
  817.   end
  818.   #--------------------------------------------------------------------------
  819.   # ● 数値のmaxmin値取得
  820.   #--------------------------------------------------------------------------
  821.   def min
  822.     -99999999
  823.   end
  824.   def max
  825.     99999999
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # ● 数値の符号
  829.   #--------------------------------------------------------------------------
  830.   def sign
  831.     min < 0
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # ● 数値の符号
  835.   #--------------------------------------------------------------------------
  836.   def sign
  837.     true
  838.   end
  839. end


  840. #==============================================================================
  841. # ■ Window_DebugMapSelfSw
  842. #==============================================================================
  843. class Window_DebugMapSelfSw < Window_DebugBase
  844.   #--------------------------------------------------------------------------
  845.   # ● オブジェクト初期化
  846.   #--------------------------------------------------------------------------
  847.   def initialize(rect, map_id=$game_map.map_id)
  848.     @map_id = map_id
  849.     @map = load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
  850.     super(rect)
  851.   end
  852.   #--------------------------------------------------------------------------
  853.   # ● 項目数の取得
  854.   #--------------------------------------------------------------------------
  855.   def item_max
  856.     @map.events.size
  857.   end
  858.   #--------------------------------------------------------------------------
  859.   # ● イベントID
  860.   #--------------------------------------------------------------------------
  861.   def id(i)
  862.     @map.events.keys[i]
  863.   end
  864.   #--------------------------------------------------------------------------
  865.   # ● アイテムの取得
  866.   #--------------------------------------------------------------------------
  867.   def item(i)
  868.     @map.events[id(i)]
  869.   end
  870.   #--------------------------------------------------------------------------
  871.   # ● アイテムの取得
  872.   #--------------------------------------------------------------------------
  873.   def name(i)
  874.     @map.events[id(i)].name
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # ● 項目の描画
  878.   #--------------------------------------------------------------------------
  879.   def draw_item(index)
  880.     draw_item_id_name(index)
  881.   end
  882.   #--------------------------------------------------------------------------
  883.   # ● ヘルプウィンドウの更新
  884.   #--------------------------------------------------------------------------
  885.   def update_help
  886.     @help_window.set_event(@map_id, cid)
  887.   end
  888. end

  889. #==============================================================================
  890. # ■ Window_DebugSelfSwitch
  891. #==============================================================================
  892. class Window_DebugSelfSwitch < Window_DebugBaseHorzCommand
  893.   KEY = ["A", "B", "C", "D"]
  894.   #--------------------------------------------------------------------------
  895.   # ● オブジェクト初期化
  896.   #--------------------------------------------------------------------------
  897.   def initialize(rect, map_id=$game_map.map_id, ev_id=1)
  898.     @map_id = map_id
  899.     @ev_id = ev_id
  900.     super(rect)
  901.   end
  902.   #--------------------------------------------------------------------------
  903.   # ● 項目数の取得
  904.   #--------------------------------------------------------------------------
  905.   def item_max
  906.     KEY.size
  907.   end
  908.   #--------------------------------------------------------------------------
  909.   # ● ハッシュキー
  910.   #--------------------------------------------------------------------------
  911.   def key(i)
  912.     [@map_id, @ev_id, KEY[i]]
  913.   end
  914.   #--------------------------------------------------------------------------
  915.   # ● アイテムの取得
  916.   #--------------------------------------------------------------------------
  917.   def item(i)
  918.     $game_self_switches[key(i)]
  919.   end
  920.   #--------------------------------------------------------------------------
  921.   # ● アイテムの変更
  922.   #--------------------------------------------------------------------------
  923.   def change
  924.     k = key(@index)
  925.     $game_self_switches[k] = !$game_self_switches[k]
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● アイテム名の取得
  929.   #--------------------------------------------------------------------------
  930.   def name(i)
  931.     KEY[i]
  932.   end
  933.   #--------------------------------------------------------------------------
  934.   # ● コマンド名の取得
  935.   #--------------------------------------------------------------------------
  936.   def command_name(index)
  937.     @list[index][:name] + (item(index) ? "[ON]" : "[OFF]")
  938.   end
  939.   #--------------------------------------------------------------------------
  940.   # ● コマンドの有効状態を取得
  941.   #--------------------------------------------------------------------------
  942.   def command_enabled?(index)
  943.     item(index)
  944.   end
  945.   #--------------------------------------------------------------------------
  946.   # ● コマンドリストの作成
  947.   #--------------------------------------------------------------------------
  948.   def make_command_list
  949.     item_max.times {|i| add_command(name(i), :ok) }
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● イベントの設定
  953.   #--------------------------------------------------------------------------
  954.   def set_event(map_id, ev_id)
  955.     @map_id = map_id
  956.     @ev_id  = ev_id
  957.     refresh
  958.   end
  959. end


  960. #==============================================================================
  961. # ■ Window_DebugItem
  962. #==============================================================================
  963. class Window_DebugItem < Window_DebugBase
  964.   #--------------------------------------------------------------------------
  965.   # ● 項目数の取得
  966.   #--------------------------------------------------------------------------
  967.   def item_max
  968.     $data_items.size-1
  969.   end
  970.   #--------------------------------------------------------------------------
  971.   # ● アイテムの取得
  972.   #--------------------------------------------------------------------------
  973.   def item(i)
  974.     $data_items[id(i)]
  975.   end
  976.   #--------------------------------------------------------------------------
  977.   # ● アイテムの変更
  978.   #--------------------------------------------------------------------------
  979.   def change(n)
  980.     d = citem
  981.     n -= $game_party.item_number(d)
  982.     $game_party.gain_item(d, n)
  983.   end
  984.   #--------------------------------------------------------------------------
  985.   # ● 名前の描画
  986.   #--------------------------------------------------------------------------
  987.   def draw_index_name(rect, index)
  988.     draw_item_name(item(index), rect.x, rect.y)
  989.   end
  990.   #--------------------------------------------------------------------------
  991.   # ● 項目の描画
  992.   #--------------------------------------------------------------------------
  993.   def draw_item(index)
  994.     draw_item_id_name(index)
  995.     draw_item_number(item_rect_for_text(index), item(index))
  996.   end
  997.   #--------------------------------------------------------------------------
  998.   # ● アイテム個数を描画
  999.   #--------------------------------------------------------------------------
  1000.   def draw_item_number(rect, item)
  1001.     draw_text(rect, sprintf(":%#{@max_n}d", $game_party.item_number(item)), 2)
  1002.   end
  1003.   #--------------------------------------------------------------------------
  1004.   # ● 数値の最大桁数取得
  1005.   #--------------------------------------------------------------------------
  1006.   def num_max
  1007.     Math.log10(max).to_i + 1
  1008.   end
  1009.   #--------------------------------------------------------------------------
  1010.   # ● 数値のmaxmin値取得
  1011.   #--------------------------------------------------------------------------
  1012.   def min
  1013.     0
  1014.   end
  1015.   def max
  1016.     $game_party.max_item_number(citem)
  1017.   end
  1018.   def max_n
  1019.     m = []
  1020.     0..item_max.times {|i| m.push(Math.log10($game_party.max_item_number(item(i))).to_i + 1)}
  1021.     m.max
  1022.   end
  1023.   #--------------------------------------------------------------------------
  1024.   # ● 数値の取得/設定
  1025.   #--------------------------------------------------------------------------
  1026.   def number
  1027.     $game_party.item_number(citem)
  1028.   end
  1029.   def number=(n)
  1030.     change(n)
  1031.     redraw_current_item
  1032.   end
  1033. end


  1034. #==============================================================================
  1035. # ■ Window_DebugWeapon
  1036. #==============================================================================
  1037. class Window_DebugWeapon < Window_DebugItem
  1038.   #--------------------------------------------------------------------------
  1039.   # ● 項目数の取得
  1040.   #--------------------------------------------------------------------------
  1041.   def item_max
  1042.     $data_weapons.size-1
  1043.   end
  1044.   #--------------------------------------------------------------------------
  1045.   # ● アイテムの取得
  1046.   #--------------------------------------------------------------------------
  1047.   def item(i)
  1048.     $data_weapons[id(i)]
  1049.   end
  1050. end


  1051. #==============================================================================
  1052. # ■ Window_DebugArmor
  1053. #==============================================================================
  1054. class Window_DebugArmor < Window_DebugItem
  1055.   #--------------------------------------------------------------------------
  1056.   # ● 項目数の取得
  1057.   #--------------------------------------------------------------------------
  1058.   def item_max
  1059.     $data_armors.size-1
  1060.   end
  1061.   #--------------------------------------------------------------------------
  1062.   # ● アイテムの取得
  1063.   #--------------------------------------------------------------------------
  1064.   def item(i)
  1065.     $data_armors[id(i)]
  1066.   end
  1067. end


  1068. #==============================================================================
  1069. # ■ Window_DebugParty
  1070. #==============================================================================
  1071. class Window_DebugParty < Window_DebugBase
  1072.   #--------------------------------------------------------------------------
  1073.   # ● 歩行グラフィックの描画
  1074.   #--------------------------------------------------------------------------
  1075.   def draw_line_character(character_name, character_index, x, y, enabled=true)
  1076.     return unless character_name
  1077.     bitmap = Cache.character(character_name)
  1078.     sign = character_name[/^[\!\$]./]
  1079.     if sign && sign.include?('[/fold]     )
  1080.       cw = bitmap.width / 3
  1081.       ch = bitmap.height / 4
  1082.     else
  1083.       cw = bitmap.width / 12
  1084.       ch = bitmap.height / 8
  1085.     end
  1086.     y += (line_height - ch) / 2 if ch < line_height
  1087.     n = character_index
  1088.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, [ch, line_height].min)
  1089.     contents.blt(x, y, bitmap, src_rect, enabled ? 255 : translucent_alpha)
  1090.     cw
  1091.   end
  1092.   #--------------------------------------------------------------------------
  1093.   # ● アクターの歩行グラフィック描画
  1094.   #--------------------------------------------------------------------------
  1095.   def draw_actor_line_graphic(actor, x, y, enabled=true)
  1096.     draw_line_character(actor.character_name, actor.character_index, x, y, enabled)
  1097.   end
  1098.   #--------------------------------------------------------------------------
  1099.   # ● 項目数の取得<精霊システムあり用>
  1100.   #--------------------------------------------------------------------------
  1101.   def item_max_actors
  1102.     $data_actors.inject(0) {|r, a| r + (a.nil? ? 0 : (Spirits.spirit?(a.id) ? 0 : 1)) }
  1103.   end
  1104.   #--------------------------------------------------------------------------
  1105.   # ● 項目数の取得
  1106.   #--------------------------------------------------------------------------
  1107.   def item_max
  1108.     return item_max_actors if defined?(Spirits)
  1109.     $data_actors.size - 1
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # ● アクターIDの取得<精霊システムあり用>
  1113.   #--------------------------------------------------------------------------
  1114.   def aid(i)
  1115.     $data_actors.select {|a| !a.nil? and !Spirits.spirit?(a.id)}[i].id
  1116.   end
  1117.   #--------------------------------------------------------------------------
  1118.   # ● アクターIDの取得
  1119.   #--------------------------------------------------------------------------
  1120.   def id(i)
  1121.     return aid(i) if defined?(Spirits)
  1122.     i + 1
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # ● アイテムの取得
  1126.   #--------------------------------------------------------------------------
  1127.   def item(i)
  1128.     $game_actors[id(i)]
  1129.   end
  1130.   #--------------------------------------------------------------------------
  1131.   # ● アイテムの変更
  1132.   #--------------------------------------------------------------------------
  1133.   def change
  1134.     if status(@index)
  1135.       $game_party.remove_actor(cid)
  1136.     else
  1137.       $game_party.add_actor(cid)
  1138.     end
  1139.   end
  1140.   #--------------------------------------------------------------------------
  1141.   # ● アイテム状態の取得
  1142.   #--------------------------------------------------------------------------
  1143.   def status(i)
  1144.     $game_party.members.include?(item(i))
  1145.   end
  1146.   def cstate; status(@index); end
  1147.   #--------------------------------------------------------------------------
  1148.   # ● ステータステキスト
  1149.   #--------------------------------------------------------------------------
  1150.   def status_text(index)
  1151.     status(index) ? "[加入]" : "[未加入]"
  1152.   end
  1153.   #--------------------------------------------------------------------------
  1154.   # ● 名前の描画
  1155.   #--------------------------------------------------------------------------
  1156.   def draw_index_name(rect, index)
  1157.     draw_actor_line_graphic(item(index), rect.x, rect.y)
  1158.     draw_actor_name(item(index), rect.x + 34, rect.y, rect.width)
  1159.   end
  1160.   #--------------------------------------------------------------------------
  1161.   # ● 項目の描画
  1162.   #--------------------------------------------------------------------------
  1163.   def draw_item(index)
  1164.     draw_item_id_name_sw(index)
  1165.   end
  1166. end


  1167. #==============================================================================
  1168. # ■ Window_DebugActor
  1169. #==============================================================================
  1170. class Window_DebugActor < Window_DebugBase
  1171.   #--------------------------------------------------------------------------
  1172.   # ● オブジェクト初期化
  1173.   #--------------------------------------------------------------------------
  1174.   def initialize(rect)
  1175.     r = rect.dup
  1176.     r.width = 160
  1177.     super(r)
  1178.   end
  1179.   #--------------------------------------------------------------------------
  1180.   # ● 項目数の取得
  1181.   #--------------------------------------------------------------------------
  1182.   def item_max
  1183.     $data_actors.size - 1
  1184.   end
  1185.   #--------------------------------------------------------------------------
  1186.   # ● アイテムの取得
  1187.   #--------------------------------------------------------------------------
  1188.   def item(i)
  1189.     $game_actors[i+1]
  1190.   end
  1191.   #--------------------------------------------------------------------------
  1192.   # ● 項目の描画
  1193.   #--------------------------------------------------------------------------
  1194.   def draw_item(index)
  1195.     actor = item(index)
  1196.     rect = item_rect_for_text(index)
  1197.     if defined?(Spirits) and actor.spirit?
  1198.       draw_spirit_name(actor, rect.x, rect.y, rect.width)
  1199.     else
  1200.       draw_actor_name(actor, rect.x, rect.y, rect.width)
  1201.     end
  1202.   end
  1203.   #--------------------------------------------------------------------------
  1204.   # ● ヘルプウィンドウの更新
  1205.   #--------------------------------------------------------------------------
  1206.   def update_help
  1207.     @help_window.set_actor(citem) unless @index < 0
  1208.   end
  1209. end



  1210. #==============================================================================
  1211. # ■ Window_DebugActorStatus
  1212. #==============================================================================
  1213. class Window_DebugActorStatus < Window_DebugBaseCommand
  1214.   #--------------------------------------------------------------------------
  1215.   # ● オブジェクト初期化
  1216.   #--------------------------------------------------------------------------
  1217.   def initialize(rect)
  1218.     @actor = $game_actors[1]
  1219.     super(rect)
  1220.   end
  1221.   #--------------------------------------------------------------------------
  1222.   # ● アクター設定
  1223.   #--------------------------------------------------------------------------
  1224.   def set_actor(actor)
  1225.     return if @actor == actor
  1226.     @actor = actor
  1227.     refresh
  1228.   end
  1229.   #--------------------------------------------------------------------------
  1230.   # ● コマンドリストの作成
  1231.   #--------------------------------------------------------------------------
  1232.   def make_command_list
  1233.     add_command(Vocab::level,     :ok, true, 2)   # レベル
  1234.     add_command(Vocab::param(0),  :ok, true, 4)   # 最大HP
  1235.     add_command(Vocab::param(1),  :ok, true, 4)   # 最大MP
  1236.     add_command(Vocab::param(2),  :ok, true, 3)   # 攻撃力
  1237.     add_command(Vocab::param(3),  :ok, true, 3)   # 防御力
  1238.     add_command(Vocab::param(4),  :ok, true, 3)   # 魔法力
  1239.     add_command(Vocab::param(5),  :ok, true, 3)   # 魔法防御
  1240.     add_command(Vocab::param(6),  :ok, true, 3)   # 敏捷性
  1241.     add_command(Vocab::param(7),  :ok, true, 3)   # 運
  1242.   end
  1243.   #--------------------------------------------------------------------------
  1244.   # ● 項目の描画
  1245.   #--------------------------------------------------------------------------
  1246.   def draw_item(index)
  1247.     super
  1248.     draw_text(item_rect_for_text(index), status_val(index), 2)
  1249.   end
  1250.   def status_val(index)
  1251.     return 0 if @actor.nil?
  1252.     case index
  1253.     when 0; return @actor.level
  1254.     else;   return @actor.param(index-1)
  1255.     end
  1256.   end
  1257.   #--------------------------------------------------------------------------
  1258.   # ● 数値の最大桁数取得
  1259.   #--------------------------------------------------------------------------
  1260.   def num_max
  1261.     current_ext
  1262.   end
  1263.   #--------------------------------------------------------------------------
  1264.   # ● アイテムの変更
  1265.   #--------------------------------------------------------------------------
  1266.   def change(n=0)
  1267.     case index
  1268.     when 0; @actor.change_level(n, false)
  1269.     else;   @actor.add_param(index-1, n - status_val(index))
  1270.     end
  1271.   end
  1272.   #--------------------------------------------------------------------------
  1273.   # ● 数値の取得/設定
  1274.   #--------------------------------------------------------------------------
  1275.   def number
  1276.     status_val(@index)
  1277.   end
  1278.   def number=(n)
  1279.     change(n)
  1280.     if @index == 0
  1281.       contents.clear
  1282.       draw_all_items
  1283.     else
  1284.       redraw_current_item
  1285.     end
  1286.   end
  1287. end


  1288. #==============================================================================
  1289. # ■ Window_DebugActorSkill
  1290. #==============================================================================
  1291. class Window_DebugActorSkill < Window_DebugActorStatus
  1292.   #--------------------------------------------------------------------------
  1293.   # ● アクター設定
  1294.   #--------------------------------------------------------------------------
  1295.   def set_actor(actor)
  1296.     return if @actor == actor
  1297.     @actor = actor
  1298.     refresh_enabled
  1299.   end
  1300.   #--------------------------------------------------------------------------
  1301.   # ● 半透明描画用のアルファ値を取得
  1302.   #--------------------------------------------------------------------------
  1303.   def translucent_alpha
  1304.     return 80
  1305.   end
  1306.   #--------------------------------------------------------------------------
  1307.   # ● 許可状態だけ変更
  1308.   #--------------------------------------------------------------------------
  1309.   def refresh_enabled
  1310.     item_max.times do |i|
  1311.       next if @actor.nil?
  1312.       enabled = @actor.skill_learn?(item(i))
  1313.       if @list[i][:enabled] != enabled
  1314.         @list[i][:enabled] = enabled
  1315.         redraw_item(i)
  1316.       end
  1317.     end
  1318.   end
  1319.   #--------------------------------------------------------------------------
  1320.   # ● 選択項目の有効状態を取得
  1321.   #--------------------------------------------------------------------------
  1322.   def current_item_enabled?
  1323.     !citem.nil?
  1324.   end
  1325.   #--------------------------------------------------------------------------
  1326.   # ● アイテム取得
  1327.   #--------------------------------------------------------------------------
  1328.   def item(i)
  1329.     $data_skills[i+1]
  1330.   end
  1331.   def citem;  item(@index); end
  1332.   #--------------------------------------------------------------------------
  1333.   # ● コマンドリストの作成
  1334.   #--------------------------------------------------------------------------
  1335.   def make_command_list
  1336.     n = ($data_skills.size - 1)
  1337.     n.times {|i| add_command(item(i).id, :ok, @actor.skill_learn?(item(i)))}
  1338.   end
  1339.   #--------------------------------------------------------------------------
  1340.   # ● 項目の描画
  1341.   #--------------------------------------------------------------------------
  1342.   def draw_item(index)
  1343.     enabled = command_enabled?(index)
  1344.     change_color(normal_color, enabled)
  1345.     rect = item_rect_for_text(index)
  1346.     draw_item_name(item(index), rect.x, rect.y, enabled, rect.width-24)
  1347.   end
  1348.   #--------------------------------------------------------------------------
  1349.   # ● アイテムの変更
  1350.   #--------------------------------------------------------------------------
  1351.   def change
  1352.     if command_enabled?(@index)
  1353.       @actor.forget_skill(citem.id)
  1354.     else
  1355.       @actor.learn_skill(citem.id)
  1356.     end
  1357.     @list[@index][:enabled] = @actor.skill_learn?(citem)
  1358.   end
  1359.   #--------------------------------------------------------------------------
  1360.   # ● OK時の処理
  1361.   #--------------------------------------------------------------------------
  1362.   def ok
  1363.     change
  1364.     redraw_current_item
  1365.   end
  1366. end


  1367. #==============================================================================
  1368. # ■ Window_DebugMap
  1369. #==============================================================================
  1370. class Window_DebugMap < Window_DebugBase
  1371.   #--------------------------------------------------------------------------
  1372.   # ● オブジェクト初期化
  1373.   #--------------------------------------------------------------------------
  1374.   def initialize(rect)
  1375.     @map = $data_mapinfos.sort {|a,b| a[1].order - b[1].order}
  1376.     super(rect)
  1377.   end
  1378.   #--------------------------------------------------------------------------
  1379.   # ● 項目数の取得
  1380.   #--------------------------------------------------------------------------
  1381.   def item_max
  1382.     @map.size
  1383.   end
  1384.   #--------------------------------------------------------------------------
  1385.   # ● マップIDの取得
  1386.   #--------------------------------------------------------------------------
  1387.   def id(i)
  1388.     @map[i][0]
  1389.   end
  1390.   #--------------------------------------------------------------------------
  1391.   # ● アイテムの取得
  1392.   #--------------------------------------------------------------------------
  1393.   def item(i)
  1394.     @map[i][1]
  1395.   end
  1396.   #--------------------------------------------------------------------------
  1397.   # ● アイテム名の取得
  1398.   #--------------------------------------------------------------------------
  1399.   def name(i)
  1400.     item(i).name
  1401.   end
  1402.   #--------------------------------------------------------------------------
  1403.   # ● 項目の描画
  1404.   #--------------------------------------------------------------------------
  1405.   def draw_item(index)
  1406.     draw_item_id_name(index)
  1407.   end
  1408.   #--------------------------------------------------------------------------
  1409.   # ● 決定ハンドラの呼び出し
  1410.   #--------------------------------------------------------------------------
  1411.   def call_ok_handler
  1412.     ok
  1413.     super
  1414.   end
  1415.   #--------------------------------------------------------------------------
  1416.   # ● 移動位置
  1417.   #--------------------------------------------------------------------------
  1418.   def move_point(i)
  1419.     pos = DebugPP::MAP[id(i)]
  1420.     return pos unless pos.nil?
  1421.     data = load_data(sprintf("Data/Map%03d.rvdata2", id(i)))
  1422.     [(data.width / 2).truncate, (data.height / 2).truncate]
  1423.   end
  1424.   #--------------------------------------------------------------------------
  1425.   # ● OK時の処理
  1426.   #--------------------------------------------------------------------------
  1427.   def ok
  1428.     pos = move_point(@index)
  1429.     $game_player.reserve_transfer(cid, pos[0], pos[1], $game_player.direction)
  1430.     $game_temp.fade_type = 1  # 白
  1431.   end
  1432. end


  1433. #==============================================================================
  1434. # ■ Window_DebugMusicCtg
  1435. #==============================================================================
  1436. class Window_DebugMusicCtg < Window_DebugBaseHorzCommand
  1437.   #--------------------------------------------------------------------------
  1438.   # ● コマンドリストの作成
  1439.   #--------------------------------------------------------------------------
  1440.   def make_command_list
  1441.     ["BGM", "BGS", "ME", "SE"].each {|n| add_command(n, :ok) }
  1442.   end
  1443.   #--------------------------------------------------------------------------
  1444.   # ● ヘルプウィンドウの更新
  1445.   #--------------------------------------------------------------------------
  1446.   def update_help
  1447.     @help_window.set_ctg(@index)
  1448.   end
  1449. end


  1450. #==============================================================================
  1451. # ■ Window_DebugMusic
  1452. #==============================================================================
  1453. class Window_DebugMusic < Window_DebugBase
  1454.   BGM=0;BGS=1;ME=2;SE=3
  1455.   #--------------------------------------------------------------------------
  1456.   # ● オブジェクト初期化
  1457.   #--------------------------------------------------------------------------
  1458.   def initialize(rect)
  1459.     @ctg = BGM
  1460.     data_refresh
  1461.     super(rect)
  1462.   end
  1463.   #--------------------------------------------------------------------------
  1464.   # ● データ初期化
  1465.   #--------------------------------------------------------------------------
  1466.   def data_refresh
  1467.     @list = []
  1468.     4.times do |i|
  1469.       @list[i] = rtp_audio(i) + audio_grep(i)
  1470.     end
  1471.   end
  1472.   #--------------------------------------------------------------------------
  1473.   # ● データ初期化
  1474.   #--------------------------------------------------------------------------
  1475.   def set_ctg(ctg)
  1476.     return if @ctg == ctg
  1477.     @ctg = ctg
  1478.     create_contents
  1479.     draw_all_items
  1480.     self.top_row = 0
  1481.     unselect
  1482.   end
  1483.   #--------------------------------------------------------------------------
  1484.   # ● RTP-Audio
  1485.   #--------------------------------------------------------------------------
  1486.   def rtp_audio(i)
  1487.     return [] unless DebugPP::RTP_MUSIC
  1488.     case i
  1489.     when BGM
  1490.       return ["Airship.ogg","Battle1.ogg","Battle2.ogg","Battle3.ogg",
  1491.               "Battle4.ogg","Battle5.ogg","Battle6.ogg","Battle7.ogg",
  1492.               "Battle8.ogg","Battle9.ogg",
  1493.               "Dungeon1.ogg","Dungeon2.ogg","Dungeon3.ogg","Dungeon4.ogg",
  1494.               "Dungeon5.ogg","Dungeon6.ogg","Dungeon7.ogg","Dungeon8.ogg",
  1495.               "Dungeon9.ogg",
  1496.               "Field1.ogg","Field2.ogg","Field3.ogg","Field4.ogg",
  1497.               "Scene1.ogg","Scene2.ogg","Scene3.ogg","Scene4.ogg",
  1498.               "Scene5.ogg","Scene6.ogg","Ship.ogg",
  1499.               "Theme1.ogg","Theme2.ogg","Theme3.ogg","Theme4.ogg","Theme5.ogg",
  1500.               "Town1.ogg","Town2.ogg","Town3.ogg","Town4.ogg","Town5.ogg",
  1501.               "Town6.ogg","Town7.ogg"]
  1502.     when BGS
  1503.       return ["Clock.ogg","Darkness.ogg","Drips.ogg","Fire.ogg","Quake.ogg",
  1504.               "Rain.ogg","River.ogg","Sea.ogg","Storm.ogg","Wind.ogg"]
  1505.     when ME
  1506.       return ["Fanfare1.ogg","Fanfare2.ogg","Fanfare3.ogg","Gag.ogg",
  1507.               "Gameover1.ogg","Gameover2.ogg","Inn.ogg","Item.ogg","Mystery.ogg",
  1508.               "Organ.ogg","Shock.ogg","Victory1.ogg","Victory2.ogg"]
  1509.     when SE
  1510.       return ["Absorb1.ogg","Absorb2.ogg","Applause1.ogg","Applause2.ogg",
  1511.               "Attack1.ogg","Attack2.ogg","Attack3.ogg","Autodoor.ogg",
  1512.               "Barrier.ogg","Battle1.ogg","Battle2.ogg","Battle3.ogg",
  1513.               "Bell1.ogg","Bell2.ogg","Bell3.ogg","Bite.ogg","Blind.ogg",
  1514.               "Blow1.ogg","Blow2.ogg","Blow3.ogg","Blow4.ogg","Blow5.ogg",
  1515.               "Blow6.ogg","Blow7.ogg","Blow8.ogg","Book1.ogg","Book2.ogg",
  1516.               "Bow1.ogg","Bow2.ogg","Bow3.ogg","Bow4.ogg","Break.ogg",
  1517.               "Breath.ogg","Buzzer1.ogg","Buzzer2.ogg",
  1518.               "Cancel1.ogg","Cancel2.ogg","Cat.ogg","Chest.ogg",
  1519.               "Chicken.ogg","Chime1.ogg","Chime2.ogg",
  1520.               "Close1.ogg","Close2.ogg","Close3.ogg","Coin.ogg",
  1521.               "Collapse1.ogg","Collapse2.ogg","Collapse3.ogg","Collapse4.ogg",
  1522.               "Confuse.ogg","Cow.ogg","Crash.ogg","Crossbow.ogg","Crow.ogg",
  1523.               "Cry1.ogg","Cry2.ogg","Cursor1.ogg","Cursor2.ogg",
  1524.               "Damage1.ogg","Damage2.ogg","Damage3.ogg","Damage4.ogg","Damage5.ogg",
  1525.               "Darkness1.ogg","Darkness2.ogg","Darkness3.ogg","Darkness4.ogg",
  1526.               "Darkness5.ogg","Darkness6.ogg","Darkness7.ogg","Darkness8.ogg",
  1527.               "Decision1.ogg","Decision2.ogg","Decision3.ogg",
  1528.               "Devil1.ogg","Devil2.ogg","Devil3.ogg","Disappointment.ogg",
  1529.               "Dive.ogg","Dog.ogg","Down1.ogg","Down2.ogg","Down3.ogg","Down4.ogg",
  1530.               "Earth1.ogg","Earth2.ogg","Earth3.ogg","Earth4.ogg","Earth5.ogg",
  1531.               "Earth6.ogg","Earth7.ogg","Earth8.ogg", "Earth9.ogg",
  1532.               "Equip1.ogg","Equip2.ogg","Equip3.ogg","Evasion1.ogg","Evasion2.ogg",
  1533.               "Explosion1.ogg","Explosion2.ogg","Explosion3.ogg","Explosion4.ogg",
  1534.               "Explosion5.ogg","Explosion6.ogg","Explosion7.ogg","Fall.ogg",
  1535.               "Fire1.ogg","Fire2.ogg","Fire3.ogg","Fire4.ogg","Fire5.ogg",
  1536.               "Fire6.ogg","Fire7.ogg","Fire8.ogg","Fire9.ogg",
  1537.               "Flash1.ogg","Flash2.ogg","Flash3.ogg","Fog1.ogg","Fog2.ogg",
  1538.               "Frog.ogg","Gun1.ogg","Gun2.ogg",
  1539.               "Hammer.ogg","Heal1.ogg","Heal2.ogg","Heal3.ogg","Heal4.ogg",
  1540.               "Heal5.ogg","Heal6.ogg","Heal7.ogg","Horse.ogg",
  1541.               "Ice1.ogg","Ice2.ogg","Ice3.ogg","Ice4.ogg","Ice5.ogg","Ice6.ogg",
  1542.               "Ice7.ogg","Ice8.ogg","Ice9.ogg","Ice10.ogg","Ice11.ogg",
  1543.               "Item1.ogg","Item2.ogg","Item3.ogg","Jump1.ogg","Jump2.ogg",
  1544.               "Key.ogg","Knock.ogg","Laser.ogg","Load.ogg",
  1545.               "Machine.ogg","Magic1.ogg","Magic2.ogg","Magic3.ogg",
  1546.               "Magic4.ogg","Magic5.ogg","Magic6.ogg","Magic7.ogg","Miss.ogg",
  1547.               "Monster1.ogg","Monster2.ogg","Monster3.ogg","Monster4.ogg",
  1548.               "Monster5.ogg","Monster6.ogg","Monster7.ogg","Move.ogg",
  1549.               "Noise.ogg","Open1.ogg","Open2.ogg","Open3.ogg","Open4.ogg","Open5.ogg",
  1550.               "Paralyze1.ogg","Paralyze2.ogg","Paralyze3.ogg","Parry.ogg",
  1551.               "Phone.ogg","Poison.ogg","Pollen.ogg","Powerup.ogg","Push.ogg",
  1552.               "Raise1.ogg","Raise2.ogg","Raise3.ogg","Recovery.ogg",
  1553.               "Reflection.ogg","Resonance.ogg","Run.ogg",
  1554.               "Saint1.ogg","Saint2.ogg","Saint3.ogg","Saint4.ogg","Saint5.ogg",
  1555.               "Saint6.ogg","Saint7.ogg","Saint8.ogg","Saint9.ogg","Sand.ogg",
  1556.               "Save.ogg","Scream.ogg","Sheep.ogg","Shop.ogg",
  1557.               "Shot1.ogg","Shot2.ogg","Shot3.ogg","Silence.ogg",
  1558.               "Skill1.ogg","Skill2.ogg","Skill3.ogg",
  1559.               "Slash1.ogg","Slash2.ogg","Slash3.ogg","Slash4.ogg","Slash5.ogg",
  1560.               "Slash6.ogg","Slash7.ogg","Slash8.ogg","Slash9.ogg",
  1561.               "Slash10.ogg","Slash11.ogg","Slash12.ogg","Sleep.ogg",
  1562.               "Sound1.ogg","Sound2.ogg","Sound3.ogg","Stare.ogg","Starlight.ogg",
  1563.               "Switch1.ogg","Switch2.ogg","Switch3.ogg",
  1564.               "Sword1.ogg","Sword2.ogg","Sword3.ogg","Sword4.ogg","Sword5.ogg",
  1565.               "Teleport.ogg","Thunder1.ogg","Thunder2.ogg","Thunder3.ogg",
  1566.               "Thunder4.ogg","Thunder5.ogg","Thunder6.ogg","Thunder7.ogg",
  1567.               "Thunder8.ogg","Thunder9.ogg","Thunder10.ogg",
  1568.               "Thunder11.ogg","Thunder12.ogg","Twine.ogg",
  1569.               "Up1.ogg","Up2.ogg","Up3.ogg","Up4.ogg",
  1570.               "Water1.ogg","Water2.ogg","Water3.ogg","Water4.ogg",
  1571.               "Water5.ogg","Water6.ogg",
  1572.               "Wind1.ogg","Wind2.ogg","Wind3.ogg","Wind4.ogg","Wind5.ogg",
  1573.               "Wind6.ogg","Wind7.ogg","Wind8.ogg","Wind9.ogg","Wind10.ogg",
  1574.               "Wind11.ogg","Wolf.ogg"]
  1575.     end
  1576.     return []
  1577.   end
  1578.   #--------------------------------------------------------------------------
  1579.   # ● Audioフォルダのパス
  1580.   #--------------------------------------------------------------------------
  1581.   def path(i)
  1582.     case i
  1583.     when BGM; return "Audio/BGM/"
  1584.     when BGS; return "Audio/BGS/"
  1585.     when ME;  return "Audio/ME/"
  1586.     when SE;  return "Audio/SE/"
  1587.     end
  1588.   end
  1589.   def filter(i)
  1590.     case i
  1591.     when BGM; return "*.{ogg,wma,mp3,wav,mid}"
  1592.     when BGS; return "*.{ogg,wma,mp3,wav}"
  1593.     when ME;  return "*.{ogg,wma,mp3,wav,mid}"
  1594.     when SE;  return "*.{ogg,wma,mp3,wav}"
  1595.     end
  1596.   end
  1597.   #--------------------------------------------------------------------------
  1598.   # ● AudioフォルダのGrep
  1599.   #--------------------------------------------------------------------------
  1600.   def audio_grep(i)
  1601.     list = Dir.glob(path(i)+filter(i))
  1602.     file_list = []
  1603.     list.select {|l| !FileTest.directory?(l)}.collect {|l| File.basename(l)}
  1604.   end
  1605.   #--------------------------------------------------------------------------
  1606.   # ● 項目数の取得
  1607.   #--------------------------------------------------------------------------
  1608.   def item_max
  1609.     @list[@ctg].size
  1610.   end
  1611.   #--------------------------------------------------------------------------
  1612.   # ● アイテムの取得
  1613.   #--------------------------------------------------------------------------
  1614.   def item(i)
  1615.     @list[@ctg][i]
  1616.   end
  1617.   def citem; item(@index); end
  1618.   #--------------------------------------------------------------------------
  1619.   # ● 項目の描画
  1620.   #--------------------------------------------------------------------------
  1621.   def draw_item(index)
  1622.     draw_text(item_rect_for_text(index), item(index))
  1623.   end
  1624.   #--------------------------------------------------------------------------
  1625.   # ● 決定やキャンセルなどのハンドリング処理
  1626.   #--------------------------------------------------------------------------
  1627.   def process_handling
  1628.     return unless open? && active
  1629.     super
  1630.     return stop   if Input.trigger?(:Y)
  1631.     return replay if Input.trigger?(:X)
  1632.   end
  1633.   #--------------------------------------------------------------------------
  1634.   # ● 決定ボタンが押されたときの処理
  1635.   #--------------------------------------------------------------------------
  1636.   def process_ok
  1637.     if current_item_enabled?
  1638. #~       Sound.play_ok  # Musicでは鳴らさない
  1639.       Input.update
  1640.       deactivate
  1641.       call_ok_handler
  1642.     else
  1643.       Sound.play_buzzer
  1644.     end
  1645.   end
  1646.   #--------------------------------------------------------------------------
  1647.   # ● OK時の処理
  1648.   #--------------------------------------------------------------------------
  1649.   def ok
  1650.     return if citem.nil?
  1651.     pth = path(@ctg)+citem
  1652.     case @ctg
  1653.     when BGM; Audio.bgm_play(pth)
  1654.     when BGS; Audio.bgs_play(pth)
  1655.     when ME;  Audio.me_play(pth)
  1656.     when SE;  Audio.se_play(pth)
  1657.     end
  1658.   end
  1659.   def stop(i=@ctg)
  1660.     case i
  1661.     when BGM; Audio.bgm_stop
  1662.     when BGS; Audio.bgs_stop
  1663.     when ME;  Audio.me_stop
  1664.     when SE;  Audio.se_stop
  1665.     end
  1666.   end
  1667.   def replay
  1668.     RPG::BGM.last.replay
  1669.     RPG::BGS.last.replay
  1670.   end
  1671. end


  1672. #==============================================================================
  1673. # ■ Window_DebugSystem
  1674. #==============================================================================
  1675. class Window_DebugSystem < Window_DebugBaseCommand
  1676.   #--------------------------------------------------------------------------
  1677.   # ● コマンドリストの作成
  1678.   #--------------------------------------------------------------------------
  1679.   def make_command_list
  1680.     add_main_commands
  1681.     add_original_commands
  1682.   end
  1683.   #--------------------------------------------------------------------------
  1684.   # ● 主要コマンドをリストに追加
  1685.   #--------------------------------------------------------------------------
  1686.   def add_main_commands
  1687.     add_command("お金",             :input)
  1688.     add_command("セーブ回数",       :input)
  1689.     add_command("戦闘回数",         :input)
  1690.     add_command("セーブ禁止",       :ok)
  1691.     add_command("メニュー禁止",     :ok)
  1692.     add_command("エンカウント禁止", :ok)
  1693.     add_command("並び替え禁止",     :ok)
  1694.     add_command("全アイテム入手",   :ok)
  1695.     add_command("解像度",           :ok)
  1696.   end
  1697.   #--------------------------------------------------------------------------
  1698.   # ● 独自コマンドの追加用
  1699.   #--------------------------------------------------------------------------
  1700.   def add_original_commands
  1701.     add_command("用語辞典初期化",        :ok,    true, :dictionary) if defined?(Dictionary)
  1702.     add_command("ワールドマップ初期化",  :ok,    true, :worldmap)   if defined?(WorldMap)
  1703.     add_command("クエストランク",        :input, true, :quest_rank) if defined?(Quest)
  1704.     add_command("クエスト初期化",        :ok,    true, :quest)      if defined?(Quest)
  1705.   end
  1706.   #--------------------------------------------------------------------------
  1707.   # ● 数取得
  1708.   #--------------------------------------------------------------------------
  1709.   def item(index)
  1710.     case index
  1711.     when 0; return $game_party.gold
  1712.     when 1; return $game_system.save_count
  1713.     when 2; return $game_system.battle_count
  1714.     when 3; return $game_system.save_disabled
  1715.     when 4; return $game_system.menu_disabled
  1716.     when 5; return $game_system.encounter_disabled
  1717.     when 6; return $game_system.formation_disabled
  1718.     else
  1719.       case @list[index][:ext]
  1720.       when :quest_rank; return $game_party.quest_rank
  1721.       end
  1722.     end
  1723.     return 0
  1724.   end
  1725.   #--------------------------------------------------------------------------
  1726.   # ● テキスト
  1727.   #--------------------------------------------------------------------------
  1728.   def text(index)
  1729.     case index
  1730.     when 0,1,2;   return item(index)
  1731.     when 3,4,5,6; return item(index) ? "[禁止]" : "[許可]"
  1732.     when 8;       return Graphics.width == 640 ? "640×480" : "544×416"
  1733.     else
  1734.       case @list[index][:ext]
  1735.       when :quest_rank; return Quest::RANK[item(index)] + "(#{item(index)})"
  1736.       end
  1737.     end
  1738.     return ""
  1739.   end
  1740.   #--------------------------------------------------------------------------
  1741.   # ● 項目の描画
  1742.   #--------------------------------------------------------------------------
  1743.   def draw_item(index)
  1744.     super(index)
  1745.     draw_text(item_rect_for_text(index), text(index), 2)
  1746.   end
  1747.   #--------------------------------------------------------------------------
  1748.   # ● 数値の最大桁数取得
  1749.   #--------------------------------------------------------------------------
  1750.   def num_max
  1751.     Math.log10(max).to_i + 1
  1752.   end
  1753.   #--------------------------------------------------------------------------
  1754.   # ● 数値の符号
  1755.   #--------------------------------------------------------------------------
  1756.   def sign
  1757.     false
  1758.   end
  1759.   #--------------------------------------------------------------------------
  1760.   # ● 数値のmaxmin値取得
  1761.   #--------------------------------------------------------------------------
  1762.   def min
  1763.     case @list[@index][:ext]
  1764.     when :quest_rank; return 1
  1765.     end
  1766.     0
  1767.   end
  1768.   def max
  1769.     case @index
  1770.     when 0
  1771.       return $game_party.max_gold
  1772.     else
  1773.       case @list[@index][:ext]
  1774.       when :quest_rank; return 10
  1775.       end
  1776.     end
  1777.     99999999
  1778.   end
  1779.   #--------------------------------------------------------------------------
  1780.   # ● アイテムの変更
  1781.   #--------------------------------------------------------------------------
  1782.   def change(n=0)
  1783.     case @index
  1784.     when 0; $game_party.gain_gold(n - $game_party.gold)
  1785.     when 1; $game_system.save_count         = n
  1786.     when 2; $game_system.battle_count       = n
  1787.     when 3; $game_system.save_disabled      = n
  1788.     when 4; $game_system.menu_disabled      = n
  1789.     when 5; $game_system.encounter_disabled = n
  1790.     when 6; $game_system.formation_disabled = n
  1791.     when 7; all_item
  1792.     when 8; resize_screen
  1793.     else
  1794.       case @list[@index][:ext]
  1795.       when :dictionary; $game_system.dictionary.reset
  1796.       when :worldmap;   $game_system.worldmap.reset
  1797.       when :quest_rank; $game_party.quest_rank = n
  1798.       when :quest;      $game_system.quest.reset
  1799.       end
  1800.     end
  1801.   end
  1802.   #--------------------------------------------------------------------------
  1803.   # ● OK時の処理
  1804.   #--------------------------------------------------------------------------
  1805.   def ok
  1806.     change(!number)
  1807.     redraw_current_item
  1808.   end
  1809.   #--------------------------------------------------------------------------
  1810.   # ● 数値の取得/設定
  1811.   #--------------------------------------------------------------------------
  1812.   def number
  1813.     item(@index)
  1814.   end
  1815.   def number=(n)
  1816.     change(n)
  1817.     redraw_current_item
  1818.   end
  1819.   #--------------------------------------------------------------------------
  1820.   # ● OK時の処理 : all item
  1821.   #--------------------------------------------------------------------------
  1822.   def all_item
  1823.     n = $data_items.size - 1
  1824.     n.times {|i| $game_party.gain_item($data_items[i+1], 1)}
  1825.     n = $data_weapons.size - 1
  1826.     n.times {|i| $game_party.gain_item($data_weapons[i+1], 1)}
  1827.     n = $data_armors.size - 1
  1828.     n.times {|i| $game_party.gain_item($data_armors[i+1], 1)}
  1829.   end
  1830.   #--------------------------------------------------------------------------
  1831.   # ● OK時の処理 : win_resize
  1832.   #--------------------------------------------------------------------------
  1833.   def resize_screen
  1834.     if Graphics.width == 640
  1835.       Graphics.resize_screen(544, 416)
  1836.     else
  1837.       Graphics.resize_screen(640, 480)
  1838.     end
  1839.     call_handler(:exit)
  1840.   end
  1841. end


  1842. #==============================================================================
  1843. # ■ Window_DebugActorExpert
  1844. #==============================================================================
  1845. class Window_DebugActorExpert < Window_DebugActorStatus
  1846.   #--------------------------------------------------------------------------
  1847.   # ● コマンドリストの作成
  1848.   #--------------------------------------------------------------------------
  1849.   def make_command_list
  1850.     SysUpdate::ELEMENTS.each {|e| add_command(e, :ok, true, 2)}
  1851.   end
  1852.   #--------------------------------------------------------------------------
  1853.   # ● 項目の描画
  1854.   #--------------------------------------------------------------------------
  1855.   def draw_item(index)
  1856.     element_id = command_name(index)
  1857.     rect = item_rect_for_text(index)
  1858.     draw_attr_icon_pm(@actor, element_id, rect.x, rect.y)
  1859.     rect.x     += 26
  1860.     rect.width -= 26
  1861.     draw_text(rect, SysUpdate.attr_name(element_id))
  1862.     attr = @actor.attr[element_id]
  1863.     draw_text(rect, attr.lv_limit, 2)
  1864.     rect.width -= 30
  1865.     draw_text(rect, "/", 2)
  1866.     rect.width -= 20
  1867.     draw_text(rect, attr.level, 2)
  1868.   end
  1869.   #--------------------------------------------------------------------------
  1870.   # ● 数値の最大桁数取得
  1871.   #--------------------------------------------------------------------------
  1872.   def num_max
  1873.     2
  1874.   end
  1875.   #--------------------------------------------------------------------------
  1876.   # ● 数値の最大値取得
  1877.   #--------------------------------------------------------------------------
  1878.   def min
  1879.     1
  1880.   end
  1881.   def max
  1882.     @actor.attr[command_name(@index)].lv_limit
  1883.   end
  1884.   #--------------------------------------------------------------------------
  1885.   # ● アイテムの変更
  1886.   #--------------------------------------------------------------------------
  1887.   def change(n)
  1888.     @actor.attr[command_name(@index)].level = n
  1889.   end
  1890.   #--------------------------------------------------------------------------
  1891.   # ● 数値の取得/設定
  1892.   #--------------------------------------------------------------------------
  1893.   def number
  1894.     @actor.attr[command_name(@index)].level
  1895.   end
  1896.   def number=(n)
  1897.     change(n)
  1898.     redraw_current_item
  1899.   end
  1900.   #--------------------------------------------------------------------------
  1901.   # ● 得意状態変更
  1902.   #--------------------------------------------------------------------------
  1903.   def change_taste
  1904.     attr = @actor.attr[command_name(@index)]
  1905.     attr.taste = (attr.taste + 1) % 3
  1906.     redraw_current_item
  1907.   end
  1908. end


  1909. #==============================================================================
  1910. # ■ Window_DebugDictCtg
  1911. #==============================================================================
  1912. class Window_DebugDictCtg < Window_DebugBase
  1913.   #--------------------------------------------------------------------------
  1914.   # ● オブジェクト初期化
  1915.   #--------------------------------------------------------------------------
  1916.   def initialize(rect)
  1917.     r = rect.dup
  1918.     r.width = 120
  1919.     super(r)
  1920.   end
  1921.   #--------------------------------------------------------------------------
  1922.   # ● 項目数の取得
  1923.   #--------------------------------------------------------------------------
  1924.   def item_max
  1925.     $game_system.dictionary.size
  1926.   end
  1927.   #--------------------------------------------------------------------------
  1928.   # ● 用語カテゴリIDの取得
  1929.   #--------------------------------------------------------------------------
  1930.   def id(i)
  1931.     $game_system.dictionary.keys[i]
  1932.   end
  1933.   #--------------------------------------------------------------------------
  1934.   # ● アイテムの取得
  1935.   #--------------------------------------------------------------------------
  1936.   def item(i)
  1937.     $game_system.dictionary[id(i)]
  1938.   end
  1939.   #--------------------------------------------------------------------------
  1940.   # ● 項目の描画
  1941.   #--------------------------------------------------------------------------
  1942.   def draw_item(index)
  1943.     draw_text(item_rect_for_text(index), item(index).name)
  1944.   end
  1945.   #--------------------------------------------------------------------------
  1946.   # ● ヘルプウィンドウの更新
  1947.   #--------------------------------------------------------------------------
  1948.   def update_help
  1949.     @help_window.set_ctg(cid)
  1950.   end
  1951. end



  1952. #==============================================================================
  1953. # ■ Window_DebugDictionary
  1954. #==============================================================================
  1955. class Window_DebugDictionary < Window_DebugBase
  1956.   #--------------------------------------------------------------------------
  1957.   # ● オブジェクト初期化
  1958.   #--------------------------------------------------------------------------
  1959.   def initialize(rect)
  1960.     @ctg = $game_system.dictionary.keys[0]
  1961.     super
  1962.   end
  1963.   #--------------------------------------------------------------------------
  1964.   # ● カテゴリ設定
  1965.   #--------------------------------------------------------------------------
  1966.   def set_ctg(ctg)
  1967.     return if @ctg == ctg
  1968.     @ctg = ctg
  1969.     create_contents
  1970.     refresh
  1971.     self.top_row = 0
  1972.     unselect
  1973.   end
  1974.   #--------------------------------------------------------------------------
  1975.   # ● 項目数の取得
  1976.   #--------------------------------------------------------------------------
  1977.   def item_max
  1978.     $game_system.dictionary[@ctg].size
  1979.   end
  1980.   #--------------------------------------------------------------------------
  1981.   # ● 用語IDの取得
  1982.   #--------------------------------------------------------------------------
  1983.   def id(i)
  1984.     $game_system.dictionary[@ctg].keys[i]
  1985.   end
  1986.   #--------------------------------------------------------------------------
  1987.   # ● アイテムの取得
  1988.   #--------------------------------------------------------------------------
  1989.   def item(i)
  1990.     $game_system.dictionary[@ctg][id(i)]
  1991.   end
  1992.   #--------------------------------------------------------------------------
  1993.   # ● アイテム名の取得
  1994.   #--------------------------------------------------------------------------
  1995.   def name(i)
  1996.     item(i).name.split(/\\n/)[0]
  1997.   end
  1998.   #--------------------------------------------------------------------------
  1999.   # ● アイテム状態の取得
  2000.   #--------------------------------------------------------------------------
  2001.   def status(i)
  2002.     item(i).show_flg
  2003.   end
  2004.   #--------------------------------------------------------------------------
  2005.   # ● 項目の描画
  2006.   #--------------------------------------------------------------------------
  2007.   def draw_item(index)
  2008.     draw_item_id_name_sw(index)
  2009.   end
  2010.   #--------------------------------------------------------------------------
  2011.   # ● アイテムの変更
  2012.   #--------------------------------------------------------------------------
  2013.   def change(n=0)
  2014.     $game_system.dictionary[@ctg][cid].show_flg = !citem.show_flg
  2015.   end
  2016. end


  2017. #==============================================================================
  2018. # ■ Window_DebugWorldRegion
  2019. #==============================================================================
  2020. class Window_DebugWorldRegion < Window_DebugBase
  2021.   #--------------------------------------------------------------------------
  2022.   # ● オブジェクト初期化
  2023.   #--------------------------------------------------------------------------
  2024.   def initialize(rect)
  2025.     r = rect.dup
  2026.     r.height /= 2
  2027.     super(r)
  2028.   end
  2029.   #--------------------------------------------------------------------------
  2030.   # ● 項目数の取得
  2031.   #--------------------------------------------------------------------------
  2032.   def item_max
  2033.     WorldMap::REGION.size
  2034.   end
  2035.   #--------------------------------------------------------------------------
  2036.   # ● 用語カテゴリIDの取得
  2037.   #--------------------------------------------------------------------------
  2038.   def id(i)
  2039.     $game_system.worldmap.ids[i]
  2040.   end
  2041.   #--------------------------------------------------------------------------
  2042.   # ● アイテムの取得
  2043.   #--------------------------------------------------------------------------
  2044.   def item(i)
  2045.     $game_system.worldmap[id(i)]
  2046.   end
  2047.   #--------------------------------------------------------------------------
  2048.   # ● アイテム名の取得
  2049.   #--------------------------------------------------------------------------
  2050.   def name(i)
  2051.     item(i).region_name
  2052.   end
  2053.   #--------------------------------------------------------------------------
  2054.   # ● アイテム状態の取得
  2055.   #--------------------------------------------------------------------------
  2056.   def status(i)
  2057.     item(i).visible
  2058.   end
  2059.   #--------------------------------------------------------------------------
  2060.   # ● 項目の描画
  2061.   #--------------------------------------------------------------------------
  2062.   def draw_item(index)
  2063.     draw_item_id_name_sw(index)
  2064.   end
  2065.   #--------------------------------------------------------------------------
  2066.   # ● ヘルプウィンドウの更新
  2067.   #--------------------------------------------------------------------------
  2068.   def update_help
  2069.     @help_window.set_ctg(cid) unless @index < 0
  2070.   end
  2071.   #--------------------------------------------------------------------------
  2072.   # ● アイテムの変更
  2073.   #--------------------------------------------------------------------------
  2074.   def change(n=0)
  2075.     $game_system.worldmap[cid].visible = !cstatus
  2076.   end
  2077. end



  2078. #==============================================================================
  2079. # ■ Window_DebugWorldTown
  2080. #==============================================================================
  2081. class Window_DebugWorldTown < Window_DebugBase
  2082.   #--------------------------------------------------------------------------
  2083.   # ● オブジェクト初期化
  2084.   #--------------------------------------------------------------------------
  2085.   def initialize(rect)
  2086.     @ctg = $game_system.worldmap.ids[0]
  2087.     super(rect)
  2088.   end
  2089.   #--------------------------------------------------------------------------
  2090.   # ● カテゴリ設定
  2091.   #--------------------------------------------------------------------------
  2092.   def set_ctg(ctg)
  2093.     return if @ctg == ctg
  2094.     @ctg = ctg
  2095.     create_contents
  2096.     refresh
  2097.     self.top_row = 0
  2098.     unselect
  2099.   end
  2100.   #--------------------------------------------------------------------------
  2101.   # ● 項目数の取得
  2102.   #--------------------------------------------------------------------------
  2103.   def item_max
  2104.     $game_system.worldmap[@ctg].ids.size
  2105.   end
  2106.   #--------------------------------------------------------------------------
  2107.   # ● タウンIDの取得
  2108.   #--------------------------------------------------------------------------
  2109.   def id(i)
  2110.     $game_system.worldmap[@ctg].ids[i]
  2111.   end
  2112.   #--------------------------------------------------------------------------
  2113.   # ● アイテムの取得
  2114.   #--------------------------------------------------------------------------
  2115.   def item(i)
  2116.     $game_system.worldmap[@ctg][id(i)]
  2117.   end
  2118.   #--------------------------------------------------------------------------
  2119.   # ● アイテム名の取得
  2120.   #--------------------------------------------------------------------------
  2121.   def name(i)
  2122.     item(i).town_name
  2123.   end
  2124.   #--------------------------------------------------------------------------
  2125.   # ● アイテム状態の取得
  2126.   #--------------------------------------------------------------------------
  2127.   def status(i)
  2128.     item(i).visible
  2129.   end
  2130.   #--------------------------------------------------------------------------
  2131.   # ● 項目の描画
  2132.   #--------------------------------------------------------------------------
  2133.   def draw_item(index)
  2134.     draw_item_id_name_sw(index)
  2135.   end
  2136.   #--------------------------------------------------------------------------
  2137.   # ● アイテムの変更
  2138.   #--------------------------------------------------------------------------
  2139.   def change(n=0)
  2140.     $game_system.worldmap[@ctg][cid].visible = !cstatus
  2141.   end
  2142. end


  2143. #==============================================================================
  2144. # ■ Window_DebugQuestCtg
  2145. #==============================================================================
  2146. class Window_DebugQuestCtg < Window_DebugBaseHorzCommand
  2147.   #--------------------------------------------------------------------------
  2148.   # ● コマンドリストの作成
  2149.   #--------------------------------------------------------------------------
  2150.   def make_command_list
  2151.     ["イベントクエスト", "ギルドクエスト"].each {|n| add_command(n, :ok) }
  2152.   end
  2153.   #--------------------------------------------------------------------------
  2154.   # ● ヘルプウィンドウの更新
  2155.   #--------------------------------------------------------------------------
  2156.   def update_help
  2157.     @help_window.set_ctg(@index)
  2158.   end
  2159. end


  2160. #==============================================================================
  2161. # ■ Window_DebugQuest
  2162. #==============================================================================
  2163. class Window_DebugQuest < Window_DebugBase
  2164.   #--------------------------------------------------------------------------
  2165.   # ● オブジェクト初期化
  2166.   #--------------------------------------------------------------------------
  2167.   def initialize(rect)
  2168.     @ctg = 0
  2169.     data_refresh
  2170.     super(rect)
  2171.   end
  2172.   #--------------------------------------------------------------------------
  2173.   # ● カテゴリデータ集計
  2174.   #--------------------------------------------------------------------------
  2175.   def data_refresh
  2176.     @commands = []
  2177.     $game_system.quest.ids.each do |id|
  2178.       data = $game_system.quest[id]
  2179.       case @ctg
  2180.       when 0; @commands.push(data) if !data.enable
  2181.       when 1; @commands.push(data) if data.enable
  2182.       end
  2183.     end
  2184.   end
  2185.   #--------------------------------------------------------------------------
  2186.   # ● カテゴリ設定
  2187.   #--------------------------------------------------------------------------
  2188.   def set_ctg(ctg)
  2189.     return if @ctg == ctg
  2190.     @ctg = ctg
  2191.     data_refresh
  2192.     create_contents
  2193.     refresh
  2194.     self.top_row = 0
  2195.     unselect
  2196.   end
  2197.   #--------------------------------------------------------------------------
  2198.   # ● 項目数の取得
  2199.   #--------------------------------------------------------------------------
  2200.   def item_max
  2201.     @commands.size
  2202.   end
  2203.   #--------------------------------------------------------------------------
  2204.   # ● クエストIDの取得
  2205.   #--------------------------------------------------------------------------
  2206.   def id(i)
  2207.     @commands[i].id
  2208.   end
  2209.   #--------------------------------------------------------------------------
  2210.   # ● アイテムの取得
  2211.   #--------------------------------------------------------------------------
  2212.   def item(i)
  2213.     @commands[i]
  2214.   end
  2215.   #--------------------------------------------------------------------------
  2216.   # ● アイテム名の取得
  2217.   #--------------------------------------------------------------------------
  2218.   def name(i)
  2219.     Quest.conv_text(item(i).name)
  2220.   end
  2221.   #--------------------------------------------------------------------------
  2222.   # ● ステータステキスト
  2223.   #--------------------------------------------------------------------------
  2224.   def status_text(index)
  2225.     quest = item(index)
  2226.     quest.playing ? "[進行中(開始)]" :
  2227.         quest.clear ?   "[クリア済み]" :
  2228.              quest.fail ?    "[失敗]": "[未開始]"
  2229.   end
  2230.   #--------------------------------------------------------------------------
  2231.   # ● 項目の描画
  2232.   #--------------------------------------------------------------------------
  2233.   def draw_item(index)
  2234.     draw_item_id_name_sw(index)
  2235.   end
  2236.   #--------------------------------------------------------------------------
  2237.   # ● ヘルプウィンドウの更新
  2238.   #--------------------------------------------------------------------------
  2239.   def update_help
  2240.     @help_window.set_id(cid)
  2241.   end
  2242.   #--------------------------------------------------------------------------
  2243.   # ● OK時の処理
  2244.   #--------------------------------------------------------------------------
  2245.   def ok
  2246.     redraw_current_item
  2247.     @help_window.refresh
  2248.   end
  2249. end


  2250. #==============================================================================
  2251. # ■ Window_DebugQuestStatus
  2252. #==============================================================================
  2253. class Window_DebugQuestStatus < Window_DebugBaseHorzCommand
  2254.   #--------------------------------------------------------------------------
  2255.   # ● オブジェクト初期化
  2256.   #--------------------------------------------------------------------------
  2257.   def initialize(rect)
  2258.     @id = nil
  2259.     super(rect)
  2260.   end
  2261.   #--------------------------------------------------------------------------
  2262.   # ● クエストID設定
  2263.   #--------------------------------------------------------------------------
  2264.   def set_id(id)
  2265.     return if @id == id
  2266.     @id = id
  2267.     return contents.clear if id.nil?
  2268.     refresh
  2269.   end
  2270.   #--------------------------------------------------------------------------
  2271.   # ● コマンド名の取得
  2272.   #--------------------------------------------------------------------------
  2273.   def command_name(index)
  2274.     super + (command_enabled?(index) ? "[ON]" : "[OFF]")
  2275.   end
  2276.   #--------------------------------------------------------------------------
  2277.   # ● コマンドの有効状態を取得
  2278.   #--------------------------------------------------------------------------
  2279.   def command_enabled?(index)
  2280.     return false if @id.nil?
  2281.     case index
  2282.     when 0; return $game_system.quest[@id].visible
  2283.     when 1; return $game_system.quest[@id].view_res
  2284.     when 2; return $game_system.quest[@id].view_cond
  2285.     end
  2286.   end
  2287.   #--------------------------------------------------------------------------
  2288.   # ● コマンドリストの作成
  2289.   #--------------------------------------------------------------------------
  2290.   def make_command_list
  2291.     add_command("一覧", :ok)
  2292.     add_command("報酬", :ok)
  2293.     add_command("進捗", :ok)
  2294.   end
  2295. end


  2296. #==============================================================================
  2297. # ■ Window_DebugQuestCmd
  2298. #==============================================================================
  2299. class Window_DebugQuestCmd < Window_DebugBase
  2300.   #--------------------------------------------------------------------------
  2301.   # ● オブジェクト初期化
  2302.   #--------------------------------------------------------------------------
  2303.   def initialize(rect)
  2304.     @commands = [
  2305.       "進捗中(開始)", "クリア済み", "失敗",
  2306.       "表示切替", "報酬表示切替", "進捗表示切替",
  2307.       "リセット"
  2308.     ]
  2309.     rect.width = 160
  2310.     rect.x = Graphics.width - rect.width
  2311.     super(rect)
  2312.   end
  2313.   #--------------------------------------------------------------------------
  2314.   # ● ウィンドウの表示
  2315.   #--------------------------------------------------------------------------
  2316.   def show
  2317. #~     self.visible = true
  2318.     self
  2319.   end
  2320.   #--------------------------------------------------------------------------
  2321.   # ● ウィンドウの非表示
  2322.   #--------------------------------------------------------------------------
  2323.   def hide
  2324. #~     self.visible = false
  2325.     self
  2326.   end
  2327.   #--------------------------------------------------------------------------
  2328.   # ● ウィンドウのアクティブ化
  2329.   #--------------------------------------------------------------------------
  2330.   def activate
  2331.     self.visible = true
  2332.     self.active = true
  2333.     self
  2334.   end
  2335.   #--------------------------------------------------------------------------
  2336.   # ● ウィンドウの非アクティブ化
  2337.   #--------------------------------------------------------------------------
  2338.   def deactivate
  2339.     self.visible = false
  2340.     self.active = false
  2341.     self
  2342.   end
  2343.   #--------------------------------------------------------------------------
  2344.   # ● 項目数の取得
  2345.   #--------------------------------------------------------------------------
  2346.   def item_max
  2347.     @commands.size
  2348.   end
  2349.   #--------------------------------------------------------------------------
  2350.   # ● アイテムの取得
  2351.   #--------------------------------------------------------------------------
  2352.   def item(i)
  2353.     @commands[i]
  2354.   end
  2355.   #--------------------------------------------------------------------------
  2356.   # ● 項目の描画
  2357.   #--------------------------------------------------------------------------
  2358.   def draw_item(index)
  2359.     draw_text(item_rect_for_text(index), item(index))
  2360.   end
  2361.   #--------------------------------------------------------------------------
  2362.   # ● ヘルプウィンドウの更新
  2363.   #--------------------------------------------------------------------------
  2364.   def update_help
  2365.     # 何もしない
  2366.   end
  2367.   #--------------------------------------------------------------------------
  2368.   # ● OK時の処理
  2369.   #--------------------------------------------------------------------------
  2370.   def ok
  2371.     case @index
  2372.     when 0; @help_window.citem.quest_start
  2373.     when 1; @help_window.citem.quest_clear(true, false)  # 強制
  2374.     when 2; @help_window.citem.quest_fail(true, false)   # 強制
  2375.     when 3; @help_window.citem.visible   = !@help_window.citem.visible
  2376.     when 4; @help_window.citem.view_res  = !@help_window.citem.view_res
  2377.     when 5; @help_window.citem.view_cond = !@help_window.citem.view_cond
  2378.     when 6; @help_window.citem.reset
  2379.     end
  2380.     hide
  2381.     @help_window.activate.ok
  2382.   end
  2383. end


  2384. #==============================================================================
  2385. # ■ Window_DebugSpirit
  2386. #==============================================================================
  2387. class Window_DebugSpirit < Window_DebugBase
  2388.   #--------------------------------------------------------------------------
  2389.   # ● 項目数の取得
  2390.   #--------------------------------------------------------------------------
  2391.   def item_max
  2392.     Spirits::SPIRIT_ACTOR.size
  2393.   end
  2394.   #--------------------------------------------------------------------------
  2395.   # ● 精霊IDの取得
  2396.   #--------------------------------------------------------------------------
  2397.   def id(i)
  2398.     Spirits::SPIRIT_ACTOR.keys[i]
  2399.   end
  2400.   #--------------------------------------------------------------------------
  2401.   # ● アクターIDの取得
  2402.   #--------------------------------------------------------------------------
  2403.   def aid(i)
  2404.     Spirits.actor_id(id(i))
  2405.   end
  2406.   #--------------------------------------------------------------------------
  2407.   # ● アイテムの取得
  2408.   #--------------------------------------------------------------------------
  2409.   def item(i)
  2410.     $game_actors[aid(i)]
  2411.   end
  2412.   #--------------------------------------------------------------------------
  2413.   # ● アイテムの変更
  2414.   #--------------------------------------------------------------------------
  2415.   def change
  2416.     if status(@index)
  2417.       $game_party.remove_spirit(cid)
  2418.     else
  2419.       $game_party.add_spirit(cid)
  2420.     end
  2421.   end
  2422.   #--------------------------------------------------------------------------
  2423.   # ● アイテム状態の取得
  2424.   #--------------------------------------------------------------------------
  2425.   def status(i)
  2426.     $game_party.include_spirit?(id(i))
  2427.   end
  2428.   #--------------------------------------------------------------------------
  2429.   # ● ステータステキスト
  2430.   #--------------------------------------------------------------------------
  2431.   def status_text(i)
  2432.     status(i) ? "[加入]" : "[未加入]"
  2433.   end
  2434.   #--------------------------------------------------------------------------
  2435.   # ● 名前の描画
  2436.   #--------------------------------------------------------------------------
  2437.   def draw_index_name(rect, index)
  2438.     draw_actor_line_graphic(item(index), rect.x, rect.y)
  2439.     draw_spirit_name(item(index), rect.x + 34, rect.y)
  2440.   end
  2441.   #--------------------------------------------------------------------------
  2442.   # ● 項目の描画
  2443.   #--------------------------------------------------------------------------
  2444.   def draw_item(index)
  2445.     draw_item_id_name_sw(index)
  2446.   end
  2447. end


  2448. #==============================================================================
  2449. # ■ Scene_Debug
  2450. #------------------------------------------------------------------------------
  2451. #  デバッグ画面の処理を行うクラスです。
  2452. #==============================================================================

  2453. class Scene_Debug < Scene_MenuBase
  2454.   #--------------------------------------------------------------------------
  2455.   # ● 開始処理
  2456.   #--------------------------------------------------------------------------
  2457.   def start
  2458.     super
  2459.     init_sub_windows
  2460.     create_help_window
  2461.     create_cmd_window
  2462.     create_number_window
  2463.     create_main_windows
  2464.     create_original_windows
  2465.     create_system_window   if DebugPP.spec("システム")
  2466.     @sub[@cmd_window.index].each {|w| w.show}
  2467.   end
  2468.   #--------------------------------------------------------------------------
  2469.   # ● 主要コマンド用ウィンドウを生成
  2470.   #--------------------------------------------------------------------------
  2471.   def create_main_windows
  2472.     create_switch_window   if DebugPP.spec("スイッチ")
  2473.     create_variable_window if DebugPP.spec("変数")
  2474.     create_selfsw_window   if DebugPP.spec("セルフSW")
  2475.     create_item_window     if DebugPP.spec("アイテム")
  2476.     create_weapon_window   if DebugPP.spec("武器")
  2477.     create_armor_window    if DebugPP.spec("防具")
  2478.     create_party_window    if DebugPP.spec("パーティー")
  2479.     create_actor_window    if DebugPP.spec("ステータス")
  2480.     create_skill_window    if DebugPP.spec("スキル")
  2481.     create_map_window      if DebugPP.spec("MAP移動")
  2482.     create_music_window    if DebugPP.spec("ミュージック")
  2483.   end
  2484.   #--------------------------------------------------------------------------
  2485.   # ● オリジナルコマンド用ウィンドウを生成
  2486.   #--------------------------------------------------------------------------
  2487.   def create_original_windows
  2488.     create_expert_window   if defined?(SysUpdate)  and DebugPP.spec("熟練度")
  2489.     create_dict_window     if defined?(Dictionary) and DebugPP.spec("用語辞典")
  2490.     create_worldmap_window if defined?(WorldMap)   and DebugPP.spec("WorldMap")
  2491.     create_quest_window    if defined?(Quest)      and DebugPP.spec("クエスト")
  2492.     create_spirit_window   if defined?(Spirits)    and DebugPP.spec("精霊")
  2493.   end
  2494.   #--------------------------------------------------------------------------
  2495.   # ● 終了処理
  2496.   #--------------------------------------------------------------------------
  2497.   def terminate
  2498.     super
  2499.     #$game_map.refresh
  2500.   end
  2501.   #--------------------------------------------------------------------------
  2502.   # ● 子Window情報の初期化
  2503.   #--------------------------------------------------------------------------
  2504.   def init_sub_windows
  2505.     @sub = []
  2506.     @sub_i = 0
  2507.   end
  2508.   #--------------------------------------------------------------------------
  2509.   # ● ヘルプウィンドウの作成
  2510.   #--------------------------------------------------------------------------
  2511.   def create_help_window
  2512.     @help_window = Window_Help.new
  2513.     @help_window.y = Graphics.height - @help_window.height
  2514.   end
  2515.   #--------------------------------------------------------------------------
  2516.   # ● コマンドウィンドウの作成
  2517.   #--------------------------------------------------------------------------
  2518.   def create_cmd_window
  2519.     @cmd_window = Window_DebugCommand.new(@help_window.y)
  2520.     @cmd_window.set_handler(:ok,     method(:enable_sub_window))
  2521.     @cmd_window.set_handler(:cancel, method(:return_scene))
  2522.     @cmd_window.set_handler(:update, method(:change_sub_window))
  2523.     @cmd_window.help_window = @help_window
  2524.   end
  2525.   #--------------------------------------------------------------------------
  2526.   # ● コマンド・ヘルプ以外のエリア
  2527.   #--------------------------------------------------------------------------
  2528.   def area
  2529.     Rect.new(@cmd_window.width, 0, Graphics.width - @cmd_window.width, @help_window.y)
  2530.   end
  2531.   #--------------------------------------------------------------------------
  2532.   # ● 子Window参照
  2533.   #--------------------------------------------------------------------------
  2534.   def sub
  2535.     @sub[@cmd_window.index][@sub_i]
  2536.   end
  2537.   #--------------------------------------------------------------------------
  2538.   # ● 子Window領域
  2539.   #--------------------------------------------------------------------------
  2540.   def sub_area
  2541.     w = sub
  2542.     Rect.new(w.x, w.y, w.width, w.height)
  2543.   end
  2544.   #--------------------------------------------------------------------------
  2545.   # ● 子Window差し替え
  2546.   #--------------------------------------------------------------------------
  2547.   def change_sub_window
  2548.     @sub.size.times do |i|
  2549.       i == @cmd_window.index ? @sub[i].each {|w| w.show} :
  2550.                                @sub[i].each {|w| w.hide}
  2551.     end
  2552.   end
  2553.   #--------------------------------------------------------------------------
  2554.   # ● 子Window有効化
  2555.   #--------------------------------------------------------------------------
  2556.   def enable_sub_window
  2557.     sub.activate.select(0)
  2558.     @num_window.item_window = sub
  2559.   end
  2560.   #--------------------------------------------------------------------------
  2561.   # ● 子Window無効化(all)
  2562.   #--------------------------------------------------------------------------
  2563.   def disable_sub_window
  2564.     @sub[@cmd_window.index].each {|w| w.deactivate.unselect}
  2565.     @num_window.item_window = nil
  2566.   end
  2567.   #--------------------------------------------------------------------------
  2568.   # ● 子WindowのOK処理
  2569.   #--------------------------------------------------------------------------
  2570.   def ok_sub_window
  2571.     sub.activate.ok
  2572.   end
  2573.   #--------------------------------------------------------------------------
  2574.   # ● 子WindowのOK処理(前の子Windowへ)
  2575.   #--------------------------------------------------------------------------
  2576.   def ok_prev_sub_window
  2577.     sub.ok
  2578.     prev_sub_window
  2579.   end
  2580.   #--------------------------------------------------------------------------
  2581.   # ● 子WindowのOK処理(次の子Windowへ)
  2582.   #--------------------------------------------------------------------------
  2583.   def next_sub_window
  2584.     sub.deactivate
  2585.     @sub_i += 1
  2586.     sub.activate
  2587.     sub.select(0) if sub.index < 0
  2588.   end
  2589.   #--------------------------------------------------------------------------
  2590.   # ● 子WindowのOK処理(前の子Windowへ)
  2591.   #--------------------------------------------------------------------------
  2592.   def prev_sub_window
  2593.     sub.deactivate
  2594.     @sub_i -= 1
  2595.     sub.activate
  2596.     sub.select(0) if sub.index < 0
  2597.   end
  2598.   #--------------------------------------------------------------------------
  2599.   # ● 子WindowのCancel処理
  2600.   #--------------------------------------------------------------------------
  2601.   def cancel_sub_window
  2602.     disable_sub_window
  2603.     @cmd_window.activate
  2604.   end
  2605.   #--------------------------------------------------------------------------
  2606.   # ● 数値ウィンドウの作成
  2607.   #--------------------------------------------------------------------------
  2608.   def create_number_window
  2609.     @num_window = Window_DebugInputNum.new(area)
  2610.     @num_window.z = 1000
  2611.     @num_window.set_handler(:ok,     method(:ok_num_window))
  2612.     @num_window.set_handler(:cancel, method(:cancel_num_window))
  2613.   end
  2614.   #--------------------------------------------------------------------------
  2615.   # ● 数値Windowの有効化
  2616.   #--------------------------------------------------------------------------
  2617.   def enable_num_window
  2618.     @num_window.show.activate.select_last.num = sub.number
  2619.   end
  2620.   #--------------------------------------------------------------------------
  2621.   # ● 数値Windowの有効化<resize>
  2622.   #--------------------------------------------------------------------------
  2623.   def enable_num_window_resize
  2624.     @num_window.show.activate.area(sub_area).sign = sub.sign
  2625.     @num_window.show.activate.area(sub_area).num_max = sub.num_max
  2626.     @num_window.select_last.num = sub.number
  2627.   end
  2628.   #--------------------------------------------------------------------------
  2629.   # ● 数値Windowの有効化<resize & maxmin>
  2630.   #--------------------------------------------------------------------------
  2631.   def enable_num_window_resize_maxmin
  2632.     @num_window.show.activate.area(sub_area).sign = sub.sign
  2633.     @num_window.show.activate.area(sub_area).num_max = sub.num_max
  2634.     @num_window.select_last.max = sub.max
  2635.     @num_window.select_last.min = sub.min
  2636.     @num_window.select_last.num = sub.number
  2637.   end
  2638.   #--------------------------------------------------------------------------
  2639.   # ● 数値Window無効化
  2640.   #--------------------------------------------------------------------------
  2641.   def disable_num_window
  2642.     @num_window.hide.deactivate.area(area)
  2643.   end
  2644.   #--------------------------------------------------------------------------
  2645.   # ● 数値WindowのOK処理
  2646.   #--------------------------------------------------------------------------
  2647.   def ok_num_window
  2648.     sub.number = @num_window.num
  2649.     sub.activate
  2650.     disable_num_window
  2651.   end
  2652.   #--------------------------------------------------------------------------
  2653.   # ● 数値WindowのCancel処理
  2654.   #--------------------------------------------------------------------------
  2655.   def cancel_num_window
  2656.     disable_num_window
  2657.     sub.activate
  2658.   end
  2659.   #--------------------------------------------------------------------------
  2660.   # ● スイッチWindow作成
  2661.   #--------------------------------------------------------------------------
  2662.   def create_switch_window
  2663.     @switch_window = Window_DebugSwitch.new(area)
  2664.     @switch_window.set_handler(:ok,     method(:ok_sub_window))
  2665.     @switch_window.set_handler(:cancel, method(:cancel_sub_window))
  2666.     @sub.push([@switch_window])
  2667.   end
  2668.   #--------------------------------------------------------------------------
  2669.   # ● 変数Window作成
  2670.   #--------------------------------------------------------------------------
  2671.   def create_variable_window
  2672.     @variable_window = Window_DebugVariable.new(area)
  2673.     @variable_window.set_handler(:ok,     method(:enable_num_window_resize_maxmin))
  2674.     @variable_window.set_handler(:cancel, method(:cancel_sub_window))
  2675.     @sub.push([@variable_window])
  2676.   end
  2677.   #--------------------------------------------------------------------------
  2678.   # ● セルフスイッチWindow作成
  2679.   #--------------------------------------------------------------------------
  2680.   def create_selfsw_window
  2681.     rect = area
  2682.     @selfsw_window = Window_DebugSelfSwitch.new(rect)
  2683.     rect.height = rect.height - @selfsw_window.height
  2684.     @selfsw_window.y = rect.height
  2685.     @selfsw_window.set_handler(:ok,     method(:ok_sub_window))
  2686.     @selfsw_window.set_handler(:cancel, method(:prev_sub_window))

  2687.     @ss_map_window = Window_DebugMapSelfSw.new(rect)
  2688.     @ss_map_window.set_handler(:ok,     method(:next_sub_window))
  2689.     @ss_map_window.set_handler(:cancel, method(:cancel_sub_window))
  2690.     @ss_map_window.help_window = @selfsw_window

  2691.     @sub.push([@ss_map_window, @selfsw_window])
  2692.   end
  2693.   #--------------------------------------------------------------------------
  2694.   # ● アイテムWindow作成
  2695.   #--------------------------------------------------------------------------
  2696.   def create_item_window
  2697.     @item_window = Window_DebugItem.new(area)
  2698.     @item_window.set_handler(:ok,     method(:enable_num_window_resize_maxmin))
  2699.     @item_window.set_handler(:cancel, method(:cancel_sub_window))
  2700.     @sub.push([@item_window])
  2701.   end
  2702.   #--------------------------------------------------------------------------
  2703.   # ● 武器Window作成
  2704.   #--------------------------------------------------------------------------
  2705.   def create_weapon_window
  2706.     @weapon_window = Window_DebugWeapon.new(area)
  2707.     @weapon_window.set_handler(:ok,     method(:enable_num_window_resize_maxmin))
  2708.     @weapon_window.set_handler(:cancel, method(:cancel_sub_window))
  2709.     @sub.push([@weapon_window])
  2710.   end
  2711.   #--------------------------------------------------------------------------
  2712.   # ● 防具Window作成
  2713.   #--------------------------------------------------------------------------
  2714.   def create_armor_window
  2715.     @armor_window = Window_DebugArmor.new(area)
  2716.     @armor_window.set_handler(:ok,     method(:enable_num_window_resize_maxmin))
  2717.     @armor_window.set_handler(:cancel, method(:cancel_sub_window))
  2718.     @sub.push([@armor_window])
  2719.   end
  2720.   #--------------------------------------------------------------------------
  2721.   # ● パーティーWindow作成
  2722.   #--------------------------------------------------------------------------
  2723.   def create_party_window
  2724.     @party_window = Window_DebugParty.new(area)
  2725.     @party_window.set_handler(:ok,     method(:ok_sub_window))
  2726.     @party_window.set_handler(:cancel, method(:cancel_sub_window))
  2727.     @sub.push([@party_window])
  2728.   end
  2729.   #--------------------------------------------------------------------------
  2730.   # ● アクターステータスWindow作成
  2731.   #--------------------------------------------------------------------------
  2732.   def create_actor_window
  2733.     rect = area
  2734.     @actor_window = Window_DebugActor.new(rect)
  2735.     @actor_window.set_handler(:ok,     method(:next_sub_window))
  2736.     @actor_window.set_handler(:cancel, method(:cancel_sub_window))

  2737.     rect.x     += @actor_window.width
  2738.     rect.width -= @actor_window.width
  2739.     @actor_st_window = Window_DebugActorStatus.new(rect)
  2740.     @actor_st_window.set_handler(:ok,     method(:enable_num_window_resize))
  2741.     @actor_st_window.set_handler(:cancel, method(:prev_sub_window))

  2742.     @actor_window.help_window = @actor_st_window
  2743.     @sub.push([@actor_window, @actor_st_window])
  2744.   end
  2745.   #--------------------------------------------------------------------------
  2746.   # ● スキルWindow作成
  2747.   #--------------------------------------------------------------------------
  2748.   def create_skill_window
  2749.     rect = area
  2750.     @skill_window = Window_DebugActor.new(rect)
  2751.     @skill_window.set_handler(:ok,     method(:next_sub_window))
  2752.     @skill_window.set_handler(:cancel, method(:cancel_sub_window))

  2753.     rect.x     += @skill_window.width
  2754.     rect.width -= @skill_window.width
  2755.     @skills_window = Window_DebugActorSkill.new(rect)
  2756.     @skills_window.set_handler(:ok,     method(:ok_sub_window))
  2757.     @skills_window.set_handler(:cancel, method(:prev_sub_window))

  2758.     @skill_window.help_window = @skills_window
  2759.     @sub.push([@skill_window, @skills_window])
  2760.   end
  2761.   #--------------------------------------------------------------------------
  2762.   # ● MapWindow作成
  2763.   #--------------------------------------------------------------------------
  2764.   def create_map_window
  2765.     @map_window = Window_DebugMap.new(area)
  2766.     @map_window.set_handler(:ok,     method(:return_scene))
  2767.     @map_window.set_handler(:cancel, method(:cancel_sub_window))
  2768.     @sub.push([@map_window])
  2769.   end
  2770.   #--------------------------------------------------------------------------
  2771.   # ● ミュージックWindow作成
  2772.   #--------------------------------------------------------------------------
  2773.   def create_music_window
  2774.     rect = area
  2775.     @music_ctg_window = Window_DebugMusicCtg.new(rect)
  2776.     rect.y      += @music_ctg_window.height
  2777.     rect.height -= @music_ctg_window.height
  2778.     @music_ctg_window.set_handler(:ok,     method(:next_sub_window))
  2779.     @music_ctg_window.set_handler(:cancel, method(:cancel_sub_window))

  2780.     @mugic_window = Window_DebugMusic.new(rect)
  2781.     @mugic_window.set_handler(:ok,     method(:ok_sub_window))
  2782.     @mugic_window.set_handler(:cancel, method(:prev_sub_window))
  2783.     @music_ctg_window.help_window = @mugic_window

  2784.     @sub.push([@music_ctg_window, @mugic_window])
  2785.   end
  2786.   #--------------------------------------------------------------------------
  2787.   # ● システムWindow作成
  2788.   #--------------------------------------------------------------------------
  2789.   def create_system_window
  2790.     @system_window = Window_DebugSystem.new(area)
  2791.     @system_window.set_handler(:ok,     method(:ok_sub_window))
  2792.     @system_window.set_handler(:input,  method(:enable_num_window_resize_maxmin))
  2793.     @system_window.set_handler(:cancel, method(:cancel_sub_window))
  2794.     @system_window.set_handler(:exit,   method(:return_scene))
  2795.     @sub.push([@system_window])
  2796.   end
  2797.   #--------------------------------------------------------------------------
  2798.   # ● 熟練度Window作成
  2799.   #--------------------------------------------------------------------------
  2800.   def create_expert_window
  2801.     rect = area
  2802.     @exp_act_window = Window_DebugActor.new(rect)
  2803.     @exp_act_window.set_handler(:ok,     method(:next_sub_window))
  2804.     @exp_act_window.set_handler(:cancel, method(:cancel_sub_window))

  2805.     rect.x     += @exp_act_window.width
  2806.     rect.width -= @exp_act_window.width
  2807.     @expert_window = Window_DebugActorExpert.new(rect)
  2808.     @expert_window.set_handler(:ok,     method(:enable_num_window_resize_maxmin))
  2809.     @expert_window.set_handler(:cancel, method(:prev_sub_window))
  2810.     @expert_window.set_handler(:x,      method(:change_taste))

  2811.     @exp_act_window.help_window = @expert_window
  2812.     @sub.push([@exp_act_window, @expert_window])
  2813.   end
  2814.   def change_taste
  2815.     sub.change_taste
  2816.   end
  2817.   #--------------------------------------------------------------------------
  2818.   # ● 用語辞典Window作成
  2819.   #--------------------------------------------------------------------------
  2820.   def create_dict_window
  2821.     rect = area
  2822.     @dict_ctg_window = Window_DebugDictCtg.new(rect)
  2823.     @dict_ctg_window.set_handler(:ok,     method(:next_sub_window))
  2824.     @dict_ctg_window.set_handler(:cancel, method(:cancel_sub_window))

  2825.     rect.x     += @dict_ctg_window.width
  2826.     rect.width -= @dict_ctg_window.width
  2827.     @dictionary_window = Window_DebugDictionary.new(rect)
  2828.     @dictionary_window.set_handler(:ok,     method(:ok_sub_window))
  2829.     @dictionary_window.set_handler(:cancel, method(:prev_sub_window))

  2830.     @dict_ctg_window.help_window = @dictionary_window
  2831.     @sub.push([@dict_ctg_window, @dictionary_window])
  2832.   end
  2833.   #--------------------------------------------------------------------------
  2834.   # ● ワールドマップWindow作成
  2835.   #--------------------------------------------------------------------------
  2836.   def create_worldmap_window
  2837.     rect = area
  2838.     @wd_region_window = Window_DebugWorldRegion.new(rect)
  2839.     @wd_region_window.set_handler(:ok,     method(:next_sub_window))
  2840.     @wd_region_window.set_handler(:cancel, method(:cancel_sub_window))
  2841.     @wd_region_window.set_handler(:x,      method(:ok_sub_window))

  2842.     rect.y      += @wd_region_window.height
  2843.     rect.height -= @wd_region_window.height
  2844.     @wd_town_window = Window_DebugWorldTown.new(rect)
  2845.     @wd_town_window.set_handler(:ok,     method(:ok_sub_window))
  2846.     @wd_town_window.set_handler(:cancel, method(:prev_sub_window))

  2847.     @wd_region_window.help_window = @wd_town_window
  2848.     @sub.push([@wd_region_window, @wd_town_window])
  2849.   end
  2850.   #--------------------------------------------------------------------------
  2851.   # ● クエストWindow作成
  2852.   #--------------------------------------------------------------------------
  2853.   def create_quest_window
  2854.     rect = area
  2855.     @qt_ctg_window = Window_DebugQuestCtg.new(rect)
  2856.     @qt_ctg_window.set_handler(:ok,     method(:next_sub_window))
  2857.     @qt_ctg_window.set_handler(:cancel, method(:cancel_sub_window))
  2858.    
  2859.     rect.y      += @qt_ctg_window.height
  2860.     rect.height -= @qt_ctg_window.height
  2861.     @qt_st_window = Window_DebugQuestStatus.new(rect)
  2862.     @qt_st_window.y = rect.y + rect.height - @qt_st_window.height
  2863.    
  2864.     rect.height -= @qt_st_window.height
  2865.     @quest_window = Window_DebugQuest.new(rect)
  2866.     @quest_window.set_handler(:ok,     method(:next_sub_window))
  2867.     @quest_window.set_handler(:cancel, method(:prev_sub_window))

  2868.     @qt_cmd_window = Window_DebugQuestCmd.new(rect)
  2869.     @qt_cmd_window.set_handler(:ok,     method(:ok_prev_sub_window))
  2870.     @qt_cmd_window.set_handler(:cancel, method(:prev_sub_window))

  2871.     @qt_ctg_window.help_window = @quest_window
  2872.     @quest_window.help_window = @qt_st_window
  2873.     @qt_cmd_window.help_window = @quest_window
  2874.     @sub.push([@qt_ctg_window, @quest_window, @qt_cmd_window, @qt_st_window])
  2875.   end
  2876.   #--------------------------------------------------------------------------
  2877.   # ● 精霊Window作成
  2878.   #--------------------------------------------------------------------------
  2879.   def create_spirit_window
  2880.     @spirit_window = Window_DebugSpirit.new(area)
  2881.     @spirit_window.set_handler(:ok,     method(:ok_sub_window))
  2882.     @spirit_window.set_handler(:cancel, method(:cancel_sub_window))
  2883.     @sub.push([@spirit_window])
  2884.   end
  2885. end
复制代码
      

点评

論壇自動把('$') 変成('[/fold]')xx原版在http://www4.plala.or.jp/findias/codecrush/material/vxace_rgss3/index.html找デバッグ++  发表于 2015-5-18 16:33
1112応是if sign && sign.include?('$')  发表于 2015-5-18 16:27
if sign && sign.include?('[/fold]'),第1112行少写一个单引号  发表于 2015-5-18 16:21
Code Crush的1112行不对,劳烦核对一下  发表于 2015-5-18 16:17

评分

参与人数 2星屑 +160 梦石 +1 收起 理由
taroxd + 1 认可答案
喵呜喵5 + 160 我很赞同

查看全部评分

回复

使用道具 举报

梦石
0
星屑
82
在线时间
26 小时
注册时间
2010-12-3
回帖
13
 楼主| 发表于 2015-5-20 09:43:51 | 显示全部楼层
本帖最后由 pjy612 于 2015-5-20 11:06 编辑
tseyik 发表于 2015-5-18 10:17
有.


焼きノリ3

( ^ω^)多谢大大 看来要自己翻译一番。。。

方便后人:
第一种脚本稍微整理汉化了下:
VA调试拓展.zip (15.17 KB, 下载次数: 110)
第二种脚本 引用上楼点评中的地址
方便查看:
http://www4.plala.or.jp/findias/codecrush/material/vxace_rgss3/index.html
左侧选
システム設定->デバッグ++
然后有类似的脚本
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-5-20 10:11:49 | 显示全部楼层
加一句
如果想把DEBUG用在正常遊戲上(當成彩旦用)
參考Scene_Map中的
  def update_call_debug
    SceneManager.call(Scene_Debug) if $TEST && Input.press?(:F9)
  end
  #-------
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部