mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
4 DKA
This commit is contained in:
parent
6f7050f9eb
commit
cab80c5a68
8 changed files with 586 additions and 10 deletions
|
|
@ -0,0 +1,97 @@
|
|||
package org.mage.test.cards;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import mage.Constants;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* also tests flashback
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public class TestIncreasingCards extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testIncreasingAmbition() {
|
||||
removeAllCardsFromHand(playerA);
|
||||
removeAllCardsFromLibrary(playerA);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 8);
|
||||
addCard(Constants.Zone.HAND, playerA, "Increasing Ambition");
|
||||
addCard(Constants.Zone.LIBRARY, playerA, "Swamp", 4);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Increasing Ambition");
|
||||
activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {7}{B}");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertGraveyardCount(playerA, 0);
|
||||
assertHandCount(playerA, 4);
|
||||
assertExileCount("Increasing Ambition", 1);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncreasingConfusion() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 4);
|
||||
addCard(Constants.Zone.HAND, playerA, "Increasing Confusion");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Increasing Confusion");
|
||||
activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {X}{U}");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertGraveyardCount(playerA, 0);
|
||||
assertExileCount("Increasing Confusion", 1);
|
||||
assertGraveyardCount(playerB, 9);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncreasingDevotion() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 9);
|
||||
addCard(Constants.Zone.HAND, playerA, "Increasing Devotion");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Increasing Devotion");
|
||||
activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {7}{W}{W}");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertGraveyardCount(playerA, 0);
|
||||
assertPermanentCount(playerA, "Human", 15);
|
||||
assertExileCount("Increasing Devotion", 1);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncreasingSavagery() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Forest", 7);
|
||||
addCard(Constants.Zone.HAND, playerA, "Increasing Savagery");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Ornithopter");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Increasing Savagery");
|
||||
activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {5}{G}{G}");
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertGraveyardCount(playerA, 0);
|
||||
assertPowerToughness(playerA, "Ornithopter", 15, 17, Filter.ComparisonScope.Any);
|
||||
assertExileCount("Increasing Savagery", 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ import java.util.UUID;
|
|||
import mage.Constants.PhaseStep;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.ExileZone;
|
||||
import org.mage.test.player.TestPlayer;
|
||||
|
||||
/**
|
||||
|
|
@ -429,6 +430,25 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
Assert.assertEquals("(Graveyard) Card counts are not equal ", count, actual);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert card count in exile.
|
||||
*
|
||||
* @param cardName Name of the cards that should be counted.
|
||||
* @param count Expected count.
|
||||
*/
|
||||
public void assertExileCount(String cardName, int count) throws AssertionError {
|
||||
int actualCount = 0;
|
||||
for (ExileZone exile: currentGame.getExile().getExileZones()) {
|
||||
for (Card card : exile.getCards(currentGame)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
actualCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Assert.assertEquals("(Exile) Card counts are not equal (" + cardName + ")", count, actualCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert card count in player's graveyard.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue