fixed synodArtificer

This commit is contained in:
drmDev 2016-03-22 09:21:44 -04:00
parent 9f3f277adb
commit 0e000267b5

View file

@ -52,6 +52,8 @@ import mage.target.TargetPermanent;
*/ */
public class SynodArtificer extends CardImpl { public class SynodArtificer extends CardImpl {
private final UUID tapId;
private final UUID untapId;
private static final FilterPermanent filter = new FilterPermanent("Target noncreature artifacts"); private static final FilterPermanent filter = new FilterPermanent("Target noncreature artifacts");
static { static {
@ -71,20 +73,23 @@ public class SynodArtificer extends CardImpl {
Effect tapEffect = new TapTargetEffect(); Effect tapEffect = new TapTargetEffect();
tapEffect.setText("Tap X target noncreature artifacts."); tapEffect.setText("Tap X target noncreature artifacts.");
Ability tapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, tapEffect, new ManaCostsImpl("{X}")); Ability tapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, tapEffect, new ManaCostsImpl("{X}"));
tapAbility.addCost(new TapSourceCost()); tapAbility.addCost(new TapSourceCost());
this.addAbility(tapAbility); this.addAbility(tapAbility);
// {X}, {tap}: Untap X target noncreature artifacts. // {X}, {tap}: Untap X target noncreature artifacts.
Effect untapEffect = new UntapTargetEffect(); Effect untapEffect = new UntapTargetEffect();
untapEffect.setText("Untap X target noncreature artifacts."); untapEffect.setText("Untap X target noncreature artifacts.");
Ability untapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, untapEffect, new ManaCostsImpl("{X}")); Ability untapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, untapEffect, new ManaCostsImpl("{X}"));
untapAbility.addCost(new TapSourceCost()); untapAbility.addCost(new TapSourceCost());
this.addAbility(untapAbility); this.addAbility(untapAbility);
tapId = tapAbility.getOriginalId();
untapId = untapAbility.getOriginalId();
} }
@Override @Override
public void adjustTargets(Ability ability, Game game) { public void adjustTargets(Ability ability, Game game) {
if (ability instanceof SimpleActivatedAbility) { if (ability.getOriginalId().equals(tapId) || ability.getOriginalId().equals(untapId)) {
ability.getTargets().clear(); ability.getTargets().clear();
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter)); ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter));
} }
@ -92,6 +97,8 @@ public class SynodArtificer extends CardImpl {
public SynodArtificer(final SynodArtificer card) { public SynodArtificer(final SynodArtificer card) {
super(card); super(card);
this.tapId = card.tapId;
this.untapId = card.untapId;
} }
@Override @Override