# 突破等级、能力上限
# 等级可无限提升
BASE_FINAL_LEVEL = 1000 # 等级最高值 ★★★★ 最高等级
MAXHP_LIMIT = 9999999 # 气血最高值
MAXSP_LIMIT = 9999999 # 魔法最高值
STR_LIMIT = 999999 # 力量最高值
DEX_LIMIT = 999999 # 灵巧最高值
AGI_LIMIT = 999999 # 速度最高值
INT_LIMIT = 999999 # 魔力最高值
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 获取 EXP 字符串
# 示例 一般最高50级
# 一转 100 级
# 二转 150 级
# 三转 200 级
#--------------------------------------------------------------------------
def exp_s
# ★★★★
if lvv == 0 and @level == 120
return "----------"
elsif lvv == 1 and @level == 300
return "----------"
elsif lvv == 2 and @level == 500
return "----------"
elsif lvv == 3 and @level == 1000
return "----------"
else
return @exp_list[@level+1] > 0 ? @exp.to_s : "----------"
end
end
#--------------------------------------------------------------------------
# ● 获取下一等级的 EXP 字符串
#--------------------------------------------------------------------------
def next_exp_s
# ★★★★
if lvv == 0 and @level > 119
return "----------"
elsif lvv == 1 and @level > 299
return "----------"
elsif lvv == 2 and @level > 499
return "----------"
elsif lvv == 3 and @level > 999
return "----------"
else
return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "----------"
end
end
#--------------------------------------------------------------------------
# ● 获取离下一等级还需的 EXP 字符串
#--------------------------------------------------------------------------
def next_rest_exp_s
# ★★★★
if lvv == 0 and @level == 119
return "----------"
elsif lvv == 1 and @level == 299
return "----------"
elsif lvv == 2 and @level == 499
return "----------"
elsif lvv == 3 and @level == 998
return "----------"
else
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "----------"
end
end
def new_final_level
lv = BASE_FINAL_LEVEL
#以下上限LV個別指定用
#case self.id
#when 1
# lv = 255
#when 2
# lv = 999
#when 23
# lv = 500
#end
return lv
end
#--------------------------------------------------------------------------
# ● 计算 EXP
#--------------------------------------------------------------------------
def make_exp_list
actor = $data_actors[@actor_id]
@exp_list = Array.new(new_final_level + 2)
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..new_final_level + 1
if i > new_final_level
@exp_list[i] = 0
else
n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
@exp_list[i] = @exp_list[i-1] + Integer(n)
end
end
end
#--------------------------------------------------------------------------
# ● 获取 MaxHP
#--------------------------------------------------------------------------
def maxhp
n = [[base_maxhp + @maxhp_plus, 1].max, MAXHP_LIMIT].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, MAXHP_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 获取基本 MaxHP
#--------------------------------------------------------------------------
def base_maxhp
n = $data_actors[@actor_id].parameters[0, 1]
n += $data_actors[@actor_id].parameters[0, 2] * @level
return n
end
#--------------------------------------------------------------------------
# ● 获取基本 MaxSP
#--------------------------------------------------------------------------
def base_maxsp
n = $data_actors[@actor_id].parameters[1, 1]
n += $data_actors[@actor_id].parameters[1, 2] * @level
return n
end
#--------------------------------------------------------------------------
# ● 获取基本力量
#--------------------------------------------------------------------------
def base_str
n = $data_actors[@actor_id].parameters[2, 1]
n += $data_actors[@actor_id].parameters[2, 2] * @level
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
return [[n, 1].max, STR_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 获取基本灵巧
#--------------------------------------------------------------------------
def base_dex
n = $data_actors[@actor_id].parameters[3, 1]
n += $data_actors[@actor_id].parameters[3, 2] * @level
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
return [[n, 1].max, DEX_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 获取基本速度
#--------------------------------------------------------------------------
def base_agi
n = $data_actors[@actor_id].parameters[4, 1]
n += $data_actors[@actor_id].parameters[4, 2] * @level
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
return [[n, 1].max, AGI_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 获取基本魔力
#--------------------------------------------------------------------------
def base_int
n = $data_actors[@actor_id].parameters[5, 1]
n += $data_actors[@actor_id].parameters[5, 2] * @level
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
return [[n, 1].max, INT_LIMIT].min
end
# ★★★★ 转数
def lvv
@lvv = 0 if @lvv.nil?
return @lvv
end
# ★★★★ 转生
def lvvpl
@lvv = lvv + 1
end
#--------------------------------------------------------------------------
# ● 更改 EXP
# exp : 新的 EXP
#--------------------------------------------------------------------------
def exp=(exp)
# ★EXPの上限チェックを解除
@exp = [exp, 0].max
# 升级
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
# ★★★★ @lvv 转数 一转二转三转 等在这里设置
if lvv == 0 and @level == 120
@exp = @exp_list[@level] # ★★ 1.12 改
return
elsif lvv == 1 and @level == 300
@exp = @exp_list[@level]
return
elsif lvv == 2 and @level == 500
@exp = @exp_list[@level]
return
elsif lvv == 3 and @level == 1000
@exp = @exp_list[@level]
return
end
@hp = maxhp
@sp = maxsp
@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)
# 上下限チェック
# ★LV上限をnew_final_levelでチェックするように変更
level = [[level, new_final_level].min, 1].max
# EXP を変更
self.exp = @exp_list[level]
end
end
class Game_Battler
#--------------------------------------------------------------------------
# ● 获取 MaxSP
#--------------------------------------------------------------------------
def maxsp
n = [[base_maxsp + @maxsp_plus, 0].max, MAXSP_LIMIT].min
for i in @states
n *= $data_states[i].maxsp_rate / 100.0
end
n = [[Integer(n), 0].max, MAXSP_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 获取力量
#--------------------------------------------------------------------------
def str
n = [[base_str + @str_plus, 1].max, STR_LIMIT].min
for i in @states
n *= $data_states[i].str_rate / 100.0
end
n = [[Integer(n), 1].max, STR_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 获取灵巧
#--------------------------------------------------------------------------
def dex
n = [[base_dex + @dex_plus, 1].max, DEX_LIMIT].min
for i in @states
n *= $data_states[i].dex_rate / 100.0
end
n = [[Integer(n), 1].max, DEX_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 获取速度
#--------------------------------------------------------------------------
def agi
n = [[base_agi + @agi_plus, 1].max, AGI_LIMIT].min
for i in @states
n *= $data_states[i].agi_rate / 100.0
end
n = [[Integer(n), 1].max, AGI_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 获取魔力
#--------------------------------------------------------------------------
def int
n = [[base_int + @int_plus, 1].max, INT_LIMIT].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, INT_LIMIT].min
return n
end
#--------------------------------------------------------------------------
# ● 设置 MaxHP
# maxhp : 新的 MaxHP
#--------------------------------------------------------------------------
def maxhp=(maxhp)
@maxhp_plus += maxhp - self.maxhp
@maxhp_plus = [[@maxhp_plus, -MAXHP_LIMIT].max, MAXHP_LIMIT].min
@hp = [@hp, self.maxhp].min
end
#--------------------------------------------------------------------------
# ● 设置 MaxSP
# maxsp : 新的 MaxSP
#--------------------------------------------------------------------------
def maxsp=(maxsp)
@maxsp_plus += maxsp - self.maxsp
@maxsp_plus = [[@maxsp_plus, -MAXSP_LIMIT].max, MAXSP_LIMIT].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# ● 设置力量
# str : 新的力量
#--------------------------------------------------------------------------
def str=(str)
@str_plus += str - self.str
@str_plus = [[@str_plus, -STR_LIMIT].max, STR_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 设置灵巧
# dex : 新的灵巧
#--------------------------------------------------------------------------
def dex=(dex)
@dex_plus += dex - self.dex
@dex_plus = [[@dex_plus, -DEX_LIMIT].max, DEX_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 设置速度
# agi : 新的速度
#--------------------------------------------------------------------------
def agi=(agi)
@agi_plus += agi - self.agi
@agi_plus = [[@agi_plus, -AGI_LIMIT].max, AGI_LIMIT].min
end
#--------------------------------------------------------------------------
# ● 设置魔力
# int : 新的魔力
#--------------------------------------------------------------------------
def int=(int)
@int_plus += int - self.int
@int_plus = [[@int_plus, -INT_LIMIT].max, INT_LIMIT].min
end
end