From 76390714f57b7a7a4c6d604b7997495c8818c943 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Jul 2017 19:52:56 +0200 Subject: [PATCH] * Duplicant - Fixed that the target creatures attributes were not copied if the target was not exiled (e.g. Commander going to command zone). --- Mage.Sets/src/mage/cards/d/Duplicant.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/Duplicant.java b/Mage.Sets/src/mage/cards/d/Duplicant.java index 60e1118972..096f112bfc 100644 --- a/Mage.Sets/src/mage/cards/d/Duplicant.java +++ b/Mage.Sets/src/mage/cards/d/Duplicant.java @@ -29,6 +29,7 @@ package mage.cards.d; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -101,13 +102,13 @@ class DuplicantExileTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - Permanent sourcePermananent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - if (sourcePermananent != null) { - sourcePermananent.imprint(permanent.getId(), game); - sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append(']').toString(), game); + MageObject sourceObject = source.getSourceObject(game); + if (permanent != null && sourceObject instanceof Permanent) { + if (permanent.moveToExile(null, null, source.getSourceId(), game)) { + ((Permanent) sourceObject).imprint(permanent.getId(), game); + ((Permanent) sourceObject).addInfo("imprint", "[Imprinted card - " + permanent.getName() + ']', game); } - return permanent.moveToExile(null, null, source.getSourceId(), game); + return true; } return false;