use FilterLandPermanent's subtype-filtering constructor

This commit is contained in:
Neil Gentleman 2016-07-17 13:58:14 -07:00
parent da07a58a85
commit b919e5907b
13 changed files with 13 additions and 65 deletions

View file

@ -39,7 +39,6 @@ import mage.abilities.effects.common.UntapTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetLandPermanent;
/**
@ -48,11 +47,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class ArborElf extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest");
static {
filter.add(new SubtypePredicate("Forest"));
}
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest", "Forest");
public ArborElf(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");

View file

@ -42,7 +42,6 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@ -53,11 +52,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class AwakenTheAncient extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain");
static {
filter.add(new SubtypePredicate("Mountain"));
}
private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain", "Mountain");
public AwakenTheAncient(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}{R}{R}");

View file

@ -41,7 +41,6 @@ import mage.cards.CardSetInfo;
import mage.constants.Layer;
import mage.constants.SubLayer;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
@ -53,11 +52,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class AwakenerDruid extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest");
static {
filter.add(new SubtypePredicate("Forest"));
}
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest", "Forest");
public AwakenerDruid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");

View file

@ -45,7 +45,6 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@ -56,11 +55,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class GenjuOfTheCedars extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest");
static {
filter.add(new SubtypePredicate("Forest"));
}
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest", "Forest");
public GenjuOfTheCedars(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}");

View file

@ -45,7 +45,6 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@ -56,11 +55,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class GenjuOfTheFalls extends CardImpl {
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Island");
static {
FILTER.add(new SubtypePredicate("Island"));
}
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Island", "Island");
public GenjuOfTheFalls(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{U}");

View file

@ -46,7 +46,6 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@ -57,11 +56,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class GenjuOfTheFens extends CardImpl {
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Swamp");
static {
FILTER.add(new SubtypePredicate("Swamp"));
}
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Swamp", "Swamp");
public GenjuOfTheFens(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}");

View file

@ -48,7 +48,6 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@ -59,11 +58,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class GenjuOfTheFields extends CardImpl {
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Plains");
static {
FILTER.add(new SubtypePredicate("Plains"));
}
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Plains", "Plains");
public GenjuOfTheFields(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}");

View file

@ -44,7 +44,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@ -55,15 +54,13 @@ import mage.target.common.TargetLandPermanent;
*/
public class GenjuOfTheRealm extends CardImpl {
private static final FilterLandPermanent FILTER = new FilterLandPermanent();
public GenjuOfTheRealm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}{U}{B}{R}{G}");
this.subtype.add("Aura");
this.supertype.add("Legendary");
// Enchant Land
TargetPermanent auraTarget = new TargetLandPermanent(FILTER);
TargetPermanent auraTarget = new TargetLandPermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());

View file

@ -44,7 +44,6 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@ -55,11 +54,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class GenjuOfTheSpires extends CardImpl {
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Mountain");
static {
FILTER.add(new SubtypePredicate("Mountain"));
}
private static final FilterLandPermanent FILTER = new FilterLandPermanent("Mountain", "Mountain");
public GenjuOfTheSpires(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}");

View file

@ -68,12 +68,10 @@ import mage.target.common.TargetLandPermanent;
*/
public class KothOfTheHammer extends CardImpl {
static final FilterLandPermanent filter = new FilterLandPermanent("Mountain");
static final FilterLandPermanent filter = new FilterLandPermanent("Mountain", "Mountain");
static final FilterLandPermanent filterCount = new FilterLandPermanent("Mountain you control");
static {
filter.add(new SubtypePredicate("Mountain"));
filterCount.add(new SubtypePredicate("Mountain"));
filterCount.add(new ControllerPredicate(TargetController.YOU));
}

View file

@ -56,7 +56,7 @@ public class LivingTerrain extends CardImpl {
// Enchant land
TargetPermanent auraTarget = new TargetLandPermanent(new FilterLandPermanent());
TargetPermanent auraTarget = new TargetLandPermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay));
Ability ability = new EnchantAbility(auraTarget.getTargetName());

View file

@ -48,7 +48,6 @@ import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterBasicLandCard;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -66,11 +65,10 @@ import mage.target.targetpointer.FixedTarget;
public class NissaWorldwaker extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("land you control");
private static final FilterPermanent filterForest = new FilterPermanent("Forest");
private static final FilterPermanent filterForest = new FilterPermanent("Forest", "Forest");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
filterForest.add(new SubtypePredicate("Forest"));
}
public NissaWorldwaker(UUID ownerId, CardSetInfo setInfo) {

View file

@ -39,7 +39,6 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -51,11 +50,7 @@ import mage.target.common.TargetLandPermanent;
*/
public class VolcanicEruption extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain");
static{
filter.add(new SubtypePredicate(("Mountain")));
}
private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain", "Mountain");
public VolcanicEruption(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{U}{U}");