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;
|
CostMana costMana = (CostMana) part;
|
||||||
|
|
||||||
String mana = getTotalMana();
|
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} */
|
public final String toString(boolean addX){
|
||||||
@Override
|
// Boolean addX used to add Xs into the returned value
|
||||||
public final String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
ArrayList<Object> list = new ArrayList<Object>(manaPart);
|
ArrayList<Object> list = new ArrayList<Object>(manaPart);
|
||||||
// need to reverse everything since the colored mana is stored first
|
// need to reverse everything since the colored mana is stored first
|
||||||
Collections.reverse(list);
|
Collections.reverse(list);
|
||||||
|
|
||||||
for (int i = 0; i < getXcounter(); i++) {
|
if (addX) {
|
||||||
sb.append(" ").append("X");
|
for (int i = 0; i < getXcounter(); i++) {
|
||||||
|
sb.append("X").append(" ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
sb.append(" ");
|
sb.append(list.get(i).toString()).append(" ");
|
||||||
sb.append(list.get(i).toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String str = sb.toString().trim();
|
String str = sb.toString().trim();
|
||||||
@@ -504,6 +504,12 @@ public class ManaCost {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Override
|
||||||
|
public final String toString() {
|
||||||
|
return toString(true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* getConvertedManaCost.
|
* getConvertedManaCost.
|
||||||
|
|||||||
Reference in New Issue
Block a user