From 037310c2797868c9940dfac0cfdd1177a0a63191 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 3 Jun 2012 17:50:13 +0400 Subject: [PATCH] Mana and getPlayable fix. +1 test passed. --- .../org/mage/test/cards/single/AltarOfTheLostTest.java | 10 ++++++++-- Mage/src/mage/Mana.java | 8 +++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java index 2f2456d5d8..a56230cf00 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/AltarOfTheLostTest.java @@ -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(); diff --git a/Mage/src/mage/Mana.java b/Mage/src/mage/Mana.java index 142f1d701d..5ed9cc0004 100644 --- a/Mage/src/mage/Mana.java +++ b/Mage/src/mage/Mana.java @@ -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, Serializable, Copyable { 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, Serializable, Copyable { 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; }