本帖最后由 taroxd 于 2015-10-13 21:40 编辑
以下脚本未测试。
而且我先说一声,闪避和没打中是两回事。这个脚本不考虑没打中的可能性,毕竟人家本来打歪了,你去保护了也一样是打歪了对吧?
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
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
|