赞 | 3 |
VIP | 333 |
好人卡 | 91 |
积分 | 2 |
经验 | 55775 |
最后登录 | 2017-7-18 |
在线时间 | 2070 小时 |
Lv1.梦旅人 Mr.Gandum
- 梦石
- 0
- 星屑
- 226
- 在线时间
- 2070 小时
- 注册时间
- 2007-1-31
- 帖子
- 3039
|
- #==============================================================================
- # ■ FE_Param
- #------------------------------------------------------------------------------
- # 设置各职业用的各数据
- # 制作者:feizhaodan
- # 版本: 1.1.0
- # 更新: 1.1.0 : 更改了随机式,从原来的非即下一项改为范围随机。
- #==============================================================================
- module FE_Param
-
- CLASSPER = {} # 不要改
-
-
- # 在这里设置各职业的提升几率
- # 格式:
- # CLASSPER[id] = {
- # :para => n%,
- #}
- # id 输入职业ID
- # para 代入属性标识(mhp, mmp, atk, def, mat, mdf, agi, luk)
- # n 代入属性提升几率
- CLASSPER[1] ={
- :mhp => 60, # 血
- :mmp => 40, # 魔
- :atk => 70, # 攻
- :def => 60, # 防
- :mat => 20, # 魔攻
- :mdf => 20, # 魔防
- :agi => 50, # 敏
- :luk => 10, # 幸运
- }
-
- CLASSUP = {} # 不要改
-
-
- # 在这里设置各职业的提升量
- # 格式:
- # CLASSUP[id] = [mi, ma]
- # id 输入职业ID
- # mi 代入提升量最小值
- # ma 代入提升量最大值
- CLASSUP[1] = [5, 9]
- end
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # 处理角色的类。本类在 Game_Actors 类 ($game_actors) 的内部使用、
- # Game_Party 类请参考 ($game_party) 。
- #==============================================================================
- class Game_Actor < Game_Battler
- FEPARAM_LIST_ = [:mhp,:mmp,:atk,:def,:mat,:mdf,:agi,:luk]
- #--------------------------------------------------------------------------
- # ● 获取普通能力
- #--------------------------------------------------------------------------
- def param(param_id)
- value = super
- value += param_gained(param_id)
- return [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
- end
- #--------------------------------------------------------------------------
- # ● 获取提升量
- #--------------------------------------------------------------------------
- def param_up
- param_up = FE_Param::CLASSUP[@class_id]
- up = param_up[0] + rand(param_up[1] - param_up[0] + 1)
- return up
- end
- #--------------------------------------------------------------------------
- # ● 获取提升率
- # param : 属性
- #--------------------------------------------------------------------------
- def param_per
- @param_per = FE_Param::CLASSPER[@class_id] if @param_per == nil
- return @param_per
- end
- #--------------------------------------------------------------------------
- # ● 获取已提升量
- # param : 属性
- #--------------------------------------------------------------------------
- def param_gained(param)
- @param_gained = {} if @param_gained == nil
- return 0 if @param_gained[param] == nil
- return @param_gained[param]
- end
- #--------------------------------------------------------------------------
- # ● 升级
- #--------------------------------------------------------------------------
- alias fe_level_up level_up
- def level_up
- fe_level_up
- gain_param
- end
- #--------------------------------------------------------------------------
- # ● 提升属性
- #--------------------------------------------------------------------------
- def gain_param
- @param_gained = {} if @param_gained == nil
- param_per
- percentage = 0
- @param_per.each_value do |v|
- percentage += v
- end
- point = param_up
- mhpper = @param_per[:mhp]
- mmpper = @param_per[:mmp] + mhpper
- atkper = @param_per[:atk] + mmpper
- defper = @param_per[:def] + atkper
- matper = @param_per[:mat] + defper
- mdfper = @param_per[:mdf] + matper
- agiper = @param_per[:agi] + mdfper
- lukper = @param_per[:luk] + agiper
- loop do
- if point == 0
- break
- end
- per = rand(percentage) + 1
- p [mhpper,mmpper,atkper,defper,matper,mdfper,agiper,lukper,per]
- case per
- when 1...mhpper
- i = FEPARAM_LIST_.index(:mhp)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- when mhpper...mmpper
- i = FEPARAM_LIST_.index(:mmp)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- when mmpper...atkper
- i = FEPARAM_LIST_.index(:atk)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- when atkper...defper
- i = FEPARAM_LIST_.index(:def)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- when defper...matper
- i = FEPARAM_LIST_.index(:mat)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- when matper...mdfper
- i = FEPARAM_LIST_.index(:mdf)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- when mdfper...agiper
- i = FEPARAM_LIST_.index(:agi)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- when agiper...lukper
- i = FEPARAM_LIST_.index(:luk)
- @param_gained[i] = 0 if @param_gained[i] == nil
- @param_gained[i] += 1
- point -= 1
- end
- end
- end
- end
-
复制代码 修正版。然后关于这个几率,他每个属性在升级时增加的几率是(所有属性的几率的和)分之(这个属性的几率),因此没法弄每次升级一定增加HP。因为默认的升级增加属性也还是有效,所以增加HP就用那个来吧。 |
评分
-
查看全部评分
|