diff --git a/Mage/src/main/java/mage/target/targetadjustment/ConditionalTargetAdjuster.java b/Mage/src/main/java/mage/target/targetadjustment/ConditionalTargetAdjuster.java index 964ffbe87b9..7ba63269602 100644 --- a/Mage/src/main/java/mage/target/targetadjustment/ConditionalTargetAdjuster.java +++ b/Mage/src/main/java/mage/target/targetadjustment/ConditionalTargetAdjuster.java @@ -11,7 +11,7 @@ import mage.target.Targets; */ public class ConditionalTargetAdjuster implements TargetAdjuster { private final Condition condition; - private final boolean keepOldTargets; + private final boolean keepExistingTargets; private final Targets replacementTargets; /** @@ -21,37 +21,26 @@ public class ConditionalTargetAdjuster implements TargetAdjuster { * @param replacementTarget The target to use if the condition is true. */ public ConditionalTargetAdjuster(Condition condition, Target replacementTarget) { - this(condition, false, new Targets(replacementTarget)); - } - - /** - * If the condition is true, change the target list - * - * @param condition The condition to be checked - * @param keepOldTargets Add to the targets list instead of replacing it entirely - * @param replacementTarget The target to use if the condition is true. Can also take a Targets list - */ - public ConditionalTargetAdjuster(Condition condition, boolean keepOldTargets, Target replacementTarget) { - this(condition, keepOldTargets, new Targets(replacementTarget)); + this(condition, false, replacementTarget); } /** * If the condition is true, change the target list with multiple targets at once * - * @param condition The condition to be checked - * @param keepOldTargets Add to the targets list instead of replacing it entirely - * @param replacementTargets The targets list to use if the condition is true. + * @param condition The condition to be checked + * @param keepExistingTargets if true, don't clear existing targets when adding the new ones + * @param replacementTargets Targets to be added if the condition is true */ - public ConditionalTargetAdjuster(Condition condition, boolean keepOldTargets, Targets replacementTargets) { + public ConditionalTargetAdjuster(Condition condition, boolean keepExistingTargets, Target... replacementTargets) { this.condition = condition; - this.keepOldTargets = keepOldTargets; - this.replacementTargets = replacementTargets; + this.keepExistingTargets = keepExistingTargets; + this.replacementTargets = new Targets(replacementTargets); } @Override public void adjustTargets(Ability ability, Game game) { if (condition.apply(game, ability)) { - if (!keepOldTargets) { + if (!keepExistingTargets) { ability.getTargets().clear(); } for (Target target : replacementTargets) {