Fixed different ZCC in split card's parts (flashback fix, see 95075cf33e);

Improve moveToZone code and fixed some cards with wrong commands queue (e.g. directly removes card from zone and then calls moveToZone again);
This commit is contained in:
Oleg Agafonov 2020-06-04 23:47:50 +04:00
parent f010454cb2
commit e95ae2675b
21 changed files with 116 additions and 36 deletions

View file

@ -70,6 +70,43 @@ public class CastSplitCardsWithFlashbackTest extends CardTestPlayerBase {
assertExileCount(playerA, "Wear // Tear", 1);
}
@Test
public void test_Flashback_SplitLeft_ZCCChanged() {
// {1}{U}
// When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn.
addCard(Zone.HAND, playerA, "Snapcaster Mage", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
//
// Wear {1}{R} Destroy target artifact.
// Tear {W} Destroy target enchantment.
addCard(Zone.HAND, playerA, "Wear // Tear", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2 + 2); // for first Wear cast
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
addCard(Zone.BATTLEFIELD, playerB, "Bident of Thassa", 1); // Legendary Enchantment Artifact
addCard(Zone.BATTLEFIELD, playerB, "Bow of Nylea", 1); // Legendary Enchantment Artifact
// play card as normal to change ZCC for split cards (simulate GUI session - ZCC's was bugged and card's parts was able to have different ZCC)
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wear", "Bow of Nylea");
// add flashback
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage");
addTarget(playerA, "Wear // Tear");
// cast as flashback
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{R}", "Bident of Thassa");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertGraveyardCount(playerB, "Bident of Thassa", 1);
assertGraveyardCount(playerB, "Bow of Nylea", 1);
assertExileCount(playerA, "Wear // Tear", 1);
}
@Test
public void test_Flashback_SplitRight() {
// {1}{U}

View file

@ -1601,13 +1601,12 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
}
/**
*
* @param turnNum
* @param step
* @param player
* @param ability
* @param targetName use NO_TARGET if there is no target to set
* @param spellOnStack
* @param targetName use NO_TARGET if there is no target to set
* @param spellOnStack
*/
public void activateAbility(int turnNum, PhaseStep step, TestPlayer player, String ability, String targetName, String spellOnStack) {
// TODO: it's uses computerPlayer to execute, only ability target will work, but choices and targets commands aren't