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); 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 // convert these to SubAbilities when appropriate
if (params.containsKey("Stuck")) { if (params.containsKey("Stuck")) {
abMana.setUndoable(false); abMana.setUndoable(false);

View File

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

View File

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

View File

@@ -192,9 +192,6 @@ public class InputPayManaCostUtil {
manaCost = AllZone.getHumanPlayer().getManaPool().subtractMana(sa, manaCost, chosen); 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(); AllZone.getHumanPlayer().getZone(Zone.Battlefield).updateObservers();
// DO NOT REMOVE THIS, otherwise the cards don't always tap (copied) // DO NOT REMOVE THIS, otherwise the cards don't always tap (copied)
return manaCost; return manaCost;