Various text fixes

This commit is contained in:
Alex W. Jackson 2022-04-26 07:10:13 -04:00
parent 4304b4a66a
commit d95d8378fb
57 changed files with 224 additions and 708 deletions

View file

@ -6,9 +6,9 @@ import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -17,12 +17,6 @@ import java.util.UUID;
*/
public final class AnglerTurtle extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public AnglerTurtle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
this.subtype.add(SubType.TURTLE);
@ -33,8 +27,7 @@ public final class AnglerTurtle extends CardImpl {
this.addAbility(HexproofAbility.getInstance());
// Creatures your opponents control attack each combat if able
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter, Duration.WhileOnBattlefield)),
new AttackedThisTurnWatcher());
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES)));
}
private AnglerTurtle(final AnglerTurtle card) {

View file

@ -14,10 +14,9 @@ import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SpellAbilityType;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
import java.util.UUID;
@ -43,11 +42,9 @@ public final class AppealAuthority extends SplitCard {
getRightHalfCard().addAbility(new AftermathAbility().setRuleAtTheTop(true));
// Tap up to two target creatures your opponents control. Creatures you control gain vigilance until end of turn.
getRightHalfCard().getSpellAbility().addEffect(new TapTargetEffect());
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
filter.add(TargetController.OPPONENT.getControllerPredicate());
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2, filter, false));
getRightHalfCard().getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent(0, 2));
getRightHalfCard().getSpellAbility().addEffect(new GainAbilityControlledEffect(VigilanceAbility.getInstance(),
Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures")));
Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES));
}

View file

@ -15,9 +15,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -25,13 +22,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class ArcaneLighthouse extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public ArcaneLighthouse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
@ -39,11 +29,11 @@ public final class ArcaneLighthouse extends CardImpl {
this.addAbility(new ColorlessManaAbility());
// {1}, {tap}: Until end of turn, creatures your opponents control lose hexproof and shroud and can't have hexproof or shroud.
Effect effect = new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, filter);
Effect effect = new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.EndOfTurn);
effect.setText("Until end of turn, creatures your opponents control lose hexproof");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1));
Ability ability = new SimpleActivatedAbility(effect, new GenericManaCost(1));
ability.addCost(new TapSourceCost());
effect = new CreaturesCantGetOrHaveAbilityEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, filter);
effect = new CreaturesCantGetOrHaveAbilityEffect(ShroudAbility.getInstance(), Duration.EndOfTurn);
effect.setText("and shroud and can't have hexproof or shroud");
ability.addEffect(effect);
this.addAbility(ability);

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -9,9 +8,10 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -19,12 +19,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class ArchetypeOfAggression extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public ArchetypeOfAggression(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{1}{R}{R}");
this.subtype.add(SubType.HUMAN);
@ -34,10 +28,9 @@ public final class ArchetypeOfAggression extends CardImpl {
this.toughness = new MageInt(2);
// Creatures you control have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose trample and can't have or gain trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
this.addAbility(new SimpleStaticAbility(new CreaturesCantGetOrHaveAbilityEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield)));
}
private ArchetypeOfAggression(final ArchetypeOfAggression card) {

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -9,9 +8,10 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -19,11 +19,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class ArchetypeOfCourage extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public ArchetypeOfCourage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{1}{W}{W}");
this.subtype.add(SubType.HUMAN);
@ -33,9 +28,9 @@ public final class ArchetypeOfCourage extends CardImpl {
this.toughness = new MageInt(2);
// Creatures you control have first strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose first strike and can't have or gain first strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
this.addAbility(new SimpleStaticAbility(new CreaturesCantGetOrHaveAbilityEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield)));
}
private ArchetypeOfCourage(final ArchetypeOfCourage card) {

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -9,9 +8,10 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -19,12 +19,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class ArchetypeOfEndurance extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public ArchetypeOfEndurance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{6}{G}{G}");
this.subtype.add(SubType.BOAR);
@ -33,11 +27,9 @@ public final class ArchetypeOfEndurance extends CardImpl {
this.toughness = new MageInt(5);
// Creatures you control have hexproof.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose hexproof and can't have or gain hexproof.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
this.addAbility(new SimpleStaticAbility(new CreaturesCantGetOrHaveAbilityEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield)));
}
private ArchetypeOfEndurance(final ArchetypeOfEndurance card) {

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -9,9 +8,10 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -19,12 +19,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class ArchetypeOfFinality extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public ArchetypeOfFinality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{4}{B}{B}");
this.subtype.add(SubType.GORGON);
@ -33,10 +27,9 @@ public final class ArchetypeOfFinality extends CardImpl {
this.toughness = new MageInt(3);
// Creatures you control have deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose deathtouch and can't have or gain deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
this.addAbility(new SimpleStaticAbility(new CreaturesCantGetOrHaveAbilityEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield)));
}
private ArchetypeOfFinality(final ArchetypeOfFinality card) {

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -9,9 +8,10 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -19,11 +19,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class ArchetypeOfImagination extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public ArchetypeOfImagination(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{4}{U}{U}");
this.subtype.add(SubType.HUMAN);
@ -33,10 +28,9 @@ public final class ArchetypeOfImagination extends CardImpl {
this.toughness = new MageInt(2);
// Creatures you control have flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
// Creatures your opponents control lose flying and can't have or gain flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CreaturesCantGetOrHaveAbilityEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
this.addAbility(new SimpleStaticAbility(new CreaturesCantGetOrHaveAbilityEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)));
}
private ArchetypeOfImagination(final ArchetypeOfImagination card) {

View file

@ -11,8 +11,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -21,9 +20,6 @@ import java.util.UUID;
*/
public final class ArchfiendOfSorrows extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public ArchfiendOfSorrows(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}{B}");
@ -36,7 +32,7 @@ public final class ArchfiendOfSorrows extends CardImpl {
// When Archfiend of Sorrows enters the battlefield, creatures your opponents control get -2/-2 until end of turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new BoostAllEffect(
-2, -2, Duration.EndOfTurn, filter, false
-2, -2, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false
)));
// Unearth {3}{B}{B}

View file

