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