mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Fixing CostChange issue where required mana is reduced to 0.
This commit is contained in:
@@ -18,7 +18,7 @@ import forge.card.spellability.SpellAbility;
|
||||
*/
|
||||
public class Cost {
|
||||
private boolean isAbility = true;
|
||||
ArrayList<CostPart> costParts = new ArrayList<CostPart>();
|
||||
private ArrayList<CostPart> costParts = new ArrayList<CostPart>();
|
||||
|
||||
public ArrayList<CostPart> getCostParts(){ return costParts; }
|
||||
|
||||
|
||||
@@ -103,10 +103,15 @@ public class CostMana extends CostPart {
|
||||
manaToAdd = AbilityFactory.calculateAmount(source, "X", ability) * getXMana();
|
||||
}
|
||||
}
|
||||
if (!getManaToPay().equals("0") || manaToAdd > 0)
|
||||
if (!getManaToPay().equals("0") || manaToAdd > 0){
|
||||
CostUtil.setInput(CostMana.input_payMana(ability, payment, this, manaToAdd));
|
||||
else if (getXMana() > 0)
|
||||
}
|
||||
else if (getXMana() > 0){
|
||||
CostUtil.setInput(CostMana.input_payXMana(ability, payment, this, getXMana()));
|
||||
}
|
||||
else{
|
||||
payment.paidCost(this);
|
||||
}
|
||||
|
||||
// We return false here because the Inputs set above should recall payment.payCosts()
|
||||
return false;
|
||||
|
||||
@@ -352,7 +352,13 @@ public class ManaCost {
|
||||
sb.append(list.get(i).toString());
|
||||
}
|
||||
|
||||
return sb.toString().trim();
|
||||
String str = sb.toString().trim();
|
||||
|
||||
if (str.equals("")){
|
||||
return "0";
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user