mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Fix casting with unpayable cost if no alternative provided
This commit is contained in:
@@ -370,15 +370,23 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
if ((sa.hasParam("WithoutManaCost") || sa.hasParam("PlayCost")) && tgtSA.costHasManaX() && !tgtSA.getPayCosts().getCostMana().canXbe0()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean unpayableCost = tgtSA.getHostCard().getManaCost().isNoCost();
|
||||
if (sa.hasParam("WithoutManaCost")) {
|
||||
tgtSA = tgtSA.copyWithNoManaCost();
|
||||
} else if (sa.hasParam("PlayCost")) {
|
||||
Cost abCost;
|
||||
String cost = sa.getParam("PlayCost");
|
||||
if (cost.equals("ManaCost")) {
|
||||
if (unpayableCost) {
|
||||
continue;
|
||||
}
|
||||
abCost = new Cost(source.getManaCost(), false);
|
||||
} else {
|
||||
if (cost.contains("ConvertedManaCost")) {
|
||||
if (unpayableCost) {
|
||||
continue;
|
||||
}
|
||||
final String costcmc = Integer.toString(tgtCard.getCMC());
|
||||
cost = cost.replace("ConvertedManaCost", costcmc);
|
||||
}
|
||||
@@ -386,6 +394,8 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
}
|
||||
|
||||
tgtSA = tgtSA.copyWithManaCostReplaced(tgtSA.getActivatingPlayer(), abCost);
|
||||
} else if (unpayableCost) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!optional) {
|
||||
|
||||
Reference in New Issue
Block a user