mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fixing X Mana bug when paying from the Mana Pool
This commit is contained in:
@@ -355,7 +355,10 @@ public class Cost {
|
||||
CostMana costMana = (CostMana) part;
|
||||
|
||||
String mana = getTotalMana();
|
||||
costMana.setAdjustedMana(AllZone.getGameAction().getSpellCostChange(sa, new ManaCost(mana)).toString());
|
||||
|
||||
ManaCost changedCost = AllZone.getGameAction().getSpellCostChange(sa, new ManaCost(mana));
|
||||
|
||||
costMana.setAdjustedMana(changedCost.toString(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,21 +478,21 @@ public class ManaCost {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final String toString() {
|
||||
public final String toString(boolean addX){
|
||||
// Boolean addX used to add Xs into the returned value
|
||||
StringBuilder sb = new StringBuilder();
|
||||
ArrayList<Object> list = new ArrayList<Object>(manaPart);
|
||||
// need to reverse everything since the colored mana is stored first
|
||||
Collections.reverse(list);
|
||||
|
||||
for (int i = 0; i < getXcounter(); i++) {
|
||||
sb.append(" ").append("X");
|
||||
if (addX) {
|
||||
for (int i = 0; i < getXcounter(); i++) {
|
||||
sb.append("X").append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
sb.append(" ");
|
||||
sb.append(list.get(i).toString());
|
||||
sb.append(list.get(i).toString()).append(" ");
|
||||
}
|
||||
|
||||
String str = sb.toString().trim();
|
||||
@@ -504,6 +504,12 @@ public class ManaCost {
|
||||
return str;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final String toString() {
|
||||
return toString(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getConvertedManaCost.
|
||||
|
||||
Reference in New Issue
Block a user