mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
2 DKA
This commit is contained in:
parent
e03aaee4b6
commit
f1fefb0d59
12 changed files with 463 additions and 190 deletions
|
|
@ -1,31 +0,0 @@
|
|||
package org.mage.test.cards;
|
||||
|
||||
import mage.Constants;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public class TestCurseOfBloodletting extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCard1() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 7);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Bloodletting");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt", 2);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerA);
|
||||
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 17);
|
||||
assertLife(playerB, 14);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package org.mage.test.cards;
|
||||
|
||||
import mage.Constants;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public class TestCurseOfEchoes extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCard1() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 5);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 5);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Echoes");
|
||||
addCard(Constants.Zone.HAND, playerB, "Jace's Ingenuity");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Echoes", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Jace's Ingenuity");
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertHandCount(playerA, 3);
|
||||
assertHandCount(playerB, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package org.mage.test.cards;
|
||||
|
||||
import mage.Constants;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public class TestCurseOfExhaustion extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCard1() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 4);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Exhaustion");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
addCard(Constants.Zone.HAND, playerB, "Lightning Bolt", 2);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20);
|
||||
assertLife(playerA, 17);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCard2() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 4);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Exhaustion");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt", 2);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 14);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
package org.mage.test.cards;
|
||||
|
||||
import mage.Constants;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public class TestCurseOfThirst extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCard1() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
|
||||
|
||||
setStopAt(2, Constants.PhaseStep.DRAW);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 19);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCard2() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Bloodletting");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB);
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
|
||||
|
||||
setStopAt(2, Constants.PhaseStep.DRAW);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 16);
|
||||
}
|
||||
|
||||
}
|
||||
151
Mage.Tests/src/test/java/org/mage/test/cards/TestCurses.java
Normal file
151
Mage.Tests/src/test/java/org/mage/test/cards/TestCurses.java
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
package org.mage.test.cards;
|
||||
|
||||
import mage.Constants;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public class TestCurses extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCurseOfBloodletting() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 7);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Bloodletting");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt", 2);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerA);
|
||||
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 17);
|
||||
assertLife(playerB, 14);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurseOfEchoes() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Island", 5);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Island", 5);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Echoes");
|
||||
addCard(Constants.Zone.HAND, playerB, "Jace's Ingenuity");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Echoes", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Jace's Ingenuity");
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertHandCount(playerA, 3);
|
||||
assertHandCount(playerB, 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurseOfExhaustion1() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 4);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Exhaustion");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
addCard(Constants.Zone.HAND, playerB, "Lightning Bolt", 2);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20);
|
||||
assertLife(playerA, 17);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurseOfExhaustion2() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 4);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Exhaustion");
|
||||
addCard(Constants.Zone.HAND, playerA, "Lightning Bolt", 2);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Exhaustion", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, Constants.PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 14);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurseOfThirst1() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
|
||||
|
||||
setStopAt(2, Constants.PhaseStep.DRAW);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 19);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurseOfThirst2() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Thirst");
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Bloodletting");
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Bloodletting", playerB);
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Thirst", playerB);
|
||||
|
||||
setStopAt(2, Constants.PhaseStep.DRAW);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 16);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurseOfMisfortune1() {
|
||||
removeAllCardsFromLibrary(playerA);
|
||||
addCard(Constants.Zone.LIBRARY, playerA, "Curse of Misfortunes", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Misfortunes");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Misfortunes", playerB);
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.DRAW);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerA, "Curse of Misfortunes", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurseOfMisfortune2() {
|
||||
removeAllCardsFromLibrary(playerA);
|
||||
addCard(Constants.Zone.LIBRARY, playerA, "Curse of Bloodletting", 2);
|
||||
addCard(Constants.Zone.HAND, playerA, "Curse of Misfortunes");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of Misfortunes", playerB);
|
||||
|
||||
setStopAt(3, Constants.PhaseStep.DRAW);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerA, "Curse of Misfortunes", 1);
|
||||
assertPermanentCount(playerA, "Curse of Bloodletting", 1); }
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class TestSuddenDisappearance extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCard() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 6);
|
||||
addCard(Constants.Zone.HAND, playerA, "Sudden Disappearance");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 1);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Horned Turtle", 4);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Altar of the Lost", 1);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Sudden Disappearance", playerB);
|
||||
|
||||
setStopAt(1, Constants.PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerB, "Air Elemental", 0);
|
||||
assertPermanentCount(playerB, "Horned Turtle", 0);
|
||||
assertPermanentCount(playerB, "Altar of the Lost", 0);
|
||||
assertExileCount("Air Elemental", 1);
|
||||
assertExileCount("Horned Turtle", 4);
|
||||
assertExileCount("Altar of the Lost", 1);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCard1() {
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains", 6);
|
||||
addCard(Constants.Zone.HAND, playerA, "Sudden Disappearance");
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Air Elemental", 1);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Horned Turtle", 4);
|
||||
addCard(Constants.Zone.BATTLEFIELD, playerB, "Altar of the Lost", 1);
|
||||
|
||||
castSpell(1, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Sudden Disappearance", playerB);
|
||||
|
||||
setStopAt(2, Constants.PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
assertPermanentCount(playerB, "Air Elemental", 1);
|
||||
assertPermanentCount(playerB, "Horned Turtle", 4);
|
||||
assertPermanentCount(playerB, "Altar of the Lost", 1);
|
||||
assertExileCount("Air Elemental", 0);
|
||||
assertExileCount("Horned Turtle", 0);
|
||||
assertExileCount("Altar of the Lost", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -260,7 +260,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
*/
|
||||
public void assertLife(Player player, int life) throws AssertionError {
|
||||
int actual = currentGame.getPlayer(player.getId()).getLife();
|
||||
Assert.assertEquals("Life amounts are not equal", life, actual);
|
||||
Assert.assertEquals("Life amounts are not equal for player " + player.getName(), life, actual);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue