* Some more use of StaticFilter objects.

This commit is contained in:
LevelX2 2017-07-23 14:59:13 +02:00
parent d5f4df7f54
commit 4806738cfb
234 changed files with 1211 additions and 1211 deletions

View file

@ -781,9 +781,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
} }
List<Permanent> targets; List<Permanent> targets;
if (outcome.isGood()) { if (outcome.isGood()) {
targets = threats(playerId, source.getSourceId(), new FilterCreaturePermanent(), game, target.getTargets()); targets = threats(playerId, source.getSourceId(), StaticFilters.FILTER_PERMANENT_CREATURE, game, target.getTargets());
} else { } else {
targets = threats(opponentId, source.getSourceId(), new FilterCreaturePermanent(), game, target.getTargets()); targets = threats(opponentId, source.getSourceId(), StaticFilters.FILTER_PERMANENT_CREATURE, game, target.getTargets());
} }
for (Permanent permanent : targets) { for (Permanent permanent : targets) {
if (target.canTarget(getId(), permanent.getId(), source, game)) { if (target.canTarget(getId(), permanent.getId(), source, game)) {

View file

@ -66,7 +66,7 @@ public class AbhorrentOverlord extends CardImpl {
effect.setText("create a number of 1/1 black Harpy creature tokens with flying equal to your devotion to black. <i>(Each {B} in the mana costs of permanents you control counts toward your devotion to black.)</i>"); effect.setText("create a number of 1/1 black Harpy creature tokens with flying equal to your devotion to black. <i>(Each {B} in the mana costs of permanents you control counts toward your devotion to black.)</i>");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); this.addAbility(new EntersBattlefieldTriggeredAbility(effect));
// At the beginning of your upkeep, sacrifice a creature. // At the beginning of your upkeep, sacrifice a creature.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, null), TargetController.YOU, false)); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, null), TargetController.YOU, false));
} }
public AbhorrentOverlord(final AbhorrentOverlord card) { public AbhorrentOverlord(final AbhorrentOverlord card) {

View file

@ -84,7 +84,7 @@ class AbolisherOfBloodlinesAbility extends TriggeredAbilityImpl {
static final String RULE_TEXT = "When this creature transforms into Abolisher of Bloodlines, target opponent sacrifices three creatures"; static final String RULE_TEXT = "When this creature transforms into Abolisher of Bloodlines, target opponent sacrifices three creatures";
public AbolisherOfBloodlinesAbility() { public AbolisherOfBloodlinesAbility() {
super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterCreaturePermanent(), 3, "Target opponent"), false); super(Zone.BATTLEFIELD, new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 3, "Target opponent"), false);
Target target = new TargetOpponent(); Target target = new TargetOpponent();
this.addTarget(target); this.addTarget(target);
} }

View file

@ -52,7 +52,7 @@ public class AccursedCentaur extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// When Accursed Centaur enters the battlefield, sacrifice a creature. // When Accursed Centaur enters the battlefield, sacrifice a creature.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, null))); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, null)));
} }
public AccursedCentaur(final AccursedCentaur card) { public AccursedCentaur(final AccursedCentaur card) {

View file

@ -86,7 +86,7 @@ class AlphaStatusDynamicValue implements DynamicValue {
if (enchantment != null && enchantment.getAttachedTo() != null) { if (enchantment != null && enchantment.getAttachedTo() != null) {
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
if (enchanted != null) { if (enchanted != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) {
if (!permanent.getId().equals(enchanted.getId())) { if (!permanent.getId().equals(enchanted.getId())) {
if (enchanted.shareSubtypes(permanent, game)) { if (enchanted.shareSubtypes(permanent, game)) {
xValue += 2; xValue += 2;

View file

@ -91,7 +91,7 @@ class AngelsTrumpetTapEffect extends OneShotEffect {
Player player = game.getPlayer(game.getActivePlayerId()); Player player = game.getPlayer(game.getActivePlayerId());
int count = 0; int count = 0;
if (player != null) { if (player != null) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) {
// Untapped creatures are safe. // Untapped creatures are safe.
if (creature.isTapped()) { if (creature.isTapped()) {
continue; continue;

View file

@ -60,7 +60,7 @@ public class ArtisanOfForms extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// <i>Heroic</i> - Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability. // <i>Heroic</i> - Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability.
Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new ArtisanOfFormsApplyToPermanent(), true); Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new ArtisanOfFormsApplyToPermanent(), true);
effect.setText("have {this} become a copy of target creature and gain this ability"); effect.setText("have {this} become a copy of target creature and gain this ability");
Ability ability = new HeroicAbility(effect, true); Ability ability = new HeroicAbility(effect, true);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());

View file

@ -49,7 +49,7 @@ public class AuraShards extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}{W}"); super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}{W}");
// Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment. // Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment.
Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new FilterCreaturePermanent(), true, "Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment"); Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), StaticFilters.FILTER_PERMANENT_CREATURE, true, "Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment");
ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent()));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -138,7 +138,7 @@ class SacrificeAllEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getId(), game); List<Permanent> permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getId(), game);
for (Permanent p : permanents) { for (Permanent p : permanents) {
p.sacrifice(source.getSourceId(), game); p.sacrifice(source.getSourceId(), game);
} }

View file

@ -102,10 +102,10 @@ class AvatarOfMightCostReductionEffect extends CostModificationEffectImpl {
@Override @Override
public boolean applies(Ability abilityToModify, Ability source, Game game) { public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility)) { if (abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility)) {
int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); int creatures = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
for (UUID playerId : game.getOpponents(source.getControllerId())) { for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(playerId); Player opponent = game.getPlayer(playerId);
if (opponent != null && game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) >= creatures + 4) { if (opponent != null && game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game) >= creatures + 4) {
return true; return true;
} }
} }

View file

@ -71,7 +71,7 @@ public class AvengingArrow extends CardImpl {
class AvengingArrowTarget extends TargetPermanent { class AvengingArrowTarget extends TargetPermanent {
public AvengingArrowTarget() { public AvengingArrowTarget() {
super(1, 1, new FilterCreaturePermanent(), false); super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false);
targetName = "creature that dealt damage this turn"; targetName = "creature that dealt damage this turn";
} }

View file

@ -90,7 +90,7 @@ class BalefireDragonEffect extends OneShotEffect {
if (player != null) { if (player != null) {
int amount = (Integer)getValue("damage"); int amount = (Integer)getValue("damage");
if (amount > 0) { if (amount > 0) {
for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { for (Permanent creature: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) {
creature.damage(amount, source.getSourceId(), game, false, true); creature.damage(amount, source.getSourceId(), game, false, true);
} }
} }

View file

@ -1,112 +1,112 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.cards.b; package mage.cards.b;
import java.util.UUID; import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCreaturePermanentSameController; import mage.target.common.TargetCreaturePermanentSameController;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public class BarrinsSpite extends CardImpl { public class BarrinsSpite extends CardImpl {
public BarrinsSpite(UUID ownerId, CardSetInfo setInfo) { public BarrinsSpite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{B}");
// Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand. // Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand.
this.getSpellAbility().addEffect(new BarrinsSpiteEffect()); this.getSpellAbility().addEffect(new BarrinsSpiteEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2, 2, new FilterCreaturePermanent(), false)); this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2, 2, StaticFilters.FILTER_PERMANENT_CREATURE, false));
} }
public BarrinsSpite(final BarrinsSpite card) { public BarrinsSpite(final BarrinsSpite card) {
super(card); super(card);
} }
@Override @Override
public BarrinsSpite copy() { public BarrinsSpite copy() {
return new BarrinsSpite(this); return new BarrinsSpite(this);
} }
} }
class BarrinsSpiteEffect extends OneShotEffect { class BarrinsSpiteEffect extends OneShotEffect {
public BarrinsSpiteEffect() { public BarrinsSpiteEffect() {
super(Outcome.Detriment); super(Outcome.Detriment);
this.staticText = "Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand"; this.staticText = "Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand";
} }
public BarrinsSpiteEffect(final BarrinsSpiteEffect effect) { public BarrinsSpiteEffect(final BarrinsSpiteEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public BarrinsSpiteEffect copy() { public BarrinsSpiteEffect copy() {
return new BarrinsSpiteEffect(this); return new BarrinsSpiteEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
MageObject sourceObject = source.getSourceObject(game); MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null) { if (sourceObject != null) {
boolean sacrificeDone = false; boolean sacrificeDone = false;
int count = 0; int count = 0;
for (UUID targetId : getTargetPointer().getTargets(game, source)) { for (UUID targetId : getTargetPointer().getTargets(game, source)) {
Permanent creature = game.getPermanent(targetId); Permanent creature = game.getPermanent(targetId);
if (creature != null) { if (creature != null) {
Player controllerOfCreature = game.getPlayer(creature.getControllerId()); Player controllerOfCreature = game.getPlayer(creature.getControllerId());
if ((count == 0 if ((count == 0
&& controllerOfCreature.chooseUse(Outcome.Sacrifice, "Sacrifice " + creature.getLogName() + '?', source, game)) && controllerOfCreature.chooseUse(Outcome.Sacrifice, "Sacrifice " + creature.getLogName() + '?', source, game))
|| (count == 1 || (count == 1
&& !sacrificeDone)) { && !sacrificeDone)) {
creature.sacrifice(source.getId(), game); creature.sacrifice(source.getId(), game);
sacrificeDone = true; sacrificeDone = true;
} else { } else {
creature.moveToZone(Zone.HAND, source.getId(), game, false); creature.moveToZone(Zone.HAND, source.getId(), game, false);
} }
count++; count++;
} }
} }
return true; return true;
} }
return false; return false;
} }
} }

View file

@ -99,7 +99,7 @@ class BatheInLightEffect extends OneShotEffect {
ObjectColor protectColor = (ObjectColor) game.getState().getValue(target.getId() + "_color"); ObjectColor protectColor = (ObjectColor) game.getState().getValue(target.getId() + "_color");
if (protectColor != null) { if (protectColor != null) {
ObjectColor color = target.getColor(game); ObjectColor color = target.getColor(game);
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
if (permanent.getColor(game).shares(color)) { if (permanent.getColor(game).shares(color)) {
ContinuousEffect effect = new GainProtectionFromColorTargetEffect(Duration.EndOfTurn, protectColor); ContinuousEffect effect = new GainProtectionFromColorTargetEffect(Duration.EndOfTurn, protectColor);
effect.setTargetPointer(new FixedTarget(permanent, game)); effect.setTargetPointer(new FixedTarget(permanent, game));

View file

@ -61,7 +61,7 @@ public class BearerOfSilence extends CardImpl {
this.addAbility(new DevoidAbility(this.color)); this.addAbility(new DevoidAbility(this.color));
// When you cast Bearer of Silence, you may pay {1}{C}. If you do, target opponent sacrifices a creature. // When you cast Bearer of Silence, you may pay {1}{C}. If you do, target opponent sacrifices a creature.
Ability ability = new CastSourceTriggeredAbility(new DoIfCostPaid(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent"), new ManaCostsImpl("{1}{C}"))); Ability ability = new CastSourceTriggeredAbility(new DoIfCostPaid(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent"), new ManaCostsImpl("{1}{C}")));
ability.addTarget(new TargetOpponent()); ability.addTarget(new TargetOpponent());
this.addAbility(ability); this.addAbility(ability);

View file

@ -132,9 +132,9 @@ class BenevolentOfferingEffect2 extends OneShotEffect {
target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), game); target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), game);
Player opponent = game.getPlayer(target.getFirstTarget()); Player opponent = game.getPlayer(target.getFirstTarget());
if (opponent != null) { if (opponent != null) {
int count = game.getBattlefield().countAll(new FilterCreaturePermanent(), controller.getId(), game) * 2; int count = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game) * 2;
controller.gainLife(count, game); controller.gainLife(count, game);
count = game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) * 2; count = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game) * 2;
opponent.gainLife(count, game); opponent.gainLife(count, game);
return true; return true;
} }

View file

@ -90,7 +90,7 @@ class BiomanticMasteryEffect extends OneShotEffect {
for(UUID playerId: getTargetPointer().getTargets(game, source)) { for(UUID playerId: getTargetPointer().getTargets(game, source)) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), playerId, game); int creatures = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game);
controller.drawCards(creatures, game); controller.drawCards(creatures, game);
} }
} }

View file

@ -85,7 +85,7 @@ class BlasphemousCostReductionEffect extends CostModificationEffectImpl {
public boolean apply(Game game, Ability source, Ability abilityToModify) { public boolean apply(Game game, Ability source, Ability abilityToModify) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
int reductionAmount = game.getBattlefield().count(new FilterCreaturePermanent(), source.getSourceId(), source.getControllerId(), game); int reductionAmount = game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, source.getSourceId(), source.getControllerId(), game);
CardUtil.reduceCost(abilityToModify, reductionAmount); CardUtil.reduceCost(abilityToModify, reductionAmount);
return true; return true;
} }

View file

@ -57,7 +57,7 @@ public class BlightedFen extends CardImpl {
// {4}{B}, {T}, Sacrifice Blighted Fen: Target opponent sacrifices a creature. // {4}{B}, {T}, Sacrifice Blighted Fen: Target opponent sacrifices a creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent"), new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent"),
new ManaCostsImpl<>("{4}{B}")); new ManaCostsImpl<>("{4}{B}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());

View file

@ -1,83 +1,83 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.cards.b; package mage.cards.b;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID; import java.util.UUID;
/** /**
* *
* @author Styxo * @author Styxo
*/ */
public class BlindWorship extends CardImpl { public class BlindWorship extends CardImpl {
public BlindWorship(UUID ownerId, CardSetInfo setInfo) { public BlindWorship(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{G}{W}"); super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{G}{W}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
// Enchant creature // Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent(); TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// Enchanted creature has "Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power." // Enchanted creature has "Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power."
DynamicValue xValue = new SourcePermanentPowerCount(); DynamicValue xValue = new SourcePermanentPowerCount();
Ability attachedAbility = new AttacksTriggeredAbility(new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, new FilterCreaturePermanent(), true), false); Ability attachedAbility = new AttacksTriggeredAbility(new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true), false);
Effect gainAbilityEffect = new GainAbilityAttachedEffect(attachedAbility, AttachmentType.AURA); Effect gainAbilityEffect = new GainAbilityAttachedEffect(attachedAbility, AttachmentType.AURA);
gainAbilityEffect.setText("Enchanted creature has \"Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power\""); gainAbilityEffect.setText("Enchanted creature has \"Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power\"");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, gainAbilityEffect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, gainAbilityEffect));
} }
public BlindWorship(final BlindWorship card) { public BlindWorship(final BlindWorship card) {
super(card); super(card);
} }
@Override @Override
public BlindWorship copy() { public BlindWorship copy() {
return new BlindWorship(this); return new BlindWorship(this);
} }
} }

View file

@ -50,7 +50,7 @@ public class BloodReckoning extends CardImpl {
// Whenever a creature attacks you or a planeswalker you control, that creature's controller loses 1 life. // Whenever a creature attacks you or a planeswalker you control, that creature's controller loses 1 life.
Effect effect = new LoseLifeTargetEffect(1); Effect effect = new LoseLifeTargetEffect(1);
effect.setText("that creature's controller loses 1 life"); effect.setText("that creature's controller loses 1 life");
this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), SetTargetPointer.PLAYER, true, true)); this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PLAYER, true, true));
} }
public BloodReckoning(final BloodReckoning card) { public BloodReckoning(final BloodReckoning card) {

View file

@ -58,7 +58,7 @@ public class BoldDefense extends CardImpl {
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn), this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn),
new BoostTargetEffect(1, 1, Duration.EndOfTurn), new LockedInCondition(KickedCondition.instance), new BoostTargetEffect(1, 1, Duration.EndOfTurn), new LockedInCondition(KickedCondition.instance),
"Creatures you control get +1/+1 until end of turn. If {this} was kicked, instead creatures you control get +2/+2")); "Creatures you control get +1/+1 until end of turn. If {this} was kicked, instead creatures you control get +2/+2"));
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false), this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false),
null, new LockedInCondition(KickedCondition.instance), null, new LockedInCondition(KickedCondition.instance),
"and gain first strike until end of turn")); "and gain first strike until end of turn"));
} }

View file

@ -90,7 +90,7 @@ class BreakingWaveEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> creatures = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), List<Permanent> creatures = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE,
source.getControllerId(), source.getSourceId(), game); source.getControllerId(), source.getSourceId(), game);
for(Permanent creature: creatures) { for(Permanent creature: creatures) {
if(creature.isTapped()) { if(creature.isTapped()) {

View file

@ -46,7 +46,7 @@ public class BurstOfSpeed extends CardImpl {
public BurstOfSpeed(UUID ownerId, CardSetInfo setInfo) { public BurstOfSpeed(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}");
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false)); this.getSpellAbility().addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false));
} }
public BurstOfSpeed(final BurstOfSpeed card) { public BurstOfSpeed(final BurstOfSpeed card) {

View file

@ -79,7 +79,7 @@ public class CabalExecutioner extends CardImpl {
class CabalExecutionerAbility extends TriggeredAbilityImpl { class CabalExecutionerAbility extends TriggeredAbilityImpl {
public CabalExecutionerAbility() { public CabalExecutionerAbility() {
super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterCreaturePermanent(), 1, "")); super(Zone.BATTLEFIELD, new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""));
} }
public CabalExecutionerAbility(final CabalExecutionerAbility ability) { public CabalExecutionerAbility(final CabalExecutionerAbility ability) {

View file

@ -65,7 +65,7 @@ public class CallForUnity extends CardImpl {
// Creatures you control get +1/+1 for each unity counter on Call for Unity. // Creatures you control get +1/+1 for each unity counter on Call for Unity.
Effect effect = new BoostControlledEffect(new CountersSourceCount(CounterType.UNITY), new CountersSourceCount(CounterType.UNITY), Duration.WhileOnBattlefield, Effect effect = new BoostControlledEffect(new CountersSourceCount(CounterType.UNITY), new CountersSourceCount(CounterType.UNITY), Duration.WhileOnBattlefield,
new FilterCreaturePermanent(), false); StaticFilters.FILTER_PERMANENT_CREATURE, false);
effect.setText("Creatures you control get +1/+1 for each unity counter on {this}"); effect.setText("Creatures you control get +1/+1 for each unity counter on {this}");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
} }

View file

@ -91,7 +91,7 @@ class CalltoGloryFirstEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) {
creature.untap(game); creature.untap(game);
} }
return true; return true;

View file

@ -51,7 +51,7 @@ public class Caltrops extends CardImpl {
// Whenever a creature attacks, Caltrops deals 1 damage to it. // Whenever a creature attacks, Caltrops deals 1 damage to it.
Effect effect = new DamageTargetEffect(1); Effect effect = new DamageTargetEffect(1);
effect.setText("{this} deals 1 damage to it"); effect.setText("{this} deals 1 damage to it");
this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE,
SetTargetPointer.PERMANENT, false)); SetTargetPointer.PERMANENT, false));
} }

View file

@ -102,7 +102,7 @@ class CankerAbominationEffect extends OneShotEffect {
Player opponent = game.getPlayer(target.getFirstTarget()); Player opponent = game.getPlayer(target.getFirstTarget());
if (opponent != null) { if (opponent != null) {
game.informPlayers(cankerAbomination.getName() + ": " + controller.getLogName() + " has chosen " + opponent.getLogName()); game.informPlayers(cankerAbomination.getName() + ": " + controller.getLogName() + " has chosen " + opponent.getLogName());
int amount = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), opponent.getId(), game).size(); int amount = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game).size();
if (amount > 0) { if (amount > 0) {
cankerAbomination.addCounters(CounterType.M1M1.createInstance(amount), source, game); cankerAbomination.addCounters(CounterType.M1M1.createInstance(amount), source, game);
} }

View file

@ -55,7 +55,7 @@ public class Cannibalize extends CardImpl {
// Choose two target creatures controlled by the same player. Exile one of the creatures and put two +1/+1 counters on the other. // Choose two target creatures controlled by the same player. Exile one of the creatures and put two +1/+1 counters on the other.
this.getSpellAbility().addEffect(new CannibalizeEffect()); this.getSpellAbility().addEffect(new CannibalizeEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,new FilterCreaturePermanent(),false)); this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,StaticFilters.FILTER_PERMANENT_CREATURE,false));
} }
public Cannibalize(final Cannibalize card) { public Cannibalize(final Cannibalize card) {

View file

@ -90,7 +90,7 @@ class CatastropheEffect extends OneShotEffect {
permanent.destroy(source.getSourceId(), game, permanent.isCreature()); permanent.destroy(source.getSourceId(), game, permanent.isCreature());
} }
} else { } else {
for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { for (Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) {
permanent.destroy(source.getSourceId(), game, true); permanent.destroy(source.getSourceId(), game, true);
} }
} }

View file

@ -56,7 +56,7 @@ public class CauldronOfSouls extends CardImpl {
Effect effect = new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn); Effect effect = new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn);
effect.setText("choose any number of target creatures. Each of those creatures gains persist until end of turn"); effect.setText("choose any number of target creatures. Each of those creatures gains persist until end of turn");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); ability.addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -50,7 +50,7 @@ public class ChainersEdict extends CardImpl {
// Target player sacrifices a creature. // Target player sacrifices a creature.
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
// Flashback {5}{B}{B} // Flashback {5}{B}{B}

View file

@ -85,7 +85,7 @@ class ChandrasIgnitionEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature != null && targetCreature.getPower().getValue() > 0) { if (targetCreature != null && targetCreature.getPower().getValue() > 0) {
for (Permanent creature : game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
if (!creature.getId().equals(targetCreature.getId())) { if (!creature.getId().equals(targetCreature.getId())) {
creature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true); creature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true);
} }

View file

@ -48,7 +48,7 @@ public class CleaverRiot extends CardImpl {
// Creatures you control gain double strike until end of turn. // Creatures you control gain double strike until end of turn.
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false)); this.getSpellAbility().addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false));
} }
public CleaverRiot(final CleaverRiot card) { public CleaverRiot(final CleaverRiot card) {

View file

@ -89,7 +89,7 @@ class CloneLegionEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (controller != null && targetPlayer != null) { if (controller != null && targetPlayer != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) {
if (permanent != null) { if (permanent != null) {
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
effect.setTargetPointer(new FixedTarget(permanent, game)); effect.setTargetPointer(new FixedTarget(permanent, game));

View file

@ -131,7 +131,7 @@ class CollectiveEffortEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player target = game.getPlayer(source.getFirstTarget()); Player target = game.getPlayer(source.getFirstTarget());
if (target != null) { if (target != null) {
for (Permanent p : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), target.getId(), game)) { for (Permanent p : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, target.getId(), game)) {
p.addCounters(CounterType.P1P1.createInstance(), source, game); p.addCounters(CounterType.P1P1.createInstance(), source, game);
} }
return true; return true;

View file

@ -58,7 +58,7 @@ public class CommanderGrevenIlVec extends CardImpl {
this.addAbility(FearAbility.getInstance()); this.addAbility(FearAbility.getInstance());
// When Commander Greven il-Vec enters the battlefield, sacrifice a creature. // When Commander Greven il-Vec enters the battlefield, sacrifice a creature.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""), false));
} }
public CommanderGrevenIlVec(final CommanderGrevenIlVec card) { public CommanderGrevenIlVec(final CommanderGrevenIlVec card) {

View file

@ -95,7 +95,7 @@ class ContagionEngineEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
if (targetPlayer != null) { if (targetPlayer != null) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) {
creature.addCounters(CounterType.M1M1.createInstance(), source, game); creature.addCounters(CounterType.M1M1.createInstance(), source, game);
} }
return true; return true;

View file

@ -102,7 +102,7 @@ class CracklingDoomEffect extends OneShotEffect {
int greatestPower = Integer.MIN_VALUE; int greatestPower = Integer.MIN_VALUE;
int numberOfCreatures = 0; int numberOfCreatures = 0;
Permanent permanentToSacrifice = null; Permanent permanentToSacrifice = null;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), playerId, game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game)) {
if (permanent.getPower().getValue() > greatestPower) { if (permanent.getPower().getValue() > greatestPower) {
greatestPower = permanent.getPower().getValue(); greatestPower = permanent.getPower().getValue();
numberOfCreatures = 1; numberOfCreatures = 1;

View file

@ -93,7 +93,7 @@ class CraterHellionEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); List<Permanent> permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
for (Permanent permanent : permanents) { for (Permanent permanent : permanents) {
if (!permanent.getId().equals(source.getSourceId())) { if (!permanent.getId().equals(source.getSourceId())) {
permanent.damage(4, source.getSourceId(), game, false, true); permanent.damage(4, source.getSourceId(), game, false, true);

View file

@ -58,7 +58,7 @@ public class CreamOfTheCrop extends CardImpl {
// Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order. // Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility( this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
Zone.BATTLEFIELD, new CreamOfTheCropEffect(), Zone.BATTLEFIELD, new CreamOfTheCropEffect(),
new FilterCreaturePermanent(), true, SetTargetPointer.PERMANENT, StaticFilters.FILTER_PERMANENT_CREATURE, true, SetTargetPointer.PERMANENT,
"Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order")); "Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order"));
} }

View file

@ -89,7 +89,7 @@ class CrownOfConvergenceColorBoostEffect extends BoostAllEffect {
private static final String effectText = "creatures you control that share a color with that card get +1/+1"; private static final String effectText = "creatures you control that share a color with that card get +1/+1";
CrownOfConvergenceColorBoostEffect() { CrownOfConvergenceColorBoostEffect() {
super(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); super(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false);
staticText = effectText; staticText = effectText;
} }

View file

@ -67,7 +67,7 @@ public class CrownOfDoom extends CardImpl {
// Whenever a creature attacks you or a planeswalker you control, it gets +2/+0 until end of turn. // Whenever a creature attacks you or a planeswalker you control, it gets +2/+0 until end of turn.
Effect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn); Effect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn);
effect.setText("it gets +2/+0 until end of turn"); effect.setText("it gets +2/+0 until end of turn");
this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), SetTargetPointer.PERMANENT, true)); this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, true));
// {2}: Target player other than Crown of Doom's owner gains control of it. Activate this ability only during your turn. // {2}: Target player other than Crown of Doom's owner gains control of it. Activate this ability only during your turn.
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CrownOfDoomEffect(), new ManaCostsImpl("{2}"), MyTurnCondition.instance); Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CrownOfDoomEffect(), new ManaCostsImpl("{2}"), MyTurnCondition.instance);

View file

@ -45,7 +45,7 @@ public class CruelEdict extends CardImpl {
public CruelEdict(UUID ownerId, CardSetInfo setInfo) { public CruelEdict(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}");
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent sacrifices a creature")); this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent sacrifices a creature"));
this.getSpellAbility().addTarget(new TargetOpponent()); this.getSpellAbility().addTarget(new TargetOpponent());
// Target opponent sacrifices a creature. // Target opponent sacrifices a creature.
} }

View file

@ -61,7 +61,7 @@ public class CruelUltimatum extends CardImpl {
// Target opponent sacrifices a creature, discards three cards, then loses 5 life. // Target opponent sacrifices a creature, discards three cards, then loses 5 life.
// You return a creature card from your graveyard to your hand, draw three cards, then gain 5 life. // You return a creature card from your graveyard to your hand, draw three cards, then gain 5 life.
this.getSpellAbility().addTarget(new TargetOpponent()); this.getSpellAbility().addTarget(new TargetOpponent());
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent")); this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent"));
this.getSpellAbility().addEffect(new DiscardTargetEffect(3)); this.getSpellAbility().addEffect(new DiscardTargetEffect(3));
this.getSpellAbility().addEffect(new LoseLifeTargetEffect(5)); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(5));

View file

@ -1,89 +1,89 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.cards.c; package mage.cards.c;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.TargetSpell; import mage.target.TargetSpell;
import java.util.UUID; import java.util.UUID;
/** /**
* *
* @author Styxo * @author Styxo
*/ */
public class CrueltyOfTheSith extends CardImpl { public class CrueltyOfTheSith extends CardImpl {
private static final FilterSpell filterNoncreature = new FilterSpell("noncreature spell"); private static final FilterSpell filterNoncreature = new FilterSpell("noncreature spell");
static { static {
filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
} }
public CrueltyOfTheSith(UUID ownerId, CardSetInfo setInfo) { public CrueltyOfTheSith(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{B}{R}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{B}{R}");
// Choose one - Counter target noncreature spell. // Choose one - Counter target noncreature spell.
this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addTarget(new TargetSpell(filterNoncreature)); this.getSpellAbility().addTarget(new TargetSpell(filterNoncreature));
// Target player sacrifices a creture. // Target player sacrifices a creture.
Mode mode = new Mode(); Mode mode = new Mode();
mode.getEffects().add(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); mode.getEffects().add(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"));
mode.getTargets().add(new TargetPlayer()); mode.getTargets().add(new TargetPlayer());
this.getSpellAbility().addMode(mode); this.getSpellAbility().addMode(mode);
// Cruelty of the Sith deals 3 damage to target player. That player discards a card. // Cruelty of the Sith deals 3 damage to target player. That player discards a card.
mode = new Mode(); mode = new Mode();
mode.getEffects().add(new DamageTargetEffect(3)); mode.getEffects().add(new DamageTargetEffect(3));
mode.getEffects().add(new DiscardTargetEffect(1)); mode.getEffects().add(new DiscardTargetEffect(1));
mode.getTargets().add(new TargetPlayer()); mode.getTargets().add(new TargetPlayer());
this.getSpellAbility().addMode(mode); this.getSpellAbility().addMode(mode);
} }
public CrueltyOfTheSith(final CrueltyOfTheSith card) { public CrueltyOfTheSith(final CrueltyOfTheSith card) {
super(card); super(card);
} }
@Override @Override
public CrueltyOfTheSith copy() { public CrueltyOfTheSith copy() {
return new CrueltyOfTheSith(this); return new CrueltyOfTheSith(this);
} }
} }

View file

@ -91,7 +91,7 @@ class CurseOfDeathsHoldEffect extends ContinuousEffectImpl {
if (enchantment != null && enchantment.getAttachedTo() != null) { if (enchantment != null && enchantment.getAttachedTo() != null) {
Player player = game.getPlayer(enchantment.getAttachedTo()); Player player = game.getPlayer(enchantment.getAttachedTo());
if (player != null) { if (player != null) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { for (Permanent perm: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) {
perm.addPower(-1); perm.addPower(-1);
perm.addToughness(-1); perm.addToughness(-1);
} }

View file

@ -90,7 +90,7 @@ class DarkDabblingEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
if (SpellMasteryCondition.instance.apply(game, source)) { if (SpellMasteryCondition.instance.apply(game, source)) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
if (!permanent.getId().equals(getTargetPointer().getFirst(game, source))) { if (!permanent.getId().equals(getTargetPointer().getFirst(game, source))) {
RegenerateTargetEffect regenEffect = new RegenerateTargetEffect(); RegenerateTargetEffect regenEffect = new RegenerateTargetEffect();
regenEffect.setTargetPointer(new FixedTarget(permanent.getId())); regenEffect.setTargetPointer(new FixedTarget(permanent.getId()));

View file

@ -65,7 +65,7 @@ public class DarkSalvation extends CardImpl {
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
DynamicValue value = new ZombiesControlledByTargetPlayerCount(); DynamicValue value = new ZombiesControlledByTargetPlayerCount();
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false));
effect = new BoostTargetEffect(value, value, Duration.EndOfTurn, true); effect = new BoostTargetEffect(value, value, Duration.EndOfTurn, true);
effect.setTargetPointer(new SecondTargetPointer()); effect.setTargetPointer(new SecondTargetPointer());
effect.setText(", then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls"); effect.setText(", then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls");

View file

@ -77,7 +77,7 @@ class DarkestHourEffect extends ContinuousEffectImpl {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
permanent.getColor(game).setColor(ObjectColor.BLACK); permanent.getColor(game).setColor(ObjectColor.BLACK);
} }
return true; return true;

View file

@ -1,126 +1,126 @@
/* /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, are * Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met: * permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this list of * 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer. * conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list * 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials * of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution. * provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* The views and conclusions contained in the software and documentation are those of the * The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.cards.d; package mage.cards.d;
import mage.MageInt; import mage.MageInt;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.LifelinkAbility;
import mage.abilities.keyword.MenaceAbility; import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.Iterator; import java.util.Iterator;
import java.util.UUID; import java.util.UUID;
/** /**
* *
* @author Styxo * @author Styxo
*/ */
public class DarthVader extends CardImpl { public class DarthVader extends CardImpl {
public DarthVader(UUID ownerId, CardSetInfo setInfo) { public DarthVader(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},""); super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"");
addSuperType(SuperType.LEGENDARY); addSuperType(SuperType.LEGENDARY);
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Sith"); this.subtype.add("Sith");
this.power = new MageInt(4); this.power = new MageInt(4);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
this.color.setBlack(true); this.color.setBlack(true);
this.nightCard = true; this.nightCard = true;
// Menace // Menace
this.addAbility(new MenaceAbility()); this.addAbility(new MenaceAbility());
// Lifelink // Lifelink
this.addAbility(LifelinkAbility.getInstance()); this.addAbility(LifelinkAbility.getInstance());
// Whenever Darth Vader attacks, creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader. // Whenever Darth Vader attacks, creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader.
this.addAbility(new AttacksTriggeredAbility(new UnboostCreaturesDefendingPlayerEffect(), false, null, SetTargetPointer.PLAYER)); this.addAbility(new AttacksTriggeredAbility(new UnboostCreaturesDefendingPlayerEffect(), false, null, SetTargetPointer.PLAYER));
} }
public DarthVader(final DarthVader card) { public DarthVader(final DarthVader card) {
super(card); super(card);
} }
@Override @Override
public DarthVader copy() { public DarthVader copy() {
return new DarthVader(this); return new DarthVader(this);
} }
} }
class UnboostCreaturesDefendingPlayerEffect extends ContinuousEffectImpl { class UnboostCreaturesDefendingPlayerEffect extends ContinuousEffectImpl {
public UnboostCreaturesDefendingPlayerEffect() { public UnboostCreaturesDefendingPlayerEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.UnboostCreature); super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.UnboostCreature);
staticText = "creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader"; staticText = "creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader";
} }
public UnboostCreaturesDefendingPlayerEffect(final UnboostCreaturesDefendingPlayerEffect effect) { public UnboostCreaturesDefendingPlayerEffect(final UnboostCreaturesDefendingPlayerEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public UnboostCreaturesDefendingPlayerEffect copy() { public UnboostCreaturesDefendingPlayerEffect copy() {
return new UnboostCreaturesDefendingPlayerEffect(this); return new UnboostCreaturesDefendingPlayerEffect(this);
} }
@Override @Override
public void init(Ability source, Game game) { public void init(Ability source, Game game) {
super.init(source, game); super.init(source, game);
if (this.affectedObjectsSet) { if (this.affectedObjectsSet) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) {
affectedObjectList.add(new MageObjectReference(creature, game)); affectedObjectList.add(new MageObjectReference(creature, game));
} }
} }
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
Permanent permanent = it.next().getPermanent(game); Permanent permanent = it.next().getPermanent(game);
if (permanent != null) { if (permanent != null) {
int unboostCount = -1 * new CountersSourceCount(CounterType.P1P1).calculate(game, source, this); int unboostCount = -1 * new CountersSourceCount(CounterType.P1P1).calculate(game, source, this);
permanent.addPower(unboostCount); permanent.addPower(unboostCount);
permanent.addToughness(unboostCount); permanent.addToughness(unboostCount);
} else { } else {
it.remove(); it.remove();
} }
} }
return true; return true;
} }
} }

View file

@ -50,7 +50,7 @@ public class DeadDrop extends CardImpl {
// Delve // Delve
this.addAbility(new DelveAbility()); this.addAbility(new DelveAbility());
// Target player sacrifices two creatures // Target player sacrifices two creatures
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 2, "Target player")); this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 2, "Target player"));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
} }

View file

@ -85,7 +85,7 @@ class DeadlyTempestEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
HashMap<UUID, Integer> destroyedCreatures = new HashMap<>(); HashMap<UUID, Integer> destroyedCreatures = new HashMap<>();
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
if (permanent.destroy(source.getSourceId(), game, false)) { if (permanent.destroy(source.getSourceId(), game, false)) {
int count = destroyedCreatures.containsKey(permanent.getControllerId()) ? destroyedCreatures.get(permanent.getControllerId()) : 0; int count = destroyedCreatures.containsKey(permanent.getControllerId()) ? destroyedCreatures.get(permanent.getControllerId()) : 0;
destroyedCreatures.put(permanent.getControllerId(), count + 1); destroyedCreatures.put(permanent.getControllerId(), count + 1);

View file

@ -57,7 +57,7 @@ public class DeathMatch extends CardImpl {
// Whenever a creature enters the battlefield, that creature's controller may have target creature of his or her choice get -3/-3 until end of turn. // Whenever a creature enters the battlefield, that creature's controller may have target creature of his or her choice get -3/-3 until end of turn.
// NOTE: The ability being optional is implemented in the subclass to give the choice to correct player. // NOTE: The ability being optional is implemented in the subclass to give the choice to correct player.
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new DeathMatchEffect(), Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new DeathMatchEffect(),
new FilterCreaturePermanent(), false, SetTargetPointer.PLAYER, ""); StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PLAYER, "");
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
originalId = ability.getOriginalId(); originalId = ability.getOriginalId();

View file

@ -93,7 +93,7 @@ class DeathPitOfferingEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
for (Permanent permanent : permanents) { for (Permanent permanent : permanents) {
permanent.sacrifice(source.getSourceId(), game); permanent.sacrifice(source.getSourceId(), game);
} }

View file

@ -89,6 +89,6 @@ class DeathbringerRegentCondition implements Condition {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
return CastFromHandSourceCondition.instance.apply(game, source) return CastFromHandSourceCondition.instance.apply(game, source)
&& game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game).size() >= 6; && game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game).size() >= 6;
} }
} }

View file

@ -100,7 +100,7 @@ class DeceiverOfFormEffect extends OneShotEffect {
if (copyFromCard.isCreature()) { if (copyFromCard.isCreature()) {
if (controller.chooseUse(outcome, "Let creatures you control other than " if (controller.chooseUse(outcome, "Let creatures you control other than "
+ sourceObject.getLogName() + " becomes copies of " + copyFromCard.getLogName() + " until end of turn?", source, game)) { + sourceObject.getLogName() + " becomes copies of " + copyFromCard.getLogName() + " until end of turn?", source, game)) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) {
if (!permanent.getId().equals(sourceObject.getId())) { if (!permanent.getId().equals(sourceObject.getId())) {
Permanent newBluePrint = null; Permanent newBluePrint = null;
newBluePrint = new PermanentCard((Card) copyFromCard, source.getControllerId(), game); newBluePrint = new PermanentCard((Card) copyFromCard, source.getControllerId(), game);

View file

@ -95,7 +95,7 @@ class DecreeOfPainEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
int destroyedCreature = 0; int destroyedCreature = 0;
for(Permanent creature: game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { for(Permanent creature: game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) {
if (creature.destroy(source.getSourceId(), game, true)) { if (creature.destroy(source.getSourceId(), game, true)) {
destroyedCreature++; destroyedCreature++;
} }

View file

@ -82,7 +82,7 @@ public class DefenseOfTheHeart extends CardImpl {
Set<UUID> opponents = game.getOpponents(source.getControllerId()); Set<UUID> opponents = game.getOpponents(source.getControllerId());
for(UUID uuid : opponents) for(UUID uuid : opponents)
{ {
if(game.getBattlefield().countAll(new FilterCreaturePermanent(), uuid, game) >= 3) if(game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, uuid, game) >= 3)
{ {
return true; return true;
} }

View file

@ -54,7 +54,7 @@ public class DesecrationElemental extends CardImpl {
// Fear // Fear
this.addAbility(FearAbility.getInstance()); this.addAbility(FearAbility.getInstance());
// Whenever a player casts a spell, sacrifice a creature. // Whenever a player casts a spell, sacrifice a creature.
this.addAbility(new SpellCastAllTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false)); this.addAbility(new SpellCastAllTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""), false));
} }
public DesecrationElemental(final DesecrationElemental card) { public DesecrationElemental(final DesecrationElemental card) {

View file

@ -46,7 +46,7 @@ public class DiabolicEdict extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}");
// Target player sacrifices a creature. // Target player sacrifices a creature.
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
} }

View file

@ -66,7 +66,7 @@ public class DiaochanArtfulBeauty extends CardImpl {
// {tap}: Destroy target creature of your choice, then destroy target creature of an opponent's choice. Activate this ability only during your turn, before attackers are declared. // {tap}: Destroy target creature of your choice, then destroy target creature of an opponent's choice. Activate this ability only during your turn, before attackers are declared.
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiaochanArtfulBeautyDestroyEffect(), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.instance); Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiaochanArtfulBeautyDestroyEffect(), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.instance);
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
ability.addTarget(new TargetOpponentsChoicePermanent(1, 1, new FilterCreaturePermanent(), false, true)); ability.addTarget(new TargetOpponentsChoicePermanent(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false, true));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -104,7 +104,7 @@ class DoOrDieEffect extends OneShotEffect {
} }
} }
List<Permanent> pile2 = new ArrayList<>(); List<Permanent> pile2 = new ArrayList<>();
for (Permanent p : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { for (Permanent p : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) {
if (!pile1.contains(p)) { if (!pile1.contains(p)) {
pile2.add(p); pile2.add(p);
} }

View file

@ -95,7 +95,7 @@ class DoublingChantEffect extends OneShotEffect {
if (player == null) { if (player == null) {
return false; return false;
} }
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
for (Permanent creature : creatures) { for (Permanent creature : creatures) {
final String creatureName = creature.getName(); final String creatureName = creature.getName();
if (!namesFiltered.contains(creatureName)) { if (!namesFiltered.contains(creatureName)) {

View file

@ -73,7 +73,7 @@ public class DragonlordKolaghan extends CardImpl {
// Other creatures you control have haste. // Other creatures you control have haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true)));
// Whenever an opponent casts a creature or planeswalker spell with the same name as a card in their graveyard, that player loses 10 life. // Whenever an opponent casts a creature or planeswalker spell with the same name as a card in their graveyard, that player loses 10 life.
Effect effect = new LoseLifeTargetEffect(10); Effect effect = new LoseLifeTargetEffect(10);

View file

@ -53,7 +53,7 @@ public class DwarvenSong extends CardImpl {
Effect effect = new BecomesColorTargetEffect(ObjectColor.RED, Duration.EndOfTurn); Effect effect = new BecomesColorTargetEffect(ObjectColor.RED, Duration.EndOfTurn);
effect.setText("Any number of target creatures become red until end of turn"); effect.setText("Any number of target creatures become red until end of turn");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false));
} }

View file

@ -93,7 +93,7 @@ class EgoErasureLoseEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) { public void init(Ability source, Game game) {
super.init(source, game); super.init(source, game);
if (this.affectedObjectsSet) { if (this.affectedObjectsSet) {
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game);
for (Permanent creature : creatures) { for (Permanent creature : creatures) {
affectedObjectList.add(new MageObjectReference(creature, game)); affectedObjectList.add(new MageObjectReference(creature, game));
} }
@ -134,7 +134,7 @@ class EgoErasureBoostEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) { public void init(Ability source, Game game) {
super.init(source, game); super.init(source, game);
if (this.affectedObjectsSet) { if (this.affectedObjectsSet) {
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game);
for (Permanent creature : creatures) { for (Permanent creature : creatures) {
affectedObjectList.add(new MageObjectReference(creature, game)); affectedObjectList.add(new MageObjectReference(creature, game));
} }

View file

@ -65,7 +65,7 @@ public class EldraziMonument extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}"); super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}");
// Creatures you control get +1/+1, have flying, and are indestructible. // Creatures you control get +1/+1, have flying, and are indestructible.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent())));
Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Creatures you control"), false); Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Creatures you control"), false);
effect.setText("Creatures you control are indestructible"); effect.setText("Creatures you control are indestructible");

View file

@ -85,7 +85,7 @@ class ElspethTirelFirstEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int amount = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); int amount = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
player.gainLife(amount, game); player.gainLife(amount, game);

View file

@ -88,7 +88,7 @@ class EssenceHarvestEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget()); Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (player != null && targetPlayer != null) { if (player != null && targetPlayer != null) {
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game); List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game);
int amount = 0; int amount = 0;
for (Permanent creature : creatures) { for (Permanent creature : creatures) {
int power = creature.getPower().getValue(); int power = creature.getPower().getValue();

View file

@ -64,7 +64,7 @@ public class EvilTwin extends CardImpl {
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature." // You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature."
Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new EvilTwinApplyToPermanent()); Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new EvilTwinApplyToPermanent());
effect.setText("a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature.\""); effect.setText("a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature.\"");
this.addAbility(new EntersBattlefieldAbility(effect, true)); this.addAbility(new EntersBattlefieldAbility(effect, true));

View file

@ -74,7 +74,7 @@ public class ExecutionersSwing extends CardImpl {
class TargetCreaturePermanentThatDealtDamageThisTurn extends TargetPermanent { class TargetCreaturePermanentThatDealtDamageThisTurn extends TargetPermanent {
public TargetCreaturePermanentThatDealtDamageThisTurn() { public TargetCreaturePermanentThatDealtDamageThisTurn() {
super(1, 1, new FilterCreaturePermanent(), false); super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false);
targetName = "creature that dealt damage this turn"; targetName = "creature that dealt damage this turn";
} }

View file

@ -50,7 +50,7 @@ public class FarAway extends SplitCard {
// Away // Away
// Target player sacrifices a creature. // Target player sacrifices a creature.
getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"));
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer()); getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());
} }

View file

@ -102,7 +102,7 @@ class FavorOfTheMightyEffect extends ContinuousEffectImpl {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int maxCMC = Integer.MIN_VALUE; int maxCMC = Integer.MIN_VALUE;
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
if (permanent != null && permanent.getConvertedManaCost() > maxCMC) { if (permanent != null && permanent.getConvertedManaCost() > maxCMC) {
maxCMC = permanent.getConvertedManaCost(); maxCMC = permanent.getConvertedManaCost();
} }

View file

@ -88,7 +88,7 @@ class FellTheMightyEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Permanent targetCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); Permanent targetCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
if (controller != null && targetCreature != null) { if (controller != null && targetCreature != null) {
for(Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { for(Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) {
if (permanent.getPower().getValue() > targetCreature.getPower().getValue()) { if (permanent.getPower().getValue() > targetCreature.getPower().getValue()) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }

View file

@ -51,7 +51,7 @@ public class Fervor extends CardImpl {
// Creatures you control have haste. // Creatures you control have haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect( this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(
HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false)));
} }
public Fervor(final Fervor card) { public Fervor(final Fervor card) {

View file

@ -62,7 +62,7 @@ public class Festercreep extends CardImpl {
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)))); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1))));
// {1}{B}, Remove a +1/+1 counter from Festercreep: All other creatures get -1/-1 until end of turn. // {1}{B}, Remove a +1/+1 counter from Festercreep: All other creatures get -1/-1 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, new FilterCreaturePermanent(), true), new ManaCostsImpl("{1}{B}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true), new ManaCostsImpl("{1}{B}"));
ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1)));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -46,9 +46,9 @@ public class FinalRevels extends CardImpl {
public FinalRevels(UUID ownerId, CardSetInfo setInfo) { public FinalRevels(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}");
this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false));
Mode mode = new Mode(); Mode mode = new Mode();
mode.getEffects().add(new BoostAllEffect(0, -2, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); mode.getEffects().add(new BoostAllEffect(0, -2, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false));
this.getSpellAbility().addMode(mode); this.getSpellAbility().addMode(mode);
} }

View file

@ -60,7 +60,7 @@ class ForcedMarchEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
// for(Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { // for(Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE,
source.getControllerId(), source.getControllerId(),
source.getSourceId(), source.getSourceId(),
game)) { game)) {

View file

@ -70,7 +70,7 @@ public class FoulTongueInvocation extends CardImpl {
// Target player sacrifices a creature. If you revealed a Dragon card or controlled a Dragon as you cast Foul-Tongue Invocation, you gain 4 life. // Target player sacrifices a creature. If you revealed a Dragon card or controlled a Dragon as you cast Foul-Tongue Invocation, you gain 4 life.
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "target player")); this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "target player"));
this.getSpellAbility().addEffect(new FoulTongueInvocationEffect()); this.getSpellAbility().addEffect(new FoulTongueInvocationEffect());
this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher()); this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
} }

View file

@ -84,7 +84,7 @@ class FumigateEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
int destroyedCreature = 0; int destroyedCreature = 0;
for(Permanent creature: game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { for(Permanent creature: game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) {
if (creature.destroy(source.getSourceId(), game, false)) { if (creature.destroy(source.getSourceId(), game, false)) {
destroyedCreature++; destroyedCreature++;
} }

View file

@ -123,7 +123,7 @@ class P1P1CountersOnControlledCreaturesCount implements DynamicValue {
@Override @Override
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
int count = 0; int count = 0;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), sourceAbility.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceAbility.getControllerId(), game)) {
count += permanent.getCounters(game).getCount(CounterType.P1P1); count += permanent.getCounters(game).getCount(CounterType.P1P1);
} }
return count; return count;

View file

@ -49,7 +49,7 @@ public class GaeasAnthem extends CardImpl {
// Creatures you control get +1/+1. // Creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false)));
} }
public GaeasAnthem(final GaeasAnthem card) { public GaeasAnthem(final GaeasAnthem card) {

View file

@ -48,7 +48,7 @@ public class GerrardsBattleCry extends CardImpl {
public GerrardsBattleCry(UUID ownerId, CardSetInfo setInfo) { public GerrardsBattleCry(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}"); super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}");
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), false), new ManaCostsImpl("{2}{W}"))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), new ManaCostsImpl("{2}{W}")));
} }
public GerrardsBattleCry(final GerrardsBattleCry card) { public GerrardsBattleCry(final GerrardsBattleCry card) {

View file

@ -47,7 +47,7 @@ public class GethsVerdict extends CardImpl {
public GethsVerdict (UUID ownerId, CardSetInfo setInfo) { public GethsVerdict (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}{B}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}{B}");
this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"));
this.getSpellAbility().addEffect(new LoseLifeTargetEffect(1)); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(1));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
} }

View file

@ -63,7 +63,7 @@ public class Gigantoplasm extends CardImpl {
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// You may have Gigantoplasm enter the battlefield as a copy of any creature on the battlefield except it gains "{X}: This creature has base power and toughness X/X." // You may have Gigantoplasm enter the battlefield as a copy of any creature on the battlefield except it gains "{X}: This creature has base power and toughness X/X."
Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new GigantoplasmApplyToPermanent()); Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new GigantoplasmApplyToPermanent());
effect.setText("a copy of any creature on the battlefield except it gains \"{X}: This creature has base power and toughness X/X.\""); effect.setText("a copy of any creature on the battlefield except it gains \"{X}: This creature has base power and toughness X/X.\"");
this.addAbility(new EntersBattlefieldAbility(effect, true)); this.addAbility(new EntersBattlefieldAbility(effect, true));
} }

View file

@ -86,7 +86,7 @@ public class GiltspireAvenger extends CardImpl {
class GiltspireAvengerTarget extends TargetPermanent { class GiltspireAvengerTarget extends TargetPermanent {
public GiltspireAvengerTarget() { public GiltspireAvengerTarget() {
super(1, 1, new FilterCreaturePermanent(), false); super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false);
targetName = "creature that dealt damage to you this turn"; targetName = "creature that dealt damage to you this turn";
} }

View file

@ -67,7 +67,7 @@ public class GlaringSpotlight extends CardImpl {
// {3}, Sacrifice Glaring Spotlight: Creatures you control gain hexproof until end of turn and can't be blocked this turn. // {3}, Sacrifice Glaring Spotlight: Creatures you control gain hexproof until end of turn and can't be blocked this turn.
Ability ability = new SimpleActivatedAbility( Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(),false), Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE,false),
new GenericManaCost(3)); new GenericManaCost(3));
ability.addEffect(new CantBeBlockedAllEffect(new FilterControlledCreaturePermanent(), Duration.EndOfTurn)); ability.addEffect(new CantBeBlockedAllEffect(new FilterControlledCreaturePermanent(), Duration.EndOfTurn));
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());

View file

@ -51,7 +51,7 @@ public class GleamOfResistance extends CardImpl {
// Creatures you control get +1/+2 until end of turn. Untap those creatures. // Creatures you control get +1/+2 until end of turn. Untap those creatures.
this.getSpellAbility().addEffect(new BoostControlledEffect(1, 2, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BoostControlledEffect(1, 2, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures")); this.getSpellAbility().addEffect(new UntapAllControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE,"Untap those creatures"));
// Basic landcycling {1}{W}({1}{W}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) // Basic landcycling {1}{W}({1}{W}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.)
this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{1}{W}"))); this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{1}{W}")));
} }

View file

@ -49,7 +49,7 @@ public class GloriousAnthem extends CardImpl {
// Creatures you control get +1/+1. // Creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false)));
} }
public GloriousAnthem(final GloriousAnthem card) { public GloriousAnthem(final GloriousAnthem card) {

View file

@ -47,7 +47,7 @@ public class GloriousCharge extends CardImpl {
// Creatures you control get +1/+1 until end of turn. // Creatures you control get +1/+1 until end of turn.
this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false));
} }
public GloriousCharge(final GloriousCharge card) { public GloriousCharge(final GloriousCharge card) {

View file

@ -103,7 +103,7 @@ class GreatOakGuardianEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) { public void init(Ability source, Game game) {
super.init(source, game); super.init(source, game);
if (this.affectedObjectsSet) { if (this.affectedObjectsSet) {
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game);
for (Permanent creature : creatures) { for (Permanent creature : creatures) {
affectedObjectList.add(new MageObjectReference(creature, game)); affectedObjectList.add(new MageObjectReference(creature, game));
} }
@ -145,7 +145,7 @@ class GreatOakGuardianUntapEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getControllerId());
if (targetPlayer != null) { if (targetPlayer != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) {
permanent.untap(game); permanent.untap(game);
} }
return true; return true;

View file

@ -61,7 +61,7 @@ public class GrixisCharm extends CardImpl {
this.getSpellAbility().addMode(mode); this.getSpellAbility().addMode(mode);
// or creatures you control get +2/+0 until end of turn. // or creatures you control get +2/+0 until end of turn.
mode = new Mode(); mode = new Mode();
mode.getEffects().add(new BoostControlledEffect(2, 0, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); mode.getEffects().add(new BoostControlledEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false));
this.getSpellAbility().addMode(mode); this.getSpellAbility().addMode(mode);
} }

View file

@ -85,7 +85,7 @@ class HallowedBurialEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) {
controller.moveCardToLibraryWithInfo(creature, source.getSourceId(), game, Zone.BATTLEFIELD, false, true); controller.moveCardToLibraryWithInfo(creature, source.getSourceId(), game, Zone.BATTLEFIELD, false, true);
} }
return true; return true;

View file

@ -64,7 +64,7 @@ public class HauntedPlateMail extends CardImpl {
Zone.BATTLEFIELD, Zone.BATTLEFIELD,
new BecomesCreatureSourceEffect(new HauntedPlateMailToken(),"", Duration.EndOfTurn), new BecomesCreatureSourceEffect(new HauntedPlateMailToken(),"", Duration.EndOfTurn),
new ManaCostsImpl("{0}"), new ManaCostsImpl("{0}"),
new PermanentsOnTheBattlefieldCondition(new FilterCreaturePermanent(), ComparisonType.EQUAL_TO, 0), new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_PERMANENT_CREATURE, ComparisonType.EQUAL_TO, 0),
"{0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures."); "{0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures.");
this.addAbility(ability); this.addAbility(ability);
// Equip {4} // Equip {4}

View file

@ -53,7 +53,7 @@ public class HeavensGate extends CardImpl {
Effect effect = new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn); Effect effect = new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn);
effect.setText("Any number of target creatures become white until end of turn"); effect.setText("Any number of target creatures become white until end of turn");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false));
} }

View file

@ -69,7 +69,7 @@ public class HeliodGodOfTheSun extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// Other creatures you control have vigilance. // Other creatures you control have vigilance.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true)));
// {2}{W}{W}: Create a 2/1 white Cleric enchantment creature token. // {2}{W}{W}: Create a 2/1 white Cleric enchantment creature token.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HeliodGodOfTheSunToken()), new ManaCostsImpl("{2}{W}{W}"))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HeliodGodOfTheSunToken()), new ManaCostsImpl("{2}{W}{W}")));

View file

@ -81,7 +81,7 @@ class HellionEruptionEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
for (Permanent permanent : permanents) { for (Permanent permanent : permanents) {
permanent.sacrifice(source.getSourceId(), game); permanent.sacrifice(source.getSourceId(), game);
} }

View file

@ -89,7 +89,7 @@ class HumilityEffect extends ContinuousEffectImpl {
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), player.getId(), source.getSourceId(), game)) { for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), source.getSourceId(), game)) {
switch (layer) { switch (layer) {
case AbilityAddingRemovingEffects_6: case AbilityAddingRemovingEffects_6:
permanent.removeAllAbilities(source.getSourceId(), game); permanent.removeAllAbilities(source.getSourceId(), game);

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