Fix issues with Clone and Metallic Mimic (#5160)

Fix bugs with Metallic Mimic and Adaptive Automaton and clone effects.

Metallic Mimic and Adaptive Automaton were both using the technically correct EnterEventType specifier for their as enters the battlefield abilities. Despite it being technically correct this meant that their ability didn't trigger if they were cloned.

Additionally EnterAttributeAddChosenSubtypeEffect changed the subtype of the base object which meant that clones entered in with the chosen subtype of the original.
This commit is contained in:
Samuel Sandeen 2018-07-29 07:40:48 -04:00 committed by GitHub
parent 3875f42bac
commit a164dad83f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 40 deletions

View file

@ -4,6 +4,7 @@ import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectsList;
import mage.cards.Card;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
@ -89,7 +90,7 @@ public class CloneTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerB, "Llanowar Elves");
addCard(Zone.BATTLEFIELD, playerB, "Craw Wurm");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Public Executio", "Llanowar Elves");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Public Execution", "Llanowar Elves");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Clone");
setStopAt(1, PhaseStep.END_TURN);
@ -199,4 +200,32 @@ public class CloneTest extends CardTestPlayerBase {
Assert.assertTrue("There should be a white and a blue Silvercoat Lion be on the battlefield", blueLion && whiteLion);
}
@Test
public void testAdaptiveAutomaton() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.HAND, playerA, "Adaptive Automaton");
addCard(Zone.BATTLEFIELD, playerB, "Island", 4);
addCard(Zone.HAND, playerB, "Clone");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adaptive Automaton");
setChoice(playerA, "Elf");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Clone");
setChoice(playerB, "Adaptive Automaton");
setChoice(playerB, "Goblin");
setStopAt(2, PhaseStep.END_COMBAT);
execute();
assertPermanentCount(playerA, "Adaptive Automaton", 1);
Permanent original = getPermanent("Adaptive Automaton", playerA);
Assert.assertTrue("The original Adaptive Automaton should be an Elf", original.hasSubtype(SubType.ELF, currentGame));
assertPermanentCount(playerB, "Adaptive Automaton", 1);
Permanent clone = getPermanent("Adaptive Automaton", playerB);
Assert.assertFalse("The cloned Adaptive Automaton should not be as Elf", clone.hasSubtype(SubType.ELF, currentGame));
Assert.assertTrue("The cloned Adaptive Automaton should be a Goblin", clone.hasSubtype(SubType.GOBLIN, currentGame));
}
}