diff --git a/Mage/src/mage/abilities/SpellAbility.java b/Mage/src/mage/abilities/SpellAbility.java index 9bd7e5632e..eee99fdc21 100644 --- a/Mage/src/mage/abilities/SpellAbility.java +++ b/Mage/src/mage/abilities/SpellAbility.java @@ -37,6 +37,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import java.util.UUID; +import mage.players.Player; /** * @@ -44,7 +45,7 @@ import java.util.UUID; */ public class SpellAbility extends ActivatedAbilityImpl { - private SpellAbilityType spellAbilityType; + protected SpellAbilityType spellAbilityType; public SpellAbility(ManaCost cost, String cardName) { this(cost, cardName, Zone.HAND); @@ -102,7 +103,13 @@ public class SpellAbility extends ActivatedAbilityImpl { return false; } } - + // Alternate spell abilities (Flashback, Overload) can't be cast with no mana to pay option + if (getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) { + Player player = game.getPlayer(playerId); + if (player != null && getSourceId().equals(player.getCastSourceIdWithoutMana())) { + return false; + } + } if (costs.canPay(this, sourceId, controllerId, game)) { if (getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) { SplitCard splitCard = (SplitCard) game.getCard(getSourceId()); diff --git a/Mage/src/mage/abilities/keyword/FlashbackAbility.java b/Mage/src/mage/abilities/keyword/FlashbackAbility.java index 7618b11aae..b62f48e1be 100644 --- a/Mage/src/mage/abilities/keyword/FlashbackAbility.java +++ b/Mage/src/mage/abilities/keyword/FlashbackAbility.java @@ -63,7 +63,6 @@ import mage.players.Player; */ public class FlashbackAbility extends SpellAbility { - private SpellAbilityType spellAbilityType; private String abilityName; public FlashbackAbility(Cost cost, TimingRule timingRule) { @@ -74,7 +73,7 @@ public class FlashbackAbility extends SpellAbility { this.addCost(cost); this.timing = timingRule; this.usesStack = false; - this.spellAbilityType = SpellAbilityType.BASE; + this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.addEffect(new CreateDelayedTriggeredAbilityEffect(new FlashbackTriggeredAbility())); } diff --git a/Mage/src/mage/abilities/keyword/OverloadAbility.java b/Mage/src/mage/abilities/keyword/OverloadAbility.java index 77ac5f9708..b5abc7ac04 100644 --- a/Mage/src/mage/abilities/keyword/OverloadAbility.java +++ b/Mage/src/mage/abilities/keyword/OverloadAbility.java @@ -32,6 +32,7 @@ import mage.abilities.SpellAbility; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.effects.Effect; import mage.cards.Card; +import mage.constants.SpellAbilityType; import mage.constants.TimingRule; @@ -61,6 +62,7 @@ public class OverloadAbility extends SpellAbility { public OverloadAbility(Card card,Effect effect, ManaCosts costs) { this(card, effect, costs, TimingRule.INSTANT); + this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; } public OverloadAbility(Card card,Effect effect, ManaCosts costs, TimingRule timingRule) { diff --git a/Mage/src/mage/constants/SpellAbilityType.java b/Mage/src/mage/constants/SpellAbilityType.java index 37733359c6..b07ed45c91 100644 --- a/Mage/src/mage/constants/SpellAbilityType.java +++ b/Mage/src/mage/constants/SpellAbilityType.java @@ -6,6 +6,7 @@ package mage.constants; */ public enum SpellAbilityType { BASE("Basic SpellAbility"), + BASE_ALTERNATE("Basic SpellAbility Alternate"), // used for Overload, Flashback to know they must be handled as Alternate casting costs SPLIT("Split SpellAbility"), SPLIT_FUSED("Split SpellAbility"), SPLIT_LEFT("LeftSplit SpellAbility"), @@ -13,7 +14,7 @@ public enum SpellAbilityType { MODE("Mode SpellAbility"), SPLICE("Spliced SpellAbility"); - private String text; + private final String text; SpellAbilityType(String text) { this.text = text;