replaced x targets adjustment

This commit is contained in:
Evan Kranzler 2018-09-17 13:26:48 -04:00
parent 7305fbac3a
commit 0d3c068f50
9 changed files with 37 additions and 28 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -14,12 +13,12 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.common.TargetCardInHand;
import mage.target.targetadjustment.XTargetsAdjuster;
/**
*
@ -40,7 +39,7 @@ public final class AlexiZephyrMage extends CardImpl {
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards"))));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURES));
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
ability.setTargetAdjuster(XTargetsAdjuster.instance);
this.addAbility(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.c;
import java.util.UUID;
@ -11,10 +10,10 @@ import mage.abilities.effects.common.UntapTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.XTargetsAdjuster;
/**
*
@ -31,7 +30,7 @@ public final class CandelabraOfTawnos extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
ability.setTargetAdjuster(XTargetsAdjuster.instance);
this.addAbility(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.d;
import java.util.UUID;
@ -17,12 +16,12 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetAdjustment;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.XTargetsAdjuster;
import mage.target.targetpointer.FixedTarget;
/**
@ -44,7 +43,7 @@ public final class DeepwoodElder extends CardImpl {
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
ability.setTargetAdjuster(XTargetsAdjuster.instance);
this.addAbility(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.m;
import java.util.UUID;
@ -13,10 +12,10 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.XTargetsAdjuster;
/**
* @author duncant
@ -37,7 +36,7 @@ public final class MagusOfTheCandelabra extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
ability.setTargetAdjuster(XTargetsAdjuster.instance);
this.addAbility(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.m;
import java.util.UUID;
@ -11,10 +10,10 @@ import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.XTargetsAdjuster;
/**
*
@ -30,7 +29,7 @@ public final class MishrasHelix extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
ability.setTargetAdjuster(XTargetsAdjuster.instance);
this.addAbility(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -14,11 +13,11 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Duration;
import mage.constants.TargetAdjustment;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.XTargetsAdjuster;
/**
*
@ -48,7 +47,7 @@ public final class RunedArch extends CardImpl {
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetPermanent(filter));
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
ability.setTargetAdjuster(XTargetsAdjuster.instance);
this.addAbility(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.s;
import java.util.UUID;
@ -14,12 +13,12 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.XTargetsAdjuster;
/**
*
@ -46,7 +45,7 @@ public final class SynodArtificer extends CardImpl {
tapEffect.setText("Tap X target noncreature artifacts.");
Ability tapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, tapEffect, new ManaCostsImpl("{X}"));
tapAbility.addCost(new TapSourceCost());
tapAbility.setTargetAdjustment(TargetAdjustment.X_TARGETS);
tapAbility.setTargetAdjuster(XTargetsAdjuster.instance);
tapAbility.addTarget(new TargetPermanent(filter));
this.addAbility(tapAbility);
@ -55,7 +54,7 @@ public final class SynodArtificer extends CardImpl {
untapEffect.setText("Untap X target noncreature artifacts.");
Ability untapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, untapEffect, new ManaCostsImpl("{X}"));
untapAbility.addCost(new TapSourceCost());
untapAbility.setTargetAdjustment(TargetAdjustment.X_TARGETS);
untapAbility.setTargetAdjuster(XTargetsAdjuster.instance);
untapAbility.addTarget(new TargetPermanent(filter));
this.addAbility(untapAbility);
}

View file

@ -361,12 +361,6 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
switch (ability.getTargetAdjustment()) {
case NONE:
break;
case X_TARGETS:
xValue = ability.getManaCostsToPay().getX();
permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(xValue, permanentFilter));
break;
case X_POWER_LEQ:// Minamo Sightbender only
xValue = ability.getManaCostsToPay().getX();
oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0);

View file

@ -0,0 +1,22 @@
package mage.target.targetadjustment;
import mage.abilities.Ability;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
*
* @author TheElk801
*/
public enum XTargetsAdjuster implements TargetAdjuster {
instance;
@Override
public void adjustTargets(Ability ability, Game game) {
int xValue = ability.getManaCostsToPay().getX();
FilterPermanent permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(xValue, permanentFilter));
}
}