forked from External/mage
new StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND
This commit is contained in:
parent
0b802b5992
commit
3eaf80cfa6
12 changed files with 36 additions and 120 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -12,8 +11,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -22,28 +20,21 @@ import mage.target.TargetPermanent;
|
|||
*/
|
||||
public final class BrinkOfDisaster extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
CardType.CREATURE.getPredicate(),
|
||||
CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public BrinkOfDisaster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{B}");
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
|
||||
// Enchant creature or land
|
||||
TargetPermanent auraTarget = new TargetPermanent(filter);
|
||||
TargetPermanent auraTarget = new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND);
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
this.addAbility(ability);
|
||||
|
||||
// When enchanted permanent becomes tapped, destroy it.
|
||||
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DestroyAttachedToEffect("it"), "").setTriggerPhrase("When enchanted permanent becomes tapped, "));
|
||||
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DestroyAttachedToEffect("it"), "")
|
||||
.setTriggerPhrase("When enchanted permanent becomes tapped, "));
|
||||
}
|
||||
|
||||
private BrinkOfDisaster(final BrinkOfDisaster card) {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ import mage.constants.SubType;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -19,12 +18,6 @@ import mage.target.TargetPermanent;
|
|||
*/
|
||||
public final class CivicGardener extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public CivicGardener(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
|
||||
|
||||
|
|
@ -35,7 +28,7 @@ public final class CivicGardener extends CardImpl {
|
|||
|
||||
// Whenever Civic Gardener attacks, untap target creature or land.
|
||||
Ability ability = new AttacksTriggeredAbility(new UntapTargetEffect());
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -7,8 +6,7 @@ import mage.abilities.effects.common.SacrificeControllerEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -16,17 +14,11 @@ import mage.filter.predicate.Predicates;
|
|||
*/
|
||||
public final class Dredge extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public Dredge(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}");
|
||||
|
||||
// Sacrifice a creature or land.
|
||||
this.getSpellAbility().addEffect(new SacrificeControllerEffect(filter, 1, ""));
|
||||
this.getSpellAbility().addEffect(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND, 1, ""));
|
||||
|
||||
// Draw a card.
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("<br>"));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -6,8 +5,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -16,17 +14,13 @@ import mage.target.TargetPermanent;
|
|||
* @author Jgod
|
||||
*/
|
||||
public final class Fissure extends CardImpl {
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public Fissure(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{R}{R}");
|
||||
|
||||
// Destroy target creature or land. It can't be regenerated.
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
|
||||
Target target = new TargetPermanent(filter);
|
||||
Target target = new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND);
|
||||
this.getSpellAbility().addTarget(target);
|
||||
}
|
||||
|
||||
|
|
@ -39,4 +33,3 @@ public final class Fissure extends CardImpl {
|
|||
return new Fissure(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -10,8 +9,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -20,13 +18,6 @@ import mage.target.TargetPermanent;
|
|||
*/
|
||||
public final class InitiatesCompanion extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(),
|
||||
CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public InitiatesCompanion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
|
||||
|
||||
|
|
@ -36,7 +27,7 @@ public final class InitiatesCompanion extends CardImpl {
|
|||
|
||||
// Whenever Initiate's Companion deals combat damage to a player, untap target creature or land.
|
||||
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new UntapTargetEffect(), false);
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -6,8 +5,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -16,17 +14,13 @@ import mage.target.TargetPermanent;
|
|||
* @author ilcartographer
|
||||
*/
|
||||
public final class LavaFlow extends CardImpl {
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public LavaFlow(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R}{R}");
|
||||
|
||||
// Destroy target creature or land.
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||
Target target = new TargetPermanent(filter);
|
||||
Target target = new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND);
|
||||
this.getSpellAbility().addTarget(target);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,15 +13,11 @@ import mage.abilities.keyword.ProtectionAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -30,12 +26,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class MinionOfLeshrac extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filterCreatureOrLand = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filterCreatureOrLand.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public MinionOfLeshrac(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{B}");
|
||||
|
||||
|
|
@ -52,7 +42,7 @@ public final class MinionOfLeshrac extends CardImpl {
|
|||
|
||||
// {tap}: Destroy target creature or land.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetPermanent(filterCreatureOrLand));
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND));
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
|
@ -84,11 +74,7 @@ class MinionLeshracEffect extends OneShotEffect {
|
|||
Permanent minionLeshrac = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (controller != null
|
||||
&& minionLeshrac != null) {
|
||||
FilterControlledPermanent filterCreature = new FilterControlledPermanent();
|
||||
filterCreature.add(CardType.CREATURE.getPredicate());
|
||||
filterCreature.add(AnotherPredicate.instance);
|
||||
TargetControlledPermanent target = new TargetControlledPermanent(filterCreature);
|
||||
SacrificeTargetCost cost = new SacrificeTargetCost(target);
|
||||
SacrificeTargetCost cost = new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE);
|
||||
if (controller.chooseUse(Outcome.AIDontUseIt, "Sacrifice another creature to prevent the damage?", source, game)
|
||||
&& cost.canPay(source, source, source.getControllerId(), game)
|
||||
&& cost.pay(source, game, source, source.getControllerId(), true)) {
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ import mage.abilities.mana.SimpleManaAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
|
@ -27,22 +26,13 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class NaturesEmbrace extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
CardType.CREATURE.getPredicate(),
|
||||
CardType.LAND.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
public NaturesEmbrace(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature or land
|
||||
TargetPermanent auraTarget = new TargetPermanent(filter);
|
||||
TargetPermanent auraTarget = new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND);
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import mage.constants.SubType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.CanBeEnchantedByPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
|
|
@ -29,20 +30,13 @@ import mage.target.TargetPermanent;
|
|||
*/
|
||||
public final class NettlevineBlight extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(),
|
||||
CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public NettlevineBlight(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}");
|
||||
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature or land
|
||||
TargetPermanent auraTarget = new TargetPermanent(filter);
|
||||
TargetPermanent auraTarget = new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND);
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -6,8 +5,7 @@ import mage.abilities.effects.common.PutOnLibraryTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -16,20 +14,12 @@ import mage.target.TargetPermanent;
|
|||
*/
|
||||
public final class TemporalEddy extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
CardType.CREATURE.getPredicate(),
|
||||
CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public TemporalEddy(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}{U}");
|
||||
|
||||
// Put target creature or land on top of its owner's library.
|
||||
this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true));
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND));
|
||||
}
|
||||
|
||||
private TemporalEddy(final TemporalEddy card) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.w;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -6,9 +5,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.target.Target;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -17,19 +14,13 @@ import mage.target.TargetPermanent;
|
|||
|
||||
*/
|
||||
public final class WreckingBall extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("creature or land");
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
|
||||
}
|
||||
|
||||
public WreckingBall(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}{R}");
|
||||
|
||||
// Destroy target creature or land.
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||
Target target = new TargetPermanent(filter);
|
||||
this.getSpellAbility().addTarget(target);
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_OR_LAND));
|
||||
}
|
||||
|
||||
private WreckingBall(final WreckingBall card) {
|
||||
|
|
|
|||
|
|
@ -734,6 +734,17 @@ public final class StaticFilters {
|
|||
FILTER_PERMANENT_CREATURE_OR_PLANESWALKER.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterPermanent FILTER_PERMANENT_CREATURE_OR_LAND = new FilterPermanent("creature or land");
|
||||
|
||||
static {
|
||||
FILTER_PERMANENT_CREATURE_OR_LAND.add(
|
||||
Predicates.or(
|
||||
CardType.CREATURE.getPredicate(),
|
||||
CardType.LAND.getPredicate()
|
||||
));
|
||||
FILTER_PERMANENT_CREATURE_OR_LAND.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterCreaturePermanent FILTER_PERMANENT_A_CREATURE = new FilterCreaturePermanent("a creature");
|
||||
|
||||
static {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue