| 赞 | 72 |
| VIP | |
| 好人卡 | |
| 积分 | 23 |
| 经验 | |
| 最后登录 | 2022-3-9 |
| 在线时间 | 4033 小时 |
…あたしは天
- 梦石
- 0
- 星屑
- 2308
- 在线时间
- 4033 小时
- 注册时间
- 2010-10-4
- 回帖
- 10548
 
|
发表于 2015-10-13 20:23:09
|
显示全部楼层
本帖最后由 taroxd 于 2015-10-13 21:40 编辑
以下脚本未测试。
而且我先说一声,闪避和没打中是两回事。这个脚本不考虑没打中的可能性,毕竟人家本来打歪了,你去保护了也一样是打歪了对吧?
[pre lang="ruby"]
class Scene_Battle
# alias_method :as_20151013, :apply_substitute
def apply_substitute(target, item)
if check_substitute(target, item)
substitute = target.friends_unit.substitute_battler
if substitute && target != substitute && rand < 0.5 # 保护弱者的概率(用0~1的小数表示)
@log_window.display_substitute(substitute, target)
substitute.substitute_flag = true
return substitute
end
end
target
end
alias_method :aie_20151013, :apply_item_effects
def apply_item_effects(target, item)
aie_20151013(target, item)
target.substitute_flag = false
end
end
class Game_BattlerBase
attr_accessor :substitute_flag
alias_method :eva_20151013, :eva
def eva
substitute_flag ? 0.0 : eva_20151013
end
end[/pre] |
|