Skip to content

Commit

Permalink
tests: fix some missing choices (#12728)
Browse files Browse the repository at this point in the history
* explicit strict mode false where applicable
  • Loading branch information
xenohedron authored Aug 25, 2024
1 parent 85d612d commit 2cd1a27
Show file tree
Hide file tree
Showing 51 changed files with 176 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void test_chooseTargetCard_AI() {
//setChoice(playerB, "Silvercoat Lion");
//setChoice(playerA, true);

//setStrictChooseMode(true);
setStrictChooseMode(false);
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void test_CopyTarget_AI_Response_MostValueableFromOwn() {
//addTarget(playerA, "Spectral Bears"); // AI must choose

setStopAt(1, PhaseStep.END_TURN);
//setStrictChooseMode(true); // AI must choose
setStrictChooseMode(false); // AI must choose
execute();

assertPermanentCount(playerA, "Spectral Bears", 1);
Expand All @@ -191,7 +191,7 @@ public void test_CopyTarget_AI_Response_MostValueableFromOpponent() {
//addTarget(playerA, "Spectral Bears"); // AI must choose

setStopAt(1, PhaseStep.END_TURN);
//setStrictChooseMode(true); // AI must choose
setStrictChooseMode(false); // AI must choose
execute();

assertPermanentCount(playerA, "Spectral Bears", 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void test_chooseOpponentTargets() {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring");
//addTarget(playerA, "Balduvian Bears"); // disable to activate AI target choose

//setStrictChooseMode(true); // disable strict mode to activate AI for choosing
setStrictChooseMode(false); // disable strict mode to activate AI for choosing
setStopAt(1, PhaseStep.END_COMBAT);
execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void test_AI_ChooseTargets() {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blessings of Nature");

setStopAt(1, PhaseStep.END_TURN);
//setStrictChooseMode(true); // ai must choose
setStrictChooseMode(false); // ai must choose
execute();

assertPowerToughness(playerA, "Balduvian Bears", 2 + 4, 2 + 4); // boost one creature (it's just a choose code, so can be different from simulation results)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void test_OpponentMakeChooseInsteadPlayer_AI() {
//
//addTarget(playerB, "Balduvian Bears"); // give small bear to A - AI must choose itself

//setStrictChooseMode(true); // AI must choose
setStrictChooseMode(false); // AI must choose
setStopAt(1, PhaseStep.END_TURN);
execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void test_target_KillCreatureNotDamage() {
checkPermanentCounters("counters", 1, PhaseStep.BEGIN_COMBAT, playerB, "Balduvian Bears", CounterType.P1P1, 2);

// AI cast avatar on turn 3 and target 1 creature to kil by 3 damage
//setStrictChooseMode(true); // AI
setStrictChooseMode(false); // AI
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void test_chooseBadTargetOnSacrifice_WithTargets_AI() {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Redcap Melee", "Silvercoat Lion");
//addTarget(playerA, "Mountain"); AI must select targets

//setStrictChooseMode(true); AI must select targets
setStrictChooseMode(false); // AI must select targets
setStopAt(1, PhaseStep.END_TURN);
execute();

Expand Down Expand Up @@ -87,7 +87,7 @@ public void test_chooseBadTargetOnSacrifice_WithoutTargets_AI() {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Redcap Melee", "Silvercoat Lion");
//addTarget(playerA, "Mountain"); no lands to sacrifice

//setStrictChooseMode(true);
setStrictChooseMode(false);
setStopAt(1, PhaseStep.END_TURN);
execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void test_TargetStack_ChooseByAI() {
//setChoice(playerB, "Swamp"); // discard

setStopAt(1, PhaseStep.END_TURN);
//setStrictChooseMode(true); // AI must choose
setStrictChooseMode(false); // AI must choose
execute();

assertGraveyardCount(playerB, "Grizzly Bears", 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void testExileToGraveyard2() {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swords to Plowshares", "Silvercoat Lion");

activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2}");
addTarget(playerA, "Silvercoat Lion");

setStopAt(1, PhaseStep.END_TURN);
execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public void VeilbornGhoulTest1() {
addCard(Zone.HAND, playerA, "Swamp");

playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swamp");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
setChoice(playerA, true);

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertPermanentCount(playerA, "Swamp", 1);
Expand All @@ -82,8 +83,9 @@ public void VeilbornGhoulTest2() {
addCard(Zone.BATTLEFIELD, playerA, "Urborg, Tomb of Yawgmoth", 1);

playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flood Plain");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
setChoice(playerA, true);

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertPermanentCount(playerA, "Flood Plain", 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void testCurseOfEchoes() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Echoes", playerB);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Jace's Ingenuity");
setChoice(playerA, true); // yes to copy

setStopAt(1, PhaseStep.END_TURN);
execute();
Expand Down Expand Up @@ -118,7 +119,7 @@ public void testCurseOfExhaustion3() {

castSpell(4, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Copy Enchantment");
// Choices for Copy Enchantment get auto-chosen
setStrictChooseMode(false); // auto choose

checkPlayableAbility("Can't cast a 2nd spell", 4, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cast Lightning", false);

Expand Down Expand Up @@ -211,6 +212,8 @@ public void testCurseOfMisfortune1() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Misfortunes", playerB);

setStrictChooseMode(false); // auto choose, not valid choice since same name

setStopAt(3, PhaseStep.DRAW);
execute();

Expand All @@ -228,6 +231,9 @@ public void testCurseOfMisfortune2() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Misfortunes", playerB);

setChoice(playerA, true);
addTarget(playerA, "Curse of Bloodletting");

setStopAt(3, PhaseStep.DRAW);
execute();

Expand All @@ -247,6 +253,7 @@ public void testCurseOfDeathsHold() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Death's Hold", playerB);

setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_COMBAT);
execute();

Expand All @@ -273,12 +280,15 @@ public void testCurseOfDeathsHold2() {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Death's Hold", playerB);

castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Reclamation Sage");
setChoice(playerB, true); // yes to destroy artifact or enchantment
addTarget(playerB, "Curse of Death's Hold");

// {2}{G/U}{G/U}: Put the top two cards of your library into your graveyard, then return a nonland card of an opponent's choice from your graveyard to your hand.
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{G/U}{G/U}: Mill two cards");
addTarget(playerB, "Curse of Death's Hold"); // opponent's choice
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Curse of Death's Hold", playerB);

setStrictChooseMode(true);
setStopAt(3, PhaseStep.END_TURN);
execute();

Expand Down Expand Up @@ -345,6 +355,7 @@ public void cruelRealityOnlyHasCreatureNoChoiceMade() {
addCard(Zone.BATTLEFIELD, playerB, memnite);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, cReality, playerB);
setChoice(playerB, memnite);

setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
execute();
Expand All @@ -363,6 +374,7 @@ public void cruelRealityOnlyHasPwNoChoiceMade() {
addCard(Zone.BATTLEFIELD, playerB, ugin);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, cReality, playerB);
setChoice(playerB, ugin);

setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@
*/
public class AugurOfBolasTest extends CardTestPlayerBase {

/*
Aether Figment {1}{U}
Creature - Illusion
1/1
Kicker {3} (You may pay an additional as you cast this spell.)
Aether Figment can't be blocked.
If Aether Figment was kicked, it enters with two +1/+1 counters on it.
*/
@Test
public void testEnteringWithCounters() {
public void testAbility() {
addCard(Zone.LIBRARY, playerA, "Lightning Bolt", 3);
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
Expand All @@ -29,7 +21,11 @@ public void testEnteringWithCounters() {
addCard(Zone.HAND, playerA, "Augur of Bolas"); // Creature {1}{U}

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Augur of Bolas");
setChoice(playerA, true);
addTarget(playerA, "Lightning Bolt"); // to hand
setChoice(playerA, "Lightning Bolt"); // order to bottom

setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public void returnAsAura(){
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Terror", lion);
setChoice(playerA, "Grizzly Bears"); // to enchant

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, lion, 0);
Expand All @@ -39,6 +41,7 @@ public void stayInGraveyard(){
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Terror", lion);
setStrictChooseMode(false); // auto choose, no legal target
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, lion, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void testCastNotOwned() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gonti, Lord of Luxury", true);
// addTarget(playerA, playerB); playerB is autochosen since only option
setStrictChooseMode(false);
setChoice(playerA, "Greenbelt Rampager");

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public void testWithProgenitorMimic() {
addCard(Zone.HAND, playerA, "Progenitor Mimic");

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Progenitor Mimic");
setChoice(playerA, true); // yes to copy
setChoice(playerA, "Master Biomancer");
setStrictChooseMode(false); // something weird with replacement effect ordering?

setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public void testEnteringWithCounters() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Protean Hydra");

setStrictChooseMode(false); // test AI use max for X
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class SkylineCascadeTest extends CardTestPlayerBase {

/**
* Reported bug on Skyline Cascade not working properly.
*
* Test the typical situation - tapped creature not being able to untap during next untap step.
*/
@Test
Expand All @@ -31,10 +30,10 @@ public void testPreventsTappedCreatureUntapping() {
attack(1, playerA, "Savannah Lions");

playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Skyline Cascade");
// Savannah Lions is autochosen
addTarget(playerB, "Savannah Lions");

setStrictChooseMode(true);
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);

execute();

assertTapped("Savannah Lions", true);
Expand All @@ -56,21 +55,21 @@ public void testDoesNotStopUntappedCreatureUntapping() {
// {W} 2/1
addCard(Zone.BATTLEFIELD, playerA, "Savannah Lions");

/**
/*
* Skyline Cascade enters the battlefield tapped.
* When Skyline Cascade enters the battlefield, target creature an opponent controls doesn't untap during its controller's next untap step.
* Tap: Add {U} .
*/
addCard(Zone.HAND, playerB, "Skyline Cascade");

playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Skyline Cascade");
// Savannah Lions is autochosen

addTarget(playerB, "Savannah Lions");

setStrictChooseMode(true);
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);

execute();

assertTapped("Savannah Lions", false);
assertTapped("Skyline Cascade", true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public void fiveMountainsDamageToPlayerB() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);

playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain"); // 3 damage because already 5 Mountains on battlefield
setChoice(playerA, true); // yes to deal damage
addTarget(playerA, playerB); // to deal damage

setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
Expand All @@ -66,6 +68,10 @@ public void sixEnterWithScapeshiftDamageToPlayerB() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scapeshift");
setChoice(playerA, "Forest^Forest^Forest^Forest^Forest^Forest");
addTarget(playerA, "Mountain^Mountain^Mountain^Mountain^Mountain^Mountain");
setChoice(playerA, "Whenever", 5); // order triggers
setChoice(playerA, true, 6); // yes to deal damage
addTarget(playerA, playerB, 6); // to deal damage

setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
Expand All @@ -89,6 +95,10 @@ public void sixAndValakutEnterWithScapeshiftDamageToPlayerB() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scapeshift");
setChoice(playerA, "Forest^Forest^Forest^Forest^Forest^Forest^Forest");
addTarget(playerA, "Mountain^Mountain^Mountain^Mountain^Mountain^Mountain^Valakut, the Molten Pinnacle");
setChoice(playerA, "Whenever", 5); // order triggers
setChoice(playerA, true, 6); // yes to deal damage
addTarget(playerA, playerB, 6); // to deal damage

setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
Expand All @@ -114,9 +124,13 @@ public void sixWithShocklandsAndValakutEnterWithScapeshiftDamageToPlayerB() {

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scapeshift");
setChoice(playerA, "Forest^Forest^Forest^Forest^Forest^Forest^Forest");
addTarget(playerA, "Mountain^Mountain^Mountain^Stomping Ground^Stomping Ground^Stomping Ground^Valakut, the Molten Pinnacle");
setChoice(playerA, false); // Stomping Ground can be tapped
setChoice(playerA, false); // Stomping Ground can be tapped
setChoice(playerA, false); // Stomping Ground can be tapped
setChoice(playerA, "Whenever", 5); // order triggers
setChoice(playerA, true, 6); // yes to deal damage
addTarget(playerA, playerB, 6); // to deal damage
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down Expand Up @@ -153,6 +167,7 @@ public void withPrismaticOmen() {
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
addTarget(playerA, playerB);

setStrictChooseMode(false); // auto-choose
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

Expand Down
Loading

0 comments on commit 2cd1a27

Please sign in to comment.