* Changed two replacement effects to rule modifying effects.

This commit is contained in:
LevelX2 2014-10-23 16:17:50 +02:00
parent 7c36ed4b20
commit a1a54cae14
2 changed files with 14 additions and 34 deletions

View file

@ -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;
}
}

View file

@ -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);
}
}