赞 | 3 |
VIP | 333 |
好人卡 | 91 |
积分 | 2 |
经验 | 55775 |
最后登录 | 2017-7-18 |
在线时间 | 2070 小时 |
Lv1.梦旅人 Mr.Gandum
- 梦石
- 0
- 星屑
- 226
- 在线时间
- 2070 小时
- 注册时间
- 2007-1-31
- 帖子
- 3039
|
脚本行不?- #==============================================================================
- # ■ FE_Param
- #------------------------------------------------------------------------------
- # 设置各职业用的各数据
- #==============================================================================
- module FE_Param
-
- CLASSPER = {} # 不要改
-
-
- # 在这里设置各职业的提升几率
- # 格式:
- # CLASSPER[id] = {
- # :para => n%,
- #}
- # id 输入职业ID
- # para 代入属性标识(hp, mp, atk, def, spi, agi)
- # n 代入属性提升几率
- CLASSPER[1] ={
- :hp => 60, # 血
- :mp => 40, # 魔
- :atk => 70, # 攻
- :def => 60, # 防
- :spi => 20, # 精神
- :agi => 50, # 敏
- }
-
- 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
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_id : 角色 ID
- #--------------------------------------------------------------------------
- alias fe_param_initialize initialize
- def initialize(actor_id)
- @class_id = $data_actors[actor_id].class_id
-
- fe_param_initialize(actor_id)
- 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)
- param_per = FE_Param::CLASSPER[@class_id][param]
- per = rand(100) + 1
- suc = (per >= param_per)
- return suc
- end
- #--------------------------------------------------------------------------
- # ● 获取已提升量
- # param : 属性
- #--------------------------------------------------------------------------
- def param_gained(param)
- return 0 if @param_gained == nil
- return 0 if @param_gained[param] == nil
- return @param_gained[param]
- end
- #--------------------------------------------------------------------------
- # ● 获取基本体力最大值
- #--------------------------------------------------------------------------
- alias fe_base_maxhp base_maxhp
- def base_maxhp
- n = fe_base_maxhp + param_gained(:hp)
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本体力最大值
- #--------------------------------------------------------------------------
- alias fe_base_maxmp base_maxmp
- def base_maxmp
- n = fe_base_maxmp + param_gained(:mp)
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本攻击力
- #--------------------------------------------------------------------------
- alias fe_base_atk base_atk
- def base_atk
- n = fe_base_atk + param_gained(:atk)
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本防御力
- #--------------------------------------------------------------------------
- alias fe_base_def base_def
- def base_def
- n = fe_base_def + param_gained(:def)
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本精神力
- #--------------------------------------------------------------------------
- alias fe_base_spi base_spi
- def base_spi
- n = fe_base_spi + param_gained(:spi)
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本敏捷
- #--------------------------------------------------------------------------
- alias fe_base_agi base_agi
- def base_agi
- n = fe_base_agi + param_gained(:agi)
- return n
- 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
- point = param_up
- loop do
- if point == 0
- break
- end
- if param_per(:hp)
- @param_gained[:hp] = 0 if @param_gained[:hp] == nil
- @param_gained[:hp] += 1
- point -= 1
- elsif param_per(:mp)
- @param_gained[:mp] = 0 if @param_gained[:mp] == nil
- @param_gained[:mp] += 1
- point -= 1
- elsif param_per(:atk)
- @param_gained[:atk] = 0 if @param_gained[:atk] == nil
- @param_gained[:atk] += 1
- point -= 1
- elsif param_per(:def)
- @param_gained[:def] = 0 if @param_gained[:def] == nil
- @param_gained[:def] += 1
- point -= 1
- elsif param_per(:spi)
- @param_gained[:spi] = 0 if @param_gained[:spi] == nil
- @param_gained[:spi] += 1
- point -= 1
- elsif param_per(:agi)
- @param_gained[:agi] = 0 if @param_gained[:agi] == nil
- @param_gained[:agi] += 1
- point -= 1
- end
- end
- end
- end
-
复制代码 不知道是不是这样
没玩过火纹 |
|