Finish RestrictValid check early if cost is for effect

This commit is contained in:
TRT
2022-03-18 15:02:42 +01:00
committed by tool4EvEr
parent b317e46353
commit faefab9395
2 changed files with 11 additions and 3 deletions

View File

@@ -312,8 +312,11 @@ public class AbilityManaPart implements java.io.Serializable {
continue; continue;
} }
if (restriction.startsWith("CostContainsX")) { if (restriction.startsWith("CostContains")) {
if (sa.costHasManaX()) { if (restriction.endsWith("X") && sa.costHasManaX()) {
return true;
}
if (restriction.endsWith("C") && sa.getPayCosts().hasManaCost() && sa.getPayCosts().getCostMana().getManaToPay().getGenericCost() > 0) {
return true; return true;
} }
continue; continue;
@@ -338,6 +341,11 @@ public class AbilityManaPart implements java.io.Serializable {
return true; 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)) { if (sa.isValid(restriction, this.getSourceCard().getController(), this.getSourceCard(), null)) {
return true; return true;
} }

View File

@@ -2,6 +2,6 @@ Name:Eldrazi Temple
ManaCost:no cost ManaCost:no cost
Types:Land Types:Land
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}. A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
A:AB$ Mana | Cost$ T | Produced$ C | Amount$ 2 | RestrictValid$ Spell.Eldrazi,Activated.Eldrazi+Colorless | SpellDescription$ Add {C}{C}. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi. A:AB$ Mana | Cost$ T | Produced$ C | Amount$ 2 | RestrictValid$ Spell.Eldrazi+Colorless,Activated.Eldrazi+Colorless | SpellDescription$ Add {C}{C}. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi.
AI:RemoveDeck:Random AI:RemoveDeck:Random
Oracle:{T}: Add {C}.\n{T}: Add {C}{C}. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi. Oracle:{T}: Add {C}.\n{T}: Add {C}{C}. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi.