cleaned up some cards, tested that the abilities can be copied

This commit is contained in:
Evan Kranzler 2017-09-19 15:40:45 -04:00
parent e2a1fa50ea
commit 79d3bd24d5
17 changed files with 36 additions and 230 deletions

View file

@ -40,12 +40,9 @@ 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.FilterPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.TargetPermanent;
import mage.target.common.TargetCardInHand;
@ -63,7 +60,6 @@ public class AlexiZephyrMage extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
//TODO: Make ability properly copiable
// {X}{U}, {tap}, Discard two cards: Return X target creatures to their owners' hands.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{X}{U}"));
ability.addCost(new TapSourceCost());
@ -72,15 +68,6 @@ public class AlexiZephyrMage extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
// ability.getTargets().clear();
// ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
// }
// }
public AlexiZephyrMage(final AlexiZephyrMage card) {
super(card);
}

View file

@ -51,7 +51,7 @@ import mage.target.TargetPermanent;
*/
public class AncientHellkite extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("creature defending player controlsknlokn");
private static final FilterPermanent filter = new FilterPermanent("creature defending player controls");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
@ -65,11 +65,9 @@ public class AncientHellkite extends CardImpl {
this.power = new MageInt(6);
this.toughness = new MageInt(6);
//TODO: Make ability properly copiable
this.addAbility(FlyingAbility.getInstance());
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}"), SourceAttackingCondition.instance);
ability.addTarget(new TargetPermanent(filter));
// ability.setTargetAdjustment(TargetAdjustment.DEFENDING_PLAYER);
this.addAbility(ability);
}
@ -77,20 +75,6 @@ public class AncientHellkite extends CardImpl {
super(card);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.DEFENDING_PLAYER) {
// TargetPermanent oldTarget = (TargetPermanent) ability.getTargets().get(0);
// int minTargets = oldTarget.getMinNumberOfTargets();
// int maxTargets = oldTarget.getMaxNumberOfTargets();
// FilterPermanent filter2 = oldTarget.getFilter().copy();
// UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
// filter2.add(new ControllerIdPredicate(defenderId));
// ability.getTargets().clear();
// ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, filter2, false));
// }
// }
@Override
public AncientHellkite copy() {
return new AncientHellkite(this);

View file

@ -39,10 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -54,7 +51,6 @@ public class CandelabraOfTawnos extends CardImpl {
public CandelabraOfTawnos(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
//TODO: Make ability properly copiable
// {X}, {T}: Untap X target lands.
Effect effect = new UntapTargetEffect();
effect.setText("untap X target lands");
@ -65,15 +61,6 @@ public class CandelabraOfTawnos extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
// ability.getTargets().clear();
// ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
// }
// }
public CandelabraOfTawnos(final CandelabraOfTawnos card) {
super(card);
}

View file

@ -28,7 +28,6 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -40,8 +39,6 @@ import mage.constants.CardType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.target.TargetSpell;
/**
@ -58,24 +55,11 @@ public class DeclarationOfNaught extends CardImpl {
// As Declaration of Naught enters the battlefield, name a card.
this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL)));
//TODO: Make ability properly copiable
// {U}: Counter target spell with the chosen name.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}"));
ability.setTargetAdjustment(TargetAdjustment.CHOSEN_NAME);
ability.addTarget(new TargetSpell(filter));
this.addAbility(ability);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.CHOSEN_NAME) {
ability.getTargets().clear();
FilterSpell filter2 = new FilterSpell("spell with the chosen name");
filter2.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + NameACardEffect.INFO_KEY)));
TargetSpell target = new TargetSpell(1, filter2);
ability.addTarget(target);
}
}
public DeclarationOfNaught(final DeclarationOfNaught card) {

View file

@ -37,14 +37,11 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ComparisonType;
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.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -66,7 +63,6 @@ public class DeepfireElemental extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(4);
//TODO: Make ability properly copiable
// {X}{X}{1}: Destroy target artifact or creature with converted mana cost X.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}"));
ability.addTarget(new TargetPermanent(filter));
@ -74,17 +70,6 @@ public class DeepfireElemental extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_CMC_EQUAL_PERM) {
// int xValue = ability.getManaCostsToPay().getX();
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter().copy();
// filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
// ability.getTargets().clear();
// ability.getTargets().add(new TargetPermanent(filter2));
// }
// }
public DeepfireElemental(final DeepfireElemental card) {
super(card);
}

View file

@ -37,11 +37,8 @@ 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.FilterPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -53,7 +50,6 @@ public class FloodwaterDam extends CardImpl {
public FloodwaterDam(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
//TODO: Make ability properly copiable
// {X}{X}{1}, {tap}: Tap X target lands.
Effect effect = new TapTargetEffect();
effect.setText("tap X target lands");
@ -63,15 +59,6 @@ public class FloodwaterDam extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
// ability.getTargets().clear();
// ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
// }
// }
public FloodwaterDam(final FloodwaterDam card) {
super(card);
}

View file

@ -39,7 +39,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.TargetAdjustment;
@ -47,10 +46,8 @@ import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInOpponentsGraveyard;
/**
@ -76,27 +73,14 @@ public class GethLordOfTheVault extends CardImpl {
// Intimidate
this.addAbility(IntimidateAbility.getInstance());
//TODO: Make ability properly copiable
// {X}{B}: Put target artifact or creature card with converted mana cost X from an opponent's graveyard onto the battlefield under your control tapped.
// Then that player puts the top X cards of his or her library into his or her graveyard.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}"));
ability.setTargetAdjustment(TargetAdjustment.GETH);
ability.setTargetAdjustment(TargetAdjustment.X_CMC_EQUAL_GY_CARD);
ability.addTarget(new TargetCardInOpponentsGraveyard(filter));
this.addAbility(ability);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.GETH) {
int xValue = ability.getManaCostsToPay().getX();
TargetCard oldTarget = (TargetCard) ability.getTargets().get(0);
FilterCard filter2 = oldTarget.getFilter().copy();
filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
ability.getTargets().clear();
ability.getTargets().add(new TargetCardInOpponentsGraveyard(filter2));
}
}
public GethLordOfTheVault(final GethLordOfTheVault card) {
super(card);
}

View file

@ -37,14 +37,11 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ComparisonType;
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.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -67,7 +64,6 @@ public class GorillaShaman extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
//TODO: Make ability properly copiable
// {X}{X}{1}: Destroy target noncreature artifact with converted mana cost X.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}"));
ability.addTarget(new TargetPermanent(filter));
@ -75,20 +71,6 @@ public class GorillaShaman extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_CMC_EQUAL_PERM) {
// int xValue = ability.getManaCostsToPay().getX();
// TargetPermanent oldTarget = (TargetPermanent) ability.getTargets().get(0);
// int minTargets = oldTarget.getMinNumberOfTargets();
// int maxTargets = oldTarget.getMaxNumberOfTargets();
// FilterPermanent filter2 = oldTarget.getFilter().copy();
// filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
// ability.getTargets().clear();
// ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, filter2, false));
// }
// }
public GorillaShaman(final GorillaShaman card) {
super(card);
}

View file

@ -38,13 +38,10 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ComparisonType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -65,7 +62,6 @@ public class HearthKami extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
//TODO: Make ability properly copiable
// {X}, Sacrifice Hearth Kami: Destroy target artifact with converted mana cost X.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}"));
ability.addCost(new SacrificeSourceCost());
@ -74,17 +70,6 @@ public class HearthKami extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_CMC_EQUAL_PERM) {
// int xValue = ability.getManaCostsToPay().getX();
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter().copy();
// filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
// ability.getTargets().clear();
// ability.getTargets().add(new TargetPermanent(filter2));
// }
// }
public HearthKami(final HearthKami card) {
super(card);
}

View file

@ -40,7 +40,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.TargetAdjustment;
@ -48,7 +47,6 @@ import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -79,7 +77,6 @@ public class LinessaZephyrMage extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
//TODO: Make ability properly copiable
// {X}{U}{U}, {tap}: Return target creature with converted mana cost X to its owner's hand.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{X}{U}{U}"));
ability.addCost(new TapSourceCost());
@ -97,17 +94,6 @@ public class LinessaZephyrMage extends CardImpl {
super(card);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_CMC_EQUAL_PERM) {
// int xValue = ability.getManaCostsToPay().getX();
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter().copy();
// filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
// ability.getTargets().clear();
// ability.getTargets().add(new TargetPermanent(filter2));
// }
// }
@Override
public LinessaZephyrMage copy() {
return new LinessaZephyrMage(this);

View file

@ -41,10 +41,7 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -60,7 +57,6 @@ public class MagusOfTheCandelabra extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(2);
//TODO: Make ability properly copiable
// {X}, {T}: Untap X target lands.
Effect effect = new UntapTargetEffect();
effect.setText("untap X target lands");
@ -71,15 +67,6 @@ public class MagusOfTheCandelabra extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
// ability.getTargets().clear();
// ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
// }
// }
public MagusOfTheCandelabra(final MagusOfTheCandelabra card) {
super(card);
}

View file

@ -38,13 +38,10 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ComparisonType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.target.Target;
import mage.target.TargetPermanent;
@ -68,7 +65,6 @@ public class MinamoSightbender extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(2);
//TODO: Make ability properly copiable
// {X}, {T}: Target creature with power X or less can't be blocked this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new ManaCostsImpl("{X}"));
Target target = new TargetPermanent(filter);
@ -79,20 +75,6 @@ public class MinamoSightbender extends CardImpl {
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_POWER_LEQ) {
// int xValue = ability.getManaCostsToPay().getX();
// TargetPermanent oldTarget = (TargetPermanent) ability.getTargets().get(0);
// int minTargets = oldTarget.getMinNumberOfTargets();
// int maxTargets = oldTarget.getMaxNumberOfTargets();
// FilterPermanent filter2 = oldTarget.getFilter().copy();
// filter2.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
// ability.getTargets().clear();
// ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, filter2, false));
// }
// }
public MinamoSightbender(final MinamoSightbender card) {
super(card);
}

View file

@ -39,9 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetAdjustment;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -53,7 +51,6 @@ public class MishrasHelix extends CardImpl {
public MishrasHelix(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
//TODO: Make ability properly copiable
// {X}, {tap}: Tap X target lands.
Effect effect = new TapTargetEffect("X target lands");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
@ -63,15 +60,6 @@ public class MishrasHelix extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
// ability.getTargets().clear();
// ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
// }
// }
public MishrasHelix(final MishrasHelix card) {
super(card);
}

View file

@ -38,15 +38,12 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ComparisonType;
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.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -68,7 +65,6 @@ public class Plaguebearer extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
//TODO: Make ability properly copiable
// {X}{X}{B}: Destroy target nonblack creature with converted mana cost X.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{B}"));
ability.addTarget(new TargetPermanent(filter));
@ -76,17 +72,6 @@ public class Plaguebearer extends CardImpl {
this.addAbility(ability);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_CMC_EQUAL_PERM) {
// int xValue = ability.getManaCostsToPay().getX();
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter().copy();
// filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
// ability.getTargets().clear();
// ability.getTargets().add(new TargetPermanent(filter2));
// }
// }
public Plaguebearer(final Plaguebearer card) {
super(card);
}

View file

@ -45,7 +45,6 @@ import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.target.TargetPermanent;
/**
@ -68,7 +67,6 @@ public class SynodArtificer extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(2);
//TODO: Make ability properly copiable
// {X}, {tap}: Tap X target noncreature artifacts.
Effect tapEffect = new TapTargetEffect();
tapEffect.setText("Tap X target noncreature artifacts.");
@ -88,15 +86,6 @@ public class SynodArtificer extends CardImpl {
this.addAbility(untapAbility);
}
// @Override
// public void adjustTargets(Ability ability, Game game) {
// if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
// FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
// ability.getTargets().clear();
// ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
// }
// }
public SynodArtificer(final SynodArtificer card) {
super(card);
}

View file

@ -37,13 +37,17 @@ import mage.MageObjectImpl;
import mage.Mana;
import mage.ObjectColor;
import mage.abilities.*;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.cards.repository.PluginClassloaderRegistery;
import mage.constants.*;
import mage.counters.Counter;
import mage.counters.Counters;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.*;
import mage.game.events.GameEvent;
@ -51,7 +55,10 @@ import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.game.stack.StackObject;
import mage.target.TargetCard;
import mage.target.TargetPermanent;
import mage.target.TargetSpell;
import mage.target.common.TargetCardInOpponentsGraveyard;
import mage.util.GameLog;
import mage.util.SubTypeList;
import mage.watchers.Watcher;
@ -328,6 +335,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
public void adjustTargets(Ability ability, Game game) {
int xValue;
TargetPermanent oldTargetPermanent;
FilterPermanent permanentFilter;
int minTargets;
int maxTargets;
switch (ability.getTargetAdjustment()) {
@ -338,26 +346,42 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0);
minTargets = oldTargetPermanent.getMinNumberOfTargets();
maxTargets = oldTargetPermanent.getMaxNumberOfTargets();
FilterPermanent filter2 = oldTargetPermanent.getFilter().copy();
filter2.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
permanentFilter = oldTargetPermanent.getFilter().copy();
permanentFilter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
ability.getTargets().clear();
ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, filter2, false));
ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false));
break;
case X_POWER_LEQ:
case X_POWER_LEQ:// Minamo Sightbender only
xValue = ability.getManaCostsToPay().getX();
oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0);
minTargets = oldTargetPermanent.getMinNumberOfTargets();
maxTargets = oldTargetPermanent.getMaxNumberOfTargets();
filter2 = oldTargetPermanent.getFilter().copy();
filter2.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
permanentFilter = oldTargetPermanent.getFilter().copy();
permanentFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
ability.getTargets().clear();
ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, filter2, false));
ability.getTargets().add(new TargetPermanent(minTargets, maxTargets, permanentFilter, false));
break;
case X_TARGETS:
xValue = ability.getManaCostsToPay().getX();
filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(xValue, filter2));
ability.addTarget(new TargetPermanent(xValue, permanentFilter));
break;
case X_CMC_EQUAL_GY_CARD: //Geth, Lord of the Vault only
xValue = ability.getManaCostsToPay().getX();
TargetCard oldTarget = (TargetCard) ability.getTargets().get(0);
FilterCard filterCard = oldTarget.getFilter().copy();
filterCard.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
ability.getTargets().clear();
ability.getTargets().add(new TargetCardInOpponentsGraveyard(filterCard));
break;
case CHOSEN_NAME: //Declaration of Naught only
ability.getTargets().clear();
FilterSpell filterSpell = new FilterSpell("spell with the chosen name");
filterSpell.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + NameACardEffect.INFO_KEY)));
TargetSpell target = new TargetSpell(1, filterSpell);
ability.addTarget(target);
break;
}
}

View file

@ -6,5 +6,5 @@ package mage.constants;
*/
public enum TargetAdjustment {
NONE, X_TARGETS, X_CMC_EQUAL_PERM, GETH, DEFENDING_PLAYER, X_POWER_LEQ, CHOSEN_NAME
NONE, X_TARGETS, X_CMC_EQUAL_PERM, X_CMC_EQUAL_GY_CARD, X_POWER_LEQ, CHOSEN_NAME
}