* Spark Double - fixed duplicated counters on copying of another Spark Double (#7553);

This commit is contained in:
Oleg Agafonov 2021-02-22 21:22:31 +04:00
parent f6c0f4c712
commit 2accab79c5
10 changed files with 113 additions and 56 deletions

View file

@ -1,4 +1,3 @@
package org.mage.test.cards.copy;
import mage.constants.PhaseStep;
@ -7,7 +6,6 @@ import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author LevelX2
*/
public class AlteredEgoTest extends CardTestPlayerBase {
@ -24,9 +22,13 @@ public class AlteredEgoTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Altered Ego");
setChoice(playerA, "X=3");
setChoice(playerA, "Yes"); // use copy
setChoice(playerA, "Silvercoat Lion"); // copy target
setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertPowerToughness(playerA, "Silvercoat Lion", 5, 5);
@ -42,9 +44,12 @@ public class AlteredEgoTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Altered Ego");
setChoice(playerA, "X=3");
setChoice(playerA, "Yes"); // use copy (but no targets for copy)
setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Altered Ego", 0);
assertGraveyardCount(playerA, "Altered Ego", 1);

View file

@ -244,4 +244,46 @@ public class SparkDoubleTest extends CardTestPlayerBase {
assertAllCommandsUsed();
}
@Test
public void test_SparkCopyEachOther() {
// rules:
// 706.9e Some replacement effects that generate copy effects include an exception thats an
// additional effect rather than a modification of the affected objects characteristics.
// If another copy effect is applied to that object after applying the copy effect with that
// exception, the exceptions effect doesnt happen.
// Example: Altered Ego reads, You may have Altered Ego enter the battlefield as a copy of any
// creature on the battlefield, except it enters with X additional +1/+1 counters on it. You
// choose for it to enter the battlefield as a copy of Clone, which reads You may have Clone
// enter the battlefield as a copy of any creature on the battlefield, for which no creature
// was chosen as it entered the battlefield. If you then choose a creature to copy as you apply
// the replacement effect Altered Ego gains by copying Clone, Altered Egos replacement effect
// wont cause it to enter the battlefield with any +1/+1 counters on it.
addCard(Zone.HAND, playerA, "Spark Double", 2); // {3}{U}
addCard(Zone.BATTLEFIELD, playerA, "Island", 4 * 2);
//
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
// cast first spark
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spark Double");
setChoice(playerA, "Yes");
setChoice(playerA, "Grizzly Bears");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkPermanentCount("after 1", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears", 2);
// cast second spark
// rules 706.9e affected, so must get only 1 counter
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spark Double");
setChoice(playerA, "Yes");
setChoice(playerA, "Grizzly Bears[only copy]");
//setChoice(playerA, "Grizzly Bears"); // possible bug: two etb effects
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkPermanentCount("after 2", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears", 3);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
}
}