forked from External/mage
more filter cleanup
This commit is contained in:
parent
45b54e8cc4
commit
f6fdcb9d59
10 changed files with 29 additions and 110 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -12,7 +11,7 @@ import mage.abilities.keyword.MenaceAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -20,12 +19,6 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
*/
|
||||
public final class AtarkaPummeler extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public AtarkaPummeler(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}");
|
||||
this.subtype.add(SubType.OGRE);
|
||||
|
|
@ -36,7 +29,7 @@ public final class AtarkaPummeler extends CardImpl {
|
|||
// <i>Formidable</i> — {3}{R}{R}: Creatures you control gain menace until end of turn. Activate this ability only if creature you control have total power 8 or greater. (They can't be blocked except by two or more creatures.)
|
||||
Ability ability = new ActivateIfConditionActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, filter),
|
||||
new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES),
|
||||
new ManaCostsImpl<>("{3}{R}{R}"),
|
||||
FormidableCondition.instance);
|
||||
ability.setAbilityWord(AbilityWord.FORMIDABLE);
|
||||
|
|
|
|||
|
|
@ -4,16 +4,13 @@ import mage.MageInt;
|
|||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.ChancellorAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.hint.common.CreaturesYouControlHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.PhyrexianGoblinHasteToken;
|
||||
|
|
@ -26,11 +23,6 @@ import java.util.UUID;
|
|||
public final class ChancellorOfTheForge extends CardImpl {
|
||||
|
||||
private static String abilityText = "at the beginning of the first upkeep, create a 1/1 red Goblin creature token with haste";
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public ChancellorOfTheForge(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}{R}");
|
||||
|
|
@ -44,8 +36,7 @@ public final class ChancellorOfTheForge extends CardImpl {
|
|||
this.addAbility(new ChancellorAbility(new ChancellorOfTheForgeDelayedTriggeredAbility(), abilityText));
|
||||
|
||||
// When Chancellor of the Forge enters the battlefield, create X 1/1 red Goblin creature tokens with haste, where X is the number of creatures you control.
|
||||
DynamicValue value = new PermanentsOnBattlefieldCount(filter);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PhyrexianGoblinHasteToken(), value), false)
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PhyrexianGoblinHasteToken(), CreaturesYouControlCount.instance), false)
|
||||
.addHint(CreaturesYouControlHint.instance));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -7,8 +6,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -16,17 +14,11 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
*/
|
||||
public final class DivineLight extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public DivineLight(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}");
|
||||
|
||||
// Prevent all damage that would be dealt this turn to creatures you control.
|
||||
this.getSpellAbility().addEffect(new PreventAllDamageToAllEffect(Duration.EndOfTurn, filter)
|
||||
this.getSpellAbility().addEffect(new PreventAllDamageToAllEffect(Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES)
|
||||
.setText("Prevent all damage that would be dealt this turn to creatures you control.")
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -7,7 +6,7 @@ import mage.abilities.Mode;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.EntwineAbility;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -15,7 +14,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -29,12 +28,6 @@ import mage.watchers.common.AttackedThisTurnWatcher;
|
|||
*/
|
||||
public final class InciteWar extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public InciteWar(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
|
||||
|
||||
|
|
@ -44,7 +37,7 @@ public final class InciteWar extends CardImpl {
|
|||
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
|
||||
|
||||
// or creatures you control gain first strike until end of turn.
|
||||
Mode mode = new Mode(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter));
|
||||
Mode mode = new Mode(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES));
|
||||
this.getSpellAbility().getModes().addMode(mode);
|
||||
|
||||
// Entwine {2}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -10,7 +9,7 @@ import mage.abilities.keyword.HasteAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -18,12 +17,6 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
*/
|
||||
public final class MaelstromWanderer extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public MaelstromWanderer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{U}{R}");
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
|
|
@ -34,7 +27,7 @@ public final class MaelstromWanderer extends CardImpl {
|
|||
|
||||
// Creatures you control have haste.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||
new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false)));
|
||||
new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_CONTROLLED_CREATURES, false)));
|
||||
// Cascade
|
||||
this.addAbility(new CascadeAbility(false));
|
||||
// Cascade
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -19,12 +17,6 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
|||
*/
|
||||
public final class MawOfTheObzedat extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public MawOfTheObzedat(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{B}");
|
||||
this.subtype.add(SubType.THRULL);
|
||||
|
|
@ -33,8 +25,8 @@ public final class MawOfTheObzedat extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Sacrifice a creature: Creatures you control get +1/+1 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false),
|
||||
new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn),
|
||||
new SacrificeTargetCost(new TargetControlledCreaturePermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT))));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,13 +8,11 @@ import mage.abilities.decorator.ConditionalContinuousEffect;
|
|||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.AttackingCreatureCount;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -25,12 +23,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class PathOfBravery extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
static final String rule = "As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1";
|
||||
private static final DynamicValue xValue = new AttackingCreatureCount();
|
||||
|
||||
|
|
@ -38,9 +30,9 @@ public final class PathOfBravery extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
|
||||
// As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(new BoostAllEffect(
|
||||
1, 1, Duration.WhileOnBattlefield, filter, true
|
||||
), LifeCondition.instance, rule)));
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(new BoostControlledEffect(
|
||||
1, 1, Duration.WhileOnBattlefield
|
||||
), PathOfBraveryCondition.instance, rule)));
|
||||
|
||||
// Whenever one or more creatures you control attack, you gain life equal to the number of attacking creatures.
|
||||
this.addAbility(new AttacksWithCreaturesTriggeredAbility(new GainLifeEffect(
|
||||
|
|
@ -58,7 +50,7 @@ public final class PathOfBravery extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
enum LifeCondition implements Condition {
|
||||
enum PathOfBraveryCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -12,8 +11,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -21,12 +19,6 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
*/
|
||||
public final class PyreheartWolf extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public PyreheartWolf(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
|
||||
this.subtype.add(SubType.WOLF);
|
||||
|
|
@ -35,7 +27,7 @@ public final class PyreheartWolf extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Pyreheart Wolf attacks, creatures you control gain menace until end of turn. (They can't be blocked except by two or more creatures.)
|
||||
this.addAbility(new AttacksTriggeredAbility(new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, filter), false));
|
||||
this.addAbility(new AttacksTriggeredAbility(new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES), false));
|
||||
|
||||
// Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)
|
||||
this.addAbility(new UndyingAbility());
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -14,8 +13,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -23,12 +21,6 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
*/
|
||||
public final class SavageOffensive extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public SavageOffensive(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}");
|
||||
|
||||
|
|
@ -36,7 +28,7 @@ public final class SavageOffensive extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{G}"));
|
||||
|
||||
// Creatures you control gain first strike until end of turn.
|
||||
this.getSpellAbility().addEffect(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter));
|
||||
this.getSpellAbility().addEffect(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES));
|
||||
|
||||
// If Savage Offensive was kicked, they get +1/+1 until end of turn.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
|
@ -26,12 +25,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class Teleportal extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
public Teleportal(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{R}");
|
||||
|
||||
|
|
@ -41,8 +34,8 @@ public final class Teleportal extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new CantBeBlockedTargetEffect().setText("and can't be blocked this turn"));
|
||||
|
||||
// Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
|
||||
OverloadAbility ability = new OverloadAbility(this, new BoostAllEffect(1, 0, Duration.EndOfTurn, filter, false), new ManaCostsImpl<>("{3}{U}{R}"));
|
||||
ability.addEffect(new TeleportalEffect(filter));
|
||||
OverloadAbility ability = new OverloadAbility(this, new BoostAllEffect(1, 0, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, false), new ManaCostsImpl<>("{3}{U}{R}"));
|
||||
ability.addEffect(new TeleportalEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
@ -58,22 +51,18 @@ public final class Teleportal extends CardImpl {
|
|||
|
||||
class TeleportalEffect extends OneShotEffect {
|
||||
|
||||
private FilterCreaturePermanent filter;
|
||||
|
||||
public TeleportalEffect(FilterCreaturePermanent filter) {
|
||||
public TeleportalEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
staticText = "each creature you control can't be blocked this turn";
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public TeleportalEffect(final TeleportalEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURES, source.getControllerId(), source, game)) {
|
||||
CantBeBlockedTargetEffect effect = new CantBeBlockedTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(creature.getId(), game));
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue