| 
UID632帖子1756主题48精华1积分2733历练1 声望6 人气250 经验2568 金钱1265 注册时间2010-7-25最后登录2021-5-5在线时间305 小时阅读权限60
 
 
 TA的每日心情|  | 怒 2015-6-15 20:14
 | 
|---|
 签到天数: 105 天 [LV.6]常住仙友II 精华1积分2733历练1 声望6 人气250 
 | 
| =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
 | 
 |