设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1832|回复: 1
打印 上一主题 下一主题

[转载] 发一个自己汉化的调试模式机能扩张的脚本!

[复制链接]

Lv4.逐梦者

梦石
0
星屑
6380
在线时间
920 小时
注册时间
2006-7-18
帖子
505
跳转到指定楼层
1
发表于 2015-1-22 02:50:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
找了一下,发现站里似乎没有,就发个上来,日文不多,所以对着翻译工具一会儿就翻译完了!
原地址:http://www4.plala.or.jp/findias/ ... ce_rgss3/index.html
  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.   - 全初期化、任务状態変更、任务Rank変更
  29. ・精霊系统
  30.   - 精霊の加入状態の変更、精霊の状态編集
  31. =end
  32. #==============================================================================

  33. module DebugPP
  34.   # 項目有効/無効
  35.   SPEC = {
  36.     "开关"     => true,
  37.     "変数"         => true,
  38.     "独立开关"     => 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("独立开关",     :ok, true, self_sw_text)  if DebugPP.spec("独立开关")
  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.     ["音楽变更。", "Z (Enter)--播放 / S--停止 / X--返回"]
  171.   end
  172.   def system_text
  173.     ["其它、各种各样的变更。", "Z (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.     [url=home.php?mod=space&uid=25307]@Max[/url] = 99999999
  221.     @sign = false
  222.     @pm_sign = true
  223.     [url=home.php?mod=space&uid=25749]@min[/url] = 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.   # ● 光标往右移動(前进10格)
  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 + 10) > (item_max - 1)
  444.         select(item_max - 1)
  445.       else
  446.         select((index + 10) % item_max)
  447.       end
  448.     end
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # ● 光标往左移動(后退10格)
  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 - 10) < 0
  458.         select(0)
  459.       else
  460.         select((index - 10 + 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?(')
  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("任务Rank",        :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 ? "640x480" : "800x600"
  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("独立开关")
  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
复制代码

Lv4.逐梦者

梦石
0
星屑
6380
在线时间
920 小时
注册时间
2006-7-18
帖子
505
2
 楼主| 发表于 2015-1-22 19:28:40 | 只看该作者
刚发现,原作者不允许转载,怪不得没人放!管理员帮删了吧!
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-28 04:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表