Project1
标题: 关于分段等级上限脚本/与加点脚本的问题 [打印本页]
作者: fjjghj1 时间: 2015-9-12 19:29
标题: 关于分段等级上限脚本/与加点脚本的问题
本帖最后由 fjjghj1 于 2015-9-12 20:30 编辑
用了以下的脚本,发现角色到达120级后 确实经验变成了----------,可是 一旦用事件增加角色经验以及打怪,还是会继续提升等级呢(用事件的等级提升是正常的,不会提升等级)。 请问该如何修改成用事件增加经验以及战斗获得的经验(在角色到达一阶段/二阶段/三阶段的等级上限后不会获得或着为0呢?就是不管获得多少经验都不会升级饿,,请原谅我的叙述有问题,感谢各位大大!
# 突破等级、能力上限
# 等级可无限提升
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 == 999
return "--------"
else
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "--------"
end
end
def new_final_level
def new_final_level
lv = BASE_FINAL_LEVEL
case self.lvv
when 0
lv = 120
when 1
lv = 300
when 2
lv = 500
when 3
lv = 1000
end
return lv
end
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(BASE_FINAL_LEVEL + 2)
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..BASE_FINAL_LEVEL + 1
if i > BASE_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 lvv=(lvv)
# 防止出现负数
@lvv = [lvv, 0].max
# 防止转生超过最大等级
self.level = new_final_level if @level > new_final_level
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
# 突破等级、能力上限
# 等级可无限提升
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 == 999
return "--------"
else
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "--------"
end
end
def new_final_level
def new_final_level
lv = BASE_FINAL_LEVEL
case self.lvv
when 0
lv = 120
when 1
lv = 300
when 2
lv = 500
when 3
lv = 1000
end
return lv
end
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(BASE_FINAL_LEVEL + 2)
@exp_list[1] = 0
pow_i = 2.4 + actor.exp_inflation / 100.0
for i in 2..BASE_FINAL_LEVEL + 1
if i > BASE_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 lvv=(lvv)
# 防止出现负数
@lvv = [lvv, 0].max
# 防止转生超过最大等级
self.level = new_final_level if @level > new_final_level
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
作者: fjjghj1 时间: 2015-9-12 20:32
刚才自己试了一下,发现好像等级上线脚本本身没有问题,是因为加点脚本导致的,请问各位大该改哪里呀?谢谢
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
# 脚本使用设定:
LEVEL_UP_POINT = 3 # 每升一级所增加的点数
LEVEL_UP_VARIABLE = 100 # 储存角色点数的变量编号与角色id编号的差值
# 默认情况 = 100,
# 则是数据库里1号角色的加点数存于101号变量
# 3号角色的加点数存于103号变量。
# 你可以直接操作变量赠与角色可分配点数
# 每增加一次点数,各项能力值的变化:357-410行
# 使用方法介绍:
# 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
# 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
# 1-99级全部等于一个相同数值就行了。
# 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
# 默认都是0号
# 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
# 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
# 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 处理角色的类。(再定义)
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 更改 EXP
# exp : 新的 EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [exp, 0].max
# 升级
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# 增加4点可自由分配的点数
if self.id > 30
$game_variables[self.id + LEVEL_UP_VARIABLE] += 5
else
##修改
# 打开开关1,id为3的角色额外获得2点,打开开关2,id为4的角色额外获得2点,以此类推
extra_point = $game_switches[self.id + 1524] ? 2 : 0
$game_variables[self.id + LEVEL_UP_VARIABLE] += (LEVEL_UP_POINT + extra_point)
($db_point[@actor_id])[5] += (LEVEL_UP_POINT + extra_point)#加的1行
end
# 学会特技
for j in $data_classes[@class_id].learnings
if j.level == @level
if @level >= 99
else
learn_skill(j.skill_id)
end
end
end
end
# 降级
while @exp < @exp_list[@level]
# 遗忘特技
for j in $data_classes[@class_id].learnings
if j.level == @level
if @level >= 99
else
forget_skill(j.skill_id)
end
end
end
@level -= 1
end
# 修正当前的 HP 与 SP 超过最大值
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
$game_temp.common_event_id = 178
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类(追加定义)
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘 HP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_hp_lvup(actor, x, y)
self.contents.font.color = Color.new(79,39,0,255)
if $temp_hp == 0
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
else
maxhp = actor.maxhp + $temp_hp.to_i
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
self.contents.font.color = normal_color
# self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
if $temp_hp >=0
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " +",2)
else
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " -",2)
end
# self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
end
end
#--------------------------------------------------------------------------
# ● 描绘 SP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_sp_lvup(actor, x, y)
self.contents.font.color = Color.new(79,39,0,255)
if $temp_sp == 0
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
else
maxsp = actor.maxsp + $temp_sp.to_i
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
self.contents.font.color = normal_color
# self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
if $temp_sp >=0
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " +",2)
else
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " -",2)
end
# self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
end
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~4)
#--------------------------------------------------------------------------
def draw_actor_lvup(actor, x, y, type)
# 定义数字颜色
lvup = Color.new(79,39,0,255)
upcolor = Color.new(0, 255, 0)
downcolor = Color.new(79,39,0,255)
self.contents.font.color = normal_color
case type
when 0
parameter_name = $data_system.words.str
parameter_value = actor.str
parameter_value_temp = parameter_value + $temp_str.to_i
if $temp_str != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_str >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.str
parameter_value = actor.str
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.str
parameter_value = actor.str
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 1
parameter_name = $data_system.words.dex
parameter_value = actor.dex
parameter_value_temp = parameter_value + $temp_dex.to_i
if $temp_dex != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_dex >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.dex
parameter_value = actor.dex
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.dex
parameter_value = actor.dex
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 2
parameter_name = $data_system.words.agi
parameter_value = actor.agi
parameter_value_temp = parameter_value + $temp_agi.to_i
if $temp_agi != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_agi >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.agi
parameter_value = actor.agi
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.agi
parameter_value = actor.agi
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 3
parameter_name = $data_system.words.int
parameter_value = actor.int
parameter_value_temp = parameter_value + $temp_int.to_i
if $temp_int != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_int >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.int
parameter_value = actor.int
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.int
parameter_value = actor.int
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 4
parameter_name = ""
parameter_value = $point
if $point != 0
lvup = upcolor
end
end
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x + 450, y, 36, 32, parameter_value.to_s)
if type != 4
self.contents.draw_text(x + 480, y, 36, 32, " →")
end
self.contents.font.color = lvup
self.contents.draw_text(x + 510, y, 60, 32, parameter_value_temp.to_s)
self.contents.font.color = Color.new(79,39,0,255)
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
# 脚本使用设定:
LEVEL_UP_POINT = 3 # 每升一级所增加的点数
LEVEL_UP_VARIABLE = 100 # 储存角色点数的变量编号与角色id编号的差值
# 默认情况 = 100,
# 则是数据库里1号角色的加点数存于101号变量
# 3号角色的加点数存于103号变量。
# 你可以直接操作变量赠与角色可分配点数
# 每增加一次点数,各项能力值的变化:357-410行
# 使用方法介绍:
# 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
# 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
# 1-99级全部等于一个相同数值就行了。
# 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
# 默认都是0号
# 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
# 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
# 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 处理角色的类。(再定义)
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 更改 EXP
# exp : 新的 EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [exp, 0].max
# 升级
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# 增加4点可自由分配的点数
if self.id > 30
$game_variables[self.id + LEVEL_UP_VARIABLE] += 5
else
##修改
# 打开开关1,id为3的角色额外获得2点,打开开关2,id为4的角色额外获得2点,以此类推
extra_point = $game_switches[self.id + 1524] ? 2 : 0
$game_variables[self.id + LEVEL_UP_VARIABLE] += (LEVEL_UP_POINT + extra_point)
($db_point[@actor_id])[5] += (LEVEL_UP_POINT + extra_point)#加的1行
end
# 学会特技
for j in $data_classes[@class_id].learnings
if j.level == @level
if @level >= 99
else
learn_skill(j.skill_id)
end
end
end
end
# 降级
while @exp < @exp_list[@level]
# 遗忘特技
for j in $data_classes[@class_id].learnings
if j.level == @level
if @level >= 99
else
forget_skill(j.skill_id)
end
end
end
@level -= 1
end
# 修正当前的 HP 与 SP 超过最大值
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
$game_temp.common_event_id = 178
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类(追加定义)
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘 HP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_hp_lvup(actor, x, y)
self.contents.font.color = Color.new(79,39,0,255)
if $temp_hp == 0
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
else
maxhp = actor.maxhp + $temp_hp.to_i
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
self.contents.font.color = normal_color
# self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
if $temp_hp >=0
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " +",2)
else
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " -",2)
end
# self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
end
end
#--------------------------------------------------------------------------
# ● 描绘 SP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_sp_lvup(actor, x, y)
self.contents.font.color = Color.new(79,39,0,255)
if $temp_sp == 0
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
else
maxsp = actor.maxsp + $temp_sp.to_i
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
self.contents.font.color = normal_color
# self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
if $temp_sp >=0
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " +",2)
else
self.contents.font.color = Color.new(0, 255, 0)
self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
# self.contents.draw_text(x + 155, y, 36, 32, " -",2)
end
# self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
self.contents.font.color = Color.new(79,39,0,255)
# self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
end
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~4)
#--------------------------------------------------------------------------
def draw_actor_lvup(actor, x, y, type)
# 定义数字颜色
lvup = Color.new(79,39,0,255)
upcolor = Color.new(0, 255, 0)
downcolor = Color.new(79,39,0,255)
self.contents.font.color = normal_color
case type
when 0
parameter_name = $data_system.words.str
parameter_value = actor.str
parameter_value_temp = parameter_value + $temp_str.to_i
if $temp_str != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_str >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.str
parameter_value = actor.str
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.str
parameter_value = actor.str
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 1
parameter_name = $data_system.words.dex
parameter_value = actor.dex
parameter_value_temp = parameter_value + $temp_dex.to_i
if $temp_dex != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_dex >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.dex
parameter_value = actor.dex
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.dex
parameter_value = actor.dex
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 2
parameter_name = $data_system.words.agi
parameter_value = actor.agi
parameter_value_temp = parameter_value + $temp_agi.to_i
if $temp_agi != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_agi >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.agi
parameter_value = actor.agi
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.agi
parameter_value = actor.agi
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 3
parameter_name = $data_system.words.int
parameter_value = actor.int
parameter_value_temp = parameter_value + $temp_int.to_i
if $temp_int != 0
# lvup = upcolor
# self.contents.draw_text(x + 256, y, 16, 32, "(")
if $temp_int >= 0
lvup = upcolor
self.contents.font.color = lvup
parameter_name = $data_system.words.int
parameter_value = actor.int
# self.contents.draw_text(x + 272, y, 80, 32, "+",0)
else
lvup = downcolor
self.contents.font.color = lvup#Color.new(255,255,0,255)
parameter_name = $data_system.words.int
parameter_value = actor.int
# self.contents.draw_text(x + 272, y, 80, 32, "-",0)
end
# self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
self.contents.font.color = Color.new(255, 0, 0)
# self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
end
when 4
parameter_name = ""
parameter_value = $point
if $point != 0
lvup = upcolor
end
end
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = Color.new(79,39,0,255)
self.contents.draw_text(x + 450, y, 36, 32, parameter_value.to_s)
if type != 4
self.contents.draw_text(x + 480, y, 36, 32, " →")
end
self.contents.font.color = lvup
self.contents.draw_text(x + 510, y, 60, 32, parameter_value_temp.to_s)
self.contents.font.color = Color.new(79,39,0,255)
end
end
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |