From 16bc70576a1b5fc518597769456fb22ac0a79513 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 27 Mar 2014 01:11:33 +0100 Subject: [PATCH] * Fixed a problem that abilities of cards could not be cast /played / activated if they had no mana costs (e.g. Cabal Therapy and Crucible of Worlds). --- Mage.Sets/src/mage/sets/judgment/CabalTherapy.java | 6 +++--- Mage/src/mage/abilities/SpellAbility.java | 7 ++++--- Mage/src/mage/cards/CardsImpl.java | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/sets/judgment/CabalTherapy.java b/Mage.Sets/src/mage/sets/judgment/CabalTherapy.java index 1502bd4f6c..8e40b95435 100644 --- a/Mage.Sets/src/mage/sets/judgment/CabalTherapy.java +++ b/Mage.Sets/src/mage/sets/judgment/CabalTherapy.java @@ -61,7 +61,7 @@ public class CabalTherapy extends CardImpl { this.color.setBlack(true); // Name a nonland card. Target player reveals his or her hand and discards all cards with that name. - this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new TargetPlayer(true)); this.getSpellAbility().addEffect(new CabalTherapyEffect()); // Flashback-Sacrifice a creature. this.addAbility(new FlashbackAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), true)), TimingRule.SORCERY)); @@ -80,7 +80,7 @@ public class CabalTherapy extends CardImpl { class CabalTherapyEffect extends OneShotEffect { public CabalTherapyEffect() { - super(Outcome.Exile); + super(Outcome.Discard); staticText = "Name a nonland card. Search target player's hand for all cards with that name and discard them"; } @@ -107,7 +107,7 @@ class CabalTherapyEffect extends OneShotEffect { game.informPlayers("Cabal Therapy, named card: [" + cardName + "]"); for (Card card : player.getHand().getCards(game)) { if (card.getName().equals(cardName)) { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); + player.discard(card, source, game); } } diff --git a/Mage/src/mage/abilities/SpellAbility.java b/Mage/src/mage/abilities/SpellAbility.java index b2f1ae3a79..4b5d86016a 100644 --- a/Mage/src/mage/abilities/SpellAbility.java +++ b/Mage/src/mage/abilities/SpellAbility.java @@ -93,9 +93,10 @@ public class SpellAbility extends ActivatedAbilityImpl { if (!controllerId.equals(playerId)) { return false; } - if (this.getManaCosts().isEmpty()) { - return false; - } + // Why is this check made? It prevents Flashback with non mana costs (Cabal Therapy) +// if (this.getManaCosts().isEmpty()) { +// return false; +// } if (costs.canPay(sourceId, controllerId, game)) { if (getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) { SplitCard splitCard = (SplitCard) game.getCard(getSourceId()); diff --git a/Mage/src/mage/cards/CardsImpl.java b/Mage/src/mage/cards/CardsImpl.java index e5bbb0ec0e..70d5f9783e 100644 --- a/Mage/src/mage/cards/CardsImpl.java +++ b/Mage/src/mage/cards/CardsImpl.java @@ -158,7 +158,7 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl @Override public Set getCards(FilterCard filter, Game game) { - Set cards = new LinkedHashSet(); + Set cards = new LinkedHashSet<>(); for (UUID card: this) { boolean match = filter.match(game.getCard(card), game); if (match) { @@ -170,7 +170,7 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl @Override public Set getCards(Game game) { - Set cards = new LinkedHashSet(); + Set cards = new LinkedHashSet<>(); for (UUID card: this) { cards.add(game.getCard(card)); } @@ -186,7 +186,7 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl @Override public Collection getUniqueCards(Game game) { - Map cards = new HashMap(); + Map cards = new HashMap<>(); for(UUID cardId: this) { Card card = game.getCard(cardId); if (!cards.containsKey(card.getName())) {