mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Fix for new Cost object not using CostChange information properly
This commit is contained in:
@@ -300,8 +300,8 @@ public class Cost {
|
|||||||
if (part instanceof CostMana){
|
if (part instanceof CostMana){
|
||||||
CostMana costMana = (CostMana)part;
|
CostMana costMana = (CostMana)part;
|
||||||
|
|
||||||
if (getTotalMana() != "0") { // 11/15/10 use getTotalMana() to account for X reduction
|
String mana = getTotalMana();
|
||||||
String mana = getTotalMana();
|
if (mana != "0") { // 11/15/10 use getTotalMana() to account for X reduction
|
||||||
costMana.setAdjustedMana(AllZone.getGameAction().getSpellCostChange(sa, new ManaCost(mana)).toString());
|
costMana.setAdjustedMana(AllZone.getGameAction().getSpellCostChange(sa, new ManaCost(mana)).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,14 @@ public class CostMana extends CostPart {
|
|||||||
this.adjustedMana = adjustedMana;
|
this.adjustedMana = adjustedMana;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getManaToPay() {
|
||||||
|
// Only used for Human to pay for non-X cost first
|
||||||
|
if (!adjustedMana.equals(""))
|
||||||
|
return adjustedMana;
|
||||||
|
|
||||||
|
return mana;
|
||||||
|
}
|
||||||
|
|
||||||
public CostMana(String mana, int amount){
|
public CostMana(String mana, int amount){
|
||||||
this.mana = mana.trim();
|
this.mana = mana.trim();
|
||||||
this.amountX = amount;
|
this.amountX = amount;
|
||||||
@@ -95,7 +103,7 @@ public class CostMana extends CostPart {
|
|||||||
manaToAdd = AbilityFactory.calculateAmount(source, "X", ability) * getXMana();
|
manaToAdd = AbilityFactory.calculateAmount(source, "X", ability) * getXMana();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!getMana().equals("0") || manaToAdd > 0)
|
if (!getManaToPay().equals("0") || manaToAdd > 0)
|
||||||
CostUtil.setInput(CostMana.input_payMana(ability, payment, this, manaToAdd));
|
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()));
|
CostUtil.setInput(CostMana.input_payXMana(ability, payment, this, getXMana()));
|
||||||
@@ -188,7 +196,7 @@ public class CostMana extends CostPart {
|
|||||||
if (sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
|
if (sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
|
||||||
manaCost = new ManaCost("0");
|
manaCost = new ManaCost("0");
|
||||||
} else {
|
} else {
|
||||||
String mana = costMana.getMana();
|
String mana = costMana.getManaToPay();
|
||||||
manaCost = new ManaCost(mana);
|
manaCost = new ManaCost(mana);
|
||||||
manaCost.increaseColorlessMana(manaToAdd);
|
manaCost.increaseColorlessMana(manaToAdd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user