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

Project1

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

[综合信息] 【VX】【汉化+加强】DEBUG工具

[复制链接]

Lv1.梦旅人

星君

梦石
0
星屑
83
在线时间
2980 小时
注册时间
2011-10-9
帖子
2317

贵宾短篇七萝莉正太组冠军

跳转到指定楼层
1
发表于 2012-6-17 02:12:23 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
大家好,我好久没发帖了呢……
最近真的没动力啊,真的没
然后为了刷下存在感,我汉化了这个脚本,
因为我不擅长做说明什么的,所以我就多说点废话
大家看作是说明就行了
首先呢,这个脚本并不是我原创的
不过有原创内容,当然,版权归OriginalWij所有
这脚本的主要功能有:
在地图上的时候可以传送到xxx地图,可以调整坐标
在地图上的时候可以随时存档
在地图上的时候可以打开DEBUG用的背包,可以自己增减道具,武器,防具,金钱,角色
在地图上的时候可以打开图标查看器,这个东西可以查看图标的ID,对脚本编写者很有用
在地图上的时候可以打开变量&开关搜索器,这个东西可以查看你的游戏里出现的开关或变量的地方(搜索范围为,脚本,公共事件和事件)

截图:


脚本:
插入到MAIN的上面即可
  1. #==============================================================================
  2. # Debug Tools
  3. #
  4. # 作者 : OriginalWij + Yanfly + 星君
  5. #
  6. # 版本 : 2.0
  7. #
  8. # 星君的话:
  9. #
  10. #  本脚本并不是本人原创的,本人只是给这个脚本加了功能,而且汉化了
  11. #  不过我相信我的版本不比原版差
  12. #  请大家多多包涵
  13. #
  14. # 版本:
  15. #
  16. #  v1.0  - 原版
  17. #   - 开始公开
  18. #
  19. #  v1.2  - 星君的版本
  20. #   - 替换ICON查看器,增加变量和开关全局查看,并保存为txt格式
  21. #
  22. #  v2.0  - 星君的版本
  23. #   - 结束更新,最终版
  24. #
  25. # 调用按键 :F7
  26. #==============================================================================

  27. #==============================================================================
  28. # Window_NumberInput
  29. #==============================================================================
  30. class Window_NumberInput < Window_Base
  31.   attr_accessor :index
  32.   def index
  33.     return @index
  34.   end
  35.   def index=(new_index)
  36.     @index = new_index
  37.   end
  38. end

  39. #==============================================================================
  40. # Scene_Map
  41. #==============================================================================
  42. class Scene_Map < Scene_Base
  43.   alias test_keys_update update unless $@
  44.   def update
  45.     test_keys_update
  46.     if Input.trigger?(Input::F7) and $TEST
  47.       Sound.play_decision
  48.       $scene = Scene_DebugSelect.new
  49.     end
  50.   end
  51. end

  52. #==============================================================================
  53. # Scene_Debug
  54. #==============================================================================
  55. class Scene_Debug < Scene_Base
  56.   def update_left_input
  57.     if Input.trigger?(Input::B)
  58.       Sound.play_cancel
  59.       $scene = Scene_Map.new
  60.       return
  61.     elsif Input.trigger?(Input::C)
  62.       Sound.play_decision
  63.       wlh = 28
  64.       if @left_window.mode == 0
  65.         text1 = 'C » ON / OFF'
  66.         @help_window.contents.draw_text(4, 0, 336, wlh, text1)
  67.       else
  68.         text1 = 'LEFT → -1'   
  69.         text2 = 'RIGHT → +1'   
  70.         text3 = 'L → -10'   
  71.         text4 = 'R → +10'   
  72.         text5 = 'X → -100'
  73.         text6 = 'Y → +100'
  74.         text7 = 'Z → Clear\c[0]'
  75.         @help_window.contents.draw_text(4, wlh * 0, 336, wlh, text1)
  76.         @help_window.contents.draw_text(4, wlh * 1, 336, wlh, text2)
  77.         @help_window.contents.draw_text(4, wlh * 2, 336, wlh, text3)
  78.         @help_window.contents.draw_text(4, wlh * 3, 336, wlh, text4)
  79.         @help_window.contents.draw_text(172, wlh * 0, 336, wlh, text5)
  80.         @help_window.contents.draw_text(172, wlh * 1, 336, wlh, text6)
  81.         @help_window.contents.draw_text(172, wlh * 2, 336, wlh, text7)
  82.       end
  83.       @left_window.active = false
  84.       @right_window.active = true
  85.       @right_window.index = 0
  86.     end
  87.   end
  88.   alias test_keys_sd_update_right_input update_right_input unless $@
  89.   def update_right_input
  90.     test_keys_sd_update_right_input
  91.     if Input.repeat?(Input::X) and @right_window.mode == 1
  92.       Sound.play_decision
  93.       $game_variables[@right_window.top_id + @right_window.index] -= 100
  94.       @right_window.draw_item(@right_window.index)
  95.     elsif Input.repeat?(Input::Y) and @right_window.mode == 1
  96.       Sound.play_decision
  97.       $game_variables[@right_window.top_id + @right_window.index] += 100
  98.       @right_window.draw_item(@right_window.index)
  99.     elsif Input.trigger?(Input::Z) and @right_window.mode == 1
  100.       Sound.play_decision
  101.       $game_variables[@right_window.top_id + @right_window.index] = 0
  102.       @right_window.draw_item(@right_window.index)
  103.     end
  104.   end
  105. end
  106.   
  107. #==============================================================================
  108. # Map_Select_Window
  109. #==============================================================================
  110. class Map_Select_Window < Window_Base
  111.   def initialize
  112.     super(0, 56, 160, 120)
  113.     refresh
  114.   end
  115.   def refresh
  116.     self.contents.clear
  117.     self.contents.font.color = system_color
  118.     self.contents.draw_text(0, 0, 120, WLH, '地图 ID:', 0)
  119.     self.contents.draw_text(0, 32, 120, WLH, 'X:', 0)
  120.     self.contents.draw_text(0, 64, 120, WLH, 'Y:', 0)
  121.   end
  122. end

  123. #==============================================================================
  124. # Map_Keys_Window
  125. #==============================================================================
  126. class Map_Keys_Window < Window_Base
  127.   def initialize
  128.     super(0, 264, 160, 152)
  129.     refresh
  130.   end
  131.   def refresh
  132.     self.contents.clear
  133.     self.contents.font.color = crisis_color
  134.     self.contents.font.size = 16
  135.     self.contents.draw_text(4, 0, 120, WLH, 'Z → 选择坐标', 0)
  136.     self.contents.draw_text(4, 32, 120, WLH, 'R → 下一个', 0)
  137.     self.contents.draw_text(4, 64, 120, WLH, 'L → 前一个', 0)
  138.     self.contents.draw_text(4, 96, 120, WLH, 'C → 传送', 0)
  139.   end
  140. end

  141. #==============================================================================
  142. # Item_Keys_Window
  143. #==============================================================================
  144. class Item_Keys_Window < Window_Base
  145.   def initialize
  146.     super(0, 208, 160, 208)
  147.     unfresh
  148.   end
  149.   def unfresh
  150.     self.contents.clear
  151.   end
  152.   def refresh_items
  153.     self.contents.clear
  154.     self.contents.font.color = crisis_color
  155.     self.contents.font.size = 16
  156.     self.contents.draw_text(4, 2, 120, 24, 'UP → 前一个', 0)
  157.     self.contents.draw_text(4, 32, 120, 24, 'DOWN → 下一个', 0)
  158.     self.contents.draw_text(4, 62, 120, 24, 'C → +1', 0)
  159.     self.contents.draw_text(4, 92, 120, 24, 'Z → +10', 0)
  160.     self.contents.draw_text(4, 122, 120, 24, 'Y → -1', 0)
  161.     self.contents.draw_text(4, 152, 120, 24, 'X → -10', 0)
  162.   end
  163.   def refresh_gold
  164.     self.contents.clear
  165.     self.contents.font.color = crisis_color
  166.     self.contents.font.size = 16
  167.     self.contents.draw_text(4, 2, 120, 24, 'UP → +100', 0)
  168.     self.contents.draw_text(4, 32, 120, 24, 'DOWN → -100', 0)
  169.     self.contents.draw_text(4, 62, 120, 24, 'L → +1,000', 0)
  170.     self.contents.draw_text(4, 92, 120, 24, 'R → -1,000', 0)
  171.     self.contents.draw_text(4, 122, 120, 24, 'X → +10,000', 0)
  172.     self.contents.draw_text(4, 152, 120, 24, 'Y → -10,000', 0)
  173.   end
  174.   def refresh_actors
  175.     self.contents.clear
  176.     self.contents.font.color = crisis_color
  177.     self.contents.font.size = 16
  178.     self.contents.draw_text(4, 2, 120, 24, 'RIGHT → 移除队伍', 0)
  179.     self.contents.draw_text(4, 32, 120, 24, 'LEFT → 加到队伍', 0)
  180.     self.contents.draw_text(4, 62, 120, 24, 'C → 查看状态', 0)
  181.   end
  182.   def refresh_actors_stats
  183.     self.contents.clear
  184.     self.contents.font.color = crisis_color
  185.     self.contents.font.size = 16
  186.     self.contents.draw_text(4, 2, 120, 24, 'A → +1', 0)
  187.     self.contents.draw_text(4, 32, 120, 24, 'Z → -1', 0)
  188.     self.contents.draw_text(4, 62, 120, 24, 'L → +10', 0)
  189.     self.contents.draw_text(4, 92, 120, 24, 'R → -10', 0)
  190.     self.contents.draw_text(4, 122, 120, 24, 'X → +100', 0)
  191.     self.contents.draw_text(4, 152, 120, 24, 'Y → -100', 0)
  192.   end
  193. end

  194. #==============================================================================
  195. # Misc_Window
  196. #==============================================================================
  197. class Misc_Window < Window_Base
  198.   def initialize(x, y, width, height)
  199.     super(x, y, width, height)
  200.     refresh
  201.   end
  202.   def refresh
  203.     self.contents.clear
  204.   end
  205. end

  206. #==============================================================================
  207. # Party_Member_Select_Window
  208. #==============================================================================
  209. class Party_Member_Select_Window < Window_Selectable
  210.   def initialize(x, y, width, height, stats = false)
  211.     super(x, y, width, height)
  212.     if stats
  213.       @pmsw = 36
  214.       @item_max = 9
  215.     else
  216.       @pmsw = 40
  217.       @item_max = 20
  218.     end
  219.     @column_max = 1
  220.     self.opacity = 0
  221.     self.index = 0
  222.     self.contents.clear
  223.   end
  224.   def item_rect(index)
  225.     rect = Rect.new(0, 0, 0, 0)
  226.     rect.width = (contents.width + @spacing) / @column_max - @spacing
  227.     rect.height = @pmsw
  228.     rect.x = index % @column_max * (rect.width + @spacing)
  229.     rect.y = index / @column_max * @pmsw
  230.     return rect
  231.   end
  232.   def update_cursor
  233.     if @index < 0               
  234.       self.cursor_rect.empty
  235.     elsif @index < @item_max   
  236.       super
  237.     elsif @index >= 100         
  238.       self.cursor_rect.set(0, (@index - 100) * @pmsw,
  239.         contents.width, @pmsw)
  240.     else                        
  241.       self.cursor_rect.set(0, 0, contents.width, @item_max * @pmsw)
  242.     end
  243.   end
  244. end

  245. #==============================================================================
  246. # Item_Display_Window
  247. #==============================================================================
  248. class Item_Display_Window < Window_Selectable
  249.   def initialize(data)
  250.     super(160, 52, 384, 368)
  251.     @data = data
  252.     @item_max = @data.size - 1
  253.     @column_max = 1
  254.     self.opacity = 0
  255.     self.index = 0
  256.     refresh
  257.   end
  258.   def refresh
  259.     create_contents
  260.     for i in 0...@item_max
  261.       draw_item(i)
  262.     end
  263.   end
  264.   def draw_item(index)
  265.     rect = item_rect(index)
  266.     self.contents.clear_rect(rect)
  267.     item = @data[index + 1]
  268.     if item != nil
  269.       number = $game_party.item_number(item)
  270.       rect.width -= 4
  271.       draw_item_name(item, rect.x, rect.y, true)
  272.       self.contents.draw_text(rect, sprintf(":%2d", number), 2)
  273.     end
  274.   end
  275. end

  276. #==============================================================================
  277. # Scene_Teleport
  278. #==============================================================================
  279. class Scene_Teleport < Scene_Base
  280.   def initialize
  281.     @map_id = 1
  282.     @map_x = @map_y = @active_input = 0
  283.     @cursor_count = 17
  284.     @blink = false
  285.   end
  286.   def start
  287.     create_menu_background
  288.     @info_window = Window_Help.new
  289.     @map_name_window = Window_Help.new
  290.     @info_window.width = @map_name_window.x = 160
  291.     @map_name_window.width = 384
  292.     @map_name_window.height = 33
  293.     @info_window.create_contents
  294.     @map_name_window.create_contents
  295.     @map_display_window = Misc_Window.new(160, 32, 384, 384)
  296.     @map_text_window = Misc_Window.new(160, -16, 384, 432)
  297.     @map_text_window.opacity = 0
  298.     @map_text_window.z = @map_display_window.z + 1
  299.     @map_text_window.active = false
  300.     @map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
  301.     @map_select_window = Map_Select_Window.new
  302.     @map_confirm_window = Misc_Window.new(0, 176, 160, 88)
  303.     @map_keys_window = Map_Keys_Window.new
  304.     @input_window = []
  305.     for i in 0..2
  306.       @input_window[i] = Window_NumberInput.new
  307.       @input_window[i].number = 1 if i == 0
  308.       @input_window[i].index = 2
  309.       @input_window[i].update_cursor
  310.       @input_window[i].digits_max = 3
  311.       @input_window[i].x = 48
  312.       @input_window[i].y = 56 + (i * 32)
  313.     end
  314.     @map_info = load_data('Data/MapInfos.rvdata')
  315.     create_target(@map.data, 0, 0)
  316.     @input_window[0].active = true
  317.   end
  318.   def terminate
  319.     dispose_menu_background
  320.     dispose_target_map
  321.     @info_window.dispose
  322.     @map_name_window.dispose
  323.     @map_display_window.dispose
  324.     @map_text_window.dispose
  325.     @map_select_window.dispose
  326.     if @confirm_window != nil
  327.       @confirm_window.dispose
  328.       @confirm_window = nil
  329.     end
  330.     @map_confirm_window.dispose
  331.     @map_keys_window.dispose
  332.     for i in 0..2
  333.       @input_window[i].dispose
  334.     end
  335.   end
  336.   def update
  337.     update_menu_background
  338.     case @active_input
  339.     when 0
  340.       @info_window.set_text('选择地图……', 1)
  341.     when 1
  342.       @info_window.set_text('选择X值……', 1)
  343.     when 2
  344.       @info_window.set_text('选择Y值……', 1)
  345.     else
  346.       @info_window.set_text('选择X&Y值……', 1)
  347.     end
  348.     @info_window.set_text('传送?', 1) if @confirm_window != nil
  349.     @map_display_window.update
  350.     @map_text_window.update
  351.     @map_select_window.update
  352.     @map_keys_window.update
  353.     for i in 0..2
  354.       @input_window[i].update
  355.     end
  356.     if @confirm_window != nil
  357.       @confirm_window.update
  358.     end
  359.     if Input.trigger?(Input::Z)
  360.       if @confirm_window == nil and @active_input < 3
  361.         Sound.play_decision
  362.         @active_input += 10
  363.         for i in 0..2
  364.           @input_window[i].active = false
  365.         end
  366.         @map_text_window.active = true
  367.       elsif @confirm_window == nil
  368.         Sound.play_cancel
  369.         @active_input -= 10
  370.         @map_text_window.active = false
  371.         @input_window[@active_input].active = true
  372.       end
  373.     elsif Input.trigger?(Input::B)
  374.       Sound.play_cancel
  375.       if @confirm_window != nil
  376.         @confirm_window.active = false
  377.         reset_active_input
  378.         @confirm_window.dispose
  379.         @confirm_window = nil
  380.       else
  381.         $scene = Scene_Map.new
  382.       end
  383.     elsif Input.trigger?(Input::C)
  384.       if @confirm_window != nil
  385.         if @confirm_window.index == 0
  386.           Sound.play_load
  387.           $game_player.reserve_transfer(@input_window[0].number,
  388.             @input_window[1].number, @input_window[2].number, 0)
  389.           for i in 1..20
  390.             $game_map.screen.pictures[i].erase
  391.           end
  392.           $scene = Scene_Map.new
  393.         else
  394.           Sound.play_decision
  395.           @confirm_window.active = false
  396.           reset_active_input
  397.           @confirm_window.dispose
  398.           @confirm_window = nil
  399.         end
  400.       else
  401.         Sound.play_decision
  402.         com1 = '确认'
  403.         com2 = '返回'
  404.         @confirm_window = Window_Command.new(160, [com1, com2])
  405.         @confirm_window.index = 1
  406.         @confirm_window.y = 180
  407.         @confirm_window.opacity = 0
  408.         for i in 0..2
  409.           @input_window[i].active = false
  410.         end
  411.         @map_text_window.active = false
  412.         @confirm_window.active = true
  413.       end
  414.     elsif Input.repeat?(Input::UP) and @map_text_window.active == true
  415.       if @input_window[2].number > 0
  416.         adjust_y(-1)
  417.       end
  418.     elsif Input.repeat?(Input::DOWN) and @map_text_window.active == true
  419.       if @input_window[2].number < @map.height - 1
  420.         adjust_y(1)
  421.       end
  422.     elsif Input.repeat?(Input::LEFT) and @map_text_window.active == true
  423.       if @input_window[1].number > 0
  424.         adjust_x(-1)
  425.       end
  426.     elsif Input.repeat?(Input::RIGHT) and @map_text_window.active == true
  427.       if @input_window[1].number < @map.width - 1
  428.         adjust_x(1)
  429.       end
  430.     elsif Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN) and
  431.         @map_text_window.active == false
  432.       mapid = @input_window[0].number
  433.       filename = sprintf("Data/Map%03d.rvdata", mapid)
  434.       dispose_target_map
  435.       @map_display_window.refresh
  436.       @map_text_window.refresh
  437.       if FileTest.exist?(filename)
  438.         @map_id = @input_window[0].number
  439.         if @input_window[1].number > 4
  440.           @map_x = (@input_window[1].number - 5) * 256
  441.         else
  442.           @map_x = 0
  443.         end
  444.         if @input_window[2].number > 4
  445.           @map_y = (@input_window[2].number - 5) * 256
  446.         else
  447.           @map_y = 0
  448.         end
  449.         @map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
  450.         if @map_x > ((@map.width * 256) - 2816)
  451.           @map_x = ((@map.width * 256) - 2816)
  452.         end
  453.         if @map_y > ((@map.height * 256) - 2816)
  454.           @map_y = ((@map.height * 256) - 2816)
  455.         end
  456.         if @input_window[1].number > @map.width - 1
  457.           index = @input_window[1].index
  458.           @input_window[1].number = @map.width - 1
  459.           @input_window[1].index = index
  460.           @input_window[1].update_cursor
  461.         end
  462.         if @input_window[2].number > @map.height - 1
  463.           index = @input_window[2].index
  464.           @input_window[2].number = @map.height - 1
  465.           @input_window[2].index = index
  466.           @input_window[2].update_cursor
  467.         end
  468.         create_target(@map.data, @map_x, @map_y)
  469.       else
  470.         text = '地图 #' + @input_window[0].number.to_s + ' 不存在……'
  471.         @map_text_window.contents.draw_text(16, 4, 320, 24, text, 1)
  472.       end
  473.     elsif Input.trigger?(Input::L) and @map_text_window.active == false
  474.       Sound.play_cursor
  475.       @active_input -= 1
  476.       @active_input = 2 if @active_input < 0
  477.       for i in 0..2
  478.         @input_window[i].active = false
  479.       end
  480.       @input_window[@active_input].active = true
  481.     elsif Input.trigger?(Input::R) and @map_text_window.active == false
  482.       Sound.play_cursor
  483.       @active_input += 1
  484.       @active_input = 0 if @active_input > 2
  485.       for i in 0..2
  486.         @input_window[i].active = false
  487.       end
  488.       @input_window[@active_input].active = true
  489.     end
  490.     mx = calc_x
  491.     my = calc_y
  492.     if @map_text_window.active == true
  493.       if @cursor_count == 0 and @blink == true
  494.         @cursor_count = 17
  495.         @blink = false
  496.         @map_text_window.contents.fill_rect(mx, my + 48, 32, 32,
  497.           Color.new(0, 255, 0, 255 - @cursor_count * 15))
  498.         @map_text_window.contents.fill_rect(mx + 2, my + 50, 28, 28,
  499.           Color.new(0, 255, 0, (255 - (@cursor_count * 15)) / 2))
  500.       elsif @cursor_count == 0 and @blink == false
  501.         @cursor_count = 17
  502.         @blink = true
  503.         @map_text_window.contents.fill_rect(mx, my + 48, 32, 32,
  504.           Color.new(0, 255, 0, @cursor_count * 15))
  505.         @map_text_window.contents.fill_rect(mx + 2, my + 50, 28, 28,
  506.           Color.new(0, 255, 0, (@cursor_count * 15) / 2))
  507.       else
  508.         @cursor_count -= 1
  509.         if @blink == true
  510.           @map_text_window.contents.fill_rect(mx, my + 48, 32, 32,
  511.             Color.new(0, 255, 0, @cursor_count * 15))
  512.           @map_text_window.contents.fill_rect(mx + 2, my + 50, 28, 28,
  513.             Color.new(0, 255, 0, (@cursor_count * 15) / 2))
  514.         else
  515.           @map_text_window.contents.fill_rect(mx, my + 48, 32, 32,
  516.             Color.new(0, 255, 0, 255 - @cursor_count * 15))
  517.           @map_text_window.contents.fill_rect(mx + 2, my + 50, 28, 28,
  518.             Color.new(0, 255, 0, (255 - (@cursor_count * 15)) / 2))
  519.         end
  520.       end
  521.     else
  522.       mapid = @input_window[0].number
  523.       filename = sprintf("Data/Map%03d.rvdata", mapid)
  524.       if FileTest.exist?(filename)
  525.         @map_text_window.contents.fill_rect(mx, my + 48, 32, 32,
  526.           Color.new(255, 0, 0, 255))
  527.         @map_text_window.contents.fill_rect(mx + 2, my + 50, 28, 28,
  528.           Color.new(255, 0, 0, 128))
  529.       else
  530.         @map_text_window.contents.clear_rect(mx, my + 48, 32, 32)
  531.       end
  532.     end
  533.   end
  534.   def create_target(map_data, ox, oy)
  535.     @viewport = Viewport.new(@map_display_window.x + 16,
  536.       @map_display_window.y + 16, 352,352)
  537.     @viewport.z = @map_display_window.z
  538.     @target_map = Tilemap.new(@viewport)
  539.     @target_map.bitmaps[0] = Cache.system("TileA1")
  540.     @target_map.bitmaps[1] = Cache.system("TileA2")
  541.     @target_map.bitmaps[2] = Cache.system("TileA3")
  542.     @target_map.bitmaps[3] = Cache.system("TileA4")
  543.     @target_map.bitmaps[4] = Cache.system("TileA5")
  544.     @target_map.bitmaps[5] = Cache.system("TileB")
  545.     @target_map.bitmaps[6] = Cache.system("TileC")
  546.     @target_map.bitmaps[7] = Cache.system("TileD")
  547.     @target_map.bitmaps[8] = Cache.system("TileE")
  548.     @target_map.map_data = map_data
  549.     @target_map.ox = ox / 8
  550.     @target_map.oy = oy / 8
  551.     filename = sprintf("Data/Map%03d.rvdata", @map_id)
  552.     if FileTest.exist?(filename)
  553.       mx = calc_x
  554.       my = calc_y
  555.       @map_text_window.contents.fill_rect(mx, my + 48, 32, 32,
  556.         Color.new(255, 0, 0, 255))
  557.       @map_text_window.contents.fill_rect(mx + 2, my + 50, 28, 28,
  558.         Color.new(255, 0, 0, 128))
  559.       @map_text_window.contents.font.size = 16
  560.       text = @map_info[@map_id].name
  561.       @map_text_window.contents.draw_text(16, 4, 320, 24, text, 1)
  562.     end
  563.   end
  564.   def dispose_target_map
  565.     unless @target_map == nil
  566.       @target_map.dispose
  567.       @target_map = nil
  568.     end
  569.   end
  570.   def reset_active_input
  571.     case @active_input
  572.     when 0
  573.       @input_window[0].active = true
  574.     when 1
  575.       @input_window[1].active = true
  576.     when 2
  577.       @input_window[2].active = true
  578.     else
  579.       @map_text_window.active = true
  580.     end
  581.   end
  582.   def adjust_x(adj_x)
  583.     Sound.play_cursor
  584.     index = @input_window[1].index
  585.     @input_window[1].number += adj_x
  586.     @input_window[1].index = index
  587.     @input_window[1].update_cursor
  588.     if @input_window[1].number > 4
  589.       @map_x = (@input_window[1].number - 5) * 256
  590.     else
  591.       @map_x = 0
  592.     end
  593.     if @map_x > ((@map.width * 256) - 2816)
  594.       @map_x = ((@map.width * 256) - 2816)
  595.     end
  596.     dispose_target_map
  597.     @map_text_window.refresh
  598.     create_target(@map.data, @map_x, @map_y)
  599.   end
  600.   def adjust_y(adj_y)
  601.     Sound.play_cursor
  602.     index = @input_window[2].index
  603.     @input_window[2].number += adj_y
  604.     @input_window[2].index = index
  605.     @input_window[2].update_cursor
  606.     if @input_window[2].number > 4
  607.       @map_y = (@input_window[2].number - 5) * 256
  608.     else
  609.       @map_y = 0
  610.     end
  611.     if @map_y > ((@map.height * 256) - 2816)
  612.       @map_y = ((@map.height * 256) - 2816)
  613.     end
  614.     dispose_target_map
  615.     @map_text_window.refresh
  616.     create_target(@map.data, @map_x, @map_y)
  617.   end
  618.   def calc_x
  619.     x = @input_window[1].number
  620.     if x > 4 and x < (@map.width - 5)
  621.       x = 5
  622.     elsif x > 4
  623.       x -= (@map.width - 11)
  624.     end
  625.     x *= 32
  626.     return x
  627.   end
  628.   def calc_y
  629.     y = @input_window[2].number
  630.     if y > 4 and y < (@map.height - 5)
  631.       y = 5
  632.     elsif y > 4
  633.       y -= (@map.height - 11)
  634.     end
  635.     y *= 32
  636.     return y
  637.   end
  638. end

  639. #==============================================================================
  640. # Scene_ItemsGoldParty
  641. #==============================================================================
  642. class Scene_ItemsGoldParty < Scene_Base
  643.   def initialize
  644.     @itemsgoldparty = 0
  645.     @text = []
  646.     @sub_text = []
  647.     @text[0] = '增减 道具'
  648.     @text[1] = '增减 武器'
  649.     @text[2] = '增减 防具'
  650.     @text[3] = "增减 金钱"
  651.     @text[4] = '增减 队伍角色'
  652.     @sub_text[0] = '选择道具,并增减'
  653.     @sub_text[1] = '选择武器,并增减'
  654.     @sub_text[2] = '选择防具,并增减'
  655.     @sub_text[3] = '增减金钱'
  656.     @sub_text[4] = '选择角色,并增减队伍'
  657.     @sub_text[5] = '选择角色,并增加状态'
  658.     @stat_mode = false
  659.   end
  660.   def start
  661.     create_menu_background
  662.     @help_window = Window_Help.new
  663.     @display_window = Misc_Window.new(160, 56, 384, 360)
  664.     @gold_window = Window_Gold.new(160, 56)
  665.     @gold_window.z = @display_window.z + 1
  666.     @gold_window.opacity = 0
  667.     @gold_window.visible = false
  668.     com1 = ' 道具 '
  669.     com2 = ' 武器 '
  670.     com3 = ' 装备 '
  671.     com4 = ' 金钱 '
  672.     com5 = ' 角色 '
  673.     @command_window = Window_Command.new(160, [com1, com2, com3, com4, com5])
  674.     @command_window.y = 56
  675.     @key_window = Item_Keys_Window.new
  676.     @command_window.active = true
  677.   end
  678.   def terminate
  679.     dispose_menu_background
  680.     @help_window.dispose
  681.     @gold_window.dispose
  682.     @display_window.dispose
  683.     @key_window.dispose
  684.     @command_window.dispose
  685.     if @item_window != nil
  686.       @item_window.dispose
  687.       @item_window = nil
  688.     end
  689.   end
  690.   def update
  691.     update_menu_background
  692.     @help_window.update
  693.     if @itemsgoldparty == 0
  694.       @help_window.set_text(@text[@command_window.index], 1)
  695.     else
  696.       @help_window.set_text(@sub_text[@itemsgoldparty - 1], 1) unless @stat_mode
  697.       @help_window.set_text(@sub_text[@itemsgoldparty], 1) if @stat_mode
  698.     end
  699.     @gold_window.update
  700.     @display_window.update
  701.     @key_window.update
  702.     @command_window.update
  703.     if @item_window != nil
  704.       @item_window.update
  705.     end
  706.     update_keys
  707.     case @itemsgoldparty
  708.     when 0
  709.       @display_window.active = false
  710.       @command_window.active = true
  711.       update_main
  712.     when 1, 2, 3
  713.       @command_window.active = false
  714.       @item_window.active = true
  715.       update_inventory
  716.     when 4
  717.       @command_window.active = false
  718.       @display_window.active = true
  719.       update_gold
  720.     when 5
  721.       @command_window.active = false
  722.       @display_window.active = true
  723.       update_party unless @stat_mode
  724.       update_stats if @stat_mode
  725.     end
  726.   end
  727.   def update_main
  728.     if Input.trigger?(Input::B)
  729.       Sound.play_cancel
  730.       $scene = Scene_Map.new
  731.     elsif Input.trigger?(Input::C)
  732.       Sound.play_decision
  733.       case @command_window.index
  734.       when 0
  735.         @data = $data_items
  736.         @itemsgoldparty = 1
  737.         if @item_window != nil
  738.           @item_window.dispose
  739.         end
  740.         @item_window = Item_Display_Window.new(@data)
  741.       when 1
  742.         @data = $data_weapons
  743.         @itemsgoldparty = 2
  744.         if @item_window != nil
  745.           @item_window.dispose
  746.         end
  747.         @item_window = Item_Display_Window.new(@data)
  748.       when 2
  749.         @data = $data_armors
  750.         @itemsgoldparty = 3
  751.         if @item_window != nil
  752.           @item_window.dispose
  753.         end
  754.         @item_window = Item_Display_Window.new(@data)
  755.       when 3
  756.         if @item_window != nil
  757.           @item_window.dispose
  758.           @item_window = nil
  759.         end
  760.         @itemsgoldparty = 4
  761.         @gold_window.visible = true
  762.       when 4
  763.         if @item_window != nil
  764.           @item_window.dispose
  765.           @item_window = nil
  766.         end
  767.         @itemsgoldparty = 5
  768.         draw_party
  769.         @select_window = Party_Member_Select_Window.new(160, 60, 384, 360)
  770.       end
  771.     end
  772.   end
  773.   def update_inventory
  774.     if Input.trigger?(Input::B)
  775.       Sound.play_cancel
  776.       @itemsgoldparty = 0
  777.       @item_window.dispose
  778.       @item_window = nil
  779.     elsif Input.repeat?(Input::C)
  780.       Sound.play_decision
  781.       $game_party.gain_item(@data[@item_window.index + 1], 1)
  782.       @item_window.draw_item(@item_window.index)
  783.     elsif Input.repeat?(Input::Y)
  784.       Sound.play_decision
  785.       $game_party.lose_item(@data[@item_window.index + 1], 1)
  786.       @item_window.draw_item(@item_window.index)
  787.     elsif Input.repeat?(Input::Z)
  788.       Sound.play_decision
  789.       $game_party.gain_item(@data[@item_window.index + 1], 10)
  790.       @item_window.draw_item(@item_window.index)
  791.     elsif Input.repeat?(Input::X)
  792.       Sound.play_decision
  793.       $game_party.lose_item(@data[@item_window.index + 1], 10)
  794.       @item_window.draw_item(@item_window.index)
  795.     end
  796.   end
  797.   def update_gold
  798.     if Input.trigger?(Input::B)
  799.       Sound.play_cancel
  800.       @gold_window.visible = false
  801.       @itemsgoldparty = 0
  802.     elsif Input.repeat?(Input::UP)
  803.       Sound.play_cursor
  804.       $game_party.gain_gold(100)
  805.       @gold_window.refresh
  806.     elsif Input.repeat?(Input::DOWN)
  807.       Sound.play_cursor
  808.       $game_party.lose_gold(100)
  809.       @gold_window.refresh
  810.     elsif Input.repeat?(Input::L)
  811.       Sound.play_cursor
  812.       $game_party.gain_gold(1000)
  813.       @gold_window.refresh
  814.     elsif Input.repeat?(Input::R)
  815.       Sound.play_cursor
  816.       $game_party.lose_gold(1000)
  817.       @gold_window.refresh
  818.     elsif Input.repeat?(Input::X)
  819.       Sound.play_cursor
  820.       $game_party.gain_gold(10000)
  821.       @gold_window.refresh
  822.     elsif Input.repeat?(Input::Y)
  823.       Sound.play_cursor
  824.       $game_party.lose_gold(10000)
  825.       @gold_window.refresh
  826.     end
  827.   end
  828.   def update_party
  829.     @select_window.update
  830.     if Input.trigger?(Input::B)
  831.       Sound.play_cancel
  832.       draw_party(true)
  833.       @select_window.dispose
  834.       @select_window = nil
  835.       @itemsgoldparty = 0
  836.     elsif Input.trigger?(Input::C)
  837.       Sound.play_decision
  838.       @actor = $game_actors[@select_window.index + 1]
  839.       draw_party(true)
  840.       @select_window.dispose
  841.       @select_window = Party_Member_Select_Window.new(160, 58, 384, 360, true)
  842.       draw_stats
  843.       @stat_mode = true
  844.     elsif Input.trigger?(Input::LEFT)
  845.       if !$game_party.members.include?($game_actors[@select_window.index + 1])
  846.         Sound.play_cursor
  847.         $game_party.add_actor(@select_window.index + 1)
  848.         draw_party
  849.       end
  850.     elsif Input.trigger?(Input::RIGHT)
  851.       if $game_party.members.include?($game_actors[@select_window.index + 1])
  852.         Sound.play_cursor
  853.         $game_party.remove_actor(@select_window.index + 1)
  854.         draw_party
  855.       end
  856.     end
  857.   end
  858.   def update_stats
  859.     @select_window.update
  860.     if Input.trigger?(Input::B)
  861.       Sound.play_cancel
  862.       draw_stats(true)
  863.       @select_window.dispose
  864.       @select_window = Party_Member_Select_Window.new(160, 60, 384, 360)
  865.       @select_window.index = @actor.id - 1
  866.       @stat_mode = false
  867.       draw_party
  868.     elsif Input.repeat?(Input::C)
  869.       change_stat(1)
  870.       draw_stats
  871.     elsif Input.repeat?(Input::Z)
  872.       change_stat(-1)
  873.       draw_stats
  874.     elsif Input.repeat?(Input::L)
  875.       change_stat(10)
  876.       draw_stats
  877.     elsif Input.repeat?(Input::R)
  878.       change_stat(-10)
  879.       draw_stats
  880.     elsif Input.repeat?(Input::X)
  881.       change_stat(100)
  882.       draw_stats
  883.     elsif Input.repeat?(Input::Y)
  884.       change_stat(-100)
  885.       draw_stats
  886.     end
  887.   end
  888.   def change_stat(amount)
  889.     case @select_window.index
  890.     when 0
  891.       if @actor.level + amount >= 1 and @actor.level + amount <= 99
  892.         Sound.play_cursor
  893.         @actor.change_level(@actor.level + amount, false)
  894.       end
  895.     when 1
  896.       if @actor.maxhp + amount >= 1 and @actor.maxhp + amount <= 9999
  897.         Sound.play_cursor
  898.         @actor.maxhp += amount
  899.       end
  900.     when 2
  901.       if @actor.hp + amount >= 1 and @actor.hp + amount <= @actor.maxhp
  902.         Sound.play_cursor
  903.         @actor.hp += amount
  904.       end
  905.     when 3
  906.       if @actor.maxmp + amount >= 0 and @actor.maxmp + amount <= 9999
  907.         Sound.play_cursor
  908.         @actor.maxmp += amount
  909.       end
  910.     when 4
  911.       if @actor.mp + amount >= 0 and @actor.mp + amount <= @actor.maxmp
  912.         Sound.play_cursor
  913.         @actor.mp += amount
  914.       end
  915.     when 5
  916.       if @actor.atk + amount >= 1 and @actor.atk + amount <= 999
  917.         Sound.play_cursor
  918.         @actor.atk += amount
  919.       end
  920.     when 6
  921.       if @actor.def + amount >= 1 and @actor.def + amount <= 999
  922.         Sound.play_cursor
  923.         @actor.def += amount
  924.       end
  925.     when 7
  926.       if @actor.spi + amount >= 1 and @actor.spi + amount <= 999
  927.         Sound.play_cursor
  928.         @actor.spi += amount
  929.       end
  930.     when 8
  931.       if @actor.agi + amount >= 1 and @actor.agi + amount <= 999
  932.         Sound.play_cursor
  933.         @actor.agi += amount
  934.       end
  935.     end
  936.   end
  937.   def update_keys
  938.     @key_window.contents.clear
  939.     case @itemsgoldparty
  940.     when 1, 2, 3
  941.       @key_window.refresh_items
  942.     when 4
  943.       @key_window.refresh_gold
  944.     when 5
  945.       @key_window.refresh_actors unless @stat_mode
  946.       @key_window.refresh_actors_stats if @stat_mode
  947.     else
  948.       @key_window.unfresh
  949.     end
  950.   end
  951.   def draw_party(erase = false)
  952.     @display_window.contents.clear
  953.     unless erase
  954.       for i in 1..20
  955.         actor = $game_actors[i]
  956.         if $game_party.members.include?(actor)
  957.           @display_window.draw_actor_graphic(actor, 24, i * 40)
  958.           @display_window.draw_actor_name(actor, 60, i * 40 - 28)
  959.         else
  960.           @display_window.draw_actor_graphic(actor, 328, i * 40)
  961.           @display_window.draw_actor_name(actor, 208, i * 40 - 28)
  962.         end
  963.       end
  964.     end
  965.   end
  966.   def draw_stats(erase = false)
  967.     @display_window.contents.clear
  968.     unless erase
  969.       actr_lvl = sprintf("Level: %3d", @actor.level)
  970.       actr_mhp = sprintf("Max Hp: %5d", @actor.maxhp)
  971.       actr_chp = sprintf("Hp: %5d", @actor.hp)
  972.       actr_mmp = sprintf("Max Mp: %5d", @actor.maxmp)
  973.       actr_cmp = sprintf("Mp: %5d", @actor.mp)
  974.       actr_atk = sprintf("Off: %5d", @actor.atk)
  975.       actr_def = sprintf("Def: %5d", @actor.def)
  976.       actr_spi = sprintf("Int:  %5d", @actor.spi)
  977.       actr_agi = sprintf("Agi: %5d", @actor.agi)
  978.       spc = 36
  979.       @display_window.contents.draw_text(4, spc * 0 + 8, 352, 24, actr_lvl, 0)
  980.       @display_window.contents.draw_text(4, spc * 1 + 8, 352, 24, actr_mhp, 0)
  981.       @display_window.contents.draw_text(4, spc * 2 + 8, 352, 24, actr_chp, 0)
  982.       @display_window.contents.draw_text(4, spc * 3 + 8, 352, 24, actr_mmp, 0)
  983.       @display_window.contents.draw_text(4, spc * 4 + 8, 352, 24, actr_cmp, 0)
  984.       @display_window.contents.draw_text(4, spc * 5 + 8, 352, 24, actr_atk, 0)
  985.       @display_window.contents.draw_text(4, spc * 6 + 8, 352, 24, actr_def, 0)
  986.       @display_window.contents.draw_text(4, spc * 7 + 8, 352, 24, actr_spi, 0)
  987.       @display_window.contents.draw_text(4, spc * 8 + 8, 352, 24, actr_agi, 0)
  988.     end
  989.   end
  990. end

  991. #==============================================================================
  992. # Window_Search
  993. #==============================================================================
  994. class Window_Search < Window_Base
  995.   def initialize
  996.     super(0, 56, Graphics.width, Graphics.height - 56)
  997.     @maps = {}
  998.     map_files = Dir.glob("Data/Map*.rvdata")
  999.     map_files.pop
  1000.     for map in map_files
  1001.       data = load_data(map)
  1002.       map.scan(/MAP(\d+)/i)
  1003.       @maps[$1.to_i] = data.events
  1004.     end
  1005.     @common_events = load_data("Data/CommonEvents.rvdata").compact!
  1006.     @scripts = {}
  1007.     File.open("Data/Scripts.rvdata", "rb") { |f|
  1008.     Marshal.load(f).each{ |s| @scripts[s[1]] = Zlib::Inflate.inflate(s[2]) } }
  1009.   end
  1010.   def find(fd, fv = false)
  1011.     @fd = []
  1012.     sdata = "$game_variables[" + fd.to_s + "]" if fv
  1013.     sdata = "$game_switches[" + fd.to_s + "]" unless fv
  1014.     found_check = @fd.size
  1015.     for script in @scripts.keys
  1016.       next if @scripts[script] == ""
  1017.       @fd.push([-1, script, 0]) if @scripts[script].include?(sdata)
  1018.       @scripts[script].scan(/\$game_switches\[(.*)\]/i) { |s|
  1019.         next if $1.nil? or $1.is_a?(Integer)
  1020.         begin
  1021.           ev = eval($1)
  1022.           @fd.push([-1, script, 0]) if ev == fd
  1023.         rescue
  1024.           next
  1025.         ensure
  1026.           next
  1027.         end
  1028.       }
  1029.     end
  1030.     @fd.push([-1, "-无-", 0]) if found_check == @fd.size
  1031.     found_check = @fd.size
  1032.     for ce in @common_events
  1033.       data = [0, ce.name, 0]
  1034.       @fd.push(data) if ce.switch_id == fd and ce.trigger > 0 and !fv
  1035.       for cm in ce.list
  1036.         next if cm.code == 0
  1037.         if cm.code == 111 and cm.parameters[1] == fd
  1038.           @fd.push(data) if cm.parameters[0] == 0 and !fv
  1039.           if fv
  1040.             @fd.push(data) if cm.parameters[0] == 1
  1041.             @fd.push(data) if cm.parameters[2] != 0 and cm.parameters[3] == fd
  1042.           end
  1043.         elsif cm.code == 111 and cm.parameters[0] == 12
  1044.           @fd.push(data) if cm.parameters[1].include?(sdata)
  1045.         elsif cm.code == 121 and !fv
  1046.           @fd.push(data) if fd.between?(cm.parameters[0], cm.parameters[1])
  1047.         elsif cm.code == 122 and fv
  1048.           @fd.push(data) if fd.between?(cm.parameters[0], cm.parameters[1])
  1049.           @fd.push(data) if cm.parameters[3] == 1 and cm.parameters[4] == fd
  1050.         elsif cm.code == 355 or cm.code == 655
  1051.           @fd.push(data) if cm.parameters[0].include?(sdata)
  1052.         end
  1053.       end
  1054.     end
  1055.     @fd.push([0, "-无-", 0]) if found_check == @fd.size
  1056.     found_check = @fd.size
  1057.     for map in @maps.keys
  1058.       for event in @maps[map].values
  1059.         for page in event.pages
  1060.           data = [map, event.id, event.pages.index(page) + 1]
  1061.           cn = page.condition
  1062.           @fd.push(data) if cn.switch1_id == fd and cn.switch1_valid and !fv
  1063.           @fd.push(data) if cn.switch2_id == fd and cn.switch2_valid and !fv
  1064.           @fd.push(data) if cn.variable_id == fd and cn.variable_valid and fv
  1065.           for cm in page.list
  1066.             next if cm.code == 0
  1067.             if cm.code == 111 and cm.parameters[1] == fd
  1068.               @fd.push(data) if cm.parameters[0] == 0 and !fv
  1069.               @fd.push(data) if cm.parameters[0] == 1 and fv
  1070.               cm2 = cm.parameters[2] != 0
  1071.               @fd.push(data) if cm2 and cm.parameters[3] == fd and fv
  1072.             elsif cm.code == 111 and cm.parameters[0] == 12
  1073.               @fd.push(data) if cm.parameters[1].include?(sdata)
  1074.             elsif cm.code == 121 and !fv
  1075.               @fd.push(data) if fd.between?(cm.parameters[0], cm.parameters[1])
  1076.             elsif cm.code == 122 and fv
  1077.               @fd.push(data) if fd.between?(cm.parameters[0], cm.parameters[1])
  1078.               @fd.push(data) if cm.parameters[3] == 1 and cm.parameters[4] == fd
  1079.             elsif cm.code == 355 or cm.code == 655
  1080.               @fd.push(data) if cm.parameters[0].include?(sdata)
  1081.             end
  1082.           end
  1083.         end
  1084.       end
  1085.     end
  1086.     @fd.push([9999, "-无-", 0]) if found_check == @fd.size
  1087.     @fd.uniq!
  1088.     @fd.sort!
  1089.     refresh
  1090.   end
  1091.   def refresh
  1092.     self.contents.dispose
  1093.     self.contents = Bitmap.new(Graphics.width - 32, (@fd.size + 3) * 24)
  1094.     self.contents.clear
  1095.     self.oy = y = 0
  1096.     self.contents.font.color = text_color(18)
  1097.     self.contents.draw_text(0, y, self.contents.width, WLH, "脚本:")
  1098.     self.contents.font.color = normal_color
  1099.     for found in @fd
  1100.       next unless found[0] == -1
  1101.       y += WLH
  1102.       self.contents.draw_text(8, y, self.contents.width, WLH, found[1])
  1103.     end
  1104.     y += WLH
  1105.     self.contents.font.color = text_color(18)
  1106.     self.contents.draw_text(0, y, self.contents.width, WLH, "公共事件:")
  1107.     self.contents.font.color = normal_color
  1108.     for found in @fd
  1109.       next unless found[0] == 0
  1110.       y += WLH
  1111.       self.contents.draw_text(8, y, self.contents.width, WLH, found[1])
  1112.     end
  1113.     y += WLH
  1114.     self.contents.font.color = text_color(18)
  1115.     self.contents.draw_text(0, y, self.contents.width, WLH, "事件:")
  1116.     self.contents.font.color = normal_color
  1117.     for found in @fd
  1118.       next unless found[0] > 0
  1119.       if found[0] == 9999
  1120.         text = found[1]
  1121.       else
  1122.         text = "地图 #" + found[0].to_s + ", 事件ID #" + found[1].to_s
  1123.         text += ", 第 #" + found[2].to_s + "页里"
  1124.       end
  1125.       y += WLH
  1126.       self.contents.draw_text(8, y, self.contents.width, WLH, text)
  1127.     end
  1128.   end
  1129.   #--------------------------------------------------------------------------
  1130.   # Text Dump
  1131.   #--------------------------------------------------------------------------
  1132.   def text_dump(fd, fv = false)
  1133.     filename = "变量 ##{fd} 搜索结果.txt" if fv
  1134.     filename = "开关 ##{fd} 搜索结果.txt" unless fv
  1135.     file = File.new(filename, "w+")
  1136.     text = "变量的搜索结果: ##{fd}" if fv
  1137.     text = "开关的搜索结果: ##{fd}" unless fv
  1138.     file.puts(text)
  1139.     line = "-" * text.size
  1140.     file.puts(line)
  1141.     file.puts(" ")
  1142.     file.puts("脚本:")
  1143.     file.puts("--------")
  1144.     for found in @fd
  1145.       next unless found[0] == -1
  1146.       file.puts(found[1])
  1147.     end
  1148.     file.puts(" ")
  1149.     file.puts("公共事件:")
  1150.     file.puts("--------------")
  1151.     for found in @fd
  1152.       next unless found[0] == 0
  1153.       file.puts(found[1])
  1154.     end
  1155.     file.puts(" ")
  1156.     file.puts("事件:")
  1157.     file.puts("-------")
  1158.     for found in @fd
  1159.       next unless found[0] > 0
  1160.       if found[0] == 9999
  1161.         text = found[1]
  1162.       else
  1163.         text = "地图 #" + found[0].to_s + ", 事件ID #" + found[1].to_s
  1164.         text += ", 第 #" + found[2].to_s + "页里"
  1165.       end
  1166.       file.puts(text)
  1167.     end
  1168.     file.close
  1169.   end
  1170. end
  1171. #==============================================================================
  1172. # Scene_Search
  1173. #==============================================================================
  1174. class Scene_Search < Scene_Base
  1175.   def start
  1176.     super
  1177.     create_menu_background
  1178.     w = Graphics.width - 112
  1179.     @inf_win = Window_Base.new(0, 0, w, 56)
  1180.     @inf_win.visible = false
  1181.     @inf_win.contents.font.size = 16
  1182.     commands = ["搜索开关ID", "搜索变量ID"]
  1183.     @com_win = Window_Command.new(w, commands, 2, 1, 1)
  1184.     @dum_win = Window_Base.new(w, 0, Graphics.width - w, 56)
  1185.     @num_win = Window_NumberInput.new
  1186.     @num_win.digits_max = 4
  1187.     @num_win.index = 3
  1188.     @num_win.update_cursor
  1189.     @num_win.active = false
  1190.     @num_win.x = w - 16
  1191.     @sch_win = Window_Search.new
  1192.     @no_scroll = true
  1193.   end
  1194.   def terminate
  1195.     super
  1196.     dispose_menu_background
  1197.     @inf_win.dispose
  1198.     @com_win.dispose
  1199.     @dum_win.dispose
  1200.     @num_win.dispose
  1201.     @sch_win.dispose
  1202.   end
  1203.   def update
  1204.     super
  1205.     update_menu_background
  1206.     @inf_win.update
  1207.     @com_win.update
  1208.     @dum_win.update
  1209.     @num_win.update
  1210.     @sch_win.update
  1211.     if Input.press?(Input::A) and !@num_win.active and !@com_win.active
  1212.       update_scroll unless @no_scroll
  1213.     elsif !Input.press?(Input::A) and @sch_win.cursor_rect.width > 0
  1214.       @sch_win.cursor_rect.empty
  1215.     elsif Input.trigger?(Input::B) and @com_win.active
  1216.       Sound.play_cancel
  1217.       $scene = Scene_Map.new
  1218.     elsif Input.trigger?(Input::B) and @num_win.active
  1219.       Sound.play_cancel
  1220.       @com_win.active = @com_win.visible = true
  1221.       @num_win.active = @inf_win.visible = false
  1222.     elsif Input.trigger?(Input::B) and !@num_win.active and !@com_win.active
  1223.       Sound.play_cancel
  1224.       @num_win.active = true
  1225.       @inf_win.contents.clear
  1226.       txt = @com_win.index == 0 ? "选择开关ID" : "选择变量ID"
  1227.       @inf_win.contents.draw_text(0, 0, Graphics.width - 144, 24, txt, 1)
  1228.     elsif Input.trigger?(Input::C) and @com_win.active
  1229.       Sound.play_decision
  1230.       @com_win.active = @com_win.visible = false
  1231.       @inf_win.contents.clear
  1232.       txt = @com_win.index == 0 ? "选择开关ID" : "选择变量ID"
  1233.       @inf_win.contents.draw_text(0, 0, Graphics.width - 144, 24, txt, 1)
  1234.       @num_win.active = @inf_win.visible = true
  1235.     elsif Input.trigger?(Input::C) and @num_win.active
  1236.       unless @num_win.number.between?(1, 5000)
  1237.         Sound.play_buzzer
  1238.         @sch_win.contents.clear
  1239.         return
  1240.       end
  1241.       Sound.play_decision
  1242.       @sch_win.find(@num_win.number, @com_win.index == 1)
  1243.       @num_win.active = @com_win.visible = false
  1244.       @inf_win.contents.clear
  1245.       @no_scroll = @sch_win.height - 32 >= @sch_win.contents.height
  1246.       txt = @com_win.index == 1 ? "变量" : "开关"
  1247.       txt += "搜索结果输出 = Z"
  1248.       txt += "/翻滚页面 = A" unless @no_scroll
  1249.       @inf_win.contents.draw_text(0, 0, Graphics.width - 144, 24, txt, 1)
  1250.     elsif Input.trigger?(Input::Z) and !@num_win.active and !@com_win.active
  1251.       Sound.play_save
  1252.       @sch_win.text_dump(@num_win.number, @com_win.index == 1)
  1253.     end
  1254.   end
  1255.   def update_scroll
  1256.     @sch_win.cursor_rect.width = @sch_win.width - 32
  1257.     @sch_win.cursor_rect.height = @sch_win.height - 32
  1258.     if Input.press?(Input::UP)
  1259.       @sch_win.oy = [@sch_win.oy - 8, 0].max
  1260.     elsif Input.press?(Input::DOWN)
  1261.       y = @sch_win.contents.height - (Graphics.height - 88)
  1262.       @sch_win.oy = [@sch_win.oy + 8, y].min
  1263.     end
  1264.   end
  1265. end
  1266. #===============================================================================
  1267. # Window_Command
  1268. #===============================================================================
  1269. class Window_Command < Window_Selectable
  1270.   attr_accessor :commands
  1271.   attr_accessor :item_max
  1272. end

  1273. #===============================================================================
  1274. # Window_Iconview
  1275. #===============================================================================
  1276. class Window_Iconview < Window_Selectable
  1277.   attr_accessor :max_pages
  1278.   attr_accessor :page
  1279.   attr_accessor :image
  1280.   def initialize
  1281.     super(Graphics.width - 416, 0, 416, 416)
  1282.     self.z += 1
  1283.     @item_max = 256
  1284.     @column_max = 16
  1285.     @page = @index = @spacing = 0
  1286.     @image = Cache.system("IconSet")
  1287.     @max_pages = (@image.height / 384.0).ceil
  1288.     @icon_sprite = Sprite.new
  1289.     @icon_sprite.bitmap = Bitmap.new(384, 384)
  1290.     @icon_sprite.x = self.x + 16
  1291.     @icon_sprite.y = self.y + 16
  1292.     @icon_sprite.z = self.z - 1
  1293.     self.opacity = self.back_opacity = 0
  1294.     refresh
  1295.   end
  1296.   def dispose
  1297.     @icon_sprite.bitmap.dispose
  1298.     @icon_sprite.dispose
  1299.     super
  1300.   end
  1301.   def update
  1302.     super
  1303.     return unless @max_pages > 1
  1304.     if Input.repeat?(Input::L)
  1305.       Sound.play_cursor
  1306.       image_page_up
  1307.     elsif Input.repeat?(Input::R)
  1308.       Sound.play_cursor
  1309.       image_page_down
  1310.     end
  1311.   end
  1312.   def refresh
  1313.     @icon_sprite.bitmap.dispose
  1314.     @icon_sprite.bitmap = Bitmap.new(384, 384)
  1315.     rect = Rect.new(0, @page * 384, 384, 384)
  1316.     @icon_sprite.bitmap.blt(0, 0, @image, rect)
  1317.   end
  1318.   def cursor_down(wrap)
  1319.     if @index < 240
  1320.       @index += 16
  1321.     elsif wrap
  1322.       @index -= 240
  1323.     end
  1324.   end
  1325.   def cursor_up(wrap)
  1326.     if @index >= 16
  1327.       @index -= 16
  1328.     elsif wrap
  1329.       @index += 240
  1330.     end
  1331.   end
  1332.   def cursor_right(wrap)
  1333.     if @index % 16 < 15
  1334.       @index += 1
  1335.     elsif wrap
  1336.       @index -= 15
  1337.     end
  1338.   end
  1339.   def cursor_left(wrap)
  1340.     if @index % 16 > 0
  1341.       @index -= 1
  1342.     elsif wrap
  1343.       @index += 15
  1344.     end
  1345.   end
  1346.   def image_page_up
  1347.     @page = @page == 0 ? @max_pages - 1 : @page - 1
  1348.     refresh
  1349.   end
  1350.   def image_page_down
  1351.     @page = @page == @max_pages - 1 ? 0 : @page + 1
  1352.     refresh
  1353.   end
  1354. end

  1355. #===============================================================================
  1356. # Window_IconPageList
  1357. #===============================================================================
  1358. class Window_IconPageList < Window_Selectable
  1359.   def initialize(icon_window)
  1360.     @icon_window = icon_window
  1361.     super(0, 128, Graphics.width-@icon_window.width, @icon_window.height-128)
  1362.     self.active = false
  1363.     self.index = 0
  1364.     refresh
  1365.   end
  1366.   def refresh
  1367.     @item_max = @icon_window.max_pages
  1368.     create_contents
  1369.     for i in 0...@item_max; draw_item(i); end
  1370.   end
  1371.   def draw_item(index)
  1372.     rect = item_rect(index)
  1373.     self.contents.clear_rect(rect)
  1374.     text = sprintf("Page%d", index+1)
  1375.     self.contents.draw_text(rect, text, 1)
  1376.   end
  1377.   def update
  1378.     super
  1379.     if self.index != @icon_window.page
  1380.       self.index = @icon_window.page
  1381.     end
  1382.   end
  1383. end

  1384. #===============================================================================
  1385. # Window_Icondata
  1386. #===============================================================================
  1387. class Window_Icondata < Window_Base
  1388.   def initialize(iconview_window)
  1389.     @iconview_window = iconview_window
  1390.     super(0, 0, Graphics.width - @iconview_window.width, 128)
  1391.   end
  1392.   def refresh
  1393.     self.contents.clear
  1394.     text = 256 * @iconview_window.page + @iconview_window.index
  1395.     text = sprintf("ID:%d", text)
  1396.     self.contents.draw_text(0, WLH*0, contents.width, WLH, text, 1)
  1397.     text = @iconview_window.image.height / 24 * 16
  1398.     text = sprintf("总共:%d", text)
  1399.     self.contents.draw_text(0, WLH*1, contents.width, WLH, text, 1)
  1400.     text = "Q=上一页"
  1401.     self.contents.draw_text(0, WLH*2, contents.width, WLH, text, 1)
  1402.     text = "W=下一页"
  1403.     self.contents.draw_text(0, WLH*3, contents.width, WLH, text, 1)
  1404.   end
  1405.   def update
  1406.     super
  1407.     if @last_index != @iconview_window.index or
  1408.     @last_page != @iconview_window.page
  1409.       @last_index = @iconview_window.index
  1410.       @last_page = @iconview_window.page
  1411.       refresh
  1412.     end
  1413.   end
  1414. end

  1415. #===============================================================================
  1416. # Scene_Iconview
  1417. #===============================================================================
  1418. class Scene_Iconview < Scene_Base
  1419.   def start
  1420.     super
  1421.     create_menu_background
  1422.     @iconview_window = Window_Iconview.new
  1423.     dx = @iconview_window.x
  1424.     dy = @iconview_window.y
  1425.     dw = @iconview_window.width
  1426.     dh = @iconview_window.height
  1427.     @dummy_window = Window_Base.new(dx, dy, dw, dh)
  1428.     @data_window = Window_Icondata.new(@iconview_window)
  1429.     @page_window = Window_IconPageList.new(@iconview_window)
  1430.   end
  1431.   def terminate
  1432.     super
  1433.     dispose_menu_background
  1434.     @iconview_window.dispose
  1435.     @dummy_window.dispose
  1436.     @data_window.dispose
  1437.     @page_window.dispose
  1438.   end
  1439.   def update
  1440.     super
  1441.     update_menu_background
  1442.     @iconview_window.update
  1443.     @data_window.update
  1444.     @page_window.update
  1445.     if Input.trigger?(Input::B)
  1446.       Sound.play_cancel
  1447.       $scene = Scene_Map.new
  1448.     end
  1449.   end
  1450. end

  1451. #===============================================================================
  1452. # Scene_DebugSelect
  1453. #===============================================================================
  1454. class Scene_DebugSelect < Scene_Base
  1455.   def start
  1456.     super
  1457.     create_menu_background
  1458.     create_command_window
  1459.   end
  1460.   def post_start
  1461.     super
  1462.     open_command_window
  1463.   end
  1464.   def terminate
  1465.     super
  1466.     dispose_command_window
  1467.     dispose_menu_background
  1468.   end
  1469.   def update
  1470.     super
  1471.     update_menu_background
  1472.     @command_window.update
  1473.     if Input.trigger?(Input::B)
  1474.       Sound.play_cancel
  1475.       $scene = Scene_Map.new
  1476.     elsif Input.trigger?(Input::C)
  1477.       case @command_window.index
  1478.       when 0
  1479.         Sound.play_decision
  1480.         $scene = Scene_Teleport.new
  1481.       when 1
  1482.         Sound.play_save
  1483.         for actor in $game_party.members
  1484.           actor.recover_all
  1485.         end
  1486.         $scene = Scene_File.new(true, false, true)
  1487.       when 2
  1488.         Sound.play_decision
  1489.         $scene = Scene_ItemsGoldParty.new
  1490.       when 3
  1491.         Sound.play_decision
  1492.         $scene = Scene_Iconview.new
  1493.       when 4
  1494.         Sound.play_decision
  1495.         $scene = Scene_Search.new
  1496.       end
  1497.     end
  1498.   end
  1499.   def update_menu_background
  1500.     super
  1501.     @menuback_sprite.tone.set(0, 0, 0, 0)
  1502.   end
  1503.   def create_command_window
  1504.     s1 = " 传送"
  1505.     s2 = " 存档"
  1506.     s3 = " 背包"
  1507.     s4 = " 图标"
  1508.     s5 = " 查找"
  1509.     @command_window = Window_Command.new(120, [s1, s2, s3, s4, s5])
  1510.     @command_window.x = (544 - @command_window.width) / 2
  1511.     @command_window.y = (416 - @command_window.height) / 2
  1512.   end
  1513.   def dispose_command_window
  1514.     @command_window.dispose
  1515.   end
  1516.   def open_command_window
  1517.     @command_window.open
  1518.     begin
  1519.       @command_window.update
  1520.       Graphics.update
  1521.     end until @command_window.openness == 255
  1522.   end
  1523.   def close_command_window
  1524.     @command_window.close
  1525.     begin
  1526.       @command_window.update
  1527.       Graphics.update
  1528.     end until @command_window.openness == 0
  1529.   end
  1530.   def dispose_command_window
  1531.     @command_window.dispose
  1532.   end
  1533. end
