diff --git a/Mage/src/main/java/mage/abilities/Ability.java b/Mage/src/main/java/mage/abilities/Ability.java index 82713574f6..9701e1a140 100644 --- a/Mage/src/main/java/mage/abilities/Ability.java +++ b/Mage/src/main/java/mage/abilities/Ability.java @@ -13,7 +13,6 @@ import mage.abilities.effects.Effects; import mage.constants.AbilityType; import mage.constants.AbilityWord; import mage.constants.EffectType; -import mage.constants.TargetAdjustment; import mage.constants.Zone; import mage.game.Controllable; import mage.game.Game; @@ -532,8 +531,4 @@ public interface Ability extends Controllable, Serializable { 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 5c0d404307..4d189d54a8 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -72,7 +72,6 @@ public abstract class AbilityImpl implements Ability { protected List watchers = new ArrayList<>(); protected List subAbilities = null; protected boolean canFizzle = true; - protected TargetAdjustment targetAdjustment = TargetAdjustment.NONE; protected TargetAdjuster targetAdjuster = null; public AbilityImpl(AbilityType abilityType, Zone zone) { @@ -120,7 +119,7 @@ public abstract class AbilityImpl implements Ability { this.sourceObject = ability.sourceObject; this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter; this.canFizzle = ability.canFizzle; - this.targetAdjustment = ability.targetAdjustment; + this.targetAdjuster = ability.targetAdjuster; } @Override @@ -1225,23 +1224,13 @@ public abstract class AbilityImpl implements Ability { this.canFizzle = canFizzle; } - @Override - public void setTargetAdjustment(TargetAdjustment targetAdjustment) { - this.targetAdjustment = targetAdjustment; - } - - @Override - public TargetAdjustment getTargetAdjustment() { - return targetAdjustment; - } - @Override public void setTargetAdjuster(TargetAdjuster targetAdjuster) { this.targetAdjuster = targetAdjuster; } @Override - public TargetAdjustment getTargetAdjuster() { + public TargetAdjuster getTargetAdjuster() { return targetAdjuster; } diff --git a/Mage/src/main/java/mage/constants/TargetAdjustment.java b/Mage/src/main/java/mage/constants/TargetAdjustment.java deleted file mode 100644 index 675b2fed05..0000000000 --- a/Mage/src/main/java/mage/constants/TargetAdjustment.java +++ /dev/null @@ -1,20 +0,0 @@ -package mage.constants; - -/** - * - * @author TheElk801 - */ -public enum TargetAdjustment { - NONE, - X_TARGETS, - X_CMC_EQUAL_PERM, - X_CMC_EQUAL_GY_CARD, - X_POWER_LEQ, - CHOSEN_NAME, - CHOSEN_COLOR, - VERSE_COUNTER_TARGETS, - TREASURE_COUNTER_POWER, - SIMIC_MANIPULATOR, - CREATURE_POWER_X_OR_LESS, - X_CMC_EQUAL_SPELL_CONTROLLED -} diff --git a/Mage/src/main/java/mage/game/stack/StackAbility.java b/Mage/src/main/java/mage/game/stack/StackAbility.java index a9d8707f09..b86a225972 100644 --- a/Mage/src/main/java/mage/game/stack/StackAbility.java +++ b/Mage/src/main/java/mage/game/stack/StackAbility.java @@ -1,4 +1,3 @@ - package mage.game.stack; import java.util.ArrayList; @@ -28,6 +27,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.util.GameLog; import mage.util.SubTypeList; import mage.watchers.Watcher; @@ -49,7 +49,7 @@ public class StackAbility extends StackObjImpl implements Ability { private UUID controllerId; private String name; private String expansionSetCode; - private TargetAdjustment targetAdjustment = TargetAdjustment.NONE; + private TargetAdjuster targetAdjuster = null; public StackAbility(Ability ability, UUID controllerId) { this.ability = ability; @@ -62,7 +62,7 @@ public class StackAbility extends StackObjImpl implements Ability { this.controllerId = stackAbility.controllerId; this.name = stackAbility.name; this.expansionSetCode = stackAbility.expansionSetCode; - this.targetAdjustment = stackAbility.targetAdjustment; + this.targetAdjuster = stackAbility.targetAdjuster; this.targetChanged = stackAbility.targetChanged; } @@ -596,12 +596,17 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void setTargetAdjustment(TargetAdjustment targetAdjustment) { - this.targetAdjustment = targetAdjustment; + public void setTargetAdjuster(TargetAdjuster targetAdjuster) { + this.targetAdjuster = targetAdjuster; } @Override - public TargetAdjustment getTargetAdjustment() { - return targetAdjustment; + public TargetAdjuster getTargetAdjuster() { + return targetAdjuster; + } + + @Override + public void adjustTargets(Game game) { + this.targetAdjuster.adjustTargets(this, game); } }