From 454efbbef6f2c83a032982643acd2beba9fca9b7 Mon Sep 17 00:00:00 2001 From: MitchelStein Date: Wed, 20 Aug 2014 10:50:21 -0700 Subject: [PATCH] Card updates. --- .../mage/sets/darksteel/GethsGrimoire.java | 41 +++---------------- .../src/mage/sets/iceage/OrcishLibrarian.java | 2 +- .../mage/sets/urzasdestiny/Opalescence.java | 6 +-- 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/Mage.Sets/src/mage/sets/darksteel/GethsGrimoire.java b/Mage.Sets/src/mage/sets/darksteel/GethsGrimoire.java index 4421261b62..780f434d6c 100644 --- a/Mage.Sets/src/mage/sets/darksteel/GethsGrimoire.java +++ b/Mage.Sets/src/mage/sets/darksteel/GethsGrimoire.java @@ -30,13 +30,10 @@ package mage.sets.darksteel; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; - +import mage.abilities.common.DiscardsACardOpponentTriggeredAbility; +import mage.abilities.effects.Effect; import mage.cards.CardImpl; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; /** * @@ -48,8 +45,10 @@ public class GethsGrimoire extends CardImpl { super(ownerId, 123, "Geth's Grimoire", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "DST"; + Effect drawTrigger = new DrawCardSourceControllerEffect(1); + drawTrigger.setText("You may draw a card."); // Whenever an opponent discards a card, you may draw a card. - this.addAbility(new GethsGrimoireTriggeredAbility()); + this.addAbility(new DiscardsACardOpponentTriggeredAbility(drawTrigger, true)); } public GethsGrimoire(final GethsGrimoire card) { @@ -60,32 +59,4 @@ public class GethsGrimoire extends CardImpl { public GethsGrimoire copy() { return new GethsGrimoire(this); } -} - -class GethsGrimoireTriggeredAbility extends TriggeredAbilityImpl { - GethsGrimoireTriggeredAbility() { - super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), true); - } - - GethsGrimoireTriggeredAbility(final GethsGrimoireTriggeredAbility ability) { - super(ability); - } - - @Override - public GethsGrimoireTriggeredAbility copy() { - return new GethsGrimoireTriggeredAbility(this); - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever an opponent discards a card, you may draw a card."; - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/iceage/OrcishLibrarian.java b/Mage.Sets/src/mage/sets/iceage/OrcishLibrarian.java index 496c8a5800..03dcfa2e8a 100644 --- a/Mage.Sets/src/mage/sets/iceage/OrcishLibrarian.java +++ b/Mage.Sets/src/mage/sets/iceage/OrcishLibrarian.java @@ -116,7 +116,7 @@ class OrcishLibrarianEffect extends OneShotEffect { if (cards.size() > 0) { Card card = cards.getRandom(game); - card.moveToExile(null, null, source.getSourceId(), game); + player.moveCardToExileWithInfo(card, null, null, source.getId(), game, Zone.LIBRARY); cards.remove(card); } } diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java index 9a7e5675e2..b75ab8a106 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java @@ -41,11 +41,10 @@ import static mage.constants.Layer.TypeChangingEffects_4; import mage.constants.Outcome; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.filter.FilterPermanent; +import mage.filter.common.FilterEnchantmentPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -79,10 +78,9 @@ public class Opalescence extends CardImpl { class OpalescenceEffect extends ContinuousEffectImpl { - private static final FilterPermanent filter = new FilterPermanent("Each other non-Aura enchantment"); + private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Each other non-Aura enchantment"); static { filter.add(Predicates.not(new SubtypePredicate("Aura"))); - filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public OpalescenceEffect() {