=begin
在可以升级的技能的备注栏里写上
下等级技能编号
升级经验
每次增加经验
例
下等级技能编号2
升级经验10
每次增加经验2
=end
class Game_Actor
MULTISKILLS = true#true时可以同时学会高等级技能和低等级技能,
#false时候学会高等级技能后会遗忘低等级技能
alias supersetup setup
def setup(*args)
supersetup(*args)
@skillexp = {}
end
def addskillexp
return unless @action.skill.updatable?
@skillexp[@action.skill.id] = 0 if @skillexp[@action.skill.id].nil?
@skillexp[@action.skill.id] += @action.skill.eachexp
if @skillexp[@action.skill.id] >= @action.skill.maxexp
return if @skills.include?(@action.skill.nextskillid)
learn_skill(@action.skill.nextskillid)
forget_skill(@action.skill.id) unless MULTISKILLS
$game_message.new_page
text = "技能" + @action.skill.name + "升级"
$game_message.texts.push(text)
text = "学会" + $data_skills[@action.skill.nextskillid].name
$game_message.texts.push(text)
end
end
end
class Game_Enemy
def addskillexp
end
end
module RPG
class Skill
def updatable?
@note =~ /下等级技能编号(\d+)/
return !$1.nil?
end
def nextskillid
@note =~ /下等级技能编号(\d+)/
return $1.to_i
end
def maxexp
@note =~ /升级经验(\d+)/
return $1.to_i
end
def eachexp
@note =~ /每次增加经验(\d+)/
return $1.to_i
end
end
end
class Scene_Battle
alias superexecute_action_skill execute_action_skill
def execute_action_skill
superexecute_action_skill
@active_battler.addskillexp
end
end