Project1

标题: 这个加点脚本如何关联装备属性 [打印本页]

作者: y967    时间: 2016-1-6 14:45
标题: 这个加点脚本如何关联装备属性
问题
比如设置1点力量+5点hp,只有加的点才有效果,首饰上带的力量并不加hp

如何修改....
  1. # 脚本使用设定:
  2. LEVEL_UP_POINT = 5  # 每升一级所增加的点数
  3. LEVEL_UP_VARIABLE = 900  # 储存角色点数的变量编号与角色id编号的差值
  4.                          # 默认情况 = 100,
  5.                          # 则是数据库里1号角色的加点数存于101号变量
  6.                          # 3号角色的加点数存于103号变量。
  7.                          # 你可以直接操作变量赠与角色可分配点数
  8. # 每增加一次点数,各项能力值的变化:357-410行
  9.                         
  10. # 使用方法介绍:
  11. # 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
  12. # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
  13. # 1-99级全部等于一个相同数值就行了。
  14. # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
  15. # 默认都是0号
  16. # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
  17. # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
  18. # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
  19. #==============================================================================
  20. # ■ Window_Command
  21. #------------------------------------------------------------------------------
  22. #  一般的命令选择行窗口。(追加定义)
  23. #==============================================================================
  24. class Window_Command < Window_Selectable
  25.   #--------------------------------------------------------------------------
  26.   # ● 项目有效化
  27.   #     index : 项目编号
  28.   #--------------------------------------------------------------------------
  29.   def able_item(index)
  30.     draw_item(index, normal_color)
  31.   end
  32. end
  33. #==============================================================================
  34. # ■ Game_Actor
  35. #------------------------------------------------------------------------------
  36. #  处理角色的类。(再定义)
  37. #==============================================================================
  38. class Game_Actor < Game_Battler
  39.   #--------------------------------------------------------------------------
  40.   # ● 更改 EXP
  41.   #     exp : 新的 EXP
  42.   #--------------------------------------------------------------------------
  43.   def exp=(exp)
  44.     @exp = [[exp, 99999999999999].min, 0].max
  45.     # 升级
  46.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  47.       @level += 1
  48.       # 增加4点可自由分配的点数
  49.       $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  50.       # 学会特技
  51.       for j in $data_classes[@class_id].learnings
  52.         if j.level == @level
  53.           learn_skill(j.skill_id)
  54.         end
  55.       end
  56.     end
  57.     # 降级
  58.     while @exp < @exp_list[@level]
  59.       @level -= 1
  60.     end
  61.     # 修正当前的 HP 与 SP 超过最大值
  62.     @hp = [@hp, self.maxhp].min
  63.     @sp = [@sp, self.maxsp].min
  64.   end
  65. end
  66. #==============================================================================
  67. # ■ Window_Base
  68. #------------------------------------------------------------------------------
  69. #  游戏中全部窗口的超级类(追加定义)
  70. #==============================================================================
  71. class Window_Base < Window
  72.   #--------------------------------------------------------------------------
  73.   # ● 描绘 HP
  74.   #     actor : 角色
  75.   #     x     : 描画目标 X 坐标
  76.   #     y     : 描画目标 Y 坐标
  77.   #     width : 描画目标的宽
  78.   #--------------------------------------------------------------------------
  79.   def draw_actor_hp_lvup(actor, x, y)
  80.     self.contents.font.color = system_color
  81.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
  82.     if $temp_hp == 0
  83.       self.contents.font.color = normal_color
  84.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
  85.     else
  86.       maxhp = actor.maxhp + $temp_hp
  87.       self.contents.font.color = Color.new(255,0, 255, 255)
  88.       self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
  89.       self.contents.font.color = normal_color      
  90.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  91.       if $temp_hp >=0
  92.         self.contents.font.color = Color.new(255, 0, 255, 255)
  93.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  94.       else
  95.         self.contents.font.color = Color.new(255,255,0,255)
  96.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  97.       end
  98.       self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
  99.       self.contents.font.color = normal_color
  100.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  101.     end
  102.   end
  103.   
  104.   
  105.   #--------------------------------------------------------------------------
  106.   # ● 描绘 SP
  107.   #     actor : 角色
  108.   #     x     : 描画目标 X 坐标
  109.   #     y     : 描画目标 Y 坐标
  110.   #     width : 描画目标的宽
  111.   #--------------------------------------------------------------------------
  112.   def draw_actor_sp_lvup(actor, x, y)
  113.     self.contents.font.color = system_color
  114.     self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
  115.     if $temp_sp == 0
  116.       self.contents.font.color = normal_color
  117.       self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
  118.     else
  119.       maxsp = actor.maxsp + $temp_sp
  120.       self.contents.font.color = Color.new(0,191, 255, 255)
  121.       self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
  122.       self.contents.font.color = normal_color      
  123.       self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
  124.       if $temp_sp >=0
  125.         self.contents.font.color = Color.new(0, 191, 255, 255)
  126.         self.contents.draw_text(x + 155, y, 36, 32, " +",2)
  127.       else
  128.         self.contents.font.color = Color.new(255,255,0,255)
  129.         self.contents.draw_text(x + 155, y, 36, 32, " -",2)
  130.       end
  131.       self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
  132.       self.contents.font.color = normal_color
  133.       self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
  134.     end
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 描绘能力值
  138.   #     actor : 角色
  139.   #     x     : 描画目标 X 坐标
  140.   #     y     : 描画目标 Y 坐标
  141.   #     type  : 能力值种类 (0~4)
  142.   #--------------------------------------------------------------------------
  143.   def draw_actor_lvup(actor, x, y, type)   
  144.     # 定义数字颜色
  145.     lvup = normal_color
  146.     upcolor = Color.new(0, 255, 0, 255)
  147.     self.contents.font.color = normal_color   
  148.     case type
  149.     when 0
  150.       parameter_name = $data_system.words.str
  151.       parameter_value = actor.str
  152.       parameter_value_temp = parameter_value + $temp_str
  153.       if $temp_str != 0
  154.         lvup = upcolor
  155.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  156.         if $temp_str >= 0
  157.           self.contents.font.color = lvup
  158.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  159.         else
  160.           self.contents.font.color = Color.new(255,255,0,255)
  161.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  162.         end        
  163.         self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
  164.         self.contents.font.color = normal_color
  165.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  166.       end
  167.     when 1
  168.       parameter_name = $data_system.words.dex
  169.       parameter_value = actor.dex
  170.       parameter_value_temp = parameter_value + $temp_dex
  171.       if $temp_dex != 0
  172.         lvup = upcolor
  173.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  174.         if $temp_dex >= 0
  175.           self.contents.font.color = lvup
  176.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  177.         else
  178.           self.contents.font.color = Color.new(255,255,0,255)
  179.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  180.         end        
  181.         self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
  182.         self.contents.font.color = normal_color
  183.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  184.       end
  185.     when 2
  186.       parameter_name = $data_system.words.agi
  187.       parameter_value = actor.agi
  188.       parameter_value_temp = parameter_value + $temp_agi
  189.       if $temp_agi != 0
  190.         lvup = upcolor
  191.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  192.         if $temp_agi >= 0
  193.           self.contents.font.color = lvup
  194.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  195.         else
  196.           self.contents.font.color = Color.new(255,255,0,255)
  197.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  198.         end        
  199.         self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
  200.         self.contents.font.color = normal_color
  201.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  202.       end
  203.     when 3
  204.       parameter_name = $data_system.words.int
  205.       parameter_value = actor.int
  206.       parameter_value_temp = parameter_value + $temp_int
  207.       if $temp_int != 0
  208.         lvup = upcolor
  209.         self.contents.draw_text(x + 256, y, 16, 32, "(")
  210.         if $temp_int >= 0
  211.           self.contents.font.color = lvup
  212.           self.contents.draw_text(x + 272, y, 80, 32, "+",0)
  213.         else
  214.           self.contents.font.color = Color.new(255,255,0,255)
  215.           self.contents.draw_text(x + 272, y, 80, 32, "-",0)
  216.         end        
  217.         self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
  218.         self.contents.font.color = normal_color
  219.         self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
  220.       end
  221.       

  222.     when 4
  223.       parameter_name = "剩余点数"
  224.       parameter_value = $point
  225.       if $point != 0
  226.         lvup = upcolor
  227.       end
  228.     end   
  229.     self.contents.font.color = system_color
  230.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  231.     self.contents.font.color = normal_color
  232.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  233.     if type != 4
  234.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  235.     end  
  236.     self.contents.font.color = lvup
  237.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  238.     self.contents.font.color = normal_color        
  239.   end
  240. end
  241. #==============================================================================
  242. # ■ Window_lvup
  243. #------------------------------------------------------------------------------
  244. #  显示升级状态窗口。
  245. #==============================================================================
  246. class Window_Lvup < Window_Base
  247.   #--------------------------------------------------------------------------
  248.   # ● 初始化对像
  249.   #     actor : 角色
  250.   #--------------------------------------------------------------------------
  251.   def initialize(actor)
  252.     super(0, 0, 512, 320)
  253.     self.contents = Bitmap.new(width - 32, height - 32)
  254.     @actor = actor
  255.     self.opacity = 0
  256.     refresh
  257.   end  
  258.   #--------------------------------------------------------------------------
  259.   # ● 刷新
  260.   #--------------------------------------------------------------------------
  261.   def refresh
  262.     self.contents.clear
  263.     draw_actor_graphic(@actor, 40, 112)
  264.     draw_actor_name(@actor, 4, 0)
  265.     draw_actor_class(@actor, 4 + 144, 0)
  266.     draw_actor_level(@actor, 96, 32)
  267.     draw_actor_state(@actor, 96, 64)   
  268.     draw_actor_hp_lvup(@actor, 96+128, 32)
  269.     draw_actor_sp_lvup(@actor, 96+128, 64)
  270.     draw_actor_lvup(@actor, 96, 128, 0)
  271.     draw_actor_lvup(@actor, 96, 160, 1)
  272.     draw_actor_lvup(@actor, 96, 192, 2)
  273.     draw_actor_lvup(@actor, 96, 224, 3)
  274.     draw_actor_lvup(@actor, 96, 256, 4)
  275.   end
  276. end
  277. #==============================================================================
  278. # ■ Window_Help
  279. #------------------------------------------------------------------------------
  280. #  特技及物品的说明、角色的状态显示的窗口。
  281. #==============================================================================
  282. class Window_Lvup_Help < Window_Base
  283.   #--------------------------------------------------------------------------
  284.   # ● 初始化对像
  285.   #--------------------------------------------------------------------------
  286.   def initialize
  287.     super(0, 320, 640, 160)
  288.     self.contents = Bitmap.new(width - 32, height - 32)
  289.     @test = "" #——这个东西用来检测,节约内存专用
  290.   end  
  291.   #--------------------------------------------------------------------------
  292.   # ● 设置文本
  293.   #--------------------------------------------------------------------------
  294.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  295.     if @test != text1
  296.       @test = text1
  297.     else
  298.       return
  299.     end   
  300.     self.contents.clear
  301.     self.contents.font.color = normal_color
  302.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  303.     if text2 != nil
  304.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  305.     end
  306.     self.contents.font.size -= 4
  307.     if text3 != nil
  308.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  309.     end
  310.     if text4 != nil
  311.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  312.     end
  313.     self.contents.font.size += 4
  314.   end
  315. end
  316. #==============================================================================
  317. # ■ Scene_lvup
  318. #------------------------------------------------------------------------------
  319. #  处理升级画面的类。
  320. #==============================================================================
  321. class Scene_Lvup
  322.   #--------------------------------------------------------------------------
  323.   # ● 初始化对像
  324.   #     actor_index : 角色索引
  325.   #     menu_index : 选项起始位置
  326.   #--------------------------------------------------------------------------
  327.   def initialize(actor_index = 0 , menu_index = 0)
  328.     @actor_index = actor_index
  329.     @menu_index = menu_index
  330.   end
  331.   

  332.    
  333.   #--------------------------------------------------------------------------
  334.   # ● 主处理
  335.   #--------------------------------------------------------------------------
  336.   def main
  337.     s1 = "增加体质"
  338.     s2 = "增加"+$data_system.words.str
  339.     s3 = "增加"+$data_system.words.dex
  340.     s4 = "增加"+$data_system.words.agi
  341.     s5 = "增加"+$data_system.words.int
  342.     s6 = "确认加点"
  343.     s7 = "点数重置"
  344.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  345.     @command_window.index = @menu_index
  346.     # 获取角色
  347.     @actor = $game_party.actors[@actor_index]
  348.     # 将角色的剩余点数带入
  349.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  350.     # 初始化临时量
  351.     $temp_str = 0
  352.     $temp_dex = 0
  353.     $temp_agi = 0
  354.     $temp_int = 0
  355.     $temp_hp = 0
  356.     $temp_sp = 0

  357.     #=========================================================================
  358.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  359.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  360.     #=========================================================================
  361.     # 每提升一次力量,提升多少附加能力
  362.     #=========================================================================
  363.     @str_hp = 0     # 每提升一次力量附加提升多少HP
  364.     @str_sp = 0     # 每提升一次力量附加提升多少SP
  365.     @str_dex = 0    # 每提升一次力量附加提升多少灵巧
  366.     @str_agi = 0    # 每提升一次力量附加提升多少速度
  367.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  368.     @str_str = 1   # 每提升一次力量附加提升多少力量

  369.     #=========================================================================
  370.     # 每提升一次灵巧,提升多少附加能力
  371.     #=========================================================================
  372.     @dex_hp = 0     # 每提升一次灵巧附加提升多少HP
  373.     @dex_sp = 0     # 每提升一次灵巧附加提升多少SP
  374.     @dex_str = 0    # 每提升一次灵巧附加提升多少力量
  375.     @dex_agi = 0    # 每提升一次灵巧附加提升多少速度
  376.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  377.     @dex_dex = 1   # 每提升一次灵巧附加提升多少灵巧

  378.     #=========================================================================
  379.     # 每提升一次速度,提升多少附加能力
  380.     #=========================================================================
  381.     @agi_hp = 0    # 每提升一次速度附加提升多少HP
  382.     @agi_sp = 0    # 每提升一次速度附加提升多少SP
  383.     @agi_str = 0    # 每提升一次速度附加提升多少力量
  384.     @agi_dex = 0    # 每提升一次速度附加提升多少灵巧
  385.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  386.     @agi_agi = 1   # 每提升一次速度附加提升多少速度

  387.     #=========================================================================
  388.     # 每提升一次魔力,提升多少附加能力
  389.     #=========================================================================
  390.     @int_hp =  0   # 每提升一次魔力附加提升多少HP
  391.     @int_sp = 0    # 每提升一次魔力附加提升多少SP
  392.     @int_str = 0   # 每提升一次魔力附加提升多少力量
  393.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  394.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  395.     @int_int = 1   # 每提升一次魔力附加提升多少魔力

  396.     #=========================================================================
  397.     # 每提升一次体力,提升多少附加能力
  398.     #=========================================================================
  399.     @hp = 16        # 每提升一次体力提升多少HP
  400.     @sp = 5        # 每提升一次体力提升多少SP
  401.     @hp_str = 0   # 每提升一次魔力附加提升多少力量
  402.     @hp_dex = 0   # 每提升一次魔力附加提升多少灵巧
  403.     @hp_agi = 0   # 每提升一次魔力附加提升多少速度
  404.     @hp_int = 0   # 每提升一次魔力附加提升多少魔力

  405.    
  406.     # 定义说明文字
  407.     @text_hp_sc = "体质可以增加HP和Sp!"
  408.     @text_str_sc = $data_system.words.str + "可以增加物攻和物理系技能的威力!"
  409.     @text_dex_sc = $data_system.words.dex + "可以提高命中率和回避率!"
  410.     @text_agi_sc = $data_system.words.agi + "可以提高攻击速度和逃跑成功率!"
  411.     @text_int_sc = $data_system.words.int + "可以提高魔能术的伤害系数!"
  412.     @text_save = "保存分配并返回游戏"
  413.     @text_reset= "重新分配能力点数"
  414.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  415.     @text_hp = "最大" + $data_system.words.hp + "值"
  416.     @text_sp = "最大" + $data_system.words.sp + "值"
  417.     @text_str = "最大" + $data_system.words.str + "值"
  418.     @text_dex = "最大" + $data_system.words.dex + "值"
  419.     @text_agi = "最大" + $data_system.words.agi + "值"
  420.     @text_int = "最大" + $data_system.words.int + "值"

  421.     s_disable
  422.     # 生成状态窗口
  423.     @lvup_window = Window_Lvup.new(@actor)
  424.     @lvup_window.x = 128
  425.     @lvup_window.y = 0   
  426.     # 生成帮助窗口并初始化帮助文本
  427.     @help_window = Window_Lvup_Help.new
  428.    
  429.          
  430.      #生成物品图片
  431.     @menu_com = Sprite.new
  432.     @menu_com.bitmap = RPG::Cache.picture("加点.jpg")
  433.    
  434.     # 执行过渡
  435.     Graphics.transition(20, "Graphics/Transitions/" + $data_system.battle_transition)
  436.     # 主循环
  437.     loop do
  438.       # 刷新游戏画面
  439.       Graphics.update
  440.       # 刷新输入信息
  441.       Input.update
  442.       # 刷新画面
  443.       update
  444.       # 如果切换画面就中断循环
  445.       if $scene != self
  446.         break
  447.       end
  448.     end
  449.     # 准备过渡
  450.     Graphics.freeze
  451.     # 释放窗口
  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.       $game_system.se_play($data_system.cancel_se)
  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.         $game_system.se_play($data_system.decision_se)
  482.         # 将角色的剩余点数带回
  483.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  484.         # 将角色点数实际加上
  485.         @actor.str += $temp_str
  486.         @actor.dex += $temp_dex
  487.         @actor.agi += $temp_agi
  488.         @actor.int += $temp_int
  489.         @actor.maxhp += $temp_hp
  490.         @actor.maxsp += $temp_sp
  491.   
  492.         
  493.         # 切换到地图画面
  494.         $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  495.         #$scene = Scene_Map.new
  496.         return
  497.       end
  498.       if @command_window.index == 6
  499.           # 演奏确定 SE
  500.         $game_system.se_play($data_system.cancel_se)
  501.           # 将角色的剩余点数带入
  502.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  503.           # 初始化临时量
  504.         $temp_str = 0
  505.         $temp_dex = 0
  506.         $temp_agi = 0
  507.         $temp_int = 0
  508.         $temp_hp = 0
  509.         $temp_sp = 0

  510.         @lvup_window.refresh
  511.         return
  512.       end
  513.       if $point == 0
  514.         # 演奏冻结 SE
  515.         $game_system.se_play($data_system.buzzer_se)
  516.         return
  517.       end
  518.       case @command_window.index
  519.       when 0
  520.         # 演奏确定 SE
  521.         $game_system.se_play($data_system.decision_se)
  522.         $temp_hp += @hp
  523.         $temp_sp += @sp
  524.         $temp_str += @hp_str
  525.         $temp_dex += @hp_dex
  526.         $temp_agi += @hp_agi
  527.         $temp_int += @hp_int

  528.         $point -= 1
  529.         @lvup_window.refresh
  530.         s_disable
  531.         return
  532.       when 1
  533.         # 演奏确定 SE
  534.         $game_system.se_play($data_system.decision_se)
  535.         $temp_str += @str_str
  536.         $temp_hp += @str_hp
  537.         $temp_sp += @str_sp
  538.         $temp_dex += @str_dex
  539.         $temp_agi += @str_agi
  540.         $temp_int += @str_int
  541.    
  542.         $point -= 1
  543.         @lvup_window.refresh
  544.         s_disable
  545.         return
  546.       when 2
  547.         # 演奏确定 SE
  548.         $game_system.se_play($data_system.decision_se)
  549.         $temp_dex += @dex_dex
  550.         $temp_hp += @dex_hp
  551.         $temp_sp += @dex_sp
  552.         $temp_str += @dex_str
  553.         $temp_agi += @dex_agi
  554.         $temp_int += @dex_int
  555.   
  556.         $point -= 1
  557.         @lvup_window.refresh
  558.         s_disable
  559.         return
  560.       when 3
  561.         # 演奏确定 SE
  562.         $game_system.se_play($data_system.decision_se)
  563.         $temp_agi += @agi_agi
  564.         $temp_hp += @agi_hp
  565.         $temp_sp += @agi_sp
  566.         $temp_str += @agi_str
  567.         $temp_dex += @agi_dex
  568.         $temp_int += @agi_int
  569.   
  570.         $point -= 1
  571.         @lvup_window.refresh
  572.         s_disable
  573.         return
  574.       when 4
  575.         # 演奏确定 SE
  576.         $game_system.se_play($data_system.decision_se)
  577.         $temp_int += @int_int
  578.         $temp_hp += @int_hp
  579.         $temp_sp += @int_sp
  580.         $temp_str += @int_str
  581.         $temp_dex += @int_dex
  582.         $temp_agi += @int_agi

  583.         $point -= 1
  584.         @lvup_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_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点 "
  595.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点 "
  596.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  597.     when 1  # 增加力量
  598.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  599.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  600.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  601.     when 2  # 增加灵巧
  602.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  603.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  604.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  605.     when 3  # 增加速度
  606.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  607.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  608.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  609.     when 4  # 增加魔力
  610.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  611.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  612.       @help_window.lvup_text(@text_int_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.       $game_system.se_play($data_system.cursor_se)
  624.       # 移至下一位角色
  625.       @actor_index += 1
  626.       @actor_index %= $game_party.actors.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.       $game_system.se_play($data_system.cursor_se)
  635.       # 移至上一位角色
  636.       @actor_index += $game_party.actors.size - 1
  637.       @actor_index %= $game_party.actors.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.       @command_window.disable_item(0)
  650.       @command_window.disable_item(1)
  651.       @command_window.disable_item(2)
  652.       @command_window.disable_item(3)
  653.       @command_window.disable_item(4)
  654.     else
  655.       @command_window.able_item(0)
  656.       @command_window.able_item(1)      
  657.       @command_window.able_item(2)
  658.       @command_window.able_item(3)
  659.       @command_window.able_item(4)
  660.     end
  661.   end
  662. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1