@ -7,8 +7,7 @@ import mage.abilities.effects.common.PermanentsEnterBattlefieldTappedEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -17,19 +16,16 @@ import java.util.UUID;
*/
public final class AuthorityOfTheConsuls extends CardImpl {
private static final FilterPermanent filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public AuthorityOfTheConsuls(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}");
// Creatures your opponents control enter the battlefield tapped.
this.addAbility(new SimpleStaticAbility(new PermanentsEnterBattlefieldTappedEffect(filter)));
this.addAbility(new SimpleStaticAbility(new PermanentsEnterBattlefieldTappedEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES)));
// Whenever a creature enters the battlefield under an opponent's control, you gain 1 life.
this.addAbility(new EntersBattlefieldAllTriggeredAbility(
new GainLifeEffect(1), filter, "Whenever a creature enters " +
"the battlefield under an opponent's control, you gain 1 life."
new GainLifeEffect(1), StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES,
"Whenever a creature enters the battlefield under an opponent's control, you gain 1 life."
));
}

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -10,9 +9,7 @@ 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.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
/**
*
@ -20,12 +17,6 @@ import mage.target.common.TargetCreaturePermanent;
*/
public final class AzoriusJusticiar extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public AzoriusJusticiar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
this.subtype.add(SubType.HUMAN);
@ -37,7 +28,7 @@ public final class AzoriusJusticiar extends CardImpl {
// When Azorius Justiciar enters the battlefield, detain up to two target creatures your opponents control.
// (Until your next turn, those creatures can't attack or block and their activated abilities can't be activated.)
Ability ability = new EntersBattlefieldTriggeredAbility(new DetainTargetEffect());
ability.addTarget(new TargetCreaturePermanent(0,2,filter,false));
ability.addTarget(new TargetOpponentsCreaturePermanent(0, 2));
this.addAbility(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.b;
import java.util.UUID;
@ -8,8 +7,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;
/**
*
@ -17,18 +15,11 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class BlindingSpray extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public BlindingSpray(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{U}");
// Creatures your opponents control get -4/-0 until end of turn.
this.getSpellAbility().addEffect(new BoostAllEffect(-4, 0, Duration.EndOfTurn, filter, false));
this.getSpellAbility().addEffect(new BoostAllEffect(-4, 0, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));

View file

@ -7,9 +7,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import java.util.UUID;
@ -18,14 +16,11 @@ import java.util.UUID;
*/
public final class BondOfDiscipline extends CardImpl {
private static final FilterPermanent filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public BondOfDiscipline(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}");
// Tap all creatures your opponents control. Creatures you control gain lifelink until end of turn.
this.getSpellAbility().addEffect(new TapAllEffect(filter));
this.getSpellAbility().addEffect(new TapAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
LifelinkAbility.getInstance(), Duration.EndOfTurn,
StaticFilters.FILTER_PERMANENT_CREATURES

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.LoseAbilityAllEffect;
@ -14,10 +14,9 @@ import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
/**
*
@ -25,12 +24,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class BondsOfMortality extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public BondsOfMortality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}");
@ -38,10 +31,12 @@ public final class BondsOfMortality extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false));
// {G}: Creatures your opponents control lose hexproof and indestructible until end of turn.
Effect effect = new LoseAbilityAllEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, filter);
Effect effect = new LoseAbilityAllEffect(
HexproofAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES);
effect.setText("Creatures your opponents control lose hexproof");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{G}"));
effect = new LoseAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, filter);
Ability ability = new SimpleActivatedAbility(effect, new ColoredManaCost(ColoredManaSymbol.G));
effect = new LoseAbilityAllEffect(
IndestructibleAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES);
effect.setText("and indestructible until end of turn");
ability.addEffect(effect);
this.addAbility(ability);

View file

@ -12,7 +12,7 @@ import mage.abilities.effects.common.combat.ChooseBlockersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -26,12 +26,6 @@ import java.util.UUID;
*/
public final class BrutalHordechief extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public BrutalHordechief(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.subtype.add(SubType.ORC, SubType.WARRIOR);
@ -43,7 +37,8 @@ public final class BrutalHordechief extends CardImpl {
// {3}{R/W}{R/W}: Creatures your opponents control block this turn if able, and you choose how those creatures block.
Ability ability = new SimpleActivatedAbility(
new BlocksIfAbleAllEffect(filter, Duration.EndOfTurn), new ManaCostsImpl<>("{3}{R/W}{R/W}")
new BlocksIfAbleAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, Duration.EndOfTurn),
new ManaCostsImpl<>("{3}{R/W}{R/W}")
);
ability.addEffect(new ChooseBlockersEffect(Duration.EndOfTurn).setText("and you choose how those creatures block"));
ability.addWatcher(new ControlCombatRedundancyWatcher());

View file

@ -1,4 +1,3 @@
package mage.cards.c;
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,18 +14,11 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class CowerInFear extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public CowerInFear(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}{B}");
// Creatures your opponents control get -1/-1 until end of turn.
this.getSpellAbility().addEffect(new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false));
this.getSpellAbility().addEffect(new BoostAllEffect(-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false));
}
private CowerInFear(final CowerInFear card) {

View file

@ -8,8 +8,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
@ -19,23 +18,15 @@ import java.util.UUID;
*/
public final class Crypsis extends CardImpl {
static final FilterPermanent filter = new FilterPermanent("creatures your opponents control");
static {
filter.add(CardType.CREATURE.getPredicate());
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public Crypsis(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Target creature you control gains protection from creatures your opponents control until end of turn. Untap it.
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new ProtectionAbility(filter), Duration.EndOfTurn));
Effect effect = new UntapTargetEffect();
effect.setText("Untap it.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(
new ProtectionAbility(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES),
Duration.EndOfTurn));
this.getSpellAbility().addEffect(new UntapTargetEffect("untap it"));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
}
private Crypsis(final Crypsis card) {

View file

@ -1,21 +1,15 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.effects.common.TapAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.TargetSpell;
@ -31,24 +25,22 @@ public final class CrypticCommand extends CardImpl {
// Choose two -
this.getSpellAbility().getModes().setMinModes(2);
this.getSpellAbility().getModes().setMaxModes(2);
// Counter target spell;
Effect effect1 = new CounterTargetEffect();
effect1.setText("Counter target spell.");
this.getSpellAbility().addEffect(effect1);
this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addTarget(new TargetSpell());
// or return target permanent to its owner's hand;
Effect effect2 = new ReturnToHandTargetEffect();
effect2.setText("Return target permanent to its owner's hand.");
Mode mode = new Mode(effect2);
Mode mode = new Mode(new ReturnToHandTargetEffect());
mode.addTarget(new TargetPermanent());
this.getSpellAbility().getModes().addMode(mode);
// or tap all creatures your opponents control;
mode = new Mode(new CrypticCommandEffect());
mode = new Mode(new TapAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES));
this.getSpellAbility().getModes().addMode(mode);
// or draw a card.
Effect effect3 = new DrawCardSourceControllerEffect(1);
effect3.setText("Draw a card.");
mode = new Mode(effect3);
mode = new Mode(new DrawCardSourceControllerEffect(1));
this.getSpellAbility().getModes().addMode(mode);
}
@ -61,32 +53,3 @@ public final class CrypticCommand extends CardImpl {
return new CrypticCommand(this);
}
}
class CrypticCommandEffect extends OneShotEffect {
public CrypticCommandEffect() {
super(Outcome.Tap);
staticText = "Tap all creatures your opponents control";
}
public CrypticCommandEffect(final CrypticCommandEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE, player.getId(), source, game)) {
creature.tap(source, game);
}
return true;
}
@Override
public CrypticCommandEffect copy() {
return new CrypticCommandEffect(this);
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.d;
import java.util.UUID;
@ -8,9 +7,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
/**
*
@ -18,18 +15,11 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class DampeningPulse extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public DampeningPulse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}");
// Creatures your opponents control get -1/-0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, filter, false)));
this.addAbility(new SimpleStaticAbility(new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false)));
}
private DampeningPulse(final DampeningPulse card) {

View file

@ -10,8 +10,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;
/**
*
@ -19,12 +18,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class DoomwakeGiant extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public DoomwakeGiant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{4}{B}");
this.subtype.add(SubType.GIANT);
@ -33,7 +26,7 @@ public final class DoomwakeGiant extends CardImpl {
this.toughness = new MageInt(6);
// Constellation - When Doomwake Giant or another enchantment enters the battlefield under your control, creatures your opponents control get -1/-1 until end of turn.
this.addAbility(new ConstellationAbility(new BoostAllEffect(-1,-1, Duration.EndOfTurn, filter, false)));
this.addAbility(new ConstellationAbility(new BoostAllEffect(-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false)));
}
private DoomwakeGiant(final DoomwakeGiant card) {

View file

@ -1,4 +1,3 @@
package mage.cards.d;
import java.util.UUID;
@ -14,6 +13,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.watchers.common.CastFromHandWatcher;
@ -22,12 +22,7 @@ import mage.watchers.common.CastFromHandWatcher;
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/
public final class DreadCacodemon extends CardImpl {
private static final FilterCreaturePermanent opponentsCreatures = new FilterCreaturePermanent("creatures your opponents control");
static {
opponentsCreatures.add(TargetController.OPPONENT.getControllerPredicate());
}
private static final FilterCreaturePermanent otherCreaturesYouControl = new FilterCreaturePermanent("other creatures you control");
static {
otherCreaturesYouControl.add(TargetController.YOU.getControllerPredicate());
@ -39,10 +34,10 @@ public final class DreadCacodemon extends CardImpl {
this.subtype.add(SubType.DEMON);
this.power = new MageInt(8);
this.toughness = new MageInt(8);
// When Dread Cacodemon enters the battlefield,
// if you cast it from your hand, destroy all creatures your opponents control, then tap all other creatures you control.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(opponentsCreatures, false));
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES));
ability.addEffect(new TapAllEffect(otherCreaturesYouControl));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, CastFromHandSourcePermanentCondition.instance,
"When {this} enters the battlefield, if you cast it from your hand, destroy all creatures your opponents control, then tap all other creatures you control."), new CastFromHandWatcher());
@ -56,4 +51,4 @@ public final class DreadCacodemon extends CardImpl {
public DreadCacodemon copy() {
return new DreadCacodemon(this);
}
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.f;
import java.util.UUID;
@ -12,10 +11,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.filter.StaticFilters;
/**
*
@ -35,11 +31,8 @@ public final class FumikoTheLowblood extends CardImpl {
// Fumiko the Lowblood has bushido X, where X is the number of attacking creatures.
this.addAbility(new BushidoAbility(new AttackingCreatureCount("the number of attacking creatures.")));
// Creatures your opponents control attack each turn if able.
FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
filter.add(TargetController.OPPONENT.getControllerPredicate());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)), new AttackedThisTurnWatcher());
// Creatures your opponents control attack each combat if able.
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES)));
}
private FumikoTheLowblood(final FumikoTheLowblood card) {

View file

@ -11,10 +11,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.permanent.token.GoblinToken;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
@ -28,8 +26,8 @@ public final class GoblinAssault extends CardImpl {
// At the beginning of your upkeep, create a 1/1 red Goblin creature token with haste.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinToken(true)), TargetController.YOU, false));
// Goblin creatures attack each turn if able.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE_GOBLINS, Duration.WhileOnBattlefield, true)), new AttackedThisTurnWatcher());
// Goblin creatures attack each combat if able.
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE_GOBLINS)));
}
private GoblinAssault(final GoblinAssault card) {

View file

@ -46,8 +46,8 @@ public final class GoblinRabblemaster extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Other Goblin creatures you control attack each turn if able.
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(otherGoblinFilter, Duration.WhileOnBattlefield, true)));
// Other Goblin creatures you control attack each combat if able.
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(otherGoblinFilter)));
// At the beginning of combat on your turn, create a 1/1 red Goblin creature token with haste.
this.addAbility(new BeginningOfCombatTriggeredAbility(new CreateTokenEffect(new GoblinToken(true)), TargetController.YOU, false));

View file

@ -1,7 +1,8 @@
package mage.cards.g;
import mage.abilities.condition.common.CitysBlessingCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.AddContinuousEffectToGame;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.keyword.AscendEffect;
import mage.abilities.hint.common.CitysBlessingHint;
@ -10,8 +11,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;
import java.util.UUID;
@ -29,11 +29,9 @@ public final class GoldenDemise extends CardImpl {
this.getSpellAbility().addHint(PermanentsYouControlHint.instance);
// All creatures get -2/-2 until end of turn. If you have the city's blessing, instead only creatures your opponents control get -2/-2 until end of turn.
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
filter.add(TargetController.OPPONENT.getControllerPredicate());
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new BoostAllEffect(-2, -2, Duration.EndOfTurn, filter, false),
new BoostAllEffect(-2, -2, Duration.EndOfTurn),
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new AddContinuousEffectToGame(new BoostAllEffect(-2, -2, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false)),
new AddContinuousEffectToGame(new BoostAllEffect(-2, -2, Duration.EndOfTurn)),
CitysBlessingCondition.instance,
"All creatures get -2/-2 until end of turn. If you have the city's blessing, instead only creatures your opponents control get -2/-2 until end of turn"
));

View file

@ -3,10 +3,8 @@ package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
@ -16,9 +14,6 @@ import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
@ -35,10 +30,12 @@ public final class HellraiserGoblin extends CardImpl {
this.toughness = new MageInt(2);
// Creatures you control have haste and attack each combat if able.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES));
Effect effect = new AttacksIfAbleAllEffect(Duration.WhileOnBattlefield);
effect.setText("and attack each combat if able");
ability.addEffect(effect);
Ability ability = new SimpleStaticAbility(new GainAbilityControlledEffect(
HasteAbility.getInstance(),
Duration.WhileOnBattlefield,
StaticFilters.FILTER_PERMANENT_CREATURES
));
ability.addEffect(new AttacksIfAbleAllEffect(StaticFilters.FILTER_CONTROLLED_CREATURES).setText("and attack each combat if able"));
this.addAbility(ability);
}
@ -51,51 +48,3 @@ public final class HellraiserGoblin extends CardImpl {
return new HellraiserGoblin(this);
}
}
class AttacksIfAbleAllEffect extends RequirementEffect {
private FilterControlledCreaturePermanent filter;
public AttacksIfAbleAllEffect(Duration duration) {
this(duration, new FilterControlledCreaturePermanent());
}
public AttacksIfAbleAllEffect(Duration duration, FilterControlledCreaturePermanent filter) {
super(duration);
this.filter = filter;
}
public AttacksIfAbleAllEffect(final AttacksIfAbleAllEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public AttacksIfAbleAllEffect copy() {
return new AttacksIfAbleAllEffect(this);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return filter.match(permanent, source.getControllerId(), source, game);
}
@Override
public boolean mustAttack(Game game) {
return true;
}
@Override
public boolean mustBlock(Game game) {
return false;
}
@Override
public String getText(Mode mode) {
if (!staticText.isEmpty()) {
return staticText;
}
return filter.getMessage() + " attack each combat if able";
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.h;
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,18 +14,11 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class HystericalBlindness extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public HystericalBlindness(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}");
// Creatures your opponents control get -4/-0 until end of turn.
this.getSpellAbility().addEffect(new BoostAllEffect(-4, 0, Duration.EndOfTurn, filter, false));
this.getSpellAbility().addEffect(new BoostAllEffect(-4, 0, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false));
}
private HystericalBlindness(final HystericalBlindness card) {

View file

@ -29,7 +29,7 @@ public final class IntrusivePackbeast extends CardImpl {
this.addAbility(VigilanceAbility.getInstance());
// When Intrusive Packbeast enters the battlefield, tap up to two target creatures your opponents control.
Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect().setText("tap up to two target creatures your opponents control"));
Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect());
ability.addTarget(new TargetOpponentsCreaturePermanent(0, 2));
this.addAbility(ability);
}

View file

@ -21,13 +21,14 @@ import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.HunterToken;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
/**
*
@ -35,7 +36,7 @@ import mage.target.common.TargetOpponentsCreaturePermanent;
*/
public final class JabbaTheHutt extends CardImpl {
private static final FilterOpponentsCreaturePermanent filter = new FilterOpponentsCreaturePermanent("creature an opponent control with a bounty counter on it");
private static final FilterPermanent filter = new FilterOpponentsCreaturePermanent("creature an opponent controls with a bounty counter on it");
static {
filter.add(CounterType.BOUNTY.getPredicate());
@ -60,7 +61,7 @@ public final class JabbaTheHutt extends CardImpl {
// {R},{T}: Create a tapped 4/4 red Hunter creature token. It fights another target creature an opponent control with a bounty counter on it. Activate this ability only any time you could cast a sorcery.
ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new JabbaTheHuttEffect(), new ManaCostsImpl<>("{R}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetOpponentsCreaturePermanent(filter));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}

View file

@ -1,5 +1,3 @@
package mage.cards.l;
import java.util.UUID;
@ -7,32 +5,21 @@ import mage.abilities.effects.common.DetainTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
/**
*
* @author LevelX2
*/
public final class LyevDecree extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public LyevDecree(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{W}");
// Detain up to two target creatures your opponents control.
this.getSpellAbility().addEffect(new DetainTargetEffect());
Target target = new TargetCreaturePermanent(0,2,filter,false);
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent(0, 2));
}
private LyevDecree(final LyevDecree card) {
@ -43,5 +30,4 @@ public final class LyevDecree extends CardImpl {
public LyevDecree copy() {
return new LyevDecree(this);
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.m;
import java.util.UUID;
@ -11,8 +10,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;
/**
*
@ -20,12 +18,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class MinisterOfPain extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public MinisterOfPain(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
this.subtype.add(SubType.HUMAN);
@ -37,7 +29,8 @@ public final class MinisterOfPain extends CardImpl {
this.addAbility(new ExploitAbility());
// When Minister of Pain explots a creature, creatures your opponents control get -1/-1 until end of turn.
this.addAbility(new ExploitCreatureTriggeredAbility(new BoostAllEffect(-1,-1, Duration.EndOfTurn, filter, false), false));
this.addAbility(new ExploitCreatureTriggeredAbility(
new BoostAllEffect(-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false)));
}

View file

@ -9,8 +9,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -19,9 +18,6 @@ import java.util.UUID;
*/
public final class NightClubber extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public NightClubber(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
@ -32,7 +28,7 @@ public final class NightClubber extends CardImpl {
// When Night Clubber enters the battlefield, creatures your opponents control get -1/-1 until end of turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new BoostAllEffect(
-1, -1, Duration.EndOfTurn, filter, false
-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false
)));
// Blitz {2}{B}

View file

@ -2,24 +2,21 @@ package mage.cards.o;
import mage.abilities.condition.common.ControlACommanderCondition;
import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
import mage.abilities.hint.common.ControlACommanderHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
/**
* @author TheElk801
*/
public final class ObscuringHaze extends CardImpl {
private static final FilterOpponentsCreaturePermanent filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public ObscuringHaze(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
@ -30,7 +27,7 @@ public final class ObscuringHaze extends CardImpl {
// Prevent all damage that would be dealt this turn by creatures your opponents control.
this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(
filter, Duration.EndOfTurn, false
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, Duration.EndOfTurn, false
));
}

View file

@ -1,4 +1,3 @@
package mage.cards.p;
import java.util.UUID;
@ -9,28 +8,21 @@ import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SpellAbilityType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
public final class ProfitLoss extends SplitCard {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public ProfitLoss(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}", "{2}{B}", SpellAbilityType.SPLIT_FUSED);
// Profit
// Creatures you control get +1/+1 until end of turn.
getLeftHalfCard().getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent()));
getLeftHalfCard().getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn));
// Loss
// Creatures your opponents control get -1/-1 until end of turn.
getRightHalfCard().getSpellAbility().addEffect(new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false));
getRightHalfCard().getSpellAbility().addEffect(
new BoostAllEffect(-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false));
}
private ProfitLoss(final ProfitLoss card) {

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -8,10 +7,8 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponentsCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
/**
@ -20,18 +17,12 @@ import mage.target.targetpointer.SecondTargetPointer;
*/
public final class RoilingWaters extends CardImpl {
private static final FilterCreaturePermanent FILTER = new FilterCreaturePermanent("creatures your opponents control");
static {
FILTER.add(TargetController.OPPONENT.getControllerPredicate());
}
public RoilingWaters(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{U}{U}");
// Return up to two target creatures your opponents control to their owners' hands.
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2, FILTER, false));
this.getSpellAbility().addTarget(new TargetOpponentsCreaturePermanent(0, 2));
// Target player draws two cards.
Effect effect = new DrawCardTargetEffect(2);
effect.setTargetPointer(new SecondTargetPointer());

View file

@ -1,7 +1,7 @@
package mage.cards.r;
import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
@ -12,8 +12,7 @@ import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
/**
*
@ -21,23 +20,21 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class RoilmagesTrick extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
private static final DynamicValue xValue = new SignInversionDynamicValue(ColorsOfManaSpentToCastCount.getInstance());
public RoilmagesTrick(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}");
// <i>Converge</i> &mdash; Creatures your opponents control get -X/-0 until end of turn, where X is the number of colors of mana spent to cast Roilmage's Trick.
// <i>Converge</i> &mdash; Creatures your opponents control get -X/-0 until end of turn,
// where X is the number of colors of mana spent to cast this spell.
this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE);
this.getSpellAbility().addEffect(new BoostAllEffect(
new SignInversionDynamicValue(ColorsOfManaSpentToCastCount.getInstance()), StaticValue.get(-0), Duration.EndOfTurn, filter, false,
"Creatures your opponents control get -X/-0 until end of turn, where X is the number of colors of mana spent to cast this spell.<br>", true));
xValue, StaticValue.get(0), Duration.EndOfTurn,
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false, null, true
));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("<br>"));
}
private RoilmagesTrick(final RoilmagesTrick card) {

View file

@ -1,41 +1,34 @@
package mage.cards.r;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.constants.*;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
* @author LevelX2
* @author awjackson
*/
public final class RoninWarclub extends CardImpl {
public RoninWarclub(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +2/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 1)));
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 1)));
// Whenever a creature enters the battlefield under your control, attach Ronin Warclub to that creature.
Ability ability = new RoninWarclubTriggeredAbility();
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
Zone.BATTLEFIELD, new AttachEffect(Outcome.BoostCreature, "attach {this} to that creature"),
StaticFilters.FILTER_PERMANENT_A_CREATURE, false, SetTargetPointer.PERMANENT, null));
// Equip {5} ({5}: Attach to target creature you control. Equip only as a sorcery.)
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(5)));
@ -49,84 +42,4 @@ public final class RoninWarclub extends CardImpl {
public RoninWarclub copy() {
return new RoninWarclub(this);
}
private class RoninWarclubTriggeredAbility extends TriggeredAbilityImpl {
public RoninWarclubTriggeredAbility() {
super(Zone.BATTLEFIELD, new RoninWarclubAttachEffect(), false);
}
public RoninWarclubTriggeredAbility(RoninWarclubTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null
&& permanent.isCreature(game)
&& permanent.isControlledBy(this.controllerId)) {
if (!this.getTargets().isEmpty()) {
// remove previous target
if (!this.getTargets().get(0).getTargets().isEmpty()) {
this.getTargets().clear();
this.addTarget(new TargetCreaturePermanent());
}
Target target = this.getTargets().get(0);
if (target instanceof TargetCreaturePermanent) {
target.add(event.getTargetId(), game);
}
}
return true;
}
return false;
}
@Override
public RoninWarclubTriggeredAbility copy() {
return new RoninWarclubTriggeredAbility(this);
}
}
private static class RoninWarclubAttachEffect extends OneShotEffect {
public RoninWarclubAttachEffect() {
super(Outcome.BoostCreature);
this.staticText = "Whenever a creature enters the battlefield under your control, attach {this} to that creature";
}
public RoninWarclubAttachEffect(final RoninWarclubAttachEffect effect) {
super(effect);
}
@Override
public RoninWarclubAttachEffect copy() {
return new RoninWarclubAttachEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
Permanent attachment = game.getPermanent(source.getSourceId());
if (permanent != null && attachment != null) {
if (attachment.getAttachedTo() != null) {
Permanent oldTarget = game.getPermanent(attachment.getAttachedTo());
if (oldTarget != null) {
oldTarget.removeAttachment(source.getSourceId(), source, game);
}
}
boolean result;
result = permanent.addAttachment(source.getSourceId(), source, game);
return result;
}
return false;
}
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.s;
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.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
/**
*
@ -19,12 +17,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class SubjugatorAngel extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public SubjugatorAngel(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}{W}");
this.subtype.add(SubType.ANGEL);
@ -35,7 +27,7 @@ public final class SubjugatorAngel extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Subjugator Angel enters the battlefield, tap all creatures your opponents control.
this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(filter)));
this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES)));
}
private SubjugatorAngel(final SubjugatorAngel card) {

View file

@ -1,14 +1,13 @@
package mage.cards.s;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -17,19 +16,16 @@ import java.util.UUID;
*/
public final class SuffocatingFumes extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public SuffocatingFumes(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
// Creatures your opponents control get -1/-1 until end of turn.
this.getSpellAbility().addEffect(new BoostAllEffect(
-1, -1, Duration.EndOfTurn, filter, false
-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false
));
// Cycling {2}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
this.addAbility(new CyclingAbility(new GenericManaCost(2)));
}
private SuffocatingFumes(final SuffocatingFumes card) {

View file

@ -14,7 +14,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
@ -39,13 +38,7 @@ public final class ThantisTheWarweaver extends CardImpl {
this.addAbility(ReachAbility.getInstance());
// All creatures attack each combat if able.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new AttacksIfAbleAllEffect(
StaticFilters.FILTER_PERMANENT_CREATURES,
Duration.WhileOnBattlefield, true
).setText("All creatures attack each combat if able")
));
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_PERMANENT_ALL_CREATURES)));
// Whenever a creature attacks you or a planeswalker you control, put a +1/+1 counter on Thantis the Warweaver.
this.addAbility(new AttacksAllTriggeredAbility(

View file

@ -10,8 +10,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
import mage.target.common.TargetCreaturePermanent;
@ -24,9 +24,6 @@ import mage.abilities.condition.common.SourceRemainsInZoneCondition;
*/
public final class TheAkroanWar extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public TheAkroanWar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
@ -51,9 +48,7 @@ public final class TheAkroanWar extends CardImpl {
sagaAbility.addChapterEffect(
this,
SagaChapter.CHAPTER_II,
new AttacksIfAbleAllEffect(
filter, Duration.UntilYourNextTurn, true
).setText("until your next turn, creatures your opponents control attack each combat if able")
new AttacksIfAbleAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, Duration.UntilYourNextTurn)
);
// III Each tapped creature deals damage to itself equal to its power.
@ -101,4 +96,4 @@ class TheAkroanWarEffect extends OneShotEffect {
.forEach(permanent -> permanent.damage(permanent.getPower().getValue(), permanent.getId(), source, game));
return true;
}
}
}

