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

Project1

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

游戏调试时如何修改物品和金钱

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-27
帖子
22
跳转到指定楼层
1
发表于 2007-8-1 23:42:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-27
帖子
22
2
 楼主| 发表于 2007-8-1 23:42:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-9
帖子
735
3
发表于 2007-8-1 23:45:31 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

圣魔

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-1-12
帖子
3395
4
发表于 2007-8-1 23:49:41 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
5 小时
注册时间
2007-7-19
帖子
159
5
发表于 2007-8-2 17:38:07 | 只看该作者
这个脚本
  1. # --------------------------------------------------------------------

  2. # 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息
  3. # --------------------------------------------------------------------

  4. =begin

  5. 原文说明与中文翻译

  6. 原文:
  7.     This script adds many features to the debug screen (access by hitting F9
  8. during Test Play). When editing variables, you can now push C to enter the
  9. variable's value, like in RPG Maker 2000 and 2003. You can also push X to
  10. multiply the variable by -1. By pushing X when the left window is active,
  11. you can open the Debug Command window (see images).
  12. 翻译:
  13.       这个脚本增添了很多Debug的功能(就是按F9出来的那个东东)。当编辑变量的时候,你可以
  14.     按C键直接输入变量的数值,就像RM2000和RM2003一样。你也可以按X键使变量取负数。
  15.     当左边窗口激活的时候按下X按钮(说明:这里指的是RMXP的程序控制X键,默认的键盘A键。
  16.     以下提到按键均为程序控制键),可以打开除错命令窗口。
  17.    
  18. 原文:
  19.     Each option is described with its controls below:
  20.     ·Heal Character: Lets you heal a character.
  21.     ·C Button: Recover the character's HP, SP, and status.
  22.     ·X Button: Recover the character's HP only.
  23.     ·Y Button: Recover the character's SP only.
  24.     ·A Button: Recover the character's status only.
  25.     ·God Mode: If this mode is on, your characters will be ultra-powerful.
  26.     ·Money: Enter the amount of money you want to have in the number window.
  27.     ·Encounters: Decide whether you want random encounters on or off.
  28.     ·Items/Weapons/Armor: Lets you add or remove items, weapons, or armor from the party's inventory.
  29.     ·Right: Gain 1 copy of the item.
  30.     ·Left: Lose 1 copy of the item.
  31.     ·X Button: Lose 10 copies of the item.
  32.     ·Y Button: Gain 10 copies of the item.
  33.     ·Teleport: Teleport to a preset destination. You'll need to edit the script yourself to add destinations.
  34.     ·Walk Speed: Choose one of the six walk speeds for the player character.
  35.     ·Save: Allows you to save anywhere, regardless of whether saving is enabled on the map or not.
  36. 翻译:
  37.   各项功能和控制如下:
  38.   ·治疗我方角色:C钮:完全恢复,X钮:只恢复HP,Y钮:只恢复SP,A钮:只恢复状态
  39.   ·无敌模式:角色无敌。这项功能有可能和突破上限的脚本冲突,如果需要可以自行整合,不赘述
  40.   ·金钱操作:调整金钱数值
  41.   ·禁止遇敌:决定你是否碰到随机敌人
  42.   ·物品操作,·武器操作,·防具操作:更改物品,武器,防具。按左右增减
  43.   ·传送:见下面说明,手动定义debug传送功能
  44.   ·更改移动速度:不废话了
  45.   ·强行储存进度:可以在禁止存档的地方强行存档。

  46. 原文:
  47.   To use this script, replace Scene_Debug with the one provided,
  48.   then add the new class Window_Dataset after all the other window classes,
  49.   then replace the methods shown in Game_Actor.
  50.   Finally, add the statements in Game_Character and Game_Temp, as shown.
  51.   Note that there is no need to add Window_Dataset if you're already using my battle debugger script.  
  52. 翻译:
  53.   使用方法:替换这个类那个类的相应内容……真罗嗦。直接在main前面插入即可,已经调整好了。
  54. =end

  55. #——————————————————————————————————————
  56. # 66RPG的特别说明:传送功能需要手动定义传送点。
  57. #
  58. # 这个功能我本来想把所有地图都放进去,就不用手动定义了。后来想想也不方便。
  59. # 大制作才会使用这个超级Debug功能,而大制作有上百张地图实在很正常,
  60. # 这样找地图反而不方便。故作罢。
  61. #
  62. # 这个传送功能很实用,如果你真的需要大型的数据均衡。并且,如果你并不懂脚本
  63. # 制作,能够独立完成这项手动定义的工作,这是你的荣耀!
  64. #
  65. # ——2005年6月,柳柳
  66. #
  67. # 另:只有决心制作中大型游戏(至少制作150小时以上)再使用本脚本,普通的小型游戏没必要。
  68. #——————————————————————————————————————
  69.   
  70. class Scene_Debug
  71.   #——————————————————————————————————
  72.   def update_warp
  73.     if Input.trigger?(Input::B)
  74.       $game_system.se_play($data_system.cancel_se)
  75.       @warp_window.active = false
  76.       @other_window.active = true
  77.       @warp_window.visible = false
  78.       return
  79.     end
  80.     if Input.trigger?(Input::C)
  81.       $game_system.se_play($data_system.decision_se)
  82.       $game_temp.player_transferring = true
  83.       case @warp_window.index
  84.   #————————————以上内容不用管———————————————
  85.   
  86.   
  87.   
  88.   #———————————以下内容手动定义———————————————
  89.   
  90.       when 0 #——当选中第0号选项的时候(就是第一个选项)
  91.         $game_temp.player_new_map_id = 1 #——传送到1号地图
  92.         $game_temp.player_new_x = 1
  93.         $game_temp.player_new_y = 1 #——坐标X=1,Y=1的位置
  94.         @warp_window.active = false
  95.         @other_window.active = true
  96.         @warp_window.visible = false #上面这3行不用动。
  97.       when 1 #——当选中第1号选项的时候(就是第二个选项)
  98.         $game_temp.player_new_map_id = 2 #——传送到2号地图
  99.         $game_temp.player_new_x = 5
  100.         $game_temp.player_new_y = 9 #——坐标X=5,Y=8的位置
  101.         @warp_window.active = false
  102.         @other_window.active = true
  103.         @warp_window.visible = false
  104.       when 2
  105.         $game_temp.player_new_map_id = 3 #——传送到3号地图
  106.         $game_temp.player_new_x = 2
  107.         $game_temp.player_new_y = 7 #——坐标X=2,Y=7的位置
  108.         @warp_window.active = false
  109.         @other_window.active = true
  110.         @warp_window.visible = false
  111.       #when 3......依次类推,照猫画虎。
  112.       #when 4......依次类推,照葫芦画瓢
  113.       
  114.   #——手动定义部分1到此结束,如果懂程序,觉得这么多注释太乱,删除后格式就清晰了
  115.   #——下面还有一点点内容
  116.   
  117.   #————————————以下内容不用管————————————————
  118.       end
  119.     end
  120.   end
  121.   def main
  122.   #————————————以上内容不用管————————————————  
  123.    
  124.   #————————————以下为手动定义内容——————————————
  125.    
  126.     d0 = "传送到1号图左上角" # 0号选项的文字说明,自己看着用的
  127.     d1 = "传送到2号地图的(5,9)" # 1号选项的文字说明,自己看着用的
  128.     d2 = "传送到3号地图的(2,7)"
  129.     #d3=.....
  130.     warp_commands = [d0,d1,d2]  #所有你定义的都放在中括号里,逗号隔开。
  131.                              #比如定义了d0,d1,d2,d3,则warp_commands = [d0,d1,d2,d3]
  132.    
  133.    
  134.   #—————以上为手动定义,全部到此结束,后面的别动了。——————————
  135.     @left_window = Window_DebugLeft.new
  136.     @right_window = Window_DebugRight.new
  137.     c1 = "·治疗我方角色"
  138.     c2 = "·无敌模式"
  139.     c3 = "·金钱操作"
  140.     c4 = "·禁止遇敌"
  141.     c5 = "·物品操作"
  142.     c6 = "·武器操作"
  143.     c7 = "·防具操作"
  144.     c8 = "·传送"
  145.     c9 = "·更改移动速度"
  146.     c10 = "·强行储存进度"
  147.     x1 = "打开"
  148.     x2 = "关闭"
  149.     w1 = "速度1 (最慢)"
  150.     w2 = "速度2 (很慢)"
  151.     w3 = "速度3 (慢)"
  152.     w4 = "速度4 (快)"
  153.     w5 = "速度5 (很快)"
  154.     w6 = "速度6 (小飞侠)"
  155.     main_commands = [c1, c2, c3, c4, c5, c6, c7, c8, c9, c10]
  156.     speed_commands = [w1, w2, w3, w4, w5, w6]
  157.     toggle_commands = [x1, x2]
  158.     @other_window = Window_Command.new(240, main_commands)
  159.     @speed_window = Window_Command.new(180, speed_commands)
  160.     @enc_window = Window_Command.new(80, toggle_commands)
  161.     @god_window = Window_Command.new(80, toggle_commands)
  162.     @warp_window = Window_Command.new(300, warp_commands)
  163.     @target_window = Window_Target.new
  164.     @money_window = Window_Gold.new
  165.     @number_window = Window_InputNumber.new(7)
  166.     @var_window = Window_InputNumber.new(8)
  167.     @help_window = Window_Base.new(192, 352, 448, 128)
  168.     @help_window.contents = Bitmap.new(406, 96)
  169.     @help_window.contents.font.name = "黑体"
  170.     @help_window.contents.font.size = 22
  171.     @left_window.top_row = $game_temp.debug_top_row
  172.     @left_window.index = $game_temp.debug_index
  173.     @right_window.mode = @left_window.mode
  174.     @right_window.top_id = @left_window.top_id
  175.     @other_window.visible = false
  176.     @other_window.active = false
  177.     @target_window.visible = false
  178.     @target_window.active = false
  179.     @enc_window.visible = false
  180.     @enc_window.active = false
  181.     @god_window.visible = false
  182.     @god_window.active = false
  183.     @speed_window.visible = false
  184.     @speed_window.active = false
  185.     @warp_window.visible = false
  186.     @warp_window.active = false
  187.     @money_window.visible = false
  188.     @money_window.active = false
  189.     @number_window.visible = false
  190.     @number_window.active = false
  191.     @var_window.visible = false
  192.     @var_window.active = false
  193.     @itemset_window = Window_Dataset.new(1)
  194.     @itemset_window.visible = false
  195.     @itemset_window.active = false
  196.     @weaponset_window = Window_Dataset.new(2)
  197.     @weaponset_window.visible = false
  198.     @weaponset_window.active = false
  199.     @armorset_window = Window_Dataset.new(3)
  200.     @armorset_window.visible = false
  201.     @armorset_window.active = false
  202.     @other_window.opacity = 255
  203.     @other_window.x = 100
  204.     @other_window.y = 48
  205.     @other_window.z = 200
  206.     @target_window.x = 304
  207.     @target_window.y = 0
  208.     @target_window.z = 300
  209.     @target_window.opacity = 255
  210.     @enc_window.x = 225
  211.     @enc_window.y = 180
  212.     @enc_window.z = 210
  213.     @enc_window.opacity = 255
  214.     @god_window.x = 225
  215.     @god_window.y = 180
  216.     @god_window.z = 210
  217.     @god_window.opacity = 255
  218.     @speed_window.x = 270
  219.     @speed_window.y = 100
  220.     @speed_window.z = 220
  221.     @speed_window.opacity = 255
  222.     @warp_window.x = 270
  223.     @warp_window.y = 100
  224.     @warp_window.z = 220
  225.     @warp_window.opacity = 255
  226.     @itemset_window.x = 0
  227.     @itemset_window.y = 0
  228.     @itemset_window.z = 1000
  229.     @itemset_window.opacity = 255
  230.     @weaponset_window.x = 0
  231.     @weaponset_window.y = 0
  232.     @weaponset_window.z = 1000
  233.     @weaponset_window.opacity = 255
  234.     @armorset_window.x = 0
  235.     @armorset_window.y = 0
  236.     @armorset_window.z = 1000
  237.     @armorset_window.opacity = 255
  238.     @money_window.x = 270
  239.     @money_window.y = 100
  240.     @money_window.z = 700
  241.     @money_window.opacity = 255
  242.     @number_window.x = 270
  243.     @number_window.y = 164
  244.     @number_window.z = 710
  245.     @number_window.opacity = 255
  246.     @var_window.x = 270
  247.     @var_window.y = 164
  248.     @var_window.z = 710
  249.     @var_window.opacity = 255
  250.     @variable_edit = 0
  251.     @help_window.contents.draw_text(4, 0, 400, 32, "按键盘A键(控制X键)打开菜单")
  252.     Graphics.transition
  253.     loop do
  254.       Graphics.update
  255.       Input.update
  256.       update
  257.       if $scene != self
  258.         break
  259.       end
  260.     end
  261.     $game_map.refresh
  262.     Graphics.freeze
  263.     @left_window.dispose
  264.     @right_window.dispose
  265.     @help_window.dispose
  266.     @other_window.dispose
  267.     @god_window.dispose
  268.     @speed_window.dispose
  269.     @enc_window.dispose
  270.     @target_window.dispose
  271.     @warp_window.dispose
  272.     @itemset_window.dispose
  273.     @weaponset_window.dispose
  274.     @armorset_window.dispose
  275.     @money_window.dispose
  276.     @var_window.dispose
  277.   end
  278.   # ------------------------------
  279.   def update
  280.     @right_window.mode = @left_window.mode
  281.     @right_window.top_id = @left_window.top_id
  282.     @left_window.update
  283.     @right_window.update
  284.     @other_window.update
  285.     @enc_window.update
  286.     @itemset_window.update
  287.     @weaponset_window.update
  288.     @armorset_window.update
  289.     @target_window.update
  290.     @god_window.update
  291.     @speed_window.update
  292.     @warp_window.update
  293.     @money_window.update
  294.     @number_window.update
  295.     @var_window.update
  296.     $game_temp.debug_top_row = @left_window.top_row
  297.     $game_temp.debug_index = @left_window.index
  298.     if @left_window.active
  299.       update_left
  300.       return
  301.     end
  302.     if @right_window.active
  303.       update_right
  304.       return
  305.     end
  306.     if @other_window.active
  307.       update_command
  308.       return
  309.     end
  310.     if @target_window.active
  311.       update_target
  312.       return
  313.     end
  314.     if @enc_window.active
  315.       update_enc
  316.       return
  317.     end
  318.      if @itemset_window.active
  319.       update_itemset
  320.       return
  321.     end
  322.       if @weaponset_window.active
  323.       update_weaponset
  324.       return
  325.     end
  326.     if @armorset_window.active
  327.       update_armorset
  328.       return
  329.     end
  330.      if @god_window.active
  331.       update_god
  332.       return
  333.     end
  334.      if @speed_window.active
  335.       update_speed
  336.       return
  337.     end
  338.      if @warp_window.active
  339.       update_warp
  340.       return
  341.     end
  342.       if @number_window.active
  343.       update_money
  344.       return
  345.     end
  346.       if @var_window.active
  347.       update_var
  348.       return
  349.     end
  350.   end
  351. # ------------------------------
  352.   def update_left
  353.     if Input.trigger?(Input::B)
  354.       $game_system.se_play($data_system.cancel_se)
  355.       $scene = Scene_Map.new
  356.       return
  357.     end
  358.     if Input.trigger?(Input::C)
  359.       $game_system.se_play($data_system.decision_se)
  360.       if @left_window.mode == 0
  361.         @help_window.contents.clear
  362.         text1 = "C (回车) : 打开 / 关闭"
  363.         @help_window.contents.draw_text(4, 0, 406, 32, text1)
  364.       else
  365.         @help_window.contents.clear
  366.         text1 = "左键 : -1   右键 : +1"
  367.         text2 = "L : -10"
  368.         text3 = "R : +10"
  369.         text4 = "C: 输入数值"
  370.         text5 = "X: 正负符号"
  371.         @help_window.contents.draw_text(4, 0, 200, 32, text1)
  372.         @help_window.contents.draw_text(4, 32, 200, 32, text2)
  373.         @help_window.contents.draw_text(4, 64, 200, 32, text3)
  374.         @help_window.contents.draw_text(240, 0, 180, 32, text4)
  375.         @help_window.contents.draw_text(240, 32, 180, 32, text5)
  376.       end
  377.       @left_window.active = false
  378.       @right_window.active = true
  379.       @right_window.index = 0
  380.       return
  381.     end
  382.     if Input.trigger?(Input::X)
  383.       $game_system.se_play($data_system.decision_se)
  384.       @other_window.visible = true
  385.       @left_window.active = false
  386.       @other_window.active = true
  387.     end
  388.   end
  389.   # ------------------------------
  390.   def update_command
  391.     if Input.trigger?(Input::B)
  392.       $game_system.se_play($data_system.cancel_se)
  393.       @other_window.active = false
  394.       @left_window.active = true
  395.       @other_window.visible = false
  396.       return
  397.     end
  398.     if Input.trigger?(Input::C)
  399.       $game_system.se_play($data_system.decision_se)
  400.       case @other_window.index
  401.       when 0
  402.         @other_window.active = false
  403.         @target_window.active = true
  404.         @target_window.visible = true
  405.         @target_window.index = 0
  406.       when 1
  407.         @god_window.index = 1
  408.         if $game_temp.god_mode
  409.           @god_window.index = 0
  410.         end
  411.         @god_window.active = true
  412.         @god_window.visible = true
  413.         @other_window.active = false
  414.       when 2
  415.         @number_window.number = 0
  416.         @money_window.visible = true
  417.         @number_window.active = true
  418.         @number_window.visible = true
  419.         @other_window.active = false
  420.       when 3
  421.         @enc_window.index = 0
  422.         if $game_system.encounter_disabled
  423.           @enc_window.index = 1
  424.         end
  425.         @enc_window.active = true
  426.         @enc_window.visible = true
  427.         @other_window.active = false
  428.       when 4
  429.         @itemset_window.index = 0
  430.         @itemset_window.active = true
  431.         @itemset_window.visible = true
  432.         @other_window.active = false
  433.       when 5
  434.         @weaponset_window.index = 0
  435.         @weaponset_window.active = true
  436.         @weaponset_window.visible = true
  437.         @other_window.active = false
  438.       when 6
  439.         @armorset_window.index = 0
  440.         @armorset_window.active = true
  441.         @armorset_window.visible = true
  442.         @other_window.active = false
  443.       when 7
  444.         @warp_window.active = true
  445.         @warp_window.visible = true
  446.         @other_window.active = false
  447.       when 8
  448.         @speed_window.index = $game_player.move_speed - 1
  449.         @speed_window.active = true
  450.         @speed_window.visible = true
  451.         @other_window.active = false
  452.       when 9
  453.         $scene = Scene_Save.new
  454.         return
  455.       end
  456.     end
  457.   end
  458.   # ------------------------------
  459.   def update_money
  460.    if Input.trigger?(Input::B)
  461.       $game_system.se_play($data_system.cancel_se)
  462.       @number_window.active = false
  463.       @other_window.active = true
  464.       @money_window.visible = false
  465.       @number_window.visible = false
  466.       return
  467.     end
  468.     if Input.trigger?(Input::C)
  469.       $game_system.se_play($data_system.decision_se)
  470.       $game_party.lose_gold(9999999)
  471.       $game_party.gain_gold(@number_window.number)
  472.       @money_window.refresh
  473.     end
  474.     if Input.repeat?(Input::X)
  475.       $game_system.se_play($data_system.cursor_se)
  476.       $game_party.gain_gold(9999999)
  477.       @money_window.refresh
  478.     end
  479.      if Input.repeat?(Input::Y)
  480.       $game_system.se_play($data_system.cursor_se)
  481.       $game_party.lose_gold(9999999)
  482.       @money_window.refresh
  483.     end
  484.   end
  485.    # ------------------------------
  486.   def update_itemset
  487.    if Input.trigger?(Input::B)
  488.       $game_system.se_play($data_system.cancel_se)
  489.       @itemset_window.active = false
  490.       @other_window.active = true
  491.       @itemset_window.visible = false
  492.       return
  493.     end
  494.     if Input.repeat?(Input::RIGHT)
  495.       $game_system.se_play($data_system.cursor_se)
  496.       $game_party.gain_item(@itemset_window.index + 1, 1)
  497.       @itemset_window.refresh
  498.     end
  499.     if Input.repeat?(Input::LEFT)
  500.       $game_system.se_play($data_system.cursor_se)
  501.       $game_party.lose_item(@itemset_window.index + 1, 1)
  502.       @itemset_window.refresh
  503.     end
  504.     if Input.repeat?(Input::X)
  505.       $game_system.se_play($data_system.cursor_se)
  506.       $game_party.lose_item(@itemset_window.index + 1, 10)
  507.       @itemset_window.refresh
  508.     end
  509.     if Input.repeat?(Input::Y)
  510.       $game_system.se_play($data_system.cursor_se)
  511.       $game_party.gain_item(@itemset_window.index + 1, 10)
  512.       @itemset_window.refresh
  513.     end
  514.   end
  515.    # ------------------------------
  516.   def update_weaponset
  517.    if Input.trigger?(Input::B)
  518.       $game_system.se_play($data_system.cancel_se)
  519.       @weaponset_window.active = false
  520.       @other_window.active = true
  521.       @weaponset_window.visible = false
  522.       return
  523.     end
  524.     if Input.repeat?(Input::RIGHT)
  525.       $game_system.se_play($data_system.cursor_se)
  526.       $game_party.gain_weapon(@weaponset_window.index + 1, 1)
  527.       @weaponset_window.refresh
  528.     end
  529.     if Input.repeat?(Input::LEFT)
  530.       $game_system.se_play($data_system.cursor_se)
  531.       $game_party.lose_weapon(@weaponset_window.index + 1, 1)
  532.       @weaponset_window.refresh
  533.     end
  534.     if Input.repeat?(Input::X)
  535.       $game_system.se_play($data_system.cursor_se)
  536.       $game_party.lose_weapon(@weaponset_window.index + 1, 10)
  537.       @weaponset_window.refresh
  538.     end
  539.     if Input.repeat?(Input::Y)
  540.       $game_system.se_play($data_system.cursor_se)
  541.       $game_party.gain_weapon(@weaponset_window.index + 1, 10)
  542.       @weaponset_window.refresh
  543.     end
  544.   end
  545.    # ------------------------------
  546.   def update_armorset
  547.    if Input.trigger?(Input::B)
  548.       $game_system.se_play($data_system.cancel_se)
  549.       @armorset_window.active = false
  550.       @other_window.active = true
  551.       @armorset_window.visible = false
  552.       return
  553.     end
  554.     if Input.repeat?(Input::RIGHT)
  555.       $game_system.se_play($data_system.cursor_se)
  556.       $game_party.gain_armor(@armorset_window.index + 1, 1)
  557.       @armorset_window.refresh
  558.     end
  559.     if Input.repeat?(Input::LEFT)
  560.       $game_system.se_play($data_system.cursor_se)
  561.       $game_party.lose_armor(@armorset_window.index + 1, 1)
  562.       @armorset_window.refresh
  563.     end
  564.     if Input.repeat?(Input::X)
  565.       $game_system.se_play($data_system.cursor_se)
  566.       $game_party.lose_armor(@armorset_window.index + 1, 10)
  567.       @armorset_window.refresh
  568.     end
  569.     if Input.repeat?(Input::Y)
  570.       $game_system.se_play($data_system.cursor_se)
  571.       $game_party.gain_armor(@armorset_window.index + 1, 10)
  572.       @armorset_window.refresh
  573.     end
  574.   end
  575.   # -------------------------------
  576.    def update_enc
  577.     if Input.trigger?(Input::B)
  578.       $game_system.se_play($data_system.cancel_se)
  579.       @enc_window.active = false
  580.       @other_window.active = true
  581.       @enc_window.visible = false
  582.       return
  583.     end
  584.     if Input.trigger?(Input::C)
  585.       case @enc_window.index
  586.       when 0
  587.         $game_system.se_play($data_system.decision_se)
  588.         $game_system.encounter_disabled = false
  589.         @enc_window.active = false
  590.         @other_window.active = true
  591.         @enc_window.visible = false
  592.       when 1
  593.         $game_system.se_play($data_system.decision_se)
  594.         $game_system.encounter_disabled = true
  595.         @enc_window.active = false
  596.         @other_window.active = true
  597.         @enc_window.visible = false
  598.       end
  599.     end
  600.   end
  601.    # -------------------------------
  602.    def update_god
  603.     if Input.trigger?(Input::B)
  604.       $game_system.se_play($data_system.cancel_se)
  605.       @god_window.active = false
  606.       @other_window.active = true
  607.       @god_window.visible = false
  608.       return
  609.     end
  610.     if Input.trigger?(Input::C)
  611.       case @god_window.index
  612.       when 0
  613.         $game_system.se_play($data_system.decision_se)
  614.         $game_temp.god_mode = true
  615.         @god_window.active = false
  616.         @other_window.active = true
  617.         @god_window.visible = false
  618.       when 1
  619.         $game_system.se_play($data_system.decision_se)
  620.         $game_temp.god_mode = false
  621.         @god_window.active = false
  622.         @other_window.active = true
  623.         @god_window.visible = false
  624.       end
  625.     end
  626.   end
  627.    # -------------------------------
  628.   def update_speed
  629.     if Input.trigger?(Input::B)
  630.       $game_system.se_play($data_system.cancel_se)
  631.       @speed_window.active = false
  632.       @other_window.active = true
  633.       @speed_window.visible = false
  634.       return
  635.     end
  636.     if Input.trigger?(Input::C)
  637.       $game_system.se_play($data_system.decision_se)
  638.       $game_player.move_speed = @speed_window.index + 1
  639.       @speed_window.active = false
  640.       @other_window.active = true
  641.       @speed_window.visible = false
  642.     end
  643.   end
  644.   # ------------------------------
  645.   def update_target
  646.     if Input.trigger?(Input::B)
  647.       $game_system.se_play($data_system.cancel_se)
  648.       @target_window.active = false
  649.       @other_window.active = true
  650.       @target_window.visible = false
  651.       return
  652.     end
  653.     if Input.trigger?(Input::C)
  654.       $game_system.se_play($data_system.save_se)
  655.       for i in 1..$data_states.size
  656.         $game_party.actors[@target_window.index].remove_state(i)
  657.       end
  658.       $game_party.actors[@target_window.index].hp += 9999
  659.       $game_party.actors[@target_window.index].sp += 9999
  660.       @target_window.refresh
  661.     end
  662.     if Input.trigger?(Input::X)
  663.       $game_system.se_play($data_system.save_se)
  664.       $game_party.actors[@target_window.index].hp += 9999
  665.       @target_window.refresh
  666.     end
  667.     if Input.trigger?(Input::Y)
  668.       $game_system.se_play($data_system.save_se)
  669.       $game_party.actors[@target_window.index].sp += 9999
  670.       @target_window.refresh
  671.     end
  672.     if Input.trigger?(Input::A)
  673.       $game_system.se_play($data_system.save_se)
  674.       for i in 1..$data_states.size
  675.         $game_party.actors[@target_window.index].remove_state(i)
  676.       end
  677.       @target_window.refresh
  678.     end
  679.   end
  680.   # ------------------------------
  681.   def update_var
  682.    if Input.trigger?(Input::B)
  683.       $game_system.se_play($data_system.cancel_se)
  684.       @var_window.active = false
  685.       @var_window.visible = false
  686.       @right_window.active = true
  687.       return
  688.     end
  689.     if Input.trigger?(Input::C)
  690.       $game_system.se_play($data_system.decision_se)
  691.       $game_variables[@variable_edit] = @var_window.number
  692.       @right_window.refresh
  693.       @var_window.active = false
  694.       @var_window.visible = false
  695.       @right_window.active = true
  696.     end
  697.   end
  698. # ------------------------------
  699.   def update_right
  700.     if Input.trigger?(Input::B)
  701.       $game_system.se_play($data_system.cancel_se)
  702.       @left_window.active = true
  703.       @right_window.active = false
  704.       @right_window.index = -1
  705.       @help_window.contents.clear
  706.       @help_window.contents.draw_text(4, 0, 400, 32, "按键盘A键(控制X键)打开菜单")
  707.       return
  708.     end
  709.     current_id = @right_window.top_id + @right_window.index
  710.     if @right_window.mode == 0
  711.       if Input.trigger?(Input::C)
  712.         $game_system.se_play($data_system.decision_se)
  713.         $game_switches[current_id] = (not $game_switches[current_id])
  714.         @right_window.refresh
  715.         return
  716.       end
  717.     end
  718.     if @right_window.mode == 1
  719.       if Input.repeat?(Input::RIGHT)
  720.         $game_system.se_play($data_system.cursor_se)
  721.         $game_variables[current_id] += 1
  722.         if $game_variables[current_id] > 99999999
  723.           $game_variables[current_id] = 99999999
  724.         end
  725.         @right_window.refresh
  726.         return
  727.       end
  728.       if Input.repeat?(Input::LEFT)
  729.         $game_system.se_play($data_system.cursor_se)
  730.         $game_variables[current_id] -= 1
  731.         if $game_variables[current_id] < -99999999
  732.           $game_variables[current_id] = -99999999
  733.         end
  734.         @right_window.refresh
  735.         return
  736.       end
  737.       if Input.repeat?(Input::C)
  738.         $game_system.se_play($data_system.decision_se)
  739.         current_id = @right_window.top_id + @right_window.index
  740.         @variable_edit = current_id
  741.         @var_window.number = $game_variables[current_id].abs
  742.         @var_window.visible = true
  743.         @var_window.active = true
  744.         @right_window.active = false
  745.       end
  746.        if Input.repeat?(Input::X)
  747.         $game_system.se_play($data_system.decision_se)
  748.         current_id = @right_window.top_id + @right_window.index
  749.         $game_variables[current_id] *= -1
  750.         @right_window.refresh
  751.       end
  752.       if Input.repeat?(Input::R)
  753.         $game_system.se_play($data_system.cursor_se)
  754.         $game_variables[current_id] += 10
  755.         if $game_variables[current_id] > 99999999
  756.           $game_variables[current_id] = 99999999
  757.         end
  758.         @right_window.refresh
  759.         return
  760.       end
  761.       if Input.repeat?(Input::L)
  762.         $game_system.se_play($data_system.cursor_se)
  763.         $game_variables[current_id] -= 10
  764.         if $game_variables[current_id] < -99999999
  765.           $game_variables[current_id] = -99999999
  766.         end
  767.         @right_window.refresh
  768.         return
  769.       end
  770.     end
  771.   end
  772. end
  773. class Window_Dataset < Window_Selectable
  774.   #---------------------------------
  775.   def initialize(type)
  776.     super(0, 0, 300, 480)
  777.     self.contents = Bitmap.new(width - 32, height - 32)
  778.     self.back_opacity = 160
  779.     self.contents.font.name = "黑体"
  780.     self.contents.font.size = 22
  781.     @type = type
  782.     if @type == 1
  783.       @item_max = $data_items.size - 1
  784.     end
  785.     if @type == 2
  786.       @item_max = $data_weapons.size - 1
  787.     end
  788.     if @type == 3
  789.       @item_max = $data_armors.size - 1
  790.     end
  791.     refresh
  792.   end
  793.   #---------------------------------
  794.   def refresh
  795.      if self.contents != nil
  796.       self.contents.dispose
  797.       self.contents = nil
  798.     end
  799.     y = 0
  800.     self.contents = Bitmap.new(width - 32, 32 * @item_max)
  801.     self.contents.clear
  802.     self.contents.font.name = "黑体"
  803.     self.contents.font.size = 22
  804.     self.opacity = 255
  805.     self.back_opacity = 255
  806.     if @type == 1
  807.       for i in 1..$data_items.size - 1
  808.       draw_item_name($data_items[i], 4, i*32 - 32)
  809.       number = $game_party.item_number(i).to_s
  810.       self.contents.draw_text(4, i*32 - 32, 262, 32, number, 2)
  811.       end
  812.     end
  813.      if @type == 2
  814.       for i in 1..$data_weapons.size - 1
  815.       draw_item_name($data_weapons[i], 4, i*32 - 32)
  816.       number = $game_party.weapon_number(i).to_s
  817.       self.contents.draw_text(4, i*32 - 32, 262, 32, number, 2)
  818.     end
  819.     end
  820.     if @type == 3
  821.       for i in 1..$data_armors.size - 1
  822.       draw_item_name($data_armors[i], 4, i*32 - 32)
  823.       number = $game_party.armor_number(i).to_s
  824.       self.contents.draw_text(4, i*32 - 32, 262, 32, number, 2)
  825.     end
  826.     end
  827.   end
  828. #---------------------------------
  829. def update
  830.   super
  831.   end
  832. end




  833. class Game_Actor < Game_Battler
  834. # -------------------------------------
  835.   def base_maxhp
  836.     if $game_temp.god_mode
  837.       return 9999
  838.     end
  839.     return $data_actors[@actor_id].parameters[0, @level]
  840.   end
  841.   # -------------------------------------
  842.   def base_maxsp
  843.     if $game_temp.god_mode
  844.       return 9999
  845.     end
  846.     return $data_actors[@actor_id].parameters[1, @level]
  847.   end
  848.   # -------------------------------------
  849.   def base_str
  850.     if $game_temp.god_mode
  851.       return 999
  852.     end
  853.     n = $data_actors[@actor_id].parameters[2, @level]
  854.     weapon = $data_weapons[@weapon_id]
  855.     armor1 = $data_armors[@armor1_id]
  856.     armor2 = $data_armors[@armor2_id]
  857.     armor3 = $data_armors[@armor3_id]
  858.     armor4 = $data_armors[@armor4_id]
  859.     n += weapon != nil ? weapon.str_plus : 0
  860.     n += armor1 != nil ? armor1.str_plus : 0
  861.     n += armor2 != nil ? armor2.str_plus : 0
  862.     n += armor3 != nil ? armor3.str_plus : 0
  863.     n += armor4 != nil ? armor4.str_plus : 0
  864.     return [[n, 1].max, 999].min
  865.   end
  866.   # -------------------------------------
  867.   def base_dex
  868.     if $game_temp.god_mode
  869.       return 999
  870.     end
  871.     n = $data_actors[@actor_id].parameters[3, @level]
  872.     weapon = $data_weapons[@weapon_id]
  873.     armor1 = $data_armors[@armor1_id]
  874.     armor2 = $data_armors[@armor2_id]
  875.     armor3 = $data_armors[@armor3_id]
  876.     armor4 = $data_armors[@armor4_id]
  877.     n += weapon != nil ? weapon.dex_plus : 0
  878.     n += armor1 != nil ? armor1.dex_plus : 0
  879.     n += armor2 != nil ? armor2.dex_plus : 0
  880.     n += armor3 != nil ? armor3.dex_plus : 0
  881.     n += armor4 != nil ? armor4.dex_plus : 0
  882.     return [[n, 1].max, 999].min
  883.   end
  884.   # -------------------------------------
  885.   def base_agi
  886.     if $game_temp.god_mode
  887.       return 999
  888.     end
  889.     n = $data_actors[@actor_id].parameters[4, @level]
  890.     weapon = $data_weapons[@weapon_id]
  891.     armor1 = $data_armors[@armor1_id]
  892.     armor2 = $data_armors[@armor2_id]
  893.     armor3 = $data_armors[@armor3_id]
  894.     armor4 = $data_armors[@armor4_id]
  895.     n += weapon != nil ? weapon.agi_plus : 0
  896.     n += armor1 != nil ? armor1.agi_plus : 0
  897.     n += armor2 != nil ? armor2.agi_plus : 0
  898.     n += armor3 != nil ? armor3.agi_plus : 0
  899.     n += armor4 != nil ? armor4.agi_plus : 0
  900.     return [[n, 1].max, 999].min
  901.   end
  902.   # -------------------------------------
  903.   def base_int
  904.     if $game_temp.god_mode
  905.       return 999
  906.     end
  907.     n = $data_actors[@actor_id].parameters[5, @level]
  908.     weapon = $data_weapons[@weapon_id]
  909.     armor1 = $data_armors[@armor1_id]
  910.     armor2 = $data_armors[@armor2_id]
  911.     armor3 = $data_armors[@armor3_id]
  912.     armor4 = $data_armors[@armor4_id]
  913.     n += weapon != nil ? weapon.int_plus : 0
  914.     n += armor1 != nil ? armor1.int_plus : 0
  915.     n += armor2 != nil ? armor2.int_plus : 0
  916.     n += armor3 != nil ? armor3.int_plus : 0
  917.     n += armor4 != nil ? armor4.int_plus : 0
  918.     return [[n, 1].max, 999].min
  919.   end
  920.   # -------------------------------------
  921.   def base_atk
  922.     if $game_temp.god_mode
  923.       return 9999999
  924.     end
  925.     weapon = $data_weapons[@weapon_id]
  926.     return weapon != nil ? weapon.atk : 0
  927.   end
  928.   # -------------------------------------
  929.   def base_pdef
  930.     if $game_temp.god_mode
  931.       return 999999
  932.     end
  933.     weapon = $data_weapons[@weapon_id]
  934.     armor1 = $data_armors[@armor1_id]
  935.     armor2 = $data_armors[@armor2_id]
  936.     armor3 = $data_armors[@armor3_id]
  937.     armor4 = $data_armors[@armor4_id]
  938.     pdef1 = weapon != nil ? weapon.pdef : 0
  939.     pdef2 = armor1 != nil ? armor1.pdef : 0
  940.     pdef3 = armor2 != nil ? armor2.pdef : 0
  941.     pdef4 = armor3 != nil ? armor3.pdef : 0
  942.     pdef5 = armor4 != nil ? armor4.pdef : 0
  943.     return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
  944.   end
  945.   # -------------------------------------
  946.   def base_mdef
  947.     if $game_temp.god_mode
  948.       return 999999
  949.     end
  950.     weapon = $data_weapons[@weapon_id]
  951.     armor1 = $data_armors[@armor1_id]
  952.     armor2 = $data_armors[@armor2_id]
  953.     armor3 = $data_armors[@armor3_id]
  954.     armor4 = $data_armors[@armor4_id]
  955.     mdef1 = weapon != nil ? weapon.mdef : 0
  956.     mdef2 = armor1 != nil ? armor1.mdef : 0
  957.     mdef3 = armor2 != nil ? armor2.mdef : 0
  958.     mdef4 = armor3 != nil ? armor3.mdef : 0
  959.     mdef5 = armor4 != nil ? armor4.mdef : 0
  960.     return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
  961.   end
  962. end


  963. class Game_Character
  964.   attr_accessor :move_speed # Add this after the other attr_accessors.
  965. end

  966. class Game_Temp
  967.   attr_accessor :god_mode # Add this after the other attr_accessors.
  968.   @god_mode = false # Add this after the other variable initializations.
  969. end

复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-7-1 11:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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