| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2020-5-5 |
| 在线时间 | 357 小时 |
- 梦石
- 0
- 星屑
- 90
- 在线时间
- 357 小时
- 注册时间
- 2006-3-3
- 回帖
- 163
|
发表于 2015-4-27 14:02:37
|
显示全部楼层
- =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
复制代码
原帖:
https://rpg.blue/forum.php?mod=viewthread&tid=107835 |
|