mirror of
https://github.com/correl/mage.git
synced 2024-11-24 19:19:56 +00:00
* Some more use of StaticFilter objects.
This commit is contained in:
parent
d5f4df7f54
commit
4806738cfb
234 changed files with 1211 additions and 1211 deletions
|
@ -781,9 +781,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
List<Permanent> targets;
|
||||
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 {
|
||||
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) {
|
||||
if (target.canTarget(getId(), permanent.getId(), source, game)) {
|
||||
|
|
|
@ -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>");
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(effect));
|
||||
// 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) {
|
||||
|
|
|
@ -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";
|
||||
|
||||
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();
|
||||
this.addTarget(target);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class AccursedCentaur extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -86,7 +86,7 @@ class AlphaStatusDynamicValue implements DynamicValue {
|
|||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
|
||||
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 (enchanted.shareSubtypes(permanent, game)) {
|
||||
xValue += 2;
|
||||
|
|
|
@ -91,7 +91,7 @@ class AngelsTrumpetTapEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
int count = 0;
|
||||
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.
|
||||
if (creature.isTapped()) {
|
||||
continue;
|
||||
|
|
|
@ -60,7 +60,7 @@ public class ArtisanOfForms extends CardImpl {
|
|||
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.
|
||||
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");
|
||||
Ability ability = new HeroicAbility(effect, true);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
@ -49,7 +49,7 @@ public class AuraShards extends CardImpl {
|
|||
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.
|
||||
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()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ class SacrificeAllEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
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) {
|
||||
p.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
@ -102,10 +102,10 @@ class AvatarOfMightCostReductionEffect extends CostModificationEffectImpl {
|
|||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
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())) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public class AvengingArrow extends CardImpl {
|
|||
class AvengingArrowTarget extends TargetPermanent {
|
||||
|
||||
public AvengingArrowTarget() {
|
||||
super(1, 1, new FilterCreaturePermanent(), false);
|
||||
super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false);
|
||||
targetName = "creature that dealt damage this turn";
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ class BalefireDragonEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
int amount = (Integer)getValue("damage");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,112 +1,112 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanentSameController;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class BarrinsSpite extends CardImpl {
|
||||
|
||||
public BarrinsSpite(UUID ownerId, CardSetInfo setInfo) {
|
||||
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.
|
||||
this.getSpellAbility().addEffect(new BarrinsSpiteEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2, 2, new FilterCreaturePermanent(), false));
|
||||
|
||||
}
|
||||
|
||||
public BarrinsSpite(final BarrinsSpite card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarrinsSpite copy() {
|
||||
return new BarrinsSpite(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BarrinsSpiteEffect extends OneShotEffect {
|
||||
|
||||
public BarrinsSpiteEffect() {
|
||||
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";
|
||||
}
|
||||
|
||||
public BarrinsSpiteEffect(final BarrinsSpiteEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarrinsSpiteEffect copy() {
|
||||
return new BarrinsSpiteEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null) {
|
||||
boolean sacrificeDone = false;
|
||||
int count = 0;
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
if (creature != null) {
|
||||
Player controllerOfCreature = game.getPlayer(creature.getControllerId());
|
||||
if ((count == 0
|
||||
&& controllerOfCreature.chooseUse(Outcome.Sacrifice, "Sacrifice " + creature.getLogName() + '?', source, game))
|
||||
|| (count == 1
|
||||
&& !sacrificeDone)) {
|
||||
creature.sacrifice(source.getId(), game);
|
||||
sacrificeDone = true;
|
||||
} else {
|
||||
creature.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanentSameController;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class BarrinsSpite extends CardImpl {
|
||||
|
||||
public BarrinsSpite(UUID ownerId, CardSetInfo setInfo) {
|
||||
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.
|
||||
this.getSpellAbility().addEffect(new BarrinsSpiteEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2, 2, StaticFilters.FILTER_PERMANENT_CREATURE, false));
|
||||
|
||||
}
|
||||
|
||||
public BarrinsSpite(final BarrinsSpite card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarrinsSpite copy() {
|
||||
return new BarrinsSpite(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BarrinsSpiteEffect extends OneShotEffect {
|
||||
|
||||
public BarrinsSpiteEffect() {
|
||||
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";
|
||||
}
|
||||
|
||||
public BarrinsSpiteEffect(final BarrinsSpiteEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarrinsSpiteEffect copy() {
|
||||
return new BarrinsSpiteEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null) {
|
||||
boolean sacrificeDone = false;
|
||||
int count = 0;
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
if (creature != null) {
|
||||
Player controllerOfCreature = game.getPlayer(creature.getControllerId());
|
||||
if ((count == 0
|
||||
&& controllerOfCreature.chooseUse(Outcome.Sacrifice, "Sacrifice " + creature.getLogName() + '?', source, game))
|
||||
|| (count == 1
|
||||
&& !sacrificeDone)) {
|
||||
creature.sacrifice(source.getId(), game);
|
||||
sacrificeDone = true;
|
||||
} else {
|
||||
creature.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ class BatheInLightEffect extends OneShotEffect {
|
|||
ObjectColor protectColor = (ObjectColor) game.getState().getValue(target.getId() + "_color");
|
||||
if (protectColor != null) {
|
||||
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)) {
|
||||
ContinuousEffect effect = new GainProtectionFromColorTargetEffect(Duration.EndOfTurn, protectColor);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
|
|
|
@ -61,7 +61,7 @@ public class BearerOfSilence extends CardImpl {
|
|||
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.
|
||||
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());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
@ -132,9 +132,9 @@ class BenevolentOfferingEffect2 extends OneShotEffect {
|
|||
target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), game);
|
||||
Player opponent = game.getPlayer(target.getFirstTarget());
|
||||
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);
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class BiomanticMasteryEffect extends OneShotEffect {
|
|||
for(UUID playerId: getTargetPointer().getTargets(game, source)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ class BlasphemousCostReductionEffect extends CostModificationEffectImpl {
|
|||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class BlightedFen extends CardImpl {
|
|||
|
||||
// {4}{B}, {T}, Sacrifice Blighted Fen: Target opponent sacrifices a creature.
|
||||
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}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
|
|
|
@ -1,83 +1,83 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class BlindWorship extends CardImpl {
|
||||
|
||||
public BlindWorship(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{G}{W}");
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
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."
|
||||
DynamicValue xValue = new SourcePermanentPowerCount();
|
||||
Ability attachedAbility = new AttacksTriggeredAbility(new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, new FilterCreaturePermanent(), true), false);
|
||||
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\"");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, gainAbilityEffect));
|
||||
|
||||
}
|
||||
|
||||
public BlindWorship(final BlindWorship card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlindWorship copy() {
|
||||
return new BlindWorship(this);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class BlindWorship extends CardImpl {
|
||||
|
||||
public BlindWorship(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{G}{W}");
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
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."
|
||||
DynamicValue xValue = new SourcePermanentPowerCount();
|
||||
Ability attachedAbility = new AttacksTriggeredAbility(new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true), false);
|
||||
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\"");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, gainAbilityEffect));
|
||||
|
||||
}
|
||||
|
||||
public BlindWorship(final BlindWorship card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlindWorship copy() {
|
||||
return new BlindWorship(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
Effect effect = new LoseLifeTargetEffect(1);
|
||||
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) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class BoldDefense extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn),
|
||||
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"));
|
||||
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),
|
||||
"and gain first strike until end of turn"));
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class BreakingWaveEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
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);
|
||||
for(Permanent creature: creatures) {
|
||||
if(creature.isTapped()) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class BurstOfSpeed extends CardImpl {
|
|||
public BurstOfSpeed(UUID ownerId, CardSetInfo setInfo) {
|
||||
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) {
|
||||
|
|
|
@ -79,7 +79,7 @@ public class CabalExecutioner extends CardImpl {
|
|||
class CabalExecutionerAbility extends TriggeredAbilityImpl {
|
||||
|
||||
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) {
|
||||
|
|
|
@ -65,7 +65,7 @@ public class CallForUnity extends CardImpl {
|
|||
|
||||
// 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,
|
||||
new FilterCreaturePermanent(), false);
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE, false);
|
||||
effect.setText("Creatures you control get +1/+1 for each unity counter on {this}");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class CalltoGloryFirstEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -51,7 +51,7 @@ public class Caltrops extends CardImpl {
|
|||
// Whenever a creature attacks, Caltrops deals 1 damage to it.
|
||||
Effect effect = new DamageTargetEffect(1);
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ class CankerAbominationEffect extends OneShotEffect {
|
|||
Player opponent = game.getPlayer(target.getFirstTarget());
|
||||
if (opponent != null) {
|
||||
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) {
|
||||
cankerAbomination.addCounters(CounterType.M1M1.createInstance(amount), source, game);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
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) {
|
||||
|
|
|
@ -90,7 +90,7 @@ class CatastropheEffect extends OneShotEffect {
|
|||
permanent.destroy(source.getSourceId(), game, permanent.isCreature());
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class CauldronOfSouls extends CardImpl {
|
|||
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");
|
||||
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);
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ChainersEdict extends CardImpl {
|
|||
|
||||
|
||||
// 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());
|
||||
|
||||
// Flashback {5}{B}{B}
|
||||
|
|
|
@ -85,7 +85,7 @@ class ChandrasIgnitionEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
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())) {
|
||||
creature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class CleaverRiot extends CardImpl {
|
|||
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -89,7 +89,7 @@ class CloneLegionEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
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) {
|
||||
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
|
|
|
@ -131,7 +131,7 @@ class CollectiveEffortEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player target = game.getPlayer(source.getFirstTarget());
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -58,7 +58,7 @@ public class CommanderGrevenIlVec extends CardImpl {
|
|||
this.addAbility(FearAbility.getInstance());
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -95,7 +95,7 @@ class ContagionEngineEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -102,7 +102,7 @@ class CracklingDoomEffect extends OneShotEffect {
|
|||
int greatestPower = Integer.MIN_VALUE;
|
||||
int numberOfCreatures = 0;
|
||||
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) {
|
||||
greatestPower = permanent.getPower().getValue();
|
||||
numberOfCreatures = 1;
|
||||
|
|
|
@ -93,7 +93,7 @@ class CraterHellionEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
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) {
|
||||
if (!permanent.getId().equals(source.getSourceId())) {
|
||||
permanent.damage(4, source.getSourceId(), game, false, true);
|
||||
|
|
|
@ -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.
|
||||
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
|
||||
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"));
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
CrownOfConvergenceColorBoostEffect() {
|
||||
super(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false);
|
||||
super(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false);
|
||||
staticText = effectText;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
Effect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn);
|
||||
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.
|
||||
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CrownOfDoomEffect(), new ManaCostsImpl("{2}"), MyTurnCondition.instance);
|
||||
|
|
|
@ -45,7 +45,7 @@ public class CruelEdict extends CardImpl {
|
|||
public CruelEdict(UUID ownerId, CardSetInfo setInfo) {
|
||||
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());
|
||||
// Target opponent sacrifices a creature.
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class CruelUltimatum extends CardImpl {
|
|||
// 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.
|
||||
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 LoseLifeTargetEffect(5));
|
||||
|
||||
|
|
|
@ -1,89 +1,89 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class CrueltyOfTheSith extends CardImpl {
|
||||
|
||||
private static final FilterSpell filterNoncreature = new FilterSpell("noncreature spell");
|
||||
|
||||
static {
|
||||
filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||
}
|
||||
|
||||
public CrueltyOfTheSith(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{B}{R}");
|
||||
|
||||
// Choose one - Counter target noncreature spell.
|
||||
this.getSpellAbility().addEffect(new CounterTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell(filterNoncreature));
|
||||
|
||||
// Target player sacrifices a creture.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"));
|
||||
mode.getTargets().add(new TargetPlayer());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
|
||||
// Cruelty of the Sith deals 3 damage to target player. That player discards a card.
|
||||
mode = new Mode();
|
||||
mode.getEffects().add(new DamageTargetEffect(3));
|
||||
mode.getEffects().add(new DiscardTargetEffect(1));
|
||||
mode.getTargets().add(new TargetPlayer());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
|
||||
}
|
||||
|
||||
public CrueltyOfTheSith(final CrueltyOfTheSith card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrueltyOfTheSith copy() {
|
||||
return new CrueltyOfTheSith(this);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class CrueltyOfTheSith extends CardImpl {
|
||||
|
||||
private static final FilterSpell filterNoncreature = new FilterSpell("noncreature spell");
|
||||
|
||||
static {
|
||||
filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||
}
|
||||
|
||||
public CrueltyOfTheSith(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{B}{R}");
|
||||
|
||||
// Choose one - Counter target noncreature spell.
|
||||
this.getSpellAbility().addEffect(new CounterTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell(filterNoncreature));
|
||||
|
||||
// Target player sacrifices a creture.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"));
|
||||
mode.getTargets().add(new TargetPlayer());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
|
||||
// Cruelty of the Sith deals 3 damage to target player. That player discards a card.
|
||||
mode = new Mode();
|
||||
mode.getEffects().add(new DamageTargetEffect(3));
|
||||
mode.getEffects().add(new DiscardTargetEffect(1));
|
||||
mode.getTargets().add(new TargetPlayer());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
|
||||
}
|
||||
|
||||
public CrueltyOfTheSith(final CrueltyOfTheSith card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CrueltyOfTheSith copy() {
|
||||
return new CrueltyOfTheSith(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class CurseOfDeathsHoldEffect extends ContinuousEffectImpl {
|
|||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
Player player = game.getPlayer(enchantment.getAttachedTo());
|
||||
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.addToughness(-1);
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class DarkDabblingEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability 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))) {
|
||||
RegenerateTargetEffect regenEffect = new RegenerateTargetEffect();
|
||||
regenEffect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
|
|
|
@ -65,7 +65,7 @@ public class DarkSalvation extends CardImpl {
|
|||
this.getSpellAbility().addEffect(effect);
|
||||
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.setTargetPointer(new SecondTargetPointer());
|
||||
effect.setText(", then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls");
|
||||
|
|
|
@ -77,7 +77,7 @@ class DarkestHourEffect extends ContinuousEffectImpl {
|
|||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,126 +1,126 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class DarthVader extends CardImpl {
|
||||
|
||||
public DarthVader(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Sith");
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
this.color.setBlack(true);
|
||||
|
||||
this.nightCard = true;
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Lifelink
|
||||
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.
|
||||
this.addAbility(new AttacksTriggeredAbility(new UnboostCreaturesDefendingPlayerEffect(), false, null, SetTargetPointer.PLAYER));
|
||||
}
|
||||
|
||||
public DarthVader(final DarthVader card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DarthVader copy() {
|
||||
return new DarthVader(this);
|
||||
}
|
||||
}
|
||||
|
||||
class UnboostCreaturesDefendingPlayerEffect extends ContinuousEffectImpl {
|
||||
|
||||
public UnboostCreaturesDefendingPlayerEffect() {
|
||||
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";
|
||||
}
|
||||
|
||||
public UnboostCreaturesDefendingPlayerEffect(final UnboostCreaturesDefendingPlayerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnboostCreaturesDefendingPlayerEffect copy() {
|
||||
return new UnboostCreaturesDefendingPlayerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
int unboostCount = -1 * new CountersSourceCount(CounterType.P1P1).calculate(game, source, this);
|
||||
permanent.addPower(unboostCount);
|
||||
permanent.addToughness(unboostCount);
|
||||
} else {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* 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
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class DarthVader extends CardImpl {
|
||||
|
||||
public DarthVader(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Sith");
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
this.color.setBlack(true);
|
||||
|
||||
this.nightCard = true;
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Lifelink
|
||||
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.
|
||||
this.addAbility(new AttacksTriggeredAbility(new UnboostCreaturesDefendingPlayerEffect(), false, null, SetTargetPointer.PLAYER));
|
||||
}
|
||||
|
||||
public DarthVader(final DarthVader card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DarthVader copy() {
|
||||
return new DarthVader(this);
|
||||
}
|
||||
}
|
||||
|
||||
class UnboostCreaturesDefendingPlayerEffect extends ContinuousEffectImpl {
|
||||
|
||||
public UnboostCreaturesDefendingPlayerEffect() {
|
||||
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";
|
||||
}
|
||||
|
||||
public UnboostCreaturesDefendingPlayerEffect(final UnboostCreaturesDefendingPlayerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnboostCreaturesDefendingPlayerEffect copy() {
|
||||
return new UnboostCreaturesDefendingPlayerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
int unboostCount = -1 * new CountersSourceCount(CounterType.P1P1).calculate(game, source, this);
|
||||
permanent.addPower(unboostCount);
|
||||
permanent.addToughness(unboostCount);
|
||||
} else {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class DeadDrop extends CardImpl {
|
|||
// Delve
|
||||
this.addAbility(new DelveAbility());
|
||||
// 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());
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ class DeadlyTempestEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
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)) {
|
||||
int count = destroyedCreatures.containsKey(permanent.getControllerId()) ? destroyedCreatures.get(permanent.getControllerId()) : 0;
|
||||
destroyedCreatures.put(permanent.getControllerId(), count + 1);
|
||||
|
|
|
@ -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.
|
||||
// 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(),
|
||||
new FilterCreaturePermanent(), false, SetTargetPointer.PLAYER, "");
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PLAYER, "");
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
originalId = ability.getOriginalId();
|
||||
|
|
|
@ -93,7 +93,7 @@ class DeathPitOfferingEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
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) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
@ -89,6 +89,6 @@ class DeathbringerRegentCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class DeceiverOfFormEffect extends OneShotEffect {
|
|||
if (copyFromCard.isCreature()) {
|
||||
if (controller.chooseUse(outcome, "Let creatures you control other than "
|
||||
+ 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())) {
|
||||
Permanent newBluePrint = null;
|
||||
newBluePrint = new PermanentCard((Card) copyFromCard, source.getControllerId(), game);
|
||||
|
|
|
@ -95,7 +95,7 @@ class DecreeOfPainEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
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)) {
|
||||
destroyedCreature++;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class DefenseOfTheHeart extends CardImpl {
|
|||
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class DesecrationElemental extends CardImpl {
|
|||
// Fear
|
||||
this.addAbility(FearAbility.getInstance());
|
||||
// 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) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class DiabolicEdict extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}");
|
||||
|
||||
// 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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiaochanArtfulBeautyDestroyEffect(), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.instance);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ class DoOrDieEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
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)) {
|
||||
pile2.add(p);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class DoublingChantEffect extends OneShotEffect {
|
|||
if (player == null) {
|
||||
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) {
|
||||
final String creatureName = creature.getName();
|
||||
if (!namesFiltered.contains(creatureName)) {
|
||||
|
|
|
@ -73,7 +73,7 @@ public class DragonlordKolaghan extends CardImpl {
|
|||
|
||||
// Other creatures you control have haste.
|
||||
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.
|
||||
Effect effect = new LoseLifeTargetEffect(10);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class DwarvenSong extends CardImpl {
|
|||
Effect effect = new BecomesColorTargetEffect(ObjectColor.RED, Duration.EndOfTurn);
|
||||
effect.setText("Any number of target creatures become red until end of turn");
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ class EgoErasureLoseEffect extends ContinuousEffectImpl {
|
|||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
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) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ class EgoErasureBoostEffect extends ContinuousEffectImpl {
|
|||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
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) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class EldraziMonument extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}");
|
||||
|
||||
// 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())));
|
||||
Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Creatures you control"), false);
|
||||
effect.setText("Creatures you control are indestructible");
|
||||
|
|
|
@ -85,7 +85,7 @@ class ElspethTirelFirstEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
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());
|
||||
if (player != null) {
|
||||
player.gainLife(amount, game);
|
||||
|
|
|
@ -88,7 +88,7 @@ class EssenceHarvestEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
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;
|
||||
for (Permanent creature : creatures) {
|
||||
int power = creature.getPower().getValue();
|
||||
|
|
|
@ -64,7 +64,7 @@ public class EvilTwin extends CardImpl {
|
|||
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."
|
||||
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.\"");
|
||||
this.addAbility(new EntersBattlefieldAbility(effect, true));
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public class ExecutionersSwing extends CardImpl {
|
|||
class TargetCreaturePermanentThatDealtDamageThisTurn extends TargetPermanent {
|
||||
|
||||
public TargetCreaturePermanentThatDealtDamageThisTurn() {
|
||||
super(1, 1, new FilterCreaturePermanent(), false);
|
||||
super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false);
|
||||
targetName = "creature that dealt damage this turn";
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class FarAway extends SplitCard {
|
|||
|
||||
// Away
|
||||
// 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());
|
||||
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class FavorOfTheMightyEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
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) {
|
||||
maxCMC = permanent.getConvertedManaCost();
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class FellTheMightyEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent targetCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
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()) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class Fervor extends CardImpl {
|
|||
|
||||
// Creatures you control have haste.
|
||||
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) {
|
||||
|
|
|
@ -62,7 +62,7 @@ public class Festercreep extends CardImpl {
|
|||
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.
|
||||
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)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -46,9 +46,9 @@ public class FinalRevels extends CardImpl {
|
|||
public FinalRevels(UUID ownerId, CardSetInfo setInfo) {
|
||||
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.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);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class ForcedMarchEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
|
||||
// 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.getSourceId(),
|
||||
game)) {
|
||||
|
|
|
@ -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.
|
||||
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().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ class FumigateEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
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)) {
|
||||
destroyedCreature++;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ class P1P1CountersOnControlledCreaturesCount implements DynamicValue {
|
|||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
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);
|
||||
}
|
||||
return count;
|
||||
|
|
|
@ -49,7 +49,7 @@ public class GaeasAnthem extends CardImpl {
|
|||
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public class GerrardsBattleCry extends CardImpl {
|
|||
public GerrardsBattleCry(UUID ownerId, CardSetInfo setInfo) {
|
||||
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) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public class GethsVerdict extends CardImpl {
|
|||
public GethsVerdict (UUID ownerId, CardSetInfo setInfo) {
|
||||
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().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class Gigantoplasm extends CardImpl {
|
|||
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."
|
||||
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.\"");
|
||||
this.addAbility(new EntersBattlefieldAbility(effect, true));
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class GiltspireAvenger extends CardImpl {
|
|||
class GiltspireAvengerTarget extends TargetPermanent {
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
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));
|
||||
ability.addEffect(new CantBeBlockedAllEffect(new FilterControlledCreaturePermanent(), Duration.EndOfTurn));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
|
|
|
@ -51,7 +51,7 @@ public class GleamOfResistance extends CardImpl {
|
|||
|
||||
// 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 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.)
|
||||
this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{1}{W}")));
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class GloriousAnthem extends CardImpl {
|
|||
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public class GloriousCharge extends CardImpl {
|
|||
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -103,7 +103,7 @@ class GreatOakGuardianEffect extends ContinuousEffectImpl {
|
|||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
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) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ class GreatOakGuardianUntapEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(source.getControllerId());
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -61,7 +61,7 @@ public class GrixisCharm extends CardImpl {
|
|||
this.getSpellAbility().addMode(mode);
|
||||
// or creatures you control get +2/+0 until end of turn.
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ class HallowedBurialEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -64,7 +64,7 @@ public class HauntedPlateMail extends CardImpl {
|
|||
Zone.BATTLEFIELD,
|
||||
new BecomesCreatureSourceEffect(new HauntedPlateMailToken(),"", Duration.EndOfTurn),
|
||||
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.");
|
||||
this.addAbility(ability);
|
||||
// Equip {4}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class HeavensGate extends CardImpl {
|
|||
Effect effect = new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn);
|
||||
effect.setText("Any number of target creatures become white until end of turn");
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class HeliodGodOfTheSun extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
// 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.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HeliodGodOfTheSunToken()), new ManaCostsImpl("{2}{W}{W}")));
|
||||
|
|
|
@ -81,7 +81,7 @@ class HellionEruptionEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
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) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ class HumilityEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
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) {
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue