查看: 6075|回复: 3

[已经解决] 请问加点功能和等级突破上限冲突怎么办

[复制链接]
梦石
0
星屑
404
在线时间
49 小时
注册时间
2018-8-4
回帖
1
发表于 2021-1-13 19:56:07 | 显示全部楼层 |阅读模式
悬赏20星屑已解决
先使用等级上限脚本,就没办法加点,但是如果先使用加点脚本就没法使用等级上限。求大佬救救孩子吧~

最佳答案

查看完整内容

[pre lang="ruby"]# 脚本使用设定: LEVEL_UP_POINT = 8 # 每升一级所增加的点数 LEVEL_UP_VARIABLE = 300 # 储存角色点数的变量编号与角色id编号的差值 # 默认情况 = 100, # 则是数据库里1号角色的加点数存于101号变量 # 3号角色的加点数存于103号变量。 # 你可以直接操作变量赠与角色可分配点数 # 每增加一次点数,各 ...
梦石
0
星屑
17566
在线时间
4250 小时
注册时间
2013-7-18
回帖
2491
发表于 2021-1-13 19:56:08 | 显示全部楼层
  1. # 脚本使用设定:
  2. LEVEL_UP_POINT = 8  # 每升一级所增加的点数
  3. LEVEL_UP_VARIABLE = 300  # 储存角色点数的变量编号与角色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,215,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,215,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,215,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,215,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.    
  331.      @menu_com = Sprite.new
  332.     @menu_com.bitmap = RPG::Cache.picture("菜单.jpg")
  333.    
  334.    
  335.   end
  336.   

  337.    
  338.   #--------------------------------------------------------------------------
  339.   # ● 主处理
  340.   #--------------------------------------------------------------------------
  341.   def main
  342.     s1 = "增加体质"
  343.     s2 = "增加"+$data_system.words.str
  344.     s3 = "增加"+$data_system.words.dex
  345.     s4 = "增加"+$data_system.words.agi
  346.     s5 = "增加"+$data_system.words.int
  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.actors[@actor_index]
  353.     # 将角色的剩余点数带入
  354.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  355.     # 初始化临时量
  356.     $temp_str = 0
  357.     $temp_dex = 0
  358.     $temp_agi = 0
  359.     $temp_int = 0
  360.     $temp_hp = 0
  361.     $temp_sp = 0

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

  374.     #=========================================================================
  375.     # 每提升一次灵巧,提升多少附加能力
  376.     #=========================================================================
  377.     @dex_hp = 0     # 每提升一次灵巧附加提升多少HP
  378.     @dex_sp = 0     # 每提升一次灵巧附加提升多少SP
  379.     @dex_str = 0    # 每提升一次灵巧附加提升多少力量
  380.     @dex_agi = 0    # 每提升一次灵巧附加提升多少速度
  381.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  382.     @dex_dex = 2   # 每提升一次灵巧附加提升多少灵巧

  383.     #=========================================================================
  384.     # 每提升一次速度,提升多少附加能力
  385.     #=========================================================================
  386.     @agi_hp = 0    # 每提升一次速度附加提升多少HP
  387.     @agi_sp = 0    # 每提升一次速度附加提升多少SP
  388.     @agi_str = 0    # 每提升一次速度附加提升多少力量
  389.     @agi_dex = 0    # 每提升一次速度附加提升多少灵巧
  390.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  391.     @agi_agi = 2   # 每提升一次速度附加提升多少速度

  392.     #=========================================================================
  393.     # 每提升一次魔力,提升多少附加能力
  394.     #=========================================================================
  395.     @int_hp =  0   # 每提升一次魔力附加提升多少HP
  396.     @int_sp =  0    # 每提升一次魔力附加提升多少SP
  397.     @int_str = 0   # 每提升一次魔力附加提升多少力量
  398.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  399.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  400.     @int_int = 2   # 每提升一次魔力附加提升多少魔力

  401.     #=========================================================================
  402.     # 每提升一次体力,提升多少附加能力
  403.     #=========================================================================
  404.     @hp = 35        # 每提升一次体力提升多少HP
  405.     @sp = 14        # 每提升一次体力提升多少SP
  406.     @hp_str = 0   # 每提升一次魔力附加提升多少力量
  407.     @hp_dex = 0   # 每提升一次魔力附加提升多少灵巧
  408.     @hp_agi = 0   # 每提升一次魔力附加提升多少速度
  409.     @hp_int = 0   # 每提升一次魔力附加提升多少魔力

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

  426.     s_disable
  427.     # 生成状态窗口
  428.     @lvup_window = Window_Lvup.new(@actor)
  429.     @lvup_window.x = 128
  430.     @lvup_window.y = 0   
  431.     # 生成帮助窗口并初始化帮助文本
  432.     @help_window = Window_Lvup_Help.new
  433.    
  434.          
  435.   
  436.    
  437.     # 执行过渡
  438.     Graphics.transition(20, "Graphics/Transitions/" + $data_system.battle_transition)
  439.     # 主循环
  440.     loop do
  441.       # 刷新游戏画面
  442.       Graphics.update
  443.       # 刷新输入信息
  444.       Input.update
  445.       # 刷新画面
  446.       update
  447.       # 如果切换画面就中断循环
  448.       if $scene != self
  449.         break
  450.       end
  451.     end
  452.     # 准备过渡
  453.     Graphics.freeze
  454.     # 释放窗口
  455.     @command_window.dispose
  456.     @lvup_window.dispose
  457.     @help_window.dispose
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● 刷新画面
  461.   #--------------------------------------------------------------------------
  462.   def update
  463.     # 刷新窗口
  464.     @command_window.update
  465.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  466.     s_disable
  467.     @lvup_window.update
  468.     #=============================================================
  469.     # 按下 B 键的情况下
  470.     #=============================================================
  471.     if Input.trigger?(Input::B)
  472.       # 演奏取消 SE
  473.       $game_system.se_play($data_system.cancel_se)
  474.       # 切换到地图画面
  475.        $scene = Scene_Menu.new(5)
  476.       return
  477.     end
  478.     #=============================================================
  479.     # 按下 C 键的情况下
  480.     #=============================================================
  481.     if Input.repeat?(Input::C)      
  482.       if @command_window.index == 5
  483.           # 演奏确定 SE
  484.         $game_system.se_play($data_system.decision_se)
  485.         # 将角色的剩余点数带回
  486.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  487.         # 将角色点数实际加上
  488.         @actor.str += $temp_str
  489.         @actor.dex += $temp_dex
  490.         @actor.agi += $temp_agi
  491.         @actor.int += $temp_int
  492.         @actor.maxhp += $temp_hp
  493.         @actor.maxsp += $temp_sp
  494.   
  495.         
  496.         # 切换到地图画面
  497.         $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  498.         #$scene = Scene_Map.new
  499.         return
  500.       end
  501.       if @command_window.index == 6
  502.           # 演奏确定 SE
  503.         $game_system.se_play($data_system.cancel_se)
  504.           # 将角色的剩余点数带入
  505.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  506.           # 初始化临时量
  507.         $temp_str = 0
  508.         $temp_dex = 0
  509.         $temp_agi = 0
  510.         $temp_int = 0
  511.         $temp_hp = 0
  512.         $temp_sp = 0

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

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

  586.         $point -= 1
  587.         @lvup_window.refresh
  588.         s_disable
  589.         return
  590.       end
  591.     end
  592.     #=============================================================
  593.     # 什么都没有按下的情况
  594.     #=============================================================
  595.     case @command_window.index   
  596.     when 0  # 增加体力
  597.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点 "
  598.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点 "
  599.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  600.     when 1  # 增加力量
  601.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  602.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  603.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  604.     when 2  # 增加灵巧
  605.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  606.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  607.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  608.     when 3  # 增加速度
  609.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  610.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  611.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  612.     when 4  # 增加魔力
  613.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  614.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  615.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  616.     when 5 # 保存设定
  617.       @help_window.lvup_text(@text_save)
  618.     when 6 # 点数重置
  619.       @help_window.lvup_text(@text_reset)     
  620.     end
  621.     #=============================================================
  622.     # 按下R与L换人的情况
  623.     #=============================================================      
  624.     if Input.trigger?(Input::R)
  625.       # 演奏光标 SE
  626.       $game_system.se_play($data_system.cursor_se)
  627.       # 移至下一位角色
  628.       @actor_index += 1
  629.       @actor_index %= $game_party.actors.size
  630.       # 切换到别的状态画面
  631.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  632.       return
  633.     end
  634.     # 按下 L 键的情况下
  635.     if Input.trigger?(Input::L)
  636.       # 演奏光标 SE
  637.       $game_system.se_play($data_system.cursor_se)
  638.       # 移至上一位角色
  639.       @actor_index += $game_party.actors.size - 1
  640.       @actor_index %= $game_party.actors.size
  641.       # 切换到别的状态画面
  642.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  643.       return
  644.     end
  645.   end  
  646.   #--------------------------------------------------------------------------
  647.   # ● 选项明暗判断
  648.   #--------------------------------------------------------------------------
  649.   def s_disable
  650.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  651.     if $point == 0
  652.       @command_window.disable_item(0)
  653.       @command_window.disable_item(1)
  654.       @command_window.disable_item(2)
  655.       @command_window.disable_item(3)
  656.       @command_window.disable_item(4)
  657.     else
  658.       @command_window.able_item(0)
  659.       @command_window.able_item(1)      
  660.       @command_window.able_item(2)
  661.       @command_window.able_item(3)
  662.       @command_window.able_item(4)
  663.     end
  664.   end
  665. end
