- Improve Colorless Mana Payment when amount in ManaPool is <= to amount of Colorless Mana, or only one type of Mana in the pool.

This commit is contained in:
jendave
2011-08-06 10:22:02 +00:00
parent 8c4d08d95c
commit 6fb2792ae6

View File

@@ -261,8 +261,11 @@ public class ManaPool extends Card {
normalMana[map.get(m.getColor())] += m.getAmount();
}
int totalMana = 0;
ArrayList<String> alChoice = new ArrayList<String>();
for(int i = 0; i < normalMana.length; i++){
totalMana += normalMana[i];
totalMana += snowMana[i];
if (normalMana[i] > 0){
alChoice.add(manaStrings[i]+"("+normalMana[i]+")");
}
@@ -271,7 +274,17 @@ public class ManaPool extends Card {
}
}
if (alChoice.size() == 1){
choice = manaChoices.get(0);
return choice;
}
int numColorless = Integer.parseInt(manaStr);
if (numColorless >= totalMana){
choice = manaChoices.get(0);
return choice;
}
Object o = AllZone.Display.getChoiceOptional("Pay Mana from Mana Pool", alChoice.toArray());
if (o != null){
String ch = o.toString();