From 1baf5235224a75cf10752b70a9e2a125e16b89ca Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 31 Jul 2021 08:11:57 -0400 Subject: [PATCH] add boolean int method for setChoice --- .../org/mage/test/cards/abilities/keywords/KickerTest.java | 2 +- .../org/mage/test/cards/abilities/keywords/ModularTest.java | 2 +- .../org/mage/test/cards/single/c20/TwinningStaffTest.java | 2 +- .../java/org/mage/test/cards/single/iko/TheOzolithTest.java | 2 +- .../test/cards/single/iko/UnpredictableCycloneTest.java | 6 +++--- .../org/mage/test/cards/triggers/DivineVisitationTest.java | 2 +- .../src/test/java/org/mage/test/multiplayer/VotingTest.java | 6 +++--- .../test/serverside/base/impl/CardTestPlayerAPIImpl.java | 6 +++++- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java index 5a9ad9029c..8afe385617 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java @@ -606,7 +606,7 @@ public class KickerTest extends CardTestPlayerBase { // Multikicker (You may pay an additional {B} any number of times as you cast this spell.) // When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked. castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bloodhusk Ritualist"); - setChoice(playerA, "Yes", 2); // 2 x Multikicker + setChoice(playerA, true, 2); // 2 x Multikicker setChoice(playerA, false); // stop the kicking castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Bloodhusk Ritualist"); addTarget(playerA, playerB); // target for kicker's trigger (discard cards) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ModularTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ModularTest.java index d794ec38d3..281bb53487 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ModularTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ModularTest.java @@ -142,7 +142,7 @@ public class ModularTest extends CardTestPlayerBase { // put three -1/-1 counters on lancer, which leaves it with one +1/+1 castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Puncture Blast", "Arcbound Lancer"); - setChoice(playerA, "Yes", 2); + setChoice(playerA, true, 2); checkStackSize("stack1", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 1); // kill lancer with one +1/+1 counter on it diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java index 0f54d615e3..ddc236ddee 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/TwinningStaffTest.java @@ -74,7 +74,7 @@ public class TwinningStaffTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, fork); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, disfigure, bear); - setChoice(playerA, "Yes", 2); + setChoice(playerA, true, 2); addTarget(playerA, elite, 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, fork, disfigure, disfigure); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/TheOzolithTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/TheOzolithTest.java index f2a268ba5f..5619ac083a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/TheOzolithTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/TheOzolithTest.java @@ -132,7 +132,7 @@ public class TheOzolithTest extends CardTestPlayerBase { waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, MURDER, FERTILID); - setChoice(playerA, "Yes", 2); // Move counters at beginning of combat + setChoice(playerA, true, 2); // Move counters at beginning of combat setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/UnpredictableCycloneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/UnpredictableCycloneTest.java index de672f2023..8392ef4edc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/UnpredictableCycloneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/UnpredictableCycloneTest.java @@ -67,7 +67,7 @@ public class UnpredictableCycloneTest extends CardTestPlayerBase { showAvailableAbilities("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling"); setChoice(playerA, "Thought Reflection"); // apply doubling first - setChoice(playerA, "Yes", 2); // cast found library cards + setChoice(playerA, true, 2); // cast found library cards setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); @@ -92,10 +92,10 @@ public class UnpredictableCycloneTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling"); // from first cycle call setChoice(playerA, "Thought Reflection", 2); // 3 triggers: 2x doubling + 1x cycle - setChoice(playerA, "Yes", 2); // cast found library cards for 2x doubling triggers + setChoice(playerA, true, 2); // cast found library cards for 2x doubling triggers // from triggered cycle setChoice(playerA, "Thought Reflection", 1); // 2 triggers: 1x doubling + 1x cycle - setChoice(playerA, "Yes", 2); // cast found library cards for 2x doubling triggers + setChoice(playerA, true, 2); // cast found library cards for 2x doubling triggers setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DivineVisitationTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DivineVisitationTest.java index bc915a4c90..3c8fe42df0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DivineVisitationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DivineVisitationTest.java @@ -33,7 +33,7 @@ public class DivineVisitationTest extends CardTestPlayerBase { // Let the opponent draw castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ancestral Recall", playerB); setChoice(playerA, "Whenever an opponent draws a card", 2); // choose order of triggers - setChoice(playerB, "No", 3); // Decline to pay 2 + setChoice(playerB, false, 3); // Decline to pay 2 setStopAt(1, PhaseStep.BEGIN_COMBAT); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/multiplayer/VotingTest.java b/Mage.Tests/src/test/java/org/mage/test/multiplayer/VotingTest.java index 489d822d59..d9c6065d9a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/multiplayer/VotingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/multiplayer/VotingTest.java @@ -208,7 +208,7 @@ public class VotingTest extends CardTestCommander4PlayersWithAIHelps { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, illusion); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, lieutenant); - setChoice(playerA, "Yes", 4); + setChoice(playerA, true, 4); setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); @@ -228,7 +228,7 @@ public class VotingTest extends CardTestCommander4PlayersWithAIHelps { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, illusion); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, lieutenant); - setChoice(playerA, "Yes", 5); + setChoice(playerA, true, 5); setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); @@ -250,7 +250,7 @@ public class VotingTest extends CardTestCommander4PlayersWithAIHelps { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, illusion); castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, illusion); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, lieutenant); - setChoice(playerB, "Yes", 4); + setChoice(playerB, true, 4); setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index 4de0d06b54..c6eab37810 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -1923,7 +1923,11 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * @param choice */ public void setChoice(TestPlayer player, boolean choice) { - setChoice(player, choice ? "Yes" : "No"); + setChoice(player, choice, 1); + } + + public void setChoice(TestPlayer player, boolean choice, int timesToChoose) { + setChoice(player, choice ? "Yes" : "No", timesToChoose); } public void setChoice(TestPlayer player, String choice) {