From 32779cb856284d18be2957daae067eec0a3de42c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 17 Nov 2013 08:37:31 +0100 Subject: [PATCH] * Shimmer Myr - Fixed that Artifact cards could be cast from every zone. --- .../sets/mirrodinbesieged/ShimmerMyr.java | 57 ++++++------------- 1 file changed, 16 insertions(+), 41 deletions(-) diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java index a7109daafc..6caad6adc2 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ShimmerMyr.java @@ -29,16 +29,17 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.common.continious.CastAsThoughItHadFlashEffect; import mage.abilities.keyword.FlashAbility; -import mage.cards.Card; import mage.cards.CardImpl; -import mage.game.Game; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,14 +47,22 @@ import mage.game.Game; */ public class ShimmerMyr extends CardImpl { + private static final FilterCreatureCard filter = new FilterCreatureCard("artifact cards"); + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + public ShimmerMyr (UUID ownerId) { super(ownerId, 129, "Shimmer Myr", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); this.expansionSetCode = "MBS"; this.subtype.add("Myr"); this.power = new MageInt(2); this.toughness = new MageInt(2); + + // Flash this.addAbility(FlashAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShimmerMyrEffect())); + // You may cast artifact cards as though they had flash. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashEffect(Duration.WhileOnBattlefield, filter))); } public ShimmerMyr (final ShimmerMyr card) { @@ -66,37 +75,3 @@ public class ShimmerMyr extends CardImpl { } } - -class ShimmerMyrEffect extends AsThoughEffectImpl { - - public ShimmerMyrEffect() { - super(AsThoughEffectType.CAST, Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "You may cast artifact cards as though they had flash"; - } - - public ShimmerMyrEffect(final ShimmerMyrEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public ShimmerMyrEffect copy() { - return new ShimmerMyrEffect(this); - } - - @Override - public boolean applies(UUID sourceId, Ability source, Game game) { - Card card = game.getCard(sourceId); - if (card != null) { - if (card.getCardType().contains(CardType.ARTIFACT) && card.getOwnerId().equals(source.getControllerId())) { - return true; - } - } - return false; - } - -} \ No newline at end of file