mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Finish RestrictValid check early if cost is for effect
This commit is contained in:
@@ -312,8 +312,11 @@ public class AbilityManaPart implements java.io.Serializable {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (restriction.startsWith("CostContainsX")) {
|
||||
if (sa.costHasManaX()) {
|
||||
if (restriction.startsWith("CostContains")) {
|
||||
if (restriction.endsWith("X") && sa.costHasManaX()) {
|
||||
return true;
|
||||
}
|
||||
if (restriction.endsWith("C") && sa.getPayCosts().hasManaCost() && sa.getPayCosts().getCostMana().getManaToPay().getGenericCost() > 0) {
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
@@ -338,6 +341,11 @@ public class AbilityManaPart implements java.io.Serializable {
|
||||
return true;
|
||||
}
|
||||
|
||||
// the payment is for a resolving SA, currently no other restrictions would allow that
|
||||
if (getSourceCard().getGame().getStack().getInstanceFromSpellAbility(sa.getRootAbility()) != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sa.isValid(restriction, this.getSourceCard().getController(), this.getSourceCard(), null)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user