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:
Evan Kranzler 2021-01-31 12:55:30 -05:00 committed by GitHub
parent 9d84a22412
commit 3a4b0159a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 0 deletions

View file

@ -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);
}
}