From dd403d2c55ec65a3d70bb2dcba81660dc694a203 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 6 Feb 2013 17:15:25 +0100 Subject: [PATCH] Added applier parameter to CopyPermanentEffet(). --- .../effects/common/CopyPermanentEffect.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java b/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java index 8c71224f0a3..a7877a44e11 100644 --- a/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java @@ -37,6 +37,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.TargetPermanent; +import mage.util.functions.ApplyToPermanent; import mage.util.functions.EmptyApplyToPermanent; /** @@ -46,13 +47,23 @@ import mage.util.functions.EmptyApplyToPermanent; public class CopyPermanentEffect extends OneShotEffect { private FilterPermanent filter; + private ApplyToPermanent applier; public CopyPermanentEffect() { this(new FilterCreaturePermanent()); } + public CopyPermanentEffect(ApplyToPermanent applier) { + this(new FilterCreaturePermanent(), applier); + } + public CopyPermanentEffect(FilterPermanent filter) { + this(filter, new EmptyApplyToPermanent()); + } + + public CopyPermanentEffect(FilterPermanent filter, ApplyToPermanent applier) { super(Outcome.Copy); + this.applier = applier; this.filter = filter; this.staticText = "You may have {this} enter the battlefield as a copy of any " + filter.getMessage() + " on the battlefield"; } @@ -60,6 +71,7 @@ public class CopyPermanentEffect extends OneShotEffect { public CopyPermanentEffect(final CopyPermanentEffect effect) { super(effect); this.filter = effect.filter.copy(); + this.applier = effect.applier; } @Override @@ -72,7 +84,7 @@ public class CopyPermanentEffect extends OneShotEffect { player.choose(Outcome.Copy, target, source.getSourceId(), game); Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); if (copyFromPermanent != null) { - game.copyPermanent(copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent()); + game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier); return true; } @@ -85,5 +97,4 @@ public class CopyPermanentEffect extends OneShotEffect { public CopyPermanentEffect copy() { return new CopyPermanentEffect(this); } - -} \ No newline at end of file +}