mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Fixed Unless costs with colored mana (Chain Lightning).
This commit is contained in:
@@ -1100,13 +1100,9 @@ public class AbilityUtils {
|
|||||||
ManaCostBeingPaid newCost = new ManaCostBeingPaid(unlessCost.toString());
|
ManaCostBeingPaid newCost = new ManaCostBeingPaid(unlessCost.toString());
|
||||||
newCost.decreaseColorlessMana(2);
|
newCost.decreaseColorlessMana(2);
|
||||||
unlessCost = newCost.toString();
|
unlessCost = newCost.toString();
|
||||||
} else if( unlessCost.indexOf('<') < 0 ) { // if cost has '<' or '>' signs - it's definitely not a variable
|
} else if( !StringUtils.isBlank(sa.getSVar(unlessCost)) || !StringUtils.isBlank(source.getSVar(unlessCost))) {
|
||||||
try {
|
// check for X costs (stored in SVars
|
||||||
String unlessVar = Integer.toString(calculateAmount(source, sa.getParam("UnlessCost").replace(" ", ""), sa));
|
unlessCost = Integer.toString(calculateAmount(source, sa.getParam("UnlessCost").replace(" ", ""), sa));
|
||||||
unlessCost = unlessVar;
|
|
||||||
} catch (final NumberFormatException n) {
|
|
||||||
} //This try/catch method enables UnlessCost to parse any svar name
|
|
||||||
//instead of just X for cards like Draco.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final Cost cost = new Cost(source, unlessCost, true);
|
final Cost cost = new Cost(source, unlessCost, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user