From 00dd941260e8f1fa79857d673ac38e4bc861c331 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 14 Feb 2018 17:35:47 +0100 Subject: [PATCH] * Grave Scrabbler - Fixed that it was also possible to return a card from graveyard even if not cast by madness. --- .../src/mage/cards/g/GraveScrabbler.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GraveScrabbler.java b/Mage.Sets/src/mage/cards/g/GraveScrabbler.java index ccb3b459e7..f86199a122 100644 --- a/Mage.Sets/src/mage/cards/g/GraveScrabbler.java +++ b/Mage.Sets/src/mage/cards/g/GraveScrabbler.java @@ -2,10 +2,8 @@ package mage.cards.g; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.TriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.condition.Condition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; @@ -16,7 +14,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.common.FilterCreatureCard; -import mage.game.Game; import mage.target.common.TargetCardInGraveyard; public class GraveScrabbler extends CardImpl { @@ -35,7 +32,7 @@ public class GraveScrabbler extends CardImpl { //you may return target creature card from a graveyard to its owner's hand. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"))); - this.addAbility(new ConditionalTriggeredAbility(ability, MadnessPaidCondition.instance, + this.addAbility(new ConditionalTriggeredAbility(ability, MadnessAbility.GetCondition(), "When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand.")); } @@ -49,21 +46,3 @@ public class GraveScrabbler extends CardImpl { } } - -enum MadnessPaidCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getSourceId()); - if (card != null) { - for (Ability ability : card.getAbilities()) { - if (ability instanceof MadnessAbility) { - return ((MadnessAbility) ability).getCosts().isPaid(); - } - } - } - return false; - } - -}