mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* Kruphix, God of Horizons - Fixed a bug that the mana pool was not correctly emptied (fixes #555).
This commit is contained in:
parent
72cd7a46ec
commit
2977cd27ea
3 changed files with 34 additions and 2 deletions
|
|
@ -89,5 +89,35 @@ public class NykthosShrineToNyxTest extends CardTestPlayerBase {
|
||||||
Assert.assertEquals("amount of green mana", 10, playerA.getManaPool().getGreen()); // 6G - 2G = 4G + 6G = 10G
|
Assert.assertEquals("amount of green mana", 10, playerA.getManaPool().getGreen()); // 6G - 2G = 4G + 6G = 10G
|
||||||
assertPowerToughness(playerA, "Omnath, Locus of Mana", 11,11);
|
assertPowerToughness(playerA, "Omnath, Locus of Mana", 11,11);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Use Nykthos together with Kruphix, God of Horizons to save mana as colorless mana
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDoubleUseWithKruphix() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 2); // to use Nykthos
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
|
||||||
|
// Kiora's Follower {G}{U}
|
||||||
|
// Creature - Merfolk
|
||||||
|
// {T}: Untap another target permanent.
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Kiora's Follower"); // 1 G devotion
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Kalonian Tusker", 2); // 4 G devotion
|
||||||
|
// Kruphix, God of Horizons {3}{G}{U}
|
||||||
|
// If unused mana would empty from your mana pool, that mana becomes colorless instead.
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Kruphix, God of Horizons", 1); // 1 G devotion
|
||||||
|
|
||||||
|
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. <i>(Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)</i>.");
|
||||||
|
setChoice(playerA, "Green");
|
||||||
|
|
||||||
|
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Untap another target permanent.","Nykthos, Shrine to Nyx");
|
||||||
|
|
||||||
|
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. <i>(Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)</i>.");
|
||||||
|
setChoice(playerA, "Green");
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
Assert.assertEquals("amount of colorless mana", 10, playerA.getManaPool().getColorless()); // 6 - 2 (2.Activation) = 4 + 6 = 10 colorless mana
|
||||||
|
assertPowerToughness(playerA, "Kruphix, God of Horizons", 4,7);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ package mage.constants;
|
||||||
public enum ManaType {
|
public enum ManaType {
|
||||||
BLACK ("black"),
|
BLACK ("black"),
|
||||||
BLUE ("blue"),
|
BLUE ("blue"),
|
||||||
GREEN ("greeen"),
|
GREEN ("green"),
|
||||||
RED ("red"),
|
RED ("red"),
|
||||||
WHITE ("white"),
|
WHITE ("white"),
|
||||||
COLORLESS("colorless");
|
COLORLESS("colorless");
|
||||||
|
|
|
||||||
|
|
@ -164,9 +164,11 @@ public class ManaPool implements Serializable {
|
||||||
for (ManaType manaType: manaTypeArray) {
|
for (ManaType manaType: manaTypeArray) {
|
||||||
if (item.get(manaType) > 0) {
|
if (item.get(manaType) > 0) {
|
||||||
total += item.get(manaType);
|
total += item.get(manaType);
|
||||||
|
while (item.get(manaType) > 0) {
|
||||||
item.remove(manaType);
|
item.remove(manaType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (item.count() == 0) {
|
if (item.count() == 0) {
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue