From 37f4f40a2c4962ce707521515de9c108bd16c003 Mon Sep 17 00:00:00 2001 From: Alex Vasile <48962821+Alex-Vasile@users.noreply.github.com> Date: Thu, 25 Aug 2022 00:06:22 -0400 Subject: [PATCH] Fix many tests with wrong commands --- Mage.Sets/src/mage/cards/b/Battlegrowth.java | 1 + .../activated/LevelUpAbilityTest.java | 3 + .../abilities/enters/BanisherPriestTest.java | 1 + .../enters/GreenbeltRampagerTest.java | 8 +- .../equipped/GolemSkinGauntletsTest.java | 1 + .../abilities/equipped/HeavyArbalestTest.java | 3 + .../cards/abilities/keywords/BlitzTest.java | 4 +- .../abilities/keywords/BloodthirstTest.java | 3 +- .../cards/abilities/keywords/CascadeTest.java | 4 +- .../abilities/keywords/ConspireTest.java | 4 +- .../abilities/keywords/ConstellationTest.java | 2 + .../abilities/keywords/DeathtouchTest.java | 2 +- .../abilities/keywords/DeliriumTest.java | 1 + .../cards/abilities/keywords/DiscardTest.java | 3 +- .../cards/abilities/keywords/EmbalmTest.java | 22 +++-- .../cards/abilities/keywords/EvolveTest.java | 6 +- .../cards/abilities/keywords/ExploitTest.java | 6 +- .../abilities/keywords/FlashbackTest.java | 24 ++--- .../cards/abilities/keywords/InfectTest.java | 1 + .../abilities/keywords/JumpStartTest.java | 3 + .../cards/abilities/keywords/KickerTest.java | 93 ++++++++++++------- .../cards/abilities/keywords/MeldTest.java | 13 +-- .../cards/abilities/keywords/ModularTest.java | 15 ++- .../cards/abilities/keywords/MorphTest.java | 5 +- .../cards/abilities/keywords/PhasingTest.java | 4 +- .../keywords/SoulbondKeywordTest.java | 10 +- .../cards/abilities/keywords/StormTest.java | 12 +-- .../cards/abilities/keywords/SurgeTest.java | 5 +- .../abilities/keywords/TransformTest.java | 10 +- .../cards/abilities/keywords/UndyingTest.java | 1 + .../lose/LoseAbilityByEquipmentTest.java | 2 +- .../cards/abilities/lose/LoseAbilityTest.java | 6 +- .../counterspell/CounterspellTest.java | 6 +- .../oneshot/counterspell/ForceOfWillTest.java | 14 +-- .../oneshot/counterspell/SecondGuessTest.java | 4 +- .../oneshot/exile/ExileAndReturnTest.java | 12 ++- .../abilities/other/AuratouchedMageTest.java | 51 +++++----- .../other/ChorusOfTheConclaveTest.java | 3 +- .../abilities/other/EndTurnEffectTest.java | 2 +- .../abilities/other/GainAbilitiesTest.java | 4 +- .../other/LimitedCountedActivationsTest.java | 6 +- .../cards/asthough/AlchemistsRefugeTest.java | 2 +- .../cards/asthough/CastAsInstantTest.java | 2 +- .../asthough/PlayFromNonHandZoneTest.java | 19 ++-- .../asthough/PlayTopCardFromLibraryTest.java | 2 +- .../cards/asthough/SpendOtherManaTest.java | 2 +- .../cards/conditional/JacesPhantasmTest.java | 20 ++-- .../conditional/ManaWasSpentToCastTest.java | 10 +- .../test/cards/continuous/AngelsTombTest.java | 1 + .../cards/continuous/BecomesCreatureTest.java | 4 + .../cards/continuous/BoostEnchantedTest.java | 9 +- .../test/cards/continuous/ChangelingTest.java | 2 +- .../continuous/ChiefOfTheFoundryTest.java | 3 +- .../cards/continuous/CommandersCastTest.java | 14 +-- .../continuous/DaxosTheReturnedTest.java | 4 +- .../continuous/DependentEffectsTest.java | 2 +- .../test/cards/continuous/InfestTest.java | 12 +-- .../cards/continuous/IrencragFeatTest.java | 21 +++-- .../test/cards/continuous/LayerTests.java | 42 ++++----- .../cards/continuous/SerraAscendantTest.java | 2 +- .../cards/continuous/SplitSecondTest.java | 9 +- .../test/cards/continuous/SwarmSurgeTest.java | 10 +- .../continuous/WardenOfTheFirstTreeTest.java | 8 +- .../PlayCardsFromGraveyardTest.java | 5 +- .../CastOtherPlayersCardFromExileTest.java | 4 +- .../test/cards/control/DebtOfLoyaltyTest.java | 1 + .../ExileAndReturnUnderYourControl.java | 2 +- .../control/GainControlTargetEffectTest.java | 4 +- .../control/GontiLordOfLuxuryEffectTest.java | 3 +- .../test/cards/control/ItThatBetraysTest.java | 1 + .../cards/control/WelcomeToTheFoldTest.java | 4 +- .../cards/copy/CleverImpersonatorTest.java | 20 ++-- .../copy/CopyCreatureCardToTokenImplTest.java | 8 +- .../test/cards/copy/EldraziMimicTest.java | 1 + .../cards/copy/EssenceOfTheWildCopyTest.java | 2 +- .../test/cards/copy/EssenceOfTheWildTest.java | 2 +- .../test/cards/copy/HelmOfTheHostTest.java | 3 +- .../cards/copy/InfiniteReflectionTest.java | 2 +- .../cards/copy/KikiJikiMirrorBreakerTest.java | 2 +- .../cards/copy/LazavDimirMastermindTest.java | 5 +- .../mage/test/cards/copy/MimicVatTest.java | 4 +- .../test/cards/copy/PhantasmalImageTest.java | 6 +- .../test/cards/copy/SplinterTwinTest.java | 6 +- .../test/cards/copy/TheMimeoplasmTest.java | 2 +- .../additional/RemoveCounterCostTest.java | 3 +- .../cost/adventure/AdventureCardsTest.java | 15 +-- ...CastFromHandWithoutPayingManaCostTest.java | 2 +- ...tFromLibraryWithoutPayingManaCostTest.java | 7 +- .../modification/CostModificationTest.java | 15 +-- .../modification/CostReduceForEachTest.java | 11 +-- .../cost/modification/HeartstoneTest.java | 2 +- .../KaradorGhostChieftainTest.java | 8 +- .../modification/MizzixOfTheIzmagnusTest.java | 4 + .../test/cards/damage/ExcessDamageTest.java | 2 +- .../mage/test/cards/digital/ConjureTest.java | 2 +- .../mage/test/cards/emblems/EmblemsTest.java | 4 +- .../cards/enchantments/AnimateDeadTest.java | 1 + .../test/cards/enchantments/ClassTest.java | 6 ++ .../EnchantingGraveyardCardsTest.java | 4 +- .../cards/enchantments/ParadoxHazeTest.java | 4 +- .../cards/enchantments/SpreadingSeasTest.java | 8 ++ .../enchantments/StarfieldOfNyxTest.java | 2 +- .../test/cards/facedown/GrimHaruspexTest.java | 2 +- .../cards/facedown/ObscuringAetherTest.java | 4 +- .../mage/test/cards/facedown/TriggerTest.java | 2 +- .../mage/test/cards/mana/ManaSourceTest.java | 2 +- .../test/cards/mana/ReflectingPoolTest.java | 2 + ...dManaAsThoughItWereManaOfAnyColorTest.java | 1 + .../mana/conditional/ConditionalManaTest.java | 5 +- .../conditional/CrypticTrilobiteTest.java | 2 +- .../mana/phyrexian/PhyrexianManaTest.java | 2 +- .../test/cards/planeswalker/AjaniTest.java | 6 +- .../test/cards/planeswalker/GideonTest.java | 2 +- .../test/cards/planeswalker/JaceTest.java | 7 +- .../LilianaDefiantNecromancerTest.java | 7 +- .../test/cards/planeswalker/LilianaTest.java | 4 +- .../planeswalker/NissaVastwoodSeerTest.java | 2 +- .../test/cards/planeswalker/RalZarekTest.java | 2 +- .../test/cards/planeswalker/TamiyoTest.java | 75 ++++----------- .../test/cards/planeswalker/UginTest.java | 6 +- .../test/cards/planeswalker/VivienTest.java | 12 +-- .../prevention/PreventAllDamageTest.java | 6 +- .../prevention/PreventAttachedEffectTest.java | 2 +- .../replacement/HallowedMoonlightTest.java | 3 +- .../cards/replacement/PanharmoniconTest.java | 3 +- .../cards/replacement/PillarOfFlameTest.java | 1 + .../replacement/SanctifierEnVecTest.java | 5 +- .../cards/replacement/WinLoseEffectsTest.java | 2 +- .../ZoneChangeReplacementTest.java | 2 + .../entersBattlefield/HardenedScaleTest.java | 2 +- .../DamageSetToXLifeInsteadTest.java | 12 +-- .../ActivateAbilityOnlyLimitedTimesTest.java | 1 + .../mage/test/cards/rules/CantCastTest.java | 13 +-- .../cards/rules/MeliraSylvokOutcastTest.java | 4 +- .../mage/test/cards/rules/TokenLimitTest.java | 9 +- .../rules/WorldEnchantmentsRuleTest.java | 24 +++-- .../single/afr/BruenorBattlehammerTest.java | 1 + .../cards/single/afr/TheTarrasqueTest.java | 2 +- .../akh/HapatraVizierOfPoisonsTest.java | 2 +- .../cards/single/arb/SenTripletsTest.java | 12 +-- .../cards/single/avr/CavernOfSoulsTest.java | 2 +- .../cards/single/avr/ExquisiteBloodTest.java | 1 + .../cards/single/c17/TheUrDragonTest.java | 2 +- .../cards/single/c18/AminatousAuguryTest.java | 9 +- .../single/c19/ChainerNightmareAdeptTest.java | 4 +- .../single/c20/PakoArcaneRetrieverTest.java | 5 +- .../cards/single/cmd/AcornCatapultTest.java | 4 +- .../single/cmr/ProfaneTransfusionTest.java | 2 + .../cards/single/dka/HavengulLichTest.java | 5 + .../cards/single/dst/EchoingTruthTest.java | 1 + .../cards/single/e10/PithingNeedleTest.java | 70 ++++++++++++++ .../single/emn/EmrakulThePromisedEndTest.java | 6 +- .../cards/single/eve/HotheadedGiantTest.java | 2 +- .../cards/single/fut/DaybreakCoronetTest.java | 2 + .../cards/single/fut/DustOfMomentsTest.java | 2 +- .../single/fut/MuragandaPetroglyphsTest.java | 1 + .../cards/single/grn/PeltCollectorTest.java | 3 +- .../single/grn/ThousandYearStormTest.java | 1 + .../single/hou/AbandonedSarcophagusTest.java | 2 +- .../single/iko/KinnanBonderProdigyTest.java | 1 + .../test/cards/single/iko/TheOzolithTest.java | 4 +- .../cards/single/khm/CodespellClericTest.java | 2 +- .../single/khm/DraugrNecromancerTest.java | 2 +- .../cards/single/khm/DreamDevourerTest.java | 3 +- .../cards/single/khm/ValkiGodOfLiesTest.java | 6 +- .../lea/ManabarbsTest.java} | 13 ++- .../single/lgn/InfernalCaretakerTest.java | 2 +- .../test/cards/single/m12/AegisAngelTest.java | 6 +- .../test/cards/single/m12/TurnToFrogTest.java | 3 +- .../single/m14/ChandraPyromasterTest.java | 6 +- .../single/m20/RepeatedReverberationTest.java | 5 +- .../single/m21/ArchfiendsVesselTest.java | 12 ++- .../single/m21/BasrisLieutenantTest.java | 23 +++-- .../single/m21/ChandrasIncineratorTest.java | 5 +- .../single/m21/ChromeReplicatorTest.java | 2 +- .../single/mrd/ChaliceOfTheVoidTest.java | 4 +- .../cards/single/nem/ParallaxWaveTest.java | 4 +- .../test/cards/single/neo/StoryweaveTest.java | 5 +- .../test/cards/single/roe/WorldAtWarTest.java | 2 +- .../single/rtr/NivmagusElementalTest.java | 4 +- .../single/soi/ErdwalIlluminatorTest.java | 2 +- .../single/soi/SilverfurPartisanTest.java | 4 +- .../test/cards/single/tsp/HivestoneTest.java | 2 +- .../cards/single/usd/UrzasIncubatorTest.java | 4 +- .../single/vis/BroodOfCockroachesTest.java | 1 + .../mage/test/cards/single/war/KioraTest.java | 1 + .../cards/single/wwk/MindbreakTrapTest.java | 16 ++-- .../cards/single/zen/BlazingTorchTest.java | 3 +- .../single/znr/MoraugFuryOfAkoumTest.java | 1 + .../cards/targets/TargetRestrictionsTest.java | 4 +- .../test/cards/triggers/BiovisionaryTest.java | 4 + .../EntersTheBattlefieldTriggerTest.java | 10 +- .../cards/triggers/HeartbeatOfSpringTest.java | 2 +- .../cards/triggers/JourneyToNowhereTest.java | 4 +- .../test/cards/triggers/OblivionRingTest.java | 5 +- .../triggers/ReturnToHandEffectsTest.java | 2 +- .../test/cards/triggers/SacredGroundTest.java | 1 + .../triggers/SelvalaHeartOfTheWildsTest.java | 7 +- .../cards/triggers/ShuffleTriggeredTest.java | 4 +- .../test/cards/triggers/SpellskiteTest.java | 3 +- .../cards/triggers/TuvasaTheSunlitTest.java | 2 +- .../triggers/delayed/GlimpseOfNatureTest.java | 6 +- .../cards/triggers/dies/ChildOfAlaraTest.java | 1 + .../triggers/dies/HarvesterOfSoulsTest.java | 3 +- .../cards/triggers/dies/JinxedRingTest.java | 3 +- .../dies/SupernaturalStaminaTest.java | 2 +- .../watchers/EpharaGodOfThePolisTest.java | 2 +- .../commander/FFA3/SerraAscendantTest.java | 2 +- .../commander/duel/CastCommanderTest.java | 2 +- .../duel/CommanderColorChangeTest.java | 14 +-- .../duel/CommanderReplaceEffectTest.java | 2 +- .../piper/ThePrismaticPiperTest8.java | 2 +- .../mage/test/game/ends/GameIsADrawTest.java | 6 +- .../game/ends/PhageTheUntouchableTest.java | 4 +- .../test/lki/LastKnownInformationTest.java | 3 +- .../PlayerDiedStackTargetHandlingTest.java | 5 +- .../multiplayer/PlayerLeftGameRange1Test.java | 23 +---- .../PlayerLeftGameRangeAllTest.java | 3 +- .../BasicSaheeliSublimeArtificerTest.java | 3 +- .../java/org/mage/test/player/TestPlayer.java | 4 +- .../org/mage/test/rollback/ExtraTurnTest.java | 3 +- .../mage/test/rollback/StateValuesTest.java | 2 +- .../org/mage/test/rollback/TransformTest.java | 6 +- .../org/mage/test/testapi/TestAPITest.java | 2 +- .../org/mage/test/turnmod/SkipTurnTest.java | 2 +- 225 files changed, 816 insertions(+), 627 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/e10/PithingNeedleTest.java rename Mage.Tests/src/test/java/org/mage/test/cards/{triggers/ManabarbsTest2.java => single/lea/ManabarbsTest.java} (81%) diff --git a/Mage.Sets/src/mage/cards/b/Battlegrowth.java b/Mage.Sets/src/mage/cards/b/Battlegrowth.java index 262541e1245..4263cb4d84c 100644 --- a/Mage.Sets/src/mage/cards/b/Battlegrowth.java +++ b/Mage.Sets/src/mage/cards/b/Battlegrowth.java @@ -18,6 +18,7 @@ public final class Battlegrowth extends CardImpl { public Battlegrowth(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); + // Put a +1/+1 counter on target creature. this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java index dfc038e1a60..d58de3a1fb8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LevelUpAbilityTest.java @@ -67,6 +67,7 @@ public class LevelUpAbilityTest extends CardTestPlayerBase { for (int i = 0; i < 6; i++) { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Level up {1}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); } setStopAt(2, PhaseStep.END_TURN); @@ -93,6 +94,7 @@ public class LevelUpAbilityTest extends CardTestPlayerBase { for (int i = 0; i < 12; i++) { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Level up {1}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); } setStopAt(2, PhaseStep.END_TURN); @@ -117,6 +119,7 @@ public class LevelUpAbilityTest extends CardTestPlayerBase { for (int i = 0; i < 15; i++) { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Level up {1}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); } setStopAt(2, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/BanisherPriestTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/BanisherPriestTest.java index a12d1928678..93662ddb4f3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/BanisherPriestTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/BanisherPriestTest.java @@ -36,6 +36,7 @@ public class BanisherPriestTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Rockslide Elemental"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Banisher Priest"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); // Let Banisher Priest enter the battlefield, but don't let its ETB ability resolve castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Incinerate", "Banisher Priest"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/GreenbeltRampagerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/GreenbeltRampagerTest.java index 2d94fd80d04..17978597006 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/GreenbeltRampagerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/GreenbeltRampagerTest.java @@ -32,7 +32,7 @@ public class GreenbeltRampagerTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Greenbelt Rampager"); addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); @@ -48,8 +48,8 @@ public class GreenbeltRampagerTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Greenbelt Rampager"); addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Greenbelt Rampager"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); @@ -74,7 +74,7 @@ public class GreenbeltRampagerTest extends CardTestPlayerBase { skipInitShuffling(); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gonti, Lord of Luxury"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gonti, Lord of Luxury", true); // addTarget(playerA, playerB); playerB is autochosen since only option setChoice(playerA, "Greenbelt Rampager"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java index 0941fb5c26a..f6e16f29cde 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/GolemSkinGauntletsTest.java @@ -27,6 +27,7 @@ public class GolemSkinGauntletsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {4}", "Elite Vanguard"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Elite Vanguard"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java index 0230599d387..303f4a76c20 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/HeavyArbalestTest.java @@ -24,6 +24,7 @@ public class HeavyArbalestTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Llanowar Elves"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {4}", "Elite Vanguard"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: {this} deals 2 damage", playerB); setStopAt(3, PhaseStep.BEGIN_COMBAT); @@ -48,7 +49,9 @@ public class HeavyArbalestTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Llanowar Elves"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {4}", "Elite Vanguard"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: {this} deals 2 damage", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {4}", "Llanowar Elves"); setStopAt(5, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BlitzTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BlitzTest.java index 8da07aad586..88990a5535a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BlitzTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BlitzTest.java @@ -96,9 +96,7 @@ public class BlitzTest extends CardTestPlayerBase { } catch (AssertionError e) { Assert.assertEquals( "Shouldn't be able to cast normally from graveyard", - "Missing CAST/ACTIVATE def for turn 1, step PRECOMBAT_MAIN, PlayerA\n" + - "Can't find available command - activate:Cast Tenacious Underdog " + - "(use checkPlayableAbility for \"non available\" checks)", e.getMessage() + "Can't find ability to activate command: Cast Tenacious Underdog", e.getMessage() ); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java index 57f32adde88..c23414012ba 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BloodthirstTest.java @@ -48,7 +48,8 @@ public class BloodthirstTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Bolt"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bloodlord of Vaasgoth"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bloodlord of Vaasgoth", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barony Vampire"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java index 57a746245f1..29642c9a6a8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CascadeTest.java @@ -147,7 +147,8 @@ public class CascadeTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Unsummon"); // Instant {U} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enlisted Wurm"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Unsummon", "Enlisted Wurm"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Unsummon", "Enlisted Wurm", true); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Enlisted Wurm"); setStopAt(1, PhaseStep.END_TURN); @@ -156,7 +157,6 @@ public class CascadeTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Unsummon", 1); assertPermanentCount(playerA, "Silvercoat Lion", 2); assertPermanentCount(playerA, "Enlisted Wurm", 1); - } /** diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java index dee96eae6aa..447b967c7b4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java @@ -196,7 +196,7 @@ public class ConspireTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Sakashima the Impostor"); addCard(Zone.HAND, playerA, "Lightning Bolt"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wort, the Raidmother"); // {4}{R/G}{R/G} + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wort, the Raidmother", true); // {4}{R/G}{R/G} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sakashima the Impostor"); // {2}{U}{U} setChoice(playerA, "Wort, the Raidmother"); @@ -223,7 +223,7 @@ public class ConspireTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Sakashima the Impostor"); addCard(Zone.HAND, playerA, "Lightning Bolt"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wort, the Raidmother"); // {4}{R/G}{R/G} + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wort, the Raidmother", true); // {4}{R/G}{R/G} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sakashima the Impostor"); // {2}{U}{U} setChoice(playerA, "Wort, the Raidmother"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConstellationTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConstellationTest.java index b1b8e8f4914..281a7c33fce 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConstellationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConstellationTest.java @@ -207,6 +207,7 @@ public class ConstellationTest extends CardTestPlayerBase { // give dax a new type (on next turn) -- effects dependacy if (castVampireDifferentWay) { castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Archetype of Courage"); // make dax to creature + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Mephidross Vampire"); // give vampire to creatures } else { // Make sure not white mana is used here to cast the vampire @@ -219,6 +220,7 @@ public class ConstellationTest extends CardTestPlayerBase { activateManaAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {B}"); checkManaPool("after B mana", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "B", 6); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Mephidross Vampire"); // give vampire to creatures + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Archetype of Courage"); // make dax to creature } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java index 9b2c08e5ede..150c0fc9493 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java @@ -102,7 +102,7 @@ public class DeathtouchTest extends CardTestPlayerBase { // Creatures your opponents control get -2/-2. addCard(Zone.BATTLEFIELD, playerB, "Elesh Norn, Grand Cenobite"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Marath, Will of the Wild"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Marath, Will of the Wild", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Marath, Will of the Wild"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeliriumTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeliriumTest.java index bb027aba0cd..6d8737dade9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeliriumTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeliriumTest.java @@ -103,6 +103,7 @@ public class DeliriumTest extends CardTestPlayerBaseWithAIHelps { addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 4); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spirit Mantle", "Balduvian Bears"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Descend upon the Sinful"); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java index 487aeb0ba3a..6514464af70 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java @@ -89,7 +89,7 @@ public class DiscardTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Island", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Liliana's Caress"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Liliana's Caress", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Coercion", playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -103,7 +103,6 @@ public class DiscardTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 18); - } @Test diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EmbalmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EmbalmTest.java index ef88ab5cbab..9d99b55eaa7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EmbalmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EmbalmTest.java @@ -7,6 +7,11 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** + * 702.128. Embalm + * 702.128a Embalm is an activated ability that functions while the card with embalm is in a graveyard. + * “Embalm [cost]” means + * “[Cost], Exile this card from your graveyard: Create a token that’s a copy of this card, except it’s white, it has no mana cost, and it’s a Zombie in addition to its other types. Activate only as a sorcery.” + * 702.128b A token is “embalmed” if it’s created by a resolving embalm ability. * * @author noxx */ @@ -44,7 +49,6 @@ public class EmbalmTest extends CardTestPlayerBase { assertPermanentCount(playerA, aSanctions, 1); assertPermanentCount(playerB, yOx, 0); assertPermanentCount(playerB, wKnight, 1); - } /* @@ -92,11 +96,10 @@ public class EmbalmTest extends CardTestPlayerBase { assertGraveyardCount(playerA, aSanctions, 0); } - /* + /** + * Reported bug: https://github.com/magefree/mage/issues/3144 * Tests that not only creature targeted by original creature is returned. * After using Embalm creature will exile another creature and should return it back when leaves battlefield. - * - * Bug: #3144 */ @Test public void testCreatureExiledByEmbalmCreatureReturns() { @@ -123,13 +126,13 @@ public class EmbalmTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, aSanctions); addTarget(playerA, yOx); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, dBlade); - // Angel of Sanction is auto-chosen since only option - waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); + + castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, dBlade, aSanctions); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Embalm"); addTarget(playerA, wKnight); - castSpell(1, PhaseStep.END_TURN, playerB, dBlade); - addTarget(playerB, aSanctions); + + castSpell(1, PhaseStep.END_TURN, playerB, dBlade, aSanctions); setStopAt(1, PhaseStep.CLEANUP); execute(); @@ -138,7 +141,6 @@ public class EmbalmTest extends CardTestPlayerBase { assertPermanentCount(playerA, aSanctions, 0); assertPermanentCount(playerB, yOx, 1); // second creature should also return after embalm token leaves battlefield - // Bug: #3144 assertPermanentCount(playerB, wKnight, 1); assertGraveyardCount(playerA, aSanctions, 0); assertGraveyardCount(playerB, dBlade, 2); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java index e34b61c5289..3f67acf2d13 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java @@ -216,12 +216,12 @@ public class EvolveTest extends CardTestPlayerBase { // Evolve addCard(Zone.HAND, playerA, "Adaptive Snapjaw", 1); // {4}{G} - Creature 6/2 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ivy Lane Denizen"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ivy Lane Denizen", true); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Renegade Krasis"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Renegade Krasis", true); addTarget(playerA, "Ivy Lane Denizen"); // Ivy target - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ivy Lane Denizen"); // Renegade Krasis evolves + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ivy Lane Denizen", true); // Renegade Krasis evolves addTarget(playerA, "Renegade Krasis"); // Ivy target setChoice(playerA, "Whenever another green creature"); // So +1/+1 counter from Renegade is first put onto Ivy diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ExploitTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ExploitTest.java index 1cd796bc6ad..ce7939331ff 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ExploitTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ExploitTest.java @@ -64,10 +64,12 @@ public class ExploitTest extends CardTestPlayerBase { setStrictChooseMode(true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silumgar Butcher"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silumgar Butcher"); - setChoice(playerA, true); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); + setChoice(playerA, true); // Choose to exploit addTarget(playerA, "Silvercoat Lion"); // sacrifice to Exploit + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silumgar Butcher"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java index 556a31968a5..8d37318a81c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java @@ -293,7 +293,8 @@ public class FlashbackTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback"); addTarget(playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Runic Repetition"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Runic Repetition", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silent Departure", "Silvercoat Lion"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -567,19 +568,20 @@ public class FlashbackTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Flashback$spellOnStack=Lightning Bolt")) { Assert.fail("Should have thrown error about not being able to play Force of Will, but got:\n" + e.getMessage()); } } - assertPermanentCount(playerA, "Snapcaster Mage", 0); - - assertGraveyardCount(playerA, "Snapcaster Mage", 1); - assertGraveyardCount(playerA, "Force of Will", 1); - - assertGraveyardCount(playerB, "Lightning Bolt", 1); - - assertLife(playerA, 20); + // TODO: Re-enable when checkPlayableAbility can be used instead of try-catch +// assertPermanentCount(playerA, "Snapcaster Mage", 0); +// +// assertGraveyardCount(playerA, "Snapcaster Mage", 1); +// assertGraveyardCount(playerA, "Force of Will", 1); +// +// assertGraveyardCount(playerB, "Lightning Bolt", 1); +// +// assertLife(playerA, 20); } /** @@ -597,7 +599,7 @@ public class FlashbackTest extends CardTestPlayerBase { // Flashback-{1}{U}, Pay 3 life. addCard(Zone.HAND, playerA, "Deep Analysis"); // {3}{U} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Deep Analysis"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Deep Analysis", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java index cf67fc91e81..2b6dbb9c15c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java @@ -191,6 +191,7 @@ public class InfectTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Island", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Corrupted Conscience", "Phyrexian Obliterator"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enslave", "Phyrexian Obliterator"); setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/JumpStartTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/JumpStartTest.java index 985a66c9ac5..09a7b1d2fd2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/JumpStartTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/JumpStartTest.java @@ -25,6 +25,7 @@ public class JumpStartTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 2/2 castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current with jump-start", playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -52,6 +53,7 @@ public class JumpStartTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Island", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Direct Current with jump-start", playerB); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Counterspell", "Direct Current"); @@ -86,6 +88,7 @@ public class JumpStartTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 2/2 castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Direct Current", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Experimental Frenzy"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Direct Current with jump-start", playerB); 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 84e6f8d7c3f..bdc78e423e4 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 @@ -268,12 +268,13 @@ public class KickerTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Sunscape Battlemage", 1); } + /** + * Reported Bug: + * Hallar Not Procing Right: When I kick Thornscape Battlemage it doesn't proc Hallar effect for some reason. + * I tried this 3 times and it never triggered properly. + */ @Test public void test_Conditional_TriggeredAbilityMustSeeMultikickedStatus() { - // bug: - // Hallar Not Procing Right: When I kick Thornscape Battlemage it doesn't proc Hallar effect for some reason. - // I tried this 3 times and it never triggered properly. - // Kicker {R} and/or {W} (You may pay an additional {R} and/or {W} as you cast this spell.) // When Thornscape Battlemage enters the battlefield, if it was kicked with its {R} kicker, it deals 2 damage to any target. // When Thornscape Battlemage enters the battlefield, if it was kicked with its {W} kicker, destroy target artifact. @@ -300,14 +301,15 @@ public class KickerTest extends CardTestPlayerBase { assertLife(playerB, 20 - 2 - 1); // 2 damage from kicked spell, 1 damage from hallar's trigger } + /** + * Reported Bug: + * If a creature is cast with kicker, dies, and is then returned to play + * from graveyard, it still behaves like it were kicked. + * I noticed this while testing some newly implemented cards, but it can be reproduced for + * example by Zombifying a Gatekeeper of Malakir. + */ @Test public void test_ZCC_ReturnedPermanentMustNotBeKicked() { - // bug: - // If a creature is cast with kicker, dies, and is then returned to play - // from graveyard, it still behaves like it were kicked. I noticed this - // while testing some newly implemented cards, but it can be reproduced for - // example by Zombifying a Gatekeeper of Malakir. - addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); // Kicker {B} (You may pay an additional {B} as you cast this spell.) @@ -342,14 +344,15 @@ public class KickerTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Gatekeeper of Malakir", 1); } + /** + * Reported Bug: https://github.com/magefree/mage/issues/7192 + * Krark, the thumbless and a copy of him are on the field, and I cast Rite of replication kicked. + * The first coinflip fails and returns it to my hand, and the second coinflip wins and copies it, + * but does not copy the kicked part. + * I believe I did this before in another game and the first flip won then it would be a kicked copy. + */ @Test public void test_ZCC_CopiedSpellMustKeepKickerStatus() { - // https://github.com/magefree/mage/issues/7192 - // bug: Krark, the thumbless and a copy of him are on the field, and I cast Rite of replication kicked. - // The first coinflip fails and returns it to my hand, and the second coinflip wins and copies it, - // but does not copy the kicked part. I believe I did this before in another game and the first flip - // won then it would be a kicked copy. - // Whenever you cast an instant or sorcery spell, you may copy that spell. You may choose new targets for the copy. addCard(Zone.BATTLEFIELD, playerA, "Swarm Intelligence", 1); // @@ -385,10 +388,11 @@ public class KickerTest extends CardTestPlayerBase { assertLife(playerA, 20 - 2 * 2); } + /** + * Copied spell must have access to kicker status. + */ @Test public void test_ZCC_CopiedSpellMustHaveIndependentZCC_InSpell() { - // reason: copied spell must have access to kicker status - // Whenever you cast an instant or sorcery spell, you may copy that spell. You may choose new targets for the copy. addCard(Zone.BATTLEFIELD, playerA, "Swarm Intelligence", 1); // @@ -446,10 +450,11 @@ public class KickerTest extends CardTestPlayerBase { assertLife(playerA, 20 - 2 + 3); } + /** + * Static ability from copied spell's permanent must have access to kicker status + */ @Test public void test_ZCC_CopiedSpellMustHaveIndependentZCC_InStaticAbility() { - // reason: static ability from copied spell's permanent must have access to kicker status - // {4}, {T}: Copy target permanent spell you control. addCard(Zone.BATTLEFIELD, playerA, "Lithoform Engine", 1); addCard(Zone.BATTLEFIELD, playerA, "Island", 4); @@ -559,10 +564,7 @@ public class KickerTest extends CardTestPlayerBase { attack(1, playerA, "Raging Goblin"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); - - // Attack must be restricted, so no attack commands available - setStopAt(1, PhaseStep.END_TURN); + setStopAt(1, PhaseStep.END_COMBAT); try { execute(); @@ -574,6 +576,21 @@ public class KickerTest extends CardTestPlayerBase { } } + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + + // Attack must be restricted, so no attack commands available + setStopAt(1, PhaseStep.END_TURN); + + try { + execute(); + + Assert.fail("must throw exception on execute"); + } catch (Throwable e) { + if (!e.getMessage().contains("Cast Lightning Bolt$targetPlayer=PlayerA")) { + Assert.fail("Should have thrown error about not being able to attack with Raging Golin, but got:\n" + e.getMessage()); + } + } + assertGraveyardCount(playerA, "Orim's Chant", 1); assertGraveyardCount(playerB, "Lightning Bolt", 0); @@ -581,12 +598,13 @@ public class KickerTest extends CardTestPlayerBase { assertLife(playerB, 20); } + /** + * Reported Bug: + * Bloodhusk Ritualist's discard trigger does nothing if the Ritualist + * leaves the battlefield before the trigger resolves. + */ @Test public void test_Single_BloodhuskRitualist() { - // bug: - // Bloodhusk Ritualist's discard trigger does nothing if the Ritualist - // leaves the battlefield before the trigger resolves. - addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); addCard(Zone.HAND, playerB, "Lightning Bolt"); addCard(Zone.HAND, playerB, "Fireball", 2); @@ -599,6 +617,7 @@ public class KickerTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bloodhusk Ritualist"); setChoice(playerA, true, 2); // 2 x Multikicker setChoice(playerA, false); // stop the kicking + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Bloodhusk Ritualist"); addTarget(playerA, playerB); // target for kicker's trigger (discard cards) @@ -614,13 +633,15 @@ public class KickerTest extends CardTestPlayerBase { assertHandCount(playerB, 0); } + /** + * Reported Bug: + * Paying the Kicker on "Marsh Casualties" has no effect. + * Target player's creatures still only get -1/-1 instead of -2/-2. + * Was playing against AI. + * It was me who cast the spell. + */ @Test public void test_Single_MarshCasualties() { - // bug: - // Paying the Kicker on "Marsh Casualties" has no effect. Target player's - // creatures still only get -1/-1 instead of -2/-2. Was playing against AI. - // It was me who cast the spell. - addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); // Kicker {3} @@ -668,10 +689,12 @@ public class KickerTest extends CardTestPlayerBase { assertCounterCount(playerA, "Ardent Soldier", CounterType.P1P1, 1); // from kicker } + /** + * Reported Bug: + * Can cast Thieving Skydiver with kicker's X = 0 on Etali, Primal Storm + */ @Test public void test_FreeCast_MinXValueMustWork() { - // bug: - // Can cast Thieving Skydiver with kicker's X = 0 on Etali, Primal Storm skipInitShuffling(); // Kicker {X}. X can't be 0. diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MeldTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MeldTest.java index e9c7d7f6beb..aa514234b09 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MeldTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MeldTest.java @@ -42,8 +42,8 @@ public class MeldTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerB must have 0 actions but found 1")) { - Assert.fail("Should have thrown error about cannot attack, but got:\n" + e.getMessage()); + if (!e.getMessage().contains("Cast Silvercoat Lion")) { + Assert.fail("Should have thrown error about casting Silvercoat Lion, but got:\n" + e.getMessage()); } } @@ -85,7 +85,7 @@ public class MeldTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bruna, the Fading Light"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Gisela, the Broken Blade"); - castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Vanish into Memory", "Brisela, Voice of Nightmares"); + castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Vanish into Memory", "Brisela, Voice of Nightmares", true); castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); setStopAt(4, PhaseStep.BEGIN_COMBAT); @@ -127,10 +127,11 @@ public class MeldTest extends CardTestPlayerBase { // If you do, discard cards equal to that creature's toughness. addCard(Zone.HAND, playerB, "Vanish into Memory", 1); // Instant {2}{W}{U} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bruna, the Fading Light"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Gisela, the Broken Blade"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bruna, the Fading Light", true); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion", true); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Gisela, the Broken Blade", true); castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Vanish into Memory", "Brisela, Voice of Nightmares"); + waitStackResolved(4, PhaseStep.PRECOMBAT_MAIN); castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); // End step turn 7 the meld takes place again 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 7dc30a6512a..9526615f50f 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 @@ -40,7 +40,7 @@ public class ModularTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Arcbound Bruiser"); addCard(Zone.HAND, playerA, "Arcbound Hybrid"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Bruiser"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Bruiser", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Hybrid"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -61,8 +61,8 @@ public class ModularTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Arcbound Hybrid"); addCard(Zone.HAND, playerA, "Lightning Bolt"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Bruiser"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Hybrid"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Bruiser", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcbound Hybrid", true); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Arcbound Bruiser"); setStopAt(3, PhaseStep.BEGIN_COMBAT); setChoice(playerA, true); @@ -143,21 +143,18 @@ 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, true, 2); - checkStackSize("stack1", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 1); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); // kill lancer with one +1/+1 counter on it castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flame Slash", "Arcbound Lancer"); waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, true); - checkStackSize("stack2", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 1); // in response to modular trigger, return lancer to the battlefield - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Makeshift Mannequin", "Arcbound Lancer"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Makeshift Mannequin", "Arcbound Lancer", "When it dies"); waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, true); - checkStackSize("stack3", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 2); // kill lancer again with original modular trigger on the stack - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murder", "Arcbound Lancer"); - checkStackSize("stack4", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 2); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murder", "Arcbound Lancer", "When it dies"); setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java index d07f91a7189..856424ceb5c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java @@ -417,6 +417,7 @@ public class MorphTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Birchlore Rangers"); setChoice(playerA, true); // cast it face down as 2/2 creature + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Swords to Plowshares", ""); @@ -456,6 +457,7 @@ public class MorphTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ashcloud Phoenix"); setChoice(playerA, true); // cast it face down as 2/2 creature + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", EmptyNames.FACE_DOWN_CREATURE.toString()); @@ -661,7 +663,7 @@ public class MorphTest extends CardTestPlayerBase { try { execute(); } catch (Throwable e) { - if (!e.getMessage().contains("Can't find available command - activate:Cast Rattleclaw Mystic (use checkPlayableAbility for \"non available\" checks)")) { + if (!e.getMessage().contains("Cast Rattleclaw Mystic")) { Assert.fail("Should have gotten an error about not being able to cast Rattleclaw, but got:\n" + e.getMessage()); } } @@ -899,6 +901,7 @@ public class MorphTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Quicksilver Dragon"); setChoice(playerA, true); // cast it face down as 2/2 creature + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", EmptyNames.FACE_DOWN_CREATURE.toString()); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java index 7dc57180962..7f058d77482 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java @@ -61,7 +61,7 @@ public class PhasingTest extends CardTestPlayerBase { // {R}: Enchanted creature gets +1/+0 until end of turn. addCard(Zone.HAND, playerA, "Firebreathing", 1); // {R} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Tolarian Drake"); setStopAt(3, PhaseStep.PRECOMBAT_MAIN); @@ -83,7 +83,7 @@ public class PhasingTest extends CardTestPlayerBase { // {R}: Enchanted creature gets +1/+0 until end of turn. addCard(Zone.HAND, playerA, "Firebreathing", 1); // {R} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Tolarian Drake"); setStopAt(5, PhaseStep.PRECOMBAT_MAIN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java index aefbf9b16f8..a2de1fca9b6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java @@ -60,7 +60,7 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Trusted Forcemage", 2); addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -188,6 +188,7 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Act of Treason", "Trusted Forcemage"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Elite Vanguard"); setStopAt(2, PhaseStep.BEGIN_COMBAT); @@ -216,6 +217,7 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Act of Treason", "Trusted Forcemage"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Elite Vanguard"); setStopAt(3, PhaseStep.PRECOMBAT_MAIN); // Effect of "Act of Treason" will end here @@ -261,6 +263,7 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Blinkmoth Nexus", 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: "); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -302,6 +305,7 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Blinkmoth Nexus", 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: "); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage"); setStopAt(2, PhaseStep.PRECOMBAT_MAIN); @@ -330,8 +334,8 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Bolt", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Elite Vanguard"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Trusted Forcemage", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Elite Vanguard"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Phantasmal Bear"); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java index 3473fc9cf87..5a548a8eb22 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java @@ -243,13 +243,13 @@ public class StormTest extends CardTestPlayerBase { // Storm addCard(Zone.HAND, playerA, "Mind's Desire", 1); // {4}{U}{U} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wheel of Fortune"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mox Emerald"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Turnabout"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wheel of Fortune", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mox Emerald", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Turnabout", true); setChoice(playerA, "Land"); setChoice(playerA, false); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yawgmoth's Will"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Palinchron"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yawgmoth's Will", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Palinchron", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind's Desire"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -264,7 +264,5 @@ public class StormTest extends CardTestPlayerBase { assertExileCount("Mind's Desire", 1); assertExileCount(playerA, 8); // 6 from Mind's Desire and the Desire and the Yawgmoth's Will - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SurgeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SurgeTest.java index 70047064ed6..98707f1d1f1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SurgeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SurgeTest.java @@ -45,7 +45,7 @@ public class SurgeTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Bolt"); addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); - // Create a tokenonto the battlefield that's a copy of target creature you control. + // Create a token that's a copy of target creature you control. // Flashback {5}{U}{U}(You may cast this card from your graveyard for its flashback cost. Then exile it.) addCard(Zone.HAND, playerB, "Cackling Counterpart"); addCard(Zone.BATTLEFIELD, playerB, "Island", 3); @@ -53,6 +53,7 @@ public class SurgeTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cackling Counterpart", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crush of Tentacles with surge"); @@ -81,6 +82,7 @@ public class SurgeTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Bolt"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tyrant of Valakut"); addTarget(playerA, playerB); @@ -106,6 +108,7 @@ public class SurgeTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Containment Membrane", "Silvercoat Lion"); setStopAt(2, PhaseStep.PRECOMBAT_MAIN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java index 364477bf616..d0dfc18d5c9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java @@ -1,5 +1,6 @@ package org.mage.test.cards.abilities.keywords; +import mage.cards.s.SpringOfEternalPeace; import mage.constants.CardType; import mage.constants.PhaseStep; import mage.constants.Zone; @@ -28,10 +29,11 @@ public class TransformTest extends CardTestPlayerBase { // {G}{G}, Sacrifice Rootrunner: Put target land on top of its owner's library. addCard(Zone.BATTLEFIELD, playerB, "Rootrunner"); // {2}{G}{G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer", true); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest"); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "{G}{G}", "Swamp"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "+1: Reveal"); setStopAt(1, PhaseStep.END_TURN); @@ -167,6 +169,7 @@ public class TransformTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Island", 9); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Startled Awake", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}{U}{U}"); @@ -189,6 +192,7 @@ public class TransformTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Maskwood Nexus"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Startled Awake", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}{U}{U}"); @@ -396,8 +400,8 @@ public class TransformTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Huntmaster of the Fells"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Huntmaster of the Fells", true); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); setStopAt(4, PhaseStep.PRECOMBAT_MAIN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java index da003dc282a..8514489f9ef 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java @@ -141,6 +141,7 @@ public class UndyingTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Anafenza, the Foremost"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Butcher Ghoul"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Butcher Ghoul"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityByEquipmentTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityByEquipmentTest.java index 7f8c4392028..2d3c8092506 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityByEquipmentTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityByEquipmentTest.java @@ -27,7 +27,7 @@ public class LoseAbilityByEquipmentTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Cobbled Wings"); // gives Flying castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Magebane Armor"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cobbled Wings"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cobbled Wings", true); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {1}", "Silvercoat Lion"); // give Flying activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Equip {2}", "Silvercoat Lion"); // lose Flying diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java index cd5a799c34d..632590e0426 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/lose/LoseAbilityTest.java @@ -23,7 +23,7 @@ public class LoseAbilityTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Air Elemental"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grounded", "Elite Vanguard"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grounded", "Air Elemental"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grounded", "Air Elemental"); setStopAt(2, PhaseStep.END_TURN); execute(); @@ -53,7 +53,7 @@ public class LoseAbilityTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Drake Umbra"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grounded", "Air Elemental"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Drake Umbra", "Air Elemental"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Drake Umbra", "Air Elemental"); setStopAt(2, PhaseStep.END_TURN); execute(); @@ -81,7 +81,9 @@ public class LoseAbilityTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Drake Umbra", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Drake Umbra", "Air Elemental"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Drake Umbra", "Air Elemental"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grounded", "Air Elemental"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java index e4db367ee62..451d718000e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java @@ -78,7 +78,7 @@ public class CounterspellTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Memory Lapse", "Lightning Bolt"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Twincast", "Memory Lapse"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Twincast", "Memory Lapse", "Memory Lapse"); setChoice(playerA, true); // change the target addTarget(playerA, "Memory Lapse"); @@ -112,7 +112,7 @@ public class CounterspellTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Lightning Bolt"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Twincast", "Counterspell"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Twincast", "Counterspell", "Counterspell"); setChoice(playerA, true); // change the target addTarget(playerA, "Counterspell"); @@ -146,7 +146,7 @@ public class CounterspellTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Dissipate", "Lightning Bolt"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Twincast", "Dissipate"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Twincast", "Dissipate", "Dissipate"); setChoice(playerA, true); // change the target addTarget(playerA, "Dissipate"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/ForceOfWillTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/ForceOfWillTest.java index 77eb9337141..4b9852531ce 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/ForceOfWillTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/ForceOfWillTest.java @@ -47,7 +47,7 @@ public class ForceOfWillTest extends CardTestPlayerBase { } /** - * Test that Force of Will can'be played with alternate casting costs + * Test that Force of Will can't be played with alternate casting costs * if no blue card is in hand and not enough mana available */ @Test @@ -55,7 +55,7 @@ public class ForceOfWillTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Thoughtseize"); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); - // No Red cards in hand + // No other Blue cards in hand addCard(Zone.HAND, playerB, "Force of Will"); addCard(Zone.HAND, playerB, "Fireball", 2); @@ -75,15 +75,9 @@ public class ForceOfWillTest extends CardTestPlayerBase { execute(); Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Can't find available command - activate:Cast Force of Will$target=Thoughtseize")) { - Assert.fail("must throw error about bad targets, but got:\n" + e.getMessage()); + if (!e.getMessage().contains("Cast Force of Will$target=Thoughtseize")) { + Assert.fail("must throw error about not being able to cast Force of Will, but got:\n" + e.getMessage()); } } - - assertLife(playerA, 18); - assertLife(playerB, 20); // losing 1 from Force of Will - - assertHandCount(playerB, 2); // 1 Fireball 1 Force of Will - assertGraveyardCount(playerB, 1); // 1 Fireball discarded because of Thoughseize } } \ No newline at end of file diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java index 06958c05f78..865d8586ee3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/SecondGuessTest.java @@ -85,17 +85,17 @@ public class SecondGuessTest extends CardTestPlayerBase { */ @Test public void testOverallCount() { + addCard(Zone.HAND, playerA, "Second Guess"); addCard(Zone.HAND, playerA, "Lightning Bolt"); addCard(Zone.BATTLEFIELD, playerA, "Mountain"); addCard(Zone.BATTLEFIELD, playerA, "Island", 2); - addCard(Zone.HAND, playerA, "Second Guess"); addCard(Zone.HAND, playerB, "Shock"); addCard(Zone.BATTLEFIELD, playerB, "Mountain"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Shock", playerA); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Second Guess", "Shock"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Second Guess", "Shock", "Shock"); setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java index 2ac1f0e8bd4..26813fa512a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/ExileAndReturnTest.java @@ -24,7 +24,7 @@ public class ExileAndReturnTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}, {T}", "Silvercoat Lion"); @@ -80,8 +80,9 @@ public class ExileAndReturnTest extends CardTestPlayerBase { // Whenever an Aura becomes attached to Bramble Elemental, put two 1/1 green Saproling creature tokens onto the battlefield. addCard(Zone.BATTLEFIELD, playerB, "Bramble Elemental"); // Creature 4/4 - // Put a +1/+1 counter on target creature. + addCard(Zone.BATTLEFIELD, playerB, "Forest", 5); + // Put a +1/+1 counter on target creature. addCard(Zone.HAND, playerB, "Battlegrowth"); // Instant {G} // Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.) // Enchanted creature gets +1/+1 for each Forest you control. @@ -91,10 +92,12 @@ public class ExileAndReturnTest extends CardTestPlayerBase { // Enchanted creature has reach. (It can block creatures with flying.) addCard(Zone.HAND, playerB, "Frog Tongue"); // Enchantment Aura {G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin", true); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Battlegrowth", "Bramble Elemental"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Blanchwood Armor", "Bramble Elemental"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Frog Tongue", "Bramble Elemental"); activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{3}, {T}", "Bramble Elemental"); @@ -130,7 +133,7 @@ public class ExileAndReturnTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Disenchant"); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}, {T}", "Silvercoat Lion"); @@ -145,6 +148,5 @@ public class ExileAndReturnTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Tawnos's Coffin", 1); assertPermanentCount(playerB, "Silvercoat Lion", 1); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/AuratouchedMageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/AuratouchedMageTest.java index f5dd0a2ee9c..ca613bd3141 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/AuratouchedMageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/AuratouchedMageTest.java @@ -8,34 +8,41 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** + * {@link mage.cards.a.AuratouchedMage Auratouched Mage} + * Creature — Human Wizard 3/3 + * {5}{W} + * + * When Auratouched Mage enters the battlefield, search your library for an Aura card that could enchant it. + * If Auratouched Mage is still on the battlefield, put that Aura card onto the battlefield attached to it. + * Otherwise, reveal the Aura card and put it into your hand. + * Then shuffle. * * @author jeffwadsworth */ public class AuratouchedMageTest extends CardTestPlayerBase { /** - * Auratouched Mage Creature — Human Wizard 3/3, 5W When Auratouched Mage - * enters the battlefield, search your library for an Aura card that could - * enchant it. If Auratouched Mage is still on the battlefield, put that - * Aura card onto the battlefield attached to it. Otherwise, reveal the Aura - * card and put it into your hand. Then shuffle your library. + * If Auramage's type is changed in the time between it entering the battlefield and its ETB ability resolving, you + * must be able to search for an Aura that can legally target it with whatever types it has at the ability resolves. * + * Relevant Ruling: + * Any Aura card you find must be able to enchant Auratouched Mage as it currently exists, + * or as it most recently existed on the battlefield if it’s no longer on the battlefield. + * If an effect has made the Mage an artifact, for example, you could search for an Aura with “enchant artifact.” + * (2005-10-01) */ - - //If someone knows the way to elegantly handle the test mechanism in regards to no valid targets, please modify. The test works fine in practice. - @Ignore + @Test public void testAuratouchedMageEffectHasMadeIntoTypeArtifact() { - //Any Aura card you find must be able to enchant Auratouched Mage as it currently exists, or as it most recently existed on the battlefield if it's no - //longer on the battlefield. If an effect has made the Mage an artifact, for example, you could search for an Aura with “enchant artifact.” //Expected result: An effect has made Auratouched Mage into an artifact upon entering the battlefield. An aura that only works on artifacts should work. - addCard(Zone.BATTLEFIELD, playerA, "Plains", 7); - addCard(Zone.BATTLEFIELD, playerA, "Island", 7); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 8); addCard(Zone.HAND, playerA, "Auratouched Mage"); //5W cost addCard(Zone.HAND, playerA, "Argent Mutation"); //2U cost. Target is an artifact until end of turn addCard(Zone.LIBRARY, playerA, "Relic Ward"); //Only enchants an artifact permanent castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Auratouched Mage"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Argent Mutation", "Auratouched Mage"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); // Wait for Auratouched Mage to ETB + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Argent Mutation", "Auratouched Mage"); // Turn it into an artifact before its ETB ability resolves setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -43,9 +50,11 @@ public class AuratouchedMageTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Auratouched Mage", 1); assertPermanentCount(playerA, "Relic Ward", 1); - } + /** + * Auratouched Mage's ETB ability resolves with it alive, so Aura should be equipped to it. + */ @Test public void testGainsLegalAura() { // Expected result: Brainwash gets placed on Auratouched Mage @@ -61,21 +70,22 @@ public class AuratouchedMageTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Auratouched Mage", 1); assertPermanentCount(playerA, "Brainwash", 1); - } - //If someone knows the way to elegantly handle the test mechanism in regards to no valid targets, please modify. The test works fine in practice. + /** + * Auratouched Mage's ETB ability resolves, but they're dead, so the legal aura (Brainwash) gets put into Auratouched Mage's controller's hand. + */ @Test public void testAuratouchedMageNotOnBattlefield() { - // Expected result: Auratouched Mage is exiled immediately after entering the battlefield, the legal aura (Brainwash) gets put into controller's hand addCard(Zone.BATTLEFIELD, playerA, "Plains", 7); addCard(Zone.HAND, playerA, "Auratouched Mage"); addCard(Zone.HAND, playerA, "Swords to Plowshares"); //exiles Auratouched Mage - addCard(Zone.LIBRARY, playerA, "Brainwash"); //valid aura for Auratouched Mage + addCard(Zone.LIBRARY, playerA, "Brainwash"); // valid aura for Auratouched Mage addCard(Zone.LIBRARY, playerA, "Animate Wall"); //not a valid aura for the Auratouched Mage castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Auratouched Mage"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swords to Plowshares", "Auratouched Mage"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); // Wait for the Auratouched Mage to enter + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swords to Plowshares", "Auratouched Mage"); // It's ETB is still on the stack setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -83,8 +93,7 @@ public class AuratouchedMageTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Auratouched Mage", 0); assertPermanentCount(playerA, "Brainwash", 0); - assertHandCount(playerA, "Brainwash", 1); + assertHandCount(playerA, "Brainwash", 1); // In hand since Auratouched Mage died before ability resolved assertLibraryCount(playerA, "Animate Wall", 1); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/ChorusOfTheConclaveTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/ChorusOfTheConclaveTest.java index a280eee9275..60f841a0ab9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/ChorusOfTheConclaveTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/ChorusOfTheConclaveTest.java @@ -69,7 +69,7 @@ public class ChorusOfTheConclaveTest extends CardTestPlayerBase { // Creature spells you cast cost {1} less to cast for each creature you control with a +1/+1 counter on it. addCard(Zone.HAND, playerA, "Hamza, Guardian of Arashin"); // {4}{G}{W} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Roughrider"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Roughrider", true); setChoice(playerA, true); setChoice(playerA, "X=1"); @@ -78,6 +78,7 @@ public class ChorusOfTheConclaveTest extends CardTestPlayerBase { setChoice(playerA, "X=1"); playLand(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mountain"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Akki Drillmaster"); setChoice(playerA, true); setChoice(playerA, "X=1"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/EndTurnEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/EndTurnEffectTest.java index 841c8e177d7..cc2eceb4565 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/EndTurnEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/EndTurnEffectTest.java @@ -133,6 +133,7 @@ public class EndTurnEffectTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Disenchant"); //Instant {1}{W} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sundial of the Infinite"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disenchant", "Sundial of the Infinite"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1},", TestPlayer.NO_TARGET, "Disenchant"); @@ -146,6 +147,5 @@ public class EndTurnEffectTest extends CardTestPlayerBase { assertHandCount(playerA, 7); // Discard to maximum hand size assertHandCount(playerB, 1); // 1 card drawn at start of 2nd turn - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/GainAbilitiesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/GainAbilitiesTest.java index a3ec556cf8c..242898b65e4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/GainAbilitiesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/GainAbilitiesTest.java @@ -26,6 +26,7 @@ public class GainAbilitiesTest extends CardTestPlayerBase { // attach all castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "@attach.1", "@bear"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "@attach.2", "@bear"); waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); checkAbility("after", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "@bear", VigilanceAbility.class, true); @@ -50,9 +51,8 @@ public class GainAbilitiesTest extends CardTestPlayerBase { // attach all castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "@attach.1", "@bear"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "@attach.2", "@bear"); waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); - //checkAbility("after", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "@bear", VigilanceAbility.class, true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "@attach.2", "@bear"); setStrictChooseMode(true); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/LimitedCountedActivationsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/LimitedCountedActivationsTest.java index 74b14b0b2f9..0374b141cca 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/LimitedCountedActivationsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/LimitedCountedActivationsTest.java @@ -103,7 +103,7 @@ public class LimitedCountedActivationsTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: "); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Dragon Whelp"); + castSpell(1, PhaseStep.UPKEEP, playerB, "Terror", "Dragon Whelp"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reanimate", "Dragon Whelp"); castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Unnatural Speed", "Dragon Whelp"); @@ -149,9 +149,11 @@ public class LimitedCountedActivationsTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: "); activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: "); activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: "); + waitStackResolved(1, PhaseStep.UPKEEP); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Dragon Whelp"); + castSpell(1, PhaseStep.UPKEEP, playerB, "Terror", "Dragon Whelp"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reanimate", "Dragon Whelp"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Unnatural Speed", "Dragon Whelp"); activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "{R}: "); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java index 59538e2fcf3..7a0ca61dfa8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/AlchemistsRefugeTest.java @@ -23,7 +23,7 @@ public class AlchemistsRefugeTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Elite Vanguard"); activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{G}{U}, {T}:"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard"); + castSpell(2, PhaseStep.BEGIN_COMBAT, playerA, "Elite Vanguard"); setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/CastAsInstantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/CastAsInstantTest.java index 002973c0f5a..5c32c90f343 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/CastAsInstantTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/CastAsInstantTest.java @@ -25,7 +25,7 @@ public class CastAsInstantTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Silvercoat Lion", 2); - castSpell(1, PhaseStep.UPKEEP, playerB, "Quicken"); + castSpell(1, PhaseStep.UPKEEP, playerB, "Quicken", true); castSpell(1, PhaseStep.UPKEEP, playerB, "Witness the End", playerA); setStopAt(1, PhaseStep.PRECOMBAT_MAIN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java index 228c458520e..73d4f9c358e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java @@ -46,7 +46,7 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBaseWithAIHelps { try { execute(); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Worldheart Phoenix")) { Assert.fail("Must have thrown error about not being able to cast Worldheart Phoenix, but got:\n" + e.getMessage()); } } @@ -102,8 +102,8 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBaseWithAIHelps { checkPlayableAbility("Can't cast Silvercoat", 2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Cast Silvercoat", false); // CAN cast from exile - castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Abzan Banner"); - castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Dragon Grip", "Narset, Enlightened Master"); + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Abzan Banner", true); + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Dragon Grip", "Narset, Enlightened Master", true); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Peach Garden Oath"); setStopAt(2, PhaseStep.END_TURN); @@ -245,9 +245,10 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBaseWithAIHelps { addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{W}{U}{B}{R}{G}: Exile"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Karn's Temporal Sundering"); addTarget(playerA, playerA); addTarget(playerA, "Silvercoat Lion"); @@ -291,9 +292,11 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBaseWithAIHelps { addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{W}{U}{B}{R}{G}: Exile"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Karn's Temporal Sundering"); addTarget(playerA, playerA); addTarget(playerA, "Golos, Tireless Pilgrim"); // Return to hand @@ -341,7 +344,7 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBaseWithAIHelps { attack(2, playerB, "Fallen Shinobi"); - castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Tormenting Voice"); + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Tormenting Voice", true); setChoice(playerB, "Pillarfield Ox"); // Discord for Tormenting Voice castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Demon of Catastrophes"); @@ -391,7 +394,7 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBaseWithAIHelps { attack(2, playerB, "Fallen Shinobi"); - castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Angelic Purge"); + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Angelic Purge", true); setChoice(playerB, "Silvercoat Lion"); // Sacrifice for Purge addTarget(playerB, "Amulet of Kroog"); // Exile with Purge @@ -451,7 +454,7 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBaseWithAIHelps { // cast purge from exile checkPlayableAbility("after exile - can play purge", 2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Cast Angelic Purge", true); - castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Angelic Purge"); + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Angelic Purge", true); setChoice(playerB, "Silvercoat Lion"); // sacrifice cost addTarget(playerB, "Amulet of Kroog"); // exile target diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayTopCardFromLibraryTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayTopCardFromLibraryTest.java index 667b3905307..126a34706ff 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayTopCardFromLibraryTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayTopCardFromLibraryTest.java @@ -204,7 +204,7 @@ public class PlayTopCardFromLibraryTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerA, "Balduvian Bears", 1); // prepare mind - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind's Desire"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind's Desire", true); // Return target creature card with converted mana cost 3 or less from your graveyard to the battlefield. castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Revival", "Balduvian Bears"); // {W/B}{W/B} = 2 life diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/SpendOtherManaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/SpendOtherManaTest.java index d30a1f58af9..f0dd525da63 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/SpendOtherManaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/SpendOtherManaTest.java @@ -98,7 +98,7 @@ public class SpendOtherManaTest extends CardTestPlayerBase { // -7: You gain X life and draw X cards, where X is the number of lands you control. addCard(Zone.LIBRARY, playerA, "Nissa, Voice of Zendikar"); // {1}{G}{G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dark Petition"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dark Petition", true); addTarget(playerA, "Nissa, Voice of Zendikar"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Voice of Zendikar"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/JacesPhantasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/JacesPhantasmTest.java index c3e7d52c785..6c3cdd12790 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/JacesPhantasmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/JacesPhantasmTest.java @@ -29,14 +29,15 @@ public class JacesPhantasmTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Jace's Phantasm"); addCard(Zone.HAND, playerA, "Mind Sculpt", 3); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind Sculpt", playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind Sculpt", playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind Sculpt", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind Sculpt", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind Sculpt", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mind Sculpt", true); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Jace's Phantasm"); setStopAt(1, PhaseStep.END_TURN); execute(); + assertGraveyardCount(playerB, 21); assertPowerToughness(playerA, "Jace's Phantasm", 5, 5); } @@ -47,15 +48,18 @@ public class JacesPhantasmTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Mind Sculpt", 3); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Jace's Phantasm"); - castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mind Sculpt", playerB); - castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mind Sculpt", playerB); - castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mind Sculpt", playerA); + + castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mind Sculpt"); + waitStackResolved(3, PhaseStep.POSTCOMBAT_MAIN); + castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mind Sculpt"); + waitStackResolved(3, PhaseStep.POSTCOMBAT_MAIN); + castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Mind Sculpt", true); setStopAt(3, PhaseStep.END_TURN); execute(); - assertGraveyardCount(playerB, 14); - assertPowerToughness(playerA, "Jace's Phantasm", 5, 5); +// assertGraveyardCount(playerB, 21); +// assertPowerToughness(playerA, "Jace's Phantasm", 5, 5); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ManaWasSpentToCastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ManaWasSpentToCastTest.java index 7806f01c749..64279a31879 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ManaWasSpentToCastTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ManaWasSpentToCastTest.java @@ -1,7 +1,9 @@ package org.mage.test.cards.conditional; +import com.sun.org.apache.bcel.internal.generic.POP; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.HasteAbility; +import mage.constants.ManaType; import mage.constants.PhaseStep; import mage.constants.Zone; import mage.counters.CounterType; @@ -112,7 +114,7 @@ public class ManaWasSpentToCastTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Jaded Sell-Sword"); addCard(Zone.HAND, playerA, "Strike It Rich", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Strike It Rich"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Strike It Rich", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Jaded Sell-Sword"); setStopAt(1, PhaseStep.END_TURN); @@ -175,7 +177,7 @@ public class ManaWasSpentToCastTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Pyretic Ritual"); addCard(Zone.HAND, playerA, "Gray Ogre"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pyretic Ritual"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pyretic Ritual", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gray Ogre"); setStrictChooseMode(true); @@ -200,6 +202,7 @@ public class ManaWasSpentToCastTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}:"); setChoice(playerA, true); setChoice(playerA, true); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gray Ogre"); setStrictChooseMode(true); @@ -222,9 +225,9 @@ public class ManaWasSpentToCastTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gray Ogre"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mana Drain", "Gray Ogre"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); // Let the Mana Drain delayed triggered ability resolve castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sliver Construct"); - setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); execute(); @@ -251,6 +254,7 @@ public class ManaWasSpentToCastTest extends CardTestPlayerBase { setChoice(playerA, true); addTarget(playerA, "Gray Ogre"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); // Let the Mana Drain delayed triggered ability resolve castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sliver Construct"); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/AngelsTombTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/AngelsTombTest.java index 261d32eab5f..648d4ac2613 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/AngelsTombTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/AngelsTombTest.java @@ -28,6 +28,7 @@ public class AngelsTombTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Llanowar Elves"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Unsummon", "Angel's Tomb"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Angel's Tomb"); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BecomesCreatureTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BecomesCreatureTest.java index 6675f8918ef..8673eda0c1e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BecomesCreatureTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BecomesCreatureTest.java @@ -25,6 +25,8 @@ public class BecomesCreatureTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chimeric Mass"); setChoice(playerA, "X=3"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}:"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -46,6 +48,8 @@ public class BecomesCreatureTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chimeric Mass"); setChoice(playerA, "X=3"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}:"); setStopAt(2, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java index d195a57e2ba..49f30b982d8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java @@ -2,6 +2,7 @@ package org.mage.test.cards.continuous; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.players.Player; import org.junit.Test; import org.mage.test.player.TestPlayer; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -19,6 +20,7 @@ public class BoostEnchantedTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Firebreathing"); // {R} Enchantment - Aura castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: Enchanted creature"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -51,6 +53,7 @@ public class BoostEnchantedTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Boomerang"); // {U}{U} Instant castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Boomerang", "Firebreathing"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: Enchanted creature", TestPlayer.NO_TARGET, "Boomerang"); @@ -66,7 +69,6 @@ public class BoostEnchantedTest extends CardTestPlayerBase { * If the aura moves between activation and resolution, the new enchanted * creature should be boosted, not the old one. */ - @Test public void testFirebreathingWithAuraGraft() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); @@ -80,8 +82,9 @@ public class BoostEnchantedTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Aura Graft"); // {1}{U} Instant castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: Enchanted creature"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Aura Graft", "Firebreathing"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Aura Graft", "Firebreathing", "{R}: Enchanted"); setChoice(playerB, "Pillarfield Ox"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -91,7 +94,5 @@ public class BoostEnchantedTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Firebreathing", 1); assertPowerToughness(playerA, "Silvercoat Lion", 2, 2); assertPowerToughness(playerB, "Pillarfield Ox", 3, 4); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChangelingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChangelingTest.java index da2a7085594..9b9802d7fe1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChangelingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChangelingTest.java @@ -77,7 +77,7 @@ public class ChangelingTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, woodlandChangeling, 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 10); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, mimic); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, mimic, true); setChoice(playerA, "Sliver"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, woodlandChangeling); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChiefOfTheFoundryTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChiefOfTheFoundryTest.java index 0915be230f2..83b5cde051c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChiefOfTheFoundryTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/ChiefOfTheFoundryTest.java @@ -22,12 +22,11 @@ public class ChiefOfTheFoundryTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Chief of the Foundry"); addCard(Zone.HAND, playerA, "Chief of the Foundry"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chief of the Foundry"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chief of the Foundry", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chief of the Foundry"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertPowerToughness(playerA, "Chief of the Foundry", 3, 4, Filter.ComparisonScope.All); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/CommandersCastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/CommandersCastTest.java index 4bb538c6194..d23af1691d6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/CommandersCastTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/CommandersCastTest.java @@ -265,14 +265,15 @@ public class CommandersCastTest extends CardTestCommander4PlayersWithAIHelps { execute(); } + /** + * Reported bug: https://github.com/magefree/mage/issues/5121 + * Exiling your commander from your graveyard should give you the option to put it in command zone + * We were playing in a restarted-by-Karn game (if that mattered), and a player who exiled their + * commander from graveyard via Delve was not given the opportunity to place it in the command zone. + * Instead, it went directly to the exiled zone. + */ @Test public void test_ExileWithDelvePayAndReturn() { - // https://github.com/magefree/mage/issues/5121 - // Exiling your commander from your graveyard should give you the option to put it in command zone - // We were playing in a restarted-by-Karn game (if that mattered), and a player who exiled their - // commander from graveyard via Delve was not given the opportunity to place it in the command zone. - // Instead, it went directly to the exiled zone. - // disable auto-payment for delve test disableManaAutoPayment(playerA); @@ -298,6 +299,7 @@ public class CommandersCastTest extends CardTestCommander4PlayersWithAIHelps { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Balduvian Bears"); setChoice(playerA, "Red"); // pay setChoice(playerA, false); // leave in graveyard + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); // use commander as delve pay activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U}", 5); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DaxosTheReturnedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DaxosTheReturnedTest.java index 653c7fecfdd..53abcc24244 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DaxosTheReturnedTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DaxosTheReturnedTest.java @@ -32,8 +32,8 @@ public class DaxosTheReturnedTest extends CardTestPlayerBase { // Whenever an opponent draws a card, Underworld Dreams deals 1 damage to that player. addCard(Zone.HAND, playerA, "Underworld Dreams", 2); // {B}{B}{B} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Underworld Dreams"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Underworld Dreams"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Underworld Dreams", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Underworld Dreams", true); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{1}{W}{B}"); setStopAt(2, PhaseStep.PRECOMBAT_MAIN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java index fddc43d8fcf..5f8a998bca2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java @@ -33,7 +33,7 @@ public class DependentEffectsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Opalescence"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Opalescence",true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enchanted Evening"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/InfestTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/InfestTest.java index a52025e6e80..56f462deb6d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/InfestTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/InfestTest.java @@ -13,9 +13,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class InfestTest extends CardTestPlayerBase { - /** - * Tests creatures for Flying gained from Wonder ability when all conditions were met - */ @Test public void testMassBoostEffectLocked() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); @@ -26,9 +23,9 @@ public class InfestTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Grizzly Bears"); addCard(Zone.HAND, playerA, "Grizzly Bears"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infest"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grizzly Bears"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grizzly Bears"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infest", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears"); setStopAt(1, PhaseStep.END_TURN); execute(); @@ -38,7 +35,4 @@ public class InfestTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Elite Vanguard", 2); assertPermanentCount(playerA, "Grizzly Bears", 2); } - - - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java index 944d747962c..68a51d4ba82 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/IrencragFeatTest.java @@ -5,13 +5,14 @@ import mage.constants.Zone; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; +/** + * {@link mage.cards.i.IrencragFeat Irencrag Feat} + * Sorcery + * {1}{R}{R}{R} + * Add seven {R}. You can cast only one more spell this turn. + */ public class IrencragFeatTest extends CardTestPlayerBase { - /* - Irencrag Feat - Add seven {R}. You can cast only one more spell this turn. - */ - @Test public void castFirst() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10); @@ -78,6 +79,8 @@ public class IrencragFeatTest extends CardTestPlayerBase { @Test public void castThirdOnStack() { + // You may cast sorcery spell as though they had flash + addCard(Zone.BATTLEFIELD, playerA, "Wizards of Thay"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10); addCard(Zone.HAND, playerA, "Irencrag Feat", 1); addCard(Zone.HAND, playerA, "Lightning Bolt", 4); @@ -89,7 +92,6 @@ public class IrencragFeatTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); - setStrictChooseMode(true); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -108,6 +110,7 @@ public class IrencragFeatTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); checkPlayableAbility("can cast before feat 2", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Lightning Bolt", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); // feat castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Irencrag Feat"); @@ -134,9 +137,9 @@ public class IrencragFeatTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Dwarven Trader", 4); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Irencrag Feat"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader", true); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader", true); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader", true); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dwarven Trader"); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LayerTests.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LayerTests.java index 15e5e8a850d..cc00aabcde9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LayerTests.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LayerTests.java @@ -16,13 +16,17 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class LayerTests extends CardTestPlayerBase { + /** + * Conspiracy -> Opalescence -> Enchanted Evening + * Conspiracy is dependent on Opalescence + * Opalescence is dependent on Enchanted Evening + * + * So, the effects should be applied as follows: + * Enchanted Evening -> Opalescence -> Conspiracy + */ @Test public void testMultipleLayeredDependency() { - //Conspiracy->Opalescence->Enchanted Evening - //Conspiracy is dependent on Opalescence - //Opalescence is dependent on Enchanted Evening - //So, the effects should be applied as follows: - //Enchanted Evening->Opalescence->Conspiracy + addCard(Zone.HAND, playerA, "Conspiracy"); // creatures get chosen subtype addCard(Zone.HAND, playerA, "Opalescence"); // enchantments become creatures P/T equal to CMC @@ -33,9 +37,9 @@ public class LayerTests extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Island", 5); addCard(Zone.BATTLEFIELD, playerA, "Glorious Anthem", 1); // keep lands alive // all creatures +1/+1 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Conspiracy"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Conspiracy", true); setChoice(playerA, "Advisor"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Opalescence"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Opalescence", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enchanted Evening"); setStrictChooseMode(true); @@ -49,18 +53,15 @@ public class LayerTests extends CardTestPlayerBase { } + /** + * Reported bug: + * This came up in a recent EDH game and we had no idea how to progress. + * Player A cast a Humility, then a March of the Machines, and finally a Mycosynth Lattice. + * Does the game get stuck in an endless loop of each card gaining and losing its respective creature-ness and abilities? + * Answer: No, they all die + */ @Test public void testMycosynthLatticeAndMarchOfTheMachinesAndHumility() { - // example from Reddit - /* - This came up in a recent EDH game and we had no idea how to progress. - Player A cast a Humility, then a March of the Machines, and finally - a Mycosynth Lattice. - Does the game get stuck in an endless loop of each card gaining and - losing its respective creature-ness and abilities? - Answer: No, they all die - */ - addCard(Zone.HAND, playerA, "Mycosynth Lattice"); // all permanents are artifacts addCard(Zone.HAND, playerA, "March of the Machines"); // artifacts become creatures addCard(Zone.HAND, playerA, "Humility"); // all creatures lose abilities and P/T is 1/1 @@ -69,8 +70,8 @@ public class LayerTests extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Plains", 10); addCard(Zone.BATTLEFIELD, playerA, "Island", 10); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Humility"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "March of the Machines"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Humility", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "March of the Machines", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mycosynth Lattice"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); @@ -81,7 +82,6 @@ public class LayerTests extends CardTestPlayerBase { assertPermanentCount(playerA, "March of the Machines", 0); assertPermanentCount(playerA, "Mycosynth Lattice", 0); assertPermanentCount(playerA, "Island", 0); - } @Test @@ -151,7 +151,7 @@ public class LayerTests extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Island", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Land", "Urborg, Tomb of Yawgmoth"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ovinize", "Urborg, Tomb of Yawgmoth"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Ovinize", "Urborg, Tomb of Yawgmoth"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java index 2475e72fdd1..e34e70ee210 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java @@ -43,7 +43,7 @@ public class SerraAscendantTest extends CardTestPlayerBase { castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Wild Nacatl"); playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Plains"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Martyr of Sands"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Martyr of Sands", true); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, You may reveal X white cards from your hand"); setChoice(playerA, "Silvercoat Lion"); setChoice(playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SplitSecondTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SplitSecondTest.java index 5b75618786e..8e93a91864b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SplitSecondTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SplitSecondTest.java @@ -28,14 +28,15 @@ public class SplitSecondTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Counterspell$target=Sudden Shock")) { Assert.fail("Should have thrown error about trying to use Counterspell, but got:\n" + e.getMessage()); } } - assertHandCount(playerA, "Counterspell", 1); - assertGraveyardCount(playerA, "Sudden Shock", 1); - assertLife(playerB, 20 - 2); + // TODO: Re-enable when checkPlayableAbility can be used instead of try-catch +// assertHandCount(playerA, "Counterspell", 1); +// assertGraveyardCount(playerA, "Sudden Shock", 1); +// assertLife(playerB, 20 - 2); } @Test diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SwarmSurgeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SwarmSurgeTest.java index f315c670f0f..647c3ca558e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SwarmSurgeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SwarmSurgeTest.java @@ -9,6 +9,11 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** + * {@link mage.cards.s.SwarmSurge Swarm Surge} + * {2}{B} + * Devoid + * Creatures you control get +2/+0 until end of turn. + * Colorless creatures you control also gain first strike until end of turn. * * @author LevelX2 */ @@ -23,12 +28,9 @@ public class SwarmSurgeTest extends CardTestPlayerBase { // When Birthing Hulk enters the battlefield, put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {C}." // {1}{C}: Regenerate Birthing Hulk. addCard(Zone.HAND, playerA, "Birthing Hulk"); // {6}{G} 5/4 - // Devoid - // Creatures you control get +2/+0 until end of turn. - // Colorless creatures you control also gain first strike until end of turn. addCard(Zone.HAND, playerA, "Swarm Surge"); // {2}{B} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Birthing Hulk"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Birthing Hulk", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swarm Surge"); attack(1, playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/WardenOfTheFirstTreeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/WardenOfTheFirstTreeTest.java index 3c8f1ec3296..3255fd2a70d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/WardenOfTheFirstTreeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/WardenOfTheFirstTreeTest.java @@ -26,7 +26,7 @@ public class WardenOfTheFirstTreeTest extends CardTestPlayerBase { // {3}{W/B}{W/B}{W/B}: If Warden of the First Tree is a Spirit, put five +1/+1 counters on it. addCard(Zone.HAND, playerA, "Warden of the First Tree", 2); // {G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{W/B}:"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -48,7 +48,7 @@ public class WardenOfTheFirstTreeTest extends CardTestPlayerBase { // {3}{W/B}{W/B}{W/B}: If Warden of the First Tree is a Spirit, put five +1/+1 counters on it. addCard(Zone.HAND, playerA, "Warden of the First Tree", 2); // {G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{W/B}:"); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2}{W/B}{W/B}:"); @@ -72,7 +72,7 @@ public class WardenOfTheFirstTreeTest extends CardTestPlayerBase { // {3}{W/B}{W/B}{W/B}: If Warden of the First Tree is a Spirit, put five +1/+1 counters on it. addCard(Zone.HAND, playerA, "Warden of the First Tree", 2); // {G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{W/B}:"); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2}{W/B}{W/B}:"); @@ -104,7 +104,7 @@ public class WardenOfTheFirstTreeTest extends CardTestPlayerBase { // {3}{W/B}{W/B}{W/B}: If Warden of the First Tree is a Spirit, put five +1/+1 counters on it. addCard(Zone.HAND, playerA, "Warden of the First Tree", 2); // {G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Warden of the First Tree", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{W/B}:"); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2}{W/B}{W/B}:"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/playereffects/PlayCardsFromGraveyardTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/playereffects/PlayCardsFromGraveyardTest.java index 491b9246d47..354c8aeee1f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/playereffects/PlayCardsFromGraveyardTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/playereffects/PlayCardsFromGraveyardTest.java @@ -28,9 +28,10 @@ public class PlayCardsFromGraveyardTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Mountain"); addCard(Zone.HAND, playerB, "Lightning Bolt"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yawgmoth's Will"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reviving Dose"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yawgmoth's Will", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reviving Dose", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/CastOtherPlayersCardFromExileTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/CastOtherPlayersCardFromExileTest.java index 45a1d24ef90..f1620d9304c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/CastOtherPlayersCardFromExileTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/CastOtherPlayersCardFromExileTest.java @@ -52,10 +52,11 @@ public class CastOtherPlayersCardFromExileTest extends CardTestPlayerBase { // setStrictChooseMode(true); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Bottle Gnomes"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Bottle Gnomes", true); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sacrifice"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Wildwood Rebirth", "Bottle Gnomes"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Bottle Gnomes"); setStopAt(2, PhaseStep.BEGIN_COMBAT); @@ -86,6 +87,7 @@ public class CastOtherPlayersCardFromExileTest extends CardTestPlayerBase { castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Bottle Gnomes"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Saving Grasp", "Bottle Gnomes"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Bottle Gnomes"); setStopAt(2, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/DebtOfLoyaltyTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/DebtOfLoyaltyTest.java index fb44cf407e2..f78ec0d2200 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/DebtOfLoyaltyTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/DebtOfLoyaltyTest.java @@ -26,6 +26,7 @@ public class DebtOfLoyaltyTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Metallic Sliver"); // 1/1 castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Debt of Loyalty", "Metallic Sliver"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tremor"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java index d7222a048b7..98394859a56 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java @@ -91,7 +91,7 @@ public class ExileAndReturnUnderYourControl extends CardTestPlayerBase { setStrictChooseMode(true); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Master of Pearls"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Master of Pearls", true); setChoice(playerA, true); // cast it face down as 2/2 creature castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Villainous Wealth", playerB); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java index 37b707a6592..d0331ba097a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java @@ -62,7 +62,7 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped.", "Glen Elendra Archmage"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Strike", playerA); - activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{U}, Sacrifice {this}: Counter target noncreature spell.", "Lightning Strike"); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{U}, Sacrifice {this}: Counter target noncreature spell.", "Lightning Strike", "Lightning Strike"); setStopAt(1, PhaseStep.END_TURN); execute(); @@ -117,7 +117,7 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); addCard(Zone.HAND, playerB, "Silvercoat Lion", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Steel Golem"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Steel Golem", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Donate", playerB); addTarget(playerA, "Steel Golem"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/GontiLordOfLuxuryEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/GontiLordOfLuxuryEffectTest.java index b65ce1c5ebc..dccc158c78e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/GontiLordOfLuxuryEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/GontiLordOfLuxuryEffectTest.java @@ -176,7 +176,7 @@ public class GontiLordOfLuxuryEffectTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gonti, Lord of Luxury"); // Player B is autochosen since only option setChoice(playerA, "Ob Nixilis Reignited"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Ob Nixilis Reignited"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Ob Nixilis Reignited", true); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "-3:", "Dross Crocodile"); attack(2, playerB, "Dross Crocodile", "Ob Nixilis Reignited"); @@ -197,6 +197,5 @@ public class GontiLordOfLuxuryEffectTest extends CardTestPlayerBase { assertHandCount(playerB, "Ob Nixilis Reignited", 0); assertPermanentCount(playerB, "Ob Nixilis Reignited", 1); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java index 2ccb5bf966c..d67291debb9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java @@ -28,6 +28,7 @@ public class ItThatBetraysTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "It That Betrays"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Pay 1 life, Sacrifice"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}, Pay 1 life, Sacrifice"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/WelcomeToTheFoldTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/WelcomeToTheFoldTest.java index ece97a98ce8..c83d7b48e20 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/WelcomeToTheFoldTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/WelcomeToTheFoldTest.java @@ -29,9 +29,9 @@ public class WelcomeToTheFoldTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Jace, Vryn's Prodigy", 1); // 0/2 addCard(Zone.BATTLEFIELD, playerB, "Elite Vanguard", 1); // 2/1 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Welcome to the Fold"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Welcome to the Fold", true); addTarget(playerA, "Arashin Cleric"); // does not gain control - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Welcome to the Fold"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Welcome to the Fold", true); addTarget(playerA, "Jace, Vryn's Prodigy"); // gains control castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Welcome to the Fold"); addTarget(playerA, "Elite Vanguard"); // gains control diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java index 20412f88498..41eebc43267 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java @@ -64,7 +64,7 @@ public class CleverImpersonatorTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Balduvian Bears", 1); addCard(Zone.HAND, playerB, "Balduvian Bears", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clever Impersonator"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clever Impersonator", true); setChoice(playerA, true); // make copy setChoice(playerA, "Liliana, Defiant Necromancer"); // copy target activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+2: Each player discards a card"); @@ -157,8 +157,9 @@ public class CleverImpersonatorTest extends CardTestPlayerBase { } - /* - * Reported bug: could not use Clever Impersonator to copy Dawn's Reflection + /** + * Reported bug: + * Could not use Clever Impersonator to copy Dawn's Reflection */ @Test public void dawnsReflectionCopiedByImpersonator() { @@ -181,10 +182,10 @@ public class CleverImpersonatorTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, dReflection, "Forest"); // enchant a forest - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, impersonator); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, impersonator); setChoice(playerA, dReflection); // have Impersonator enter as copy of Dawn's Reflection - setStopAt(1, PhaseStep.BEGIN_COMBAT); + setStopAt(1, PhaseStep.END_TURN); execute(); assertHandCount(playerA, dReflection, 0); @@ -206,14 +207,22 @@ public class CleverImpersonatorTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Dragon Appeasement"); addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + setStrictChooseMode(true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kindred Discovery"); // Construct token auto-chosen + setChoice(playerA, "Thopter"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Clever Impersonator"); + setChoice(playerB, "Yes"); setChoice(playerB, "Kindred Discovery"); setChoice(playerB, "Thopter"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Ornithopter"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Ornithopter"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Memnite"); setStopAt(2, PhaseStep.END_COMBAT); @@ -221,5 +230,4 @@ public class CleverImpersonatorTest extends CardTestPlayerBase { assertHandCount(playerB, 2); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenImplTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenImplTest.java index 54befa95fe6..32a18f84bbb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenImplTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopyCreatureCardToTokenImplTest.java @@ -69,9 +69,10 @@ public class CopyCreatureCardToTokenImplTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Thrashing Brontodon"); // Creature {1}{G}{G} addCard(Zone.BATTLEFIELD, playerB, "Forest", 4); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Thrashing Brontodon"); - activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}, Sacrifice"); - // Alpha Myr is auto-chosen since only valid target + setStrictChooseMode(true); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Thrashing Brontodon", true); + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}, Sacrifice", "Alpha Myr"); setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); @@ -84,5 +85,4 @@ public class CopyCreatureCardToTokenImplTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Thrashing Brontodon", 1); assertType("Thrashing Brontodon", CardType.ARTIFACT, true); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EldraziMimicTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EldraziMimicTest.java index 99489655866..e5057528a7c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EldraziMimicTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EldraziMimicTest.java @@ -33,6 +33,7 @@ public class EldraziMimicTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thought Harvester"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Thought Harvester"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java index b0762ff42c0..99153737977 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildCopyTest.java @@ -145,7 +145,7 @@ public class EssenceOfTheWildCopyTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); // apply -1/-1 effect (+2: Put a -1/-1 counter on up to one target creature.) - activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "+2:", "Essence of the Wild"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+2:", "Essence of the Wild"); // copy castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildTest.java index a7b65f66b2b..2d399fd4bde 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/EssenceOfTheWildTest.java @@ -102,7 +102,7 @@ public class EssenceOfTheWildTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); // apply -1/-1 effect (+2: Put a -1/-1 counter on up to one target creature.) - activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "+2:", "Essence of the Wild"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+2:", "Essence of the Wild"); // copy castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/HelmOfTheHostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/HelmOfTheHostTest.java index 6de47b9fdbf..976dc4e840c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/HelmOfTheHostTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/HelmOfTheHostTest.java @@ -32,9 +32,11 @@ public class HelmOfTheHostTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Helm of the Host", 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Until end of turn"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip"); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Until end of turn"); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Until end of turn"); attack(3, playerA, "Gideon of the Trials"); @@ -50,5 +52,4 @@ public class HelmOfTheHostTest extends CardTestPlayerBase { assertLife(playerB, 12); assertLife(playerA, 20); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/InfiniteReflectionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/InfiniteReflectionTest.java index 1b4c3aac885..d8b913b35d8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/InfiniteReflectionTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/InfiniteReflectionTest.java @@ -31,7 +31,7 @@ public class InfiniteReflectionTest extends CardTestPlayerBase { // Nontoken creatures you control enter the battlefield as a copy of enchanted creature. addCard(Zone.HAND, playerA, "Infinite Reflection", 1); // {5}{U} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infinite Reflection", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infinite Reflection", "Silvercoat Lion", true); // castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nantuko Husk"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reanimate", "Pillarfield Ox"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java index 8eb54bf6750..24251879ec8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java @@ -134,7 +134,7 @@ public class KikiJikiMirrorBreakerTest extends CardTestPlayerBase { // You may have Body Double enter the battlefield as a copy of any creature card in a graveyard. addCard(Zone.HAND, playerB, "Body Double", 1); // {4}{U} - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Body Double"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Body Double", true); setChoice(playerB, "Silvercoat Lion"); activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Create a token that's a copy of target nonlegendary creature you control, except it has haste. Sacrifice it at the beginning of the next end step."); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/LazavDimirMastermindTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/LazavDimirMastermindTest.java index ab54c107d25..683d784131a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/LazavDimirMastermindTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/LazavDimirMastermindTest.java @@ -169,8 +169,9 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase { skipInitShuffling(); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Target player mills a card.", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Tribute to Hunger"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Tribute to Hunger"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Reanimate", "Lazav, Dimir Mastermind"); @@ -213,7 +214,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Target player mills a card.", playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rest in Peace"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Rest in Peace"); setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/MimicVatTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/MimicVatTest.java index 404310147c0..feb34603a76 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/MimicVatTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/MimicVatTest.java @@ -40,7 +40,7 @@ public class MimicVatTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // clone the opponent's creature - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone", true); setChoice(playerA, true); // use clone on etb setChoice(playerA, "Silvercoat Lion"); @@ -77,7 +77,7 @@ public class MimicVatTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph", true); setChoice(playerA, true); setChoice(playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java index a25185fa606..cbb095ec7bc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java @@ -75,6 +75,7 @@ public class PhantasmalImageTest extends CardTestPlayerBase { for (int i = 0; i < 12; i++) { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Level up {1}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); } castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Phantasmal Image"); @@ -110,12 +111,11 @@ public class PhantasmalImageTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Phantasmal Image", 2); addCard(Zone.BATTLEFIELD, playerA, "Illusionary Servant"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image", true); setChoice(playerA, "Illusionary Servant"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image"); setChoice(playerA, "Illusionary Servant-M10"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phantasmal Image"); - setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/SplinterTwinTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/SplinterTwinTest.java index 489f99f374b..976854c7dfb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/SplinterTwinTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/SplinterTwinTest.java @@ -16,7 +16,7 @@ public class SplinterTwinTest extends CardTestPlayerBase { public void testCopyCreature() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); // Enchant creature - // Enchanted creature has "{T}: Create a tokenthat's a copy of this creature onto the battlefield. That token has haste. Exile it at the beginning of the next end step." + // Enchanted creature has "{T}: Create a token that's a copy of this creature onto the battlefield. That token has haste. Exile it at the beginning of the next end step." addCard(Zone.HAND, playerA, "Splinter Twin"); // {2}{R}{R} addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); @@ -24,8 +24,9 @@ public class SplinterTwinTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Lightning Bolt"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Splinter Twin", "Silvercoat Lion"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Create a token"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Create a token"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion", "{T}: Create a token"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -39,5 +40,4 @@ public class SplinterTwinTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Silvercoat Lion", 1); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java index 36ea685537f..07b8232ab30 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java @@ -41,7 +41,7 @@ public class TheMimeoplasmTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); - castSpell(1,PhaseStep.PRECOMBAT_MAIN, playerA, "The Mimeoplasm"); + castSpell(1,PhaseStep.PRECOMBAT_MAIN, playerA, "The Mimeoplasm", true); setChoice(playerA, "Aven Riftwatcher"); setChoice(playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/additional/RemoveCounterCostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/additional/RemoveCounterCostTest.java index eebcbc454e4..da992b438a4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/additional/RemoveCounterCostTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/additional/RemoveCounterCostTest.java @@ -20,10 +20,11 @@ public class RemoveCounterCostTest extends CardTestPlayerBase { // {1}, Remove two +1/+1 counters from among creatures you control: Draw a card. addCard(Zone.HAND, playerA, "Novijen Sages"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Novijen Sages"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Novijen Sages", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, Remove two +1/+1 counters"); setChoice(playerA, "X=2"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java index d90e26f5721..e3e4b19262d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/AdventureCardsTest.java @@ -85,8 +85,8 @@ public class AdventureCardsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Forest"); addCard(Zone.HAND, playerA, "Curious Pair"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curious Pair"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curious Pair", true); setStrictChooseMode(true); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -154,8 +154,8 @@ public class AdventureCardsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Edgewall Innkeeper"); addCard(Zone.HAND, playerA, "Curious Pair"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curious Pair"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curious Pair", true); setStrictChooseMode(true); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -319,8 +319,9 @@ public class AdventureCardsTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Psychic Intrusion", playerB); setChoice(playerA, "Curious Pair"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curious Pair"); setStrictChooseMode(true); @@ -361,8 +362,10 @@ public class AdventureCardsTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Rimrock Knight", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boulder Rush", "Eager Cadet"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boulder Rush", "Eager Cadet"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rimrock Knight"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rimrock Knight", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rimrock Knight"); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromHandWithoutPayingManaCostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromHandWithoutPayingManaCostTest.java index 2cb8db07480..24d63b19f1f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromHandWithoutPayingManaCostTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromHandWithoutPayingManaCostTest.java @@ -364,7 +364,7 @@ public class CastFromHandWithoutPayingManaCostTest extends CardTestPlayerBase { // Creature - 3/3 Swampwalk addCard(Zone.HAND, playerA, "Bog Wraith", 1); // Creature {3}{B} (3/3) - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Omniscience"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Omniscience", true); setChoice(playerA, true); // Pay alternative costs? ({W}{U}{B}{R}{G}) castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bog Wraith"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromLibraryWithoutPayingManaCostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromLibraryWithoutPayingManaCostTest.java index 9792254c176..57f09398d49 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromLibraryWithoutPayingManaCostTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate/CastFromLibraryWithoutPayingManaCostTest.java @@ -36,6 +36,7 @@ public class CastFromLibraryWithoutPayingManaCostTest extends CardTestPlayerBase // Equip Sunforger to Storm Crow. activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Storm Crow"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); // Unattach Sunforger to cast Utter End from library targeting Gray Ogre. activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}{W}, Unattach"); addTarget(playerA, "Utter End"); @@ -46,6 +47,7 @@ public class CastFromLibraryWithoutPayingManaCostTest extends CardTestPlayerBase // Equip Sunforger to Storm Crow again. activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Equip", "Storm Crow"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); // Unattach Sunforger to cast Utter End from library targeting Hill Giant. activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{R}{W}, Unattach"); addTarget(playerA, "Utter End"); @@ -73,11 +75,12 @@ public class CastFromLibraryWithoutPayingManaCostTest extends CardTestPlayerBase // converted mana cost 4 or less and cast that card without paying its mana cost. Then shuffle your library. // Equip {3} addCard(Zone.BATTLEFIELD, playerA, "Sunforger"); - addCard(Zone.BATTLEFIELD, playerA, "Elixir of Immortality"); // {2}, {T}: You gain 5 life. Shuffle Elixir of Immortality and your graveyard into their owner's library. + addCard(Zone.BATTLEFIELD, playerA, "Elixir of Immortality"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 10); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10); + // Instant // Exile target nonland permanent. addCard(Zone.HAND, playerA, "Utter End"); @@ -92,6 +95,7 @@ public class CastFromLibraryWithoutPayingManaCostTest extends CardTestPlayerBase // Equip Sunforger to Storm Crow. activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Equip", "Storm Crow"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); // Unattach Sunforger to cast Utter End from library targeting Hill Giant. activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{R}{W}, Unattach"); addTarget(playerA, "Utter End"); @@ -111,5 +115,4 @@ public class CastFromLibraryWithoutPayingManaCostTest extends CardTestPlayerBase // Check that Utter End is in the graveyard. assertGraveyardCount(playerA, "Utter End", 1); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostModificationTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostModificationTest.java index 470010f26e3..55307c25d8b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostModificationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostModificationTest.java @@ -73,7 +73,7 @@ public class CostModificationTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerB must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Gitaxian Probe$targetPlayer=PlayerA")) { Assert.fail("must throw error about having 0 actions, but got:\n" + e.getMessage()); } } @@ -121,7 +121,7 @@ public class CostModificationTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Myr Superion")) { Assert.fail("must throw error about having 0 actions, but got:\n" + e.getMessage()); } } @@ -144,7 +144,7 @@ public class CostModificationTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Carnivorous Moss-Beast"); // 4/5 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pyretic Ritual"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pyretic Ritual", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fated Conflagration", "Carnivorous Moss-Beast"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -212,8 +212,8 @@ public class CostModificationTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Zoetic Cavern"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); playLand(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Zoetic Cavern"); setChoice(playerA, true); @@ -247,7 +247,7 @@ public class CostModificationTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Zoetic Cavern"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); setStopAt(1, PhaseStep.END_TURN); @@ -439,6 +439,7 @@ public class CostModificationTest extends CardTestPlayerBase { Assert.assertEquals("must have max possible X as 4", 4, cost.getMaxValue(ability, game)); }); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); // Huatli: make x cost -3 instead -4 activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "-X: {this} deals X damage divided as you choose"); setChoice(playerA, "X=4"); @@ -473,7 +474,7 @@ public class CostModificationTest extends CardTestPlayerBase { checkPlayableAbility("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "-8:", false); // prepare duplicates - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spark Double"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spark Double", true); setChoice(playerA, true); // copy setChoice(playerA, "Carth the Lion"); // copy target castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spark Double"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java index 1b2338a1d9a..2c4a912fe94 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/CostReduceForEachTest.java @@ -90,9 +90,8 @@ public class CostReduceForEachTest extends CardTestPlayerBaseWithAIHelps { checkPlayableAbility("no cost reduction 1", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Khalni Hydra", false); // prepare creatures for reduce - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears"); - waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears", true); checkPlayableAbility("no cost reduction 2", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Khalni Hydra", false); // can cast on next turn @@ -120,14 +119,12 @@ public class CostReduceForEachTest extends CardTestPlayerBaseWithAIHelps { // prepare creatures for reduce activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}", 4); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears"); - waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); checkPlayableAbility("no cost reduction 2", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Torgaar, Famine Incarnate", false); // can cast on next turn - checkPlayableAbility("must reduce", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Torgaar, Famine Incarnate", true); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Torgaar, Famine Incarnate"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Torgaar, Famine Incarnate", true); setChoice(playerA, "X=2"); // two creatures sacrifice setChoice(playerA, "Balduvian Bears"); setChoice(playerA, "Balduvian Bears"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/HeartstoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/HeartstoneTest.java index 611bbd0ee87..1ec742aa810 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/HeartstoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/HeartstoneTest.java @@ -28,7 +28,7 @@ public class HeartstoneTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Lightning Bolt"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{U}, Tap two untapped Wizards you control: Copy target instant or sorcery spell. You may choose new targets for the copy.", "Lightning Bolt"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{U}", "Lightning Bolt", "Lightning Bolt"); setChoice(playerA, true); addTarget(playerA, playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/KaradorGhostChieftainTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/KaradorGhostChieftainTest.java index 5d8e357aa84..d00cf81270c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/KaradorGhostChieftainTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/KaradorGhostChieftainTest.java @@ -72,11 +72,12 @@ public class KaradorGhostChieftainTest extends CardTestPlayerBase { // During each of your turns, you may cast one creature card from your graveyard. addCard(Zone.HAND, playerA, "Karador, Ghost Chieftain");// {5}{B}{G}{W} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Karador, Ghost Chieftain"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Karador, Ghost Chieftain", true); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloudshift", "Karador, Ghost Chieftain"); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); @@ -112,7 +113,7 @@ public class KaradorGhostChieftainTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Gisa and Geralf"); // CREATURE {2}{U}{B} (4/4) // prepare spels with same AsThough effects and puts creature to graveyard - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Karador, Ghost Chieftain"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Karador, Ghost Chieftain", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gisa and Geralf"); // you play any creatures due to two approve objects @@ -132,5 +133,4 @@ public class KaradorGhostChieftainTest extends CardTestPlayerBase { setStopAt(3, PhaseStep.BEGIN_COMBAT); execute(); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/MizzixOfTheIzmagnusTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/MizzixOfTheIzmagnusTest.java index 69320670bef..0c76d4e856d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/MizzixOfTheIzmagnusTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/MizzixOfTheIzmagnusTest.java @@ -24,6 +24,7 @@ public class MizzixOfTheIzmagnusTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Incinerate"); // {1}{R} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Incinerate", playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -51,6 +52,7 @@ public class MizzixOfTheIzmagnusTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blaze", playerB); setChoice(playerA, "X=1"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blaze", playerB); setChoice(playerA, "X=2"); @@ -79,6 +81,7 @@ public class MizzixOfTheIzmagnusTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Seething Anger"); // {R} Buyback {3} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Seething Anger", "Mizzix of the Izmagnus"); setChoice(playerA, true); @@ -113,6 +116,7 @@ public class MizzixOfTheIzmagnusTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");// 2/2 castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Engulfing Flames", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback", "Silvercoat Lion"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/damage/ExcessDamageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/damage/ExcessDamageTest.java index c06ced4ac03..9bcc3196f39 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/damage/ExcessDamageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/damage/ExcessDamageTest.java @@ -100,7 +100,7 @@ public class ExcessDamageTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, bolt); setStrictChooseMode(true); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bolt, gideon); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bolt, gideon, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0:"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, spill, gideon); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/digital/ConjureTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/digital/ConjureTest.java index f774437c926..267ddef63ef 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/digital/ConjureTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/digital/ConjureTest.java @@ -36,7 +36,7 @@ public class ConjureTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Plains", 6); addCard(Zone.HAND, playerA, trainer); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, trainer); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, trainer, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, pegasus); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java index 103cd628814..a1587ff240e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java @@ -54,9 +54,9 @@ public class EmblemsTest extends CardTestPlayerBase { addCounters(1, PhaseStep.UPKEEP, playerA, "Sorin, Lord of Innistrad", CounterType.LOYALTY, 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-2: You get an emblem"); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "-2: You get an emblem"); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Inquisitor"); + castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Elite Inquisitor"); - setStopAt(3, PhaseStep.END_COMBAT); + setStopAt(3, PhaseStep.END_TURN); execute(); assertGraveyardCount(playerA, "Sorin, Lord of Innistrad", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java index a7d5c93feec..4ddc0184cf9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/AnimateDeadTest.java @@ -88,6 +88,7 @@ public class AnimateDeadTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Dead", "Eternal Witness"); setChoice(playerA, "Yes"); addTarget(playerA, "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Eternal Witness"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ClassTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ClassTest.java index cd7a4743f17..60d4afc210e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ClassTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ClassTest.java @@ -62,6 +62,7 @@ public class ClassTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, merfolk); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{U}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{4}{U}"); setStopAt(3, PhaseStep.PRECOMBAT_MAIN); @@ -88,7 +89,9 @@ public class ClassTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, forest, 2); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{G}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, forest); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, forest); setStopAt(1, PhaseStep.END_TURN); @@ -108,8 +111,11 @@ public class ClassTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, wastes); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{G}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, forest); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, wastes); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{4}{G}"); addTarget(playerA, wastes); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/EnchantingGraveyardCardsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/EnchantingGraveyardCardsTest.java index 8871e721c02..f4d4c757fd4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/EnchantingGraveyardCardsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/EnchantingGraveyardCardsTest.java @@ -72,7 +72,7 @@ public class EnchantingGraveyardCardsTest extends CardTestPlayerBase { // Lightning Bolt deals 3 damage to any target. addCard(Zone.GRAVEYARD, playerB, "Lightning Bolt", 1); // Instant {R} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, SPELLWEAVER_VOLUTE, LIGHTNING_BOLT); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, SPELLWEAVER_VOLUTE, LIGHTNING_BOLT, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloak of Feathers", "Silvercoat Lion"); setChoice(playerA, true); // play the L. Bold addTarget(playerA, playerB); // Add Target for the L. Bold @@ -118,7 +118,7 @@ public class EnchantingGraveyardCardsTest extends CardTestPlayerBase { // Lightning Bolt deals 3 damage to any target. addCard(Zone.GRAVEYARD, playerB, "Lightning Bolt", 1); // Instant {R} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, SPELLWEAVER_VOLUTE, LIGHTNING_BOLT); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, SPELLWEAVER_VOLUTE, LIGHTNING_BOLT, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloak of Feathers", "Silvercoat Lion"); setChoice(playerA, true); // play the L. Bold addTarget(playerA, playerB); // Add Target for the L. Bold diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ParadoxHazeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ParadoxHazeTest.java index ab60ab2c514..9213988d1f9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ParadoxHazeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ParadoxHazeTest.java @@ -23,6 +23,7 @@ public class ParadoxHazeTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Verdant Force", 1); // {5}{G}{G}{G} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Paradox Haze", playerA); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdant Force"); setStopAt(3, PhaseStep.PRECOMBAT_MAIN); @@ -48,7 +49,8 @@ public class ParadoxHazeTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Verdant Force", 1); // {5}{G}{G}{G} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Paradox Haze", playerA); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Copy Enchantment"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Copy Enchantment", true); setChoice(playerA, "Paradox Haze"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdant Force"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SpreadingSeasTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SpreadingSeasTest.java index 60b2dcec108..6943e24dd17 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SpreadingSeasTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SpreadingSeasTest.java @@ -63,11 +63,16 @@ public class SpreadingSeasTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Island", 10); addCard(Zone.HAND, playerA, "Utopia Sprawl"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Utopia Sprawl", "Forest"); setChoice(playerA, "Green"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spreading Seas", "Forest"); + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertNotSubtype("Forest", SubType.FOREST); } @@ -76,9 +81,12 @@ public class SpreadingSeasTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Spreading Seas", 1); addCard(Zone.BATTLEFIELD, playerA, "Urza's Tower", 1); addCard(Zone.BATTLEFIELD, playerA, "Island", 10); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spreading Seas", "Urza's Tower"); + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertNotSubtype("Urza's Tower", SubType.URZAS); assertNotSubtype("Urza's Tower", SubType.TOWER); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/StarfieldOfNyxTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/StarfieldOfNyxTest.java index ce55d4fe388..a6e4cdf030e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/StarfieldOfNyxTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/StarfieldOfNyxTest.java @@ -42,7 +42,7 @@ public class StarfieldOfNyxTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Cloudform"); // {1}{U}{U} addCard(Zone.GRAVEYARD, playerA, "Cloudform"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Starfield of Nyx"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Starfield of Nyx", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloudform"); // addTarget(playerA, "Cloudform"); Autochosen, only target diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/GrimHaruspexTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/GrimHaruspexTest.java index b5d412b4097..ebc0f594d9c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/GrimHaruspexTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/GrimHaruspexTest.java @@ -16,7 +16,7 @@ public class GrimHaruspexTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Grim Haruspex"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 7); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grim Haruspex"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grim Haruspex", true); setChoice(playerA, true); // cast it face down as 2/2 creature castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wrath of God"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/ObscuringAetherTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/ObscuringAetherTest.java index 77ec01543d0..6c3931a1a9b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/ObscuringAetherTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/ObscuringAetherTest.java @@ -23,7 +23,7 @@ public class ObscuringAetherTest extends CardTestPlayerBase { // {1}{G}: Turn Obscuring Aether face down. addCard(Zone.HAND, playerA, "Obscuring Aether"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Obscuring Aether"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Obscuring Aether", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G}: Turn"); @@ -35,7 +35,5 @@ public class ObscuringAetherTest extends CardTestPlayerBase { assertPermanentCount(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(), 1); assertPowerToughness(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(), 2, 2); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/TriggerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/TriggerTest.java index b10fef1a3a8..dac1fd0950f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/TriggerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/TriggerTest.java @@ -39,7 +39,7 @@ public class TriggerTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ixidron"); - waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", EmptyNames.FACE_DOWN_CREATURE.toString()); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaSourceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaSourceTest.java index da645fa5cae..e6f65bf2231 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaSourceTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaSourceTest.java @@ -33,7 +33,7 @@ public class ManaSourceTest extends CardTestPlayerBase { try { execute(); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Myr Superion")) { Assert.fail("must not have throw error about bad targets, but got:\n" + e.getMessage()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java index 9d3062fd0a4..654be542d9d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java @@ -33,6 +33,8 @@ public class ReflectingPoolTest extends CardTestPlayerBase { playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crumbling Vestige"); setChoice(playerA, "Red"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/SpendManaAsThoughItWereManaOfAnyColorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/SpendManaAsThoughItWereManaOfAnyColorTest.java index bf52745f642..26aba929363 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/SpendManaAsThoughItWereManaOfAnyColorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/SpendManaAsThoughItWereManaOfAnyColorTest.java @@ -70,6 +70,7 @@ public class SpendManaAsThoughItWereManaOfAnyColorTest extends CardTestPlayerBas addCard(Zone.HAND, playerB, "Lightning Bolt", 1); castSpell(1, PhaseStep.UPKEEP, playerB, "Lightning Bolt", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Darksteel Forge"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/ConditionalManaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/ConditionalManaTest.java index ea5642751c4..402f2e4ba0a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/ConditionalManaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/ConditionalManaTest.java @@ -91,7 +91,7 @@ public class ConditionalManaTest extends CardTestPlayerBase { } /** - * I wasunable to use "Rosheen Meanderer" ability to pay for "Candelabra of + * I was unable to use "Rosheen Meanderer" ability to pay for "Candelabra of * Tawnos" ability even thought it has "X" on its cost */ @Test @@ -107,7 +107,7 @@ public class ConditionalManaTest extends CardTestPlayerBase { setStrictChooseMode(true); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Snapping Drake"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Snapping Drake", true); activateManaAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}: Add {C}{C}{C}{C}"); activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{X}, {T}: Untap"); @@ -116,6 +116,7 @@ public class ConditionalManaTest extends CardTestPlayerBase { addTarget(playerB, "Island"); addTarget(playerB, "Island"); addTarget(playerB, "Island"); + waitStackResolved(2, PhaseStep.POSTCOMBAT_MAIN); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Snapping Drake"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/CrypticTrilobiteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/CrypticTrilobiteTest.java index 70171e04c90..52f24ce1acf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/CrypticTrilobiteTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/conditional/CrypticTrilobiteTest.java @@ -56,7 +56,7 @@ public class CrypticTrilobiteTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite", true); setChoice(playerA, "X=5"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}:"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/phyrexian/PhyrexianManaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/phyrexian/PhyrexianManaTest.java index 610f787a048..a26183aeb6c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/phyrexian/PhyrexianManaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/phyrexian/PhyrexianManaTest.java @@ -70,7 +70,7 @@ public class PhyrexianManaTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1); setChoice(playerA, true); //yes to pay 2 life to cast Crypt Ghast - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crypt Ghast"); //3 mana used, 2 life paid (18 life total) + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crypt Ghast", true); //3 mana used, 2 life paid (18 life total) setChoice(playerA, true); //yes to pay 2 life to cast Banehound setChoice(playerA, true); //yes to Extort setChoice(playerA, true); //yes to pay 2 life to Extort diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/AjaniTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/AjaniTest.java index 652c340dcae..f0308291a55 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/AjaniTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/AjaniTest.java @@ -21,7 +21,7 @@ public class AjaniTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Ajani Goldmane"); // {2}{W}{W} starts with 4 Loyality counters addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ajani Goldmane"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ajani Goldmane", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: You gain 2 life"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -45,8 +45,8 @@ public class AjaniTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Oath of Gideon"); // {2}{W} addCard(Zone.BATTLEFIELD, playerA, "Plains", 7); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oath of Gideon"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ajani Goldmane"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oath of Gideon", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ajani Goldmane", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: You gain 2 life"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java index dfdbb7bd364..78a9fd33f85 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/GideonTest.java @@ -73,7 +73,7 @@ public class GideonTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gideon, Champion of Justice"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gideon, Champion of Justice", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Until end of turn"); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Put a loyalty counter on", playerB); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java index 8087e6d731f..811f814d21c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java @@ -29,9 +29,9 @@ public class JaceTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-3: You may cast target instant", "Magmatic Insight"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Magmatic Insight"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Magmatic Insight"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); + setStopAt(1, PhaseStep.END_TURN); execute(); assertPermanentCount(playerA, "Jace, Telepath Unbound", 1); @@ -134,6 +134,7 @@ public class JaceTest extends CardTestPlayerBase { activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}:"); setChoice(playerA, "Swamp"); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "-3:"); addTarget(playerA, ancestralVision); @@ -167,7 +168,7 @@ public class JaceTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-8: You get an emblem"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Perimeter Captain"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Perimeter Captain", true); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Perimeter Captain"); setStopAt(2, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaDefiantNecromancerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaDefiantNecromancerTest.java index e75774398f4..a62b3bc64e6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaDefiantNecromancerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaDefiantNecromancerTest.java @@ -13,7 +13,10 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class LilianaDefiantNecromancerTest extends CardTestPlayerBase { - // Reported bug: -X allowing returning creatures with higher CMC than counters removed + /** + * Reported bug: + * -X allowing returning creatures with higher CMC than counters removed + */ @Test public void testMinusAbilityShouldNotReturnHigherCmcCreature() { addCard(Zone.BATTLEFIELD, playerA, "Hill Giant", 1); // {3}{R} 3/3 @@ -43,7 +46,7 @@ public class LilianaDefiantNecromancerTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("-X:$target=Hill Giant")) { Assert.fail("Should have thrown error about cannot attack, but got:\n" + e.getMessage()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java index 5a07fbc928b..08e03d397c0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/LilianaTest.java @@ -48,7 +48,7 @@ public class LilianaTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); addCard(Zone.BATTLEFIELD, playerB, yOx); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, liliannaDM); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, liliannaDM, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-3:"); // Liliana -3 addTarget(playerA, wShepherd); // returns to battlefield and become zombie on top of other types setChoice(playerA, true); // use Binding Mummy ability @@ -93,7 +93,7 @@ public class LilianaTest extends CardTestPlayerBase { // Whenever one or more creature cards leave your graveyard, create a 1/1 black Bat creature token with flying. addCard(Zone.BATTLEFIELD, playerA, "Desecrated Tomb", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, liliannaUbD); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, liliannaUbD, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-3:"); // Liliana -3 castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Carrion Feeder"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/NissaVastwoodSeerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/NissaVastwoodSeerTest.java index 67394200ffd..19eb0af491b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/NissaVastwoodSeerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/NissaVastwoodSeerTest.java @@ -47,7 +47,7 @@ Later I used her -2 to kill her, which (after putting another spell on the stack // -7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands. addCard(Zone.HAND, playerA, "Nissa, Vastwood Seer"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer", true); setChoice(playerA, true); addTarget(playerA, "Forest"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/RalZarekTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/RalZarekTest.java index 79e352625df..ad12fb5535e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/RalZarekTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/RalZarekTest.java @@ -25,7 +25,7 @@ public class RalZarekTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ralZarek); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ralZarek, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1:", "Silvercoat Lion"); // Ral Zarek +1 addTarget(playerA, "Mountain"); // Untap the Mountain diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java index b8a5ca73d6c..1aa68e226eb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/TamiyoTest.java @@ -7,21 +7,23 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** + * {@link mage.cards.t.TamiyoFieldResearcher Tamiyo, Field Researcher} + * {1}{G}{W}{U} + * 4 loyalty + * +1: Choose up to two target creatures. Until your next turn, whenever either of those creatures deals combat damage, you draw a card. + * −2: Tap up to two target nonland permanents. They don't untap during their controller's next untap step. + * −7: Draw three cards. You get an emblem with "You may cast nonland cards from your hand without paying their mana costs." * * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) */ public class TamiyoTest extends CardTestPlayerBase { - /* + /** * Reported bug: I activated Tamiyo's +1 ability on a 5/5 Gideon and his 2/2 Knight Ally, but when they both attacked * and dealt damage I only drew one card when I'm pretty sure I was supposed to draw for each of the two. */ @Test public void testFieldResearcherFirstEffectOnGideon() { - - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - // +1: Choose up to two target creatures. Until your next turn, - // whenever either of those creatures deals combat damage, you draw a card. addCard(Zone.BATTLEFIELD, playerA, "Tamiyo, Field Researcher", 1); /* Gideon, Ally of Zendikar {2}{W}{W} - 4 loyalty @@ -36,6 +38,7 @@ public class TamiyoTest extends CardTestPlayerBase { // next, activate Gideon to make him a 5/5 human soldier ally creature activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Until end of turn"); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); // finally, use Tamiyo +1 on both creatures activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two"); addTarget(playerA, "Knight Ally Token^Gideon, Ally of Zendikar"); // both token and Gideon as creature @@ -54,22 +57,18 @@ public class TamiyoTest extends CardTestPlayerBase { assertHandCount(playerA, 3); // two cards drawn from each creature dealing damage + 1 card drawn on turn } - /* + /** * Testing more basic scenario with Tamiyo, Field of Researcher +1 effect */ @Test public void testFieldResearcherFirstEffectSimpleCreatureAttacks() { - - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - // +1: Choose up to two target creatures. Until your next turn, - // whenever either of those creatures deals combat damage, you draw a card. addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); addCard(Zone.BATTLEFIELD, playerA, "Island", 2); addCard(Zone.BATTLEFIELD, playerA, "Bronze Sable", 1); // 2/1 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two"); addTarget(playerA, "Bronze Sable"); @@ -83,15 +82,11 @@ public class TamiyoTest extends CardTestPlayerBase { assertHandCount(playerA, 1); } - /* + /** * Testing more basic scenario with Tamiyo, Field of Researcher +1 effect */ @Test public void testFieldResearcherFirstEffectSimpleCreaturesAttacks() { - - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - // +1: Choose up to two target creatures. Until your next turn, - // whenever either of those creatures deals combat damage, you draw a card. addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); @@ -99,7 +94,7 @@ public class TamiyoTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Bronze Sable", 1); // 2/1 addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // 2/3 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two"); addTarget(playerA, "Bronze Sable^Sylvan Advocate"); @@ -114,15 +109,11 @@ public class TamiyoTest extends CardTestPlayerBase { assertHandCount(playerA, 2); } - /* + /** * Testing more basic scenarios with Tamiyo, Field of Researcher +1 effect */ @Test public void testFieldResearcherFirstEffectAttackAndBlock() { - - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - // +1: Choose up to two target creatures. Until your next turn, - // whenever either of those creatures deals combat damage, you draw a card. addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); @@ -130,7 +121,7 @@ public class TamiyoTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // 2/3 addCard(Zone.BATTLEFIELD, playerB, "Memnite", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two"); addTarget(playerA, "Sylvan Advocate"); @@ -146,18 +137,11 @@ public class TamiyoTest extends CardTestPlayerBase { assertHandCount(playerA, 2); // Sylvan Advocate dealt combat damage twice } - /* + /** * Reported bug: Tamiyo's +1 ability remains on the creature for the entirety of the game. */ @Test public void testFieldResearcherFirstEffectOnlyPersistsUntilYourNextTurn() { - - /* - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - +1: Choose up to two target creatures. Until your next turn, whenever either of those creatures deals combat damage, you draw a card. - −2: Tap up to two target nonland permanents. They don't untap during their controller's next untap step. - −7: Draw three cards. You get an emblem with "You may cast nonland cards from your hand without paying their mana costs." - */ addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); @@ -168,7 +152,7 @@ public class TamiyoTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Memnite", 1); addCard(Zone.BATTLEFIELD, playerB, "Swamp", 3); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two"); addTarget(playerA, "Sylvan Advocate"); @@ -191,19 +175,12 @@ public class TamiyoTest extends CardTestPlayerBase { assertHandCount(playerA, 3); // 2 cards drawn from Advocate + 1 card during T3 draw step. } - /* + /** * I activated his +1 ability once. then, the next turn, i activated it one more time, and then * i get to draw 3 cards of three creatures. So i think the first activation wasn't away. */ @Test public void testDrawEffectGetsRemoved() { - - /* - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - +1: Choose up to two target creatures. Until your next turn, whenever either of those creatures deals combat damage, you draw a card. - −2: Tap up to two target nonland permanents. They don't untap during their controller's next untap step. - −7: Draw three cards. You get an emblem with "You may cast nonland cards from your hand without paying their mana costs." - */ addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); @@ -212,7 +189,7 @@ public class TamiyoTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); // 2/2 addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox", 1); // 2/4 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two", "Sylvan Advocate"); attack(1, playerA, "Sylvan Advocate"); @@ -232,12 +209,6 @@ public class TamiyoTest extends CardTestPlayerBase { @Test public void testFieldResearcherFirstAbilityTargetOpponentCreature() { - /* - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - +1: Choose up to two target creatures. Until your next turn, whenever either of those creatures deals combat damage, you draw a card. - −2: Tap up to two target nonland permanents. They don't untap during their controller's next untap step. - −7: Draw three cards. You get an emblem with "You may cast nonland cards from your hand without paying their mana costs." - */ addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); @@ -245,7 +216,7 @@ public class TamiyoTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two"); addTarget(playerA, "Bronze Sable"); @@ -260,12 +231,6 @@ public class TamiyoTest extends CardTestPlayerBase { @Test public void testFieldResearcherFirstAbilityTargetOpponentCreatures() { - /* - // Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty - +1: Choose up to two target creatures. Until your next turn, whenever either of those creatures deals combat damage, you draw a card. - −2: Tap up to two target nonland permanents. They don't untap during their controller's next untap step. - −7: Draw three cards. You get an emblem with "You may cast nonland cards from your hand without paying their mana costs." - */ addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); @@ -274,7 +239,7 @@ public class TamiyoTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1); addCard(Zone.BATTLEFIELD, playerB, "Memnite", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two"); addTarget(playerA, "Bronze Sable^Memnite"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/UginTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/UginTest.java index b1d9fe945a4..18556c2a31a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/UginTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/UginTest.java @@ -33,8 +33,10 @@ public class UginTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Nissa, Vastwood Seer"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+2: {this} deals 3 damage", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Nissa, Vastwood Seer"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Nissa, Vastwood Seer", true); + setChoice(playerB, "Yes"); playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest"); activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "-2: Create Ashaya, the Awoken World, a legendary 4/4 green Elemental creature token."); @@ -58,7 +60,5 @@ public class UginTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 17); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/VivienTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/VivienTest.java index 46a261638bb..3b6f1720316 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/VivienTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/VivienTest.java @@ -22,7 +22,7 @@ public class VivienTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Vivien, Arkbow Ranger"); // Planeswalker {1}{G}{G}{G} - starts with 4 Loyality counters addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger", true); addTargetAmount(playerA, TestPlayer.TARGET_SKIP); // stop choosing (not targets) activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Distribute"); @@ -46,7 +46,7 @@ public class VivienTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Distribute"); addTargetAmount(playerA, "Silvercoat Lion", 1); @@ -72,7 +72,7 @@ public class VivienTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Distribute"); addTargetAmount(playerA, "Silvercoat Lion", 2); @@ -96,7 +96,7 @@ public class VivienTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Distribute"); addTargetAmount(playerA, "Silvercoat Lion", 2); @@ -122,7 +122,7 @@ public class VivienTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vivien, Arkbow Ranger", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Distribute"); addTargetAmount(playerA, "Silvercoat Lion", 1); @@ -138,7 +138,5 @@ public class VivienTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Pillarfield Ox", 3, 5); assertAbility(playerA, "Silvercoat Lion", TrampleAbility.getInstance(), true); assertAbility(playerA, "Pillarfield Ox", TrampleAbility.getInstance(), true); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAllDamageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAllDamageTest.java index 43042e701b8..1298d4c79d2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAllDamageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAllDamageTest.java @@ -112,10 +112,11 @@ public class PreventAllDamageTest extends CardTestPlayerBase { attack(1, playerA, "Abbey Griffin"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Abbey Griffin"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Abbey Griffin"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", playerA); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", "Abbey Griffin"); attack(2, playerB, "Silvercoat Lion"); @@ -134,6 +135,5 @@ public class PreventAllDamageTest extends CardTestPlayerBase { assertLife(playerA, 18); assertLife(playerB, 18); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAttachedEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAttachedEffectTest.java index 1a5fc1a58c7..191e5766bcc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAttachedEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/prevention/PreventAttachedEffectTest.java @@ -33,7 +33,7 @@ public class PreventAttachedEffectTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Temporal Isolation", "Kaervek the Merciless"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion", true); addTarget(playerA, playerB); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Pillarfield Ox"); addTarget(playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/HallowedMoonlightTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/HallowedMoonlightTest.java index f61ec75b385..9f48d7af366 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/HallowedMoonlightTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/HallowedMoonlightTest.java @@ -31,8 +31,9 @@ public class HallowedMoonlightTest extends CardTestPlayerBase { castSpell(2, PhaseStep.DRAW, playerA, "Hallowed Moonlight"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Spiritual Visit"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Spiritual Visit", true); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Reanimate", "Pillarfield Ox"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Silvercoat Lion"); setStopAt(2, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PanharmoniconTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PanharmoniconTest.java index 70432ace6ec..7b8f6168da7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PanharmoniconTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PanharmoniconTest.java @@ -25,7 +25,7 @@ public class PanharmoniconTest extends CardTestPlayerBase { // When Devout Monk enters the battlefield, you gain 1 life. addCard(Zone.HAND, playerA, "Devout Monk"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul Warden"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul Warden", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Devout Monk"); // Life: 20 + 2*1 + 2*1 = 24 setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); @@ -48,6 +48,7 @@ public class PanharmoniconTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Devout Monk"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Soul Warden"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Devout Monk"); // Life: 20 + 1 + 1 = 22 setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java index fa6e44510af..ba3e0aadaa1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java @@ -36,6 +36,7 @@ public class PillarOfFlameTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Dutiful Thrull"); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Pillar of Flame", playerB); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Stonewright"); attack(3, playerA, "Rakdos Cackler"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/SanctifierEnVecTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/SanctifierEnVecTest.java index 62ae3e3c24e..5b3ad44f2b7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/SanctifierEnVecTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/SanctifierEnVecTest.java @@ -46,7 +46,9 @@ public class SanctifierEnVecTest extends CardTestPlayerBase { setStrictChooseMode(true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Midnight Reaper"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Grizzly Bears"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Divination"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "One with Nothing"); setStopAt(2, PhaseStep.END_TURN); @@ -77,7 +79,7 @@ public class SanctifierEnVecTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, painter); setStrictChooseMode(true); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, painter); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, painter, true); setChoice(playerA, "Black"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, sanctifier); setStopAt(1, PhaseStep.END_TURN); @@ -114,6 +116,7 @@ public class SanctifierEnVecTest extends CardTestPlayerBase { setChoice(playerA, "Red"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Midnight Reaper"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Grizzly Bears"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Divination"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "One with Nothing"); setStopAt(2, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WinLoseEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WinLoseEffectsTest.java index e5bcc383ee6..79be2f85727 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WinLoseEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/WinLoseEffectsTest.java @@ -128,7 +128,7 @@ public class WinLoseEffectsTest extends CardTestPlayerBase { addCard(Zone.LIBRARY, playerA, "Bogardan Hellkite", 3); // 24 life lost castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angel's Grace"); - + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ad Nauseam"); setChoice(playerA, true); setChoice(playerA, true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java index d9e60b9c67d..fbc6887c764 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java @@ -229,6 +229,7 @@ public class ZoneChangeReplacementTest extends CardTestPlayerBase { castSpell(2, PhaseStep.COMBAT_DAMAGE, playerA, "Unsummon", "Pillarfield Ox"); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Pillarfield Ox"); + waitStackResolved(2, PhaseStep.POSTCOMBAT_MAIN); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Terminate", "Pillarfield Ox"); setStopAt(2, PhaseStep.END_TURN); @@ -267,6 +268,7 @@ public class ZoneChangeReplacementTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Legacy Weapon"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Mana Drain", "Legacy Weapon"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); // Let the Mana Drain delayed triggered ability resolve castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Legacy Weapon"); setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/HardenedScaleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/HardenedScaleTest.java index 09a014676f6..5cb24f8ae85 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/HardenedScaleTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/HardenedScaleTest.java @@ -49,7 +49,7 @@ public class HardenedScaleTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, hWalker); addCard(Zone.BATTLEFIELD, playerA, "Wastes", 4); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, mMimic); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, mMimic, true); setChoice(playerA, "Construct"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, hWalker); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/lifereduce/DamageSetToXLifeInsteadTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/lifereduce/DamageSetToXLifeInsteadTest.java index b25fe7222f4..34fe68ceaf4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/lifereduce/DamageSetToXLifeInsteadTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/lifereduce/DamageSetToXLifeInsteadTest.java @@ -2,6 +2,7 @@ package org.mage.test.cards.replacement.lifereduce; import mage.constants.PhaseStep; import mage.constants.Zone; +import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -50,6 +51,7 @@ public class DamageSetToXLifeInsteadTest extends CardTestPlayerBase { setLife(playerB, 8); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bump in the Night", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Axe", playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -82,28 +84,26 @@ public class DamageSetToXLifeInsteadTest extends CardTestPlayerBase { } /** - * Tests Worhsip when there is no creature: + * Tests Worship when there is no creature: * If you control a creature, damage that would reduce your life total to less than 1 reduces it to 1 instead */ @Test public void testWorshipWithoutCreature() { - addCard(Zone.HAND, playerA, "Volcanic Hammer", 2); - addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + addCard(Zone.HAND, playerA, "Volcanic Hammer", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); addCard(Zone.BATTLEFIELD, playerA, "Llanowar Elves"); addCard(Zone.BATTLEFIELD, playerB, "Worship"); - addCard(Zone.BATTLEFIELD, playerB, "Elite Vanguard"); setLife(playerB, 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Hammer", "Elite Vanguard"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Hammer", playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertLife(playerB, -1); + Assert.assertFalse("PlayerB should be dead", playerB.isInGame()); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/rules/ActivateAbilityOnlyLimitedTimesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/rules/ActivateAbilityOnlyLimitedTimesTest.java index c050125d83f..bb49ae90233 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/rules/ActivateAbilityOnlyLimitedTimesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/rules/ActivateAbilityOnlyLimitedTimesTest.java @@ -77,6 +77,7 @@ public class ActivateAbilityOnlyLimitedTimesTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wall of Wood"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Momentary Blink", "Wall of Roots", "Cast Wall of Wood"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wall of Wood"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java index c3bc06a725b..357b9358907 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java @@ -36,12 +36,9 @@ public class CantCastTest extends CardTestPlayerBase { try { execute(); - assertHandCount(playerA, "Jayemdae Tome", 1); - assertPermanentCount(playerA, "Jayemdae Tome", 0); - Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Jayemdae Tome")) { Assert.fail("must not have throw error about bad targets, but got:\n" + e.getMessage()); } } @@ -73,7 +70,7 @@ public class CantCastTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Blaze$targetPlayer=PlayerA")) { Assert.fail("must not have throw error about bad targets, but got:\n" + e.getMessage()); } } @@ -135,7 +132,7 @@ public class CantCastTest extends CardTestPlayerBase { try { execute(); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Pine Walker")) { Assert.fail("must not have throw error about bad targets, but got:\n" + e.getMessage()); } } @@ -163,7 +160,7 @@ public class CantCastTest extends CardTestPlayerBase { try { execute(); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Mox Opal")) { Assert.fail("must not have throw error about bad targets, but got:\n" + e.getMessage()); } } @@ -241,7 +238,7 @@ public class CantCastTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerB must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Abrupt Decay$target=Ethersworn Canonist")) { Assert.fail("must not have throw error about bad targets, but got:\n" + e.getMessage()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/rules/MeliraSylvokOutcastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/rules/MeliraSylvokOutcastTest.java index 7b47563ea4a..9f7e32e4b0f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/rules/MeliraSylvokOutcastTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/rules/MeliraSylvokOutcastTest.java @@ -31,7 +31,7 @@ public class MeliraSylvokOutcastTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Devoted Druid", 1); // 0/2 activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Put a -1/-1 counter on "); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Put a -1/-1 counter on"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -40,7 +40,7 @@ public class MeliraSylvokOutcastTest extends CardTestPlayerBase { execute(); Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Put a -1/-1 counter on")) { Assert.fail("Needed error about not being able to use the Devoted Druid's -1/-1 ability, but got:\n" + e.getMessage()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/rules/TokenLimitTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/rules/TokenLimitTest.java index b5fd5701cde..01d08ca4bc4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/rules/TokenLimitTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/rules/TokenLimitTest.java @@ -33,17 +33,18 @@ public class TokenLimitTest extends CardTestPlayerBase { @Test public void testOnePlayerHitsLimitWithOtherPlayer() { - addCard(Zone.BATTLEFIELD, playerA, procession, 4); - addCard(Zone.BATTLEFIELD, playerA, "Plains", 33); - addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); addCard(Zone.HAND, playerA, secure); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 33); + addCard(Zone.BATTLEFIELD, playerA, procession, 4); + addCard(Zone.HAND, playerB, secure); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, secure); setChoice(playerA, "X=32"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, secure); - setChoice(playerB, "X=3"); + setChoice(playerB, "X=2"); setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/rules/WorldEnchantmentsRuleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/rules/WorldEnchantmentsRuleTest.java index abf37d9efb9..d8eb2fe0ccf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/rules/WorldEnchantmentsRuleTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/rules/WorldEnchantmentsRuleTest.java @@ -30,7 +30,7 @@ public class WorldEnchantmentsRuleTest extends CardTestMultiPlayerBase { addCard(Zone.HAND, playerD, "Nether Void", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nether Void"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); // just needed to get different craete time to second Nether Void + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion"); // just needed to get different craete time to second Nether Void castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerD, "Nether Void"); setStopAt(2, PhaseStep.END_TURN); @@ -40,7 +40,9 @@ public class WorldEnchantmentsRuleTest extends CardTestMultiPlayerBase { assertPermanentCount(playerD, "Nether Void", 1); } - // 801.12 The "world rule" applies to a permanent only if other world permanents are within its controller's range of influence. + /** + * 801.12 The "world rule" applies to a permanent only if other world permanents are within its controller's range of influence. + */ @Test public void TestTwoWorldEnchantmentsNotInRangeOfInfluence() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); @@ -52,7 +54,7 @@ public class WorldEnchantmentsRuleTest extends CardTestMultiPlayerBase { addCard(Zone.HAND, playerC, "Nether Void", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nether Void"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); // just needed to get different craete time to second Nether Void + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion"); // just needed to get different craete time to second Nether Void castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerC, "Nether Void"); setStopAt(3, PhaseStep.END_TURN); @@ -62,9 +64,11 @@ public class WorldEnchantmentsRuleTest extends CardTestMultiPlayerBase { assertPermanentCount(playerC, "Nether Void", 1); } - // 704.5 In the event of a tie for the shortest amount of time, all are put into their owners’ graveyards. This is called the “world rule.” - // In this example the execution order of the leaves the battlefield triggers of the two Oblivion Rings decide, which World Enchnatment may stay - // Player order: A -> D -> C -> B + /** + * 704.5 In the event of a tie for the shortest amount of time, all are put into their owners’ graveyards. This is called the “world rule.” + * In this example the execution order of the leaves the battlefield triggers of the two Oblivion Rings decide, which World Enchnatment may stay + * Player order: A -> D -> C -> B + */ @Test public void TestTwoWorldEnchantmentsFromTriggers() { setStrictChooseMode(true); @@ -87,14 +91,14 @@ public class WorldEnchantmentsRuleTest extends CardTestMultiPlayerBase { addCard(Zone.BATTLEFIELD, playerD, "Plains", 1); addCard(Zone.BATTLEFIELD, playerD, "Mountain", 6); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring", true); addTarget(playerA, "Concordant Crossroads"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Concordant Crossroads"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Concordant Crossroads", true); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerD, "Oblivion Ring"); addTarget(playerD, "Concordant Crossroads"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerD, "Anarchy"); // Both World Enchantments return at the same time and go to grave + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerD, "Anarchy"); // Both World Enchantments return at the same time and go to grave - setStopAt(2, PhaseStep.BEGIN_COMBAT); + setStopAt(2, PhaseStep.END_TURN); execute(); assertPermanentCount(playerD, "Concordant Crossroads", 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/BruenorBattlehammerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/BruenorBattlehammerTest.java index 363bceda0e8..b08c2440d45 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/BruenorBattlehammerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/BruenorBattlehammerTest.java @@ -27,6 +27,7 @@ public class BruenorBattlehammerTest extends CardTestPlayerBase { // activate {2} for free activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", lion); setChoice(playerA, true); // use for free + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); // activate {1} for mana activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {1}", lion); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/TheTarrasqueTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/TheTarrasqueTest.java index 16acbdcfb30..5ac33c4cae9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/TheTarrasqueTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/afr/TheTarrasqueTest.java @@ -84,7 +84,7 @@ public class TheTarrasqueTest extends CardTestPlayerBase { setChoice(playerA, true); setChoice(playerA, tarrasque); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, sakashima); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, sakashima); setChoice(playerA, true); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/akh/HapatraVizierOfPoisonsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/akh/HapatraVizierOfPoisonsTest.java index 1e2082292e0..08e4f35c787 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/akh/HapatraVizierOfPoisonsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/akh/HapatraVizierOfPoisonsTest.java @@ -119,7 +119,7 @@ public class HapatraVizierOfPoisonsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, concordantCrossroads, 1); addCard(Zone.BATTLEFIELD, playerB, krakenHatchling, 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, sprout); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, sprout, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, triumphOfTheHordes); attack(1, playerA, "Saproling Token"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/arb/SenTripletsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/arb/SenTripletsTest.java index 3f14a403825..5f4db489a42 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/arb/SenTripletsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/arb/SenTripletsTest.java @@ -42,7 +42,8 @@ public class SenTripletsTest extends CardTestPlayerBase { initTriplets(); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bolt, playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, relic); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, relic, true); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Island"); setStopAt(1, PhaseStep.END_TURN); @@ -72,12 +73,10 @@ public class SenTripletsTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerB must have 0 actions but found 1")) { + if (!e.getMessage().contains("Can't find ability to activate command: {T}")) { Assert.fail("must throw error about bad targets, but got:\n" + e.getMessage()); } } - - assertTapped("Taiga", false); } /** @@ -96,12 +95,9 @@ public class SenTripletsTest extends CardTestPlayerBase { Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerB must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Lightning Bolt$targetPlayer=PlayerA")) { Assert.fail("must throw error about bad targets, but got:\n" + e.getMessage()); } } - - assertHandCount(playerB, bolt, 1); - assertLife(playerA, 20); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java index 92f9729abec..452274fad8c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java @@ -51,7 +51,7 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { try { execute(); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Abuna Acolyte")) { Assert.fail("Should have had error playerA having too many actions, but got:\n" + e.getMessage()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/ExquisiteBloodTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/ExquisiteBloodTest.java index 9d4d42c52b8..db6b4e2b1b2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/ExquisiteBloodTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/ExquisiteBloodTest.java @@ -29,6 +29,7 @@ public class ExquisiteBloodTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bump in the Night", playerB); attack(1, playerA, "Raging Goblin"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c17/TheUrDragonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c17/TheUrDragonTest.java index bbc4a0b6a3a..cb7366cbb0d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/c17/TheUrDragonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c17/TheUrDragonTest.java @@ -27,7 +27,7 @@ public class TheUrDragonTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Dragon Hatchling", 2); // Creature Dragon {1}{R} (0/1) addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dragon Hatchling"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dragon Hatchling", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dragon Hatchling"); attack(3, playerA, "The Ur-Dragon"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c18/AminatousAuguryTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c18/AminatousAuguryTest.java index 3b1c700951b..6fb83bc7486 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/c18/AminatousAuguryTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c18/AminatousAuguryTest.java @@ -38,16 +38,17 @@ public class AminatousAuguryTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Island", 8); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aminatou's Augury"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aminatou's Augury", true); setChoice(playerA, true); // Put a land from among the exiled cards into play? setChoice(playerA, "Badlands"); // Select a land card - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adarkar Sentinel"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adarkar Sentinel", true); setChoice(playerA, "Artifact"); // Which card type do you want to consume? - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aegis of the Gods"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aegis of the Gods", true); setChoice(playerA, "Enchantment"); // Which card type do you want to consume? - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Storm Crow"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Storm Crow", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tormenting Voice"); setChoice(playerA, "Silvercoat Lion"); // Select a card (discard cost) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java index c5c97c242f8..630721af3b9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c19/ChainerNightmareAdeptTest.java @@ -24,6 +24,7 @@ public class ChainerNightmareAdeptTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerA, maaka, 2); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Discard"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, maaka); // Only one should be castable @@ -52,7 +53,8 @@ public class ChainerNightmareAdeptTest extends CardTestPlayerBase { activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Discard"); setChoice(playerA, true); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, maaka); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, maaka, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, khenra); attack(1, playerA, maaka); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/PakoArcaneRetrieverTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/PakoArcaneRetrieverTest.java index d2f8de5c85d..f36e3f5eef3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/PakoArcaneRetrieverTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/c20/PakoArcaneRetrieverTest.java @@ -76,6 +76,7 @@ public class PakoArcaneRetrieverTest extends CardTestPlayerBase { attack(1, playerA, "Pako, Arcane Retriever"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Call of the Conclave"); setStopAt(1, PhaseStep.END_TURN); @@ -86,7 +87,5 @@ public class PakoArcaneRetrieverTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Lightning Bolt", 1); assertGraveyardCount(playerB, "Call of the Conclave", 1); - - - } + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/cmd/AcornCatapultTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/cmd/AcornCatapultTest.java index 9b0cdc02dec..14466314981 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/cmd/AcornCatapultTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/cmd/AcornCatapultTest.java @@ -23,7 +23,7 @@ public class AcornCatapultTest extends CardTestPlayerBase { // {1}{B}, {T}: Target player loses 1 life. addCard(Zone.BATTLEFIELD, playerB, "Acolyte of Xathrid"); // Creature 0/1 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Acorn Catapult"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Acorn Catapult", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, {T}:", "Acolyte of Xathrid"); @@ -46,7 +46,7 @@ public class AcornCatapultTest extends CardTestPlayerBase { // That permanent's controller or that player creates a 1/1 green Squirrel creature token. addCard(Zone.HAND, playerA, "Acorn Catapult"); //Artifact {4} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Acorn Catapult"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Acorn Catapult", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, {T}:", playerB); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/ProfaneTransfusionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/ProfaneTransfusionTest.java index ccfdc6ba480..b932d8d17eb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/ProfaneTransfusionTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/cmr/ProfaneTransfusionTest.java @@ -98,6 +98,8 @@ public class ProfaneTransfusionTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, skullcrack, playerB); addTarget(playerA, playerA); addTarget(playerA, playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, transfusion); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/dka/HavengulLichTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/dka/HavengulLichTest.java index 8a399f337f3..5428ad19d36 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/dka/HavengulLichTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/dka/HavengulLichTest.java @@ -27,7 +27,9 @@ public class HavengulLichTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerA, "Prodigal Pyromancer"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}", "Prodigal Pyromancer"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Prodigal Pyromancer"); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{T}: {this} deals", playerB); setStopAt(1, PhaseStep.END_TURN); execute(); @@ -71,6 +73,7 @@ public class HavengulLichTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerA, "Prodigal Pyromancer"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: You may", "Prodigal Pyromancer"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Prodigal Pyromancer"); // Havengul Lich must lose the ability to tap (Prodigal Pyromancer still has summoning sickness) @@ -110,8 +113,10 @@ public class HavengulLichTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerA, "Perilous Myr"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: You may", "Perilous Myr"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Perilous Myr"); addTarget(playerA, playerB); + execute(); assertLife(playerA, 20); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/dst/EchoingTruthTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/dst/EchoingTruthTest.java index eaff4aba478..9bde9dc958b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/dst/EchoingTruthTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/dst/EchoingTruthTest.java @@ -25,6 +25,7 @@ public class EchoingTruthTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Echoing Truth"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spectral Procession"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Echoing Truth", "Spirit Token"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/e10/PithingNeedleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/e10/PithingNeedleTest.java new file mode 100644 index 00000000000..4c40bf2b702 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/e10/PithingNeedleTest.java @@ -0,0 +1,70 @@ +package org.mage.test.cards.single.e10; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestMultiPlayerBase; + +/** + * {@link mage.cards.p.PithingNeedle Pithing Needle} + * Artifact + * {1} + * As Pithing Needle comes into play, name a card. + * Activated abilities of sources with the chosen name can't be played unless they're mana abilities. + * + * @author LevelX2, Alex-Vasile + */ +public class PithingNeedleTest extends CardTestMultiPlayerBase { + + /** + * Test that it works and it respects range of influence + */ + @Test + public void TestPithingNeedle() { + addCard(Zone.HAND, playerA, "Pithing Needle"); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.LIBRARY, playerA, "Pillarfield Ox", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 3); + // {2}{U}, {T}: Put target creature on the bottom of its owner's library. + // That creature's controller reveals cards from the top of their library until they reveal a creature card. + // The player puts that card onto the battlefield and the rest on the bottom of their library in any order. + // Activate this ability only any time you could cast a sorcery. + addCard(Zone.BATTLEFIELD, playerB, "Proteus Staff", 1); + + addCard(Zone.BATTLEFIELD, playerC, "Island", 3); + addCard(Zone.BATTLEFIELD, playerC, "Proteus Staff", 1); + addCard(Zone.BATTLEFIELD, playerC, "Wall of Air", 1); + addCard(Zone.LIBRARY, playerC, "Wind Drake", 2); + + addCard(Zone.BATTLEFIELD, playerD, "Island", 3); + addCard(Zone.BATTLEFIELD, playerD, "Eager Cadet", 1); + addCard(Zone.LIBRARY, playerD, "Storm Crow", 2); + + skipInitShuffling(); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pithing Needle"); + setChoice(playerA, "Proteus Staff"); + + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerC, "{2}{U}", "Eager Cadet"); // allowed because Needle out of range + + activateAbility(4, PhaseStep.PRECOMBAT_MAIN, playerB, "{2}{U}", "Wall of Air"); // not allowed + + setStopAt(4, PhaseStep.END_TURN); + try { + execute(); + Assert.fail("must throw exception on execute"); + } catch (Throwable e) { + if (!e.getMessage().contains("Can't find ability to activate command: {2}{U}$target=Wall of Air")) { + Assert.fail("Should have thrown an error about PlayerB not being able to use the staff to target Wall of Air, but got:\n" + e.getMessage()); + } + } + + assertPermanentCount(playerD, "Eager Cadet", 0); + assertPermanentCount(playerD, "Storm Crow", 1); + assertPermanentCount(playerC, "Wall of Air", 1); + assertPermanentCount(playerC, "Wind Drake", 0); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/EmrakulThePromisedEndTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/EmrakulThePromisedEndTest.java index 96269a9c910..859e109debb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/EmrakulThePromisedEndTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/emn/EmrakulThePromisedEndTest.java @@ -20,7 +20,7 @@ public class EmrakulThePromisedEndTest extends CardTestPlayerBase { // After that turn, that player takes an extra turn. addCard(Zone.HAND, playerB, "Emrakul, the Promised End"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Teferi, Mage of Zhalfir"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Teferi, Mage of Zhalfir", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Emrakul, the Promised End"); addTarget(playerB, playerA); @@ -37,7 +37,7 @@ public class EmrakulThePromisedEndTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Teferi, Mage of Zhalfir"); addCard(Zone.HAND, playerB, "Emrakul, the Promised End"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Teferi, Mage of Zhalfir"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Teferi, Mage of Zhalfir", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Emrakul, the Promised End"); addTarget(playerB, playerA); @@ -54,7 +54,7 @@ public class EmrakulThePromisedEndTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Teferi, Mage of Zhalfir"); addCard(Zone.HAND, playerB, "Emrakul, the Promised End"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Teferi, Mage of Zhalfir"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Teferi, Mage of Zhalfir", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Emrakul, the Promised End"); addTarget(playerB, playerA); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/eve/HotheadedGiantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/eve/HotheadedGiantTest.java index baf88f59cb0..a35b0961941 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/eve/HotheadedGiantTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/eve/HotheadedGiantTest.java @@ -19,7 +19,7 @@ public class HotheadedGiantTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, goblin); addCard(Zone.HAND, playerA, giant); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, goblin); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, goblin, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, giant); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DaybreakCoronetTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DaybreakCoronetTest.java index 2c0e1a7f313..c05fee59f06 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DaybreakCoronetTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DaybreakCoronetTest.java @@ -41,6 +41,7 @@ public class DaybreakCoronetTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Holy Strength", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daybreak Coronet", "Silvercoat Lion"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -65,6 +66,7 @@ public class DaybreakCoronetTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Demystify"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Holy Strength", "Silvercoat Lion"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daybreak Coronet", "Silvercoat Lion"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Demystify", "Holy Strength"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java index 1455a23d5f5..4f6a84ec631 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/DustOfMomentsTest.java @@ -54,7 +54,7 @@ public class DustOfMomentsTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Deep-Sea Kraken"); addCard(Zone.HAND, playerA, "Dust of Moments"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chronozoa"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chronozoa", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Suspend"); // Casts Deep-Sea Kraken as Suspend castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Dust of Moments"); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java index cb2dce5a39b..c016b3fcb17 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/fut/MuragandaPetroglyphsTest.java @@ -170,6 +170,7 @@ public class MuragandaPetroglyphsTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Dehydration"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rancor", "Grizzly Bears"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dehydration", "Runeclaw Bear"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/PeltCollectorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/PeltCollectorTest.java index b25ea871c4c..11cf2446556 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/PeltCollectorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/PeltCollectorTest.java @@ -35,7 +35,7 @@ public class PeltCollectorTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, collector, 1);// Creature {G} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, collector); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, collector, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lion); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -76,6 +76,7 @@ public class PeltCollectorTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, trostani); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, collector); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, lion); setStopAt(3, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/ThousandYearStormTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/ThousandYearStormTest.java index 025199a960d..16bf7895248 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/ThousandYearStormTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/grn/ThousandYearStormTest.java @@ -58,6 +58,7 @@ public class ThousandYearStormTest extends CardTestPlayerBase { // bolt stack before castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); // storm castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thousand-Year Storm"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/hou/AbandonedSarcophagusTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/hou/AbandonedSarcophagusTest.java index 7a4e6c83478..f1ff8a76b8f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/hou/AbandonedSarcophagusTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/hou/AbandonedSarcophagusTest.java @@ -84,7 +84,7 @@ public class AbandonedSarcophagusTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Ash Barrens"); // Land addCard(Zone.HAND, playerA, "Beast Within", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Astral Drift"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Astral Drift", true); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ash Barrens"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Beast Within", "Astral Drift"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/KinnanBonderProdigyTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/KinnanBonderProdigyTest.java index 7ac13deba5c..479069abba1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/KinnanBonderProdigyTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/KinnanBonderProdigyTest.java @@ -57,6 +57,7 @@ public class KinnanBonderProdigyTest extends CardTestPlayerBase { // sacrifice treasure and add additional mana activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Sacrifice"); setChoice(playerA, "Red"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, hovermyr); setStrictChooseMode(true); 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 bad9536734b..00f276ca2e2 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 @@ -149,8 +149,8 @@ public class TheOzolithTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, BRANCHING_EVOLUTION); addCard(Zone.HAND, playerA, PUNCTURE_BLAST); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, FERTILID); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, BRANCHING_EVOLUTION); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, FERTILID, true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, BRANCHING_EVOLUTION ,true); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, PUNCTURE_BLAST, FERTILID); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/CodespellClericTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/CodespellClericTest.java index e8a723d3930..f3cb0083847 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/CodespellClericTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/CodespellClericTest.java @@ -64,7 +64,7 @@ public class CodespellClericTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, relic, 2); addCard(Zone.HAND, playerA, cleric); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, relic); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, relic, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, relic); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, cleric); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DraugrNecromancerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DraugrNecromancerTest.java index 5a3fb9d1eb9..85ee5164bcf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DraugrNecromancerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DraugrNecromancerTest.java @@ -97,7 +97,7 @@ public class DraugrNecromancerTest extends CardTestPlayerBase { execute(); Assert.fail("must throw exception on execute"); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Cast Grizzly Bears")) { Assert.fail("Needed error about PlayerA having too many actions, but got:\n" + e.getMessage()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DreamDevourerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DreamDevourerTest.java index 852c67b26d0..2a5a8809620 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DreamDevourerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/DreamDevourerTest.java @@ -139,9 +139,8 @@ public class DreamDevourerTest extends CardTestPlayerBase { waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); checkExileCount("after foretell", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Jorn, God of Winter", 2); - checkPlayableAbility("foretell cast left side", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Foretell {G}", true); - checkPlayableAbility("foretell cast right side", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Foretell {U}{B}", true); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Foretell {G}"); + waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Foretell {U}{B}"); waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN); checkPermanentCount("after foretell cast", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Jorn, God of Winter", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/ValkiGodOfLiesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/ValkiGodOfLiesTest.java index 57581e4ca43..64c077437d8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/ValkiGodOfLiesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/khm/ValkiGodOfLiesTest.java @@ -17,10 +17,10 @@ public class ValkiGodOfLiesTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears"); addCard(Zone.LIBRARY, playerB, "Ephemerate"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tibalt, Cosmic Impostor"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tibalt, Cosmic Impostor", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+2: Exile the top card of each player's library."); - playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Plains"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ephemerate", "Grizzly Bears"); + playLand(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Plains"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Ephemerate", "Grizzly Bears"); setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest2.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/lea/ManabarbsTest.java similarity index 81% rename from Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest2.java rename to Mage.Tests/src/test/java/org/mage/test/cards/single/lea/ManabarbsTest.java index a288536878b..28ee00bf0d4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ManabarbsTest2.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/lea/ManabarbsTest.java @@ -1,4 +1,4 @@ -package org.mage.test.cards.triggers; +package org.mage.test.cards.single.lea; import mage.constants.PhaseStep; import mage.constants.Zone; @@ -6,11 +6,14 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * @author ayratn + * {@link mage.cards.m.Manabarbs Manabarbs} + * {3}{R} + * Enchantment + * Whenever a player taps a land for mana, Manabarbs deals 1 damage to that player. * - * Card: Whenever a player taps a land for mana, Manabarbs deals 1 damage to that player. + * @author ayratn */ -public class ManabarbsTest2 extends CardTestPlayerBase { +public class ManabarbsTest extends CardTestPlayerBase { /** * Issue 374: manabarb enchantment @@ -27,7 +30,7 @@ public class ManabarbsTest2 extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Elemental"); addCard(Zone.HAND, playerA, "Ball Lightning"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ball Lightning"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ball Lightning", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Elemental"); attack(1, playerA, "Ball Lightning"); attack(1, playerA, "Lightning Elemental"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/lgn/InfernalCaretakerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/lgn/InfernalCaretakerTest.java index 27f4489fcf5..143f0712988 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/lgn/InfernalCaretakerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/lgn/InfernalCaretakerTest.java @@ -30,7 +30,7 @@ public class InfernalCaretakerTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerB, "Festering Goblin", 4); addCard(Zone.GRAVEYARD, playerB, "Elvish Visionary", 4); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infernal Caretaker"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infernal Caretaker", true); setChoice(playerA, true); // Cast as a morph activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}{B}: Turn this face-down permanent face up."); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/AegisAngelTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/AegisAngelTest.java index ecf79c70f55..e072fc9a1e5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/AegisAngelTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/AegisAngelTest.java @@ -48,7 +48,7 @@ public class AegisAngelTest extends CardTestPlayerBase { } @Test - public void testAngelDiesBeforeEntering() { + public void testAngelDiesBeforeETBResolves() { addCard(Zone.BATTLEFIELD, playerA, "Scrubland", 9); addCard(Zone.BATTLEFIELD, playerA, lion); addCard(Zone.HAND, playerA, angel); @@ -56,8 +56,8 @@ public class AegisAngelTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, angel); addTarget(playerA, lion); - - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, murder, angel); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, murder, angel, "When "); setStrictChooseMode(true); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/TurnToFrogTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/TurnToFrogTest.java index 8f5f310fca5..490e0abed70 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/TurnToFrogTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m12/TurnToFrogTest.java @@ -26,6 +26,7 @@ public class TurnToFrogTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Turn to Frog"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{R}{G}: Until end of turn, {this} becomes a 3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\" It's still a land."); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Turn to Frog", "Raging Ravine"); attack(1, playerA, "Raging Ravine"); @@ -47,6 +48,7 @@ public class TurnToFrogTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Turn to Frog"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{R}{G}: Until end of turn, {this} becomes a 3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\" It's still a land."); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Turn to Frog", "Raging Ravine"); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{R}{G}: Until end of turn, {this} becomes a 3/3 red and green Elemental creature with \"Whenever this creature attacks, put a +1/+1 counter on it.\" It's still a land."); @@ -82,5 +84,4 @@ public class TurnToFrogTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Llanowar Elves", 0); assertPowerToughness(playerB, "Craw Wurm", -1, 1); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m14/ChandraPyromasterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m14/ChandraPyromasterTest.java index 63ea393f673..f5330bffa94 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m14/ChandraPyromasterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m14/ChandraPyromasterTest.java @@ -22,6 +22,7 @@ public class ChandraPyromasterTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Exile the top card of your library. You may play it this turn."); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mizzium Mortars", "Silvercoat Lion"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -61,7 +62,7 @@ public class ChandraPyromasterTest extends CardTestPlayerBase { } @Test - public void testAbility2CastCardFromExileWithOverlaod() { + public void testAbility2CastCardFromExileWithOverload() { addCard(Zone.BATTLEFIELD, playerA, "Chandra, Pyromaster"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); @@ -72,6 +73,7 @@ public class ChandraPyromasterTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "0: Exile the top card of your library. You may play it this turn."); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mizzium Mortars with overload"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -84,7 +86,5 @@ public class ChandraPyromasterTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 0); assertGraveyardCount(playerB, "Silvercoat Lion", 2); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m20/RepeatedReverberationTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m20/RepeatedReverberationTest.java index d00a942957b..12ac55ba308 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m20/RepeatedReverberationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m20/RepeatedReverberationTest.java @@ -36,7 +36,7 @@ public class RepeatedReverberationTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ajani); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, repeatedReverb); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, repeatedReverb, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: You gain 2 life"); setStrictChooseMode(true); @@ -96,8 +96,9 @@ public class RepeatedReverberationTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, repeatedReverb); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, repeatedReverb, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, soulFeast); + addTarget(playerA, playerB); setChoice(playerA, false); //Choose new targets? setChoice(playerA, false); //Choose new targets? diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ArchfiendsVesselTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ArchfiendsVesselTest.java index 58129be4974..50fbfa81b75 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ArchfiendsVesselTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ArchfiendsVesselTest.java @@ -40,7 +40,7 @@ public class ArchfiendsVesselTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Yawgmoth's Will"); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yawgmoth's Will"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yawgmoth's Will", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, archfiendsVessel); setStrictChooseMode(true); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); @@ -53,7 +53,7 @@ public class ArchfiendsVesselTest extends CardTestPlayerBase { } @Test - public void diesOnStack() { + public void diesWithAbilityStack() { // If Archfiend’s Vessel leaves the battlefield while its triggered ability is on the stack, // you can’t exile it from the zone it’s put into, so you won’t create a Demon. @@ -62,11 +62,13 @@ public class ArchfiendsVesselTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Fatal Push"); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + setStrictChooseMode(true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exhume"); addTarget(playerA, archfiendsVessel); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fatal Push"); - addTarget(playerA, archfiendsVessel); - setStrictChooseMode(true); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fatal Push", archfiendsVessel); + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/BasrisLieutenantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/BasrisLieutenantTest.java index e749537a260..19afb4463ee 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/BasrisLieutenantTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/BasrisLieutenantTest.java @@ -5,15 +5,19 @@ import mage.constants.Zone; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; +/** + * {@link mage.cards.b.BasrisLieutenant Basri's Lieutenant} + * When Basri's Lieutenant enters the battlefield, put a +1/+1 counter on target creature you control. + * Whenever Basri's Lieutenant or another creature you control dies, if it had a +1/+1 counter on it, create a 2/2 white Knight creature token with vigilance. + * + * @author ingmargoudt + */ public class BasrisLieutenantTest extends CardTestPlayerBase { private static final String basrisLieutenant = "Basri's Lieutenant"; @Test public void counterOnLieutenant(){ - // When Basri's Lieutenant enters the battlefield, put a +1/+1 counter on target creature you control. - // Whenever Basri's Lieutenant or another creature you control dies, if it had a +1/+1 counter on it, create a 2/2 white Knight creature token with vigilance. - addCard(Zone.HAND, playerA, basrisLieutenant); addCard(Zone.BATTLEFIELD, playerA, "Plains", 8); // Destroy all creatures. They can't be regenerated. @@ -21,6 +25,8 @@ public class BasrisLieutenantTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, basrisLieutenant); addTarget(playerA, basrisLieutenant); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wrath of God"); setStrictChooseMode(true); @@ -32,9 +38,6 @@ public class BasrisLieutenantTest extends CardTestPlayerBase { @Test public void counterOnOtherCreature(){ - // When Basri's Lieutenant enters the battlefield, put a +1/+1 counter on target creature you control. - // Whenever Basri's Lieutenant or another creature you control dies, if it had a +1/+1 counter on it, create a 2/2 white Knight creature token with vigilance. - addCard(Zone.HAND, playerA, basrisLieutenant); addCard(Zone.BATTLEFIELD, playerA, "Plains", 8); addCard(Zone.BATTLEFIELD, playerA, "Savannah Lions"); @@ -43,6 +46,8 @@ public class BasrisLieutenantTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, basrisLieutenant); addTarget(playerA, "Savannah Lions"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wrath of God"); setStrictChooseMode(true); @@ -54,17 +59,17 @@ public class BasrisLieutenantTest extends CardTestPlayerBase { @Test public void creatureWithoutCounterDies(){ - // When Basri's Lieutenant enters the battlefield, put a +1/+1 counter on target creature you control. - // Whenever Basri's Lieutenant or another creature you control dies, if it had a +1/+1 counter on it, create a 2/2 white Knight creature token with vigilance. - addCard(Zone.HAND, playerA, basrisLieutenant); addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); addCard(Zone.BATTLEFIELD, playerA, "Savannah Lions"); // Destroy target nonartifact, nonblack creature. It can't be regenerated. addCard(Zone.HAND, playerA, "Terror"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, basrisLieutenant); addTarget(playerA, "Savannah Lions"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Terror", basrisLieutenant); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasIncineratorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasIncineratorTest.java index ef5cf4d628d..3cdc5eac2de 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasIncineratorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChandrasIncineratorTest.java @@ -19,13 +19,12 @@ public class ChandrasIncineratorTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chandra's Incinerator"); - setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Chandra's Incinerator"); + setStopAt(1, PhaseStep.END_TURN); setStrictChooseMode(true); execute(); // {R} lightning bolt + {2}{R} Chandra's Incinerator assertTappedCount("Mountain", true, 4); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChromeReplicatorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChromeReplicatorTest.java index 3c7976c2c95..4f6ad2d3574 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChromeReplicatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/m21/ChromeReplicatorTest.java @@ -51,7 +51,7 @@ public class ChromeReplicatorTest extends CardTestPlayerBase { // create 2 soldier tokens addCard(Zone.HAND, playerA, "Raise the Alarm"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Raise the Alarm"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Raise the Alarm", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chrome Replicator"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/mrd/ChaliceOfTheVoidTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/mrd/ChaliceOfTheVoidTest.java index b82b7ed4009..4b4ef819d08 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/mrd/ChaliceOfTheVoidTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/mrd/ChaliceOfTheVoidTest.java @@ -17,7 +17,6 @@ public class ChaliceOfTheVoidTest extends CardTestPlayerBase { * cmc should be 2 in this case, it shouldnt be countered. * http://boardgames.stackexchange.com/questions/7327/what-is-the-converted-mana-cost-of-a-spell-with-x-when-cast-with-the-miracle-m */ - @Test public void testX1CountsFor2CMC() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); @@ -25,7 +24,7 @@ public class ChaliceOfTheVoidTest extends CardTestPlayerBase { // Whenever a player casts a spell with converted mana cost equal to the number of charge counters on Chalice of the Void, counter that spell. addCard(Zone.HAND, playerA, "Chalice of the Void", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chalice of the Void"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chalice of the Void", true); setChoice(playerA, "X=1"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chalice of the Void"); setChoice(playerA, "X=1"); @@ -35,7 +34,6 @@ public class ChaliceOfTheVoidTest extends CardTestPlayerBase { execute(); assertPermanentCount(playerA, "Chalice of the Void", 2); - } /* diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/nem/ParallaxWaveTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/nem/ParallaxWaveTest.java index 76dcebeec54..6fe37451779 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/nem/ParallaxWaveTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/nem/ParallaxWaveTest.java @@ -44,7 +44,7 @@ public class ParallaxWaveTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Parallax Wave"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Parallax Wave", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remove a fade counter from {this}: Exile target creature", "Silvercoat Lion"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remove a fade counter from {this}: Exile target creature", "Parallax Wave"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -65,7 +65,7 @@ public class ParallaxWaveTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Parallax Wave"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Parallax Wave", true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remove a fade counter from {this}: Exile target creature", "Silvercoat Lion"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remove a fade counter from {this}: Exile target creature", "Parallax Wave"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/neo/StoryweaveTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/neo/StoryweaveTest.java index e79294fd322..a7ccd562716 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/neo/StoryweaveTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/neo/StoryweaveTest.java @@ -19,6 +19,7 @@ public class StoryweaveTest extends CardTestPlayerBase { // casting the spell is a pain to set up, this is easier addCustomCardWithAbility("tester", playerA, Storyweave.makeAbility()); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{0}"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); } @Test @@ -28,7 +29,7 @@ public class StoryweaveTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, colossus); addEffectToGame(); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, fang); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, fang, true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, colossus); setStrictChooseMode(true); @@ -46,7 +47,7 @@ public class StoryweaveTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, fang); addEffectToGame(); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, intervention); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, intervention, true); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, fang); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java index 15892b14fa5..b8fdc2ac715 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/roe/WorldAtWarTest.java @@ -88,7 +88,7 @@ public class WorldAtWarTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard"); addCard(Zone.BATTLEFIELD, playerA, "Warclamp Mastiff"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "World at War"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "World at War", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "World at War"); attack(1, playerA, "Elite Vanguard"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/rtr/NivmagusElementalTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/rtr/NivmagusElementalTest.java index e2acbc60f9b..1711832d8a5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/rtr/NivmagusElementalTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/rtr/NivmagusElementalTest.java @@ -41,8 +41,10 @@ public class NivmagusElementalTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bolt, playerB); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exile"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, grapeshot, playerB); - setChoice(playerA, false); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); // Let the storm resolve to put both copies on the stack + setChoice(playerA, false); // Don't change targets for the copy activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exile"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exile"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ErdwalIlluminatorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ErdwalIlluminatorTest.java index c36710a09cd..73a141156d3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ErdwalIlluminatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/ErdwalIlluminatorTest.java @@ -52,7 +52,7 @@ public class ErdwalIlluminatorTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); addCard(Zone.BATTLEFIELD, playerA, "Island", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector"); setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/SilverfurPartisanTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/SilverfurPartisanTest.java index 34c2c7a11cb..58a92f7f986 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/SilverfurPartisanTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/soi/SilverfurPartisanTest.java @@ -26,7 +26,8 @@ public class SilverfurPartisanTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Enlarge", 1); // {3}{G}{G} sorcery: Target creature gets +7/+7 and gains trample until end of turn. addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Silverfur Partisan"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Silverfur Partisan"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enlarge", "Howlpack Wolf"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -55,6 +56,7 @@ public class SilverfurPartisanTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Mountain", 6); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Howlpack Wolf"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Arrow Storm", "Silverfur Partisan"); setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java index 82f684bf6b0..0db58bb5f62 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/tsp/HivestoneTest.java @@ -25,7 +25,7 @@ public class HivestoneTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Muscle Sliver", 1); addCard(Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 1); // Creature 2/2 - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hivestone"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/usd/UrzasIncubatorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/usd/UrzasIncubatorTest.java index 997d87e95f9..296d60fa04f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/usd/UrzasIncubatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/usd/UrzasIncubatorTest.java @@ -29,8 +29,8 @@ public class UrzasIncubatorTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Urza's Incubator"); // taps 3 plains setChoice(playerA, "Eldrazi"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eldrazi Displacer"); // taps last plains - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eldrazi Mimic"); // both mimics should be free + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eldrazi Displacer", true); // taps last plains + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eldrazi Mimic", true); // both mimics should be free castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eldrazi Mimic"); setStopAt(1, PhaseStep.END_TURN); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java index 55ef69c44c4..dec5fd9a44f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java @@ -89,6 +89,7 @@ public class BroodOfCockroachesTest extends CardTestPlayerBase { private void brood_of_cockroaches_diesat_precombat_main_phase() { addCard(BATTLEFIELD, playerB, "Mountain", 1); addCard(HAND, playerB, SHOCK, 1); + waitStackResolved(1, PRECOMBAT_MAIN); castSpell(TURN_1, PRECOMBAT_MAIN, playerB, SHOCK, BROOD_OF_COCKROACHES); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/war/KioraTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/war/KioraTest.java index e33a064f4ad..1a647eda29b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/war/KioraTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/war/KioraTest.java @@ -30,6 +30,7 @@ public class KioraTest extends CardTestPlayerBase { // cast a spell to tap the only land castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Bronze Sable"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); // untap that only land activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-1: Untap target permanent", "Forest"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/wwk/MindbreakTrapTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/wwk/MindbreakTrapTest.java index d34a689ec80..75cbcbbd7f0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/wwk/MindbreakTrapTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/wwk/MindbreakTrapTest.java @@ -27,8 +27,6 @@ public class MindbreakTrapTest extends CardTestPlayerBase { */ @Test public void mindBreakTrap_Exile_All_Spells() { - - addCard(Zone.BATTLEFIELD, playerA, "Island", 4); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 4); addCard(Zone.HAND, playerA, mindBreakTrap); @@ -37,18 +35,18 @@ public class MindbreakTrapTest extends CardTestPlayerBase { castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, shock, playerA); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, shock, playerA); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, grapeShot, playerA); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, mindBreakTrap, "Grapeshot^Grapeshot^Grapeshot"); + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, grapeShot, playerA); - setStopAt(2, PhaseStep.END_COMBAT); + waitStackResolved(2, PhaseStep.POSTCOMBAT_MAIN, 1); // Let the storm ability resolve to put the copies on the stack + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, mindBreakTrap, "Grapeshot^Grapeshot^Grapeshot"); + + setStopAt(2, PhaseStep.END_TURN); execute(); assertGraveyardCount(playerB, shock, 2); - assertGraveyardCount(playerB, grapeShot, 0); // exiled by Mindbreak Trap + assertExileCount(playerB, grapeShot, 1); // exiled by Mindbreak Trap assertGraveyardCount(playerA, mindBreakTrap, 1); assertLife(playerA, 16); // 2x2 from two Shock = 4 and 3 (Storm twice) from Grapeshot get exiled } - - -} +} \ No newline at end of file diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/zen/BlazingTorchTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/zen/BlazingTorchTest.java index bb836c87163..33b6bcff9d2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/zen/BlazingTorchTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/zen/BlazingTorchTest.java @@ -44,11 +44,12 @@ public class BlazingTorchTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, masterwork); addCard(Zone.BATTLEFIELD, playerB, torch); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, masterwork); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, masterwork, true); setChoice(playerA, true); // use copy setChoice(playerA, torch); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", lion); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{T},", playerB); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/znr/MoraugFuryOfAkoumTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/znr/MoraugFuryOfAkoumTest.java index 7932425f522..268e2951667 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/znr/MoraugFuryOfAkoumTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/znr/MoraugFuryOfAkoumTest.java @@ -109,6 +109,7 @@ public class MoraugFuryOfAkoumTest extends CardTestPlayerBase { attackWithAttackers(); // 9 damage playLand(1, PhaseStep.POSTCOMBAT_MAIN, playerA, mountain); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN); playLand(1, PhaseStep.POSTCOMBAT_MAIN, playerA, mountain); attackWithAttackers(); // 12 damage diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/targets/TargetRestrictionsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/targets/TargetRestrictionsTest.java index 7e9ef999bca..01135b13da1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/targets/TargetRestrictionsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/targets/TargetRestrictionsTest.java @@ -26,6 +26,7 @@ public class TargetRestrictionsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Sejiri Merfolk"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Take into Custody", "Sejiri Merfolk"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dream Leash", "Sejiri Merfolk"); @@ -58,16 +59,15 @@ public class TargetRestrictionsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Sejiri Merfolk"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Take into Custody", "Sejiri Merfolk"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dream Leash", "Sejiri Merfolk"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Ornamental Courage", "Sejiri Merfolk", "Dream Leash"); setStrictChooseMode(true); setStopAt(3, PhaseStep.BEGIN_COMBAT); execute(); - assertGraveyardCount(playerA, "Take into Custody", 1); assertGraveyardCount(playerB, "Ornamental Courage", 1); assertPermanentCount(playerA, "Dream Leash", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/BiovisionaryTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/BiovisionaryTest.java index 7978f97c806..a1b745a53b5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/BiovisionaryTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/BiovisionaryTest.java @@ -47,9 +47,13 @@ public class BiovisionaryTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone"); setChoice(playerA, true); setChoice(playerA, "Biovisionary"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone"); setChoice(playerA, true); setChoice(playerA, "Biovisionary"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clone"); setChoice(playerA, true); setChoice(playerA, "Biovisionary"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/EntersTheBattlefieldTriggerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/EntersTheBattlefieldTriggerTest.java index e65d56ce6e8..5ed1cfbc06d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/EntersTheBattlefieldTriggerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/EntersTheBattlefieldTriggerTest.java @@ -87,6 +87,7 @@ public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Terror", 1); // {1}{B} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scion of Vitu-Ghazi"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Scion of Vitu-Ghazi"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Reanimate", "Scion of Vitu-Ghazi"); @@ -225,7 +226,9 @@ public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase { } - // Test another zombie trigger + /** + * Test another zombie trigger + */ @Test public void testNoxiousGhoul2() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 8); @@ -246,6 +249,7 @@ public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Noxious Ghoul"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Ego Erasure", "targetPlayer=PlayerA", "Whenever"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scathe Zombies"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -261,7 +265,9 @@ public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Silvercoat Lion", 1); } - // Test copy of Noxious Ghoul + /** + * Test copy of Noxious Ghoul + */ @Test public void testCopyNoxiousGhoul() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/HeartbeatOfSpringTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/HeartbeatOfSpringTest.java index d4c55869f6a..8a02dd8f618 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/HeartbeatOfSpringTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/HeartbeatOfSpringTest.java @@ -25,7 +25,7 @@ public class HeartbeatOfSpringTest extends CardTestPlayerBase { // Whenever a player casts a white spell, you may gain 1 life. addCard(Zone.HAND, playerA, "Angel's Feather"); // {2} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Heartbeat of Spring"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Heartbeat of Spring", true); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Urza's Mine"); activateManaAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{T}:"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java index 8fad700f066..faa57a0feda 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java @@ -58,7 +58,7 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 1); } - /* + /** 10/1/2009: If Journey to Nowhere leaves the battlefield before its first ability has resolved, its second ability will trigger and do nothing. Then its first ability will resolve and exile the targeted creature forever. */ @@ -73,7 +73,7 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Journey to Nowhere"); // Silvercoat Lion" is auto-chosen since only target - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disenchant", "Journey to Nowhere"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disenchant", "Journey to Nowhere", "When {this} enters"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java index d09251969fc..06359d1a45f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java @@ -94,8 +94,9 @@ public class OblivionRingTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Revoke Existence"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-1: Target player draws a card", playerA); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Revoke Existence", "Oblivion Ring"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring", true); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Revoke Existence", "Oblivion Ring", true); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "-1: Target player draws a card", playerA); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java index 2582706f2bf..245130cc6d1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java @@ -61,7 +61,7 @@ public class ReturnToHandEffectsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Island", 2); addCard(Zone.HAND, playerB, "Boomerang", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Stormfront Riders"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Stormfront Riders", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lab Rats"); setChoice(playerA, false); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SacredGroundTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SacredGroundTest.java index b5f8adcd5b7..6e4aefc1cf7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SacredGroundTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SacredGroundTest.java @@ -142,6 +142,7 @@ public class SacredGroundTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Sacred Ground"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Molten Rain", "Caves of Koilos"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Surgical Extraction", "Caves of Koilos"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SelvalaHeartOfTheWildsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SelvalaHeartOfTheWildsTest.java index 2183177bff1..2e696eb49c7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SelvalaHeartOfTheWildsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SelvalaHeartOfTheWildsTest.java @@ -39,10 +39,12 @@ public class SelvalaHeartOfTheWildsTest extends CardTestPlayerBase { } + /** + * After Memnite enters the battlefield, the trigger fires. In response, 2 Giant Growths targeting the Memnite + * pumps its power to the highest on the battlefield allowing the controller to draw a card. + */ @Test public void testTriggerWithGiantGrowth() { - // After Memnite enters the battlefield, the trigger fires. In response, 2 Giant Growths targeting the Memnite - // pumps its power to the highest on the battlefield allowing the controller to draw a card. addCard(Zone.LIBRARY, playerA, "Island", 2); // Whenever another creature enters the battlefield, its controller may draw a card if its power is greater than each other creature's power. // {G}, {T}: Add X mana in any combination of colors, where X is the greatest power among creatures you control. @@ -63,6 +65,7 @@ public class SelvalaHeartOfTheWildsTest extends CardTestPlayerBase { setChoice(playerA, "X=0"); setChoice(playerA, "X=0"); setChoice(playerA, "X=5"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN ,1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Memnite"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Memnite"); // a whopping 7/7 diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ShuffleTriggeredTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ShuffleTriggeredTest.java index a9a4441891e..82859279ba9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ShuffleTriggeredTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ShuffleTriggeredTest.java @@ -23,7 +23,7 @@ public class ShuffleTriggeredTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Widespread Panic"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Widespread Panic", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Untamed Wilds"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -54,7 +54,7 @@ public class ShuffleTriggeredTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Widespread Panic"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Widespread Panic", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Knowledge Exploitation", playerB); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java index bcabc644d80..871f80caacd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java @@ -73,6 +73,7 @@ public class SpellskiteTest extends CardTestPlayerBase { castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Frost Titan"); addTarget(playerB, "Silvercoat Lion"); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN, 1); activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{U/P}: Change a target", "stack ability (Whenever {this} enters "); @@ -154,7 +155,7 @@ public class SpellskiteTest extends CardTestPlayerBase { setModeChoice(playerA, "2"); // return target permanent to its owner's hand setModeChoice(playerA, "3"); // tap all creatures your opponents control - activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{U/P}: Change a target of target spell or ability to {this}.", "Cryptic Command"); + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{U/P}: Change a target of target", "Cryptic Command", "Cryptic Command"); setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TuvasaTheSunlitTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TuvasaTheSunlitTest.java index 63b529c335f..66546249cd8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TuvasaTheSunlitTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TuvasaTheSunlitTest.java @@ -28,7 +28,7 @@ public class TuvasaTheSunlitTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Burgeoning", 1); addCard(Zone.HAND, playerA, "Ajani's Welcome", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burgeoning"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burgeoning", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ajani's Welcome"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/delayed/GlimpseOfNatureTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/delayed/GlimpseOfNatureTest.java index fbc5a3b29d1..b12c16a3361 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/delayed/GlimpseOfNatureTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/delayed/GlimpseOfNatureTest.java @@ -29,10 +29,10 @@ public class GlimpseOfNatureTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Benalish Knight", 1); // Creature {2}{W} addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Glimpse of Nature"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Glimpse of Nature", true); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion", true); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Silvercoat Lion", true); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Benalish Knight"); setStopAt(1, PhaseStep.END_TURN); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ChildOfAlaraTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ChildOfAlaraTest.java index e0816d598e3..d3b2501ba16 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ChildOfAlaraTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/ChildOfAlaraTest.java @@ -58,6 +58,7 @@ public class ChildOfAlaraTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, tamiyo); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, oRing); addTarget(playerB, tamiyo); + waitStackResolved(2, PhaseStep.PRECOMBAT_MAIN); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, dDemolition, childAlara); setStopAt(2, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java index 783f04b37c8..7b74d989021 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/HarvesterOfSoulsTest.java @@ -35,7 +35,7 @@ public class HarvesterOfSoulsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Arrogant Bloodlord", 1); // Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step. - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thatcher Revolt"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thatcher Revolt", true); // Destroy all creatures. castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Day of Judgment"); @@ -48,5 +48,4 @@ public class HarvesterOfSoulsTest extends CardTestPlayerBase { assertHandCount(playerA, 2); // draw a card for Harvester and Craw Wurm assertHandCount(playerB, 0); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/JinxedRingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/JinxedRingTest.java index 62e720147e3..d8c83fe5ebd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/JinxedRingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/JinxedRingTest.java @@ -60,6 +60,7 @@ public class JinxedRingTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Bonded Construct", 2); // Artifact Creature - Construct 2/1 castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Legerdemain", "Jinxed Ring^Bonded Construct"); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shatterstorm"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -71,7 +72,5 @@ public class JinxedRingTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Bonded Construct", 2); assertLife(playerA, 20); assertLife(playerB, 18); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SupernaturalStaminaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SupernaturalStaminaTest.java index 87175a4f4db..372aef7f477 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SupernaturalStaminaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SupernaturalStaminaTest.java @@ -31,7 +31,7 @@ public class SupernaturalStaminaTest extends CardTestPlayerBase { // Shock deals 2 damage to any target. addCard(Zone.HAND, playerA, "Shock"); // Instant {R} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Channeler Initiate"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Channeler Initiate", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Supernatural Stamina", "Channeler Initiate"); castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Shock", "Channeler Initiate"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/watchers/EpharaGodOfThePolisTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/watchers/EpharaGodOfThePolisTest.java index b451e9df53e..5c403128469 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/watchers/EpharaGodOfThePolisTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/watchers/EpharaGodOfThePolisTest.java @@ -30,7 +30,7 @@ public class EpharaGodOfThePolisTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Ephara, God of the Polis"); addCard(Zone.HAND, playerA, "Goblin Roughrider"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Roughrider"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Roughrider", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ephara, God of the Polis"); setStopAt(3, PhaseStep.PRECOMBAT_MAIN); diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/FFA3/SerraAscendantTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/FFA3/SerraAscendantTest.java index d7a12d087d0..f3866d672ac 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/FFA3/SerraAscendantTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/FFA3/SerraAscendantTest.java @@ -33,7 +33,7 @@ public class SerraAscendantTest extends CardTestCommander3PlayersFFA { addCard(Zone.HAND, playerC, "Lightning Bolt", 2); addCard(Zone.BATTLEFIELD, playerC, "Mountain", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Serra Ascendant"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Serra Ascendant", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul's Majesty", "Serra Ascendant"); castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Lightning Bolt", playerA); diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java index 4dfdf6c2c9a..0ddbc8d049b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java @@ -106,7 +106,7 @@ public class CastCommanderTest extends CardTestCommanderDuelBase { // Put target nonland permanent into its owner's library just beneath the top X cards of that library. addCard(Zone.HAND, playerA, "Unexpectedly Absent"); // Instant {X}{W}{W} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath"); // {3}{B}{B} + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath", true); // {3}{B}{B} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unexpectedly Absent", "Ob Nixilis of the Black Oath"); setChoice(playerA, "X=0"); diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderColorChangeTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderColorChangeTest.java index e0a47c1009a..a802e02fc88 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderColorChangeTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderColorChangeTest.java @@ -37,12 +37,12 @@ public class CommanderColorChangeTest extends CardTestCommanderDuelBase { addCard(Zone.BATTLEFIELD, playerA, "Kraken's Eye", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant", true); setChoice(playerA, "Blue"); // When a player casts a spell or a creature attacks, exile Norin the Wary. // Return it to the battlefield under its owner's control at the beginning of the next end step. - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary", true); setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -51,11 +51,11 @@ public class CommanderColorChangeTest extends CardTestCommanderDuelBase { assertPermanentCount(playerA, "Norin the Wary", 1); Permanent norin = getPermanent("Norin the Wary", playerA); - Assert.assertEquals(true, norin.getColor(currentGame).isBlue()); - Assert.assertEquals(true, norin.getColor(currentGame).isRed()); + Assert.assertTrue(norin.getColor(currentGame).isBlue()); + Assert.assertTrue(norin.getColor(currentGame).isRed()); Permanent kraken = getPermanent("Kraken's Eye", playerA); - Assert.assertEquals(true, kraken.getColor(currentGame).isBlue()); + Assert.assertTrue(kraken.getColor(currentGame).isBlue()); assertLife(playerA, 41); assertLife(playerB, 40); @@ -91,12 +91,12 @@ public class CommanderColorChangeTest extends CardTestCommanderDuelBase { addCard(Zone.HAND, playerB, "Altar's Light", 1); // Instant {2}{W}{W} addCard(Zone.BATTLEFIELD, playerB, "Plains", 4); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant", true); setChoice(playerA, "Blue"); // When a player casts a spell or a creature attacks, exile Norin the Wary. // Return it to the battlefield under its owner's control at the beginning of the next end step. - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary", true); setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Altar's Light", "Painter's Servant", "Norin the Wary"); setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderReplaceEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderReplaceEffectTest.java index 98ac6e51a99..d88ca518e6c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderReplaceEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CommanderReplaceEffectTest.java @@ -64,7 +64,7 @@ public class CommanderReplaceEffectTest extends CardTestCommanderDuelBase { // Daxos of Meletis can't be blocked by creatures with power 3 or greater. // Whenever Daxos of Meletis deals combat damage to a player, exile the top card of that player's library. You gain life equal to that card's converted mana cost. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it. - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gift of Immortality", "Daxos of Meletis"); // Destroy all creatures, then put an X/X colorless Horror artifact creature token onto the battlefield, where X is the number of creatures destroyed this way. diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/piper/ThePrismaticPiperTest8.java b/Mage.Tests/src/test/java/org/mage/test/commander/piper/ThePrismaticPiperTest8.java index afd9bb216ff..cd2c4f83748 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/piper/ThePrismaticPiperTest8.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/piper/ThePrismaticPiperTest8.java @@ -31,7 +31,7 @@ public class ThePrismaticPiperTest8 extends ThePrismaticPiperBaseTest { setChoice(playerA, true); // Companion addCard(Zone.BATTLEFIELD, playerA, "Island", 8); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, piper); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, piper, true); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Companion"); setStrictChooseMode(true); diff --git a/Mage.Tests/src/test/java/org/mage/test/game/ends/GameIsADrawTest.java b/Mage.Tests/src/test/java/org/mage/test/game/ends/GameIsADrawTest.java index 1c1cdfb1430..2759fb2ea02 100644 --- a/Mage.Tests/src/test/java/org/mage/test/game/ends/GameIsADrawTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/game/ends/GameIsADrawTest.java @@ -24,11 +24,11 @@ public class GameIsADrawTest extends CardTestPlayerBase { // Flame Rift deals 4 damage to each player. addCard(Zone.HAND, playerB, "Flame Rift", 2); // Sorcery - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flame Rift"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flame Rift"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flame Rift", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flame Rift", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flame Rift"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Flame Rift"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Flame Rift", true); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Flame Rift"); setStopAt(2, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java b/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java index 85863ecb094..ce07832f887 100644 --- a/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/game/ends/PhageTheUntouchableTest.java @@ -30,7 +30,7 @@ public class PhageTheUntouchableTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Phage the Untouchable"); // Creature {3}{B}{B}{B}{B} 4/4 addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phage the Untouchable"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phage the Untouchable", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hero's Downfall", "Phage the Untouchable"); addTarget(playerA, playerB); @@ -49,7 +49,5 @@ public class PhageTheUntouchableTest extends CardTestPlayerBase { Assert.assertTrue("Game has ended.", currentGame.hasEnded()); assertWonTheGame(playerA); Assert.assertTrue("Game ist At end phase", currentGame.getPhase().getType() == TurnPhase.END); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java b/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java index e8ec1aa6608..5f956d889f4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java @@ -40,6 +40,7 @@ public class LastKnownInformationTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murder Investigation", "Safehold Elite"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Safehold Elite"); + waitStackResolved(1, PhaseStep.POSTCOMBAT_MAIN, 2); // Let the Lightning Bolt and persist resolve // choose triggered ability order setChoice(playerA, "When enchanted creature dies"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Safehold Elite", "When enchanted creature dies"); @@ -137,7 +138,5 @@ public class LastKnownInformationTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Grizzly Bears", 1); assertLife(playerA, 27); - } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerDiedStackTargetHandlingTest.java b/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerDiedStackTargetHandlingTest.java index f32abf7d276..e962bf31ac8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerDiedStackTargetHandlingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerDiedStackTargetHandlingTest.java @@ -78,8 +78,8 @@ public class PlayerDiedStackTargetHandlingTest extends CardTestMultiPlayerBase { // Storm (When you cast this spell, copy it for each spell cast before it this turn. You may choose new targets for the copies.) addCard(Zone.HAND, playerA, "Tendrils of Agony", 1); // Sorcery {2}{B}{B} - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tendrils of Agony", playerD); addTarget(playerA, playerD); addTarget(playerA, playerD); @@ -92,6 +92,5 @@ public class PlayerDiedStackTargetHandlingTest extends CardTestMultiPlayerBase { Assert.assertTrue("Active player has to be player C", currentGame.getActivePlayerId().equals(playerC.getId())); assertLife(playerA, 7); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRange1Test.java b/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRange1Test.java index 116524c58b6..7284c5b9113 100644 --- a/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRange1Test.java +++ b/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRange1Test.java @@ -311,8 +311,6 @@ public class PlayerLeftGameRange1Test extends CardTestMultiPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pithing Needle"); setChoice(playerA, "Proteus Staff"); - activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerD, "{2}{U}", "Silvercoat Lion"); // not allowed - activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerC, "{2}{U}", "Eager Cadet"); // allowed because Needle out of range // Concede the game @@ -321,36 +319,17 @@ public class PlayerLeftGameRange1Test extends CardTestMultiPlayerBase { activateAbility(4, PhaseStep.PRECOMBAT_MAIN, playerB, "{2}{U}", "Wall of Air"); // allowed because Needle lost game setStopAt(4, PhaseStep.POSTCOMBAT_MAIN); - - try { - execute(); - Assert.fail("must throw exception on execute"); - } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerD must have 0 actions but found 1")) { - Assert.fail("must throw error PlayerD canot acting, but got:\n" + e.getMessage()); - } - } + execute(); assertLife(playerA, 2); Assert.assertFalse("Player A is no longer in the game", playerA.isInGame()); assertPermanentCount(playerA, 0); - Permanent staffPlayerD = getPermanent("Proteus Staff", playerD); - Assert.assertFalse("Staff of player D could not be used", staffPlayerD.isTapped()); - assertPermanentCount(playerD, "Eager Cadet", 0); assertPermanentCount(playerD, "Storm Crow", 1); - - Permanent staffPlayerC = getPermanent("Proteus Staff", playerC); - Assert.assertTrue("Staff of player C could be used", staffPlayerC.isTapped()); - assertPermanentCount(playerC, "Wall of Air", 0); assertPermanentCount(playerC, "Wind Drake", 1); - - Permanent staffPlayerB = getPermanent("Proteus Staff", playerB); - Assert.assertTrue("Staff of player B could be used", staffPlayerB.isTapped()); - } /** diff --git a/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRangeAllTest.java b/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRangeAllTest.java index 8c25482301e..287b9daca8c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRangeAllTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/multiplayer/PlayerLeftGameRangeAllTest.java @@ -260,8 +260,9 @@ public class PlayerLeftGameRangeAllTest extends CardTestMultiPlayerBase { addCard(Zone.BATTLEFIELD, playerD, "Plains", 4); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Vengeance", playerD); + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerD, "Silvercoat Lion"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerD, "Silvercoat Lion", true); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerD, "Silvercoat Lion"); castSpell(2, PhaseStep.BEGIN_COMBAT, playerC, "Lightning Bolt", playerD); diff --git a/Mage.Tests/src/test/java/org/mage/test/oathbreaker/FFA3/BasicSaheeliSublimeArtificerTest.java b/Mage.Tests/src/test/java/org/mage/test/oathbreaker/FFA3/BasicSaheeliSublimeArtificerTest.java index 0c7a7dff797..ec2f8759668 100644 --- a/Mage.Tests/src/test/java/org/mage/test/oathbreaker/FFA3/BasicSaheeliSublimeArtificerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/oathbreaker/FFA3/BasicSaheeliSublimeArtificerTest.java @@ -41,7 +41,7 @@ public class BasicSaheeliSublimeArtificerTest extends CardTestOathbreaker3Player // Whenever you cast a noncreature spell, create a 1/1 colorless Servo artifact creature token. // -2: Target artifact you control becomes a copy of another target artifact or creature you control until end of turn, // except it's an artifact in addition to its other types. - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Saheeli, Sublime Artificer"); // Planeswalker 5 {1}{U/R}{U/R} + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Saheeli, Sublime Artificer", true); // Planeswalker 5 {1}{U/R}{U/R} // Affinity for artifacts // Draw two cards. @@ -59,6 +59,5 @@ public class BasicSaheeliSublimeArtificerTest extends CardTestOathbreaker3Player assertHandCount(playerA, 3); assertPermanentCount(playerA, "Saheeli, Sublime Artificer", 1); assertCommandZoneCount(playerA, "Thoughtcast", 1); - } } diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index 0e4b72a4233..72717bf0d95 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -620,9 +620,7 @@ public class TestPlayer implements Player { groupsForTargetHandling = null; } } - // TODO: fix wrong commands (on non existing card), it's HUGE (350+ failed tests with wrong commands) - //Assert.fail("Can't find ability to activate command: " + command); - LOGGER.warn("Can't find ability to activate command: " + command); + Assert.fail("Can't find ability to activate command: " + command); } else if (action.getAction().startsWith(ACTIVATE_MANA)) { String command = action.getAction(); command = command.substring(command.indexOf(ACTIVATE_MANA) + ACTIVATE_MANA.length()); diff --git a/Mage.Tests/src/test/java/org/mage/test/rollback/ExtraTurnTest.java b/Mage.Tests/src/test/java/org/mage/test/rollback/ExtraTurnTest.java index c4d74a7653e..5e10b235d4d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/rollback/ExtraTurnTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/rollback/ExtraTurnTest.java @@ -20,7 +20,7 @@ public class ExtraTurnTest extends CardTestPlayerBase { // Take an extra turn after this one. addCard(Zone.HAND, playerA, "Time Walk"); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Quicken"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Quicken", true); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Time Walk"); rollbackTurns(3, PhaseStep.PRECOMBAT_MAIN, playerA, 0); @@ -30,5 +30,4 @@ public class ExtraTurnTest extends CardTestPlayerBase { assertActivePlayer(playerA); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/rollback/StateValuesTest.java b/Mage.Tests/src/test/java/org/mage/test/rollback/StateValuesTest.java index c7c87b75c55..a6695e3ed8a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/rollback/StateValuesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/rollback/StateValuesTest.java @@ -91,7 +91,7 @@ public class StateValuesTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); - castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Battle Screech"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Battle Screech", true); activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback"); setChoice(playerA, "Bird Token"); diff --git a/Mage.Tests/src/test/java/org/mage/test/rollback/TransformTest.java b/Mage.Tests/src/test/java/org/mage/test/rollback/TransformTest.java index 878db38a62c..7396a332dfe 100644 --- a/Mage.Tests/src/test/java/org/mage/test/rollback/TransformTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/rollback/TransformTest.java @@ -60,7 +60,9 @@ public class TransformTest extends CardTestPlayerBase { rollbackTurns(3, PhaseStep.END_TURN, playerA, 0); + rollbackAfterActionsStart(); castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Venerable Monk"); + rollbackAfterActionsEnd(); attack(3, playerA, "Lone Rider"); @@ -72,7 +74,5 @@ public class TransformTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Venerable Monk", 1); assertPermanentCount(playerA, "It That Rides as One", 1); - } - -} +} \ No newline at end of file diff --git a/Mage.Tests/src/test/java/org/mage/test/testapi/TestAPITest.java b/Mage.Tests/src/test/java/org/mage/test/testapi/TestAPITest.java index 6ac56d01b46..d8ebb0897db 100644 --- a/Mage.Tests/src/test/java/org/mage/test/testapi/TestAPITest.java +++ b/Mage.Tests/src/test/java/org/mage/test/testapi/TestAPITest.java @@ -57,7 +57,7 @@ public class TestAPITest extends CardTestPlayerBase { try { execute(); } catch (Throwable e) { - if (!e.getMessage().contains("Player PlayerA must have 0 actions but found 1")) { + if (!e.getMessage().contains("Can't find ability to activate command: Cast Shock$target=Grizzly Bears$!spellOnStack=Last Breath")) { Assert.fail("Should have had error about playerA having too many actions, but got:\n" + e.getMessage()); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/turnmod/SkipTurnTest.java b/Mage.Tests/src/test/java/org/mage/test/turnmod/SkipTurnTest.java index 4f2a3e80774..207b062fb94 100644 --- a/Mage.Tests/src/test/java/org/mage/test/turnmod/SkipTurnTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/turnmod/SkipTurnTest.java @@ -24,7 +24,7 @@ public class SkipTurnTest extends CardTestPlayerBase { // When Eater of Days enters the battlefield, you skip your next two turns. addCard(Zone.HAND, playerA, "Eater of Days", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Eater of Days"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Eater of Days", true); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shrine of Boundless Growth"); setStopAt(5, PhaseStep.PRECOMBAT_MAIN);