alias old_setup setup
def setup(actor_id)
old_setup(actor_id)
@not_new_skill = []
end
def exp=(exp)
@not_new_skill = []
@exp = [[exp, 9999999].min, 0].max
# 升级
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# 学会特技
for j in $data_classes[@class_id].learnings
if j.level == @level
@not_new_skill.push(j.skill_id) if @skills.include?(j.skill_id)
learn_skill(j.skill_id)
end
end
end
# 降级
while @exp < @exp_list[@level]
@level -= 1
end
# 修正当前的 HP 与 SP 超过最大值
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end