forked from External/mage
[filters] Replaced Supertype condition with Predicate
This commit is contained in:
parent
dfd2413b89
commit
91d320eed2
40 changed files with 81 additions and 114 deletions
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.WhiteManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -49,14 +50,13 @@ import mage.target.common.TargetControlledPermanent;
|
|||
* @author Loki
|
||||
*/
|
||||
public class FieldmistBorderpost extends CardImpl<FieldmistBorderpost> {
|
||||
private static FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
|
||||
private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand";
|
||||
private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Fieldmist Borderpost's mana cost";
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.RedManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -49,14 +50,13 @@ import mage.target.common.TargetControlledPermanent;
|
|||
* @author Loki
|
||||
*/
|
||||
public class FirewildBorderpost extends CardImpl<FirewildBorderpost> {
|
||||
private static FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
|
||||
private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand";
|
||||
private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Firewild Borderpost's mana cost";
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.BlueManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -55,8 +56,7 @@ public class MistveinBorderpost extends CardImpl<MistveinBorderpost> {
|
|||
private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Mistvein Borderpos's mana cost";
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.RedManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -49,14 +50,13 @@ import mage.target.common.TargetControlledPermanent;
|
|||
* @author Loki
|
||||
*/
|
||||
public class VeinfireBorderpost extends CardImpl<VeinfireBorderpost> {
|
||||
private static FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
|
||||
private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand";
|
||||
private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Veinfire Borderpost's mana cost";
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.WhiteManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -49,14 +50,13 @@ import mage.target.common.TargetControlledPermanent;
|
|||
* @author Loki
|
||||
*/
|
||||
public class WildfieldBorderpost extends CardImpl<WildfieldBorderpost> {
|
||||
private static FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("basic land");
|
||||
|
||||
private static final String COST_DESCRIPTION = "pay {1} and return a basic land you control to its owner's hand";
|
||||
private static final String ALTERNATIVE_COST_DESCRIPTION = "You may pay {1} and return a basic land you control to its owner's hand rather than pay Wildfield Borderpost's mana cost";
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ import mage.Constants.Rarity;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.continious.BoostControlledEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -47,8 +47,7 @@ public class DayOfDestiny extends CardImpl<DayOfDestiny> {
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Legendary creatures");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public DayOfDestiny(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ import mage.Constants.CardType;
|
|||
import mage.Constants.Rarity;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -45,8 +45,7 @@ public class HerosDemise extends CardImpl<HerosDemise> {
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("legendary creature");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public HerosDemise(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -38,8 +38,9 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
|||
import mage.abilities.effects.common.continious.GainControlTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
|
@ -51,9 +52,7 @@ public class BlindWithAnger extends CardImpl<BlindWithAnger> {
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonlegendary creature");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setNotSupertype(true);
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(Predicates.not(new SupertypePredicate("Legendary")));
|
||||
}
|
||||
|
||||
public BlindWithAnger(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ import mage.abilities.costs.mana.ColoredManaCost;
|
|||
import mage.abilities.effects.common.PreventDamageTargetEffect;
|
||||
import mage.abilities.mana.WhiteManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -52,8 +52,7 @@ public class EiganjoCastle extends CardImpl<EiganjoCastle> {
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("legendary creature");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public EiganjoCastle(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapTargetCost;
|
|||
import mage.abilities.effects.common.UntapSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -53,8 +53,7 @@ public class HonorWornShaku extends CardImpl<HonorWornShaku> {
|
|||
static {
|
||||
filter.setTapped(false);
|
||||
filter.setUseTapped(true);
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public HonorWornShaku(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ import mage.abilities.costs.common.TapSourceCost;
|
|||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.abilities.effects.common.PreventDamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
|
@ -55,8 +55,7 @@ public class KitsuneHealer extends CardImpl<KitsuneHealer> {
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("legendary creature");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public KitsuneHealer(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ import mage.abilities.effects.common.continious.BoostAllEffect;
|
|||
import mage.abilities.keyword.ChangelingAbility;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
|
@ -58,8 +58,7 @@ public class KondasBanner extends CardImpl<KondasBanner> {
|
|||
private final static FilterControlledCreaturePermanent legendaryFilter = new FilterControlledCreaturePermanent("Legendary creatures");
|
||||
|
||||
static {
|
||||
legendaryFilter.getSupertype().add("Legendary");
|
||||
legendaryFilter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
legendaryFilter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public KondasBanner(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import mage.abilities.keyword.VigilanceAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -55,8 +56,7 @@ public class KondasHatamoto extends CardImpl<KondasHatamoto>{
|
|||
private static final String rule2 = "As long as you control a legendary Samurai, {this} has vigilance";
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
filter.getSubtype().add("Samurai");
|
||||
filter.setScopeSubtype(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ import mage.abilities.costs.mana.ColoredManaCost;
|
|||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -53,8 +53,7 @@ public class MinamoSchoolAtWatersEdge extends CardImpl<MinamoSchoolAtWatersEdge>
|
|||
private final static FilterPermanent filter = new FilterPermanent("legendary permanent");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ import mage.abilities.costs.mana.ColoredManaCost;
|
|||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -52,8 +52,7 @@ public class OkinaTempleToTheGrandfathers extends CardImpl<OkinaTempleToTheGrand
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("legendary creature");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public OkinaTempleToTheGrandfathers(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
|||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -53,8 +53,7 @@ public class ShinkaTheBloodsoakedKeep extends CardImpl<ShinkaTheBloodsoakedKeep>
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("legendary creature");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public ShinkaTheBloodsoakedKeep(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
|||
import mage.abilities.keyword.FearAbility;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -53,8 +53,7 @@ public class ShizoDeathsStorehouse extends CardImpl<ShizoDeathsStorehouse> {
|
|||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("legendary creature");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public ShizoDeathsStorehouse(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ import mage.abilities.keyword.TrampleAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -62,8 +63,7 @@ public class TenzaGodosMaul extends CardImpl<TenzaGodosMaul> {
|
|||
private final static FilterCreaturePermanent redFilter = new FilterCreaturePermanent("red");
|
||||
|
||||
static {
|
||||
legendaryFilter.getSupertype().add("Legendary");
|
||||
legendaryFilter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
legendaryFilter.add(new SupertypePredicate("Legendary"));
|
||||
redFilter.getColor().setRed(true);
|
||||
redFilter.setUseColor(true);
|
||||
redFilter.setScopeColor(Filter.ComparisonScope.Any);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ import mage.Constants.CardType;
|
|||
import mage.Constants.Rarity;
|
||||
import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -47,9 +47,7 @@ public class TimeOfNeed extends CardImpl<TimeOfNeed> {
|
|||
|
||||
static {
|
||||
filter.getCardType().add(CardType.CREATURE);
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public TimeOfNeed(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ import mage.abilities.TriggeredAbilityImpl;
|
|||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
|
|
@ -55,8 +55,7 @@ public class ZoZuThePunisher extends CardImpl<ZoZuThePunisher> {
|
|||
private final static FilterCard filter = new FilterCard("legendary spell");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public ZoZuThePunisher(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.effects.common.continious.BoostControlledEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -49,7 +48,6 @@ public class GallowsWarden extends CardImpl<GallowsWarden> {
|
|||
|
||||
static {
|
||||
filter.getSubtype().add("Spirit");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
||||
public GallowsWarden(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import mage.abilities.effects.common.continious.BoostControlledEffect;
|
|||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -52,7 +51,6 @@ public class GoblinChieftain extends CardImpl<GoblinChieftain> {
|
|||
|
||||
static {
|
||||
filter.getSubtype().add("Goblin");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
||||
public GoblinChieftain(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
|
@ -56,8 +58,7 @@ public class SurgicalExtraction extends CardImpl<SurgicalExtraction> {
|
|||
private static final FilterCard filter = new FilterCard("card in a graveyard other than a basic land card");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setNotSupertype(true);
|
||||
filter.add(Predicates.not(new SupertypePredicate("Basic")));
|
||||
}
|
||||
|
||||
public SurgicalExtraction(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.keyword.ShroudAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -52,8 +53,7 @@ public class KashiTribeElite extends CardImpl<KashiTribeElite> {
|
|||
private final static FilterControlledPermanent filter = new FilterControlledPermanent("Legendary Snakes");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
filter.getSubtype().add("Snake");
|
||||
filter.setScopeSubtype(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ import mage.MageInt;
|
|||
import mage.abilities.common.SpellCastTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -46,8 +46,7 @@ public class RekiTheHistoryOfKamigawa extends CardImpl<RekiTheHistoryOfKamigawa>
|
|||
private final static FilterSpell filter = new FilterSpell("legendary spell");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Legendary");
|
||||
filter.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public RekiTheHistoryOfKamigawa(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.ColorlessManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter.ComparisonScope;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +55,7 @@ public class BantPanorama extends CardImpl<BantPanorama> {
|
|||
|
||||
static {
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getSubtype().add("Forest");
|
||||
filter.getSubtype().add("Plains");
|
||||
filter.getSubtype().add("Island");
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.ColorlessManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter.ComparisonScope;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +55,7 @@ public class EsperPanorama extends CardImpl<EsperPanorama> {
|
|||
|
||||
static {
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getSubtype().add("Plains");
|
||||
filter.getSubtype().add("Island");
|
||||
filter.getSubtype().add("Swamp");
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.ColorlessManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter.ComparisonScope;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +55,7 @@ public class GrixisPanorama extends CardImpl<GrixisPanorama> {
|
|||
|
||||
static {
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getSubtype().add("Island");
|
||||
filter.getSubtype().add("Swamp");
|
||||
filter.getSubtype().add("Mountain");
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import mage.abilities.mana.ColorlessManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -55,7 +56,7 @@ public class JundPanorama extends CardImpl<JundPanorama> {
|
|||
|
||||
static {
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getSubtype().add("Swamp");
|
||||
filter.getSubtype().add("Mountain");
|
||||
filter.getSubtype().add("Forest");
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.mana.ColorlessManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter.ComparisonScope;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +55,7 @@ public class NayaPanorama extends CardImpl<NayaPanorama> {
|
|||
|
||||
static {
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getSubtype().add("Mountain");
|
||||
filter.getSubtype().add("Forest");
|
||||
filter.getSubtype().add("Plains");
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import mage.cards.CardImpl;
|
|||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
|
|
@ -58,8 +59,7 @@ public class Earthcraft extends CardImpl<Earthcraft> {
|
|||
filterCreature.setScopeSubtype(Filter.ComparisonScope.Any);
|
||||
filterLand.getCardType().add(CardType.LAND);
|
||||
filterLand.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
filterLand.getSupertype().add("Basic");
|
||||
filterLand.setScopeSupertype(Filter.ComparisonScope.Any);
|
||||
filterLand.add(new SupertypePredicate("Basic"));
|
||||
}
|
||||
|
||||
public Earthcraft(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@ import mage.abilities.costs.common.TapSourceCost;
|
|||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -48,11 +49,10 @@ import mage.target.common.TargetLandPermanent;
|
|||
* @author Loki
|
||||
*/
|
||||
public class Wasteland extends CardImpl<Wasteland> {
|
||||
private static FilterLandPermanent filter = new FilterLandPermanent("nonbasic land");
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic land");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setNotSupertype(true);
|
||||
filter.add(Predicates.not(new SupertypePredicate("Basic")));
|
||||
}
|
||||
|
||||
public Wasteland(UUID ownerId) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ class HammerOfRuinTriggeredAbility extends TriggeredAbilityImpl<HammerOfRuinTrig
|
|||
super(Zone.BATTLEFIELD, new DestroyTargetEffect(), true);
|
||||
FilterPermanent filter = new FilterPermanent("Equipment that player controls");
|
||||
filter.getSubtype().add("Equipment");
|
||||
filter.setScopeSupertype(mage.filter.Filter.ComparisonScope.Any);
|
||||
this.addTarget(new TargetPermanent(filter));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -47,7 +48,7 @@ public class PilgrimsEye extends CardImpl<PilgrimsEye> {
|
|||
private static final FilterCard filter = new FilterCard("basic land card");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ import mage.abilities.keyword.EquipAbility;
|
|||
import mage.abilities.keyword.LandwalkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -73,7 +75,7 @@ class NonbasicLandwalkAbility extends LandwalkAbility {
|
|||
private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic land");
|
||||
|
||||
static {
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.add(Predicates.not(new SupertypePredicate("Basic")));
|
||||
}
|
||||
|
||||
public NonbasicLandwalkAbility() {
|
||||
|
|
|
|||
|
|
@ -61,9 +61,6 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
|
|||
protected List<String> subtype = new ArrayList<String>();
|
||||
protected ComparisonScope scopeSubtype = ComparisonScope.All;
|
||||
protected boolean notSubtype;
|
||||
protected List<String> supertype = new ArrayList<String>();
|
||||
protected ComparisonScope scopeSupertype = ComparisonScope.Any;
|
||||
protected boolean notSupertype;
|
||||
|
||||
/**
|
||||
* Indicates that filter shouldn't match the source.
|
||||
|
|
@ -98,9 +95,6 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
|
|||
this.subtype.addAll(filter.subtype);
|
||||
this.scopeSubtype = filter.scopeSubtype;
|
||||
this.notSubtype = filter.notSubtype;
|
||||
this.supertype.addAll(filter.supertype);
|
||||
this.scopeSupertype = filter.scopeSupertype;
|
||||
this.notSupertype = filter.notSupertype;
|
||||
this.another = filter.another;
|
||||
}
|
||||
|
||||
|
|
@ -148,11 +142,6 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
|
|||
}
|
||||
}
|
||||
|
||||
if (supertype.size() > 0) {
|
||||
if (!compString.compare(supertype, object.getSupertype(), scopeSupertype, notSupertype))
|
||||
return notFilter;
|
||||
}
|
||||
|
||||
if (abilities.size() > 0) {
|
||||
List<Ability> test = new ArrayList<Ability>(abilities);
|
||||
for (Ability ability: object.getAbilities()) {
|
||||
|
|
@ -222,18 +211,6 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
|
|||
this.notSubtype = notSubtype;
|
||||
}
|
||||
|
||||
public List<String> getSupertype() {
|
||||
return this.supertype;
|
||||
}
|
||||
|
||||
public void setScopeSupertype(ComparisonScope scopeSupertype) {
|
||||
this.scopeSupertype = scopeSupertype;
|
||||
}
|
||||
|
||||
public void setNotSupertype(boolean notSupertype) {
|
||||
this.notSupertype = notSupertype;
|
||||
}
|
||||
|
||||
public void setUseColor(boolean useColor) {
|
||||
this.useColor = useColor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ package mage.filter.common;
|
|||
|
||||
import mage.Constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -41,8 +42,7 @@ public class FilterBasicLandCard extends FilterCard<FilterBasicLandCard> {
|
|||
super("basic land card");
|
||||
this.cardType.add(CardType.LAND);
|
||||
this.setScopeCardType(ComparisonScope.Any);
|
||||
this.supertype.add("Basic");
|
||||
this.setScopeSupertype(ComparisonScope.Any);
|
||||
this.add(new SupertypePredicate("Basic"));
|
||||
}
|
||||
|
||||
public FilterBasicLandCard(final FilterBasicLandCard filter) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
package mage.filter.common;
|
||||
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -42,7 +43,7 @@ public class FilterLegendaryPermanent extends FilterPermanent<FilterLegendaryPer
|
|||
|
||||
public FilterLegendaryPermanent(String name) {
|
||||
super(name);
|
||||
this.supertype.add("Legendary");
|
||||
this.add(new SupertypePredicate("Legendary"));
|
||||
}
|
||||
|
||||
public FilterLegendaryPermanent(final FilterLegendaryPermanent filter) {
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ import mage.game.Game;
|
|||
*
|
||||
* @author North
|
||||
*/
|
||||
public class Supertype<T extends MageObject> implements Predicate<T> {
|
||||
public class SupertypePredicate<T extends MageObject> implements Predicate<T> {
|
||||
|
||||
private final String supertype;
|
||||
|
||||
public Supertype(String supertype) {
|
||||
public SupertypePredicate(String supertype) {
|
||||
this.supertype = supertype;
|
||||
}
|
||||
|
||||
|
|
@ -31,6 +31,7 @@ package mage.target.common;
|
|||
import mage.Constants.CardType;
|
||||
import mage.Constants.Zone;
|
||||
import mage.filter.Filter.ComparisonScope;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
/**
|
||||
|
|
@ -41,8 +42,7 @@ public class TargetBasicLandCard extends TargetCard<TargetBasicLandCard> {
|
|||
|
||||
public TargetBasicLandCard(Zone zone) {
|
||||
super(zone);
|
||||
filter.getSupertype().add("Basic");
|
||||
filter.setScopeSupertype(ComparisonScope.Any);
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.setScopeCardType(ComparisonScope.Any);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue