From ee02b47d54e5f3d9aac23180026275c535497620 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 4 Jun 2013 17:12:30 +0200 Subject: [PATCH] Some minor changes to framework functions. --- .../effects/common/DestroyTargetEffect.java | 3 ++- .../ReturnFromGraveyardToHandTargetEffect.java | 3 +++ .../common/TargetCardInOpponentsGraveyard.java | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java index 5767b376bc..0ea96b7ade 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java @@ -37,6 +37,7 @@ import mage.game.permanent.Permanent; import mage.target.Target; import java.util.UUID; +import mage.target.targetpointer.FirstTargetPointer; /** * @@ -73,7 +74,7 @@ public class DestroyTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int affectedTargets = 0; - if (source.getTargets().size() > 1) { // for Rain of Thorns + if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // for Rain of Thorns for (Target target : source.getTargets()) { for (UUID permanentId : target.getTargets()) { Permanent permanent = game.getPermanent(permanentId); diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java index 7543f8a0e5..78a5002a8a 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java @@ -71,6 +71,9 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect { + protected boolean allFromOneOpponent; + public TargetCardInOpponentsGraveyard(FilterCard filter) { - this(1, 1, filter); + this(1, 1, filter, false); } public TargetCardInOpponentsGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) { + this(minNumTargets, maxNumTargets, filter, false); + } + + public TargetCardInOpponentsGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter, boolean allFromOneOpponent) { super(minNumTargets, maxNumTargets, Constants.Zone.GRAVEYARD, filter); this.targetName = filter.getMessage(); + this.allFromOneOpponent = allFromOneOpponent; } public TargetCardInOpponentsGraveyard(final TargetCardInOpponentsGraveyard target) { super(target); + this.allFromOneOpponent = target.allFromOneOpponent; } @Override @@ -30,6 +38,12 @@ public class TargetCardInOpponentsGraveyard extends TargetCard