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

Project1

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

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
379
在线时间
48 小时
注册时间
2018-8-4
帖子
2
跳转到指定楼层
1
发表于 2021-1-13 19:56:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
20星屑
先使用等级上限脚本,就没办法加点,但是如果先使用加点脚本就没法使用等级上限。求大佬救救孩子吧~

最佳答案

查看完整内容

# 脚本使用设定: LEVEL_UP_POINT = 8 # 每升一级所增加的点数 LEVEL_UP_VARIABLE = 300 # 储存角色点数的变量编号与角色id编号的差值 # 默认情况 = 100, # 则是数据库里1号角色的加点数存于101号变量 # 3号角色的加点数存于103号变量。 # 你可以直接操作变量赠与角色可分配点数 # 每增加一次点数,各项能力值的变化:3 ...

Lv4.逐梦者

梦石
0
星屑
13069
在线时间
3784 小时
注册时间
2013-7-18
帖子
2278
2
发表于 2021-1-13 19:56:08 | 只看该作者
RUBY 代码复制
  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.  
  223.     when 4
  224.       parameter_name = "剩余点数"
  225.       parameter_value = $point
  226.       if $point != 0
  227.         lvup = upcolor
  228.       end
  229.     end   
  230.     self.contents.font.color = system_color
  231.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  232.     self.contents.font.color = normal_color
  233.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)   
  234.     if type != 4
  235.       self.contents.draw_text(x + 150, y, 36, 32, "→")
  236.     end  
  237.     self.contents.font.color = lvup
  238.     self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
  239.     self.contents.font.color = normal_color        
  240.   end
  241. end
  242. #==============================================================================
  243. # ■ Window_lvup
  244. #------------------------------------------------------------------------------
  245. #  显示升级状态窗口。
  246. #==============================================================================
  247. class Window_Lvup < Window_Base
  248.   #--------------------------------------------------------------------------
  249.   # ● 初始化对像
  250.   #     actor : 角色
  251.   #--------------------------------------------------------------------------
  252.   def initialize(actor)
  253.     super(0, 0, 512, 320)
  254.     self.contents = Bitmap.new(width - 32, height - 32)
  255.     @actor = actor
  256.     self.opacity = 0
  257.     refresh
  258.   end  
  259.   #--------------------------------------------------------------------------
  260.   # ● 刷新
  261.   #--------------------------------------------------------------------------
  262.   def refresh
  263.     self.contents.clear
  264.     draw_actor_graphic(@actor, 40, 112)
  265.     draw_actor_name(@actor, 4, 0)
  266.     draw_actor_class(@actor, 4 + 144, 0)
  267.     draw_actor_level(@actor, 96, 32)
  268.     draw_actor_state(@actor, 96, 64)   
  269.     draw_actor_hp_lvup(@actor, 96+128, 32)
  270.     draw_actor_sp_lvup(@actor, 96+128, 64)
  271.     draw_actor_lvup(@actor, 96, 128, 0)
  272.     draw_actor_lvup(@actor, 96, 160, 1)
  273.     draw_actor_lvup(@actor, 96, 192, 2)
  274.     draw_actor_lvup(@actor, 96, 224, 3)
  275.     draw_actor_lvup(@actor, 96, 256, 4)
  276.   end
  277. end
  278. #==============================================================================
  279. # ■ Window_Help
  280. #------------------------------------------------------------------------------
  281. #  特技及物品的说明、角色的状态显示的窗口。
  282. #==============================================================================
  283. class Window_Lvup_Help < Window_Base
  284.   #--------------------------------------------------------------------------
  285.   # ● 初始化对像
  286.   #--------------------------------------------------------------------------
  287.   def initialize
  288.     super(0, 320, 640, 160)
  289.     self.contents = Bitmap.new(width - 32, height - 32)
  290.     @test = "" #——这个东西用来检测,节约内存专用
  291.   end  
  292.   #--------------------------------------------------------------------------
  293.   # ● 设置文本
  294.   #--------------------------------------------------------------------------
  295.   def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
  296.     if @test != text1
  297.       @test = text1
  298.     else
  299.       return
  300.     end   
  301.     self.contents.clear
  302.     self.contents.font.color = normal_color
  303.     self.contents.draw_text(4, 0, self.width - 40, 32, text1)
  304.     if text2 != nil
  305.       self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
  306.     end
  307.     self.contents.font.size -= 4
  308.     if text3 != nil
  309.       self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
  310.     end
  311.     if text4 != nil
  312.       self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
  313.     end
  314.     self.contents.font.size += 4
  315.   end
  316. end
  317. #==============================================================================
  318. # ■ Scene_lvup
  319. #------------------------------------------------------------------------------
  320. #  处理升级画面的类。
  321. #==============================================================================
  322. class Scene_Lvup
  323.   #--------------------------------------------------------------------------
  324.   # ● 初始化对像
  325.   #     actor_index : 角色索引
  326.   #     menu_index : 选项起始位置
  327.   #--------------------------------------------------------------------------
  328.   def initialize(actor_index = 0 , menu_index = 0)
  329.     @actor_index = actor_index
  330.     @menu_index = menu_index
  331.  
  332.      @menu_com = Sprite.new
  333.     @menu_com.bitmap = RPG::Cache.picture("菜单.jpg")
  334.  
  335.  
  336.   end
  337.  
  338.  
  339.  
  340.   #--------------------------------------------------------------------------
  341.   # ● 主处理
  342.   #--------------------------------------------------------------------------
  343.   def main
  344.     s1 = "增加体质"
  345.     s2 = "增加"+$data_system.words.str
  346.     s3 = "增加"+$data_system.words.dex
  347.     s4 = "增加"+$data_system.words.agi
  348.     s5 = "增加"+$data_system.words.int
  349.     s6 = "确认加点"
  350.     s7 = "点数重置"
  351.     @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
  352.     @command_window.index = @menu_index
  353.     # 获取角色
  354.     @actor = $game_party.actors[@actor_index]
  355.     # 将角色的剩余点数带入
  356.     $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  357.     # 初始化临时量
  358.     $temp_str = 0
  359.     $temp_dex = 0
  360.     $temp_agi = 0
  361.     $temp_int = 0
  362.     $temp_hp = 0
  363.     $temp_sp = 0
  364.  
  365.     #=========================================================================
  366.     # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
  367.     #  (各种编程语言都有这种意外),建议还是使用整数,正负不限
  368.     #=========================================================================
  369.     # 每提升一次力量,提升多少附加能力
  370.     #=========================================================================
  371.     @str_hp = 0     # 每提升一次力量附加提升多少HP
  372.     @str_sp = 0     # 每提升一次力量附加提升多少SP
  373.     @str_dex = 0    # 每提升一次力量附加提升多少灵巧
  374.     @str_agi = 0    # 每提升一次力量附加提升多少速度
  375.     @str_int = 0    # 每提升一次力量附加提升多少魔力
  376.     @str_str = 2   # 每提升一次力量附加提升多少力量
  377.  
  378.     #=========================================================================
  379.     # 每提升一次灵巧,提升多少附加能力
  380.     #=========================================================================
  381.     @dex_hp = 0     # 每提升一次灵巧附加提升多少HP
  382.     @dex_sp = 0     # 每提升一次灵巧附加提升多少SP
  383.     @dex_str = 0    # 每提升一次灵巧附加提升多少力量
  384.     @dex_agi = 0    # 每提升一次灵巧附加提升多少速度
  385.     @dex_int = 0    # 每提升一次灵巧附加提升多少魔力
  386.     @dex_dex = 2   # 每提升一次灵巧附加提升多少灵巧
  387.  
  388.     #=========================================================================
  389.     # 每提升一次速度,提升多少附加能力
  390.     #=========================================================================
  391.     @agi_hp = 0    # 每提升一次速度附加提升多少HP
  392.     @agi_sp = 0    # 每提升一次速度附加提升多少SP
  393.     @agi_str = 0    # 每提升一次速度附加提升多少力量
  394.     @agi_dex = 0    # 每提升一次速度附加提升多少灵巧
  395.     @agi_int = 0    # 每提升一次速度附加提升多少魔力
  396.     @agi_agi = 2   # 每提升一次速度附加提升多少速度
  397.  
  398.     #=========================================================================
  399.     # 每提升一次魔力,提升多少附加能力
  400.     #=========================================================================
  401.     @int_hp =  0   # 每提升一次魔力附加提升多少HP
  402.     @int_sp =  0    # 每提升一次魔力附加提升多少SP
  403.     @int_str = 0   # 每提升一次魔力附加提升多少力量
  404.     @int_dex = 0   # 每提升一次魔力附加提升多少灵巧
  405.     @int_agi = 0   # 每提升一次魔力附加提升多少速度
  406.     @int_int = 2   # 每提升一次魔力附加提升多少魔力
  407.  
  408.     #=========================================================================
  409.     # 每提升一次体力,提升多少附加能力
  410.     #=========================================================================
  411.     @hp = 35        # 每提升一次体力提升多少HP
  412.     @sp = 14        # 每提升一次体力提升多少SP
  413.     @hp_str = 0   # 每提升一次魔力附加提升多少力量
  414.     @hp_dex = 0   # 每提升一次魔力附加提升多少灵巧
  415.     @hp_agi = 0   # 每提升一次魔力附加提升多少速度
  416.     @hp_int = 0   # 每提升一次魔力附加提升多少魔力
  417.  
  418.  
  419.     # 定义说明文字
  420.     @text_hp_sc = "体质可以增加HP和SP!Q,W 换人"
  421.     @text_str_sc = $data_system.words.str + "可以增加物理攻击的伤害! Q,W 换人"
  422.     @text_dex_sc = $data_system.words.dex + "可以提高命中率! Q,W 换人"
  423.     @text_agi_sc = $data_system.words.agi + "可以提高攻击速度,逃跑成功率! Q,W 换人"
  424.     @text_int_sc = $data_system.words.int + "可以增加魂技的伤害! Q,W 换人"
  425.     @text_save = "保存分配并返回游戏"
  426.     @text_reset= "重新分配能力点数"
  427.     @text_2 = "每增加一次此项能力值,可以提升能力值"
  428.     @text_hp = "最大" + $data_system.words.hp + "值"
  429.     @text_sp = "最大" + $data_system.words.sp + "值"
  430.     @text_str = "最大" + $data_system.words.str + "值"
  431.     @text_dex = "最大" + $data_system.words.dex + "值"
  432.     @text_agi = "最大" + $data_system.words.agi + "值"
  433.     @text_int = "最大" + $data_system.words.int + "值"
  434.  
  435.     s_disable
  436.     # 生成状态窗口
  437.     @lvup_window = Window_Lvup.new(@actor)
  438.     @lvup_window.x = 128
  439.     @lvup_window.y = 0   
  440.     # 生成帮助窗口并初始化帮助文本
  441.     @help_window = Window_Lvup_Help.new
  442.  
  443.  
  444.  
  445.  
  446.     # 执行过渡
  447.     Graphics.transition(20, "Graphics/Transitions/" + $data_system.battle_transition)
  448.     # 主循环
  449.     loop do
  450.       # 刷新游戏画面
  451.       Graphics.update
  452.       # 刷新输入信息
  453.       Input.update
  454.       # 刷新画面
  455.       update
  456.       # 如果切换画面就中断循环
  457.       if $scene != self
  458.         break
  459.       end
  460.     end
  461.     # 准备过渡
  462.     Graphics.freeze
  463.     # 释放窗口
  464.     @command_window.dispose
  465.     @lvup_window.dispose
  466.     @help_window.dispose
  467.   end
  468.   #--------------------------------------------------------------------------
  469.   # ● 刷新画面
  470.   #--------------------------------------------------------------------------
  471.   def update
  472.     # 刷新窗口
  473.     @command_window.update
  474.     # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
  475.     s_disable
  476.     @lvup_window.update
  477.     #=============================================================
  478.     # 按下 B 键的情况下
  479.     #=============================================================
  480.     if Input.trigger?(Input::B)
  481.       # 演奏取消 SE
  482.       $game_system.se_play($data_system.cancel_se)
  483.       # 切换到地图画面
  484.        $scene = Scene_Menu.new(5)
  485.       return
  486.     end
  487.     #=============================================================
  488.     # 按下 C 键的情况下
  489.     #=============================================================
  490.     if Input.repeat?(Input::C)      
  491.       if @command_window.index == 5
  492.           # 演奏确定 SE
  493.         $game_system.se_play($data_system.decision_se)
  494.         # 将角色的剩余点数带回
  495.         $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  496.         # 将角色点数实际加上
  497.         @actor.str += $temp_str
  498.         @actor.dex += $temp_dex
  499.         @actor.agi += $temp_agi
  500.         @actor.int += $temp_int
  501.         @actor.maxhp += $temp_hp
  502.         @actor.maxsp += $temp_sp
  503.  
  504.  
  505.         # 切换到地图画面
  506.         $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  507.         #$scene = Scene_Map.new
  508.         return
  509.       end
  510.       if @command_window.index == 6
  511.           # 演奏确定 SE
  512.         $game_system.se_play($data_system.cancel_se)
  513.           # 将角色的剩余点数带入
  514.         $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]   
  515.           # 初始化临时量
  516.         $temp_str = 0
  517.         $temp_dex = 0
  518.         $temp_agi = 0
  519.         $temp_int = 0
  520.         $temp_hp = 0
  521.         $temp_sp = 0
  522.  
  523.         @lvup_window.refresh
  524.         return
  525.       end
  526.       if $point == 0
  527.         # 演奏冻结 SE
  528.         $game_system.se_play($data_system.buzzer_se)
  529.         return
  530.       end
  531.       case @command_window.index
  532.       when 0
  533.         # 演奏确定 SE
  534.         $game_system.se_play($data_system.decision_se)
  535.         $temp_hp += @hp
  536.         $temp_sp += @sp
  537.         $temp_str += @hp_str
  538.         $temp_dex += @hp_dex
  539.         $temp_agi += @hp_agi
  540.         $temp_int += @hp_int
  541.  
  542.         $point -= 1
  543.         @lvup_window.refresh
  544.         s_disable
  545.         return
  546.       when 1
  547.         # 演奏确定 SE
  548.         $game_system.se_play($data_system.decision_se)
  549.         $temp_str += @str_str
  550.         $temp_hp += @str_hp
  551.         $temp_sp += @str_sp
  552.         $temp_dex += @str_dex
  553.         $temp_agi += @str_agi
  554.         $temp_int += @str_int
  555.  
  556.         $point -= 1
  557.         @lvup_window.refresh
  558.         s_disable
  559.         return
  560.       when 2
  561.         # 演奏确定 SE
  562.         $game_system.se_play($data_system.decision_se)
  563.         $temp_dex += @dex_dex
  564.         $temp_hp += @dex_hp
  565.         $temp_sp += @dex_sp
  566.         $temp_str += @dex_str
  567.         $temp_agi += @dex_agi
  568.         $temp_int += @dex_int
  569.  
  570.         $point -= 1
  571.         @lvup_window.refresh
  572.         s_disable
  573.         return
  574.       when 3
  575.         # 演奏确定 SE
  576.         $game_system.se_play($data_system.decision_se)
  577.         $temp_agi += @agi_agi
  578.         $temp_hp += @agi_hp
  579.         $temp_sp += @agi_sp
  580.         $temp_str += @agi_str
  581.         $temp_dex += @agi_dex
  582.         $temp_int += @agi_int
  583.  
  584.         $point -= 1
  585.         @lvup_window.refresh
  586.         s_disable
  587.         return
  588.       when 4
  589.         # 演奏确定 SE
  590.         $game_system.se_play($data_system.decision_se)
  591.         $temp_int += @int_int
  592.         $temp_hp += @int_hp
  593.         $temp_sp += @int_sp
  594.         $temp_str += @int_str
  595.         $temp_dex += @int_dex
  596.         $temp_agi += @int_agi
  597.  
  598.         $point -= 1
  599.         @lvup_window.refresh
  600.         s_disable
  601.         return
  602.       end
  603.     end
  604.     #=============================================================
  605.     # 什么都没有按下的情况
  606.     #=============================================================
  607.     case @command_window.index   
  608.     when 0  # 增加体力
  609.       temptext1 = @text_hp + @hp.to_s + "点   " + @text_str + @hp_str.to_s + "点   " + @text_dex + @hp_dex.to_s + "点 "
  610.       temptext2 = @text_sp + @sp.to_s + "点   " + @text_agi + @hp_agi.to_s + "点   " + @text_int + @hp_int.to_s + "点 "
  611.       @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
  612.     when 1  # 增加力量
  613.       temptext1 = @text_hp + @str_hp.to_s + "点   " + @text_str + @str_str.to_s + "点   " + @text_dex + @str_dex.to_s + "点"
  614.       temptext2 = @text_sp + @str_sp.to_s + "点   " + @text_agi + @str_agi.to_s + "点   " + @text_int + @str_int.to_s + "点"
  615.       @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
  616.     when 2  # 增加灵巧
  617.       temptext1 = @text_hp + @dex_hp.to_s + "点   " + @text_str + @dex_agi.to_s + "点   " + @text_dex + @dex_dex.to_s + "点"
  618.       temptext2 = @text_sp + @dex_sp.to_s + "点   " + @text_agi + @dex_agi.to_s + "点   " + @text_int + @dex_int.to_s + "点"
  619.       @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
  620.     when 3  # 增加速度
  621.       temptext1 = @text_hp + @agi_hp.to_s + "点   " + @text_str + @agi_str.to_s + "点   " + @text_dex + @agi_dex.to_s + "点"
  622.       temptext2 = @text_sp + @agi_sp.to_s + "点   " + @text_agi + @agi_agi.to_s + "点   " + @text_int + @agi_int.to_s + "点"
  623.       @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
  624.     when 4  # 增加魔力
  625.       temptext1 = @text_hp + @int_hp.to_s + "点   " + @text_str + @int_str.to_s + "点   " + @text_dex + @int_dex.to_s + "点"
  626.       temptext2 = @text_sp + @int_sp.to_s + "点   " + @text_agi + @int_agi.to_s + "点   " + @text_int + @int_int.to_s + "点"
  627.       @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
  628.     when 5 # 保存设定
  629.       @help_window.lvup_text(@text_save)
  630.     when 6 # 点数重置
  631.       @help_window.lvup_text(@text_reset)     
  632.     end
  633.     #=============================================================
  634.     # 按下R与L换人的情况
  635.     #=============================================================      
  636.     if Input.trigger?(Input::R)
  637.       # 演奏光标 SE
  638.       $game_system.se_play($data_system.cursor_se)
  639.       # 移至下一位角色
  640.       @actor_index += 1
  641.       @actor_index %= $game_party.actors.size
  642.       # 切换到别的状态画面
  643.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  644.       return
  645.     end
  646.     # 按下 L 键的情况下
  647.     if Input.trigger?(Input::L)
  648.       # 演奏光标 SE
  649.       $game_system.se_play($data_system.cursor_se)
  650.       # 移至上一位角色
  651.       @actor_index += $game_party.actors.size - 1
  652.       @actor_index %= $game_party.actors.size
  653.       # 切换到别的状态画面
  654.       $scene = Scene_Lvup.new(@actor_index , @command_window.index)
  655.       return
  656.     end
  657.   end  
  658.   #--------------------------------------------------------------------------
  659.   # ● 选项明暗判断
  660.   #--------------------------------------------------------------------------
  661.   def s_disable
  662.     # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
  663.     if $point == 0
  664.       @command_window.disable_item(0)
  665.       @command_window.disable_item(1)
  666.       @command_window.disable_item(2)
  667.       @command_window.disable_item(3)
  668.       @command_window.disable_item(4)
  669.     else
  670.       @command_window.able_item(0)
  671.       @command_window.able_item(1)      
  672.       @command_window.able_item(2)
  673.       @command_window.able_item(3)
  674.       @command_window.able_item(4)
  675.     end
  676.   end
  677. end


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

