fixed "any" mana bug with choice not getting reset

This commit is contained in:
ArsenalNut
2012-01-21 16:54:27 +00:00
parent da982a73e9
commit 4c0824bd79
4 changed files with 16 additions and 6 deletions

View File

@@ -354,6 +354,9 @@ public class AbilityFactoryMana {
abMana.produceMana(AbilityFactoryMana.generatedMana(abMana, af, sa), player);
}
// Only clear express choice after mana has been produced
abMana.clearExpressChoice();
// convert these to SubAbilities when appropriate
if (params.containsKey("Stuck")) {
abMana.setUndoable(false);

View File

@@ -702,12 +702,12 @@ public class ManaPool {
// paying via Mana Abilities
for (final AbilityMana mability : mAbilities) {
paidAbs.add(mability); // why???
//TODO: Look at using new getManaProduced() method of Ability_Mana (ArsenalNut)
//String[] cost = formatMana(mability);
String[] cost = null;
if (mability.isAnyMana()) {
cost = new String[1];
cost[0] = mability.getExpressChoice();
//TODO: (ArsenalNut) Look at using new getManaProduced() method of Ability_Mana
// for all mana sources not just "any" mana sources
cost = mability.getManaProduced().split(" ");
}
else {
cost = formatMana(mability);

View File

@@ -292,6 +292,16 @@ public abstract class AbilityMana extends AbilityActivated implements java.io.Se
return this.lastExpressChoice;
}
/**
* <p>
* clearExpressChoice.
* </p>
*
*/
public void clearExpressChoice() {
this.lastExpressChoice = "";
}
/**
* <p>
* Getter for the field <code>lastProduced</code>.

View File

@@ -192,9 +192,6 @@ public class InputPayManaCostUtil {
manaCost = AllZone.getHumanPlayer().getManaPool().subtractMana(sa, manaCost, chosen);
// reset choice to blank, make sure this done after subtractMana
chosen.setExpressChoice("");
AllZone.getHumanPlayer().getZone(Zone.Battlefield).updateObservers();
// DO NOT REMOVE THIS, otherwise the cards don't always tap (copied)
return manaCost;