diff --git a/Mage/src/main/java/mage/abilities/Ability.java b/Mage/src/main/java/mage/abilities/Ability.java index 2f5324f120..82713574f6 100644 --- a/Mage/src/main/java/mage/abilities/Ability.java +++ b/Mage/src/main/java/mage/abilities/Ability.java @@ -1,4 +1,3 @@ - package mage.abilities; import java.io.Serializable; @@ -23,6 +22,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.Targets; +import mage.target.targetadjustment.TargetAdjuster; import mage.watchers.Watcher; /** @@ -527,6 +527,12 @@ public interface Ability extends Controllable, Serializable { boolean canFizzle(); + void setTargetAdjuster(TargetAdjuster targetAdjuster); + + TargetAdjuster getTargetAdjuster(); + + void adjustTargets(Game game); + void setTargetAdjustment(TargetAdjustment targetAdjustment); TargetAdjustment getTargetAdjustment(); diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index 800b1242a3..5c0d404307 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -1,4 +1,3 @@ - package mage.abilities; import java.util.ArrayList; @@ -33,6 +32,7 @@ import mage.game.stack.StackAbility; import mage.players.Player; import mage.target.Target; import mage.target.Targets; +import mage.target.targetadjustment.TargetAdjuster; import mage.util.GameLog; import mage.util.ThreadLocalStringBuilder; import mage.watchers.Watcher; @@ -73,6 +73,7 @@ public abstract class AbilityImpl implements Ability { protected List subAbilities = null; protected boolean canFizzle = true; protected TargetAdjustment targetAdjustment = TargetAdjustment.NONE; + protected TargetAdjuster targetAdjuster = null; public AbilityImpl(AbilityType abilityType, Zone zone) { this.id = UUID.randomUUID(); @@ -1233,4 +1234,19 @@ public abstract class AbilityImpl implements Ability { public TargetAdjustment getTargetAdjustment() { return targetAdjustment; } + + @Override + public void setTargetAdjuster(TargetAdjuster targetAdjuster) { + this.targetAdjuster = targetAdjuster; + } + + @Override + public TargetAdjustment getTargetAdjuster() { + return targetAdjuster; + } + + @Override + public void adjustTargets(Game game) { + this.targetAdjuster.adjustTargets(this, game); + } } diff --git a/Mage/src/main/java/mage/target/targetadjustment/TargetAdjuster.java b/Mage/src/main/java/mage/target/targetadjustment/TargetAdjuster.java index 560dfb097d..5d6491b96c 100644 --- a/Mage/src/main/java/mage/target/targetadjustment/TargetAdjuster.java +++ b/Mage/src/main/java/mage/target/targetadjustment/TargetAdjuster.java @@ -1,5 +1,8 @@ package mage.target.targetadjustment; +import mage.abilities.Ability; +import mage.game.Game; + /** * * @author TheElk801