mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* Mana increase effects - fixed that some infinite mana combos gives 0 mana on too much permanents/effects (example: Nyxbloom Ancient);
This commit is contained in:
parent
cda79866ad
commit
2393485320
10 changed files with 165 additions and 103 deletions
|
|
@ -383,10 +383,11 @@ public class CommandersCastTest extends CardTestCommander4Players {
|
|||
addCustomEffect_TargetDamage(playerA, 10); // kill creature
|
||||
|
||||
// use case:
|
||||
// cast adventure spell from command zone and keep it in exile (inc next command cost)
|
||||
// cast card from exile (do not inc next command cost)
|
||||
// return commander to command zone
|
||||
// cast as adventure spell (with x1 command cost)
|
||||
// cast adventure spell from command zone (inc command tax to 1x)
|
||||
// return to command zone
|
||||
// cast adventure spell from command zone (inc command tax to 2x)
|
||||
// return to command zone
|
||||
// cast as creature (with 2x command tax)
|
||||
|
||||
// Curious Pair, creature, {1}{G}, 1/3
|
||||
// Treats to Share, sorcery, {G}
|
||||
|
|
@ -418,7 +419,6 @@ public class CommandersCastTest extends CardTestCommander4Players {
|
|||
checkPlayableAbility("after mana add", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Curious Pair", false);
|
||||
checkPlayableAbility("after mana add", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Treats to Share", true);
|
||||
|
||||
|
||||
// play adventure spell, but keep it
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Treats to Share");
|
||||
setChoice(playerA, "No"); // do not return commander
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
public class TappedForManaFromMultipleEffects extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_One() {
|
||||
public void test_NyxbloomAncient_One() {
|
||||
// If you tap a permanent for mana, it produces three times as much of that mana instead.
|
||||
addCard(Zone.HAND, playerA, "Nyxbloom Ancient"); // {4}{G}{G}{G}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 7);
|
||||
|
|
@ -36,7 +36,7 @@ public class TappedForManaFromMultipleEffects extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_Two() {
|
||||
public void test_NyxbloomAncient_Two() {
|
||||
// If you tap a permanent for mana, it produces three times as much of that mana instead.
|
||||
addCard(Zone.HAND, playerA, "Nyxbloom Ancient", 1); // {4}{G}{G}{G}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 7);
|
||||
|
|
@ -70,6 +70,25 @@ public class TappedForManaFromMultipleEffects extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Chlorophant", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_NyxbloomAncient_IntegerOverflow() {
|
||||
// If you tap a permanent for mana, it produces three times as much of that mana instead.
|
||||
int permanentsCount = 30;
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Nyxbloom Ancient", permanentsCount);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
|
||||
// total mana = 3^count, so must be Integer overflow protection (no zero or negative values)
|
||||
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}");
|
||||
checkManaPool("max mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "G", Integer.MAX_VALUE);
|
||||
setChoice(playerA, "Nyxbloom Ancient", permanentsCount - 1); // choose replacement effects order
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_ChromeMox_Direct() {
|
||||
// Imprint — When Chrome Mox enters the battlefield, you may exile a nonartifact, nonland card from your hand.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue