From 2c745109e4e110771710f005fe0385894d03b7b0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 27 Jun 2020 10:48:39 +0200 Subject: [PATCH] * Added test for Reyhan, Last of the Abzan related to (#6688). --- Mage.Tests/ReyhanCommanderDeck.dck | 65 +++++++++++++ .../duel/CastBGPartnerCommanderTest.java | 97 +++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 Mage.Tests/ReyhanCommanderDeck.dck create mode 100644 Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBGPartnerCommanderTest.java diff --git a/Mage.Tests/ReyhanCommanderDeck.dck b/Mage.Tests/ReyhanCommanderDeck.dck new file mode 100644 index 0000000000..2da832153e --- /dev/null +++ b/Mage.Tests/ReyhanCommanderDeck.dck @@ -0,0 +1,65 @@ +2 [C18:134] Budoka Gardener +2 [C18:136] Consign to Dust +1 [C18:129] Avenger of Zendikar +1 [C18:29] Crash of Rhino Beetles +1 [C18:119] Stitch Together +1 [C18:116] Retreat to Hagra +1 [C18:16] Loyal Subordinate +1 [C18:15] Entreat the Dead +1 [C18:117] Ruinous Path +1 [C18:114] Moonlight Bargain +1 [C18:18] Skull Storm +1 [C18:115] Phyrexian Delver +1 [C18:14] Bloodtracker +1 [C18:19] Sower of Discord +1 [C18:17] Night Incarnate +1 [C18:113] Army of the Damned +1 [C18:118] Soul of Innistrad +1 [C18:197] Blinkmoth Urn +1 [C18:54] Coveted Jewel +1 [C18:199] Chief of the Foundry +1 [C18:217] Psychosis Crawler +1 [C18:202] Darksteel Juggernaut +1 [C18:226] Thopter Assembly +1 [C18:224] Steel Hellkite +1 [C18:222] Sol Ring +1 [C18:219] Scuttling Doom Engine +1 [C18:205] Duplicant +1 [C18:212] Myr Battlesphere +1 [C18:53] Ancient Stone Idol +1 [C18:223] Soul of New Phyrexia +1 [C18:160] Sakura-Tribe Elder +1 [C18:133] Borderland Explorer +1 [C18:146] Farhaven Elf +1 [C18:128] Aura Gnarlid +1 [C18:166] Yavimaya Elder +1 [C18:167] Yavimaya Enchantress +1 [C18:161] Scute Mob +1 [C18:151] Herald of the Pantheon +1 [C18:35] Turntimber Sower +1 [C18:34] Ravenous Slime +1 [C18:140] Eidolon of Blossoms +1 [C18:135] Centaur Vinecrasher +1 [C18:156] Moldgraf Monstrosity +1 [C18:149] Ground Seal +1 [C18:147] Fertile Ground +1 [C18:162] Snake Umbra +1 [C18:157] Overgrowth +1 [C18:150] Harrow +1 [C18:138] Cultivate +1 [C18:164] Vow of Wildness +1 [C18:152] Hunting Wilds +1 [C18:144] Explosive Vegetation +1 [C18:131] Bear Umbra +1 [C18:32] Myth Unbound +1 [C18:141] Enchantress's Presence +1 [C18:142] Epic Proportions +1 [C18:137] Creeping Renaissance +1 [C18:30] Genesis Storm +1 [C18:163] Spawning Grounds +25 [PPP1:5] Forest +12 [PPP1:3] Swamp +SB: 1 [CM2:13] Reyhan, Last of the Abzan +SB: 1 [CM2:11] Ikra Shidiqi, the Usurper +LAYOUT MAIN:(2,11)(CMC,true,29)|()()([C18:134])([C18:16],[C18:199])([C18:14])([C18:29],[C18:115],[C18:17],[C18:217],[C18:202],[C18:161],[C18:151],[C18:134],[C18:35],[C18:140],[C18:135],[C18:156])([C18:19],[C18:118],[C18:226],[C18:224],[C18:219],[C18:205],[C18:223],[C18:149],[C18:147],[C18:162],[C18:34],[C18:157],[C18:150],[C18:138],[C18:164],[C18:152],[C18:144],[C18:136],[C18:131],[C18:32],[C18:141],[C18:142],[C18:137],[C18:30],[C18:163])([C18:129],[C18:212],[C18:160],[C18:133],[C18:146],[C18:128],[C18:166],[C18:167])()()([C18:53])([PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:5],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3],[PPP1:3])([C18:222])([C18:119])([C18:136],[C18:116],[C18:15],[C18:117])()([C18:114],[C18:197])([C18:54])()([C18:113])([C18:18])() +LAYOUT SIDEBOARD:(1,2)(RARITY,true,0)|([CM2:13])([CM2:11]) diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBGPartnerCommanderTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBGPartnerCommanderTest.java new file mode 100644 index 0000000000..29dca3ceef --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBGPartnerCommanderTest.java @@ -0,0 +1,97 @@ +package org.mage.test.commander.duel; + +import java.io.FileNotFoundException; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.GameException; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestCommanderDuelBase; + +/** + * + * @author LevelX2 ReyhanCommanderDeck + */ +public class CastBGPartnerCommanderTest extends CardTestCommanderDuelBase { + + @Override + protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { + setDecknamePlayerA("ReyhanCommanderDeck.dck"); // Commander Reyhan, Last of the Abzan {1}{B}{G} + // + Ikra Shidiqi, the Usurper + setDecknamePlayerB("CommanderDuel_UW.dck"); // Commander = Daxos of Meletis + return super.createNewGameAndPlayers(); + } + + /** + * With commander rule changes 6/2020 Reyhan goes to exile first before it + * goes to command zone. So it's triggerd ability does no longer move the + * counters on it on the battelfield + */ + @Test + public void testExileReyhan() { + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + + // As an additional cost to cast this spell, reveal a colorless creature card from your hand. + // Exile target creature if its power is less than or equal to the revealed card's power. + addCard(Zone.HAND, playerB, "Titan's Presence", 1); + addCard(Zone.HAND, playerB, "Ancient Stone Idol", 1); // Artifact Creature 12/12 + addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); + + // Reyhan, Last of the Abzan enters the battlefield with three +1/+1 counters on it. + // Whenever a creature you control dies or is put into the command zone, + // if it had one or more +1/+1 counters on it, you may put that many +1/+1 counters on target creature. + // Partner (You can have two commanders if both have partner.) + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reyhan, Last of the Abzan"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Titan's Presence", "Reyhan, Last of the Abzan"); + setChoice(playerB, "Ancient Stone Idol"); + + setChoice(playerA, "Yes"); // Commander goes to command zone + + setStrictChooseMode(true); + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertAllCommandsUsed(); + + assertGraveyardCount(playerB, "Titan's Presence", 1); + assertCommandZoneCount(playerA, "Reyhan, Last of the Abzan", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 2, 2); + } + + @Test + public void testCastBothPartnerCommanders() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + + // Reyhan, Last of the Abzan enters the battlefield with three +1/+1 counters on it. + // Whenever a creature you control dies or is put into the command zone, + // if it had one or more +1/+1 counters on it, you may put that many +1/+1 counters on target creature. + // Partner (You can have two commanders if both have partner.) + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reyhan, Last of the Abzan"); // Creature 0/0 + + // Menace + // Whenever a creature you control deals combat damage to a player, you gain life equal to that creature's toughness. + // Partner + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Ikra Shidiqi, the Usurper"); // Creature 3/7 {3}{B}{G} + + attack(3, playerA, "Reyhan, Last of the Abzan"); + + setStrictChooseMode(true); + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertAllCommandsUsed(); + + assertCommandZoneCount(playerA, "Reyhan, Last of the Abzan", 0); + assertCommandZoneCount(playerA, "Ikra Shidiqi, the Usurper", 0); + + assertPowerToughness(playerA, "Reyhan, Last of the Abzan", 3, 3); + assertPowerToughness(playerA, "Ikra Shidiqi, the Usurper", 3, 7); + + assertLife(playerA, 43); + assertLife(playerB, 37); + } +}