复制代码


---------------------------能力破限:

  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 限界突破 - KGC_LimitBreak ◆
  3. #_/    ◇ Last update : 2008/01/10 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  各種設定値の上限を変更します。
  6. #_/============================================================================
  7. #_/  なるべく [Scene_Debug] のすぐ下に導入してください。
  8. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  9. #==============================================================================
  10. # ★ カスタマイズ項目 ★
  11. #==============================================================================

  12. module KGC
  13. module LimitBreak
  14.   # ◆能力値算出方式
  15.   #   0..データベース通り。
  16.   #      (100以降は計算式として ACTOR_LV100_CALC を使用)
  17.   #
  18.   #   1..データベースを用いた2次関数。
  19.   #        a:レベル1の値  b:レベル2の値  c:レベル3の値  x:現レベル
  20.   #      として、
  21.   #        ax^2 + bx + c
  22.   #      を用いて能力値を算出。
  23.   #
  24.   #   2..データベースを用いた1次関数。
  25.   #        b:レベル2の値  c:レベル3の値  x:現レベル
  26.   #      として、
  27.   #        bx + c
  28.   #      を用いて能力値を算出。
  29.   #      (レベル2,3の値を使うのは、2次関数方式との使い分けを楽にするため)
  30.   CALC_PARAMETER_METHOD = 0

  31.   # ◆レベル 100 以降の能力値計算式
  32.   #  (CALC_PARAMETER_METHOD が 0 のときに使用)
  33.   #  【lv..現レベル  p[x]..レベル x の能力値】
  34.   #  この計算結果をレベル 99 の能力値に加算。
  35.   ACTOR_LV100_CALC = "(p[99] - p[98]) * (lv - 99)"

  36.   # ◆アクターのレベル上限
  37.   #  アクターID順に配列に格納(最初は nil)
  38.   ACTOR_LV_LIMIT = [nil]
  39.   # ◆上限未指定アクターのレベル上限
  40.   #  上限未指定(nil)のアクターはこの値を使用。
  41.   ACTOR_LV_LIMIT_DEFAULT = 9999
  42.   $actover = ACTOR_LV_LIMIT_DEFAULT + 1
  43.   # ◆アクターの経験値上限
  44.   ACTOR_EXP_LIMIT = 4200000000
  45.   # ◆アクターのHP上限
  46.   ACTOR_HP_LIMIT  = 999999999
  47.   # ◆アクターのSP上限
  48.   ACTOR_SP_LIMIT  = 999999
  49.   # ◆アクターの「腕力, 器用さ, 素早さ, 魔力」上限
  50.   ACTOR_ETC_LIMIT = 99999

  51.   # ◆敵のHP上限
  52.   ENEMY_HP_LIMIT  = 4200000000
  53.   # ◆敵のSP上限
  54.   ENEMY_SP_LIMIT  = 999999
  55.   # ◆敵の「腕力, 器用さ, 素早さ, 魔力」上限
  56.   ENEMY_ETC_LIMIT = 99999

  57.   # ◆アクター能力値修正値(百分率)
  58.   #  アクターの能力値がデータベースの設定値の○%になる。
  59.   #  (上限値が高い場合に使用。データベースの値を使う場合は 100)
  60.   ACTOR_MAXHP_REVISE = 100  # MAXHP
  61.   ACTOR_MAXSP_REVISE = 100  # MAXSP
  62.   ACTOR_STR_REVISE   = 100  # 腕力
  63.   ACTOR_DEX_REVISE   = 100  # 器用さ
  64.   ACTOR_AGI_REVISE   = 100  # 素早さ
  65.   ACTOR_INT_REVISE   = 100  # 魔力

  66.   # ◆敵能力値修正値(百分率)
  67.   #  敵の能力値がデータベースの設定値の○%になる。
  68.   ENEMY_MAXHP_REVISE = 100  # MAXHP
  69.   ENEMY_MAXSP_REVISE = 100  # MAXSP
  70.   ENEMY_STR_REVISE   = 100  # 腕力
  71.   ENEMY_DEX_REVISE   = 100  # 器用さ
  72.   ENEMY_AGI_REVISE   = 100  # 素早さ
  73.   ENEMY_INT_REVISE   = 100  # 魔力
  74.   ENEMY_ATK_REVISE   = 100  # 攻撃力
  75.   ENEMY_PDEF_REVISE  = 100  # 物理防御
  76.   ENEMY_MDEF_REVISE  = 100  # 魔法防御

  77.   # ◆所持金上限
  78.   GOLD_LIMIT = 999999999

  79.   # ◆アイテム所持数上限
  80.   ITEM_LIMIT = [99999]  # ← これは消さないこと!
  81.   # この下に、アイテム所持数の上限を
  82.   #   ITEM_LIMIT[アイテムID] = 所持数上限
  83.   # という書式で設定。
  84.   #  <例> アイテム 1 は 99 個所持可能
  85.   #  ITEM_LIMIT[1] = 99

  86.   # ◆武器所持数上限
  87.   #  指定方法はアイテムと同じ。
  88.   WEAPON_LIMIT = [9999]  # ← これは消さないこと!
  89.   # ◆防具所持数上限
  90.   #  指定方法はアイテムと同じ。
  91.   ARMOR_LIMIT = [9999]  # ← これは消さないこと!

  92.   # ◆アイテム所持数上限 (デフォルト)
  93.   #  上限を指定しなかったアイテム、武器、防具はこの値を上限として使用。
  94.   ITEM_LIMIT_DEFAULT = 99999

  95.   module_function
  96.   #--------------------------------------------------------------------------
  97.   # ○ 敵能力値直接指定
  98.   #     ここで、敵の最大HPなどを直接指定することができます。
  99.   #     データベースに入りきらない数値を指定する場合に使用してください。
  100.   #--------------------------------------------------------------------------
  101.   def set_enemy_status
  102.     #  <例> ID:10 の敵のHPを 2000000 にする場合
  103.     # $data_enemies[10].maxhp = 2000000
  104.     #  <例> ID:16 の敵の攻撃力を 5000 にする場合
  105.     # $data_enemies[16].atk = 5000
  106.   end
  107. end
  108. end

  109. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  110. $imported = {} if $imported == nil
  111. $imported["LimitBreak"] = true

  112. if $game_special_elements == nil
  113.   $game_special_elements = {}
  114.   $data_system = load_data("Data/System.rxdata")
  115. end

  116. module KGC::LimitBreak
  117.   module_function
  118.   #--------------------------------------------------------------------------
  119.   # ● 敵の能力補正を適用
  120.   #--------------------------------------------------------------------------
  121.   def revise_enemy_parameters
  122.     (1...$data_enemies.size).each { |i|
  123.       enemy = $data_enemies[i]
  124.       enemy.maxhp = enemy.maxhp * ENEMY_MAXHP_REVISE / 100
  125.       enemy.maxsp = enemy.maxsp * ENEMY_MAXSP_REVISE / 100
  126.       enemy.str = enemy.str * ENEMY_STR_REVISE / 100
  127.       enemy.dex = enemy.dex * ENEMY_DEX_REVISE / 100
  128.       enemy.agi = enemy.agi * ENEMY_AGI_REVISE / 100
  129.       enemy.int = enemy.int * ENEMY_INT_REVISE / 100
  130.       enemy.atk = enemy.atk * ENEMY_ATK_REVISE / 100
  131.       enemy.pdef = enemy.pdef * ENEMY_PDEF_REVISE / 100
  132.       enemy.mdef = enemy.mdef * ENEMY_MDEF_REVISE / 100
  133.     }
  134.   end
  135. end

  136. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  137. #==============================================================================
  138. # ■ RPG::Item
  139. #==============================================================================

  140. class RPG::Item
  141.   #--------------------------------------------------------------------------
  142.   # ● 所持数上限
  143.   #--------------------------------------------------------------------------
  144.   def number_limit
  145.     if KGC::LimitBreak::ITEM_LIMIT[self.id] != nil
  146.       return KGC::LimitBreak::ITEM_LIMIT[self.id]
  147.     else
  148.       return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
  149.     end
  150.   end
  151. end

  152. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  153. #==============================================================================
  154. # ■ RPG::Weapon
  155. #==============================================================================

  156. class RPG::Weapon
  157.   #--------------------------------------------------------------------------
  158.   # ● 所持数上限
  159.   #--------------------------------------------------------------------------
  160.   def number_limit
  161.     if KGC::LimitBreak::WEAPON_LIMIT[self.id] != nil
  162.       return KGC::LimitBreak::WEAPON_LIMIT[self.id]
  163.     else
  164.       return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
  165.     end
  166.   end
  167. end

  168. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  169. #==============================================================================
  170. # ■ RPG::Armor
  171. #==============================================================================

  172. class RPG::Armor
  173.   #--------------------------------------------------------------------------
  174.   # ● 所持数上限
  175.   #--------------------------------------------------------------------------
  176.   def number_limit
  177.     if KGC::LimitBreak::ARMOR_LIMIT[self.id] != nil
  178.       return KGC::LimitBreak::ARMOR_LIMIT[self.id]
  179.     else
  180.       return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
  181.     end
  182.   end
  183. end

  184. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  185. #==============================================================================
  186. # ■ Game_Battler (分割定義 1)
  187. #==============================================================================

  188. class Game_Battler
  189.   #--------------------------------------------------------------------------
  190.   # ● MaxHP の取得
  191.   #--------------------------------------------------------------------------
  192.   def maxhp
  193.     n = [base_maxhp + @maxhp_plus, 1].max
  194.     @states.each { |i| n *= $data_states[i].maxhp_rate / 100.0 }
  195.     n = [[Integer(n), 1].max, maxhp_limit].min
  196.     return n
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● MaxSP の取得
  200.   #--------------------------------------------------------------------------
  201.   def maxsp
  202.     n = [base_maxsp + @maxsp_plus, 0].max
  203.     @states.each { |i| n *= $data_states[i].maxsp_rate / 100.0 }
  204.     n = [[Integer(n), 0].max, maxsp_limit].min
  205.     return n
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ● 腕力の取得
  209.   #--------------------------------------------------------------------------
  210.   def str
  211.     n = [base_str + @str_plus, 1].max
  212.     @states.each { |i| n *= $data_states[i].str_rate / 100.0 }
  213.     n = [[Integer(n), 1].max, parameter_limit].min
  214.     return n
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● 器用さの取得
  218.   #--------------------------------------------------------------------------
  219.   def dex
  220.     n = [base_dex + @dex_plus, 1].max
  221.     @states.each { |i| n *= $data_states[i].dex_rate / 100.0 }
  222.     n = [[Integer(n), 1].max, parameter_limit].min
  223.     return n
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ● 素早さの取得
  227.   #--------------------------------------------------------------------------
  228.   def agi
  229.     n = [base_agi + @agi_plus, 1].max
  230.     @states.each { |i| n *= $data_states[i].agi_rate / 100.0 }
  231.     n = [[Integer(n), 1].max, parameter_limit].min
  232.     return n
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # ● 魔力の取得
  236.   #--------------------------------------------------------------------------
  237.   def int
  238.     n = [base_int + @int_plus, 1].max
  239.     @states.each { |i| n *= $data_states[i].int_rate / 100.0 }
  240.     n = [[Integer(n), 1].max, parameter_limit].min
  241.     return n
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ● MaxHP の設定
  245.   #     maxhp : 新しい MaxHP
  246.   #--------------------------------------------------------------------------
  247.   def maxhp=(maxhp)
  248.     @maxhp_plus += maxhp - self.maxhp
  249.     @maxhp_plus = [[@maxhp_plus, -maxhp_limit].max, maxhp_limit].min
  250.     @hp = [@hp, self.maxhp].min
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● MaxSP の設定
  254.   #     maxsp : 新しい MaxSP
  255.   #--------------------------------------------------------------------------
  256.   def maxsp=(maxsp)
  257.     @maxsp_plus += maxsp - self.maxsp
  258.     @maxsp_plus = [[@maxsp_plus, -maxsp_limit].max, maxsp_limit].min
  259.     @sp = [@sp, self.maxsp].min
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ● 腕力の設定
  263.   #     str : 新しい腕力
  264.   #--------------------------------------------------------------------------
  265.   def str=(str)
  266.     @str_plus += str - self.str
  267.     @str_plus = [[@str_plus, -parameter_limit].max, parameter_limit].min
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● 器用さの設定
  271.   #     dex : 新しい器用さ
  272.   #--------------------------------------------------------------------------
  273.   def dex=(dex)
  274.     @dex_plus += dex - self.dex
  275.     @dex_plus = [[@dex_plus, -parameter_limit].max, parameter_limit].min
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ● 素早さの設定
  279.   #     agi : 新しい素早さ
  280.   #--------------------------------------------------------------------------
  281.   def agi=(agi)
  282.     @agi_plus += agi - self.agi
  283.     @agi_plus = [[@agi_plus, -parameter_limit].max, parameter_limit].min
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ● 魔力の設定
  287.   #     int : 新しい魔力
  288.   #--------------------------------------------------------------------------
  289.   def int=(int)
  290.     @int_plus += int - self.int
  291.     @int_plus = [[@int_plus, -parameter_limit].max, parameter_limit].min
  292.   end
  293. end

  294. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  295. #==============================================================================
  296. # ■ Game_Actor
  297. #==============================================================================

  298. class Game_Actor < Game_Battler
  299.   #--------------------------------------------------------------------------
  300.   # ● EXP 計算
  301.   #--------------------------------------------------------------------------
  302.   def make_exp_list
  303.     actor = $data_actors[@actor_id]
  304.     @exp_list[1] = 0
  305.     pow_i = 2.4 + actor.exp_inflation / 100.0
  306.     (2..(self.final_level + 1)).each { |i|
  307.       if i > self.final_level
  308.         @exp_list[i] = 0
  309.       else
  310.         n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
  311.         @exp_list[i] = @exp_list[i-1] + Integer(n)
  312.       end
  313.     }
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # ● EXP の変更
  317.   #     exp : 新しい EXP
  318.   #--------------------------------------------------------------------------
  319.   def exp=(exp)
  320.     if $imported["ExpGoldIncrease"]
  321.       rate = calc_exp_increase_rate(KGC::EXPGLD_INC_PERMIT_DOUBLE)
  322.       exp = @exp + (exp - @exp) * rate / 100
  323.     end
  324.     @exp = [[exp, KGC::LimitBreak::ACTOR_EXP_LIMIT].min, 0].max
  325.     # レベルアップ
  326.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  327.       @level += 1
  328.       # スキル習得
  329.       $data_classes[@class_id].learnings.each { |j|
  330.         if j.level == @level
  331.           learn_skill(j.skill_id)
  332.         end
  333.       }
  334.     end
  335.     # レベルダウン
  336.     while @exp < @exp_list[@level]
  337.       @level -= 1
  338.     end
  339.     # 現在の HP と SP が最大値を超えていたら修正
  340.     @hp = [@hp, self.maxhp].min
  341.     @sp = [@sp, self.maxsp].min
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # ○ パラメータの取得
  345.   #--------------------------------------------------------------------------
  346.   if KGC::LimitBreak::CALC_PARAMETER_METHOD == 0
  347.     def parameter(type)
  348.       if @level >= 100
  349.         calc_text = KGC::LimitBreak::ACTOR_LV100_CALC.dup
  350.         calc_text.gsub!(/lv/i) { "@level" }
  351.         calc_text.gsub!(/p\[(\d+)\]/i) {
  352.           "$data_actors[@actor_id].parameters[type, #{$1.to_i}]"
  353.         }
  354.         return $data_actors[@actor_id].parameters[type, 99] + eval(calc_text)
  355.       else
  356.         return $data_actors[@actor_id].parameters[type, @level]
  357.       end
  358.     end
  359.   elsif KGC::LimitBreak::CALC_PARAMETER_METHOD == 1
  360.     def parameter(type)
  361.       a = $data_actors[@actor_id].parameters[type, 1]
  362.       b = $data_actors[@actor_id].parameters[type, 2]
  363.       c = $data_actors[@actor_id].parameters[type, 3]
  364.       return a * @level * @level + b * @level + c
  365.     end
  366.   elsif KGC::LimitBreak::CALC_PARAMETER_METHOD == 2
  367.     def parameter(type)
  368.       b = $data_actors[@actor_id].parameters[type, 2]
  369.       c = $data_actors[@actor_id].parameters[type, 3]
  370.       return b * @level + c
  371.     end
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● 基本 MaxHP の取得
  375.   #--------------------------------------------------------------------------
  376.   def base_maxhp
  377.     n = self.parameter(0)
  378.     return n * KGC::LimitBreak::ACTOR_MAXHP_REVISE / 100
  379.   end
  380.   #--------------------------------------------------------------------------
  381.   # ● MaxHP の取得
  382.   #--------------------------------------------------------------------------
  383.   def maxhp
  384.     n = [base_maxhp + @maxhp_plus, 1].max
  385.     @states.each { |i| n *= $data_states[i].maxhp_rate / 100.0 }
  386.     n = [[Integer(n), 1].max, maxhp_limit].min
  387.     return n
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ● 基本 MaxSP の取得
  391.   #--------------------------------------------------------------------------
  392.   def base_maxsp
  393.     n = self.parameter(1)
  394.     return n * KGC::LimitBreak::ACTOR_MAXSP_REVISE / 100
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ● MaxSP の取得
  398.   #--------------------------------------------------------------------------
  399.   def maxsp
  400.     n = [base_maxsp + @maxsp_plus, 0].max
  401.     @states.each { |i| n *= $data_states[i].maxsp_rate / 100.0 }
  402.     n = [[Integer(n), 0].max, maxsp_limit].min
  403.     return n
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● 基本腕力の取得
  407.   #--------------------------------------------------------------------------
  408.   def base_str
  409.     n = self.parameter(2)
  410.     if $imported["EquipExtension"]
  411.       n += equipment_parameter(2)
  412.     else
  413.       equip_item_list.each { |item| n += (item != nil ? item.str_plus : 0) }
  414.     end
  415.     return [[n * KGC::LimitBreak::ACTOR_STR_REVISE / 100, 1].max, parameter_limit].min
  416.   end
  417.   #--------------------------------------------------------------------------
  418.   # ● 基本器用さの取得
  419.   #--------------------------------------------------------------------------
  420.   def base_dex
  421.     n = self.parameter(3)
  422.     if $imported["EquipExtension"]
  423.       n += equipment_parameter(3)
  424.     else
  425.       equip_item_list.each { |item| n += (item != nil ? item.dex_plus : 0) }
  426.     end
  427.     return [[n * KGC::LimitBreak::ACTOR_DEX_REVISE / 100, 1].max, parameter_limit].min
  428.   end
  429.   #--------------------------------------------------------------------------
  430.   # ● 基本素早さの取得
  431.   #--------------------------------------------------------------------------
  432.   def base_agi
  433.     n = self.parameter(4)
  434.     if $imported["EquipExtension"]
  435.       n += equipment_parameter(4)
  436.     else
  437.       equip_item_list.each { |item| n += (item != nil ? item.agi_plus : 0) }
  438.     end
  439.     return [[n * KGC::LimitBreak::ACTOR_AGI_REVISE / 100, 1].max, parameter_limit].min
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # ● 基本魔力の取得
  443.   #--------------------------------------------------------------------------
  444.   def base_int
  445.     n = self.parameter(5)
  446.     if $imported["EquipExtension"]
  447.       n += equipment_parameter(5)
  448.     else
  449.       equip_item_list.each { |item| n += (item != nil ? item.int_plus : 0) }
  450.     end
  451.     return [[n * KGC::LimitBreak::ACTOR_INT_REVISE / 100, 1].max, parameter_limit].min
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ● レベルの変更
  455.   #     level : 新しいレベル
  456.   #--------------------------------------------------------------------------
  457.   def level=(level)
  458.     # 上下限チェック
  459.     level = [[level, self.final_level].min, 1].max
  460.     # EXP を変更
  461.     self.exp = @exp_list[level]
  462.   end
  463.   #--------------------------------------------------------------------------
  464.   # ● 最終レベルの取得
  465.   #--------------------------------------------------------------------------
  466.   def final_level
  467.     return (KGC::LimitBreak::ACTOR_LV_LIMIT[@actor_id] != nil ?
  468.       KGC::LimitBreak::ACTOR_LV_LIMIT[@actor_id] : KGC::LimitBreak::ACTOR_LV_LIMIT_DEFAULT)
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # ○ MaxHP 限界値の取得
  472.   #--------------------------------------------------------------------------
  473.   def maxhp_limit
  474.     return KGC::LimitBreak::ACTOR_HP_LIMIT
  475.   end
  476.   #--------------------------------------------------------------------------
  477.   # ○ MaxSP 限界値の取得
  478.   #--------------------------------------------------------------------------
  479.   def maxsp_limit
  480.     return KGC::LimitBreak::ACTOR_SP_LIMIT
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ○ パラメータ限界値の取得
  484.   #--------------------------------------------------------------------------
  485.   def parameter_limit
  486.     return KGC::LimitBreak::ACTOR_ETC_LIMIT
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ○ 装備武器リストの取得
  490.   #--------------------------------------------------------------------------
  491.   def equip_weapon_list
  492.     result = [$data_weapons[@weapon_id]]
  493.     return result.compact
  494.   end
  495.   #--------------------------------------------------------------------------
  496.   # ○ 装備防具リストの取得
  497.   #--------------------------------------------------------------------------
  498.   def equip_armor_list
  499.     result = []
  500.     (1..4).each { |i| result << $data_armors[eval("@armor#{i}_id")] }
  501.     return result.compact
  502.   end
  503.   #--------------------------------------------------------------------------
  504.   # ○ 装備品リストの取得
  505.   #--------------------------------------------------------------------------
  506.   def equip_item_list
  507.     return equip_weapon_list + equip_armor_list
  508.   end
  509. end

  510. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  511. #==============================================================================
  512. # ■ Game_Enemy
  513. #==============================================================================

  514. class Game_Enemy < Game_Battler
  515.   #--------------------------------------------------------------------------
  516.   # ○ MaxHP 限界値の取得
  517.   #--------------------------------------------------------------------------
  518.   def maxhp_limit
  519.     return KGC::LimitBreak::ENEMY_HP_LIMIT
  520.   end
  521.   #--------------------------------------------------------------------------
  522.   # ○ MaxSP 限界値の取得
  523.   #--------------------------------------------------------------------------
  524.   def maxsp_limit
  525.     return KGC::LimitBreak::ENEMY_SP_LIMIT
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # ○ パラメータ限界値の取得
  529.   #--------------------------------------------------------------------------
  530.   def parameter_limit
  531.     return KGC::LimitBreak::ENEMY_ETC_LIMIT
  532.   end
  533. end

  534. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  535. #==============================================================================
  536. # ■ Game_Party
  537. #==============================================================================

  538. class Game_Party
  539.   #--------------------------------------------------------------------------
  540.   # ● ゴールドの増加 (減少)
  541.   #     n : 金額
  542.   #--------------------------------------------------------------------------
  543.   def gain_gold(n)
  544.     # 所持金の限界値変更
  545.     @gold = [[@gold + n, 0].max, KGC::LimitBreak::GOLD_LIMIT].min
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ● アイテムの増加 (減少)
  549.   #     item_id : アイテム ID
  550.   #     n       : 個数
  551.   #--------------------------------------------------------------------------
  552.   def gain_item(item_id, n)
  553.     # ハッシュの個数データを更新
  554.     if item_id > 0
  555.       limit = $data_items[item_id].number_limit
  556.       @items[item_id] = [[item_number(item_id) + n, 0].max, limit].min
  557.     end
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # ● 武器の増加 (減少)
  561.   #     weapon_id : 武器 ID
  562.   #     n         : 個数
  563.   #--------------------------------------------------------------------------
  564.   def gain_weapon(weapon_id, n)
  565.     # ハッシュの個数データを更新
  566.     if weapon_id > 0
  567.       limit = $data_weapons[weapon_id].number_limit
  568.       @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, limit].min
  569.     end
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # ● 防具の増加 (減少)
  573.   #     armor_id : 防具 ID
  574.   #     n        : 個数
  575.   #--------------------------------------------------------------------------
  576.   def gain_armor(armor_id, n)
  577.     # ハッシュの個数データを更新
  578.     if armor_id > 0
  579.       limit = $data_armors[armor_id].number_limit
  580.       @armors[armor_id] = [[armor_number(armor_id) + n, 0].max, limit].min
  581.     end
  582.   end
  583. end

  584. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  585. #==============================================================================
  586. # ■ Window_ShopBuy
  587. #==============================================================================

  588. class Window_ShopBuy < Window_Selectable
  589.   #--------------------------------------------------------------------------
  590.   # ● 項目の描画
  591.   #     index : 項目番号
  592.   #--------------------------------------------------------------------------
  593.   def draw_item(index)
  594.     item = @data[index]
  595.     # アイテムの所持数を取得
  596.     case item
  597.     when RPG::Item
  598.       number = $game_party.item_number(item.id)
  599.     when RPG::Weapon
  600.       number = $game_party.weapon_number(item.id)
  601.     when RPG::Armor
  602.       number = $game_party.armor_number(item.id)
  603.     end
  604.     # 価格が所持金以下、かつ所持数が上限でなければ通常文字色に、
  605.     # そうでなければ無効文字色に設定
  606.     if item.price <= $game_party.gold && number < item.number_limit
  607.       self.contents.font.color = normal_color
  608.     else
  609.       self.contents.font.color = disabled_color
  610.     end
  611.     x = 4
  612.     y = index * 32
  613.     rect = Rect.new(x, y, self.width - 32, 32)
  614.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  615.     bitmap = RPG::Cache.icon(item.icon_name)
  616.     opacity = self.contents.font.color == normal_color ? 255 : 128
  617.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  618.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  619.     self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
  620.   end
  621. end

  622. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  623. #==============================================================================
  624. # ■ Scene_Title
  625. #==============================================================================

  626. class Scene_Title
  627.   #--------------------------------------------------------------------------
  628.   # ● コマンド : ニューゲーム
  629.   #--------------------------------------------------------------------------
  630.   alias command_new_game_KGC_LimitBreak command_new_game
  631.   def command_new_game
  632.     command_new_game_KGC_LimitBreak

  633.     KGC::LimitBreak.revise_enemy_parameters
  634.     KGC::LimitBreak.set_enemy_status
  635.   end
  636.   #--------------------------------------------------------------------------
  637.   # ● コマンド : コンティニュー
  638.   #--------------------------------------------------------------------------
  639.   alias command_continue_KGC_LimitBreak command_continue
  640.   def command_continue
  641.     command_continue_KGC_LimitBreak

  642.     KGC::LimitBreak.revise_enemy_parameters
  643.     KGC::LimitBreak.set_enemy_status
  644.   end
  645.   #--------------------------------------------------------------------------
  646.   # ● 戦闘テスト
  647.   #--------------------------------------------------------------------------
  648.   alias battle_test_KGC_LimitBreak battle_test
  649.   def battle_test
  650.     battle_test_KGC_LimitBreak

  651.     KGC::LimitBreak.revise_enemy_parameters
  652.     KGC::LimitBreak.set_enemy_status
  653.   end
  654. end

  655. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  656. #==============================================================================
  657. # ■ Scene_Shop
  658. #==============================================================================

  659. class Scene_Shop
  660.   #--------------------------------------------------------------------------
  661.   # ● フレーム更新 (購入ウィンドウがアクティブの場合)
  662.   #--------------------------------------------------------------------------
  663.   def update_buy
  664.     # ステータスウィンドウのアイテムを設定
  665.     @status_window.item = @buy_window.item
  666.     # B ボタンが押された場合
  667.     if Input.trigger?(Input::B)
  668.       # キャンセル SE を演奏
  669.       $game_system.se_play($data_system.cancel_se)
  670.       # ウィンドウの状態を初期モードへ
  671.       @command_window.active = true
  672.       @dummy_window.visible = true
  673.       @buy_window.active = false
  674.       @buy_window.visible = false
  675.       @status_window.visible = false
  676.       @status_window.item = nil
  677.       # ヘルプテキストを消去
  678.       @help_window.set_text("")
  679.       return
  680.     end
  681.     # C ボタンが押された場合
  682.     if Input.trigger?(Input::C)
  683.       # アイテムを取得
  684.       @item = @buy_window.item
  685.       # アイテムが無効の場合、または価格が所持金より上の場合
  686.       if @item == nil or @item.price > $game_party.gold
  687.         # ブザー SE を演奏
  688.         $game_system.se_play($data_system.buzzer_se)
  689.         return
  690.       end
  691.       # アイテムの所持数を取得
  692.       case @item
  693.       when RPG::Item
  694.         number = $game_party.item_number(@item.id)
  695.       when RPG::Weapon
  696.         number = $game_party.weapon_number(@item.id)
  697.       when RPG::Armor
  698.         number = $game_party.armor_number(@item.id)
  699.       end
  700.       # すでに上限まで個所持している場合
  701.       limit = @item.number_limit
  702.       if number >= limit
  703.         # ブザー SE を演奏
  704.         $game_system.se_play($data_system.buzzer_se)
  705.         return
  706.       end
  707.       # 決定 SE を演奏
  708.       $game_system.se_play($data_system.decision_se)
  709.       # 最大購入可能個数を計算
  710.       max = (@item.price == 0 ? limit : $game_party.gold / @item.price)
  711.       max = [max, limit - number].min
  712.       # ウィンドウの状態を個数入力モードへ
  713.       @buy_window.active = false
  714.       @buy_window.visible = false
  715.       @number_window.set(@item, max, @item.price)
  716.       @number_window.active = true
  717.       @number_window.visible = true
  718.     end
  719.   end
  720. end
