赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1175 |
最后登录 | 2016-1-30 |
在线时间 | 4 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 4 小时
- 注册时间
- 2016-1-28
- 帖子
- 17
|
3楼
楼主 |
发表于 2016-1-28 15:30:19
|
只看该作者
=begin
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 处理角色的类。本类在 Game_Actors 类 ($game_actors)
# 的内部使用、Game_Party 类请参考 ($game_party) 。
#==============================================================================
玄色眷恋修改:2013.3.13 融合技能熟练度脚本,实现被动技能按LV等级增益
注意 被动技能的ID必须等于状态ID 否则会出错
=end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :name # 名称
attr_reader :character_name # 角色 文件名
attr_reader :character_hue # 角色 色相
attr_reader :class_id # 职业 ID
attr_reader :weapon_id # 武器 ID
attr_reader :armor1_id # 盾 ID
attr_reader :armor2_id # 头防具 ID
attr_reader :armor3_id # 身体体防具 ID
attr_reader :armor4_id # 装饰品 ID
attr_reader :level # 等级
attr_reader :exp # EXP
attr_reader :skills # 特技
attr_accessor :skill_s # 特技快捷键
attr_accessor :item_s # 物品快捷键
#--------------------------------------------------------------------------
# ● 初始化对像
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def initialize(actor_id)
super()
setup(actor_id)
end
#--------------------------------------------------------------------------
# ● 设置
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@NAME = actor.name
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
@hp = maxhp
@sp = maxsp
@states = []
@states_turn = {}
@maxhp_plus =
@maxsp_plus =
@str_plus = 999
@dex_plus = 999
@agi_plus = 999
@int_plus = 999
@skill_s = []
#=======破限参数设定======
@str_ot = 99999
@dex_ot = 99999
@agi_ot = 99999
@int_ot = 99999
#=========================
for i in 0..9
@skill_s = ""
end
@item_s = []
for i in 0..9
@item_s = ""
end
# 学会特技
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
# 刷新自动状态
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end
#--------------------------------------------------------------------------
# ● 获取 MaxHP
#--------------------------------------------------------------------------
def maxhp
if self.id == 1
n = [[base_maxhp+cx_plus(1)+ @maxhp_plus, 1].max, 999999].max
else
n = [[base_maxhp+@maxhp_plus, 1].max, 999999].min
end
for i in @states #BUFF用 增加值=mdef_rate-100/技能LV
if skill_learn?(i) and $data_states.hold_turn == 9999
y = self.skill.level
n *= (y*($data_states.maxhp_rate - 100.0)/1000.0)+1
# y /= 10
#n *= (y+100.0)/ 100.0
else #debuff
n *= $data_states.maxhp_rate/100.0
end
end
n = [[Integer(n), 1].max, 999999].min
return n
end
#--------------------------------------------------------------------------
# ● 获取 MaxSP
#--------------------------------------------------------------------------
def maxsp
if self.id == 1
n = [[base_maxsp+cx_plus(2)+ @maxsp_plus, 1].max, 999999].max
else
n = [[base_maxsp + @maxsp_plus, 1].max, 999999].min
end
for i in @states #BUFF用 增加值=mdef_rate-100/技能LV
if skill_learn?(i) and $data_states.hold_turn == 9999
y = self.skill.level
n *= (y*($data_states.maxsp_rate - 100.0)/1000.0)+1
# y /= 10
#n *= (y+100.0)/ 100.0
else #debuff
n *= $data_states.maxsp_rate/100.0
end
end
n = [[Integer(n), 1].max, 999999].min
return n
end |
|