From a61d67b9c237f1d208f591d210c071963990bb8a Mon Sep 17 00:00:00 2001 From: fireshoes Date: Thu, 10 Sep 2015 00:36:47 -0500 Subject: [PATCH] [BFZ] Fixed Ulamog's Nullifier countering spells if controller chose to move cards from exile to graveyard, but opponent didn't have cards in exile. --- .../src/mage/sets/battleforzendikar/UlamogsNullifier.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java index 4735a69964..2f5fb4fea5 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java @@ -33,7 +33,6 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.keyword.DevoidAbility; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlyingAbility; @@ -48,6 +47,7 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.other.OwnerPredicate; import mage.game.Game; +import mage.game.stack.Spell; import mage.players.Player; import mage.target.Target; import mage.target.TargetSpell; @@ -81,7 +81,6 @@ public class UlamogsNullifier extends CardImpl { Effect effect = new UlamogsNullifierEffect(); effect.setText("you may put two cards your opponents own from exile into their owners' graveyards. If you do, "); Ability ability = new EntersBattlefieldTriggeredAbility(effect, true); - ability.addEffect(new CounterTargetEffect()); ability.addTarget(new TargetSpell()); this.addAbility(ability); } @@ -121,12 +120,14 @@ class UlamogsNullifierEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + Spell spell = game.getStack().getSpell(source.getFirstTarget()); + if (controller != null && spell != null) { Target target = new TargetCardInExile(2, 2, filter, null); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { if (controller.chooseTarget(outcome, target, source, game)) { Cards cardsToGraveyard = new CardsImpl(target.getTargets()); controller.moveCards(cardsToGraveyard, null, Zone.GRAVEYARD, source, game); + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); return true; } }