Mana and getPlayable fix. +1 test passed.

This commit is contained in:
magenoxx 2012-06-03 17:50:13 +04:00
parent 27d4997545
commit 037310c279
2 changed files with 13 additions and 5 deletions

View file

@ -14,7 +14,10 @@ public class AltarOfTheLostTest extends CardTestPlayerBase {
public void testCard() {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Altar of the Lost");
addCard(Constants.Zone.GRAVEYARD, playerA, "Lingering Souls");
setChoice(playerA, "Black");
setChoice(playerA, "Black");
activateAbility(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {1}{B}");
setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT);
execute();
@ -29,7 +32,10 @@ public class AltarOfTheLostTest extends CardTestPlayerBase {
addCard(Constants.Zone.BATTLEFIELD, playerA, "Plains");
addCard(Constants.Zone.BATTLEFIELD, playerA, "Altar of the Lost");
addCard(Constants.Zone.HAND, playerA, "Lingering Souls");
setChoice(playerA, "Black");
setChoice(playerA, "Black");
castSpell(3, Constants.PhaseStep.PRECOMBAT_MAIN, playerA, "Lingering Souls");
setStopAt(3, Constants.PhaseStep.BEGIN_COMBAT);
execute();

View file

@ -28,13 +28,13 @@
package mage;
import java.io.Serializable;
import mage.Constants.ColoredManaSymbol;
import mage.Constants.ManaType;
import mage.filter.FilterMana;
import mage.util.Copyable;
import java.io.Serializable;
/**
*
* @author BetaSteward_at_googlemail.com
@ -208,6 +208,8 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
sbMana.append("{B}");
for (int i = 0; i < white; i++)
sbMana.append("{W}");
for (int i = 0; i < any; i++)
sbMana.append("{Any}");
if (colorless > 0) {
sbMana.append("{").append(Integer.toString(colorless)).append("}");
}
@ -253,7 +255,7 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
compare.setWhite(0);
}
if (compare.getColorless() < 0) {
int remaining = compare.getRed() + compare.getGreen() + compare.getBlack() + compare.getBlue() + compare.getWhite();
int remaining = compare.getRed() + compare.getGreen() + compare.getBlack() + compare.getBlue() + compare.getWhite() + compare.getAny();
if (compare.getColorless() + remaining < 0)
return false;
}