forked from External/mage
fix and test [C21] Incarnation Technique
Incarnation Technique was not processing trigger properly inbetween the mill and return. part of #13601
This commit is contained in:
parent
531246ad7f
commit
7cbd396e39
2 changed files with 128 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ package mage.cards.i;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||
import mage.abilities.keyword.DemonstrateAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -29,6 +30,7 @@ public final class IncarnationTechnique extends CardImpl {
|
|||
this.addAbility(new DemonstrateAbility());
|
||||
|
||||
// Mill five cards, then return a creature card from your graveyard to the battlefield.
|
||||
this.getSpellAbility().addEffect(new MillCardsControllerEffect(5).concatBy(", then"));
|
||||
this.getSpellAbility().addEffect(new IncarnationTechniqueEffect());
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +48,7 @@ class IncarnationTechniqueEffect extends OneShotEffect {
|
|||
|
||||
IncarnationTechniqueEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "mill five cards, then return a creature card from your graveyard to the battlefield";
|
||||
staticText = "return a creature card from your graveyard to the battlefield";
|
||||
}
|
||||
|
||||
private IncarnationTechniqueEffect(final IncarnationTechniqueEffect effect) {
|
||||
|
|
@ -64,7 +66,6 @@ class IncarnationTechniqueEffect extends OneShotEffect {
|
|||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
player.millCards(5, source, game);
|
||||
TargetCard target = new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD);
|
||||
target.withNotTarget(true);
|
||||
if (!target.canChoose(source.getControllerId(), source, game)) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,125 @@
|
|||
package org.mage.test.cards.single.c21;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
|
||||
public class IncarnationTechniqueTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* {@link mage.cards.i.IncarnationTechnique Incarnation Technique} {4}{B}
|
||||
* Sorcery
|
||||
* Demonstrate (When you cast this spell, you may copy it. If you do, choose an opponent to also copy it.)
|
||||
* Mill five cards, then return a creature card from your graveyard to the battlefield.
|
||||
*/
|
||||
private static final String technique = "Incarnation Technique";
|
||||
|
||||
private static final String myr = "Omega Myr"; // vanilla 1/2
|
||||
|
||||
/**
|
||||
* Emrakul, the Aeons Torn {15}
|
||||
* Legendary Creature — Eldrazi
|
||||
* This spell can’t be countered.
|
||||
* When you cast this spell, take an extra turn after this one.
|
||||
* Flying, protection from spells that are one or more colors, annihilator 6
|
||||
* When Emrakul is put into a graveyard from anywhere, its owner shuffles their graveyard into their library.
|
||||
* 15/15
|
||||
*/
|
||||
private static final String emrakul = "Emrakul, the Aeons Torn";
|
||||
|
||||
/**
|
||||
* Cosi's Trickster {U}
|
||||
* Creature — Merfolk Wizard
|
||||
* Whenever an opponent shuffles their library, you may put a +1/+1 counter on this creature.
|
||||
* 1/1
|
||||
*/
|
||||
private static final String trickster = "Cosi's Trickster";
|
||||
|
||||
@Test
|
||||
public void testNoCreatureToReturn() {
|
||||
setStrictChooseMode(true);
|
||||
skipInitShuffling();
|
||||
|
||||
addCard(Zone.HAND, playerA, technique);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, technique);
|
||||
setChoice(playerA, true); // yes to demonstrate
|
||||
setChoice(playerA, playerB.getName()); // choosing B for demonstrate copy
|
||||
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, 5 * 2 + 1);
|
||||
assertGraveyardCount(playerB, 5);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatureInGraveyard() {
|
||||
setStrictChooseMode(true);
|
||||
skipInitShuffling();
|
||||
|
||||
addCard(Zone.HAND, playerA, technique);
|
||||
addCard(Zone.GRAVEYARD, playerA, myr);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, technique);
|
||||
setChoice(playerA, false); // no to demonstrate
|
||||
setChoice(playerA, myr); // returned creature
|
||||
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, myr, 1);
|
||||
assertGraveyardCount(playerA, 5 + 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatureMilled() {
|
||||
setStrictChooseMode(true);
|
||||
skipInitShuffling();
|
||||
|
||||
addCard(Zone.HAND, playerA, technique);
|
||||
addCard(Zone.LIBRARY, playerA, myr);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, technique);
|
||||
setChoice(playerA, false); // no to demonstrate
|
||||
setChoice(playerA, myr); // returned creature
|
||||
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, myr, 1);
|
||||
assertGraveyardCount(playerA, 4 + 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmrakul() {
|
||||
setStrictChooseMode(true);
|
||||
skipInitShuffling();
|
||||
|
||||
addCard(Zone.HAND, playerA, technique);
|
||||
addCard(Zone.BATTLEFIELD, playerB, trickster);
|
||||
addCard(Zone.LIBRARY, playerA, emrakul);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, technique);
|
||||
setChoice(playerA, false); // no to demonstrate
|
||||
setChoice(playerA, emrakul); // returned creature
|
||||
setChoice(playerB, true); // yes to Cosi's Trickster may trigger
|
||||
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, emrakul, 1);
|
||||
assertGraveyardCount(playerA, 0);
|
||||
assertCounterCount(playerB, trickster, CounterType.P1P1, 1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue