Refactor effects which disable the "legend rule" (#9662)

This commit is contained in:
Evan Kranzler 2022-10-28 18:04:23 -04:00 committed by GitHub
parent 1fece87819
commit 3ed26a2b1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 243 additions and 211 deletions

View file

@ -144,7 +144,7 @@ public class CleverImpersonatorTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clever Impersonator");
setChoice(playerA, "Jace, Vryn's Prodigy");
addTarget(playerA, "Jace, Vryn's Prodigy[only copy]"); // keep the copied Jace
setChoice(playerA, "Jace, Vryn's Prodigy[only copy]"); // keep the copied Jace
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card");
setChoice(playerA, "Pillarfield Ox");

View file

@ -55,25 +55,25 @@ public class SharuumTheHegemonTest extends CardTestPlayerBase {
setChoice(playerA, true);
setChoice(playerA, "Sharuum the Hegemon"); // what creature to clone
addTarget(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Whenever {this} or another creature dies"); // blood first
addTarget(playerA, playerB); // damage by blood
setChoice(playerA, true); // return
// addTarget(playerA, "Sharuum the Hegemon"); // return real sharuum (Autochosen, only target)
addTarget(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Whenever {this} or another creature dies"); // blood first
addTarget(playerA, playerB); // damage by blood
setChoice(playerA, true); // return
// addTarget(playerA, "Sharuum the Hegemon"); // return real sharuum (Autochosen, only target
addTarget(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Whenever {this} or another creature dies"); // blood first
addTarget(playerA, playerB); // damage by blood
setChoice(playerA, true); // return
// addTarget(playerA, "Sharuum the Hegemon"); // return real sharuum (Autochosen, only target)
addTarget(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Sharuum the Hegemon[only copy]"); // which legend to keep
setChoice(playerA, "Whenever {this} or another creature dies"); // blood first
addTarget(playerA, playerB); // damage by blood
setChoice(playerA, false); // Don't use it anymore

View file

@ -0,0 +1,32 @@
package org.mage.test.cards.rules;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author TheElk801
*/
public class LegendRuleTest extends CardTestPlayerBase {
private static final String isamaru = "Isamaru, Hound of Konda";
@Test
public void testRegular() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.HAND, playerA, isamaru, 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, isamaru);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, isamaru);
setChoice(playerA, isamaru);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, isamaru, 1);
assertPermanentCount(playerA, isamaru, 1);
}
}

View file

@ -0,0 +1,53 @@
package org.mage.test.cards.single.dmc;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author TheElk801
*/
public class CadricSoulKindlerTest extends CardTestPlayerBase {
private static final String cadric = "Cadric, Soul Kindler";
private static final String isamaru = "Isamaru, Hound of Konda";
@Test
public void testOneCopy() {
addCard(Zone.BATTLEFIELD, playerA, cadric);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.HAND, playerA, isamaru);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, isamaru);
setChoice(playerA, true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
setStrictChooseMode(true);
execute();
assertPermanentCount(playerA, isamaru, 2);
assertGraveyardCount(playerA, isamaru, 0);
}
@Test
public void testTwoCopies() {
addCard(Zone.BATTLEFIELD, playerA, cadric);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.HAND, playerA, isamaru, 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, isamaru);
setChoice(playerA, true);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, isamaru);
setChoice(playerA, true);
setChoice(playerA, isamaru);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
setStrictChooseMode(true);
execute();
assertPermanentCount(playerA, isamaru, 3);
assertGraveyardCount(playerA, isamaru, 1);
}
}