RUBY 代码复制
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 限界突破 - KGC_LimitBreak ◆
  3. #_/    ◇ Last update : 2008/01/10 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  各種設定値の上限を変更します。
  6. #_/============================================================================
  7. #_/  なるべく [Scene_Debug] のすぐ下に導入してください。
  8. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  9.  
  10. #==============================================================================
  11. # ★ カスタマイズ項目 ★
  12. #==============================================================================
  13.  
  14. module KGC
  15. module LimitBreak
  16.   # ◆能力値算出方式
  17.   #   0..データベース通り。
  18.   #      (100以降は計算式として ACTOR_LV100_CALC を使用)
  19.   #
  20.   #   1..データベースを用いた2次関数。
  21.   #        a:レベル1の値  b:レベル2の値  c:レベル3の値  x:現レベル
  22.   #      として、
  23.   #        ax^2 + bx + c
  24.   #      を用いて能力値を算出。
  25.   #
  26.   #   2..データベースを用いた1次関数。
  27.   #        b:レベル2の値  c:レベル3の値  x:現レベル
  28.   #      として、
  29.   #        bx + c
  30.   #      を用いて能力値を算出。
  31.   #      (レベル2,3の値を使うのは、2次関数方式との使い分けを楽にするため)
  32.   CALC_PARAMETER_METHOD = 0
  33.  
  34.   # ◆レベル 100 以降の能力値計算式
  35.   #  (CALC_PARAMETER_METHOD が 0 のときに使用)
  36.   #  【lv..現レベル  p[x]..レベル x の能力値】
  37.   #  この計算結果をレベル 99 の能力値に加算。
  38.   ACTOR_LV100_CALC = "(p[99] - p[98]) * (lv - 99)"
  39.  
  40.   # ◆アクターのレベル上限
  41.   #  アクターID順に配列に格納(最初は nil)
  42.   ACTOR_LV_LIMIT = [nil]
  43.   # ◆上限未指定アクターのレベル上限
  44.   #  上限未指定(nil)のアクターはこの値を使用。
  45.   ACTOR_LV_LIMIT_DEFAULT = 9999
  46.   $actover = ACTOR_LV_LIMIT_DEFAULT + 1
  47.   # ◆アクターの経験値上限
  48.   ACTOR_EXP_LIMIT = 4200000000
  49.   # ◆アクターのHP上限
  50.   ACTOR_HP_LIMIT  = 999999999
  51.   # ◆アクターのSP上限
  52.   ACTOR_SP_LIMIT  = 999999
  53.   # ◆アクターの「腕力, 器用さ, 素早さ, 魔力」上限
  54.   ACTOR_ETC_LIMIT = 99999
  55.  
  56.   # ◆敵のHP上限
  57.   ENEMY_HP_LIMIT  = 4200000000
  58.   # ◆敵のSP上限
  59.   ENEMY_SP_LIMIT  = 999999
  60.   # ◆敵の「腕力, 器用さ, 素早さ, 魔力」上限
  61.   ENEMY_ETC_LIMIT = 99999
  62.  
  63.   # ◆アクター能力値修正値(百分率)
  64.   #  アクターの能力値がデータベースの設定値の○%になる。
  65.   #  (上限値が高い場合に使用。データベースの値を使う場合は 100)
  66.   ACTOR_MAXHP_REVISE = 100  # MAXHP
  67.   ACTOR_MAXSP_REVISE = 100  # MAXSP
  68.   ACTOR_STR_REVISE   = 100  # 腕力
  69.   ACTOR_DEX_REVISE   = 100  # 器用さ
  70.   ACTOR_AGI_REVISE   = 100  # 素早さ
  71.   ACTOR_INT_REVISE   = 100  # 魔力
  72.  
  73.   # ◆敵能力値修正値(百分率)
  74.   #  敵の能力値がデータベースの設定値の○%になる。
  75.   ENEMY_MAXHP_REVISE = 100  # MAXHP
  76.   ENEMY_MAXSP_REVISE = 100  # MAXSP
  77.   ENEMY_STR_REVISE   = 100  # 腕力
  78.   ENEMY_DEX_REVISE   = 100  # 器用さ
  79.   ENEMY_AGI_REVISE   = 100  # 素早さ
  80.   ENEMY_INT_REVISE   = 100  # 魔力
  81.   ENEMY_ATK_REVISE   = 100  # 攻撃力
  82.   ENEMY_PDEF_REVISE  = 100  # 物理防御
  83.   ENEMY_MDEF_REVISE  = 100  # 魔法防御
  84.  
  85.   # ◆所持金上限
  86.   GOLD_LIMIT = 999999999
  87.  
  88.   # ◆アイテム所持数上限
  89.   ITEM_LIMIT = [99999]  # ← これは消さないこと!
  90.   # この下に、アイテム所持数の上限を
  91.   #   ITEM_LIMIT[アイテムID] = 所持数上限
  92.   # という書式で設定。
  93.   #  <例> アイテム 1 は 99 個所持可能
  94.   #  ITEM_LIMIT[1] = 99
  95.  
  96.   # ◆武器所持数上限
  97.   #  指定方法はアイテムと同じ。
  98.   WEAPON_LIMIT = [9999]  # ← これは消さないこと!
  99.   # ◆防具所持数上限
  100.   #  指定方法はアイテムと同じ。
  101.   ARMOR_LIMIT = [9999]  # ← これは消さないこと!
  102.  
  103.   # ◆アイテム所持数上限 (デフォルト)
  104.   #  上限を指定しなかったアイテム、武器、防具はこの値を上限として使用。
  105.   ITEM_LIMIT_DEFAULT = 99999
  106.  
  107.   module_function
  108.   #--------------------------------------------------------------------------
  109.   # ○ 敵能力値直接指定
  110.   #     ここで、敵の最大HPなどを直接指定することができます。
  111.   #     データベースに入りきらない数値を指定する場合に使用してください。
  112.   #--------------------------------------------------------------------------
  113.   def set_enemy_status
  114.     #  <例> ID:10 の敵のHPを 2000000 にする場合
  115.     # $data_enemies[10].maxhp = 2000000
  116.     #  <例> ID:16 の敵の攻撃力を 5000 にする場合
  117.     # $data_enemies[16].atk = 5000
  118.   end
  119. end
  120. end
  121.  
  122. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  123.  
  124. $imported = {} if $imported == nil
  125. $imported["LimitBreak"] = true
  126.  
  127. if $game_special_elements == nil
  128.   $game_special_elements = {}
  129.   $data_system = load_data("Data/System.rxdata")
  130. end
  131.  
  132. module KGC::LimitBreak
  133.   module_function
  134.   #--------------------------------------------------------------------------
  135.   # ● 敵の能力補正を適用
  136.   #--------------------------------------------------------------------------
  137.   def revise_enemy_parameters
  138.     (1...$data_enemies.size).each { |i|
  139.       enemy = $data_enemies[i]
  140.       enemy.maxhp = enemy.maxhp * ENEMY_MAXHP_REVISE / 100
  141.       enemy.maxsp = enemy.maxsp * ENEMY_MAXSP_REVISE / 100
  142.       enemy.str = enemy.str * ENEMY_STR_REVISE / 100
  143.       enemy.dex = enemy.dex * ENEMY_DEX_REVISE / 100
  144.       enemy.agi = enemy.agi * ENEMY_AGI_REVISE / 100
  145.       enemy.int = enemy.int * ENEMY_INT_REVISE / 100
  146.       enemy.atk = enemy.atk * ENEMY_ATK_REVISE / 100
  147.       enemy.pdef = enemy.pdef * ENEMY_PDEF_REVISE / 100
  148.       enemy.mdef = enemy.mdef * ENEMY_MDEF_REVISE / 100
  149.     }
  150.   end
  151. end
  152.  
  153. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  154.  
  155. #==============================================================================
  156. # ■ RPG::Item
  157. #==============================================================================
  158.  
  159. class RPG::Item
  160.   #--------------------------------------------------------------------------
  161.   # ● 所持数上限
  162.   #--------------------------------------------------------------------------
  163.   def number_limit
  164.     if KGC::LimitBreak::ITEM_LIMIT[self.id] != nil
  165.       return KGC::LimitBreak::ITEM_LIMIT[self.id]
  166.     else
  167.       return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
  168.     end
  169.   end
  170. end
  171.  
  172. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  173.  
  174. #==============================================================================
  175. # ■ RPG::Weapon
  176. #==============================================================================
  177.  
  178. class RPG::Weapon
  179.   #--------------------------------------------------------------------------
  180.   # ● 所持数上限
  181.   #--------------------------------------------------------------------------
  182.   def number_limit
  183.     if KGC::LimitBreak::WEAPON_LIMIT[self.id] != nil
  184.       return KGC::LimitBreak::WEAPON_LIMIT[self.id]
  185.     else
  186.       return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
  187.     end
  188.   end
  189. end
  190.  
  191. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  192.  
  193. #==============================================================================
  194. # ■ RPG::Armor
  195. #==============================================================================
  196.  
  197. class RPG::Armor
  198.   #--------------------------------------------------------------------------
  199.   # ● 所持数上限
  200.   #--------------------------------------------------------------------------
  201.   def number_limit
  202.     if KGC::LimitBreak::ARMOR_LIMIT[self.id] != nil
  203.       return KGC::LimitBreak::ARMOR_LIMIT[self.id]
  204.     else
  205.       return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
  206.     end
  207.   end
  208. end
  209.  
  210. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  211.  
  212. #==============================================================================
  213. # ■ Game_Battler (分割定義 1)
  214. #==============================================================================
  215.  
  216. class Game_Battler
  217.   #--------------------------------------------------------------------------
  218.   # ● MaxHP の取得
  219.   #--------------------------------------------------------------------------
  220.   def maxhp
  221.     n = [base_maxhp + @maxhp_plus, 1].max
  222.     @states.each { |i| n *= $data_states[i].maxhp_rate / 100.0 }
  223.     n = [[Integer(n), 1].max, maxhp_limit].min
  224.     return n
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ● MaxSP の取得
  228.   #--------------------------------------------------------------------------
  229.   def maxsp
  230.     n = [base_maxsp + @maxsp_plus, 0].max
  231.     @states.each { |i| n *= $data_states[i].maxsp_rate / 100.0 }
  232.     n = [[Integer(n), 0].max, maxsp_limit].min
  233.     return n
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # ● 腕力の取得
  237.   #--------------------------------------------------------------------------
  238.   def str
  239.     n = [base_str + @str_plus, 1].max
  240.     @states.each { |i| n *= $data_states[i].str_rate / 100.0 }
  241.     n = [[Integer(n), 1].max, parameter_limit].min
  242.     return n
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # ● 器用さの取得
  246.   #--------------------------------------------------------------------------
  247.   def dex
  248.     n = [base_dex + @dex_plus, 1].max
  249.     @states.each { |i| n *= $data_states[i].dex_rate / 100.0 }
  250.     n = [[Integer(n), 1].max, parameter_limit].min
  251.     return n
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 素早さの取得
  255.   #--------------------------------------------------------------------------
  256.   def agi
  257.     n = [base_agi + @agi_plus, 1].max
  258.     @states.each { |i| n *= $data_states[i].agi_rate / 100.0 }
  259.     n = [[Integer(n), 1].max, parameter_limit].min
  260.     return n
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 魔力の取得
  264.   #--------------------------------------------------------------------------
  265.   def int
  266.     n = [base_int + @int_plus, 1].max
  267.     @states.each { |i| n *= $data_states[i].int_rate / 100.0 }
  268.     n = [[Integer(n), 1].max, parameter_limit].min
  269.     return n
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # ● MaxHP の設定
  273.   #     maxhp : 新しい MaxHP
  274.   #--------------------------------------------------------------------------
  275.   def maxhp=(maxhp)
  276.     @maxhp_plus += maxhp - self.maxhp
  277.     @maxhp_plus = [[@maxhp_plus, -maxhp_limit].max, maxhp_limit].min
  278.     @hp = [@hp, self.maxhp].min
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● MaxSP の設定
  282.   #     maxsp : 新しい MaxSP
  283.   #--------------------------------------------------------------------------
  284.   def maxsp=(maxsp)
  285.     @maxsp_plus += maxsp - self.maxsp
  286.     @maxsp_plus = [[@maxsp_plus, -maxsp_limit].max, maxsp_limit].min
  287.     @sp = [@sp, self.maxsp].min
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # ● 腕力の設定
  291.   #     str : 新しい腕力
  292.   #--------------------------------------------------------------------------
  293.   def str=(str)
  294.     @str_plus += str - self.str
  295.     @str_plus = [[@str_plus, -parameter_limit].max, parameter_limit].min
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● 器用さの設定
  299.   #     dex : 新しい器用さ
  300.   #--------------------------------------------------------------------------
  301.   def dex=(dex)
  302.     @dex_plus += dex - self.dex
  303.     @dex_plus = [[@dex_plus, -parameter_limit].max, parameter_limit].min
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● 素早さの設定
  307.   #     agi : 新しい素早さ
  308.   #--------------------------------------------------------------------------
  309.   def agi=(agi)
  310.     @agi_plus += agi - self.agi
  311.     @agi_plus = [[@agi_plus, -parameter_limit].max, parameter_limit].min
  312.   end
  313.   #--------------------------------------------------------------------------
  314.   # ● 魔力の設定
  315.   #     int : 新しい魔力
  316.   #--------------------------------------------------------------------------
  317.   def int=(int)
  318.     @int_plus += int - self.int
  319.     @int_plus = [[@int_plus, -parameter_limit].max, parameter_limit].min
  320.   end
  321. end
  322.  
  323. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  324.  
  325. #==============================================================================
  326. # ■ Game_Actor
  327. #==============================================================================
  328.  
  329. class Game_Actor < Game_Battler
  330.   #--------------------------------------------------------------------------
  331.   # ● EXP 計算
  332.   #--------------------------------------------------------------------------
  333.   def make_exp_list
  334.     actor = $data_actors[@actor_id]
  335.     @exp_list[1] = 0
  336.     pow_i = 2.4 + actor.exp_inflation / 100.0
  337.     (2..(self.final_level + 1)).each { |i|
  338.       if i > self.final_level
  339.         @exp_list[i] = 0
  340.       else
  341.         n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
  342.         @exp_list[i] = @exp_list[i-1] + Integer(n)
  343.       end
  344.     }
  345.   end
  346.   #--------------------------------------------------------------------------
  347.   # ● EXP の変更
  348.   #     exp : 新しい EXP
  349.   #--------------------------------------------------------------------------
  350.   def exp=(exp)
  351.     if $imported["ExpGoldIncrease"]
  352.       rate = calc_exp_increase_rate(KGC::EXPGLD_INC_PERMIT_DOUBLE)
  353.       exp = @exp + (exp - @exp) * rate / 100
  354.     end
  355.     @exp = [[exp, KGC::LimitBreak::ACTOR_EXP_LIMIT].min, 0].max
  356.     # レベルアップ
  357.     while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  358.       @level += 1
  359.       # スキル習得
  360.       $data_classes[@class_id].learnings.each { |j|
  361.         if j.level == @level
  362.           learn_skill(j.skill_id)
  363.         end
  364.       }
  365.     end
  366.     # レベルダウン
  367.     while @exp < @exp_list[@level]
  368.       @level -= 1
  369.     end
  370.     # 現在の HP と SP が最大値を超えていたら修正
  371.     @hp = [@hp, self.maxhp].min
  372.     @sp = [@sp, self.maxsp].min
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ○ パラメータの取得
  376.   #--------------------------------------------------------------------------
  377.   if KGC::LimitBreak::CALC_PARAMETER_METHOD == 0
  378.     def parameter(type)
  379.       if @level >= 100
  380.         calc_text = KGC::LimitBreak::ACTOR_LV100_CALC.dup
  381.         calc_text.gsub!(/lv/i) { "@level" }
  382.         calc_text.gsub!(/p\[(\d+)\]/i) {
  383.           "$data_actors[@actor_id].parameters[type, #{$1.to_i}]"
  384.         }
  385.         return $data_actors[@actor_id].parameters[type, 99] + eval(calc_text)
  386.       else
  387.         return $data_actors[@actor_id].parameters[type, @level]
  388.       end
  389.     end
  390.   elsif KGC::LimitBreak::CALC_PARAMETER_METHOD == 1
  391.     def parameter(type)
  392.       a = $data_actors[@actor_id].parameters[type, 1]
  393.       b = $data_actors[@actor_id].parameters[type, 2]
  394.       c = $data_actors[@actor_id].parameters[type, 3]
  395.       return a * @level * @level + b * @level + c
  396.     end
  397.   elsif KGC::LimitBreak::CALC_PARAMETER_METHOD == 2
  398.     def parameter(type)
  399.       b = $data_actors[@actor_id].parameters[type, 2]
  400.       c = $data_actors[@actor_id].parameters[type, 3]
  401.       return b * @level + c
  402.     end
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # ● 基本 MaxHP の取得
  406.   #--------------------------------------------------------------------------
  407.   def base_maxhp
  408.     n = self.parameter(0)
  409.     return n * KGC::LimitBreak::ACTOR_MAXHP_REVISE / 100
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● MaxHP の取得
  413.   #--------------------------------------------------------------------------
  414.   def maxhp
  415.     n = [base_maxhp + @maxhp_plus, 1].max
  416.     @states.each { |i| n *= $data_states[i].maxhp_rate / 100.0 }
  417.     n = [[Integer(n), 1].max, maxhp_limit].min
  418.     return n
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● 基本 MaxSP の取得
  422.   #--------------------------------------------------------------------------
  423.   def base_maxsp
  424.     n = self.parameter(1)
  425.     return n * KGC::LimitBreak::ACTOR_MAXSP_REVISE / 100
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # ● MaxSP の取得
  429.   #--------------------------------------------------------------------------
  430.   def maxsp
  431.     n = [base_maxsp + @maxsp_plus, 0].max
  432.     @states.each { |i| n *= $data_states[i].maxsp_rate / 100.0 }
  433.     n = [[Integer(n), 0].max, maxsp_limit].min
  434.     return n
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ● 基本腕力の取得
  438.   #--------------------------------------------------------------------------
  439.   def base_str
  440.     n = self.parameter(2)
  441.     if $imported["EquipExtension"]
  442.       n += equipment_parameter(2)
  443.     else
  444.       equip_item_list.each { |item| n += (item != nil ? item.str_plus : 0) }
  445.     end
  446.     return [[n * KGC::LimitBreak::ACTOR_STR_REVISE / 100, 1].max, parameter_limit].min
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ● 基本器用さの取得
  450.   #--------------------------------------------------------------------------
  451.   def base_dex
  452.     n = self.parameter(3)
  453.     if $imported["EquipExtension"]
  454.       n += equipment_parameter(3)
  455.     else
  456.       equip_item_list.each { |item| n += (item != nil ? item.dex_plus : 0) }
  457.     end
  458.     return [[n * KGC::LimitBreak::ACTOR_DEX_REVISE / 100, 1].max, parameter_limit].min
  459.   end
  460.   #--------------------------------------------------------------------------
  461.   # ● 基本素早さの取得
  462.   #--------------------------------------------------------------------------
  463.   def base_agi
  464.     n = self.parameter(4)
  465.     if $imported["EquipExtension"]
  466.       n += equipment_parameter(4)
  467.     else
  468.       equip_item_list.each { |item| n += (item != nil ? item.agi_plus : 0) }
  469.     end
  470.     return [[n * KGC::LimitBreak::ACTOR_AGI_REVISE / 100, 1].max, parameter_limit].min
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # ● 基本魔力の取得
  474.   #--------------------------------------------------------------------------
  475.   def base_int
  476.     n = self.parameter(5)
  477.     if $imported["EquipExtension"]
  478.       n += equipment_parameter(5)
  479.     else
  480.       equip_item_list.each { |item| n += (item != nil ? item.int_plus : 0) }
  481.     end
  482.     return [[n * KGC::LimitBreak::ACTOR_INT_REVISE / 100, 1].max, parameter_limit].min
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # ● レベルの変更
  486.   #     level : 新しいレベル
  487.   #--------------------------------------------------------------------------
  488.   def level=(level)
  489.     # 上下限チェック
  490.     level = [[level, self.final_level].min, 1].max
  491.     # EXP を変更
  492.     self.exp = @exp_list[level]
  493.   end
  494.   #--------------------------------------------------------------------------
  495.   # ● 最終レベルの取得
  496.   #--------------------------------------------------------------------------
  497.   def final_level
  498.     return (KGC::LimitBreak::ACTOR_LV_LIMIT[@actor_id] != nil ?
  499.       KGC::LimitBreak::ACTOR_LV_LIMIT[@actor_id] : KGC::LimitBreak::ACTOR_LV_LIMIT_DEFAULT)
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ○ MaxHP 限界値の取得
  503.   #--------------------------------------------------------------------------
  504.   def maxhp_limit
  505.     return KGC::LimitBreak::ACTOR_HP_LIMIT
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # ○ MaxSP 限界値の取得
  509.   #--------------------------------------------------------------------------
  510.   def maxsp_limit
  511.     return KGC::LimitBreak::ACTOR_SP_LIMIT
  512.   end
  513.   #--------------------------------------------------------------------------
  514.   # ○ パラメータ限界値の取得
  515.   #--------------------------------------------------------------------------
  516.   def parameter_limit
  517.     return KGC::LimitBreak::ACTOR_ETC_LIMIT
  518.   end
  519.   #--------------------------------------------------------------------------
  520.   # ○ 装備武器リストの取得
  521.   #--------------------------------------------------------------------------
  522.   def equip_weapon_list
  523.     result = [$data_weapons[@weapon_id]]
  524.     return result.compact
  525.   end
  526.   #--------------------------------------------------------------------------
  527.   # ○ 装備防具リストの取得
  528.   #--------------------------------------------------------------------------
  529.   def equip_armor_list
  530.     result = []
  531.     (1..4).each { |i| result << $data_armors[eval("@armor#{i}_id")] }
  532.     return result.compact
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ○ 装備品リストの取得
  536.   #--------------------------------------------------------------------------
  537.   def equip_item_list
  538.     return equip_weapon_list + equip_armor_list
  539.   end
  540. end
  541.  
  542. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  543.  
  544. #==============================================================================
  545. # ■ Game_Enemy
  546. #==============================================================================
  547.  
  548. class Game_Enemy < Game_Battler
  549.   #--------------------------------------------------------------------------
  550.   # ○ MaxHP 限界値の取得
  551.   #--------------------------------------------------------------------------
  552.   def maxhp_limit
  553.     return KGC::LimitBreak::ENEMY_HP_LIMIT
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ○ MaxSP 限界値の取得
  557.   #--------------------------------------------------------------------------
  558.   def maxsp_limit
  559.     return KGC::LimitBreak::ENEMY_SP_LIMIT
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # ○ パラメータ限界値の取得
  563.   #--------------------------------------------------------------------------
  564.   def parameter_limit
  565.     return KGC::LimitBreak::ENEMY_ETC_LIMIT
  566.   end
  567. end
  568.  
  569. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  570.  
  571. #==============================================================================
  572. # ■ Game_Party
  573. #==============================================================================
  574.  
  575. class Game_Party
  576.   #--------------------------------------------------------------------------
  577.   # ● ゴールドの増加 (減少)
  578.   #     n : 金額
  579.   #--------------------------------------------------------------------------
  580.   def gain_gold(n)
  581.     # 所持金の限界値変更
  582.     @gold = [[@gold + n, 0].max, KGC::LimitBreak::GOLD_LIMIT].min
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ● アイテムの増加 (減少)
  586.   #     item_id : アイテム ID
  587.   #     n       : 個数
  588.   #--------------------------------------------------------------------------
  589.   def gain_item(item_id, n)
  590.     # ハッシュの個数データを更新
  591.     if item_id > 0
  592.       limit = $data_items[item_id].number_limit
  593.       @items[item_id] = [[item_number(item_id) + n, 0].max, limit].min
  594.     end
  595.   end
  596.   #--------------------------------------------------------------------------
  597.   # ● 武器の増加 (減少)
  598.   #     weapon_id : 武器 ID
  599.   #     n         : 個数
  600.   #--------------------------------------------------------------------------
  601.   def gain_weapon(weapon_id, n)
  602.     # ハッシュの個数データを更新
  603.     if weapon_id > 0
  604.       limit = $data_weapons[weapon_id].number_limit
  605.       @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, limit].min
  606.     end
  607.   end
  608.   #--------------------------------------------------------------------------
  609.   # ● 防具の増加 (減少)
  610.   #     armor_id : 防具 ID
  611.   #     n        : 個数
  612.   #--------------------------------------------------------------------------
  613.   def gain_armor(armor_id, n)
  614.     # ハッシュの個数データを更新
  615.     if armor_id > 0
  616.       limit = $data_armors[armor_id].number_limit
  617.       @armors[armor_id] = [[armor_number(armor_id) + n, 0].max, limit].min
  618.     end
  619.   end
  620. end
  621.  
  622. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  623.  
  624. #==============================================================================
  625. # ■ Window_ShopBuy
  626. #==============================================================================
  627.  
  628. class Window_ShopBuy < Window_Selectable
  629.   #--------------------------------------------------------------------------
  630.   # ● 項目の描画
  631.   #     index : 項目番号
  632.   #--------------------------------------------------------------------------
  633.   def draw_item(index)
  634.     item = @data[index]
  635.     # アイテムの所持数を取得
  636.     case item
  637.     when RPG::Item
  638.       number = $game_party.item_number(item.id)
  639.     when RPG::Weapon
  640.       number = $game_party.weapon_number(item.id)
  641.     when RPG::Armor
  642.       number = $game_party.armor_number(item.id)
  643.     end
  644.     # 価格が所持金以下、かつ所持数が上限でなければ通常文字色に、
  645.     # そうでなければ無効文字色に設定
  646.     if item.price <= $game_party.gold && number < item.number_limit
  647.       self.contents.font.color = normal_color
  648.     else
  649.       self.contents.font.color = disabled_color
  650.     end
  651.     x = 4
  652.     y = index * 32
  653.     rect = Rect.new(x, y, self.width - 32, 32)
  654.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  655.     bitmap = RPG::Cache.icon(item.icon_name)
  656.     opacity = self.contents.font.color == normal_color ? 255 : 128
  657.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  658.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  659.     self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
  660.   end
  661. end
  662.  
  663. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  664.  
  665. #==============================================================================
  666. # ■ Scene_Title
  667. #==============================================================================
  668.  
  669. class Scene_Title
  670.   #--------------------------------------------------------------------------
  671.   # ● コマンド : ニューゲーム
  672.   #--------------------------------------------------------------------------
  673.   alias command_new_game_KGC_LimitBreak command_new_game
  674.   def command_new_game
  675.     command_new_game_KGC_LimitBreak
  676.  
  677.     KGC::LimitBreak.revise_enemy_parameters
  678.     KGC::LimitBreak.set_enemy_status
  679.   end
  680.   #--------------------------------------------------------------------------
  681.   # ● コマンド : コンティニュー
  682.   #--------------------------------------------------------------------------
  683.   alias command_continue_KGC_LimitBreak command_continue
  684.   def command_continue
  685.     command_continue_KGC_LimitBreak
  686.  
  687.     KGC::LimitBreak.revise_enemy_parameters
  688.     KGC::LimitBreak.set_enemy_status
  689.   end
  690.   #--------------------------------------------------------------------------
  691.   # ● 戦闘テスト
  692.   #--------------------------------------------------------------------------
  693.   alias battle_test_KGC_LimitBreak battle_test
  694.   def battle_test
  695.     battle_test_KGC_LimitBreak
  696.  
  697.     KGC::LimitBreak.revise_enemy_parameters
  698.     KGC::LimitBreak.set_enemy_status
  699.   end
  700. end
  701.  
  702. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
  703.  
  704. #==============================================================================
  705. # ■ Scene_Shop
  706. #==============================================================================
  707.  
  708. class Scene_Shop
  709.   #--------------------------------------------------------------------------
  710.   # ● フレーム更新 (購入ウィンドウがアクティブの場合)
  711.   #--------------------------------------------------------------------------
  712.   def update_buy
  713.     # ステータスウィンドウのアイテムを設定
  714.     @status_window.item = @buy_window.item
  715.     # B ボタンが押された場合
  716.     if Input.trigger?(Input::B)
  717.       # キャンセル SE を演奏
  718.       $game_system.se_play($data_system.cancel_se)
  719.       # ウィンドウの状態を初期モードへ
  720.       @command_window.active = true
  721.       @dummy_window.visible = true
  722.       @buy_window.active = false
  723.       @buy_window.visible = false
  724.       @status_window.visible = false
  725.       @status_window.item = nil
  726.       # ヘルプテキストを消去
  727.       @help_window.set_text("")
  728.       return
  729.     end
  730.     # C ボタンが押された場合
  731.     if Input.trigger?(Input::C)
  732.       # アイテムを取得
  733.       @item = @buy_window.item
  734.       # アイテムが無効の場合、または価格が所持金より上の場合
  735.       if @item == nil or @item.price > $game_party.gold
  736.         # ブザー SE を演奏
  737.         $game_system.se_play($data_system.buzzer_se)
  738.         return
  739.       end
  740.       # アイテムの所持数を取得
  741.       case @item
  742.       when RPG::Item
  743.         number = $game_party.item_number(@item.id)
  744.       when RPG::Weapon
  745.         number = $game_party.weapon_number(@item.id)
  746.       when RPG::Armor
  747.         number = $game_party.armor_number(@item.id)
  748.       end
  749.       # すでに上限まで個所持している場合
  750.       limit = @item.number_limit
  751.       if number >= limit
  752.         # ブザー SE を演奏
  753.         $game_system.se_play($data_system.buzzer_se)
  754.         return
  755.       end
  756.       # 決定 SE を演奏
  757.       $game_system.se_play($data_system.decision_se)
  758.       # 最大購入可能個数を計算
  759.       max = (@item.price == 0 ? limit : $game_party.gold / @item.price)
  760.       max = [max, limit - number].min
  761.       # ウィンドウの状態を個数入力モードへ
  762.       @buy_window.active = false
  763.       @buy_window.visible = false
  764.       @number_window.set(@item, max, @item.price)
  765.       @number_window.active = true
  766.       @number_window.visible = true
  767.     end
  768.   end
  769. end



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


评分

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

查看全部评分

山岚野人,快人快语,礼数不周,还望海涵....
回复

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33148
在线时间
10487 小时
注册时间
2009-3-15
帖子
4756
3
发表于 2021-1-15 14:05:50 | 只看该作者
RUBY 代码复制
  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


插入?
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1157
在线时间
192 小时
注册时间
2019-3-20
帖子
24
4
发表于 2021-1-21 22:16:54 | 只看该作者
本帖最后由 YY2019 于 2021-1-27 19:17 编辑

mpdgghhyytrrllll
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 18:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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