Some changes to test handling to set correct zon for cards in library.

This commit is contained in:
LevelX2 2013-09-01 15:48:44 +02:00
parent 1090258114
commit 8e9dba6368
3 changed files with 24 additions and 7 deletions

View file

@ -9,6 +9,24 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
* @author noxx, Loki
*/
public class BloodbraidElfTest extends CardTestPlayerBase {
/*
* Terminus
* Sorcery, 4WW (6)
* Put all creatures on the bottom of their owners' libraries.
* Miracle {W} (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)
*
* Bloodbraid Elf
* Creature Elf Berserker 3/2, 2RG (4)
* Haste
* Cascade (When you cast this spell, exile cards from the top of your library until you exile a nonland card that costs
* less. You may cast it without paying its mana cost. Put the exiled cards on the bottom in a random order.)
*
* Goblin Wardriver
* Creature Goblin Warrior 2/2, RR (2)
* Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)
*
*/
@Test
public void testCascade() {
addCard(Zone.HAND, playerA, "Bloodbraid Elf");

View file

@ -63,18 +63,18 @@ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl {
logger.debug("Done!");
if (deck.getCards().size() < 40) {
throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size());
}
game.addPlayer(playerA, deck);
}
game.loadCards(deck.getCards(), playerA.getId());
game.addPlayer(playerA, deck);
playerB = createNewPlayer("PlayerB");
playerB.setTestMode(true);
Deck deck2 = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck"), false, false);
if (deck2.getCards().size() < 40) {
throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck2.getCards().size());
}
game.addPlayer(playerB, deck2);
}
game.loadCards(deck2.getCards(), playerB.getId());
game.addPlayer(playerB, deck2);
activePlayer = playerA;
currentGame = game;

View file

@ -110,11 +110,10 @@ class CascadeEffect extends OneShotEffect<CascadeEffect> {
ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade");
int sourceCost = game.getCard(source.getSourceId()).getManaCost().convertedManaCost();
do {
card = player.getLibrary().removeFromTop(game);
card = player.getLibrary().getFromTop(game);
if (card == null) {
break;
}
}
card.moveToExile(exile.getId(), exile.getName(), source.getId(), game);
} while (card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost);