refactor filters to staticfilters

This commit is contained in:
igoudt 2017-07-11 00:18:24 +02:00
parent b7159d7d2c
commit f2aa948c74
54 changed files with 218 additions and 208 deletions

View file

@ -33,7 +33,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -78,7 +78,7 @@ class AcidicSoilEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game);
List<Permanent> permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game);
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {

View file

@ -31,7 +31,7 @@ import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -46,7 +46,7 @@ public class Armageddon extends CardImpl {
// Destroy all lands.
this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent("lands")));
this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS));
}
public Armageddon(final Armageddon card) {

View file

@ -38,6 +38,7 @@ import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import java.util.UUID;
@ -55,7 +56,7 @@ public class BlanketOfNight extends CardImpl {
// Each land is a Swamp in addition to its other land types.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new BlackManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent(),
"Each land is a Swamp in addition to its other land types"));
ability.addEffect(new AddCardSubtypeAllEffect(new FilterLandPermanent(), "Swamp", DependencyType.BecomeSwamp));
ability.addEffect(new AddCardSubtypeAllEffect(StaticFilters.FILTER_LAND, "Swamp", DependencyType.BecomeSwamp));
this.addAbility(ability);
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.b;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
@ -36,10 +35,13 @@ import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.SpellAbilityType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
public class BoomBust extends SplitCard {
private static final FilterLandPermanent filter1 = new FilterLandPermanent("land you control");
@ -63,7 +65,7 @@ public class BoomBust extends SplitCard {
// Bust
// Destroy all lands.
getRightHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent()));
getRightHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS));
}

View file

@ -34,7 +34,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@ -48,13 +48,12 @@ import java.util.UUID;
public class BurningSands extends CardImpl {
private final UUID originalId;
private static final FilterLandPermanent filter = new FilterLandPermanent();
public BurningSands(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}{R}");
// Whenever a creature dies, that creature's controller sacrifices a land.
Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(filter, 1, "that creature's controller"), false, false, true);
Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "that creature's controller"), false, false, true);
originalId = ability.getOriginalId();
this.addAbility(ability);
}

View file

@ -35,7 +35,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -48,7 +48,7 @@ public class ChromaticLantern extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
// Lands you control have "{T}: Add one mana of any color to your mana pool."
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent("Lands"), false)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, StaticFilters.FILTER_LANDS, false)));
// {T}: Add one mana of any color to your mana pool.
this.addAbility(new AnyColorManaAbility());

View file

@ -27,7 +27,6 @@
*/
package mage.cards.c;
import mage.constants.ComparisonType;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.InvertCondition;
@ -39,7 +38,8 @@ import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.constants.ComparisonType;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -53,7 +53,7 @@ public class ConcealedCourtyard extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
// Concealed Courtyard enters the battlefield tapped unless you control two or fewer other lands.
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.FEWER_THAN, 3));
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3));
String abilityText = "tapped unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));

View file

@ -27,7 +27,6 @@
*/
package mage.cards.c;
import mage.constants.ComparisonType;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.InvertCondition;
@ -39,7 +38,8 @@ import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.constants.ComparisonType;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -48,14 +48,11 @@ import java.util.UUID;
* @author maurer.it_at_gmail.com
*/
public class CopperlineGorge extends CardImpl {
private static FilterLandPermanent filter = new FilterLandPermanent();
public CopperlineGorge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},null);
// Copperline Gorge enters the battlefield tapped unless you control two or fewer other lands.
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3));
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3));
String abilityText = "tapped unless you control two or fewer other lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new RedManaAbility());

View file

@ -28,25 +28,25 @@
package mage.cards.d;
import mage.abilities.Ability;
import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
import java.util.UUID;
/**
*
@ -64,7 +64,7 @@ public class DecreeOfAnnihilation extends CardImpl {
this.addAbility(new CyclingAbility(new ManaCostsImpl("{5}{R}{R}")));
// When you cycle Decree of Annihilation, destroy all lands.
Ability ability = new CycleTriggeredAbility(new DestroyAllEffect(new FilterLandPermanent("lands")), false);
Ability ability = new CycleTriggeredAbility(new DestroyAllEffect(StaticFilters.FILTER_LANDS), false);
this.addAbility(ability);
}

View file

@ -38,6 +38,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -48,7 +49,6 @@ import java.util.UUID;
*/
public class DesolationAngel extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("lands");
private static final FilterLandPermanent filter2 = new FilterLandPermanent("lands you control");
static {
@ -69,7 +69,7 @@ public class DesolationAngel extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Desolation Angel enters the battlefield, destroy all lands you control. If it was kicked, destroy all lands instead.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyAllEffect(filter),
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS),
new DestroyAllEffect(filter2), KickedCondition.instance, "destroy all lands you control. If it was kicked, destroy all lands instead.")));
}

View file

@ -34,7 +34,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -54,7 +54,7 @@ public class FoulSpirit extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Foul Spirit enters the battlefield, sacrifice a land.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false));
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, ""), false));
}
public FoulSpirit(final FoulSpirit card) {

View file

@ -35,7 +35,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
@ -61,7 +61,7 @@ public class GiftOfEstates extends CardImpl {
// If an opponent controls more lands than you, search your library for up to three Plains cards, reveal them, and put them into your hand. Then shuffle your library.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, filter), true),
new OpponentControlsMoreCondition(new FilterLandPermanent("lands"))));
new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS)));
}
public GiftOfEstates(final GiftOfEstates card) {

View file

@ -39,8 +39,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterSpell;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -108,7 +108,7 @@ class GainControlAllLandsEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (targetPlayer != null && targetPlayer.isInGame()) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), targetPointer.getFirst(game, source), game)) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LANDS, targetPointer.getFirst(game, source), game)) {
if (permanent != null) {
permanent.changeControllerId(source.getControllerId(), game);
}

View file

@ -35,8 +35,8 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SubTypeSet;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -104,7 +104,7 @@ class GlobalRuinDestroyLandEffect extends OneShotEffect {
}
}
}
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), game)) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LAND, game)) {
if (!lands.contains(permanent.getId())) {
permanent.sacrifice(permanent.getId(), game);
}

View file

@ -33,7 +33,7 @@ import mage.abilities.effects.common.SacrificeControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -50,7 +50,7 @@ public class GoblinFirebug extends CardImpl {
this.toughness = new MageInt(2);
// When Goblin Firebug leaves the battlefield, sacrifice a land.
this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false));
this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, ""), false));
}
public GoblinFirebug(final GoblinFirebug card) {

View file

@ -34,7 +34,7 @@ import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.target.TargetPlayer;
import java.util.UUID;
@ -53,7 +53,7 @@ public class GulfSquid extends CardImpl {
this.toughness = new MageInt(2);
// When Gulf Squid enters the battlefield, tap all lands target player controls.
Ability ability = new EntersBattlefieldTriggeredAbility(new TapAllTargetPlayerControlsEffect(new FilterLandPermanent("lands")));
Ability ability = new EntersBattlefieldTriggeredAbility(new TapAllTargetPlayerControlsEffect(StaticFilters.FILTER_LANDS));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
@ -60,7 +61,7 @@ public class HokoriDustDrinker extends CardImpl {
this.toughness = new MageInt(2);
// Lands don't untap during their controllers' untap steps.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterLandPermanent("Lands"))));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, StaticFilters.FILTER_LANDS)));
// At the beginning of each player's upkeep, that player untaps a land he or she controls.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new HokoriDustDrinkerUntapEffect(), TargetController.ANY, false));

View file

@ -27,9 +27,6 @@
*/
package mage.cards.i;
import java.util.UUID;
import mage.constants.ComparisonType;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.InvertCondition;
@ -41,19 +38,21 @@ import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.constants.ComparisonType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class InspiringVantage extends CardImpl {
public InspiringVantage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// Inspiring Vantage enters the battlefield tapped unless you control two or fewer other lands.
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.FEWER_THAN, 3));
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3));
String abilityText = "tapped unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));

View file

@ -27,18 +27,18 @@
*/
package mage.cards.j;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.mana.AnyColorManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
@ -53,7 +53,7 @@ public class JoinerAdept extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent(), false)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, StaticFilters.FILTER_LANDS, false)));
}
public JoinerAdept(final JoinerAdept card) {

View file

@ -28,8 +28,6 @@
package mage.cards.k;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.OpponentControlsMoreCondition;
@ -38,11 +36,14 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterBySubtypeCard;
import mage.filter.common.FilterLandPermanent;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -63,7 +64,7 @@ public class KnightOfTheWhiteOrchid extends CardImpl {
// When Knight of the White Orchid enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library.
this.addAbility(new ConditionalTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, new FilterBySubtypeCard(SubType.PLAINS)), false), true),
new OpponentControlsMoreCondition(new FilterLandPermanent("lands")),
new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS),
"When {this} enters the battlefield, if an opponent controls more lands than you, you may search your library for a Plains card, put it onto the battlefield, then shuffle your library"));
}

View file

@ -27,19 +27,20 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author spjspj
@ -65,10 +66,8 @@ public class LandEquilibrium extends CardImpl {
class LandEquilibriumAbility extends TriggeredAbilityImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("land");
public LandEquilibriumAbility() {
super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterLandPermanent(), 1, ""), false);
super(Zone.BATTLEFIELD, new SacrificeEffect(StaticFilters.FILTER_LAND, 1, ""), false);
}
public LandEquilibriumAbility(final LandEquilibriumAbility ability) {
@ -87,8 +86,8 @@ class LandEquilibriumAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
int numMyLands = game.getBattlefield().countAll(filter, this.getControllerId(), game);
int theirLands = game.getBattlefield().countAll(filter, event.getPlayerId(), game);
int numMyLands = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, this.getControllerId(), game);
int theirLands = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, event.getPlayerId(), game);
if (numMyLands < theirLands) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
return true;

View file

@ -27,7 +27,6 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.OpponentControlsMoreCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
@ -36,10 +35,12 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterBasicLandCard;
import mage.filter.common.FilterLandPermanent;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
*
* @author LevelX2
@ -52,7 +53,7 @@ public class LandTax extends CardImpl {
// At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library.
this.addAbility(new ConditionalTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true), TargetController.YOU, true),
new OpponentControlsMoreCondition(new FilterLandPermanent("lands")),
new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS),
"At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library"
));

View file

@ -27,8 +27,6 @@
*/
package mage.cards.l;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility;
@ -38,13 +36,16 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetLandPermanent;
import mage.watchers.common.PermanentsEnteredBattlefieldWatcher;
import java.util.List;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -61,7 +62,7 @@ public class LavaballTrap extends CardImpl {
// Destroy two target lands. Lavaball Trap deals 4 damage to each creature.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addEffect(new DamageAllEffect(4, new FilterCreaturePermanent()));
this.getSpellAbility().addTarget(new TargetLandPermanent(2, 2, new FilterLandPermanent("lands"), false));
this.getSpellAbility().addTarget(new TargetLandPermanent(2, 2, StaticFilters.FILTER_LANDS, false));
}

View file

@ -39,7 +39,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
@ -82,7 +82,7 @@ class LiegeOfTheTangleTriggeredAbility extends TriggeredAbilityImpl {
LiegeOfTheTangleTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.AWAKENING.createInstance()));
this.addEffect(new LiegeOfTheTangleEffect());
Target target = new TargetLandPermanent(0, Integer.MAX_VALUE, new FilterLandPermanent(), true);
Target target = new TargetLandPermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_LANDS, true);
this.addTarget(target);
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect;
@ -37,9 +36,11 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.permanent.token.Token;
import java.util.UUID;
/**
*
* @author fireshoes
@ -51,7 +52,7 @@ public class LivingPlane extends CardImpl {
this.addSuperType(SuperType.WORLD);
// All lands are 1/1 creatures that are still lands.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new LivingPlaneToken(), "lands", new FilterLandPermanent("lands"), Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new LivingPlaneToken(), "lands", StaticFilters.FILTER_LANDS, Duration.WhileOnBattlefield)));
}
public LivingPlane(final LivingPlane card) {

View file

@ -27,7 +27,6 @@
*/
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -39,10 +38,12 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
* @author duncant
*/
@ -72,7 +73,7 @@ public class MagusOfTheCandelabra extends CardImpl {
if (ability.getOriginalId().equals(originalId)){
int xValue = ability.getManaCostsToPay().getX();
ability.getTargets().clear();
ability.addTarget(new TargetLandPermanent(xValue, xValue, new FilterLandPermanent(), false));
ability.addTarget(new TargetLandPermanent(xValue, xValue, StaticFilters.FILTER_LANDS, false));
}
}

View file

@ -27,17 +27,18 @@
*/
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
*
* @author Quercitron
@ -65,7 +66,7 @@ public class ManaShort extends CardImpl {
class ManaShortEffect extends TapAllTargetPlayerControlsEffect {
public ManaShortEffect() {
super(new FilterLandPermanent("lands"));
super(StaticFilters.FILTER_LANDS);
staticText = "Tap all lands target player controls and empty his or her mana pool";
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.StateTriggeredAbility;
@ -43,8 +42,8 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
@ -52,13 +51,13 @@ import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class ManaVortex extends CardImpl {
static final FilterLandPermanent filter = new FilterLandPermanent();
public ManaVortex(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}{U}");
@ -67,7 +66,7 @@ public class ManaVortex extends CardImpl {
this.addAbility(new CastSourceTriggeredAbility(new CounterSourceEffect()));
// At the beginning of each player's upkeep, that player sacrifices a land.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(new FilterLandPermanent(), 1, "that player"),
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "that player"),
TargetController.ANY, false));
// When there are no lands on the battlefield, sacrifice Mana Vortex.
@ -151,7 +150,7 @@ class ManaVortexStateTriggeredAbility extends StateTriggeredAbility {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return game.getBattlefield().count(ManaVortex.filter, this.getSourceId(), this.getControllerId(), game) == 0;
return game.getBattlefield().count(StaticFilters.FILTER_LANDS, this.getSourceId(), this.getControllerId(), game) == 0;
}
@Override

View file

@ -27,7 +27,6 @@
*/
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
@ -38,10 +37,12 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
@ -66,7 +67,7 @@ public class MishrasHelix extends CardImpl {
if (ability.getOriginalId().equals(originalId)){
int xValue = ability.getManaCostsToPay().getX();
ability.getTargets().clear();
ability.addTarget(new TargetLandPermanent(xValue, xValue, new FilterLandPermanent(), false));
ability.addTarget(new TargetLandPermanent(xValue, xValue, StaticFilters.FILTER_LANDS, false));
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.ZoneChangeTriggeredAbility;
import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect;
@ -39,12 +38,14 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
*
* @author LevelX2
@ -84,7 +85,7 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility {
public MistbindCliqueAbility() {
// ability has to trigger independant where the source object is now
super(Zone.ALL, Zone.BATTLEFIELD, Zone.EXILED, new TapAllTargetPlayerControlsEffect(new FilterLandPermanent("lands")), "When a Faerie is championed with {this}, ", false);
super(Zone.ALL, Zone.BATTLEFIELD, Zone.EXILED, new TapAllTargetPlayerControlsEffect(StaticFilters.FILTER_LANDS), "When a Faerie is championed with {this}, ", false);
this.addTarget(new TargetPlayer());
}

View file

@ -47,7 +47,7 @@ import mage.constants.Duration;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.watchers.common.CastFromHandWatcher;
import java.util.UUID;
@ -57,8 +57,6 @@ import java.util.UUID;
*/
public class MyojinOfInfiniteRage extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("lands");
public MyojinOfInfiniteRage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{7}{R}{R}{R}");
addSuperType(SuperType.LEGENDARY);
@ -75,7 +73,7 @@ public class MyojinOfInfiniteRage extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield),
new SourceHasCounterCondition(CounterType.DIVINITY), "{this} is indestructible as long as it has a divinity counter on it")));
// Remove a divinity counter from Myojin of Infinite Rage: Destroy all lands.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAllEffect(filter), new RemoveCountersSourceCost(CounterType.DIVINITY.createInstance())));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAllEffect(StaticFilters.FILTER_LANDS), new RemoveCountersSourceCost(CounterType.DIVINITY.createInstance())));
}
public MyojinOfInfiniteRage(final MyojinOfInfiniteRage card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
@ -152,8 +152,7 @@ class NaturesWillEffect extends OneShotEffect {
return false;
}
FilterLandPermanent filter = new FilterLandPermanent();
List<Permanent> lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
List<Permanent> lands = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game);
for (Permanent land : lands) {
if (damagedPlayers.contains(land.getControllerId())) {
land.tap(game);

View file

@ -27,7 +27,6 @@
*/
package mage.cards.n;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
@ -41,13 +40,15 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.*;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.NissaSageAnimistToken;
import mage.players.Player;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author emerald000
@ -71,7 +72,7 @@ public class NissaSageAnimist extends CardImpl {
// -7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.
Ability ability = new LoyaltyAbility(new UntapTargetEffect(), -7);
ability.addTarget(new TargetLandPermanent(0, 6, new FilterLandPermanent("lands"), false));
ability.addTarget(new TargetLandPermanent(0, 6, StaticFilters.FILTER_LANDS, false));
ability.addEffect(new NissaSageAnimistMinusSevenEffect());
this.addAbility(ability);
}

View file

@ -39,7 +39,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
@ -65,7 +65,7 @@ public class NumotTheDevastator extends CardImpl {
effect.setText("destroy up to two target lands");
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(
new DoIfCostPaid(effect, new ManaCostsImpl("{2}{R}")), false);
ability.addTarget(new TargetLandPermanent(0,2, new FilterLandPermanent("lands"), false));
ability.addTarget(new TargetLandPermanent(0,2, StaticFilters.FILTER_LANDS, false));
this.addAbility(ability);
}

View file

@ -27,14 +27,15 @@
*/
package mage.cards.p;
import java.util.UUID;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author Plopman
@ -47,7 +48,7 @@ public class PlowUnder extends CardImpl {
// Put two target lands on top of their owners' libraries.
this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true));
this.getSpellAbility().addTarget(new TargetLandPermanent(2,2, new FilterLandPermanent("lands"), false));
this.getSpellAbility().addTarget(new TargetLandPermanent(2,2, StaticFilters.FILTER_LANDS, false));
}
public PlowUnder(final PlowUnder card) {

View file

@ -27,12 +27,13 @@
*/
package mage.cards.r;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
@ -45,7 +46,7 @@ public class RavagesOfWar extends CardImpl {
// Destroy all lands.
this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent("lands")));
this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS));
}
public RavagesOfWar(final RavagesOfWar card) {

View file

@ -27,9 +27,6 @@
*/
package mage.cards.r;
import java.util.UUID;
import mage.constants.ComparisonType;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.InvertCondition;
@ -41,7 +38,10 @@ import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.constants.ComparisonType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
@ -49,12 +49,10 @@ import mage.filter.common.FilterLandPermanent;
*/
public class RazorvergeThicket extends CardImpl {
private static FilterLandPermanent filter = new FilterLandPermanent();
public RazorvergeThicket(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},null);
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3));
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3));
String abilityText = "tap it unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));

View file

@ -27,7 +27,6 @@
*/
package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -35,11 +34,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
@ -48,6 +44,8 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
@ -59,7 +57,7 @@ public class RisingWaters extends CardImpl {
// Lands don't untap during their controllers' untap steps.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterLandPermanent("Lands"))));
new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, StaticFilters.FILTER_LANDS)));
// At the beginning of each player's upkeep, that player untaps a land he or she controls.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new RisingWatersUntapEffect(), TargetController.ANY, false));

View file

@ -27,7 +27,6 @@
*/
package mage.cards.r;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
@ -35,13 +34,14 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author Plopman
@ -69,10 +69,6 @@ public class Rivalry extends CardImpl {
class RivalryTriggeredAbility extends TriggeredAbilityImpl {
private static final FilterPermanent filter = new FilterLandPermanent();
public RivalryTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(2), false);
}
@ -104,10 +100,10 @@ class RivalryTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkInterveningIfClause(Game game) {
UUID player = game.getActivePlayerId();
int land = game.getBattlefield().countAll(filter, player, game);
int land = game.getBattlefield().countAll(StaticFilters.FILTER_LAND, player, game);
if(player != null){
for(UUID opponent : game.getOpponents(player)){
if(land <= game.getBattlefield().countAll(filter, opponent, game)){
if(land <= game.getBattlefield().countAll(StaticFilters.FILTER_LAND, opponent, game)){
return false;
}
}

View file

@ -27,14 +27,15 @@
*/
package mage.cards.r;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.SacrificeControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.common.FilterLandPermanent;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
@ -51,7 +52,7 @@ public class RuinousMinotaur extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Ruinous Minotaur deals damage to an opponent, sacrifice a land.
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false, false));
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, ""), false, false));
}

View file

@ -27,9 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.constants.ComparisonType;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.InvertCondition;
@ -41,21 +38,21 @@ import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.constants.ComparisonType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
* @author maurer.it_at_gmail.com
*/
public class SeachromeCoast extends CardImpl {
private static FilterLandPermanent filter = new FilterLandPermanent();
public SeachromeCoast(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},null);
// Seachrome Coast enters the battlefield tapped unless you control two or fewer other lands.
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3));
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3));
String abilityText = "tap it unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));

View file

@ -27,7 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.CreateTokenTargetEffect;
import mage.cards.CardImpl;
@ -35,9 +34,11 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.permanent.token.SnakeToken;
import java.util.UUID;
/**
*
* @author LevelX2
@ -49,7 +50,7 @@ public class SeedTheLand extends CardImpl {
// Whenever a land enters the battlefield, its controller creates a 1/1 green Snake creature token.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD,
new CreateTokenTargetEffect(new SnakeToken()), new FilterLandPermanent(), false, SetTargetPointer.PLAYER,
new CreateTokenTargetEffect(new SnakeToken()), StaticFilters.FILTER_LAND, false, SetTargetPointer.PLAYER,
"Whenever a land enters the battlefield, its controller creates a 1/1 green Snake creature token."));
}

View file

@ -29,7 +29,6 @@ package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -38,10 +37,11 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -68,7 +68,7 @@ public class SerendibDjinn extends CardImpl {
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SerendibDjinnEffect(), TargetController.YOU, false));
// When you control no lands, sacrifice Serendib Djinn.
this.addAbility(new ControlsPermanentsControllerTriggeredAbility(
new FilterLandPermanent(), ComparisonType.EQUAL_TO, 0,
StaticFilters.FILTER_LANDS, ComparisonType.EQUAL_TO, 0,
new SacrificeSourceEffect()));
}

View file

@ -27,9 +27,7 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
@ -43,19 +41,21 @@ import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.NamePredicate;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class ShelteredValley extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent();
private static final FilterPermanent filterShelteredValley = new FilterPermanent("permanent named Sheltered Valley");
static {
@ -72,7 +72,7 @@ public class ShelteredValley extends CardImpl {
this.addAbility(ability);
// At the beginning of your upkeep, if you control three or fewer lands, you gain 1 life.
Condition controls = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 4);
Condition controls = new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 4);
effect = new ConditionalOneShotEffect(new GainLifeEffect(1), controls);
effect.setText("if you control three or fewer lands, you gain 1 life");
ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false);

View file

@ -27,9 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.constants.ComparisonType;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.InvertCondition;
@ -41,7 +38,10 @@ import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.constants.ComparisonType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
@ -53,7 +53,7 @@ public class SpirebluffCanal extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
// Spirebluff Canal enters the battlefield tapped unless you control two or fewer other lands.
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.FEWER_THAN, 3));
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.FEWER_THAN, 3));
String abilityText = "tapped unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));

View file

@ -28,14 +28,15 @@
package mage.cards.s;
import java.util.UUID;
import mage.constants.CardType;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.common.FilterLandPermanent;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
*
* @author Loki
@ -45,7 +46,7 @@ public class StoneRain extends CardImpl {
public StoneRain (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}");
this.getSpellAbility().addTarget(new TargetPermanent(new FilterLandPermanent()));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_LAND));
this.getSpellAbility().addEffect(new DestroyTargetEffect());
}

View file

@ -27,16 +27,17 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.constants.CardType;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.target.TargetPlayer;
import java.util.UUID;
/**
*
* @author Plopman
@ -49,7 +50,7 @@ public class StructuralCollapse extends CardImpl {
// Target player sacrifices an artifact and a land. Structural Collapse deals 2 damage to that player.
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterArtifactPermanent(), 1, "Target player"));
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterLandPermanent(), 1, "Target player"));
this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_LANDS, 1, "Target player"));
this.getSpellAbility().addEffect(new DamageTargetEffect(2));
this.getSpellAbility().addTarget(new TargetPlayer());
}

View file

@ -27,12 +27,13 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
@ -44,7 +45,7 @@ public class Sunder extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}{U}");
// Return all lands to their owners' hands.
this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(new FilterLandPermanent("lands")));
this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(StaticFilters.FILTER_LANDS));
}
public Sunder(final Sunder card) {

View file

@ -28,9 +28,7 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.condition.common.OpponentControlsPermanentCondition;
import mage.abilities.costs.Cost;
@ -43,11 +41,15 @@ import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.target.common.TargetNonBasicLandPermanent;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -87,7 +89,6 @@ public class TectonicEdge extends CardImpl {
class TectonicEdgeCost extends CostImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent();
public TectonicEdgeCost() {
this.text = "Activate this ability only if an opponent controls four or more lands";
@ -105,7 +106,7 @@ class TectonicEdgeCost extends CostImpl {
@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
for (UUID opponentId: game.getOpponents(controllerId)) {
if (game.getBattlefield().countAll(filter, opponentId, game) > 3) {
if (game.getBattlefield().countAll(StaticFilters.FILTER_LANDS, opponentId, game) > 3) {
return true;
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.t;
import java.util.UUID;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect;
import mage.cards.CardImpl;
@ -35,8 +34,11 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandPermanent;
import java.util.UUID;
/**
*
* @author LoneFox
@ -49,7 +51,7 @@ public class TectonicInstability extends CardImpl {
// Whenever a land enters the battlefield, tap all lands its controller controls.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD,
new TapAllTargetPlayerControlsEffect(new FilterLandPermanent()), new FilterLandPermanent(),
new TapAllTargetPlayerControlsEffect(new FilterLandPermanent()), StaticFilters.FILTER_LANDS,
false, SetTargetPointer.PLAYER, "Whenever a land enters the battlefield, tap all lands its controller controls."));
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.t;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
@ -37,11 +35,14 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.List;
import java.util.UUID;
/**
*
* @author Styxo
@ -81,7 +82,7 @@ class TreacherousTerrainEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game);
List<Permanent> permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game);
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(playerId);
if (player != null) {

View file

@ -27,9 +27,6 @@
*/
package mage.cards.w;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
@ -39,10 +36,14 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandCard;
import mage.filter.common.FilterLandPermanent;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
*
* @author LevelX2
@ -63,7 +64,7 @@ public class WeatheredWayfarer extends CardImpl {
Zone.BATTLEFIELD,
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterLandCard()), true, true),
new ManaCostsImpl("{W}"),
new OpponentControlsMoreCondition(new FilterLandPermanent("lands")));
new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}

View file

@ -27,10 +27,8 @@
*/
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.constants.ComparisonType;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
@ -40,9 +38,12 @@ import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
@ -58,7 +59,7 @@ public class WoodbornBehemoth extends CardImpl {
this.toughness = new MageInt(4);
// As long as you control eight or more lands, Woodborn Behemoth gets +4/+4 and has trample.
PermanentsOnTheBattlefieldCondition eightOrMoreLandCondition = new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), ComparisonType.MORE_THAN,7);
PermanentsOnTheBattlefieldCondition eightOrMoreLandCondition = new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LANDS, ComparisonType.MORE_THAN,7);
ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(
new BoostSourceEffect(4,4, Duration.WhileOnBattlefield), eightOrMoreLandCondition,
"As long as you control eight or more lands, {this} gets +4/+4");

View file

@ -38,6 +38,9 @@ public final class StaticFilters {
public static final FilterControlledPermanent FILTER_CONTROLLED_A_CREATURE = new FilterControlledCreaturePermanent("a creature you control");
public static final FilterControlledCreaturePermanent FILTER_CONTROLLED_ANOTHER_CREATURE = new FilterControlledCreaturePermanent("another creature");
public static final FilterControlledPermanent FILTER_CONTROLLED_PERMANENT_NON_LAND = new FilterControlledPermanent("nonland permanent");
public static final FilterLandPermanent FILTER_LAND = new FilterLandPermanent();
public static final FilterLandPermanent FILTER_LANDS = new FilterLandPermanent("lands");
public static final FilterLandPermanent FILTER_BASIC_LAND = new FilterLandPermanent();
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE = new FilterCreaturePermanent();
public static final FilterCreaturePermanent FILTER_PERMANENT_A_CREATURE = new FilterCreaturePermanent("a creature");
@ -62,6 +65,8 @@ public final class StaticFilters {
static {
FILTER_CONTROLLED_PERMANENT_NON_LAND.add(
Predicates.not(new CardTypePredicate(CardType.LAND)));
FILTER_CREATURE_TOKENS.add(new TokenPredicate());
FILTER_ATTACKING_CREATURES.add(new AttackingPredicate());