From 98a49cc39b9ec001c69c4d1f1a0f7d89455bbc77 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 12 Aug 2013 18:46:35 +0200 Subject: [PATCH] * Warren Weirding - Fixed that only Goblins could be sacrificed instead of correctly all subtypes of creatures. --- .../sets/modernmasters/WarrenWeirding.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java b/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java index 3f3a6111c8..e3849653ed 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java +++ b/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java @@ -40,12 +40,12 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerIdPredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -85,6 +85,10 @@ public class WarrenWeirding extends CardImpl { class WarrenWeirdingEffect extends OneShotEffect { + private static final FilterCreaturePermanent filterGoblin = new FilterCreaturePermanent("creature an opponent controls"); + static { + filterGoblin.add(new SubtypePredicate("Goblin")); + } WarrenWeirdingEffect ( ) { super(Outcome.Sacrifice); staticText = "Target player sacrifices a creature. If a Goblin is sacrificed this way, that player puts two 1/1 black Goblin Rogue creature tokens onto the battlefield, and those tokens gain haste until end of turn"; @@ -109,11 +113,13 @@ class WarrenWeirdingEffect extends OneShotEffect { if (target.canChoose(player.getId(), game)) { player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); Permanent permanent = game.getPermanent(target.getFirstTarget()); - if (permanent != null && permanent.getSubtype().contains("Goblin")) { + if (permanent != null) { permanent.sacrifice(source.getSourceId(), game); - Effect effect = new CreateTokenTargetEffect(new WarrenWeirdingBlackGoblinRogueToken(), 2); - effect.setTargetPointer(new FixedTarget(player.getId())); - effect.apply(game, source); + if (filterGoblin.match(permanent, game)) { + Effect effect = new CreateTokenTargetEffect(new WarrenWeirdingBlackGoblinRogueToken(), 2); + effect.setTargetPointer(new FixedTarget(player.getId())); + effect.apply(game, source); + } } return true; }