View file

@ -5,8 +5,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.FilterObject;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -15,15 +14,12 @@ import java.util.UUID;
*/
public final class ThwartTheEnemy extends CardImpl {
private static final FilterObject filter
= new FilterOpponentsCreaturePermanent("creatures your opponents control");
public ThwartTheEnemy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
// Prevent all damage that would be dealt this turn by creatures your opponents control.
this.getSpellAbility().addEffect(new PreventAllDamageByAllObjectsEffect(
filter, Duration.EndOfTurn, false
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, Duration.EndOfTurn, false
));
}

View file

@ -1,4 +1,3 @@
package mage.cards.u;
import java.util.UUID;
@ -6,13 +5,13 @@ import mage.abilities.condition.common.ManaWasSpentCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.InfoEffect;
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.ColoredManaSymbol;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
/**
*
@ -21,23 +20,15 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class UnnervingAssault extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creatures you control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
filter2.add(TargetController.YOU.getControllerPredicate());
}
public UnnervingAssault(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U/R}");
// Creatures your opponents control get -1/-0 until end of turn if {U} was spent to cast Unnerving Assault, and creatures you control get +1/+0 until end of turn if {R} was spent to cast it.
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new BoostAllEffect(-1, 0, Duration.EndOfTurn, filter, false),
new BoostAllEffect(-1, 0, Duration.EndOfTurn, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false),
new ManaWasSpentCondition(ColoredManaSymbol.U), "Creatures your opponents control get -1/-0 until end of turn if {U} was spent to cast this spell,"));
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
new BoostAllEffect(1, 0, Duration.EndOfTurn, filter2, false),
new BoostControlledEffect(1, 0, Duration.EndOfTurn),
new ManaWasSpentCondition(ColoredManaSymbol.R), " and creatures you control get +1/+0 until end of turn if {R} was spent to cast this spell"));
this.getSpellAbility().addEffect(new InfoEffect("<i>(Do both if {U}{R} was spent.)</i>"));

View file

@ -12,7 +12,7 @@ import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -22,12 +22,6 @@ import java.util.UUID;
*/
public final class WakerOfWaves extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public WakerOfWaves(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
this.subtype.add(SubType.WHALE);
@ -36,7 +30,8 @@ public final class WakerOfWaves extends CardImpl {
this.toughness = new MageInt(7);
// Creatures your opponents control get -1/-0.
this.addAbility(new SimpleStaticAbility(new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, filter, false)));
this.addAbility(new SimpleStaticAbility(
new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false)));
// {1}{U}, Discard Waker of Waves: Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.
Ability ability = new SimpleActivatedAbility(Zone.HAND,

View file

@ -33,7 +33,7 @@ public final class WarmongerHellkite extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// All creatures attack each combat if able.
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_PERMANENT_ALL_CREATURES, Duration.WhileOnBattlefield, true)));
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_PERMANENT_ALL_CREATURES)));
// {1}{R}: Attacking creatures get +1/+0 until end of turn.
this.addAbility(new SimpleActivatedAbility(new BoostAllEffect(1, 0, Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, false), new ManaCostsImpl("{1}{R}")));

View file

@ -10,8 +10,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;
import java.util.UUID;
@ -20,19 +19,13 @@ import java.util.UUID;
*/
public final class WindsOfQalSisma extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public WindsOfQalSisma(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Prevent all combat damage that would be dealt this turn.
// Ferocious - If you control a creature with power 4 or greater, instead prevent all combat damage that would be dealt this turn by creatures your opponents control.
Effect effect = new ConditionalReplacementEffect(
new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, true),
new PreventAllDamageByAllPermanentsEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, Duration.EndOfTurn, true),
new LockedInCondition(FerociousCondition.instance),
new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true));
effect.setText("Prevent all combat damage that would be dealt this turn.<br>" +

View file

@ -51,11 +51,11 @@ public class EntersBattlefieldControlledTriggeredAbility extends EntersBattlefie
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (super.checkTrigger(event, game)) {
Permanent permanent = game.getPermanent(event.getTargetId());
return permanent != null && permanent.isControlledBy(this.getControllerId());
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent == null || !permanent.isControlledBy(getControllerId())) {
return false;
}
return false;
return super.checkTrigger(event, game);
}
@Override

View file

@ -79,14 +79,14 @@ public class DetainTargetEffect extends OneShotEffect {
sb.append("detain up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName());
}
sb.append(". <i>(Until your next turn, ");
if (target instanceof TargetCreaturePermanent) {
sb.append(target.getMaxNumberOfTargets() == 1 ? "that creature" : "those creatures");
} else {
sb.append(target.getMaxNumberOfTargets() == 1 ? "that permanent" : "those permanents");
boolean plural = target.getMaxNumberOfTargets() > 1;
sb.append(plural ? "those " : "that ");
sb.append(target.getTargetName().contains("creature") ? "creature" : "permanent");
if (plural) {
sb.append('s');
}
sb.append(" can't attack or block and ");
sb.append(target.getMaxNumberOfTargets() == 1 ? "its" : "their");
sb.append(plural ? "their" : "its");
sb.append(" activated abilities can't be activated.)</i>");
return sb.toString();
}

View file

@ -5,9 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.PreventionEffectImpl;
import mage.constants.Duration;
import static mage.constants.Duration.EndOfTurn;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.DamageEvent;
import mage.game.events.GameEvent;
@ -29,7 +27,7 @@ public class PreventAllDamageByAllPermanentsEffect extends PreventionEffectImpl
this(null, duration, onlyCombat);
}
public PreventAllDamageByAllPermanentsEffect(FilterCreaturePermanent filter, Duration duration, boolean onlyCombat) {
public PreventAllDamageByAllPermanentsEffect(FilterPermanent filter, Duration duration, boolean onlyCombat) {
super(duration, Integer.MAX_VALUE, onlyCombat);
this.filter = filter;
}
@ -68,24 +66,17 @@ public class PreventAllDamageByAllPermanentsEffect extends PreventionEffectImpl
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
StringBuilder sb = new StringBuilder("Prevent all ");
StringBuilder sb = new StringBuilder("prevent all ");
if (onlyCombat) {
sb.append("combat ");
}
sb.append("damage ");
if (duration == EndOfTurn) {
if (filter != null) {
sb.append(filter.getMessage());
sb.append(" would deal this turn");
} else {
sb.append("that would be dealt this turn");
}
} else {
sb.append(duration.toString());
if (filter != null) {
sb.append(" dealt by ");
sb.append(filter.getMessage());
}
sb.append("damage that would be dealt");
if (duration == Duration.EndOfTurn) {
sb.append(" this turn");
}
if (filter != null) {
sb.append(" by ");
sb.append(filter.getMessage());
}
return sb.toString();
}

View file

@ -1,5 +1,3 @@
package mage.abilities.effects.common;
import mage.constants.Outcome;
@ -9,8 +7,6 @@ import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
@ -22,7 +18,7 @@ public class TapAllEffect extends OneShotEffect {
public TapAllEffect(FilterPermanent filter) {
super(Outcome.Tap);
this.filter = filter;
setText();
staticText = "tap all " + filter.getMessage();
}
public TapAllEffect(final TapAllEffect effect) {
@ -42,9 +38,4 @@ public class TapAllEffect extends OneShotEffect {
}
return true;
}
private void setText() {
staticText = "tap all " + filter.getMessage();
}
}

View file

@ -4,7 +4,7 @@ import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.effects.RequirementEffect;
import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.watchers.common.AttackedThisTurnWatcher;
@ -15,26 +15,27 @@ import mage.watchers.common.AttackedThisTurnWatcher;
*/
public class AttacksIfAbleAllEffect extends RequirementEffect {
private final FilterCreaturePermanent filter;
private final FilterPermanent filter;
private boolean eachCombat;
public AttacksIfAbleAllEffect(FilterCreaturePermanent filter) {
public AttacksIfAbleAllEffect(FilterPermanent filter) {
this(filter, Duration.WhileOnBattlefield);
}
boolean eachCombat;
public AttacksIfAbleAllEffect(FilterCreaturePermanent filter, Duration duration) {
this(filter, duration, false);
}
public AttacksIfAbleAllEffect(FilterCreaturePermanent filter, Duration duration, boolean eachCombat) {
public AttacksIfAbleAllEffect(FilterPermanent filter, Duration duration) {
super(duration);
this.filter = filter;
this.eachCombat = eachCombat;
if (this.duration == Duration.EndOfTurn) {
staticText = filter.getMessage() + " attack " + (eachCombat ? "each combat" : "this turn") + " if able";
eachCombat = false;
staticText = filter.getMessage() + " attack this turn if able";
} else {
staticText = filter.getMessage() + " attack each " + (eachCombat ? "combat" : "turn") + " if able";
eachCombat = true;
String durationString = this.duration.toString();
if (durationString.isEmpty()) {
staticText = filter.getMessage() + " attack each combat if able";
} else {
staticText = durationString + ", " + filter.getMessage() + " attack each combat if able";
}
}
}

View file

@ -1,4 +1,3 @@
package mage.abilities.effects.common.combat;
import mage.abilities.Ability;
@ -23,11 +22,8 @@ public class BlocksIfAbleAllEffect extends RequirementEffect {
public BlocksIfAbleAllEffect(FilterCreaturePermanent filter, Duration duration) {
super(duration);
staticText = new StringBuilder(filter.getMessage())
.append(" block ")
.append(duration == Duration.EndOfTurn ? "this":"each")
.append(" turn if able").toString();
this.filter = filter;
staticText = filter.getMessage() + " block " + (duration == Duration.EndOfTurn ? "this turn" : "each combat") + " if able";
}
public BlocksIfAbleAllEffect(final BlocksIfAbleAllEffect effect) {
super(effect);
@ -58,7 +54,4 @@ public class BlocksIfAbleAllEffect extends RequirementEffect {
public boolean mustAttack(Game game) {
return false;
}
}

View file

@ -1,4 +1,3 @@
package mage.abilities.effects.common.continuous;
import mage.abilities.Ability;
@ -8,6 +7,7 @@ import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -22,11 +22,15 @@ public class CreaturesCantGetOrHaveAbilityEffect extends ContinuousEffectImpl {
private final Ability ability;
private final FilterCreaturePermanent filter;
public CreaturesCantGetOrHaveAbilityEffect(Ability ability, Duration duration) {
this(ability, duration, StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES);
}
public CreaturesCantGetOrHaveAbilityEffect(Ability ability, Duration duration, FilterCreaturePermanent filter) {
super(duration, Outcome.Detriment);
this.ability = ability;
this.filter = filter;
setText();
staticText = filter.getMessage() + " lose " + ability.getRule() + " and can't have or gain " + ability.getRule();
addDependedToType(DependencyType.AddingAbility);
}
@ -65,14 +69,4 @@ public class CreaturesCantGetOrHaveAbilityEffect extends ContinuousEffectImpl {
public boolean hasLayer(Layer layer) {
return layer == Layer.AbilityAddingRemovingEffects_6;
}
private void setText() {
StringBuilder sb = new StringBuilder();
sb.append(filter.getMessage());
sb.append(" lose ");
sb.append(ability.getRule());
sb.append(" can't have or gain ");
sb.append(ability.getRule());
staticText = sb.toString();
}
}

View file

@ -433,17 +433,15 @@ public final class StaticFilters {
FILTER_OPPONENTS_PERMANENT.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_OPPONENTS_PERMANENT_CREATURE = new FilterCreaturePermanent("creature an opponent controls");
public static final FilterCreaturePermanent FILTER_OPPONENTS_PERMANENT_CREATURE = new FilterOpponentsCreaturePermanent();
static {
FILTER_OPPONENTS_PERMANENT_CREATURE.add(TargetController.OPPONENT.getControllerPredicate());
FILTER_OPPONENTS_PERMANENT_CREATURE.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_OPPONENTS_PERMANENT_CREATURES = new FilterCreaturePermanent("creatures an opponent controls");
public static final FilterCreaturePermanent FILTER_OPPONENTS_PERMANENT_CREATURES = new FilterOpponentsCreaturePermanent("creatures your opponents control");
static {
FILTER_OPPONENTS_PERMANENT_CREATURES.add(TargetController.OPPONENT.getControllerPredicate());
FILTER_OPPONENTS_PERMANENT_CREATURES.setLockedFilter(true);
}

View file

@ -7,8 +7,7 @@ import mage.abilities.effects.common.combat.CantBlockSourceEffect;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.Arrays;
@ -17,12 +16,6 @@ import java.util.Arrays;
*/
public final class PursuedWhaleToken extends TokenImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
}
public PursuedWhaleToken() {
super("Pirate Token", "1/1 red Pirate creature token with \"This creature can't block\" and \"Creatures you control attack each combat if able.\"");
cardType.add(CardType.CREATURE);
@ -33,9 +26,7 @@ public final class PursuedWhaleToken extends TokenImpl {
this.addAbility(new SimpleStaticAbility(new CantBlockSourceEffect(Duration.WhileOnBattlefield)
.setText("this creature can't block")));
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(
filter, Duration.WhileOnBattlefield, true
)));
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_CONTROLLED_CREATURES)));
availableImageSetCodes = Arrays.asList("M21");
}

View file

@ -1,16 +1,13 @@
package mage.game.permanent.token;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.constants.SubType;
import mage.filter.StaticFilters;
/**
*
@ -18,12 +15,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public final class SpyMasterGoblinToken extends TokenImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
}
public SpyMasterGoblinToken() {
super("Goblin Token", "1/1 red Goblin creature token with \"Creatures you control attack each combat if able.\"");
cardType.add(CardType.CREATURE);
@ -32,8 +23,7 @@ public final class SpyMasterGoblinToken extends TokenImpl {
power = new MageInt(1);
toughness = new MageInt(1);
Effect effect = new AttacksIfAbleAllEffect(filter, Duration.WhileOnBattlefield, true);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
this.addAbility(new SimpleStaticAbility(new AttacksIfAbleAllEffect(StaticFilters.FILTER_CONTROLLED_CREATURES)));
}
public SpyMasterGoblinToken(final SpyMasterGoblinToken token) {

View file

@ -1,32 +1,24 @@
package mage.target.common;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
/**
*
* @author Styxo
* @author awjackson
*/
public class TargetOpponentsCreaturePermanent extends TargetCreaturePermanent {
public class TargetOpponentsCreaturePermanent extends TargetPermanent {
public TargetOpponentsCreaturePermanent() {
this(1, 1, new FilterOpponentsCreaturePermanent(), false);
this(1);
}
public TargetOpponentsCreaturePermanent(int numTargets) {
this(numTargets, numTargets, new FilterOpponentsCreaturePermanent(), false);
this(numTargets, numTargets);
}
public TargetOpponentsCreaturePermanent(int minNumTargets, int maxNumTargets) {
this(minNumTargets, maxNumTargets, new FilterOpponentsCreaturePermanent(), false);
}
public TargetOpponentsCreaturePermanent(FilterOpponentsCreaturePermanent filter) {
super(1, 1, filter, false);
}
public TargetOpponentsCreaturePermanent(int minNumTargets, int maxNumTargets, FilterOpponentsCreaturePermanent filter, boolean notTarget) {
super(minNumTargets, maxNumTargets, filter, notTarget);
this.targetName = filter.getMessage();
super(minNumTargets, maxNumTargets, maxNumTargets > 1 ? StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES : StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE);
}
public TargetOpponentsCreaturePermanent(final TargetOpponentsCreaturePermanent target) {