复制代码



---------以上是我用的加点和能力破限。


评分

参与人数 1星屑 +30 收起 理由
RyanBern + 30 认可答案

查看全部评分

退隐....
回复

使用道具 举报

梦石
0
星屑
39336
在线时间
11161 小时
注册时间
2009-3-15
回帖
4768
发表于 2021-1-15 14:05:50 | 显示全部楼层
  1. #--------------------------------------------------------------------------
  2.   # ● EXP の変更
  3.   #     exp : 新しい EXP
  4.   #--------------------------------------------------------------------------
  5. class Game_Actor < Game_Battler
  6.   def exp=(exp)
  7.     if $imported["ExpGoldIncrease"]
  8.       rate = calc_exp_increase_rate(KGC::EXPGLD_INC_PERMIT_DOUBLE)
  9.       exp = @exp + (exp - @exp) * rate / 100
  10.     end
  11.     @exp = [[exp, KGC::LimitBreak::ACTOR_EXP_LIMIT].min, 0].max
  12.     # レベルアップ
  13.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  14.       @level += 1
  15. $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  16.       # スキル習得
  17.       $data_classes[@class_id].learnings.each { |j|
  18.         if j.level == @level
  19.           learn_skill(j.skill_id)
  20.         end
  21.       }
  22.     end
  23.     # レベルダウン
  24.     while @exp < @exp_list[@level]
  25.       @level -= 1
  26.     end
  27.     # 現在の HP と SP が最大値を超えていたら修正
  28.     @hp = [@hp, self.maxhp].min
  29.     @sp = [@sp, self.maxsp].min
  30.   end
  31. end
复制代码


插入?
回复

使用道具 举报

梦石
0
星屑
1157
在线时间
192 小时
注册时间
2019-3-20
回帖
21
发表于 2021-1-21 22:16:54 | 显示全部楼层
本帖最后由 YY2019 于 2021-1-27 19:17 编辑

mpdgghhyytrrllll
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部