From a1a54cae142fae95cbfd23803a74d5aa1689b6ae Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 23 Oct 2014 16:17:50 +0200 Subject: [PATCH] * Changed two replacement effects to rule modifying effects. --- .../src/mage/sets/ravnika/ShadowOfDoubt.java | 15 +++------ .../mage/sets/shardsofalara/MindlockOrb.java | 33 ++++++------------- 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/Mage.Sets/src/mage/sets/ravnika/ShadowOfDoubt.java b/Mage.Sets/src/mage/sets/ravnika/ShadowOfDoubt.java index 7e2ea54cd8e..1971d6f50f4 100644 --- a/Mage.Sets/src/mage/sets/ravnika/ShadowOfDoubt.java +++ b/Mage.Sets/src/mage/sets/ravnika/ShadowOfDoubt.java @@ -33,6 +33,7 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.abilities.Ability; +import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; @@ -69,10 +70,10 @@ public class ShadowOfDoubt extends CardImpl { } } -class LibrariesCantBeSearchedEffect extends ReplacementEffectImpl { +class LibrariesCantBeSearchedEffect extends ContinuousRuleModifiyingEffectImpl { public LibrariesCantBeSearchedEffect() { - super(Duration.EndOfTurn, Outcome.Benefit); + super(Duration.EndOfTurn, Outcome.Benefit, true, false); staticText = "Players can't search libraries this turn"; } @@ -90,16 +91,8 @@ class LibrariesCantBeSearchedEffect extends ReplacementEffectImpl { return true; } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - return true; - } - @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.SEARCH_LIBRARY) { - return true; - } - return false; + return event.getType() == GameEvent.EventType.SEARCH_LIBRARY; } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MindlockOrb.java b/Mage.Sets/src/mage/sets/shardsofalara/MindlockOrb.java index 0661348dcd9..cb9ade33d55 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/MindlockOrb.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/MindlockOrb.java @@ -35,7 +35,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.ContinuousRuleModifiyingEffectImpl; import mage.cards.CardImpl; import mage.game.Game; import mage.game.events.GameEvent; @@ -54,7 +54,7 @@ public class MindlockOrb extends CardImpl { this.color.setBlue(true); // Players can't search libraries. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MindlockOrbReplacementEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MindlockRuleModifyingEffect())); } @@ -68,16 +68,14 @@ public class MindlockOrb extends CardImpl { } } -class MindlockOrbReplacementEffect extends ReplacementEffectImpl { - - private static final String effectText = "Players can't search libraries"; +class MindlockRuleModifyingEffect extends ContinuousRuleModifiyingEffectImpl { - MindlockOrbReplacementEffect ( ) { - super(Duration.WhileOnBattlefield, Outcome.Neutral); - staticText = effectText; + MindlockRuleModifyingEffect ( ) { + super(Duration.WhileOnBattlefield, Outcome.Neutral, true, false); + staticText = "Players can't search libraries"; } - MindlockOrbReplacementEffect ( MindlockOrbReplacementEffect effect ) { + MindlockRuleModifyingEffect ( MindlockRuleModifyingEffect effect ) { super(effect); } @@ -86,25 +84,14 @@ class MindlockOrbReplacementEffect extends ReplacementEffectImpl { throw new UnsupportedOperationException("Not supported."); } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if ( event.getType() == EventType.SEARCH_LIBRARY) { - return true; - } - return false; - } - @Override public boolean applies(GameEvent event, Ability source, Game game) { - if ( event.getType() == EventType.SEARCH_LIBRARY ) { - return true; - } - return false; + return event.getType() == EventType.SEARCH_LIBRARY; } @Override - public MindlockOrbReplacementEffect copy() { - return new MindlockOrbReplacementEffect(this); + public MindlockRuleModifyingEffect copy() { + return new MindlockRuleModifyingEffect(this); } }