mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Add a limit to how many tokens are made (#7469)
* added a simple token limit * updated implementation of token limit * added token limit test
This commit is contained in:
parent
9d84a22412
commit
3a4b0159a9
3 changed files with 74 additions and 0 deletions
|
|
@ -0,0 +1,54 @@
|
|||
package org.mage.test.cards.rules;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
||||
public class TokenLimitTest extends CardTestPlayerBase {
|
||||
private static final String secure = "Secure the Wastes";
|
||||
private static final String procession = "Anointed Procession";
|
||||
private static final String warrior = "Warrior";
|
||||
|
||||
@Test
|
||||
public void testOnePlayerHitsLimit() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, procession, 4);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 34);
|
||||
addCard(Zone.HAND, playerA, secure, 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, secure);
|
||||
setChoice(playerA, "X=16");
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, secure);
|
||||
setChoice(playerA, "X=16");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, warrior, 500);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnePlayerHitsLimitWithOtherPlayer() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, procession, 4);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 33);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 3);
|
||||
addCard(Zone.HAND, playerA, secure);
|
||||
addCard(Zone.HAND, playerB, secure);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, secure);
|
||||
setChoice(playerA, "X=32");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, secure);
|
||||
setChoice(playerB, "X=3");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, warrior, 500);
|
||||
assertPermanentCount(playerB, warrior, 2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue