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

Project1

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

[转载] VX升级加点脚本,顺便把菜单调出加点。

[复制链接]

Lv1.梦旅人

梦石
0
星屑
209
在线时间
63 小时
注册时间
2010-12-12
帖子
30
跳转到指定楼层
1
 楼主| 发表于 2013-1-18 20:51:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
给一些没有的童鞋参考参考。
先放入这个脚本,升级加点。
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5. # 脚本使用设定:
  6.  
  7. LEVEL_UP_POINT = 3  # 每升一级所增加的点数
  8. LEVEL_UP_VARIABLE = 100  # 储存角色点数的变量编号与角色id编号的差值
  9.                          # 默认情况 = 100,
  10.                          # 则是数据库里1号角色的加点数存于101号变量
  11.                          # 3号角色的加点数存于103号变量。
  12.                          # 你可以直接操作变量赠与角色可分配点数
  13.  
  14. # 每增加一次点数,各项能力值的变化:357-410行
  15.  
  16. # 使用方法介绍:
  17.  
  18. # 本脚本不会取代原来的升级自动加点 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  19. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  20. # 1-99级全部等于一个相同数值就行了。
  21.  
  22. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  23. # 默认都是0号
  24.  
  25. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  26. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
  27.  
  28.  
  29. #==============================================================================
  30. # ■ Window_Command
  31. #------------------------------------------------------------------------------
  32. #  一般的命令选择行窗口。(追加定义)
  33. #==============================================================================
  34. class Window_Command < Window_Selectable
  35.   #--------------------------------------------------------------------------
  36.   # ● 项目有效化
  37.   #     index : 项目编号
  38.   #--------------------------------------------------------------------------
  39.   def able_item(index)
  40.     draw_item(index, normal_color)
  41.   end
  42. end
  43. #==============================================================================
  44. # ■ Game_Actor
  45. #------------------------------------------------------------------------------
  46. #  处理角色的类。(再定义)
  47. #==============================================================================
  48.  
  49. class Game_Actor < Game_Battler
  50.   def level_up
  51.     [url=home.php?mod=space&uid=22147]@level[/url] += 1
  52.     $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  53.     for learning in self.class.learnings
  54.       learn_skill(learning.skill_id) if learning.level == @level
  55.     end
  56.   end
  57. end
  58. #==============================================================================
  59. # ■ Window_Base
  60. #------------------------------------------------------------------------------
  61. #  游戏中全部窗口的超级类(追加定义)
  62. #==============================================================================
  63. class Window_Base < Window
  64.   #--------------------------------------------------------------------------
  65.   # ● 描绘 HP
  66.   #     actor : 角色
  67.   #     x     : 描画目标 X 坐标
  68.   #     y     : 描画目标 Y 坐标
  69.   #     width : 描画目标的宽
  70.   #--------------------------------------------------------------------------
  71.   def draw_actor_hp_lvup(actor, x, y)
  72.     self.contents.font.color = system_color
  73.     self.contents.draw_text(x , y, 96, 32, "最大" + Vocab::hp)
  74.     if $temp_hp == 0
  75.       self.contents.font.color = normal_color
  76.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  77.     else
  78.       maxhp = actor.maxhp + $temp_hp
  79.       self.contents.font.color = Color.new(255, 128, 128, 255)
  80.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  81.       self.contents.font.color = normal_color      
  82.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  83.       if $temp_hp >=0
  84.         self.contents.font.color = Color.new(255, 128, 128, 255)
  85.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  86.       else
  87.         self.contents.font.color = Color.new(255,255,0,255)
  88.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  89.       end
  90.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  91.       self.contents.font.color = normal_color
  92.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  93.     end
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 描绘 MP
  97.   #     actor : 角色
  98.   #     x     : 描画目标 X 坐标
  99.   #     y     : 描画目标 Y 坐标
  100.   #     width : 描画目标的宽
  101.   #--------------------------------------------------------------------------
  102.   def draw_actor_mp_lvup(actor, x, y)
  103.     self.contents.font.color = system_color
  104.     self.contents.draw_text(x , y, 96, 32, "最大" + Vocab::mp)
  105.     if $temp_mp == 0
  106.       self.contents.font.color = normal_color
  107.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxmp.to_s, 2)
  108.     else
  109.       maxmp = actor.maxmp + $temp_mp
  110.       self.contents.font.color = Color.new(255, 128, 128, 255)
  111.       self.contents.draw_text(x + 120 , y, 48, 32, maxmp.to_s ,2)
  112.       self.contents.font.color = normal_color      
  113.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  114.       if $temp_mp >=0
  115.         self.contents.font.color = Color.new(255, 128, 128, 255)
  116.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  117.       else
  118.         self.contents.font.color = Color.new(255,255,0,255)
  119.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  120.       end
  121.       self.contents.draw_text(x + 200, y, 36, 32, $temp_mp.to_s, 2)
  122.       self.contents.font.color = normal_color
  123.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  124.     end
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 描绘能力值
  128.   #     actor : 角色
  129.   #     x     : 描画目标 X 坐标
  130.   #     y     : 描画目标 Y 坐标
  131.   #     type  : 能力值种类 (0~4)
  132.   #--------------------------------------------------------------------------
  133.   def draw_actor_lvup(actor, x, y, type)   
  134.     # 定义数字颜色
  135.     lvup = normal_color
  136.     upcolor = Color.new(255, 128, 128, 255)
  137.     self.contents.font.color = normal_color   
  138.     case type
  139.     when 0
  140.       parameter_name = Vocab::atk
  141.       parameter_value = actor.atk
  142.       parameter_value_temp = parameter_value + $temp_atk
  143.       if $temp_atk != 0
  144.         lvup = upcolor
  145.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  146.         if $temp_atk >= 0
  147.           self.contents.font.color = lvup
  148.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  149.         else
  150.           self.contents.font.color = Color.new(255,255,0,255)
  151.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  152.         end        
  153.         self.contents.draw_text(x + 272, y, 80, 32, $temp_atk.abs.to_s,1)
  154.         self.contents.font.color = normal_color
  155.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  156.       end
  157.     when 1
  158.       parameter_name = Vocab::def
  159.       parameter_value = actor.def
  160.       parameter_value_temp = parameter_value + $temp_def
  161.       if $temp_def != 0
  162.         lvup = upcolor
  163.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  164.         if $temp_def >= 0
  165.           self.contents.font.color = lvup
  166.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  167.         else
  168.           self.contents.font.color = Color.new(255,255,0,255)
  169.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  170.         end        
  171.         self.contents.draw_text(x + 272, y, 80, 32, $temp_def.abs.to_s,1)
  172.         self.contents.font.color = normal_color
  173.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  174.       end
  175.     when 2
  176.       parameter_name = Vocab::agi
  177.       parameter_value = actor.agi
  178.       parameter_value_temp = parameter_value + $temp_agi
  179.       if $temp_agi != 0
  180.         lvup = upcolor
  181.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  182.         if $temp_agi >= 0
  183.           self.contents.font.color = lvup
  184.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  185.         else
  186.           self.contents.font.color = Color.new(255,255,0,255)
  187.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  188.         end        
  189.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  190.         self.contents.font.color = normal_color
  191.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  192.       end
  193.     when 3
  194.       parameter_name = Vocab::spi
  195.       parameter_value = actor.spi
  196.       parameter_value_temp = parameter_value + $temp_spi
  197.       if $temp_spi != 0
  198.         lvup = upcolor
  199.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  200.         if $temp_spi >= 0
  201.           self.contents.font.color = lvup
  202.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  203.         else
  204.           self.contents.font.color = Color.new(255,255,0,255)
  205.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  206.         end        
  207.         self.contents.draw_text(x + 272, y, 80, 32, $temp_spi.abs.to_s,1)
  208.         self.contents.font.color = normal_color
  209.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  210.       end
  211.     when 4
  212.       parameter_name = "剩余点数"
  213.       parameter_value = $point
  214.       if $point != 0
  215.         lvup = upcolor
  216.       end
  217.     end   
  218.     self.contents.font.size = 16 if type == 4
  219.     self.contents.font.color = system_color
  220.     if type != 4 then
  221.       self.contents.draw_text(x, y, 120, 32, parameter_name)
  222.     else
  223.       self.contents.draw_text(x, y, 120, 24, parameter_name)
  224.     end
  225.     self.contents.font.color = normal_color
  226.     if type != 4
  227.       self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  228.     else
  229.       self.contents.draw_text(x + 68, y, 36, 24, parameter_value.to_s)   
  230.     end
  231.     if type != 4
  232.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  233.     end  
  234.     self.contents.font.color = lvup
  235.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  236.     self.contents.font.color = normal_color        
  237.   end
  238. end
  239.  
  240. class Window_Lvpoint < Window_Base
  241.   def initialize
  242.     super(0,198,128,58)
  243.     refresh
  244.   end
  245.   def refresh
  246.     self.contents.clear
  247.     draw_actor_lvup(@actor, 0, 0, 4)
  248.   end
  249. end
  250. #==============================================================================
  251. # ■ Window_lvup
  252. #------------------------------------------------------------------------------
  253. #  显示升级状态窗口。
  254. #==============================================================================
  255. class Window_Lvup < Window_Base
  256.   #--------------------------------------------------------------------------
  257.   # ● 初始化对像
  258.   #     actor : 角色
  259.   #--------------------------------------------------------------------------
  260.   def initialize(actor)
  261.     super(0, 0, 416, 256)
  262.     self.contents = Bitmap.new(width - 32, height - 32)
  263.     [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  264.     refresh
  265.   end  
  266.   #--------------------------------------------------------------------------
  267.   # ● 刷新
  268.   #--------------------------------------------------------------------------
  269.   def refresh
  270.     self.contents.clear
  271.     draw_actor_graphic(@actor, 30, 80)
  272.     draw_actor_name(@actor, 4, 0)
  273.     draw_actor_class(@actor, 96, 0)
  274.     draw_actor_level(@actor, 224, 0)
  275.     draw_actor_state(@actor, 96, 32)   
  276.     draw_actor_hp_lvup(@actor, 96, 32)
  277.     draw_actor_mp_lvup(@actor, 96, 64)
  278.     draw_actor_lvup(@actor, 4, 96, 0)
  279.     draw_actor_lvup(@actor, 4, 128, 1)
  280.     draw_actor_lvup(@actor, 4, 160, 2)
  281.     draw_actor_lvup(@actor, 4, 192, 3)
  282.   end
  283. end
  284. #==============================================================================
  285. # ■ Window_Help
  286. #------------------------------------------------------------------------------
  287. #  特技及物品的说明、角色的状态显示的窗口。
  288. #==============================================================================
  289. class Window_Lvup_Help < Window_Base
  290.   #--------------------------------------------------------------------------
  291.   # ● 初始化对像
  292.   #--------------------------------------------------------------------------
  293.   def initialize
  294.     super(0, 256, 544, 160)
  295.     self.contents = Bitmap.new(width - 32, height - 32)
  296.     [url=home.php?mod=space&uid=76370]@test[/url] = "" #——这个东西用来检测,节约内存专用
  297.   end  
  298.   #--------------------------------------------------------------------------
  299.   # ● 设置文本
  300.   #--------------------------------------------------------------------------
  301.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  302.     if @test != text1
  303.       @test = text1
  304.     else
  305.       return
  306.     end   
  307.     self.contents.clear
  308.     self.contents.font.color = normal_color
  309.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  310.     if text2 != nil
  311.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  312.     end
  313.     self.contents.font.size -= 4
  314.     if text3 != nil
  315.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  316.     end
  317.     if text4 != nil
  318.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  319.     end
  320.     self.contents.font.size += 4
  321.   end
  322. end
  323. #==============================================================================
  324. # ■ Scene_lvup
  325. #------------------------------------------------------------------------------
  326. #  处理升级画面的类。
  327. #==============================================================================
  328. class Scene_Lvup
  329.   #--------------------------------------------------------------------------
  330.   # ● 初始化对像
  331.   #     actor_index : 角色索引
  332.   #     menu_index : 选项起始位置
  333.   #--------------------------------------------------------------------------
  334.   def initialize(actor_index = 0 , menu_index = 0)
  335.     @actor_index = actor_index
  336.     @menu_index = menu_index
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # ● 主处理
  340.   #--------------------------------------------------------------------------
  341.   def main
  342.     s1 = "增加体力"
  343.     s2 = "增加"+Vocab::atk
  344.     s3 = "增加"+Vocab::def
  345.     s4 = "增加"+Vocab::agi
  346.     s5 = "增加"+Vocab::spi
  347.     s6 = "确认加点"
  348.     s7 = "点数重置"
  349.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  350.     @command_window.index = @menu_index
  351.     # 获取角色
  352.     @actor = $game_party.members[@actor_index]
  353.     # 将角色的剩余点数带入
  354.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  355.     # 初始化临时量
  356.     $temp_atk = 0
  357.     $temp_def = 0
  358.     $temp_agi = 0
  359.     $temp_spi = 0
  360.     $temp_hp = 0
  361.     $temp_mp = 0
  362.     #=========================================================================
  363.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  364.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  365.     #=========================================================================
  366.     # 每提升一次力量,提升多少附加能力
  367.     #=========================================================================
  368.     @atk_hp = 2     # 每提升一次力量附加提升多少HP
  369.     @atk_mp = 2     # 每提升一次力量附加提升多少MP
  370.     @atk_def = 1    # 每提升一次力量附加提升多少灵巧
  371.     @atk_agi = 1    # 每提升一次力量附加提升多少速度
  372.     @atk_spi = 0    # 每提升一次力量附加提升多少魔力
  373.     @atk_atk = 5    # 每提升一次力量附加提升多少力量
  374.     #=========================================================================
  375.     # 每提升一次灵巧,提升多少附加能力
  376.     #=========================================================================
  377.     @def_hp = 3     # 每提升一次灵巧附加提升多少HP
  378.     @def_mp = 2     # 每提升一次灵巧附加提升多少MP
  379.     @def_atk = 1    # 每提升一次灵巧附加提升多少力量
  380.     @def_agi = 1    # 每提升一次灵巧附加提升多少速度
  381.     @def_spi = 0    # 每提升一次灵巧附加提升多少魔力
  382.     @def_def = 5    # 每提升一次灵巧附加提升多少灵巧
  383.     #=========================================================================
  384.     # 每提升一次速度,提升多少附加能力
  385.     #=========================================================================
  386.     @agi_hp = 3     # 每提升一次速度附加提升多少HP
  387.     @agi_mp = 2     # 每提升一次速度附加提升多少MP
  388.     @agi_atk = 1    # 每提升一次速度附加提升多少力量
  389.     @agi_def = 1    # 每提升一次速度附加提升多少灵巧
  390.     @agi_spi = 0    # 每提升一次速度附加提升多少魔力
  391.     @agi_agi = 5    # 每提升一次速度附加提升多少速度
  392.     #=========================================================================
  393.     # 每提升一次魔力,提升多少附加能力
  394.     #=========================================================================
  395.     @spi_hp = 1     # 每提升一次魔力附加提升多少HP
  396.     @spi_mp = 10    # 每提升一次魔力附加提升多少MP
  397.     @spi_atk = -1   # 每提升一次魔力附加提升多少力量
  398.     @spi_def = -1   # 每提升一次魔力附加提升多少灵巧
  399.     @spi_agi = -1   # 每提升一次魔力附加提升多少速度
  400.     @spi_spi = 10   # 每提升一次魔力附加提升多少魔力
  401.     #=========================================================================
  402.     # 每提升一次体力,提升多少附加能力
  403.     #=========================================================================
  404.     @hp = 15       # 每提升一次体力提升多少HP
  405.     @mp = 10       # 每提升一次体力提升多少MP
  406.     @hp_atk = -1   # 每提升一次体力提升多少力量
  407.     @hp_def = -1   # 每提升一次体力提升多少速度
  408.     @hp_agi = -1   # 每提升一次体力提升多少灵巧
  409.     @hp_spi = -1   # 每提升一次体力提升多少魔力   
  410.     # 定义说明文字
  411.     @text_hp_sc = "体力可以增加生存的能力,可以延长生存的时间!"
  412.     @text_atk_sc = Vocab::atk + "可以增加物理攻击和物理技能的威力!"
  413.     @text_def_sc = Vocab::def + "可以提高攻击的命中率和必杀!"
  414.     @text_agi_sc = Vocab::agi + "可以提高回避、命中、逃跑成功率!"
  415.     @text_spi_sc = Vocab::spi + "可以提高魔法的效果,可以增加1点魔法!"
  416.     @text_save = "保存分配情况并返回游戏"
  417.     @text_reset= "重新分配能力点数"
  418.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  419.     @text_hp = "最大" + Vocab::hp + "值"
  420.     @text_mp = "最大" + Vocab::mp + "值"
  421.     @text_atk = "最大" + Vocab::atk + "值"
  422.     @text_def = "最大" + Vocab::def + "值"
  423.     @text_agi = "最大" + Vocab::agi + "值"
  424.     @text_spi = "最大" + Vocab::spi + "值"
  425.     s_disable
  426.     # 生成状态窗口
  427.     @lvup_window = Window_Lvup.new(@actor)
  428.     @lvup_window.x = 128
  429.     @lvup_window.y = 0   
  430.     @lvpoint_window = Window_Lvpoint.new
  431.     # 生成帮助窗口并初始化帮助文本
  432.     @help_window = Window_Lvup_Help.new   
  433.     # 执行过渡
  434.     Graphics.transition
  435.     # 主循环
  436.     loop do
  437.       # 刷新游戏画面
  438.       Graphics.update
  439.       # 刷新输入信息
  440.       Input.update
  441.       # 刷新画面
  442.       update
  443.       # 如果切换画面就中断循环
  444.       if $scene != self
  445.         break
  446.       end
  447.     end
  448.     # 准备过渡
  449.     Graphics.freeze
  450.     # 释放窗口
  451.     @lvpoint_window.dispose
  452.     @command_window.dispose
  453.     @lvup_window.dispose
  454.     @help_window.dispose
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # ● 刷新画面
  458.   #--------------------------------------------------------------------------
  459.   def update
  460.     # 刷新窗口
  461.     @command_window.update
  462.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  463.     s_disable
  464.     @lvup_window.update
  465.     #=============================================================
  466.     # 按下 B 键的情况下
  467.     #=============================================================
  468.     if Input.trigger?(Input::B)
  469.       # 演奏取消 SE
  470.       Sound.play_cancel
  471.       # 切换到地图画面
  472.       $scene = Scene_Map.new
  473.       return
  474.     end
  475.     #=============================================================
  476.     # 按下 C 键的情况下
  477.     #=============================================================
  478.     if Input.trigger?(Input::C)      
  479.       if @command_window.index == 5
  480.           # 演奏确定 SE
  481.         Sound.play_decision
  482.         # 将角色的剩余点数带回
  483.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  484.         # 将角色点数实际加上
  485.         @actor.atk += $temp_atk
  486.         @actor.def += $temp_def
  487.         @actor.agi += $temp_agi
  488.         @actor.spi += $temp_spi
  489.         @actor.maxhp += $temp_hp
  490.         @actor.maxmp += $temp_mp
  491.         # 切换到地图画面
  492.         $scene = Scene_Map.new
  493.         return
  494.       end
  495.       if @command_window.index == 6
  496.           # 演奏确定 SE
  497.         Sound.play_decision
  498.           # 将角色的剩余点数带入
  499.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  500.           # 初始化临时量
  501.         $temp_atk = 0
  502.         $temp_def = 0
  503.         $temp_agi = 0
  504.         $temp_spi = 0
  505.         $temp_hp = 0
  506.         $temp_mp = 0
  507.         @lvup_window.refresh
  508.         @lvpoint_window.refresh
  509.         return
  510.       end
  511.       if $point == 0
  512.         # 演奏冻结 SE
  513.         Sound.play_buzzer
  514.         return
  515.       end
  516.       case @command_window.index
  517.       when 0
  518.         # 演奏确定 SE
  519.         Sound.play_decision
  520.         $temp_hp += @hp
  521.         $temp_mp += @mp
  522.         $temp_atk += @hp_atk
  523.         $temp_def += @hp_def
  524.         $temp_agi += @hp_agi
  525.         $temp_spi += @hp_spi
  526.         $point -= 1
  527.         @lvup_window.refresh
  528.         @lvpoint_window.refresh
  529.         s_disable
  530.         return
  531.       when 1
  532.         # 演奏确定 SE
  533.         Sound.play_decision
  534.         $temp_atk += @atk_atk
  535.         $temp_hp += @atk_hp
  536.         $temp_mp += @atk_mp
  537.         $temp_def += @atk_def
  538.         $temp_agi += @atk_agi
  539.         $temp_spi += @atk_spi
  540.         $point -= 1
  541.         @lvup_window.refresh
  542.         @lvpoint_window.refresh
  543.         s_disable
  544.         return
  545.       when 2
  546.         # 演奏确定 SE
  547.         Sound.play_decision
  548.         $temp_def += @def_def
  549.         $temp_hp += @def_hp
  550.         $temp_mp += @def_mp
  551.         $temp_atk += @def_atk
  552.         $temp_agi += @def_agi
  553.         $temp_spi += @def_spi
  554.         $point -= 1
  555.         @lvup_window.refresh
  556.         @lvpoint_window.refresh
  557.         s_disable
  558.         return
  559.       when 3
  560.         # 演奏确定 SE
  561.         Sound.play_decision
  562.         $temp_agi += @agi_agi
  563.         $temp_hp += @agi_hp
  564.         $temp_mp += @agi_mp
  565.         $temp_atk += @agi_atk
  566.         $temp_def += @agi_def
  567.         $temp_spi += @agi_spi
  568.         $point -= 1
  569.         @lvup_window.refresh
  570.         @lvpoint_window.refresh
  571.         s_disable
  572.         return
  573.       when 4
  574.         # 演奏确定 SE
  575.         Sound.play_decision
  576.         $temp_spi += @spi_spi
  577.         $temp_hp += @spi_hp
  578.         $temp_mp += @spi_mp
  579.         $temp_atk += @spi_atk
  580.         $temp_def += @spi_def
  581.         $temp_agi += @spi_agi
  582.         $point -= 1
  583.         @lvup_window.refresh
  584.         @lvpoint_window.refresh
  585.         s_disable
  586.         return
  587.       end
  588.     end
  589.     #=============================================================
  590.     # 什么都没有按下的情况
  591.     #=============================================================
  592.     case @command_window.index   
  593.     when 0  # 增加体力
  594.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_atk + @hp_atk.to_s + "点   " + @text_def + @hp_def.to_s + "点"
  595.       temptext2 = @text_mp + @mp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_spi + @hp_spi.to_s + "点"
  596.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  597.     when 1  # 增加力量
  598.       temptext1 = @text_hp + @atk_hp.to_s + "点   " + @text_atk + @atk_atk.to_s + "点   " + @text_def + @atk_def.to_s + "点"
  599.       temptext2 = @text_mp + @atk_mp.to_s + "点   " + @text_agi + @atk_agi.to_s + "点   " + @text_spi + @atk_spi.to_s + "点"
  600.       @help_window.lvup_text(@text_atk_sc , @text_2 , temptext1 , temptext2)
  601.     when 2  # 增加灵巧
  602.       temptext1 = @text_hp + @def_hp.to_s + "点   " + @text_atk + @def_agi.to_s + "点   " + @text_def + @def_def.to_s + "点"
  603.       temptext2 = @text_mp + @def_mp.to_s + "点   " + @text_agi + @def_agi.to_s + "点   " + @text_spi + @def_spi.to_s + "点"
  604.       @help_window.lvup_text(@text_def_sc , @text_2 , temptext1 , temptext2)
  605.     when 3  # 增加速度
  606.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_atk + @agi_atk.to_s + "点   " + @text_def + @agi_def.to_s + "点"
  607.       temptext2 = @text_mp + @agi_mp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_spi + @agi_spi.to_s + "点"
  608.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  609.     when 4  # 增加魔力
  610.       temptext1 = @text_hp + @spi_hp.to_s + "点   " + @text_atk + @spi_atk.to_s + "点   " + @text_def + @spi_def.to_s + "点"
  611.       temptext2 = @text_mp + @spi_mp.to_s + "点   " + @text_agi + @spi_agi.to_s + "点   " + @text_spi + @spi_spi.to_s + "点"
  612.       @help_window.lvup_text(@text_spi_sc , @text_2 , temptext1 , temptext2)
  613.     when 5 # 保存设定
  614.       @help_window.lvup_text(@text_save)
  615.     when 6 # 点数重置
  616.       @help_window.lvup_text(@text_reset)     
  617.     end
  618.     #=============================================================
  619.     # 按下R与L换人的情况
  620.     #=============================================================      
  621.     if Input.trigger?(Input::R)
  622.       # 演奏光标 SE
  623.       Sound.play_cursor
  624.       # 移至下一位角色
  625.       @actor_index += 1
  626.       @actor_index %= $game_party.members.size
  627.       # 切换到别的状态画面
  628.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  629.       return
  630.     end
  631.     # 按下 L 键的情况下
  632.     if Input.trigger?(Input::L)
  633.       # 演奏光标 SE
  634.       Sound.play_cursor
  635.       # 移至上一位角色
  636.       @actor_index += $game_party.members.size - 1
  637.       @actor_index %= $game_party.members.size
  638.       # 切换到别的状态画面
  639.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  640.       return
  641.     end
  642.   end  
  643.   #--------------------------------------------------------------------------
  644.   # ● 选项明暗判断
  645.   #--------------------------------------------------------------------------
  646.   def s_disable
  647.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  648.     if $point == 0
  649.       enabled = false
  650.     else
  651.       enabled = true
  652.     end
  653.       @command_window.draw_item(0,enabled)
  654.       @command_window.draw_item(1,enabled)
  655.       @command_window.draw_item(2,enabled)
  656.       @command_window.draw_item(3,enabled)
  657.       @command_window.draw_item(4,enabled)
  658.   end
  659. end


接着,找到Scene_Menu,找到54行,是生成命令窗口一类。我们的加点选项肯定要在离开游戏的前一个,所以,我们先把s6 = Vocab::game_end   改成s7 = Vocab::game_end,再插在他上面输入:s6 = "加点",这样菜单就会多出一个加点选项。
然后,我们找到90行一下,看到很多when什么的,找到when 5      # 结束游戏,把他改成when 6      # 结束游戏,然后在他上面插入:when 5      # 加点,在加点的下面,再输入召唤此脚本的脚本命令$scene = Scene_Lvup.new,和上面的位置相同,然后就打开游戏测试吧!有惊喜!

Lv1.梦旅人

梦石
0
星屑
60
在线时间
56 小时
注册时间
2012-12-23
帖子
79
2
发表于 2013-1-31 11:47:35 | 只看该作者
顶一个先,没人占沙发我先占
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
7 小时
注册时间
2013-2-19
帖子
14
3
发表于 2013-2-20 20:11:54 | 只看该作者
51行 有错。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
96 小时
注册时间
2013-9-21
帖子
112
4
发表于 2013-10-3 16:50:43 | 只看该作者
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

# 脚本使用设定:

LEVEL_UP_POINT = 3  # 每升一级所增加的点数
LEVEL_UP_VARIABLE = 100  # 储存角色点数的变量编号与角色id编号的差值
                         # 默认情况 = 100,
                         # 则是数据库里1号角色的加点数存于101号变量
                         # 3号角色的加点数存于103号变量。
                         # 你可以直接操作变量赠与角色可分配点数

# 每增加一次点数,各项能力值的变化:357-410行

# 使用方法介绍:

# 本脚本不会取代原来的升级自动加点 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
# 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
# 1-99级全部等于一个相同数值就行了。

# 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
# 默认都是0号

# 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
# 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new


#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
#  一般的命令选择行窗口。(追加定义)
#==============================================================================
class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 项目有效化
  #     index : 项目编号
  #--------------------------------------------------------------------------
  def able_item(index)
    draw_item(index, normal_color)
  end
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  处理角色的类。(再定义)
#==============================================================================

class Game_Actor < Game_Battler
  def level_up
    @level += 1
    $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
    for learning in self.class.learnings
      learn_skill(learning.skill_id) if learning.level == @level
    end
  end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  游戏中全部窗口的超级类(追加定义)
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● 描绘 HP
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     width : 描画目标的宽
  #--------------------------------------------------------------------------
  def draw_actor_hp_lvup(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x , y, 96, 32, "最大" + Vocab::hp)
    if $temp_hp == 0
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
    else
      maxhp = actor.maxhp + $temp_hp
      self.contents.font.color = Color.new(255, 128, 128, 255)
      self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
      self.contents.font.color = normal_color      
      self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
      if $temp_hp >=0
        self.contents.font.color = Color.new(255, 128, 128, 255)
        self.contents.draw_text(x + 155, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(255,255,0,255)
        self.contents.draw_text(x + 155, y, 36, 32, " -",2)
      end
      self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘 MP
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     width : 描画目标的宽
  #--------------------------------------------------------------------------
  def draw_actor_mp_lvup(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x , y, 96, 32, "最大" + Vocab::mp)
    if $temp_mp == 0
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120 , y, 48, 32, actor.maxmp.to_s, 2)
    else
      maxmp = actor.maxmp + $temp_mp
      self.contents.font.color = Color.new(255, 128, 128, 255)
      self.contents.draw_text(x + 120 , y, 48, 32, maxmp.to_s ,2)
      self.contents.font.color = normal_color      
      self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
      if $temp_mp >=0
        self.contents.font.color = Color.new(255, 128, 128, 255)
        self.contents.draw_text(x + 155, y, 36, 32, " +",2)
      else
        self.contents.font.color = Color.new(255,255,0,255)
        self.contents.draw_text(x + 155, y, 36, 32, " -",2)
      end
      self.contents.draw_text(x + 200, y, 36, 32, $temp_mp.to_s, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 描绘能力值
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     type  : 能力值种类 (0~4)
  #--------------------------------------------------------------------------
  def draw_actor_lvup(actor, x, y, type)   
    # 定义数字颜色
    lvup = normal_color
    upcolor = Color.new(255, 128, 128, 255)
    self.contents.font.color = normal_color   
    case type
    when 0
      parameter_name = Vocab::atk
      parameter_value = actor.atk
      parameter_value_temp = parameter_value + $temp_atk
      if $temp_atk != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_atk >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_atk.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 1
      parameter_name = Vocab::def
      parameter_value = actor.def
      parameter_value_temp = parameter_value + $temp_def
      if $temp_def != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_def >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_def.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 2
      parameter_name = Vocab::agi
      parameter_value = actor.agi
      parameter_value_temp = parameter_value + $temp_agi
      if $temp_agi != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_agi >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 3
      parameter_name = Vocab::spi
      parameter_value = actor.spi
      parameter_value_temp = parameter_value + $temp_spi
      if $temp_spi != 0
        lvup = upcolor
        self.contents.draw_text(x + 256, y, 16, 32, "(")
        if $temp_spi >= 0
          self.contents.font.color = lvup
          self.contents.draw_text(x + 272, y, 80, 32, "+",0)
        else
          self.contents.font.color = Color.new(255,255,0,255)
          self.contents.draw_text(x + 272, y, 80, 32, "-",0)
        end        
        self.contents.draw_text(x + 272, y, 80, 32, $temp_spi.abs.to_s,1)
        self.contents.font.color = normal_color
        self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
      end
    when 4
      parameter_name = "剩余点数"
      parameter_value = $point
      if $point != 0
        lvup = upcolor
      end
    end   
    self.contents.font.size = 16 if type == 4
    self.contents.font.color = system_color
    if type != 4 then
      self.contents.draw_text(x, y, 120, 32, parameter_name)
    else
      self.contents.draw_text(x, y, 120, 24, parameter_name)
    end
    self.contents.font.color = normal_color
    if type != 4
      self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
    else
      self.contents.draw_text(x + 68, y, 36, 24, parameter_value.to_s)   
    end
    if type != 4
      self.contents.draw_text(x + 150, y, 36, 32, "→")
    end  
    self.contents.font.color = lvup
    self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
    self.contents.font.color = normal_color        
  end
end

class Window_Lvpoint < Window_Base
  def initialize
    super(0,198,128,58)
    refresh
  end
  def refresh
    self.contents.clear
    draw_actor_lvup(@actor, 0, 0, 4)
  end
end
#==============================================================================
# ■ Window_lvup
#------------------------------------------------------------------------------
#  显示升级状态窗口。
#==============================================================================
class Window_Lvup < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 416, 256)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end  
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 30, 80)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 96, 0)
    draw_actor_level(@actor, 224, 0)
    draw_actor_state(@actor, 96, 32)   
    draw_actor_hp_lvup(@actor, 96, 32)
    draw_actor_mp_lvup(@actor, 96, 64)
    draw_actor_lvup(@actor, 4, 96, 0)
    draw_actor_lvup(@actor, 4, 128, 1)
    draw_actor_lvup(@actor, 4, 160, 2)
    draw_actor_lvup(@actor, 4, 192, 3)
  end
