* Duplicant - Fixed that the target creatures attributes were not copied if the target was not exiled (e.g. Commander going to command zone).

This commit is contained in:
LevelX2 2017-07-30 19:52:56 +02:00
parent 286d08452e
commit 76390714f5

View file

@ -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;