forked from External/mage
create token copy checks for copyfrom
* Esoteric Duplicator test demonstrates fix. Sculpting steel token was not coming back as an Esoteric Duplicator
This commit is contained in:
parent
71cd3ce3fc
commit
d13a0e6e6b
2 changed files with 10 additions and 4 deletions
|
|
@ -2,7 +2,6 @@ package org.mage.test.cards.single.big;
|
||||||
|
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
|
@ -21,7 +20,6 @@ public class EsotericDuplicatorTest extends CardTestPlayerBase {
|
||||||
private static final String esotericDuplicator = "Esoteric Duplicator";
|
private static final String esotericDuplicator = "Esoteric Duplicator";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("Sculpting steel doesn't retain copy on entering battlefield")
|
|
||||||
public void testEsotericDuplicator() {
|
public void testEsotericDuplicator() {
|
||||||
setStrictChooseMode(true);
|
setStrictChooseMode(true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,8 +176,8 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
// can target card or permanent
|
// can target card or permanent
|
||||||
Card copyFrom;
|
Card copyFrom = null;
|
||||||
CopyApplier applier = new EmptyCopyApplier();
|
CopyApplier applier = null;
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
// handle copies of copies
|
// handle copies of copies
|
||||||
Permanent copyFromPermanent = permanent;
|
Permanent copyFromPermanent = permanent;
|
||||||
|
|
@ -196,9 +196,17 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// check if permanent was copying, but copy effect is no longer active
|
||||||
|
if (applier == null) {
|
||||||
|
if (permanent.isCopy() && permanent.getCopyFrom() instanceof Permanent) {
|
||||||
|
copyFromPermanent = (Permanent) permanent.getCopyFrom();
|
||||||
|
}
|
||||||
|
applier = new EmptyCopyApplier();
|
||||||
|
}
|
||||||
copyFrom = copyFromPermanent;
|
copyFrom = copyFromPermanent;
|
||||||
} else {
|
} else {
|
||||||
copyFrom = game.getCard(getTargetPointer().getFirst(game, source));
|
copyFrom = game.getCard(getTargetPointer().getFirst(game, source));
|
||||||
|
applier = new EmptyCopyApplier();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copyFrom == null) {
|
if (copyFrom == null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue