1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-29 01:09:05 -09:00

add ProtectionAbility helpers

for the most common 1 and 2 color cases
This commit is contained in:
Neil Gentleman 2016-10-16 20:11:56 -07:00
parent 3f7d75b6ca
commit ce6087bda6
142 changed files with 209 additions and 1268 deletions
Mage.Sets/src/mage/cards
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterObject;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,11 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class AbbeyGargoyles extends CardImpl {
private static final FilterObject filter = new FilterObject("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public AbbeyGargoyles(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}{W}");
this.subtype.add("Gargoyle");
@ -58,7 +51,7 @@ public class AbbeyGargoyles extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public AbbeyGargoyles(final AbbeyGargoyles card) {

View file

@ -39,9 +39,7 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -49,17 +47,11 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class AbsoluteGrace extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public AbsoluteGrace(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}");
Ability ability = new ProtectionAbility(filter);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false)));
Ability ability = ProtectionAbility.from(ObjectColor.BLACK);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures"), false)));
}
public AbsoluteGrace(final AbsoluteGrace card) {

View file

@ -39,9 +39,7 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -49,17 +47,11 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class AbsoluteLaw extends CardImpl {
private static final FilterCard filter = new FilterCard("Red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public AbsoluteLaw(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}");
Ability ability = new ProtectionAbility(filter);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false)));
Ability ability = ProtectionAbility.from(ObjectColor.RED);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures"), false)));
}
public AbsoluteLaw(final AbsoluteLaw card) {

View file

@ -17,8 +17,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent.EventType;
@ -90,13 +88,6 @@ class AkkiLavarunnerAbility extends TriggeredAbilityImpl {
}
class TokTokVolcanoBorn extends Token {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
TokTokVolcanoBorn() {
super("Tok-Tok, Volcano Born", "");
supertype.add("Legendary");
@ -106,7 +97,7 @@ class TokTokVolcanoBorn extends Token {
subtype.add("Shaman");
power = new MageInt(2);
toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TokTokVolcanoBornEffect()));
}
}

View file

@ -43,9 +43,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -53,12 +50,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class AkromaAngelOfFury extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("white and from blue");
static {
protectionFilter.add(Predicates.or(new ColorPredicate(ObjectColor.WHITE),new ColorPredicate(ObjectColor.BLUE)));
}
public AkromaAngelOfFury(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}{R}{R}");
this.supertype.add("Legendary");
@ -74,7 +65,7 @@ public class AkromaAngelOfFury extends CardImpl {
// Trample
this.addAbility(TrampleAbility.getInstance());
// protection from white and from blue
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE, ObjectColor.BLUE));
// {R}: Akroma, Angel of Fury gets +1/+0 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{R}")));
// Morph {3}{R}{R}{R}

View file

@ -34,9 +34,6 @@ import mage.ObjectColor;
import mage.abilities.keyword.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class AkromaAngelOfWrath extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("black and from red");
static {
protectionFilter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK),new ColorPredicate(ObjectColor.RED)));
}
public AkromaAngelOfWrath(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}{W}");
this.supertype.add("Legendary");
@ -64,7 +55,7 @@ public class AkromaAngelOfWrath extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
this.addAbility(HasteAbility.getInstance());
// protection from black and from red
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED));
}
public AkromaAngelOfWrath(final AkromaAngelOfWrath card) {

View file

@ -37,31 +37,22 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import java.util.UUID;
import mage.filter.predicate.Predicates;
/**
* @author Loki, noxx
*/
public class AkromasMemorial extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("black and from red");
static {
protectionFilter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK),new ColorPredicate(ObjectColor.RED)));
}
public AkromasMemorial(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{7}");
this.supertype.add("Legendary");
// Creatures you control have flying, first strike, vigilance, trample, haste, and protection from black and from red.
CompoundAbility compoundAbilities = new CompoundAbility(FlyingAbility.getInstance(), FirstStrikeAbility.getInstance(), VigilanceAbility.getInstance(), TrampleAbility.getInstance(), HasteAbility.getInstance(), new ProtectionAbility(protectionFilter));
CompoundAbility compoundAbilities = new CompoundAbility(FlyingAbility.getInstance(), FirstStrikeAbility.getInstance(), VigilanceAbility.getInstance(),
TrampleAbility.getInstance(), HasteAbility.getInstance(), ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(compoundAbilities, Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Creatures"))));
}

View file

@ -47,11 +47,8 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
@ -63,11 +60,7 @@ import mage.util.CardUtil;
public class AnimarSoulOfElements extends CardImpl {
private static final FilterSpell filterSpell = new FilterSpell("a creature spell");
private static final FilterCard filter = new FilterCard("white and from black");
static {
filter.add(Predicates.or(
new ColorPredicate(ObjectColor.WHITE),
new ColorPredicate(ObjectColor.BLACK)));
filterSpell.add(new CardTypePredicate(CardType.CREATURE));
}
@ -80,7 +73,7 @@ public class AnimarSoulOfElements extends CardImpl {
this.toughness = new MageInt(1);
// Protection from white and from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE, ObjectColor.BLACK));
// Whenever you cast a creature spell, put a +1/+1 counter on Animar, Soul of Elements.
this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filterSpell, false));

View file

@ -36,9 +36,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -46,12 +43,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class AuriokChampion extends CardImpl {
static final FilterCard filter = new FilterCard("black and from red");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK),new ColorPredicate(ObjectColor.RED)));
}
public AuriokChampion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
this.subtype.add("Human");
@ -61,7 +52,7 @@ public class AuriokChampion extends CardImpl {
this.toughness = new MageInt(1);
// Protection from black and from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED));
// Whenever another creature enters the battlefield, you may gain 1 life.
this.addAbility(new AnotherCreatureEntersBattlefieldTriggeredAbility(new GainLifeEffect(1), true));

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class AvenSmokeweaver extends CardImpl {
static final FilterCard filter = new FilterCard("red");
static{
filter.add(new ColorPredicate(ObjectColor.RED));
}
public AvenSmokeweaver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}");
this.subtype.add("Bird");
@ -61,7 +53,7 @@ public class AvenSmokeweaver extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public AvenSmokeweaver(final AvenSmokeweaver card) {

View file

@ -40,7 +40,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
@ -52,11 +51,9 @@ import mage.filter.predicate.permanent.TokenPredicate;
*/
public class BeastsOfBogardan extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("red");
private static final FilterPermanent controlFilter = new FilterPermanent("nontoken white permanent");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.RED));
controlFilter.add(new ColorPredicate(ObjectColor.WHITE));
controlFilter.add(Predicates.not(new TokenPredicate()));
}
@ -68,7 +65,7 @@ public class BeastsOfBogardan extends CardImpl {
this.toughness = new MageInt(3);
// Protection from red
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// Beasts of Bogardan gets +1/+1 as long as an opponent controls a nontoken white permanent.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield),

View file

@ -36,8 +36,6 @@ import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -45,12 +43,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class BlackKnight extends CardImpl {
private static final FilterCard filter = new FilterCard("White");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public BlackKnight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
this.subtype.add("Human");
@ -60,7 +52,7 @@ public class BlackKnight extends CardImpl {
this.toughness = new MageInt(2);
this.addAbility(FirstStrikeAbility.getInstance());
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
}
public BlackKnight(final BlackKnight card) {

View file

@ -36,8 +36,6 @@ import mage.abilities.keyword.CyclingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -45,12 +43,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class BloatedToad extends CardImpl {
private static final FilterCard filter = new FilterCard("Blue");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public BloatedToad(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
this.subtype.add("Frog");
@ -58,7 +50,7 @@ public class BloatedToad extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -44,23 +44,12 @@ import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
public class BloodBaronOfVizkopa extends CardImpl {
private static final FilterCard filter = new FilterCard("white and from black");
static {
filter.add(Predicates.or(
new ColorPredicate(ObjectColor.WHITE),
new ColorPredicate(ObjectColor.BLACK)));
}
public BloodBaronOfVizkopa(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{B}");
this.subtype.add("Vampire");
@ -70,7 +59,7 @@ public class BloodBaronOfVizkopa extends CardImpl {
// Lifelink, protection from white and from black.
this.addAbility(LifelinkAbility.getInstance());
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE, ObjectColor.BLACK));
// As long as you have 30 or more life and an opponent has 10 or less life, Blood Baron of Vizkopa gets +6/+6 and has flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BloodBaronOfVizkopaEffect()));

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class BloodKnight extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public BloodKnight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{R}");
this.subtype.add("Human");
@ -61,7 +53,7 @@ public class BloodKnight extends CardImpl {
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
}
public BloodKnight(final BloodKnight card) {

View file

@ -39,9 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -50,12 +48,6 @@ import mage.target.common.TargetControlledPermanent;
*/
public class BogElemental extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public BogElemental(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
this.subtype.add("Elemental");
@ -63,7 +55,7 @@ public class BogElemental extends CardImpl {
this.toughness = new MageInt(4);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// At the beginning of your upkeep, sacrifice Bog Elemental unless you sacrifice a land.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,

View file

@ -38,7 +38,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterObject;
import mage.filter.predicate.mageobject.ColorPredicate;
@ -48,11 +47,9 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class BurrentonForgeTender extends CardImpl {
private static final FilterCard filter = new FilterCard("Red");
private static final FilterObject filterObject = new FilterObject("a red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
filterObject.add(new ColorPredicate(ObjectColor.RED));
}
@ -65,7 +62,7 @@ public class BurrentonForgeTender extends CardImpl {
this.toughness = new MageInt(1);
// Protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// Sacrifice Burrenton Forge-Tender: Prevent all damage a red source of your choice would deal this turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageBySourceEffect(filterObject), new SacrificeSourceCost()));

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class CemeteryGate extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public CemeteryGate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
this.subtype.add("Wall");
@ -60,7 +52,7 @@ public class CemeteryGate extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}
public CemeteryGate(final CemeteryGate card) {

View file

@ -44,12 +44,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class CeruleanWyvern extends CardImpl {
private static final FilterCard filter = new FilterCard("green");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}
public CeruleanWyvern(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}");
this.subtype.add("Drake");
@ -59,7 +53,7 @@ public class CeruleanWyvern extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from green
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.GREEN));
}
public CeruleanWyvern(final CeruleanWyvern card) {

View file

@ -42,8 +42,6 @@ import mage.abilities.keyword.ChangelingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -51,12 +49,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class ChameleonColossus extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public ChameleonColossus(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
this.subtype.add("Shapeshifter");
@ -68,7 +60,7 @@ public class ChameleonColossus extends CardImpl {
this.addAbility(ChangelingAbility.getInstance());
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// {2}{G}{G}: Chameleon Colossus gets +X/+X until end of turn, where X is its power.
SourcePermanentPowerCount x = new SourcePermanentPowerCount();

View file

@ -39,9 +39,7 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -52,12 +50,10 @@ public class ChoArrimLegate extends CardImpl {
private static final FilterPermanent filterPlains = new FilterPermanent();
private static final FilterPermanent filterSwamp = new FilterPermanent();
private static final FilterCard filter = new FilterCard("black");
static {
filterPlains.add(new SubtypePredicate(("Plains")));
filterSwamp.add(new SubtypePredicate(("Swamp")));
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public ChoArrimLegate(UUID ownerId, CardSetInfo setInfo) {
@ -68,7 +64,7 @@ public class ChoArrimLegate extends CardImpl {
this.toughness = new MageInt(2);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// If an opponent controls a Swamp and you control a Plains, you may cast Cho-Arrim Legate without paying its mana cost.
Condition condition = new CompoundCondition("If an opponent controls a Swamp and you control a Plains",

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class CoastWatcher extends CardImpl {
private static final FilterCard filter = new FilterCard("green");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}
public CoastWatcher(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
this.subtype.add("Bird");
@ -60,7 +52,7 @@ public class CoastWatcher extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from green
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.GREEN));
}
public CoastWatcher(final CoastWatcher card) {

View file

@ -40,8 +40,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
@ -50,12 +48,6 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class CrimsonAcolyte extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("Red");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.RED));
}
public CrimsonAcolyte(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Human");
@ -64,11 +56,11 @@ public class CrimsonAcolyte extends CardImpl {
this.toughness = new MageInt(1);
// Protection from red
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// {W}: Target creature gains protection from red until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new GainAbilityTargetEffect(new ProtectionAbility(protectionFilter), Duration.EndOfTurn),
new GainAbilityTargetEffect(ProtectionAbility.from(ObjectColor.RED), Duration.EndOfTurn),
new ManaCostsImpl("{W}"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);

View file

@ -37,9 +37,7 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -49,10 +47,8 @@ import mage.filter.predicate.permanent.ControllerPredicate;
*/
public class CrusadingKnight extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("Black");
private static final FilterLandPermanent swampFilter = new FilterLandPermanent("Swamp your opponent controls");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.BLACK));
swampFilter.add(new SubtypePredicate("Swamp"));
swampFilter.add(new ControllerPredicate(TargetController.OPPONENT));
}
@ -65,7 +61,7 @@ public class CrusadingKnight extends CardImpl {
this.toughness = new MageInt(2);
// Protection from black
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Crusading Knight gets +1/+1 for each Swamp your opponents control.
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(swampFilter, 1);

View file

@ -38,7 +38,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
@ -47,15 +46,12 @@ import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author LoneFox
*/
public class CryptAngel extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
private static final FilterCreatureCard filter2 = new FilterCreatureCard("blue or red creature card from your graveyard");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
filter2.add(Predicates.or(new ColorPredicate(ObjectColor.RED), new ColorPredicate(ObjectColor.BLUE)));
}
@ -68,7 +64,7 @@ public class CryptAngel extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// When Crypt Angel enters the battlefield, return target blue or red creature card from your graveyard to your hand.
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false);
ability.addTarget(new TargetCardInYourGraveyard(filter2));

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.CyclingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import java.util.UUID;
@ -45,12 +43,6 @@ import java.util.UUID;
*/
public class DarkwatchElves extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public DarkwatchElves(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
this.subtype.add("Elf");
@ -58,7 +50,7 @@ public class DarkwatchElves extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -43,12 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class DeathSpeakers extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public DeathSpeakers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}");
this.subtype.add("Human");
@ -57,7 +49,7 @@ public class DeathSpeakers extends CardImpl {
this.toughness = new MageInt(1);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}
public DeathSpeakers(final DeathSpeakers card) {

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import java.util.UUID;
@ -44,12 +42,6 @@ import java.util.UUID;
*/
public class DefenderOfChaos extends CardImpl {
private static final FilterCard filter = new FilterCard("White");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public DefenderOfChaos(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
this.subtype.add("Human");
@ -59,7 +51,7 @@ public class DefenderOfChaos extends CardImpl {
this.toughness = new MageInt(1);
this.addAbility(FlashAbility.getInstance());
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
}
public DefenderOfChaos(final DefenderOfChaos card) {

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import java.util.UUID;
@ -44,12 +42,6 @@ import java.util.UUID;
*/
public class DefenderOfLaw extends CardImpl {
private static final FilterCard filter = new FilterCard("Red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public DefenderOfLaw(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
this.subtype.add("Human");
@ -59,7 +51,7 @@ public class DefenderOfLaw extends CardImpl {
this.toughness = new MageInt(1);
this.addAbility(FlashAbility.getInstance());
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public DefenderOfLaw(final DefenderOfLaw card) {

View file

@ -36,7 +36,6 @@ import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.TargetPermanent;
@ -47,11 +46,9 @@ import mage.target.TargetPermanent;
*/
public class DevoutLightcaster extends CardImpl {
private static final FilterCard filterProtection = new FilterCard("Black");
private static final FilterPermanent filterTarget = new FilterPermanent("black permanent");
static {
filterProtection.add(new ColorPredicate(ObjectColor.BLACK));
filterTarget.add(new ColorPredicate(ObjectColor.BLACK));
}
@ -63,7 +60,7 @@ public class DevoutLightcaster extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filterProtection));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect());
ability.addTarget(new TargetPermanent(filterTarget));
this.addAbility(ability);

View file

@ -36,8 +36,6 @@ import mage.abilities.keyword.CyclingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import java.util.UUID;
@ -46,12 +44,6 @@ import java.util.UUID;
*/
public class DiscipleOfGrace extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public DiscipleOfGrace(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Human");
@ -61,7 +53,7 @@ public class DiscipleOfGrace extends CardImpl {
this.toughness = new MageInt(2);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));

View file

@ -37,8 +37,6 @@ import mage.abilities.keyword.CyclingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -46,12 +44,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class DiscipleOfLaw extends CardImpl {
private static final FilterCard filter = new FilterCard("Red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public DiscipleOfLaw(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Human");
@ -59,9 +51,9 @@ public class DiscipleOfLaw extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}
public DiscipleOfLaw(final DiscipleOfLaw card) {
super(card);

View file

@ -36,8 +36,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -45,12 +43,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class DiscipleOfMalice extends CardImpl {
private static final FilterCard filter = new FilterCard("White");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public DiscipleOfMalice(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
this.subtype.add("Human");
@ -59,7 +51,7 @@ public class DiscipleOfMalice extends CardImpl {
this.toughness = new MageInt(2);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// Cycling {2}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -39,8 +39,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -48,12 +46,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class DrossHarvester extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public DrossHarvester(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}");
this.subtype.add("Horror");
@ -61,7 +53,7 @@ public class DrossHarvester extends CardImpl {
this.toughness = new MageInt(4);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// At the beginning of your end step, you lose 4 life.
this.addAbility(new BeginningOfEndStepTriggeredAbility(new LoseLifeSourceControllerEffect(4),
TargetController.YOU, false));

View file

@ -40,8 +40,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.events.GameEvent;
/**
@ -51,11 +49,6 @@ import mage.game.events.GameEvent;
public class DuneriderOutlaw extends CardImpl {
private static final String ruleText = "At the beginning of each end step, if {this} dealt damage to an opponent this turn, put a +1/+1 counter on it.";
private static final FilterCard filter = new FilterCard("green");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}
public DuneriderOutlaw(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
@ -68,7 +61,7 @@ public class DuneriderOutlaw extends CardImpl {
this.toughness = new MageInt(1);
// Protection from green
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.GREEN));
// At the beginning of each end step, if Dunerider Outlaw dealt damage to an opponent this turn, put a +1/+1 counter on it.
TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of each end step", true, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
this.addAbility(new ConditionalTriggeredAbility(triggered, new DealtDamageToAnOpponent(), ruleText));

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class DuskriderFalcon extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public DuskriderFalcon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Bird");
@ -59,7 +51,7 @@ public class DuskriderFalcon extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}
public DuskriderFalcon(final DuskriderFalcon card) {

View file

@ -37,8 +37,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -46,11 +44,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class DuskriderPeregrine extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public DuskriderPeregrine(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}");
this.subtype.add("Bird");
@ -61,7 +54,7 @@ public class DuskriderPeregrine extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Suspend 3-{1}{W}
this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{1}{W}"), this));

View file

@ -41,9 +41,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.Target;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetSpellOrPermanent;
@ -54,11 +51,6 @@ import mage.target.common.TargetSpellOrPermanent;
*/
public class EightAndAHalfTails extends CardImpl {
private static final Filter filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public EightAndAHalfTails(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
this.supertype.add("Legendary");
@ -69,7 +61,7 @@ public class EightAndAHalfTails extends CardImpl {
this.toughness = new MageInt(2);
// {1}{W}: Target permanent you control gains protection from white until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new ProtectionAbility(filter), Duration.EndOfTurn), new ManaCostsImpl("{1}{W}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(ProtectionAbility.from(ObjectColor.WHITE), Duration.EndOfTurn), new ManaCostsImpl("{1}{W}"));
Target target = new TargetControlledPermanent();
ability.addTarget(target);
this.addAbility(ability);

View file

@ -36,8 +36,6 @@ import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -45,12 +43,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class Eviscerator extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public Eviscerator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
this.subtype.add("Horror");
@ -59,7 +51,7 @@ public class Eviscerator extends CardImpl {
this.toughness = new MageInt(5);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// When Eviscerator enters the battlefield, you lose 5 life.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(5)));
}

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
@ -45,11 +43,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class FreewindFalcon extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public FreewindFalcon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Bird");
@ -60,7 +53,7 @@ public class FreewindFalcon extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public FreewindFalcon(final FreewindFalcon card) {

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -43,12 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class GalinasKnight extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("Red");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.RED));
}
public GalinasKnight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{U}");
this.subtype.add("Merfolk");
@ -57,7 +49,7 @@ public class GalinasKnight extends CardImpl {
this.toughness = new MageInt(2);
// Protection from red
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public GalinasKnight(final GalinasKnight card) {

View file

@ -35,29 +35,22 @@ import mage.ObjectColor;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author Loki
*/
public class GoblinOutlander extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public GoblinOutlander(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{R}");
this.subtype.add("Goblin");
this.subtype.add("Scout");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
this.toughness = new MageInt(2);
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
}
public GoblinOutlander(final GoblinOutlander card) {

View file

@ -39,9 +39,7 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.common.FilterAttackingCreature;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
@ -51,13 +49,11 @@ import mage.filter.predicate.permanent.AnotherPredicate;
*/
public class GoblinPiledriver extends CardImpl {
private static final FilterCard filter1 = new FilterCard("blue");
private static final FilterAttackingCreature filter2 = new FilterAttackingCreature("other attacking Goblin");
private static final FilterAttackingCreature filter = new FilterAttackingCreature("other attacking Goblin");
static {
filter1.add(new ColorPredicate(ObjectColor.BLUE));
filter2.add(new SubtypePredicate("Goblin"));
filter2.add(new AnotherPredicate());
filter.add(new SubtypePredicate("Goblin"));
filter.add(new AnotherPredicate());
}
public GoblinPiledriver(UUID ownerId, CardSetInfo setInfo) {
@ -69,9 +65,9 @@ public class GoblinPiledriver extends CardImpl {
this.toughness = new MageInt(2);
// Protection from blue
this.addAbility(new ProtectionAbility(filter1));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
// Whenever Goblin Piledriver attacks, it gets +2/+0 until end of turn for each other attacking Goblin.
PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter2, 2);
PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter, 2);
this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, new StaticValue(0), Duration.EndOfTurn, true), false));
}

View file

@ -43,10 +43,8 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.Target;
import mage.target.TargetPermanent;
@ -58,13 +56,11 @@ import mage.target.TargetPermanent;
public class GoblinWizard extends CardImpl {
private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin");
private static final FilterCard protectionFilter = new FilterCard("white");
private static final FilterPermanent goblinPermanent = new FilterPermanent("Goblin");
static {
filter.add(new SubtypePredicate("Goblin"));
goblinPermanent.add(new SubtypePredicate("Goblin"));
protectionFilter.add(new ColorPredicate(ObjectColor.WHITE));
}
public GoblinWizard(UUID ownerId, CardSetInfo setInfo) {
@ -84,7 +80,7 @@ public class GoblinWizard extends CardImpl {
// {R}: Target Goblin gains protection from white until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new GainAbilityTargetEffect(new ProtectionAbility(protectionFilter), Duration.EndOfTurn), new ManaCostsImpl("{R}"));
new GainAbilityTargetEffect(ProtectionAbility.from(ObjectColor.WHITE), Duration.EndOfTurn), new ManaCostsImpl("{R}"));
Target target = new TargetPermanent(goblinPermanent);
ability.addTarget(target);
this.addAbility(ability);

View file

@ -38,21 +38,12 @@ import mage.abilities.effects.common.CantBeCounteredSourceEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class GreatSableStag extends CardImpl {
private static final FilterCard filter1 = new FilterCard("Blue");
private static final FilterCard filter2 = new FilterCard("Black");
static {
filter1.add(new ColorPredicate(ObjectColor.BLUE));
filter2.add(new ColorPredicate(ObjectColor.BLACK));
}
public GreatSableStag(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}");
@ -61,8 +52,7 @@ public class GreatSableStag extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addAbility(new ProtectionAbility(filter1));
this.addAbility(new ProtectionAbility(filter2));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE, ObjectColor.BLACK));
this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantBeCounteredSourceEffect()));
}

View file

@ -44,9 +44,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -54,12 +51,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class GrotesqueHybrid extends CardImpl {
private static final FilterCard filter = new FilterCard("green and from white");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), new ColorPredicate(ObjectColor.WHITE)));
}
public GrotesqueHybrid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}");
this.subtype.add("Zombie");
@ -73,7 +64,7 @@ public class GrotesqueHybrid extends CardImpl {
Effect effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn);
effect.setText("{this} gains flying");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new DiscardCardCost());
effect = new GainAbilitySourceEffect(new ProtectionAbility(filter), Duration.EndOfTurn);
effect = new GainAbilitySourceEffect(ProtectionAbility.from(ObjectColor.GREEN, ObjectColor.WHITE), Duration.EndOfTurn);
effect.setText("and protection from green and from white until end of turn");
ability.addEffect(effect);
this.addAbility(ability);

View file

@ -35,8 +35,6 @@ import mage.ObjectColor;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,20 +42,14 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class Guma extends CardImpl {
private static final FilterCard filter = new FilterCard("Blue");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public Guma(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
this.subtype.add("Cat");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
}
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
}
public Guma(final Guma card) {
super(card);

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.BushidoAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class HandOfCruelty extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public HandOfCruelty(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
this.subtype.add("Human");
@ -58,7 +50,7 @@ public class HandOfCruelty extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
this.addAbility(new BushidoAbility(1));
}

View file

@ -36,20 +36,12 @@ import mage.abilities.keyword.BushidoAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
* @author anonymous
*/
public class HandOfHonor extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public HandOfHonor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
this.subtype.add("Human");
@ -58,7 +50,7 @@ public class HandOfHonor extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
this.addAbility(new BushidoAbility(1));
}

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class HazeriderDrake extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public HazeriderDrake(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{U}");
this.subtype.add("Drake");
@ -59,7 +51,7 @@ public class HazeriderDrake extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public HazeriderDrake(final HazeriderDrake card) {

View file

@ -39,22 +39,16 @@ import mage.constants.CardType;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.abilities.common.SimpleActivatedAbility;
import mage.constants.Duration;
import mage.abilities.keyword.ProtectionAbility;
/**
*
* @author tomd1990
*/
public class HellBentRaider extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("White");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.WHITE));
}
public HellBentRaider(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{R}");
this.subtype.add("Human");
@ -68,7 +62,7 @@ public class HellBentRaider extends CardImpl {
this.addAbility(HasteAbility.getInstance());
// Discard a card at random: Hell-Bent Raider gains protection from white until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new GainAbilitySourceEffect( new ProtectionAbility(protectionFilter), Duration.EndOfTurn),
new GainAbilitySourceEffect(ProtectionAbility.from(ObjectColor.WHITE), Duration.EndOfTurn),
new DiscardCardCost(true));
this.addAbility(ability);
}

View file

@ -39,8 +39,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.permanent.token.Token;
import mage.target.Target;
import mage.target.common.TargetOpponent;
@ -77,13 +75,6 @@ public class HuntedHorror extends CardImpl {
}
class CentaurToken extends Token {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
CentaurToken() {
super("Centaur", "3/3 green Centaur creature tokens with protection from black");
cardType.add(CardType.CREATURE);
@ -91,7 +82,7 @@ class CentaurToken extends Token {
subtype.add("Centaur");
power = new MageInt(3);
toughness = new MageInt(3);
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}
}

View file

@ -34,22 +34,13 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class IhsansShade extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public IhsansShade(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}");
this.supertype.add("Legendary");
@ -59,7 +50,7 @@ public class IhsansShade extends CardImpl {
this.toughness = new MageInt(5);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
}
public IhsansShade(final IhsansShade card) {

View file

@ -40,7 +40,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
@ -54,12 +53,10 @@ import mage.filter.predicate.permanent.TokenPredicate;
*/
public class IvoryGuardians extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("red");
private static final FilterPermanent controlFilter = new FilterPermanent("nontoken red permanent");
private static final FilterCreaturePermanent boostFilter = new FilterCreaturePermanent();
static {
protectionFilter.add(new ColorPredicate(ObjectColor.RED));
controlFilter.add(new ColorPredicate(ObjectColor.RED));
controlFilter.add(Predicates.not(new TokenPredicate()));
boostFilter.add(new NamePredicate("Ivory Guardians"));
@ -73,7 +70,7 @@ public class IvoryGuardians extends CardImpl {
this.toughness = new MageInt(3);
// Protection from red
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// Creatures named Ivory Guardians get +1/+1 as long as an opponent controls a nontoken red permanent.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, boostFilter, false),

View file

@ -39,9 +39,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**
@ -50,12 +48,6 @@ import mage.target.common.TargetCardInYourGraveyard;
*/
public class KarmicGuide extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public KarmicGuide(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}");
this.subtype.add("Angel");
@ -66,7 +58,7 @@ public class KarmicGuide extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Echo {3}{W}{W}
this.addAbility(new EchoAbility("{3}{W}{W}"));
// When Karmic Guide enters the battlefield, return target creature card from your graveyard to the battlefield.

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -43,12 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class KarooMeerkat extends CardImpl {
private static final FilterCard filter = new FilterCard("blue");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public KarooMeerkat(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}");
this.subtype.add("Mongoose");
@ -56,7 +48,7 @@ public class KarooMeerkat extends CardImpl {
this.toughness = new MageInt(1);
// Protection from blue
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
}
public KarooMeerkat(final KarooMeerkat card) {

View file

@ -40,8 +40,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -49,13 +47,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class KeeperOfKookus extends CardImpl {
private static final FilterCard filter = new FilterCard("from red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public KeeperOfKookus(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
this.subtype.add("Goblin");
@ -63,8 +54,8 @@ public class KeeperOfKookus extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Keeper of Kookus gains protection from red until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(new ProtectionAbility(filter), Duration.EndOfTurn),new ManaCostsImpl("{R"));
// {R}: Keeper of Kookus gains protection from red until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(ProtectionAbility.from(ObjectColor.RED), Duration.EndOfTurn), new ManaCostsImpl("{R}"));
this.addAbility(ability);
}

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class KnightOfGlory extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public KnightOfGlory(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Human");
@ -59,7 +51,7 @@ public class KnightOfGlory extends CardImpl {
this.toughness = new MageInt(1);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Exalted
this.addAbility(new ExaltedAbility());

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ExaltedAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class KnightOfInfamy extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public KnightOfInfamy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
this.subtype.add("Human");
@ -59,7 +51,7 @@ public class KnightOfInfamy extends CardImpl {
this.toughness = new MageInt(1);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// Exalted
this.addAbility(new ExaltedAbility());
}

View file

@ -41,8 +41,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -51,12 +49,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class KnightOfStromgald extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public KnightOfStromgald(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
this.subtype.add("Human");
@ -65,7 +57,7 @@ public class KnightOfStromgald extends CardImpl {
this.toughness = new MageInt(1);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// {B}: Knight of Stromgald gains first strike until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}")));

View file

@ -38,8 +38,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -50,11 +48,6 @@ import mage.game.stack.Spell;
* @author Loki
*/
public class KorFirewalker extends CardImpl {
private static final FilterCard filter = new FilterCard("Red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public KorFirewalker (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
@ -65,7 +58,7 @@ public class KorFirewalker extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
this.addAbility(new KorFirewalkerAbility());
}

View file

@ -40,11 +40,9 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.TargetController;
import mage.filter.Filter;
import mage.filter.FilterObject;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -52,14 +50,10 @@ import mage.filter.predicate.permanent.ControllerPredicate;
*
* @author LevelX2
*/
public class LaviniaOfTheTenth extends CardImpl {
private static final FilterObject filter = new FilterObject("red");
private static final FilterPermanent filterDetain = new FilterPermanent("each nonland permanent your opponents control with converted mana cost 4 or less");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
filterDetain.add(new ControllerPredicate(TargetController.OPPONENT));
filterDetain.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
filterDetain.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 5));
@ -76,7 +70,7 @@ public class LaviniaOfTheTenth extends CardImpl {
this.toughness = new MageInt(4);
// Protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// When Lavinia of the Tenth enters the battlefield, detain each nonland permanent your opponents control with converted mana cost 4 or less.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DetainAllEffect(filterDetain)));

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -43,12 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class LlanowarKnight extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("Black");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.BLACK));
}
public LlanowarKnight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}{W}");
this.subtype.add("Elf");
@ -57,7 +49,7 @@ public class LlanowarKnight extends CardImpl {
this.toughness = new MageInt(2);
// Protection from black
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}

View file

@ -40,9 +40,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
@ -53,12 +51,6 @@ import mage.players.Player;
*/
public class MalakirBloodwitch extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public MalakirBloodwitch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
this.subtype.add("Vampire");
@ -68,7 +60,7 @@ public class MalakirBloodwitch extends CardImpl {
this.toughness = new MageInt(4);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
this.addAbility(new EntersBattlefieldTriggeredAbility(new MalakirBloodwitchEffect(), false));
}

View file

@ -37,9 +37,7 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -49,10 +47,8 @@ import mage.filter.predicate.permanent.ControllerPredicate;
*/
public class MaraudingKnight extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("White");
private static final FilterLandPermanent plainsFilter = new FilterLandPermanent("Plains your opponent controls");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.WHITE));
plainsFilter.add(new SubtypePredicate("Plains"));
plainsFilter.add(new ControllerPredicate(TargetController.OPPONENT));
}
@ -65,7 +61,7 @@ public class MaraudingKnight extends CardImpl {
this.toughness = new MageInt(2);
// Protection from white
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// Marauding Knight gets +1/+1 for each Plains your opponents control.
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(plainsFilter, 1);

View file

@ -42,9 +42,6 @@ import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -54,12 +51,6 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class MaskOfLawAndGrace extends CardImpl {
private static final FilterCard filter = new FilterCard("black and from red");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK), new ColorPredicate(ObjectColor.RED)));
}
public MaskOfLawAndGrace(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}");
this.subtype.add("Aura");
@ -71,7 +62,7 @@ public class MaskOfLawAndGrace extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature has protection from black and from red.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter),
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED),
AttachmentType.AURA, Duration.WhileOnBattlefield)));
}

View file

@ -57,12 +57,10 @@ public class MaskedGorgon extends CardImpl {
private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("green creatures and white creatures");
private static final FilterCard filter2 = new FilterCard("Gorgons");
private static final FilterCard filter3 = new FilterCard("green and from white");
static {
filter1.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), new ColorPredicate(ObjectColor.WHITE)));
filter2.add(new SubtypePredicate("Gorgon"));
filter3.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), new ColorPredicate(ObjectColor.WHITE)));
}
public MaskedGorgon(UUID ownerId, CardSetInfo setInfo) {
@ -76,7 +74,7 @@ public class MaskedGorgon extends CardImpl {
new ProtectionAbility(filter2), Duration.WhileOnBattlefield, filter1)));
// Threshold - Masked Gorgon has protection from green and from white as long as seven or more cards are in your graveyard.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new GainAbilitySourceEffect(new ProtectionAbility(filter3), Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7),
new GainAbilitySourceEffect(ProtectionAbility.from(ObjectColor.GREEN, ObjectColor.WHITE), Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7),
"{this} has protection from green and from white as long as seven or more cards are in your graveyard"));
ability.setAbilityWord(AbilityWord.THRESHOLD);
this.addAbility(ability);

View file

@ -43,9 +43,7 @@ import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
@ -55,10 +53,8 @@ import mage.game.permanent.token.Token;
*/
public class MasterOfWaves extends CardImpl {
private static final FilterCard filterProtection = new FilterCard("Red");
private static final FilterCreaturePermanent filterBoost = new FilterCreaturePermanent("Elemental creatures");
static {
filterProtection.add(new ColorPredicate(ObjectColor.RED));
filterBoost.add(new SubtypePredicate("Elemental"));
}
@ -71,7 +67,7 @@ public class MasterOfWaves extends CardImpl {
this.toughness = new MageInt(1);
// Protection from red
this.addAbility(new ProtectionAbility(filterProtection));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// Elemental creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterBoost, false)));
// When Master of Waves enters the battlefield, create a number of 1/0 blue Elemental creature tokens equal to your devotion to blue.

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class MelesseSpirit extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public MelesseSpirit(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}");
this.subtype.add("Angel");
@ -60,7 +52,7 @@ public class MelesseSpirit extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}
public MelesseSpirit(final MelesseSpirit card) {

View file

@ -36,23 +36,14 @@ import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author ayratn
*/
public class MirranCrusader extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
private static final FilterCard filter2 = new FilterCard("Green");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
filter2.add(new ColorPredicate(ObjectColor.GREEN));
}
public MirranCrusader (UUID ownerId, CardSetInfo setInfo) {
public MirranCrusader(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{W}");
this.subtype.add("Human");
this.subtype.add("Knight");
@ -60,11 +51,10 @@ public class MirranCrusader extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(DoubleStrikeAbility.getInstance());
this.addAbility(new ProtectionAbility(filter));
this.addAbility(new ProtectionAbility(filter2));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.GREEN));
}
public MirranCrusader (final MirranCrusader card) {
public MirranCrusader(final MirranCrusader card) {
super(card);
}

View file

@ -39,8 +39,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.FilterObject;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -48,12 +46,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class MistcutterHydra extends CardImpl {
private static final FilterObject filter = new FilterObject("from blue");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public MistcutterHydra(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}");
this.subtype.add("Hydra");
@ -66,7 +58,7 @@ public class MistcutterHydra extends CardImpl {
// Haste
this.addAbility(HasteAbility.getInstance());
// protection from blue
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
// Mistcutter Hydra enters the battlefield with X +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance())));
}

View file

@ -35,22 +35,13 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class MountainYeti extends CardImpl {
private static final FilterCard filter = new FilterCard("White");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public MountainYeti(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}");
this.subtype.add("Yeti");
@ -60,7 +51,7 @@ public class MountainYeti extends CardImpl {
// Mountainwalk
this.addAbility(new MountainwalkAbility());
// protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
}
public MountainYeti(final MountainYeti card) {

View file

@ -44,9 +44,6 @@ import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -54,12 +51,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class MysticCrusader extends CardImpl {
static final FilterCard filter = new FilterCard("black and from red");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK),new ColorPredicate(ObjectColor.RED)));
}
public MysticCrusader(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{W}");
this.subtype.add("Human");
@ -70,7 +61,7 @@ public class MysticCrusader extends CardImpl {
this.toughness = new MageInt(1);
// Protection from black and from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED));
// Threshold - As long as seven or more cards are in your graveyard, Mystic Crusader gets +1/+1 and has flying.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7),

View file

@ -44,8 +44,6 @@ import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -53,12 +51,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class MysticEnforcer extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public MysticEnforcer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{W}");
this.subtype.add("Human");
@ -69,7 +61,7 @@ public class MysticEnforcer extends CardImpl {
this.toughness = new MageInt(3);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Threshold - As long as seven or more cards are in your graveyard, Mystic Enforcer gets +3/+3 and has flying.
Ability thresholdAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7),

View file

@ -44,8 +44,6 @@ import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -53,12 +51,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class MysticFamiliar extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public MysticFamiliar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Bird");
@ -71,7 +63,7 @@ public class MysticFamiliar extends CardImpl {
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7),
"As long as seven or more cards are in your graveyard, {this} gets +1/+1"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(new ProtectionAbility(filter)),
ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(ProtectionAbility.from(ObjectColor.BLACK)),
new CardsInControllerGraveCondition(7), "and has protection from black"));
ability.setAbilityWord(AbilityWord.THRESHOLD);
this.addAbility(ability);

View file

@ -35,29 +35,21 @@ import mage.ObjectColor;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author Loki
*/
public class NacatlOutlander extends CardImpl {
private static final FilterCard filter = new FilterCard("blue");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public NacatlOutlander(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{G}");
this.subtype.add("Cat");
this.subtype.add("Scout");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
}
public NacatlOutlander(final NacatlOutlander card) {

View file

@ -44,7 +44,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -55,13 +54,11 @@ import mage.filter.predicate.permanent.ControllerPredicate;
*/
public class NantukoBlightcutter extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
private static final FilterPermanent filter2 = new FilterPermanent();
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
filter2.add(new ColorPredicate(ObjectColor.BLACK));
filter2.add(new ControllerPredicate(TargetController.OPPONENT));
filter.add(new ControllerPredicate(TargetController.OPPONENT));
}
public NantukoBlightcutter(UUID ownerId, CardSetInfo setInfo) {
@ -72,9 +69,9 @@ public class NantukoBlightcutter extends CardImpl {
this.toughness = new MageInt(2);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Threshold - Nantuko Blightcutter gets +1/+1 for each black permanent your opponents control as long as seven or more cards are in your graveyard.
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter2);
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter);
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(count, count, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7),
"{this} gets +1/+1 for each black permanent your opponents control as long as seven or more cards are in your graveyard"));

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class Narwhal extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public Narwhal(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}");
this.subtype.add("Whale");
@ -59,7 +51,7 @@ public class Narwhal extends CardImpl {
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public Narwhal(final Narwhal card) {

View file

@ -36,8 +36,6 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -45,12 +43,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class NightwindGlider extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public NightwindGlider(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
this.subtype.add("Human");
@ -63,7 +55,7 @@ public class NightwindGlider extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}
public NightwindGlider(final NightwindGlider card) {

View file

@ -40,23 +40,14 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class ObsidianAcolyte extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public ObsidianAcolyte(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Human");
@ -65,10 +56,10 @@ public class ObsidianAcolyte extends CardImpl {
this.toughness = new MageInt(1);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// {W}: Target creature gains protection from black until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new GainAbilityTargetEffect(new ProtectionAbility(filter), Duration.EndOfTurn), new ManaCostsImpl("{W}"));
new GainAbilityTargetEffect(ProtectionAbility.from(ObjectColor.BLACK), Duration.EndOfTurn), new ManaCostsImpl("{W}"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);

View file

@ -41,10 +41,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureSpell;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.permanent.token.Token;
/**
@ -75,13 +73,6 @@ public class OpalGuardian extends CardImpl {
}
class OpalGuardianGargoyle extends Token {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public OpalGuardianGargoyle() {
super("Gargoyle", "3/4 Gargoyle creature with flying and protection from red");
cardType.add(CardType.CREATURE);
@ -89,6 +80,6 @@ class OpalGuardianGargoyle extends Token {
power = new MageInt(3);
toughness = new MageInt(4);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
}

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -43,12 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class Oraxid extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public Oraxid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}");
this.subtype.add("Crab");
@ -57,7 +49,7 @@ public class Oraxid extends CardImpl {
this.toughness = new MageInt(3);
// Protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public Oraxid(final Oraxid card) {

View file

@ -41,22 +41,13 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class OrderOfLeitbur extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public OrderOfLeitbur(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
this.subtype.add("Human");
@ -66,7 +57,7 @@ public class OrderOfLeitbur extends CardImpl {
this.toughness = new MageInt(1);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// {W}: Order of Leitbur gains first strike until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}")));

View file

@ -41,22 +41,13 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class OrderOfTheEbonHand extends CardImpl {
private static final FilterCard filter = new FilterCard("white");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public OrderOfTheEbonHand(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
this.subtype.add("Cleric");
@ -65,7 +56,7 @@ public class OrderOfTheEbonHand extends CardImpl {
this.toughness = new MageInt(1);
// Protection from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
// {B}: Order of the Ebon Hand gains first strike until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}")));

View file

@ -41,22 +41,13 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class OrderOfTheWhiteShield extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public OrderOfTheWhiteShield(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
this.subtype.add("Human");
@ -65,7 +56,7 @@ public class OrderOfTheWhiteShield extends CardImpl {
this.toughness = new MageInt(1);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// {W}: Order of the White Shield gains first strike until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}")));

View file

@ -35,20 +35,12 @@ import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author Loki
*/
public class PaladinEnVec extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("black and from red");
static {
protectionFilter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK),new ColorPredicate(ObjectColor.RED)));
}
public PaladinEnVec(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{W}");
@ -61,7 +53,7 @@ public class PaladinEnVec extends CardImpl {
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// protection from black and from red
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED));
}
public PaladinEnVec(final PaladinEnVec card) {

View file

@ -43,8 +43,6 @@ import mage.constants.Duration;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -56,12 +54,6 @@ import mage.game.turn.Step;
*/
public class PhantomCentaur extends CardImpl {
private static final FilterCard filter = new FilterCard("Black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public PhantomCentaur(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
this.subtype.add("Centaur");
@ -71,7 +63,7 @@ public class PhantomCentaur extends CardImpl {
this.toughness = new MageInt(0);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// Phantom Centaur enters the battlefield with three +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it"));

View file

@ -37,8 +37,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -46,16 +44,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class PhyrexianCrusader extends CardImpl {
private static final FilterCard filter = new FilterCard("Red");
private static final FilterCard filter2 = new FilterCard("White");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
filter2.add(new ColorPredicate(ObjectColor.WHITE));
}
public PhyrexianCrusader (UUID ownerId, CardSetInfo setInfo) {
public PhyrexianCrusader(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}");
this.subtype.add("Zombie");
this.subtype.add("Knight");
@ -66,13 +55,12 @@ public class PhyrexianCrusader extends CardImpl {
// First strike,
this.addAbility(FirstStrikeAbility.getInstance());
// protection from red and from white
this.addAbility(new ProtectionAbility(filter));
this.addAbility(new ProtectionAbility(filter2));
this.addAbility(ProtectionAbility.from(ObjectColor.RED, ObjectColor.WHITE));
// Infect
this.addAbility(InfectAbility.getInstance());
}
public PhyrexianCrusader (final PhyrexianCrusader card) {
public PhyrexianCrusader(final PhyrexianCrusader card) {
super(card);
}

View file

@ -42,7 +42,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterObject;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
@ -55,12 +54,6 @@ import mage.target.TargetSource;
*/
public class PilgrimOfJustice extends CardImpl {
static final FilterCard filter = new FilterCard("red");
static{
filter.add(new ColorPredicate(ObjectColor.RED));
}
public PilgrimOfJustice(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
this.subtype.add("Human");
@ -70,7 +63,7 @@ public class PilgrimOfJustice extends CardImpl {
this.toughness = new MageInt(3);
// Protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
// {W}, Sacrifice Pilgrim of Justice: The next time a red source of your choice would deal damage this turn, prevent that damage.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PilgrimOfJusticeEffect(), new ManaCostsImpl("{W}"));
ability.addCost(new SacrificeSourceCost());
@ -92,7 +85,7 @@ class PilgrimOfJusticeEffect extends PreventionEffectImpl {
private static final FilterObject filter = new FilterObject("red source");
static{
filter.add(new ColorPredicate(ObjectColor.RED));
}
}
private TargetSource target;
public PilgrimOfJusticeEffect() {

View file

@ -42,7 +42,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterObject;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
@ -55,12 +54,6 @@ import mage.target.TargetSource;
*/
public class PilgrimOfVirtue extends CardImpl {
static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public PilgrimOfVirtue(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
this.subtype.add("Human");
@ -70,7 +63,7 @@ public class PilgrimOfVirtue extends CardImpl {
this.toughness = new MageInt(3);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
// {W}, Sacrifice Pilgrim of Virtue: The next time a black source of your choice would deal damage this turn, prevent that damage.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PilgrimOfVirtueEffect(), new ManaCostsImpl("{W}"));
ability.addCost(new SacrificeSourceCost());

View file

@ -45,9 +45,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.permanent.token.Token;
import mage.target.common.TargetOpponent;
@ -58,12 +55,6 @@ import mage.target.common.TargetOpponent;
*/
public class QuestingPhelddagrif extends CardImpl {
private static final FilterCard filter = new FilterCard("black and from red");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK), new ColorPredicate(ObjectColor.RED)));
}
public QuestingPhelddagrif(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{W}{U}");
this.subtype.add("Phelddagrif");
@ -77,7 +68,7 @@ public class QuestingPhelddagrif extends CardImpl {
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
// {W}: Questing Phelddagrif gains protection from black and from red until end of turn. Target opponent gains 2 life.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(new ProtectionAbility(filter),
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED),
Duration.EndOfTurn), new ManaCostsImpl("{W}"));
ability.addEffect(new GainLifeTargetEffect(2));
ability.addTarget(new TargetOpponent());

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -43,11 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class RepentantBlacksmith extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("red");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.RED));
}
public RepentantBlacksmith(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");
this.subtype.add("Human");
@ -56,7 +49,7 @@ public class RepentantBlacksmith extends CardImpl {
this.toughness = new MageInt(2);
// Protection from red
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public RepentantBlacksmith(final RepentantBlacksmith card) {

View file

@ -35,23 +35,13 @@ import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class SabertoothNishoba extends CardImpl {
private static final FilterCard filter = new FilterCard("blue and from red");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLUE), new ColorPredicate(ObjectColor.RED)));
}
public SabertoothNishoba(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{W}");
this.subtype.add("Cat");
@ -63,7 +53,7 @@ public class SabertoothNishoba extends CardImpl {
// Trample
this.addAbility(TrampleAbility.getInstance());
// protection from blue and from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE, ObjectColor.RED));
}
public SabertoothNishoba(final SabertoothNishoba card) {

View file

@ -34,8 +34,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -43,11 +41,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class ScalebanesElite extends CardImpl {
private static final FilterCard filter = new FilterCard("black");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public ScalebanesElite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{W}");
this.subtype.add("Human");
@ -57,7 +50,7 @@ public class ScalebanesElite extends CardImpl {
this.toughness = new MageInt(4);
// Protection from black
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
}
public ScalebanesElite(final ScalebanesElite card) {

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterObject;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,11 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class Scragnoth extends CardImpl {
private static final FilterObject filter = new FilterObject("from blue");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public Scragnoth(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}");
this.subtype.add("Beast");
@ -59,7 +52,7 @@ public class Scragnoth extends CardImpl {
// Scragnoth can't be countered.
this.addAbility(new CantBeCounteredAbility());
// Protection from blue
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
}
public Scragnoth(final Scragnoth card) {

View file

@ -41,9 +41,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -54,10 +52,8 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class ScrybRanger extends CardImpl {
private static final FilterCard filter = new FilterCard("blue");
private static final FilterControlledLandPermanent filterForest = new FilterControlledLandPermanent("Forest");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
filterForest.add(new SubtypePredicate("Forest"));
}
@ -73,7 +69,7 @@ public class ScrybRanger extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from blue
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.BLUE));
// Return a Forest you control to its owner's hand: Untap target creature. Activate this ability only once each turn.
Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filterForest)));
ability.addTarget(new TargetCreaturePermanent(1));

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class SeaSprite extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public SeaSprite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
this.subtype.add("Faerie");
@ -59,7 +51,7 @@ public class SeaSprite extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public SeaSprite(final SeaSprite card) {

View file

@ -42,9 +42,6 @@ import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -54,12 +51,6 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class ShieldOfDutyAndReason extends CardImpl {
private static final FilterCard filter = new FilterCard("green and from blue");
static {
filter.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), new ColorPredicate(ObjectColor.BLUE)));
}
public ShieldOfDutyAndReason(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}");
this.subtype.add("Aura");
@ -71,7 +62,7 @@ public class ShieldOfDutyAndReason extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature has protection from green and from blue.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter),
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ProtectionAbility.from(ObjectColor.GREEN, ObjectColor.BLUE),
AttachmentType.AURA, Duration.WhileOnBattlefield)));
}

View file

@ -31,8 +31,6 @@ import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.keyword.ProtectionAbility;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -42,11 +40,7 @@ import mage.constants.CardType;
* @author Jgod
*/
public class ShivanZombie extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("white");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.WHITE));
}
public ShivanZombie(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{R}");
this.subtype.add("Barbarian");
@ -55,7 +49,7 @@ public class ShivanZombie extends CardImpl {
this.toughness = new MageInt(2);
// Protection from white
this.addAbility(new ProtectionAbility(protectionFilter));
this.addAbility(ProtectionAbility.from(ObjectColor.WHITE));
}
public ShivanZombie(final ShivanZombie card) {

View file

@ -35,8 +35,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
@ -44,12 +42,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class SilverKnight extends CardImpl {
private static final FilterCard filter = new FilterCard("red");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public SilverKnight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
this.subtype.add("Human");
@ -61,7 +53,7 @@ public class SilverKnight extends CardImpl {
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// protection from red
this.addAbility(new ProtectionAbility(filter));
this.addAbility(ProtectionAbility.from(ObjectColor.RED));
}
public SilverKnight(final SilverKnight card) {

Some files were not shown because too many files have changed in this diff Show more