end
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  特技及物品的说明、角色的状态显示的窗口。
#==============================================================================
class Window_Lvup_Help < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    super(0, 256, 544, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @test = "" #——这个东西用来检测,节约内存专用
  end  
  #--------------------------------------------------------------------------
  # ● 设置文本
  #--------------------------------------------------------------------------
  def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
    if @test != text1
      @test = text1
    else
      return
    end   
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, self.width - 40, 32, text1)
    if text2 != nil
      self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
    end
    self.contents.font.size -= 4
    if text3 != nil
      self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
    end
    if text4 != nil
      self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
    end
    self.contents.font.size += 4
  end
end
#==============================================================================
# ■ Scene_lvup
#------------------------------------------------------------------------------
#  处理升级画面的类。
#==============================================================================
class Scene_Lvup
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor_index : 角色索引
  #     menu_index : 选项起始位置
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0 , menu_index = 0)
    @actor_index = actor_index
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    s1 = "增加体力"
    s2 = "增加"+Vocab::atk
    s3 = "增加"+Vocab::def
    s4 = "增加"+Vocab::agi
    s5 = "增加"+Vocab::spi
    s6 = "确认加点"
    s7 = "点数重置"
    @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # 获取角色
    @actor = $game_party.members[@actor_index]
    # 将角色的剩余点数带入
    $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
    # 初始化临时量
    $temp_atk = 0
    $temp_def = 0
    $temp_agi = 0
    $temp_spi = 0
    $temp_hp = 0
    $temp_mp = 0
    #=========================================================================
    # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
    #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
    #=========================================================================
    # 每提升一次力量,提升多少附加能力
    #=========================================================================
    @atk_hp = 2     # 每提升一次力量附加提升多少HP
    @atk_mp = 2     # 每提升一次力量附加提升多少MP
    @atk_def = 1    # 每提升一次力量附加提升多少灵巧
    @atk_agi = 1    # 每提升一次力量附加提升多少速度
    @atk_spi = 0    # 每提升一次力量附加提升多少魔力
    @atk_atk = 5    # 每提升一次力量附加提升多少力量
    #=========================================================================
    # 每提升一次灵巧,提升多少附加能力
    #=========================================================================
    @def_hp = 3     # 每提升一次灵巧附加提升多少HP
    @def_mp = 2     # 每提升一次灵巧附加提升多少MP
    @def_atk = 1    # 每提升一次灵巧附加提升多少力量
    @def_agi = 1    # 每提升一次灵巧附加提升多少速度
    @def_spi = 0    # 每提升一次灵巧附加提升多少魔力
    @def_def = 5    # 每提升一次灵巧附加提升多少灵巧
    #=========================================================================
    # 每提升一次速度,提升多少附加能力
    #=========================================================================
    @agi_hp = 3     # 每提升一次速度附加提升多少HP
    @agi_mp = 2     # 每提升一次速度附加提升多少MP
    @agi_atk = 1    # 每提升一次速度附加提升多少力量
    @agi_def = 1    # 每提升一次速度附加提升多少灵巧
    @agi_spi = 0    # 每提升一次速度附加提升多少魔力
    @agi_agi = 5    # 每提升一次速度附加提升多少速度
    #=========================================================================
    # 每提升一次魔力,提升多少附加能力
    #=========================================================================
    @spi_hp = 1     # 每提升一次魔力附加提升多少HP
    @spi_mp = 10    # 每提升一次魔力附加提升多少MP
    @spi_atk = -1   # 每提升一次魔力附加提升多少力量
    @spi_def = -1   # 每提升一次魔力附加提升多少灵巧
    @spi_agi = -1   # 每提升一次魔力附加提升多少速度
    @spi_spi = 10   # 每提升一次魔力附加提升多少魔力
    #=========================================================================
    # 每提升一次体力,提升多少附加能力
    #=========================================================================
    @hp = 15       # 每提升一次体力提升多少HP
    @mp = 10       # 每提升一次体力提升多少MP
    @hp_atk = -1   # 每提升一次体力提升多少力量
    @hp_def = -1   # 每提升一次体力提升多少速度
    @hp_agi = -1   # 每提升一次体力提升多少灵巧
    @hp_spi = -1   # 每提升一次体力提升多少魔力   
    # 定义说明文字
    @text_hp_sc = "体力可以增加生存的能力,可以延长生存的时间!"
    @text_atk_sc = Vocab::atk + "可以增加物理攻击和物理技能的威力!"
    @text_def_sc = Vocab::def + "可以提高攻击的命中率和必杀!"
    @text_agi_sc = Vocab::agi + "可以提高回避、命中、逃跑成功率!"
    @text_spi_sc = Vocab::spi + "可以提高魔法的效果,可以增加1点魔法!"
    @text_save = "保存分配情况并返回游戏"
    @text_reset= "重新分配能力点数"
    @text_2 = "每增加一次此项能力值,可以提升能力值"
    @text_hp = "最大" + Vocab::hp + "值"
    @text_mp = "最大" + Vocab::mp + "值"
    @text_atk = "最大" + Vocab::atk + "值"
    @text_def = "最大" + Vocab::def + "值"
    @text_agi = "最大" + Vocab::agi + "值"
    @text_spi = "最大" + Vocab::spi + "值"
    s_disable
    # 生成状态窗口
    @lvup_window = Window_Lvup.new(@actor)
    @lvup_window.x = 128
    @lvup_window.y = 0   
    @lvpoint_window = Window_Lvpoint.new
    # 生成帮助窗口并初始化帮助文本
    @help_window = Window_Lvup_Help.new   
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果切换画面就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @lvpoint_window.dispose
    @command_window.dispose
    @lvup_window.dispose
    @help_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    # 刷新窗口
    @command_window.update
    # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
    s_disable
    @lvup_window.update
    #=============================================================
    # 按下 B 键的情况下
    #=============================================================
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      Sound.play_cancel
      # 切换到地图画面
      $scene = Scene_Map.new
      return
    end
    #=============================================================
    # 按下 C 键的情况下
    #=============================================================
    if Input.trigger?(Input::C)      
      if @command_window.index == 5
          # 演奏确定 SE
        Sound.play_decision
        # 将角色的剩余点数带回
        $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
        # 将角色点数实际加上
        @actor.atk += $temp_atk
        @actor.def += $temp_def
        @actor.agi += $temp_agi
        @actor.spi += $temp_spi
        @actor.maxhp += $temp_hp
        @actor.maxmp += $temp_mp
        # 切换到地图画面
        $scene = Scene_Map.new
        return
      end
      if @command_window.index == 6
          # 演奏确定 SE
        Sound.play_decision
          # 将角色的剩余点数带入
        $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
          # 初始化临时量
        $temp_atk = 0
        $temp_def = 0
        $temp_agi = 0
        $temp_spi = 0
        $temp_hp = 0
        $temp_mp = 0
        @lvup_window.refresh
        @lvpoint_window.refresh
        return
      end
      if $point == 0
        # 演奏冻结 SE
        Sound.play_buzzer
        return
      end
      case @command_window.index
      when 0
        # 演奏确定 SE
        Sound.play_decision
        $temp_hp += @hp
        $temp_mp += @mp
        $temp_atk += @hp_atk
        $temp_def += @hp_def
        $temp_agi += @hp_agi
        $temp_spi += @hp_spi
        $point -= 1
        @lvup_window.refresh
        @lvpoint_window.refresh
        s_disable
        return
      when 1
        # 演奏确定 SE
        Sound.play_decision
        $temp_atk += @atk_atk
        $temp_hp += @atk_hp
        $temp_mp += @atk_mp
        $temp_def += @atk_def
        $temp_agi += @atk_agi
        $temp_spi += @atk_spi
        $point -= 1
        @lvup_window.refresh
        @lvpoint_window.refresh
        s_disable
        return
      when 2
        # 演奏确定 SE
        Sound.play_decision
        $temp_def += @def_def
        $temp_hp += @def_hp
        $temp_mp += @def_mp
        $temp_atk += @def_atk
        $temp_agi += @def_agi
        $temp_spi += @def_spi
        $point -= 1
        @lvup_window.refresh
        @lvpoint_window.refresh
        s_disable
        return
      when 3
        # 演奏确定 SE
        Sound.play_decision
        $temp_agi += @agi_agi
        $temp_hp += @agi_hp
        $temp_mp += @agi_mp
        $temp_atk += @agi_atk
        $temp_def += @agi_def
        $temp_spi += @agi_spi
        $point -= 1
        @lvup_window.refresh
        @lvpoint_window.refresh
        s_disable
        return
      when 4
        # 演奏确定 SE
        Sound.play_decision
        $temp_spi += @spi_spi
        $temp_hp += @spi_hp
        $temp_mp += @spi_mp
        $temp_atk += @spi_atk
        $temp_def += @spi_def
        $temp_agi += @spi_agi
        $point -= 1
        @lvup_window.refresh
        @lvpoint_window.refresh
        s_disable
        return
      end
    end
    #=============================================================
    # 什么都没有按下的情况
    #=============================================================
    case @command_window.index   
    when 0  # 增加体力
      temptext1 = @text_hp + @hp.to_s + "点   " + @text_atk + @hp_atk.to_s + "点   " + @text_def + @hp_def.to_s + "点"
      temptext2 = @text_mp + @mp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_spi + @hp_spi.to_s + "点"
      @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
    when 1  # 增加力量
      temptext1 = @text_hp + @atk_hp.to_s + "点   " + @text_atk + @atk_atk.to_s + "点   " + @text_def + @atk_def.to_s + "点"
      temptext2 = @text_mp + @atk_mp.to_s + "点   " + @text_agi + @atk_agi.to_s + "点   " + @text_spi + @atk_spi.to_s + "点"
      @help_window.lvup_text(@text_atk_sc , @text_2 , temptext1 , temptext2)
    when 2  # 增加灵巧
      temptext1 = @text_hp + @def_hp.to_s + "点   " + @text_atk + @def_agi.to_s + "点   " + @text_def + @def_def.to_s + "点"
      temptext2 = @text_mp + @def_mp.to_s + "点   " + @text_agi + @def_agi.to_s + "点   " + @text_spi + @def_spi.to_s + "点"
      @help_window.lvup_text(@text_def_sc , @text_2 , temptext1 , temptext2)
    when 3  # 增加速度
      temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_atk + @agi_atk.to_s + "点   " + @text_def + @agi_def.to_s + "点"
      temptext2 = @text_mp + @agi_mp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_spi + @agi_spi.to_s + "点"
      @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
    when 4  # 增加魔力
      temptext1 = @text_hp + @spi_hp.to_s + "点   " + @text_atk + @spi_atk.to_s + "点   " + @text_def + @spi_def.to_s + "点"
      temptext2 = @text_mp + @spi_mp.to_s + "点   " + @text_agi + @spi_agi.to_s + "点   " + @text_spi + @spi_spi.to_s + "点"
      @help_window.lvup_text(@text_spi_sc , @text_2 , temptext1 , temptext2)
    when 5 # 保存设定
      @help_window.lvup_text(@text_save)
    when 6 # 点数重置
      @help_window.lvup_text(@text_reset)     
    end
    #=============================================================
    # 按下R与L换人的情况
    #=============================================================      
    if Input.trigger?(Input::R)
      # 演奏光标 SE
      Sound.play_cursor
      # 移至下一位角色
      @actor_index += 1
      @actor_index %= $game_party.members.size
      # 切换到别的状态画面
      $scene = Scene_Lvup.new(@actor_index , @command_window.index)
      return
    end
    # 按下 L 键的情况下
    if Input.trigger?(Input::L)
      # 演奏光标 SE
      Sound.play_cursor
      # 移至上一位角色
      @actor_index += $game_party.members.size - 1
      @actor_index %= $game_party.members.size
      # 切换到别的状态画面
      $scene = Scene_Lvup.new(@actor_index , @command_window.index)
      return
    end
  end  
  #--------------------------------------------------------------------------
  # ● 选项明暗判断
  #--------------------------------------------------------------------------
  def s_disable
    # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
    if $point == 0
      enabled = false
    else
      enabled = true
    end
      @command_window.draw_item(0,enabled)
      @command_window.draw_item(1,enabled)
      @command_window.draw_item(2,enabled)
      @command_window.draw_item(3,enabled)
      @command_window.draw_item(4,enabled)
  end
end


虽然我还没学多少ruby语言,更没有学RM里的语言,但改正这点小毛病还是会的……
不知为何有三行都多了一些奇怪的代码……对照着原来的def语句把多余部分删掉就没问题了,不过我这样做的以后发现菜单最后一行“退出游戏”显示不出来……反正无伤大雅,就这样吧。

点评

看不懂脚本ing~ 好吧我承认我弱爆了……  发表于 2013-10-3 17:43
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
130
在线时间
0 小时
注册时间
2013-10-17
帖子
1
5
发表于 2013-10-17 21:01:15 | 只看该作者
就看看,不说话。


回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
167
在线时间
434 小时
注册时间
2009-1-1
帖子
643
6
发表于 2014-3-21 19:25:15 | 只看该作者
正好要用到升级加点,先试试这个
最近在研究XAS
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 04:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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