我做过这个想法 我的做法就是给角色定义一个属性,然后在战斗中获得经验的时候加上这个属性
不知道这样是否是你想要的
class Game_Actor < Game_Battler attr_accessor :mexp alias mohuaiyuan20161223_setup setup def setup(actor_id) mohuaiyuan20161223_setup(actor_id) @mexp_z = 0 end def mexp # 经验提升 @mexp_z = [[@mexp_z, 0].max,99999999].min n = @mexp_z #当角色装备1号防具的时候 经验增益1000点! if self.armor1_id ==1 n+=1000 end return [[n, 0].max,99999999].min end def mexp=(mexp) @mexp_z += mexp - self.mexp @mexp_z = [[@mexp_z, 0].max,99999999].min end end
class Game_Actor < Game_Battler
attr_accessor :mexp
alias mohuaiyuan20161223_setup setup
def setup(actor_id)
mohuaiyuan20161223_setup(actor_id)
@mexp_z = 0
end
def mexp # 经验提升
@mexp_z = [[@mexp_z, 0].max,99999999].min
n = @mexp_z
#当角色装备1号防具的时候 经验增益1000点!
if self.armor1_id ==1
n+=1000
end
return [[n, 0].max,99999999].min
end
def mexp=(mexp)
@mexp_z += mexp - self.mexp
@mexp_z = [[@mexp_z, 0].max,99999999].min
end
end
然后找到 Scene_Battle 2 获得 EXP那一行
把下面改一改
for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false last_level = actor.level ########################## actor.exp += exp+actor.mexp ########################## if actor.level > last_level @status_window.level_up(i) end end
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
##########################
actor.exp += exp+actor.mexp
##########################
if actor.level > last_level
@status_window.level_up(i)
end
end
|