mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
Merge pull request #5916 from jgray1206/aether_gust_fix
add aether gust unit tests + fix issue #5902
This commit is contained in:
commit
e53ce49327
2 changed files with 82 additions and 3 deletions
|
@ -0,0 +1,74 @@
|
|||
|
||||
|
||||
package org.mage.test.cards.single;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jgray1206
|
||||
*/
|
||||
|
||||
public class AetherGustTest extends CardTestPlayerBase {
|
||||
|
||||
/* Aether Gust - Instant {1}{U}
|
||||
* Choose target spell or permanent that’s red or green. Its owner puts it on the top or bottom of their library.
|
||||
*/
|
||||
String aetherGust = "Aether Gust";
|
||||
|
||||
/**
|
||||
* Issue #5902:
|
||||
* Aether Gust is not putting spells back into the owner's library.
|
||||
*/
|
||||
@Test
|
||||
public void testAetherGustWorksWithSpells() {
|
||||
String barkhide = "Barkhide Troll"; //Arbitrary creature {G}{G}
|
||||
|
||||
removeAllCardsFromLibrary(playerA);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
|
||||
addCard(Zone.HAND, playerA, barkhide);
|
||||
addCard(Zone.HAND, playerA, aetherGust);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, barkhide);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, aetherGust, barkhide);
|
||||
setChoice(playerA, "Yes");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, aetherGust, 1);
|
||||
assertPermanentCount(playerA, barkhide, 0);
|
||||
assertLibraryCount(playerA, 1);
|
||||
assertAllCommandsUsed();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAetherGustWorksWithPermanents() {
|
||||
String barkhide = "Barkhide Troll"; //Arbitrary creature {G}{G}
|
||||
|
||||
removeAllCardsFromLibrary(playerA);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
|
||||
addCard(Zone.HAND, playerA, barkhide);
|
||||
addCard(Zone.HAND, playerA, aetherGust);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, barkhide);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, aetherGust, barkhide);
|
||||
setChoice(playerA, "Yes");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, aetherGust, 1);
|
||||
assertPermanentCount(playerA, barkhide, 0);
|
||||
assertLibraryCount(playerA, 1);
|
||||
assertAllCommandsUsed();
|
||||
}
|
||||
|
||||
}
|
|
@ -62,10 +62,15 @@ public class PutOnLibraryTargetEffect extends OneShotEffect {
|
|||
}
|
||||
break;
|
||||
case GRAVEYARD:
|
||||
Card graveyardCard = game.getCard(targetId);
|
||||
if (graveyardCard != null) {
|
||||
cards.add(graveyardCard);
|
||||
}
|
||||
break;
|
||||
case STACK:
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
Card stackSpellCard = game.getSpell(targetId).getCard();
|
||||
if (stackSpellCard != null) {
|
||||
cards.add(stackSpellCard);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue