| 赞 | 95 |
| VIP | |
| 好人卡 | |
| 积分 | 69 |
| 经验 | |
| 最后登录 | 2025-2-12 |
| 在线时间 | 7027 小时 |
- 梦石
- 0
- 星屑
- 6891
- 在线时间
- 7027 小时
- 注册时间
- 2013-11-2
- 回帖
- 1263
 
|
发表于 2016-11-20 09:45:33
|
显示全部楼层
[pre lang="ruby"]
class Scene_Battle < Scene_Base
def use_item
item = @subject.current_action.item
@log_window.display_use_item(@subject, item)
@subject.use_item(item)
refresh_status
targets = @subject.current_action.make_targets.compact
if item.is_a?(RPG::Skill) && [5,6,7,8].include?(item.id) #技能,ID:5,6,7,8
targets.each {|target| item.repeats.times { invoke_item(target, item) } }
show_animation(targets, item.animation_id)
else
show_animation(targets, item.animation_id)
targets.each {|target| item.repeats.times { invoke_item(target, item) } }
end
end
end
[/pre]
使用此插件脚本,并更改技能ID。如果要物品或者物品和技能都有的话请注明。
此脚本的原理是在Scene_Battle(战斗场景)的use_item(使用物品)方法(就是掌控执行使用效果和播放动画的地方)内增加判定,让某些技能的播放动画/技能效果执行顺序反过来。
if item.is_a?(RPG::Skill)是判定使用的是否技能。如果是物品的话,要放RPG::Item。&& 是“和”的符号,而 [1,2,3,4].include?(item.id) 是如果数组 [1,2,3,4] 里面包含技能/物品的ID的话,判定就成功。
|
|