diff --git a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java index dd0780e0f4..d79b0309fa 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java +++ b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java @@ -163,16 +163,18 @@ class NecroticPlagueEffect2 extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { TargetCreaturePermanent target = new TargetCreaturePermanent(filter); - if (controller.choose(Outcome.Detriment, target, game)) { - Card card = game.getCard(cardId); - if (card != null) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); - Permanent permanent = game.getPermanent(target.getFirstTarget()); - if (permanent != null) { - return permanent.addAttachment(cardId, game); - } - } - } + if (target.canChoose(source.getControllerId(), game)) { + if (controller.choose(Outcome.Detriment, target, game)) { + Card card = game.getCard(cardId); + if (card != null) { + card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + return permanent.addAttachment(cardId, game); + } + } + } + } } return false; } diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index 46331b4971..681cc50e3d 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -45,6 +45,8 @@ import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.players.Player; +import javax.swing.*; + /** * * @author BetaSteward_at_googlemail.com @@ -118,16 +120,19 @@ public class PermanentCard extends PermanentImpl { // we only want to trigger abilities that are not on the underlying card ie. have been added by another effect // or we want to trigger abilities that only trigger on leaving the battlefield // card abilities will get triggered later when the card hits the new zone - Card card = game.getCard(objectId).copy(); + List triggered = new ArrayList(); + Card card = game.getCard(objectId).copy(); for (TriggeredAbility ability: abilities.getTriggeredAbilities(event.getFromZone())) { if (!card.getAbilities().containsKey(ability.getId())) { if (ability.checkTrigger(event, game)) { + triggered.add(ability.getId()); ability.trigger(game, controllerId); } } else if (ability instanceof ZoneChangeTriggeredAbility && event.getFromZone() == Zone.BATTLEFIELD) { ZoneChangeTriggeredAbility zcAbility = (ZoneChangeTriggeredAbility)ability; if (zcAbility.getToZone() == null) { if (ability.checkTrigger(event, game)) { + triggered.add(ability.getId()); ability.trigger(game, controllerId); } } @@ -135,7 +140,7 @@ public class PermanentCard extends PermanentImpl { } for (TriggeredAbility ability: abilities.getTriggeredAbilities(event.getToZone())) { if (!card.getAbilities().containsKey(ability.getId())) { - if (ability.checkTrigger(event, game)) { + if (!triggered.contains(ability.getId()) && ability.checkTrigger(event, game)) { ability.trigger(game, controllerId); } }