# 升级
while @level < max_level and @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
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
#--------------------------------------------------------------------------
# ● 更改水品
# level : 新的等级
#--------------------------------------------------------------------------
def level=(level)
# 检查上下限
level = [[level, calc_max_level_limit].min, 1].max
# 更改 EXP
self.exp = @exp_list[level]
end