From 2b08d5a101216f04efc0d89cd3a878513e7ebca5 Mon Sep 17 00:00:00 2001 From: Mark Langen Date: Mon, 10 Apr 2017 17:00:27 -0600 Subject: [PATCH] As Foretold Implemented * Final change to card casting code to support as foretold. Removed all of the "Can't cast cards with no mana cost" code from the earlier parts of the casting process and simplified it to just the PlayerImpl::canPlay check and one final check in the main AbilityImpl::activate code after alternative costs have been chosen. --- Mage/src/main/java/mage/abilities/AbilityImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index 1f3365e3c68..ca4f014e73a 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -286,6 +286,17 @@ public abstract class AbilityImpl implements Ability { } } + // 117.6. Some mana costs contain no mana symbols. This represents an unpayable cost. An ability can + // also have an unpayable cost if its cost is based on the mana cost of an object with no mana cost. + // Attempting to cast a spell or activate an ability that has an unpayable cost is a legal action. + // However, attempting to pay an unpayable cost is an illegal action. + // + // We apply this now, *AFTER* the user has made the choice to pay an alternative cost for the + // spell. You can also still cast a spell with an unplayable cost by... not paying it's mana cost. + if (getAbilityType() == AbilityType.SPELL && getManaCostsToPay().isEmpty() && !noMana) { + return false; + } + // 20121001 - 601.2b // If the spell has a variable cost that will be paid as it's being cast (such as an {X} in // its mana cost; see rule 107.3), the player announces the value of that variable.