复制代码
最后……
感谢大家的支持,明天我要离开几天了
嘛,我就算离开了也不会对6R有什么影响

评分

参与人数 3星屑 +320 收起 理由
无双sxa + 200 我很赞同
duzhi5368 + 60 精品文章
我的米呀 + 60 精品文章

查看全部评分


Lv1.梦旅人

梦石
0
星屑
65
在线时间
53 小时
注册时间
2006-12-15
帖子
90
2
发表于 2012-6-17 02:50:42 | 只看该作者
很给力啊~~~{:2_270:}
萝卜啊,白菜啊,土豆星啊,梦想有爱啊。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
75
在线时间
1074 小时
注册时间
2012-1-16
帖子
1937
3
发表于 2012-6-17 08:30:57 | 只看该作者
额。。。刷下存在感。。。还走几天,你的守护骑士能赶上这次短篇么?
本人目前已被作业山压死,有事请烧(call)纸(me)……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

被遗忘の机器

梦石
0
星屑
73
在线时间
402 小时
注册时间
2010-7-24
帖子
1492
4
发表于 2012-6-17 09:39:52 | 只看该作者
1500+行,我给跪了,这可怕的debug
【镇楼】少年吃我大屌
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
167
在线时间
434 小时
注册时间
2009-1-1
帖子
643
5
发表于 2013-11-17 15:41:03 | 只看该作者
代码好长,功能看起来并不多嘛,查看图标的ID是指道具装备那些图标?
最近在研究XAS
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 19:05

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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