Merge commit 'ae8ada286c' into Network_Upgrade

Conflicts:
	Mage.Common/src/mage/view/CardView.java
This commit is contained in:
LevelX2 2015-09-13 18:03:07 +02:00
commit c591e4b75a
190 changed files with 6697 additions and 2331 deletions

View file

@ -41,7 +41,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 4;
public final static String MAGE_VERSION_MINOR_PATCH = "v0";
public final static String MAGE_VERSION_MINOR_PATCH = "v3";
public final static String MAGE_VERSION_INFO = "";
private final int major;

View file

@ -153,7 +153,7 @@ public class CardView extends SimpleCardView {
* for morph / face down cards to know which player may see information for
* the card
* @param showFaceDownCard if true and the card is not on the battelfield,
* also a face dwon card is shown in the view dwon cards will be shown
* also a face down card is shown in the view down cards will be shown
*/
public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard) {
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.getTokenSetCode(), game != null);

View file

@ -103,7 +103,12 @@ public class GameView implements Serializable {
Card card = game.getCard(stackObject.getSourceId());
if (card != null) {
if (object != null) {
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card)));
if (object instanceof Permanent) {
boolean controlled = ((Permanent) object).getControllerId().equals(createdForPlayerId);
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, ((Permanent) object).getName(), new CardView(((Permanent) object), game, controlled, false)));
} else {
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card, game, false, false)));
}
} else {
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, "", new CardView(card)));
}
@ -139,7 +144,7 @@ public class GameView implements Serializable {
stack.put(stackObject.getId(), new CardView(((StackAbility) stackObject)));
checkPaid(stackObject.getId(), ((StackAbility) stackObject));
} else {
logger.fatal("Object can't be cast to StackAbility: " + object.getName() + " " + object.toString());
logger.fatal("Object can't be cast to StackAbility: " + object.getName() + " " + object.toString() + " " + object.getClass().toString());
}
}
} else {

View file

@ -383,7 +383,7 @@ public class HumanPlayer extends PlayerImpl {
}
while (!abort) {
Set<UUID> possibleTargets = target.possibleTargets(source == null ? null : source.getSourceId(), abilityControllerId, game);
boolean required = target.isRequired(source);
boolean required = target.isRequired(source != null ? source.getSourceId() : null, game);
if (possibleTargets.isEmpty() || target.getTargets().size() >= target.getNumberOfTargets()) {
required = false;
}
@ -715,21 +715,23 @@ public class HumanPlayer extends PlayerImpl {
if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) {
return ability;
}
if (triggerAutoOrderNameFirst.contains(ability.getRule())) {
MageObject object = game.getObject(ability.getSourceId());
String rule = ability.getRule(object != null ? object.getName() : null);
if (triggerAutoOrderNameFirst.contains(rule)) {
return ability;
}
if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) {
abilityOrderLast = ability;
continue;
}
if (triggerAutoOrderNameLast.contains(ability.getRule())) {
if (triggerAutoOrderNameLast.contains(rule)) {
abilityOrderLast = ability;
continue;
}
if (autoOrderUse) {
if (autoOrderRuleText == null) {
autoOrderRuleText = ability.getRule();
} else if (!ability.getRule().equals(autoOrderRuleText)) {
autoOrderRuleText = rule;
} else if (!rule.equals(autoOrderRuleText)) {
autoOrderUse = false;
}
}

View file

@ -33,25 +33,13 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesSubtypeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -64,7 +52,7 @@ public class UnnaturalSelection extends CardImpl {
this.expansionSetCode = "APC";
// {1}: Choose a creature type other than Wall. Target creature becomes that type until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenNonWallCreatureTypeTargetEffect(), new GenericManaCost(1));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenCreatureTypeTargetEffect(true), new GenericManaCost(1));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
@ -77,4 +65,4 @@ public class UnnaturalSelection extends CardImpl {
public UnnaturalSelection copy() {
return new UnnaturalSelection(this);
}
}
}

View file

@ -27,21 +27,24 @@
*/
package mage.sets.avacynrestored;
import mage.constants.*;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Library;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.effects.ContinuousEffect;
import mage.target.targetpointer.FixedTarget;
/**
@ -54,7 +57,6 @@ public class StolenGoods extends CardImpl {
super(ownerId, 78, "Stolen Goods", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}");
this.expansionSetCode = "AVR";
// Target opponent exiles cards from the top of his or her library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.
this.getSpellAbility().addEffect(new StolenGoodsEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
@ -96,14 +98,13 @@ class StolenGoodsEffect extends OneShotEffect {
do {
card = library.removeFromTop(game);
if (card != null) {
opponent.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
opponent.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName());
}
} while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND));
if (card != null) {
opponent.revealCards("Card to cast", new CardsImpl(card), game);
ContinuousEffect effect = new StolenGoodsCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
game.addEffect(effect, source);
}
return true;
@ -135,7 +136,8 @@ class StolenGoodsCastFromExileEffect extends AsThoughEffectImpl {
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
if (getTargetPointer().getFirst(game, source).equals(sourceId) && affectedControllerId.equals(source.getControllerId())) {
if (sourceId != null && sourceId.equals(getTargetPointer().getFirst(game, source))
&& affectedControllerId.equals(source.getControllerId())) {
Card card = game.getCard(sourceId);
if (card != null && game.getState().getZone(sourceId) == Zone.EXILED) {
Player player = game.getPlayer(affectedControllerId);

View file

@ -0,0 +1,120 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AttacksEachTurnStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author fireshoes
*/
public class AkoumFirebird extends CardImpl {
public AkoumFirebird(UUID ownerId) {
super(ownerId, 138, "Akoum Firebird", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.expansionSetCode = "BFZ";
this.subtype.add("Phoenix");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Haste
this.addAbility(HasteAbility.getInstance());
// Akoum Firebird attacks each turn if able.
this.addAbility(new AttacksEachTurnStaticAbility());
// <i>Landfall</i>-Whenever a land enters the battlefield under your control, you may pay {4}{R}{R}.
// If you do, return Akoum Firebird from your graveyard to the battlefield.
this.addAbility(new AkoumFirebirdLandfallAbility(new DoIfCostPaid(
new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{4}{R}{R}")), false));
}
public AkoumFirebird(final AkoumFirebird card) {
super(card);
}
@Override
public AkoumFirebird copy() {
return new AkoumFirebird(this);
}
}
class AkoumFirebirdLandfallAbility extends TriggeredAbilityImpl {
public AkoumFirebirdLandfallAbility(Effect effect, boolean optional) {
this(Zone.GRAVEYARD, effect, optional);
}
public AkoumFirebirdLandfallAbility (Zone zone, Effect effect, Boolean optional ) {
super(zone, effect, optional);
}
public AkoumFirebirdLandfallAbility(final AkoumFirebirdLandfallAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
return permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId);
}
@Override
public String getRule() {
return "<i>Landfall</i> &mdash; Whenever a land enters the battlefield under your control, " + super.getRule();
}
@Override
public AkoumFirebirdLandfallAbility copy() {
return new AkoumFirebirdLandfallAbility(this);
}
}

View file

@ -0,0 +1,166 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author fireshoes
*/
public class AkoumHellkite extends CardImpl {
public AkoumHellkite(UUID ownerId) {
super(ownerId, 139, "Akoum Hellkite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{R}");
this.expansionSetCode = "BFZ";
this.subtype.add("Dragon");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// <i>Landfall</i>-Whenever a land enters the battlefield under you control, Akoum Hellkite deals 1 damage to target creature or player.
// If that land is a Mountain, Akoum Hellkite deals 2 damage to that creature or player instead.
Ability ability = new AkoumHellkiteTriggeredAbility();
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public AkoumHellkite(final AkoumHellkite card) {
super(card);
}
@Override
public AkoumHellkite copy() {
return new AkoumHellkite(this);
}
}
class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl {
private static final String text = "<i>Landfall</i> - Whenever a land enters the battlefield under your control, {this} deals 1 damage to target creature or player. "
+ "If that land is a Mountain, Akoum Hellkite deals 2 damage to that creature or player instead.";
public AkoumHellkiteTriggeredAbility() {
super(Zone.BATTLEFIELD, new AkoumHellkiteDamageEffect());
}
public AkoumHellkiteTriggeredAbility(final AkoumHellkiteTriggeredAbility ability) {
super(ability);
}
@Override
public AkoumHellkiteTriggeredAbility copy() {
return new AkoumHellkiteTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null
&& permanent.getCardType().contains(CardType.LAND)
&& permanent.getControllerId().equals(getControllerId())) {
Permanent sourcePermanent = game.getPermanent(getSourceId());
if (sourcePermanent != null)
for (Effect effect : getEffects()) {
if (effect instanceof AkoumHellkiteDamageEffect) {
effect.setTargetPointer(new FixedTarget(permanent, game));
}
return true;
}
}
return false;
}
@Override
public String getRule() {
return text;
}
}
class AkoumHellkiteDamageEffect extends OneShotEffect {
public AkoumHellkiteDamageEffect() {
super(Outcome.Damage);
}
public AkoumHellkiteDamageEffect(final AkoumHellkiteDamageEffect effect) {
super(effect);
}
@Override
public AkoumHellkiteDamageEffect copy() {
return new AkoumHellkiteDamageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
Player player = game.getPlayer(source.getFirstTarget());
if (land != null && player != null) {
if (land.hasSubtype("Mountain")) {
player.damage(2, source.getSourceId(), game, false, true);
} else {
player.damage(1, source.getSourceId(), game, false, true);
}
return true;
}
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (land != null && permanent != null) {
if (land.hasSubtype("Mountain")) {
permanent.damage(2, source.getSourceId(), game, false, true);
} else {
permanent.damage(1, source.getSourceId(), game, false, true);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,84 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.keyword.DevoidAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.permanent.token.EldraziScionToken;
/**
*
* @author fireshoes
*/
public class CatacombSifter extends CardImpl {
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature you control");
static {
filter.add(new AnotherPredicate());
filter.add(new ControllerPredicate(TargetController.YOU));
}
public CatacombSifter(UUID ownerId) {
super(ownerId, 201, "Catacomb Sifter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{G}");
this.expansionSetCode = "BFZ";
this.subtype.add("Eldrazi");
this.subtype.add("Drone");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Devoid
this.addAbility(new DevoidAbility(this.color));
// When Catacomb Sifter enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziScionToken())));
// Whenever another creature you control dies, scry 1
this.addAbility(new DiesCreatureTriggeredAbility(new ScryEffect(1), false, filter));
}
public CatacombSifter(final CatacombSifter card) {
super(card);
}
@Override
public CatacombSifter copy() {
return new CatacombSifter(this);
}
}

View file

@ -41,7 +41,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.ColorlessPredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
@ -51,7 +51,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
*/
public class DominatorDrone extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("another colorless creature");
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature");
static {
filter.add(new AnotherPredicate());

View file

@ -0,0 +1,77 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author fireshoes
*/
public class DranasEmissary extends CardImpl {
public DranasEmissary(UUID ownerId) {
super(ownerId, 210, "Drana's Emissary", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{B}");
this.expansionSetCode = "BFZ";
this.subtype.add("Vampire");
this.subtype.add("Cleric");
this.subtype.add("Ally");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, each opponent loses 1 life and you gain 1 life.
Effect effect = new GainLifeEffect(1);
effect.setText("and you gain 1 life");
Ability ability = new BeginningOfUpkeepTriggeredAbility(new LoseLifeOpponentsEffect(1), TargetController.YOU, false);
ability.addEffect(effect);
this.addAbility(ability);
}
public DranasEmissary(final DranasEmissary card) {
super(card);
}
@Override
public DranasEmissary copy() {
return new DranasEmissary(this);
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class FelidarSovereign extends mage.sets.zendikar.FelidarSovereign {
public FelidarSovereign(UUID ownerId) {
super(ownerId);
this.cardNumber = 26;
this.expansionSetCode = "BFZ";
this.rarity = Rarity.RARE;
}
public FelidarSovereign(final FelidarSovereign card) {
super(card);
}
@Override
public FelidarSovereign copy() {
return new FelidarSovereign(this);
}
}

View file

@ -0,0 +1,111 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSourceEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author fireshoes
*/
public class GreenwardenOfMurasa extends CardImpl {
public GreenwardenOfMurasa(UUID ownerId) {
super(ownerId, 174, "Greenwarden of Murasa", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.expansionSetCode = "BFZ";
this.subtype.add("Elemental");
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// When Greenwarden of Murasa enters the battlefield, you may return target card from your graveyard to your hand.
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), true);
ability.addTarget(new TargetCardInYourGraveyard());
this.addAbility(ability);
// When Greenwarden of Murasa dies, you may exile it. If you do, return target card from your graveyard to your hand.
ability = new DiesTriggeredAbility(new GreenwardenOfMurasaEffect(), false);
ability.addTarget(new TargetCardInYourGraveyard());
this.addAbility(ability);
}
public GreenwardenOfMurasa(final GreenwardenOfMurasa card) {
super(card);
}
@Override
public GreenwardenOfMurasa copy() {
return new GreenwardenOfMurasa(this);
}
}
class GreenwardenOfMurasaEffect extends OneShotEffect {
public GreenwardenOfMurasaEffect() {
super(Outcome.Benefit);
this.staticText = "you may exile it. If you do, return target card from your graveyard to your hand";
}
public GreenwardenOfMurasaEffect(final GreenwardenOfMurasaEffect effect) {
super(effect);
}
@Override
public GreenwardenOfMurasaEffect copy() {
return new GreenwardenOfMurasaEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return card from your graveyard to your hand?", source, game)) {
new ExileSourceEffect().apply(game, source);
return new ReturnToHandTargetEffect().apply(game, source);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,68 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.LandfallAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class GroveRumbler extends CardImpl {
public GroveRumbler(UUID ownerId) {
super(ownerId, 211, "Grove Rumbler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
this.expansionSetCode = "BFZ";
this.subtype.add("Elemental");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Trample
this.addAbility(TrampleAbility.getInstance());
// <i>Landfall</i>-Whenever a land enters the battlefield under your control, Grove Rumbler gets +2/+2 until end of turn.
this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false));
}
public GroveRumbler(final GroveRumbler card) {
super(card);
}
@Override
public GroveRumbler copy() {
return new GroveRumbler(this);
}
}

View file

@ -0,0 +1,119 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.players.Player;
/**
*
* @author fireshoes
*/
public class GrovetenderDruids extends CardImpl {
public GrovetenderDruids(UUID ownerId) {
super(ownerId, 212, "Grovetender Druids", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
this.expansionSetCode = "BFZ";
this.subtype.add("Elf");
this.subtype.add("Druid");
this.subtype.add("Ally");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// <i>Rally</i>-Whenever Grovetender Druids or another Ally enters the battlefield under your control, you may pay {1}.
// If you do, put a 1/1 green Plant creature token onto the battlefield.
this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new GrovetenderDruidsEffect(), false));
}
public GrovetenderDruids(final GrovetenderDruids card) {
super(card);
}
@Override
public GrovetenderDruids copy() {
return new GrovetenderDruids(this);
}
}
class GrovetenderDruidsEffect extends OneShotEffect {
GrovetenderDruidsEffect() {
super(Outcome.Benefit);
this.staticText = "you may pay {1}. If you do, put a 1/1 green Plant creature token onto the battlefield";
}
GrovetenderDruidsEffect(final GrovetenderDruidsEffect effect) {
super(effect);
}
@Override
public GrovetenderDruidsEffect copy() {
return new GrovetenderDruidsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if(player != null) {
if(player.chooseUse(Outcome.BoostCreature, "Do you want to to pay {1}?", source, game)) {
Cost cost = new ManaCostsImpl("{1}");
if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
new CreateTokenEffect(new GrovetenderDruidsPlantToken()).apply(game, source);
}
return true;
}
}
return false;
}
}
class GrovetenderDruidsPlantToken extends Token {
public GrovetenderDruidsPlantToken() {
super("Plant", "1/1 green Plant creature");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add("Plant");
power = new MageInt(1);
toughness = new MageInt(1);
this.setOriginalExpansionSetCode("BFZ");
}
}

View file

@ -0,0 +1,77 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
import mage.abilities.keyword.DevoidAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorlessPredicate;
/**
*
* @author fireshoes
*/
public class HeraldOfKozilek extends CardImpl {
private static final FilterCard filter = new FilterCard("Colorless spells");
static {
filter.add(new ColorlessPredicate());
}
public HeraldOfKozilek(UUID ownerId) {
super(ownerId, 205, "Herald of Kozilek", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{R}");
this.expansionSetCode = "BFZ";
this.subtype.add("Eldrazi");
this.subtype.add("Drone");
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Devoid
this.addAbility(new DevoidAbility(this.color));
// Colorless spells you cast cost {1} less to cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 1)));
}
public HeraldOfKozilek(final HeraldOfKozilek card) {
super(card);
}
@Override
public HeraldOfKozilek copy() {
return new HeraldOfKozilek(this);
}
}

View file

@ -0,0 +1,73 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
/**
*
* @author fireshoes
*/
public class ResoluteBlademaster extends CardImpl {
public ResoluteBlademaster(UUID ownerId) {
super(ownerId, 218, "Resolute Blademaster", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{W}");
this.expansionSetCode = "BFZ";
this.subtype.add("Human");
this.subtype.add("Soldier");
this.subtype.add("Ally");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// <i>Rally</i>-Whenever Resolute Blademaster or another Ally enters the battlefield under your control,
// you control gain double strike until end of turn.
Ability ability = new AllyEntersBattlefieldTriggeredAbility(
new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn,
new FilterControlledCreaturePermanent("creatures you control")), false);
this.addAbility(ability);
}
public ResoluteBlademaster(final ResoluteBlademaster card) {
super(card);
}
@Override
public ResoluteBlademaster copy() {
return new ResoluteBlademaster(this);
}
}

View file

@ -0,0 +1,64 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.abilities.keyword.AwakenAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class RoilSpout extends CardImpl {
public RoilSpout(UUID ownerId) {
super(ownerId, 219, "Roil Spout", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}{U}");
this.expansionSetCode = "BFZ";
// Put target creature on top of its owner's library.
this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// Awaken 4-{4}{W}{U}
this.addAbility(new AwakenAbility(this, 4, "{4}{W}{U}"));
}
public RoilSpout(final RoilSpout card) {
super(card);
}
@Override
public RoilSpout copy() {
return new RoilSpout(this);
}
}

View file

@ -0,0 +1,90 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
/**
*
* @author fireshoes
*/
public class ShamblingVent extends CardImpl {
public ShamblingVent(UUID ownerId) {
super(ownerId, 244, "Shambling Vent", Rarity.RARE, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "BFZ";
// Shambling Vent enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
// {T}: Add {W} or {B} to your mana pool.
this.addAbility(new WhiteManaAbility());
this.addAbility(new BlackManaAbility());
// {1}{W}{B}: Shambling Vent becomes a 2/3 white and black Elemental creature with lifelink until end of turn. It's still a land.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new ShamblingVentToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{W}{B}")));
}
public ShamblingVent(final ShamblingVent card) {
super(card);
}
@Override
public ShamblingVent copy() {
return new ShamblingVent(this);
}
}
class ShamblingVentToken extends Token {
public ShamblingVentToken() {
super("", "2/3 white and black Elemental creature with lifelink");
cardType.add(CardType.CREATURE);
subtype.add("Elemental");
color.setWhite(true);
color.setBlack(true);
power = new MageInt(2);
toughness = new MageInt(3);
addAbility(LifelinkAbility.getInstance());
}
}

View file

@ -0,0 +1,137 @@
/*
* 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.sets.battleforzendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.DevoidAbility;
import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.other.OwnerPredicate;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetSpell;
import mage.target.common.TargetCardInExile;
/**
*
* @author fireshoes
*/
public class UlamogsNullifier extends CardImpl {
public UlamogsNullifier(UUID ownerId) {
super(ownerId, 207, "Ulamog's Nullifier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{B}");
this.expansionSetCode = "BFZ";
this.subtype.add("Eldrazi");
this.subtype.add("Processor");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Devoid
this.addAbility(new DevoidAbility(this.color));
// Flash
this.addAbility(FlashAbility.getInstance());
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Ulamog's Nullifier enters the battlefield, you may put two cards your opponents own
// from exile into their owners' graveyards. If you do, counter target spell.
Effect effect = new UlamogsNullifierEffect();
effect.setText("you may put two cards your opponents own from exile into their owners' graveyards. If you do, ");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, true);
ability.addTarget(new TargetSpell());
this.addAbility(ability);
}
public UlamogsNullifier(final UlamogsNullifier card) {
super(card);
}
@Override
public UlamogsNullifier copy() {
return new UlamogsNullifier(this);
}
}
class UlamogsNullifierEffect extends OneShotEffect {
private final static FilterCard filter = new FilterCard("cards your opponents own from exile");
static {
filter.add(new OwnerPredicate(TargetController.OPPONENT));
}
public UlamogsNullifierEffect() {
super(Outcome.Benefit);
this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, ";
}
public UlamogsNullifierEffect(final UlamogsNullifierEffect effect) {
super(effect);
}
@Override
public UlamogsNullifierEffect copy() {
return new UlamogsNullifierEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Spell spell = game.getStack().getSpell(source.getFirstTarget());
if (controller != null && spell != null) {
Target target = new TargetCardInExile(2, 2, filter, null);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
if (controller.chooseTarget(outcome, target, source, game)) {
Cards cardsToGraveyard = new CardsImpl(target.getTargets());
controller.moveCards(cardsToGraveyard, null, Zone.GRAVEYARD, source, game);
game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
return true;
}
}
}
return false;
}
}

View file

@ -35,6 +35,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
@ -47,10 +48,8 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -111,25 +110,20 @@ class KikiJikiMirrorBreakerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
}
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
if (permanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(permanent);
token.addAbility(HasteAbility.getInstance());
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true);
effect.setTargetPointer(new FixedTarget(permanent, game));
effect.apply(game, source);
for (Permanent addedToken : effect.getAddedPermanent()) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(addedToken.getId()));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;
}

View file

@ -0,0 +1,77 @@
/*
* 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.sets.coldsnap;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class FrozenSolid extends CardImpl {
public FrozenSolid(UUID ownerId) {
super(ownerId, 35, "Frozen Solid", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}");
this.expansionSetCode = "CSP";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature doesn't untap during its controller's untap step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect()));
// When enchanted creature is dealt damage, destroy it.
this.addAbility(new DamageDealtToAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false));
}
public FrozenSolid(final FrozenSolid card) {
super(card);
}
@Override
public FrozenSolid copy() {
return new FrozenSolid(this);
}
}

View file

@ -40,30 +40,28 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.KithkinToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author jeffwadsworth
*
*/
public class GwyllionHedgeMage extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Plains");
private static final FilterLandPermanent filter2 = new FilterLandPermanent("Swamps");
private static final FilterCreaturePermanent filter3 = new FilterCreaturePermanent();
static {
filter.add(new SubtypePredicate("Plains"));
filter2.add(new SubtypePredicate("Swamps"));
filter2.add(new SubtypePredicate("Swamp"));
}
private String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield.";
private String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature.";
private final String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield.";
private final String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature.";
public GwyllionHedgeMage(UUID ownerId) {
super(ownerId, 202, "Gwyllion Hedge-Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W/B}");
@ -77,12 +75,15 @@ public class GwyllionHedgeMage extends CardImpl {
// When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield.
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KithkinToken()), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule1);
this.addAbility(ability);
// When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature.
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2);
ability2.addTarget(new TargetPermanent(filter3));
Ability ability2 = new ConditionalTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()), true),
new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1),
rule2);
ability2.addTarget(new TargetCreaturePermanent());
this.addAbility(ability2);
}
public GwyllionHedgeMage(final GwyllionHedgeMage card) {

View file

@ -30,11 +30,13 @@ package mage.sets.commander;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -48,11 +50,8 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.util.CardUtil;
/**
*
@ -62,6 +61,7 @@ public class RikuOfTwoReflections extends CardImpl {
private static final FilterSpell filter = new FilterSpell("an instant or sorcery spell");
private static final FilterControlledCreaturePermanent filterPermanent = new FilterControlledCreaturePermanent("another nontoken creature");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
@ -85,12 +85,10 @@ public class RikuOfTwoReflections extends CardImpl {
this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new RikuOfTwoReflectionsCopyEffect(), new ManaCostsImpl("{U}{R}")), filter, false, true));
// Whenever another nontoken creature enters the battlefield under your control, you may pay {G}{U}. If you do, put a token that's a copy of that creature onto the battlefield.
Ability ability = new EntersBattlefieldAllTriggeredAbility(
Zone.BATTLEFIELD, new RikuOfTwoReflectionsCopyTokenEffect(),filterPermanent, false, SetTargetPointer.PERMANENT,
"Whenever another nontoken creature enters the battlefield under your control, you may pay {G}{U}. If you do, put a token that's a copy of that creature onto the battlefield.",
true);
ability.addCost(new ManaCostsImpl("{G}{U}"));
this.addAbility(ability);
Effect effect = new DoIfCostPaid(new PutTokenOntoBattlefieldCopyTargetEffect(),
new ManaCostsImpl("{G}{U}"), "Put a token that's a copy of that creature onto the battlefield?");
effect.setText("you may pay {G}{U}. If you do, put a token that's a copy of that creature onto the battlefield");
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, effect, filterPermanent, false, SetTargetPointer.PERMANENT, null));
}
public RikuOfTwoReflections(final RikuOfTwoReflections card) {
@ -139,32 +137,3 @@ class RikuOfTwoReflectionsCopyEffect extends OneShotEffect {
return new RikuOfTwoReflectionsCopyEffect(this);
}
}
class RikuOfTwoReflectionsCopyTokenEffect extends OneShotEffect {
public RikuOfTwoReflectionsCopyTokenEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "put a token that's a copy of that creature onto the battlefield";
}
public RikuOfTwoReflectionsCopyTokenEffect(final RikuOfTwoReflectionsCopyTokenEffect effect) {
super(effect);
}
@Override
public RikuOfTwoReflectionsCopyTokenEffect copy() {
return new RikuOfTwoReflectionsCopyTokenEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (permanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(permanent);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
}
return false;
}
}

View file

@ -30,7 +30,7 @@ package mage.sets.commander;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopySource;
import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -53,7 +53,7 @@ public class Spawnwrithe extends CardImpl {
// Trample
this.addAbility(TrampleAbility.getInstance());
// Whenever Spawnwrithe deals combat damage to a player, put a token that's a copy of Spawnwrithe onto the battlefield.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PutTokenOntoBattlefieldCopySource(), false));
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PutTokenOntoBattlefieldCopySourceEffect(), false));
}

View file

@ -36,8 +36,8 @@ import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbil
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -47,10 +47,8 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -105,19 +103,12 @@ class FeldonOfTheThirdPathEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
EmptyToken token = new EmptyToken();
// TODO: This fails if a card will be copied, that uses adjustTargets() method.
CardUtil.copyTo(token).from(card);
if (!token.getCardType().contains(CardType.ARTIFACT)) {
token.getCardType().add(CardType.ARTIFACT);
}
token.addAbility(HasteAbility.getInstance());
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
Permanent permanent = game.getPermanent(token.getLastAddedToken());
if (permanent != null) {
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), CardType.ARTIFACT, true);
effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId())));
effect.apply(game, source);
for (Permanent addedToken : effect.getAddedPermanent()) {
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
sacrificeEffect.setTargetPointer(new FixedTarget(addedToken, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());

View file

@ -29,26 +29,18 @@ package mage.sets.conflux;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.common.BecomesTappedAttachedTriggeredAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.LoseLifeControllerAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -56,7 +48,7 @@ import mage.target.targetpointer.FixedTarget;
*/
public class CorruptedRoots extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("Forest or Plains");
private static final FilterPermanent filter = new FilterPermanent("Forest or Plains");
static {
filter.add(Predicates.or(
@ -69,17 +61,15 @@ public class CorruptedRoots extends CardImpl {
this.expansionSetCode = "CON";
this.subtype.add("Aura");
// Enchant Forest or Plains
TargetPermanent auraTarget = new TargetLandPermanent(filter);
TargetPermanent auraTarget = new TargetPermanent(filter);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Whenever enchanted land becomes tapped, its controller loses 2 life.
this.addAbility(new CorruptedRootsTriggeredAbility());
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new LoseLifeControllerAttachedEffect(2), "enchanted land"));
}
public CorruptedRoots(final CorruptedRoots card) {
@ -91,44 +81,3 @@ public class CorruptedRoots extends CardImpl {
return new CorruptedRoots(this);
}
}
class CorruptedRootsTriggeredAbility extends TriggeredAbilityImpl {
CorruptedRootsTriggeredAbility() {
super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2));
}
CorruptedRootsTriggeredAbility(final CorruptedRootsTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.TAPPED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.sourceId);
if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) {
Permanent attached = game.getPermanent(enchantment.getAttachedTo());
if (attached != null) {
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(attached.getControllerId()));
}
return true;
}
}
return false;
}
@Override
public CorruptedRootsTriggeredAbility copy() {
return new CorruptedRootsTriggeredAbility(this);
}
@Override
public String getRule() {
return "Whenever enchanted land becomes tapped, its controller loses 2 life.";
}
}

View file

@ -29,28 +29,21 @@ package mage.sets.conflux;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.game.permanent.token.EmptyToken;
import mage.util.CardUtil;
/**
*
@ -63,7 +56,7 @@ public class MirrorSigilSergeant extends CardImpl {
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
private static final String rule = "At the beginning of your upkeep, if you control a blue permanent, you may put a token that's a copy of Mirror-Sigil Sergeant onto the battlefield.";
public MirrorSigilSergeant(UUID ownerId) {
@ -79,7 +72,9 @@ public class MirrorSigilSergeant extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// At the beginning of your upkeep, if you control a blue permanent, you may put a token that's a copy of Mirror-Sigil Sergeant onto the battlefield.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new MirrorSigilSergeantEffect(), TargetController.YOU, true);
Effect effect = new PutTokenOntoBattlefieldCopySourceEffect();
effect.setText("you may put a token that's a copy of {this} onto the battlefield");
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, true);
this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter), rule));
}
@ -93,41 +88,3 @@ public class MirrorSigilSergeant extends CardImpl {
return new MirrorSigilSergeant(this);
}
}
class MirrorSigilSergeantEffect extends OneShotEffect {
public MirrorSigilSergeantEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "put a token that's a copy of {this} onto the battlefield";
}
public MirrorSigilSergeantEffect(final MirrorSigilSergeantEffect effect) {
super(effect);
}
@Override
public MirrorSigilSergeantEffect copy() {
return new MirrorSigilSergeantEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
UUID targetId = source.getSourceId();
if (targetId != null && player != null) {
MageObject target = game.getPermanent(targetId);
if (target == null) {
target = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
}
if (target != null) {
if (target instanceof Permanent) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from((Permanent) target);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
}
}
}
return false;
}
}

View file

@ -30,16 +30,14 @@ package mage.sets.conflux;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -48,7 +46,7 @@ import mage.target.common.TargetCreaturePermanent;
* @author jeffwadsworth
*/
public class YokeOfTheDamned extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature");
public YokeOfTheDamned(UUID ownerId) {
@ -60,13 +58,13 @@ public class YokeOfTheDamned extends CardImpl {
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// When a creature dies, destroy enchanted creature.
this.addAbility(new DiesCreatureTriggeredAbility(new DestroyEnchantedEffect(), false, filter));
this.addAbility(new DiesCreatureTriggeredAbility(new DestroyAttachedEffect("enchanted creature"), false, filter));
}
public YokeOfTheDamned(final YokeOfTheDamned card) {
@ -78,37 +76,3 @@ public class YokeOfTheDamned extends CardImpl {
return new YokeOfTheDamned(this);
}
}
class DestroyEnchantedEffect extends OneShotEffect {
public DestroyEnchantedEffect() {
super(Outcome.Detriment);
staticText = "destroy enchanted creature";
}
public DestroyEnchantedEffect(final DestroyEnchantedEffect effect) {
super(effect);
}
@Override
public DestroyEnchantedEffect copy() {
return new DestroyEnchantedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null && enchantment.getAttachedTo() != null) {
UUID uuid = getTargetPointer().getFirst(game, source);
Permanent creature = game.getPermanent(uuid);
if (creature == null) {
creature = game.getPermanent(enchantment.getAttachedTo());
}
if (creature != null) {
return creature.destroy(source.getSourceId(), game, false);
}
}
return false;
}
}

View file

@ -34,6 +34,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -44,11 +45,9 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -97,28 +96,21 @@ class SeanceEffect extends OneShotEffect {
Card card = game.getCard(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && card != null) {
if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true)) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(card);
if (!token.hasSubtype("Spirit")) {
token.getSubtype().add("Spirit");
}
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
if (controller.moveCards(card, null, Zone.EXILED, source, game)) {
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true);
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
effect.setAdditionalSubType("Spirit");
effect.apply(game, source);
for (Permanent addedToken : effect.getAddedPermanent()) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(addedToken, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}
return true;
}

View file

@ -30,7 +30,8 @@ package mage.sets.dissension;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealtDamageToSourceTriggeredAbility;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopySource;
import mage.abilities.effects.Effect;
import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -54,7 +55,9 @@ public class SproutingPhytohydra extends CardImpl {
// Defender
this.addAbility(DefenderAbility.getInstance());
// Whenever Sprouting Phytohydra is dealt damage, you may put a token that's a copy of Sprouting Phytohydra onto the battlefield.
this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, new PutTokenOntoBattlefieldCopySource(), false));
Effect effect = new PutTokenOntoBattlefieldCopySourceEffect();
effect.setText("you may put a token that's a copy of {this} onto the battlefield");
this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, effect, true));
}
public SproutingPhytohydra(final SproutingPhytohydra card) {

View file

@ -29,30 +29,22 @@ package mage.sets.dragonsmaze;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceMatchesFilterCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CopyEffect;
import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect;
import mage.abilities.effects.common.CopyPermanentEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.util.CardUtil;
import mage.util.functions.AbilityApplier;
/**
@ -78,9 +70,11 @@ public class ProgenitorMimic extends CardImpl {
// You may have Progenitor Mimic enter the battlefield as a copy of any creature on the battlefield
// except it gains "At the beginning of your upkeep, if this creature isn't a token,
// put a token onto the battlefield that's a copy of this creature."
Effect effect = new PutTokenOntoBattlefieldCopySourceEffect();
effect.setText("put a token onto the battlefield that's a copy of this creature");
AbilityApplier applier = new AbilityApplier(
new ConditionalTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(new ProgenitorMimicCopyEffect(), TargetController.YOU, false),
new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false),
new SourceMatchesFilterCondition(filter),
"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.")
);
@ -100,55 +94,3 @@ public class ProgenitorMimic extends CardImpl {
return new ProgenitorMimic(this);
}
}
class ProgenitorMimicCopyEffect extends OneShotEffect {
public ProgenitorMimicCopyEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "put a token onto the battlefield that's a copy of this creature";
}
public ProgenitorMimicCopyEffect(final ProgenitorMimicCopyEffect effect) {
super(effect);
}
@Override
public ProgenitorMimicCopyEffect copy() {
return new ProgenitorMimicCopyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent copyFromPermanent = null;
// handle copies of copies
for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) {
if (effect instanceof CopyEffect) {
CopyEffect copyEffect = (CopyEffect) effect;
// there is another copy effect that our targetPermanent copies stats from
if (copyEffect.getSourceId().equals(source.getSourceId())) {
MageObject oldBluePrint = ((CopyEffect) effect).getTarget();
if (oldBluePrint instanceof Permanent) {
// copy it and apply the applier if any
copyFromPermanent = (Permanent) oldBluePrint;
}
}
}
}
if (copyFromPermanent == null) {
// if it was no copy of copy take the target itself
copyFromPermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
}
if (copyFromPermanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(copyFromPermanent); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer)
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
Permanent newPermanentToken = game.getPermanent(token.getLastAddedToken());
if (newPermanentToken != null) {
game.copyPermanent(copyFromPermanent, newPermanentToken, source, null);
return true;
}
}
return false;
}
}

View file

@ -29,19 +29,15 @@ package mage.sets.dragonsmaze;
import mage.abilities.Ability;
import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.LoseLifeControllerAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -81,61 +77,3 @@ public class SinisterPossession extends CardImpl {
return new SinisterPossession(this);
}
}
class LoseLifeControllerAttachedEffect extends OneShotEffect {
protected DynamicValue amount;
public LoseLifeControllerAttachedEffect(int amount) {
this(new StaticValue(amount));
}
public LoseLifeControllerAttachedEffect(DynamicValue amount) {
super(Outcome.Damage);
this.amount = amount;
setText();
}
public LoseLifeControllerAttachedEffect(final LoseLifeControllerAttachedEffect effect) {
super(effect);
this.amount = effect.amount.copy();
}
@Override
public LoseLifeControllerAttachedEffect copy() {
return new LoseLifeControllerAttachedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment == null) {
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
}
if (enchantment != null && enchantment.getAttachedTo() != null) {
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature == null) {
creature = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
}
if (creature != null) {
Player player = game.getPlayer(creature.getControllerId());
if (player != null) {
player.loseLife(amount.calculate(game, source, this), game);
return true;
}
}
}
return false;
}
private void setText() {
StringBuilder sb = new StringBuilder();
sb.append("it's controller loses ").append(amount.toString()).append(" life");
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
sb.append(message);
}
staticText = sb.toString();
}
}

View file

@ -30,6 +30,7 @@ package mage.sets.dragonsoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -37,10 +38,9 @@ import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.util.CardUtil;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -91,9 +91,9 @@ class CloneLegionEffect extends OneShotEffect {
if (controller != null && targetPlayer != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) {
if (permanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(permanent);
token.putOntoBattlefield(1, game, source.getSourceId(), controller.getId());
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
effect.setTargetPointer(new FixedTarget(permanent, game));
effect.apply(game, source);
}
}
return true;

View file

@ -33,14 +33,21 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlaneswalker;
import mage.util.CardUtil;
import mage.util.GameLog;
/**
*
@ -59,17 +66,15 @@ public class DragonlordSilumgar extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Deathtouch
this.addAbility(DeathtouchAbility.getInstance());
// When Dragonlord Silumgar enters the battlefield, gain control of target creature or planeswalker for as long as you control Dragonlord Silumgar.
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), new SourceOnBattlefieldControlUnchangedCondition(), null);
effect.setText("gain control of target creature or planeswalker for as long as you control {this}");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
Ability ability = new EntersBattlefieldTriggeredAbility(new DragonlordSilumgarEffect(), false);
ability.addTarget(new TargetCreatureOrPlaneswalker());
this.addAbility(ability);
}
public DragonlordSilumgar(final DragonlordSilumgar card) {
@ -81,3 +86,36 @@ public class DragonlordSilumgar extends CardImpl {
return new DragonlordSilumgar(this);
}
}
class DragonlordSilumgarEffect extends OneShotEffect {
public DragonlordSilumgarEffect() {
super(Outcome.GainControl);
this.staticText = "gain control of target creature or planeswalker for as long as you control {this}";
}
public DragonlordSilumgarEffect(final DragonlordSilumgarEffect effect) {
super(effect);
}
@Override
public DragonlordSilumgarEffect copy() {
return new DragonlordSilumgarEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null && sourcePermanent != null && target != null
&& controller.getId().equals(sourcePermanent.getControllerId())) {
game.addEffect(new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), new SourceOnBattlefieldControlUnchangedCondition(), null), source);
if (!game.isSimulation()) {
game.informPlayers(sourcePermanent.getLogName() + ": " + controller.getLogName() + " gained control of " + target.getLogName());
}
sourcePermanent.addInfo("gained control of", CardUtil.addToolTipMarkTags("Gained control of: " + GameLog.getColoredObjectIdNameForTooltip(target)), game);
}
return false;
}
}

View file

@ -35,6 +35,7 @@ import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
@ -43,11 +44,9 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -105,16 +104,13 @@ class MirrorMockeryEffect extends OneShotEffect {
}
Permanent enchanted = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo());
if (enchanted != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(enchanted);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
effect.setTargetPointer(new FixedTarget(enchanted, game));
effect.apply(game, source);
for (Permanent addedToken : effect.getAddedPermanent()) {
if (addedToken != null) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
exileEffect.setTargetPointer(new FixedTarget(addedToken, game));
DelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());

View file

@ -34,10 +34,12 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
@ -71,12 +73,13 @@ public class AmbushCommander extends CardImpl {
this.toughness = new MageInt(2);
// Forests you control are 1/1 green Elf creatures that are still lands.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new AmbushCommanderToken(),
"lands", filter2, Duration.WhileOnBattlefield)));
ContinuousEffect effect = new BecomesCreatureAllEffect(new AmbushCommanderToken(), "lands", filter2, Duration.WhileOnBattlefield);
effect.getDependencyTypes().add(DependencyType.BecomeForest);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// {1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3,3, Duration.EndOfTurn),
new ManaCostsImpl("{1}{G}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, filter, true)));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn),
new ManaCostsImpl("{1}{G}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true)));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
@ -92,6 +95,7 @@ public class AmbushCommander extends CardImpl {
}
class AmbushCommanderToken extends Token {
public AmbushCommanderToken() {
super("Elf", "1/1 green Elf creatures");
subtype.add("Elf");

View file

@ -30,6 +30,7 @@ package mage.sets.eventide;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.keyword.RetraceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -45,7 +46,7 @@ import mage.util.CardUtil;
/**
*
* @author jeffwadsworth
*
*/
public class SpittingImage extends CardImpl {
@ -54,12 +55,12 @@ public class SpittingImage extends CardImpl {
this.expansionSetCode = "EVE";
// Put a token that's a copy of target creature onto the battlefield.
this.getSpellAbility().addEffect(new SpittingImageEffect());
this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// Retrace (You may cast this card from your graveyard by discarding a land card in addition to paying its other costs.)
this.addAbility(new RetraceAbility(this));
}
public SpittingImage(final SpittingImage card) {

View file

@ -28,16 +28,15 @@
package mage.sets.exodus;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -49,9 +48,9 @@ import mage.target.common.TargetCardInLibrary;
* @author jeffwadsworth
*/
public class SurvivalOfTheFittest extends CardImpl {
private static final FilterCard filter = new FilterCard("creature card");
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}
@ -60,7 +59,6 @@ public class SurvivalOfTheFittest extends CardImpl {
super(ownerId, 129, "Survival of the Fittest", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
this.expansionSetCode = "EXO";
// {G}, Discard a creature card: Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), new ColoredManaCost(ColoredManaSymbol.G));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter)));

View file

@ -62,7 +62,7 @@ public class Arcbond extends CardImpl {
this.expansionSetCode = "FRF";
// Choose target creature. Whenever that creature is dealt damage this turn, it deals that much damage to each other creature and each player.
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new ArcbondDelayedTriggeredAbility(), true));
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new ArcbondDelayedTriggeredAbility(), true, true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
@ -117,8 +117,8 @@ class ArcbondDelayedTriggeredAbility extends DelayedTriggeredAbility {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(targetObject.getSourceId()) &&
targetObject.getPermanentOrLKIBattlefield(game) != null) {
if (event.getTargetId().equals(targetObject.getSourceId())
&& targetObject.getPermanentOrLKIBattlefield(game) != null) {
for (Effect effect : this.getEffects()) {
effect.setValue("damage", event.getAmount());
}
@ -139,21 +139,21 @@ class ArcbondDelayedTriggeredAbility extends DelayedTriggeredAbility {
}
class ArcbondEffect extends OneShotEffect {
public ArcbondEffect() {
super(Outcome.Benefit);
this.staticText = "it deals that much damage to each other creature and each player";
}
public ArcbondEffect(final ArcbondEffect effect) {
super(effect);
}
@Override
public ArcbondEffect copy() {
return new ArcbondEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int damage = (Integer) this.getValue("damage");
@ -167,7 +167,7 @@ class ArcbondEffect extends OneShotEffect {
FilterPermanent filter = new FilterCreaturePermanent("each other creature");
filter.add(Predicates.not(new PermanentIdPredicate(sourceId)));
return new DamageEverythingEffect(new StaticValue(damage), filter, sourceId).apply(game, source);
}
}
return false;
}
}

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.keyword.DashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -46,11 +47,9 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -113,16 +112,13 @@ class FlamerushRiderEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(permanent);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true);
for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {
Effect effect = new ExileTargetEffect();
effect.setTargetPointer(new FixedTarget(tokenPermanent, game));
new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect), false).apply(game, source);
}
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true);
effect.setTargetPointer(new FixedTarget(permanent, game));
effect.apply(game, source);
for (Permanent addedToken : effect.getAddedPermanent()) {
Effect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(addedToken, game));
new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), false).apply(game, source);
}
return true;
}

View file

@ -28,15 +28,11 @@
package mage.sets.fatereforged;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BecomesAuraAttachToManifestSourceEffect;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;

View file

@ -28,18 +28,13 @@
package mage.sets.fatereforged;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
@ -54,7 +49,9 @@ public class SupplantForm extends CardImpl {
// Return target creature to its owner's hand. You put a token onto the battlefield that's a copy of that creature.
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SupplantFormEffect());
Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
effect.setText("You put a token onto the battlefield that's a copy of that creature");
this.getSpellAbility().addEffect(effect);
}
public SupplantForm(final SupplantForm card) {
@ -66,32 +63,3 @@ public class SupplantForm extends CardImpl {
return new SupplantForm(this);
}
}
class SupplantFormEffect extends OneShotEffect {
public SupplantFormEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "You put a token onto the battlefield that's a copy of that creature";
}
public SupplantFormEffect(final SupplantFormEffect effect) {
super(effect);
}
@Override
public SupplantFormEffect copy() {
return new SupplantFormEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (targetPermanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(targetPermanent);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
}
return false;
}
}

View file

@ -29,23 +29,16 @@ package mage.sets.fifthedition;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.common.BecomesTappedAttachedTriggeredAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -65,9 +58,9 @@ public class Blight extends CardImpl {
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// When enchanted land becomes tapped, destroy it.
this.addAbility(new BlightTriggeredAbility());
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DestroyAttachedEffect("it"), "enchanted land"));
}
public Blight(final Blight card) {
@ -79,43 +72,3 @@ public class Blight extends CardImpl {
return new Blight(this);
}
}
class BlightTriggeredAbility extends TriggeredAbilityImpl {
BlightTriggeredAbility() {
super(Zone.BATTLEFIELD, new DestroyTargetEffect());
}
BlightTriggeredAbility(final BlightTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.TAPPED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.sourceId);
if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) {
Permanent attached = game.getPermanent(enchantment.getAttachedTo());
if (attached != null) {
for (Effect e : getEffects()) {
e.setTargetPointer(new FixedTarget(attached.getId()));
}
return true;
}
}
return false;
}
@Override
public BlightTriggeredAbility copy() {
return new BlightTriggeredAbility(this);
}
@Override
public String getRule() {
return "When enchanted land becomes tapped, destroy it.";
}
}

View file

@ -0,0 +1,66 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.keyword.BloodthirstAbility;
import mage.abilities.keyword.FlankingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class BogardanLancer extends CardImpl {
public BogardanLancer(UUID ownerId) {
super(ownerId, 95, "Bogardan Lancer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.expansionSetCode = "FUT";
this.subtype.add("Human");
this.subtype.add("Knight");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Bloodthirst 1
this.addAbility(new BloodthirstAbility(1));
// Flanking
this.addAbility(new FlankingAbility());
}
public BogardanLancer(final BogardanLancer card) {
super(card);
}
@Override
public BogardanLancer copy() {
return new BogardanLancer(this);
}
}

View file

@ -0,0 +1,69 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LoneFox
*/
public class CharRumbler extends CardImpl {
public CharRumbler(UUID ownerId) {
super(ownerId, 96, "Char-Rumbler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.expansionSetCode = "FUT";
this.subtype.add("Elemental");
this.power = new MageInt(-1);
this.toughness = new MageInt(3);
// Double strike
this.addAbility(DoubleStrikeAbility.getInstance());
// {R}: Char-Rumbler gets +1/+0 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")));
}
public CharRumbler(final CharRumbler card) {
super(card);
}
@Override
public CharRumbler copy() {
return new CharRumbler(this);
}
}

View file

@ -0,0 +1,94 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CanBlockOnlyFlyingAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
/**
*
* @author LoneFox
*/
public class Cloudseeder extends CardImpl {
public Cloudseeder(UUID ownerId) {
super(ownerId, 33, "Cloudseeder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.expansionSetCode = "FUT";
this.subtype.add("Faerie");
this.subtype.add("Spellshaper");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// {U}, {tap}, Discard a card: Put a 1/1 blue Faerie creature token named Cloud Sprite onto the battlefield. It has flying and "Cloud Sprite can block only creatures with flying."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new CloudSpriteToken()), new ManaCostsImpl("{U}"));
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());
this.addAbility(ability);
}
public Cloudseeder(final Cloudseeder card) {
super(card);
}
@Override
public Cloudseeder copy() {
return new Cloudseeder(this);
}
}
class CloudSpriteToken extends Token {
public CloudSpriteToken() {
super("Cloud Sprite", "1/1 blue faerie creature token named Cloud Sprite with flying and \"Cloud Sprite can block only creatures with flying.\"");
this.setOriginalExpansionSetCode("FUT");
cardType.add(CardType.CREATURE);
color.setBlue(true);
subtype.add("Faerie");
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new CanBlockOnlyFlyingAbility());
}
}

View file

@ -0,0 +1,73 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class CrypticAnnelid extends CardImpl {
public CrypticAnnelid(UUID ownerId) {
super(ownerId, 34, "Cryptic Annelid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "FUT";
this.subtype.add("Worm");
this.subtype.add("Beast");
this.power = new MageInt(1);
this.toughness = new MageInt(4);
// When Cryptic Annelid enters the battlefield, scry 1, then scry 2, then scry 3.
Ability ability = new EntersBattlefieldTriggeredAbility(new ScryEffect(1));
Effect effect = new ScryEffect(2);
effect.setText(", then scry 2");
ability.addEffect(effect);
effect = new ScryEffect(3);
effect.setText(", then scry 3");
ability.addEffect(effect);
this.addAbility(ability);
}
public CrypticAnnelid(final CrypticAnnelid card) {
super(card);
}
@Override
public CrypticAnnelid copy() {
return new CrypticAnnelid(this);
}
}

View file

@ -0,0 +1,70 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.FlankingAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class KnightOfSursi extends CardImpl {
public KnightOfSursi(UUID ownerId) {
super(ownerId, 10, "Knight of Sursi", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.expansionSetCode = "FUT";
this.subtype.add("Human");
this.subtype.add("Knight");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// flanking
this.addAbility(new FlankingAbility());
// Suspend 3-{W}
this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{W}"), this));
}
public KnightOfSursi(final KnightOfSursi card) {
super(card);
}
@Override
public KnightOfSursi copy() {
return new KnightOfSursi(this);
}
}

View file

@ -0,0 +1,90 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.mana.GreenManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
/**
*
* @author LoneFox
*/
public class LlanowarMentor extends CardImpl {
public LlanowarMentor(UUID ownerId) {
super(ownerId, 131, "Llanowar Mentor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}");
this.expansionSetCode = "FUT";
this.subtype.add("Elf");
this.subtype.add("Spellshaper");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {G}, {tap}, Discard a card: Put a 1/1 green Elf Druid creature token named Llanowar Elves onto the battlefield. It has "{tap}: Add {G} to your mana pool."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LlanowarElvesToken()), new ManaCostsImpl("{G}"));
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());
this.addAbility(ability);
}
public LlanowarMentor(final LlanowarMentor card) {
super(card);
}
@Override
public LlanowarMentor copy() {
return new LlanowarMentor(this);
}
}
class LlanowarElvesToken extends Token {
public LlanowarElvesToken() {
super("Llanowar Elves", "1/1 green Elf Druid creature token named Llanowar Elves with \"{T}: Add {G} to your mana pool.\"");
this.setOriginalExpansionSetCode("FUT");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add("Elf");
subtype.add("Druid");
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(new GreenManaAbility());
}
}

View file

@ -35,6 +35,7 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
@ -86,6 +87,7 @@ public class MagusOfTheMoon extends CardImpl {
MagusOfTheMoonEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
this.staticText = "Nonbasic lands are Mountains";
dependencyTypes.add(DependencyType.BecomeMountain);
}
MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) {

View file

@ -0,0 +1,78 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BecomesTappedAttachedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.effects.common.LoseLifeControllerAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
/**
*
* @author LoneFox
*/
public class PoolingVenom extends CardImpl {
public PoolingVenom(UUID ownerId) {
super(ownerId, 74, "Pooling Venom", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.expansionSetCode = "FUT";
this.subtype.add("Aura");
// Enchant land
TargetPermanent auraTarget = new TargetLandPermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Whenever enchanted land becomes tapped, its controller loses 2 life.
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new LoseLifeControllerAttachedEffect(2), "enchanted land"));
// {3}{B}: Destroy enchanted land.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAttachedEffect("enchanted land"), new ManaCostsImpl("{3}{B}")));
}
public PoolingVenom(final PoolingVenom card) {
super(card);
}
@Override
public PoolingVenom copy() {
return new PoolingVenom(this);
}
}

View file

@ -0,0 +1,96 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class SkirkRidgeExhumer extends CardImpl {
public SkirkRidgeExhumer(UUID ownerId) {
super(ownerId, 77, "Skirk Ridge Exhumer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.expansionSetCode = "FUT";
this.subtype.add("Zombie");
this.subtype.add("Spellshaper");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {B}, {tap}, Discard a card: Put a 1/1 black Zombie Goblin creature token named Festering Goblin onto the battlefield. It has "When Festering Goblin dies, target creature gets -1/-1 until end of turn."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new FesteringGoblinToken()), new ManaCostsImpl("{B}"));
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());
this.addAbility(ability);
}
public SkirkRidgeExhumer(final SkirkRidgeExhumer card) {
super(card);
}
@Override
public SkirkRidgeExhumer copy() {
return new SkirkRidgeExhumer(this);
}
}
class FesteringGoblinToken extends Token {
public FesteringGoblinToken() {
super("Festering Goblin", "1/1 black Zombie Goblin creature token named Festering Goblin with \"When Festering Goblin dies, target creature gets -1/-1 until end of turn.\"");
this.setOriginalExpansionSetCode("FUT");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add("Zombie");
subtype.add("Goblin");
power = new MageInt(1);
toughness = new MageInt(1);
Ability ability = new DiesTriggeredAbility(new BoostTargetEffect(-1, -1, Duration.EndOfTurn), false);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
}

View file

@ -0,0 +1,95 @@
/*
* 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.sets.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
/**
*
* @author LoneFox
*/
public class Sparkspitter extends CardImpl {
public Sparkspitter(UUID ownerId) {
super(ownerId, 109, "Sparkspitter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.expansionSetCode = "FUT";
this.subtype.add("Elemental");
this.subtype.add("Spellshaper");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// {R}, {tap}, Discard a card: Put a 3/1 red Elemental creature token named Spark Elemental onto the battlefield. It has trample, haste, and "At the beginning of the end step, sacrifice Spark Elemental."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SparkElementalToken()), new ManaCostsImpl("{R}"));
ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost());
this.addAbility(ability);
}
public Sparkspitter(final Sparkspitter card) {
super(card);
}
@Override
public Sparkspitter copy() {
return new Sparkspitter(this);
}
}
class SparkElementalToken extends Token {
public SparkElementalToken() {
super("Spark Elemental", "3/1 red Elemental creature token named Spark Elemental with trample, haste, and \"At the beginning of the end step, sacrifice Spark Elemental.\"");
this.setOriginalExpansionSetCode("FUT");
cardType.add(CardType.CREATURE);
color.setRed(true);
subtype.add("Elemental");
power = new MageInt(3);
toughness = new MageInt(1);
this.addAbility(TrampleAbility.getInstance());
this.addAbility(HasteAbility.getInstance());
this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect(), TargetController.ANY, false));
}
}

View file

@ -28,22 +28,13 @@
package mage.sets.gatecrash;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.util.CardUtil;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
@ -63,7 +54,7 @@ public class GiantAdephage extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Whenever Giant Adephage deals combat damage to a player, put a token onto the battlefield that is a copy of Giant Adephage.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new GiantAdephageCopyEffect(), false));
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PutTokenOntoBattlefieldCopySourceEffect(), false));
}
@ -76,40 +67,3 @@ public class GiantAdephage extends CardImpl {
return new GiantAdephage(this);
}
}
class GiantAdephageCopyEffect extends OneShotEffect {
public GiantAdephageCopyEffect() {
super(Outcome.Copy);
this.staticText = "put a token onto the battlefield that is a copy of Giant Adephage";
}
public GiantAdephageCopyEffect(final GiantAdephageCopyEffect effect) {
super(effect);
}
@Override
public GiantAdephageCopyEffect copy() {
return new GiantAdephageCopyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
MageObject thisCard = game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
if (thisCard != null && thisCard instanceof Permanent) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from((Permanent)thisCard);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
} else { // maybe it's token
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
if (permanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(permanent);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
}
}
return false;
}
}

View file

@ -1,30 +1,30 @@
/*
* 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.
*/
* 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.sets.gatecrash;
import java.util.UUID;
@ -48,21 +48,21 @@ import mage.game.stack.StackAbility;
import mage.players.Player;
/**
*
* @author LevelX2
*/
*
* @author LevelX2
*/
public class IllusionistsBracers extends CardImpl {
public IllusionistsBracers(UUID ownerId) {
super(ownerId, 231, "Illusionist's Bracers", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "GTC";
this.subtype.add("Equipment");
super(ownerId, 231, "Illusionist's Bracers", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "GTC";
this.subtype.add("Equipment");
// Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy.
this.addAbility(new AbilityActivatedTriggeredAbility());
// Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy.
this.addAbility(new AbilityActivatedTriggeredAbility());
// Equip 3
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(3)));
// Equip 3
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(3)));
}
public IllusionistsBracers(final IllusionistsBracers card) {
@ -76,6 +76,7 @@ public class IllusionistsBracers extends CardImpl {
}
class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl {
AbilityActivatedTriggeredAbility() {
super(Zone.BATTLEFIELD, new CopyActivatedAbilityEffect());
}
@ -110,7 +111,7 @@ class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy.";
return "Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy.";
}
}
@ -142,7 +143,7 @@ class CopyActivatedAbilityEffect extends OneShotEffect {
if (newAbility.getTargets().size() > 0) {
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) {
newAbility.getTargets().clearChosen();
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) {
return false;
}
}

View file

@ -28,23 +28,15 @@
package mage.sets.gatecrash;
import java.util.UUID;
import mage.abilities.effects.common.CipherEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CipherEffect;
import mage.cards.CardImpl;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.target.TargetPermanent;
import mage.util.CardUtil;
/**
*
@ -53,17 +45,17 @@ import mage.util.CardUtil;
public class StolenIdentity extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("artifact or creature");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE)));
}
public StolenIdentity(UUID ownerId) {
super(ownerId, 53, "Stolen Identity", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{U}{U}");
this.expansionSetCode = "GTC";
// Put a token onto the battlefield that's a copy of target artifact or creature.
this.getSpellAbility().addEffect(new StolenIdentityEffect());
this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
// Cipher
this.getSpellAbility().addEffect(new CipherEffect());
@ -78,42 +70,3 @@ public class StolenIdentity extends CardImpl {
return new StolenIdentity(this);
}
}
class StolenIdentityEffect extends OneShotEffect {
public StolenIdentityEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Put a token onto the battlefield that's a copy of target artifact or creature";
}
public StolenIdentityEffect(final StolenIdentityEffect effect) {
super(effect);
}
@Override
public StolenIdentityEffect copy() {
return new StolenIdentityEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
}
if (permanent != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(permanent);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
}
return false;
}
}

View file

@ -28,10 +28,6 @@
package mage.sets.guildpact;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -40,6 +36,9 @@ import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.permanent.token.Token;
@ -52,7 +51,11 @@ public class GruulWarPlow extends CardImpl {
public GruulWarPlow(UUID ownerId) {
super(ownerId, 151, "Gruul War Plow", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "GPT";
// Creatures you control have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent())));
// {1}{R}{G}: Gruul War Plow becomes a 4/4 Juggernaut artifact creature until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new GruulWarPlowToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{G}")));
}
@ -67,6 +70,7 @@ public class GruulWarPlow extends CardImpl {
}
class GruulWarPlowToken extends Token {
GruulWarPlowToken() {
super("Juggernaut", "4/4 Juggernaut artifact creature");
cardType.add(CardType.CREATURE);
@ -75,4 +79,4 @@ class GruulWarPlowToken extends Token {
power = new MageInt(4);
toughness = new MageInt(4);
}
}
}

View file

@ -63,7 +63,7 @@ public class Seizures extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Whenever enchanted creature becomes tapped, Seizures deals 3 damage to that creature's controller unless that player pays {3}.
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new SeizuresEffect(), false));
this.addAbility(new BecomesTappedAttachedTriggeredAbility(new SeizuresEffect(), "enchanted creature"));
}
public Seizures(final Seizures card) {

View file

@ -28,24 +28,23 @@
package mage.sets.innistrad;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.CostImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.CostImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.players.Player;
import mage.game.permanent.token.EmptyToken;
import mage.target.Target;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -57,9 +56,10 @@ public class BackFromTheBrink extends CardImpl {
super(ownerId, 44, "Back from the Brink", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}{U}");
this.expansionSetCode = "ISD";
// Exile a creature card from your graveyard and pay its mana cost: Put a token onto the battlefield that's a copy of that card. Activate this ability only any time you could cast a sorcery.
this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new BackFromTheBrinkEffect(), new BackFromTheBrinkCost()));
Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
effect.setText("Put a token onto the battlefield that's a copy of that card");
this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, effect, new BackFromTheBrinkCost()));
}
@ -73,40 +73,12 @@ public class BackFromTheBrink extends CardImpl {
}
}
class BackFromTheBrinkEffect extends OneShotEffect {
public BackFromTheBrinkEffect () {
super(Outcome.PutCreatureInPlay);
staticText = "Put a token onto the battlefield that's a copy of that card. Activate this ability only any time you could cast a sorcery";
}
public BackFromTheBrinkEffect(final BackFromTheBrinkEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(this.targetPointer.getFirst(game, source));
if (card != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(card);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
}
return false;
}
@Override
public BackFromTheBrinkEffect copy() {
return new BackFromTheBrinkEffect(this);
}
}
class BackFromTheBrinkCost extends CostImpl {
public BackFromTheBrinkCost() {
this.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
Target target = new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"));
target.setNotTarget(true);
this.addTarget(target);
this.text = "Exile a creature card from your graveyard and pay its mana cost";
}
@ -127,10 +99,10 @@ class BackFromTheBrinkCost extends CostImpl {
@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
if (targets.choose(Outcome.Exile, controllerId, sourceId, game)) {
Player player = game.getPlayer(controllerId);
if (player != null) {
Card card = player.getGraveyard().get(targets.getFirstTarget(), game);
if (card != null && card.moveToZone(Zone.EXILED, sourceId, game, false)) {
Player controller = game.getPlayer(controllerId);
if (controller != null) {
Card card = controller.getGraveyard().get(targets.getFirstTarget(), game);
if (card != null && controller.moveCards(card, null, Zone.EXILED, ability, game)) {
ability.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId()));
paid = card.getManaCost().pay(ability, game, sourceId, controllerId, noMana);
}
@ -139,4 +111,4 @@ class BackFromTheBrinkCost extends CostImpl {
return paid;
}
}
}

View file

@ -34,7 +34,7 @@ import mage.abilities.abilityword.StriveAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -42,11 +42,9 @@ import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
@ -58,13 +56,12 @@ public class Twinflame extends CardImpl {
super(ownerId, 115, "Twinflame", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}");
this.expansionSetCode = "JOU";
// Strive - Twinflame costs 2R more to cast for each target beyond the first.
this.addAbility(new StriveAbility("{2}{R}"));
// Choose any number of target creatures you control. For each of them, put a token that's a copy of that creature onto the battlefield. Those tokens have haste. Exile them at the beginning of the next end step.
this.getSpellAbility().addEffect(new TwinflameCopyEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, new FilterControlledCreaturePermanent(), false));
}
public Twinflame(final Twinflame card) {
@ -78,44 +75,43 @@ public class Twinflame extends CardImpl {
}
class TwinflameCopyEffect extends OneShotEffect {
public TwinflameCopyEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Choose any number of target creatures you control. For each of them, put a token that's a copy of that creature onto the battlefield. Those tokens have haste. Exile them at the beginning of the next end step";
}
public TwinflameCopyEffect(final TwinflameCopyEffect effect) {
super(effect);
}
@Override
public TwinflameCopyEffect copy() {
return new TwinflameCopyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for(UUID creatureId: this.getTargetPointer().getTargets(game, source)) {
for (UUID creatureId : this.getTargetPointer().getTargets(game, source)) {
Permanent creature = game.getPermanentOrLKIBattlefield(creatureId);
if (creature != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(creature);
token.addAbility(HasteAbility.getInstance());
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true);
effect.setTargetPointer(new FixedTarget(creature, game));
effect.apply(game, source);
for (Permanent addedToken : effect.getAddedPermanent()) {
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(addedToken, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}
}
return true;
return true;
}
return false;
}

View file

@ -81,7 +81,7 @@ public class AnafenzaTheForemost extends CardImpl {
this.addAbility(ability);
// If a creature card would be put into an opponent's graveyard from anywhere, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnafenzaTheForemostEffect()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnafenzaTheForemostEffect()));
}
public AnafenzaTheForemost(final AnafenzaTheForemost card) {
@ -119,16 +119,15 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl {
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (((ZoneChangeEvent)event).getFromZone().equals(Zone.BATTLEFIELD)) {
Permanent permanent = ((ZoneChangeEvent)event).getTarget();
if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) {
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
if (permanent != null) {
return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
}
else {
} else {
Card card = game.getCard(event.getTargetId());
if (card != null) {
return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent)event).getFromZone(), true);
return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent) event).getFromZone(), true);
}
}
}
@ -142,11 +141,17 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() == Zone.GRAVEYARD) {
Card card = game.getCard(event.getTargetId());
if (card != null && card.getCardType().contains(CardType.CREATURE) &&
game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) {
return true;
if (card != null && game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { // Anafenza only cares about cards
if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield
if (zEvent.getTarget().getCardType().contains(CardType.CREATURE)) {
return true;
}
} else if (card.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
}
return false;

View file

@ -0,0 +1,84 @@
/*
* 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.sets.legions;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CycleTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.TargetPlayer;
/**
*
* @author fireshoes
*/
public class GempalmPolluter extends CardImpl {
static final private FilterPermanent filter = new FilterPermanent("Zombie");
static {
filter.add(new SubtypePredicate("Zombie"));
}
public GempalmPolluter(UUID ownerId) {
super(ownerId, 70, "Gempalm Avenger", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{B}");
this.expansionSetCode = "LGN";
this.subtype.add("Zombie");
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// Cycling {B}{B}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{B}{B}")));
// When you cycle Gempalm Polluter, you may have target player lose life equal to the number of Zombies on the battlefield.
Effect effect = new LoseLifeTargetEffect(new PermanentsOnBattlefieldCount(filter));
effect.setText("you may have target player lose life equal to the number of Zombies on the battlefield");
Ability ability = new CycleTriggeredAbility(effect, true);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public GempalmPolluter(final GempalmPolluter card) {
super(card);
}
@Override
public GempalmPolluter copy() {
return new GempalmPolluter(this);
}
}

View file

@ -41,6 +41,7 @@ import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Layer;
import static mage.constants.Layer.AbilityAddingRemovingEffects_6;
@ -53,7 +54,6 @@ import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.sets.futuresight.MagusOfTheMoon;
/**
*
@ -133,7 +133,7 @@ public class Conversion extends CardImpl {
Set<UUID> dependentTo = null;
for (ContinuousEffect effect : allEffectsInLayer) {
// http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/286046-conversion-magus-of-the-moon
if (MagusOfTheMoon.class.equals(effect.getClass().getEnclosingClass())) {
if (effect.getDependencyTypes().contains(DependencyType.BecomeMountain)) {
if (dependentTo == null) {
dependentTo = new HashSet<>();
}

View file

@ -29,24 +29,22 @@ package mage.sets.limitedalpha;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.permanent.token.Token;
/**
*
* @author KholdFuzion
*
*/
public class KormusBell extends CardImpl {
@ -55,7 +53,9 @@ public class KormusBell extends CardImpl {
this.expansionSetCode = "LEA";
// All Swamps are 1/1 black creatures that are still lands.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new KormusBellToken(), "lands", new FilterPermanent("Swamp", "Swamps"), Duration.WhileOnBattlefield)));
ContinuousEffect effect = new BecomesCreatureAllEffect(new KormusBellToken(), "lands", new FilterPermanent("Swamp", "Swamps"), Duration.WhileOnBattlefield);
effect.getDependencyTypes().add(DependencyType.BecomeSwamp);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
public KormusBell(final KormusBell card) {
@ -69,6 +69,7 @@ public class KormusBell extends CardImpl {
}
class KormusBellToken extends Token {
public KormusBellToken() {
super("", "1/1 creature");
cardType.add(CardType.CREATURE);
@ -77,4 +78,4 @@ class KormusBellToken extends Token {
color.setBlack(true); //Check Oracle, yes they are black
}
}
}

View file

@ -30,9 +30,11 @@ package mage.sets.limitedalpha;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
@ -51,14 +53,15 @@ public class LivingLands extends CardImpl {
static {
filter.add(new SubtypePredicate("Forest"));
}
public LivingLands(UUID ownerId) {
super(ownerId, 118, "Living Lands", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
this.expansionSetCode = "LEA";
// All Forests are 1/1 creatures that are still lands.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new LivingLandsToken(), "lands", filter, Duration.WhileOnBattlefield)));
ContinuousEffect effect = new BecomesCreatureAllEffect(new LivingLandsToken(), "lands", filter, Duration.WhileOnBattlefield);
effect.getDependencyTypes().add(DependencyType.BecomeForest);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
public LivingLands(final LivingLands card) {

View file

@ -30,22 +30,17 @@ package mage.sets.limitedalpha;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BecomesTappedAttachedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DamageAttachedControllerEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -67,7 +62,9 @@ public class PsychicVenom extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Whenever enchanted land becomes tapped, Psychic Venom deals 2 damage to that land's controller.
this.addAbility(new PsychicVenomAbility());
Effect effect = new DamageAttachedControllerEffect(2);
effect.setText("{this} deals 2 damage to that land's controller");
this.addAbility(new BecomesTappedAttachedTriggeredAbility(effect, "enchanted land"));
}
public PsychicVenom(final PsychicVenom card) {
@ -79,43 +76,3 @@ public class PsychicVenom extends CardImpl {
return new PsychicVenom(this);
}
}
class PsychicVenomAbility extends TriggeredAbilityImpl {
PsychicVenomAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(2, true, "that land's controller"));
}
PsychicVenomAbility(final PsychicVenomAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.TAPPED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent source = game.getPermanent(this.sourceId);
if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
Permanent attached = game.getPermanent(source.getAttachedTo());
if (attached != null) {
for (Effect e : getEffects()) {
e.setTargetPointer(new FixedTarget(attached.getControllerId()));
}
return true;
}
}
return false;
}
@Override
public PsychicVenomAbility copy() {
return new PsychicVenomAbility(this);
}
@Override
public String getRule() {
return "Whenever enchanted land becomes tapped, " + super.getRule();
}
}

View file

@ -57,7 +57,7 @@ public class RingsOfBrighthearth extends CardImpl {
this.expansionSetCode = "LRW";
// Whenever you activate an ability, if it isn't a mana ability, you may pay {2}. If you do, copy that ability. You may choose new targets for the copy.
this.addAbility(new RingsOfBrighthearthTriggeredAbility());
this.addAbility(new RingsOfBrighthearthTriggeredAbility());
}
public RingsOfBrighthearth(final RingsOfBrighthearth card) {
@ -71,15 +71,15 @@ public class RingsOfBrighthearth extends CardImpl {
}
class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl {
RingsOfBrighthearthTriggeredAbility() {
super(Zone.BATTLEFIELD, new RingsOfBrighthearthEffect(), false);
}
RingsOfBrighthearthTriggeredAbility(final RingsOfBrighthearthTriggeredAbility ability) {
super(ability);
}
@Override
public RingsOfBrighthearthTriggeredAbility copy() {
return new RingsOfBrighthearthTriggeredAbility(this);
@ -89,7 +89,7 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.ACTIVATED_ABILITY;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getPlayerId().equals(getControllerId())) {
@ -102,7 +102,7 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl {
}
return false;
}
@Override
public String getRule() {
return "Whenever you activate an ability, if it isn't a mana ability, you may pay {2}. If you do, copy that ability. You may choose new targets for the copy.";
@ -110,21 +110,21 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl {
}
class RingsOfBrighthearthEffect extends OneShotEffect {
RingsOfBrighthearthEffect() {
super(Outcome.Benefit);
this.staticText = ", you may pay {2}. If you do, copy that ability. You may choose new targets for the copy.";
}
RingsOfBrighthearthEffect(final RingsOfBrighthearthEffect effect) {
super(effect);
}
@Override
public RingsOfBrighthearthEffect copy() {
return new RingsOfBrighthearthEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
@ -142,7 +142,7 @@ class RingsOfBrighthearthEffect extends OneShotEffect {
if (newAbility.getTargets().size() > 0) {
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) {
newAbility.getTargets().clearChosen();
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) {
return false;
}
}

View file

@ -28,16 +28,27 @@
package mage.sets.magic2013;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetCard;
/**
*
@ -46,6 +57,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
public class AugurOfBolas extends CardImpl {
private static final FilterCard filter = new FilterCard("an instant or sorcery card");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
}
@ -60,7 +72,7 @@ public class AugurOfBolas extends CardImpl {
this.toughness = new MageInt(3);
// When Augur of Bolas enters the battlefield, look at the top three cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), filter, false, true)));
this.addAbility(new EntersBattlefieldTriggeredAbility(new AugurOfBolasEffect()));
}
public AugurOfBolas(final AugurOfBolas card) {
@ -72,3 +84,54 @@ public class AugurOfBolas extends CardImpl {
return new AugurOfBolas(this);
}
}
class AugurOfBolasEffect extends OneShotEffect {
public AugurOfBolasEffect() {
super(Outcome.DrawCard);
this.staticText = "look at the top three cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in any order";
}
public AugurOfBolasEffect(final AugurOfBolasEffect effect) {
super(effect);
}
@Override
public AugurOfBolasEffect copy() {
return new AugurOfBolasEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
Cards topCards = new CardsImpl();
topCards.addAll(controller.getLibrary().getTopCards(game, 3));
if (!topCards.isEmpty()) {
controller.lookAtCards(sourceObject.getIdName(), topCards, game);
int number = topCards.count(new FilterInstantOrSorceryCard(), source.getSourceId(), source.getControllerId(), game);
if (number > 0) {
if (controller.chooseUse(outcome, "Reveal an instant or sorcery card from the looked at cards and put it into your hand?", source, game)) {
Card card = null;
if (number == 1) {
card = topCards.getCards(new FilterInstantOrSorceryCard(), source.getSourceId(), source.getControllerId(), game).iterator().next();
} else {
Target target = new TargetCard(Zone.LIBRARY, new FilterInstantOrSorceryCard());
controller.chooseTarget(outcome, target, source, game);
card = topCards.get(target.getFirstTarget(), game);
}
if (card != null) {
controller.moveCards(card, null, Zone.HAND, source, game);
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
topCards.remove(card);
}
}
controller.putCardsOnBottomOfLibrary(topCards, game, source, true);
}
}
return true;
}
return false;
}
}

View file

@ -50,9 +50,9 @@ import mage.target.TargetPermanent;
* @author jeffwadsworth
*/
public class Encrust extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("artifact or creature");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.CREATURE),
@ -71,9 +71,9 @@ public class Encrust extends CardImpl {
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted permanent doesn't untap during its controller's untap step and its activated abilities can't be activated.
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect());
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect("permanent"));
Effect effect = new CantActivateAbilitiesAttachedEffect();
effect.setText("and its activated abilities can't be activated");
ability.addEffect(effect);

View file

@ -57,8 +57,6 @@ import mage.target.TargetObject;
*/
public class StrionicResonator extends CardImpl {
public StrionicResonator(UUID ownerId) {
super(ownerId, 224, "Strionic Resonator", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "M14";
@ -92,8 +90,8 @@ class StrionicResonatorEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
StackAbility stackAbility = (StackAbility)game.getStack().getStackObject(targetPointer.getFirst(game, source));
if(stackAbility != null){
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(targetPointer.getFirst(game, source));
if (stackAbility != null) {
Ability ability = (Ability) stackAbility.getStackAbility();
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
@ -104,7 +102,7 @@ class StrionicResonatorEffect extends OneShotEffect {
if (newAbility.getTargets().size() > 0) {
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) {
newAbility.getTargets().clearChosen();
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) {
return false;
}
}
@ -114,7 +112,7 @@ class StrionicResonatorEffect extends OneShotEffect {
}
}
return false;
}
@Override
@ -122,7 +120,7 @@ class StrionicResonatorEffect extends OneShotEffect {
return new StrionicResonatorEffect(this);
}
@Override
@Override
public String getText(Mode mode) {
StringBuilder sb = new StringBuilder();
sb.append("Copy target ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy");
@ -143,7 +141,6 @@ class TargetTriggeredAbility extends TargetObject {
super(target);
}
@Override
public boolean canTarget(UUID id, Ability source, Game game) {
if (source != null && source.getSourceId().equals(id)) {
@ -164,11 +161,11 @@ class TargetTriggeredAbility extends TargetObject {
@Override
public boolean canChoose(UUID sourceControllerId, Game game) {
for (StackObject stackObject : game.getStack()) {
for (StackObject stackObject : game.getStack()) {
if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
return true;
}
return true;
}
}
return false;
}
@ -180,7 +177,7 @@ class TargetTriggeredAbility extends TargetObject {
@Override
public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
Set<UUID> possibleTargets = new HashSet<UUID>();
for (StackObject stackObject : game.getStack()) {
for (StackObject stackObject : game.getStack()) {
if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
possibleTargets.add(stackObject.getStackAbility().getId());
}

View file

@ -152,7 +152,7 @@ class KurkeshOnakkeAncientEffect extends OneShotEffect {
if (newAbility.getTargets().size() > 0) {
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) {
newAbility.getTargets().clearChosen();
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) {
return false;
}
}

View file

@ -27,16 +27,21 @@
*/
package mage.sets.magicorigins;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
@ -70,6 +75,7 @@ public class StarfieldOfNyx extends CardImpl {
static {
filterEnchantmentYouControl.add(new ControllerPredicate(TargetController.YOU));
}
static {
filterGraveyardEnchantment.add(new CardTypePredicate(CardType.ENCHANTMENT));
filterGraveyardEnchantment.add(new OwnerPredicate(TargetController.YOU));
@ -86,7 +92,8 @@ public class StarfieldOfNyx extends CardImpl {
this.addAbility(ability);
// As long as you control five or more enchantments, each other non-Aura enchantment you control is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost.
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new StarfieldOfNyxEffect(), new PermanentsOnTheBattlefieldCondition(filterEnchantmentYouControl, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 4), rule1);
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(
new StarfieldOfNyxEffect(), new PermanentsOnTheBattlefieldCondition(filterEnchantmentYouControl, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 4), rule1);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
@ -103,6 +110,7 @@ public class StarfieldOfNyx extends CardImpl {
class StarfieldOfNyxEffect extends ContinuousEffectImpl {
private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Each other non-Aura enchantment you control");
static {
filter.add(Predicates.not(new SubtypePredicate("Aura")));
filter.add(new AnotherPredicate());
@ -152,10 +160,23 @@ class StarfieldOfNyxEffect extends ContinuousEffectImpl {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4;
}
@Override
public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) {
Set<UUID> dependentTo = null;
for (ContinuousEffect effect : allEffectsInLayer) {
// http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=17664&start=30#p185513
if (effect.getDependencyTypes().contains(DependencyType.AuraAddingRemoving)) {
if (dependentTo == null) {
dependentTo = new HashSet<>();
}
dependentTo.add(effect.getId());
}
}
return dependentTo;
}
}

View file

@ -34,9 +34,11 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.DependencyType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
@ -67,8 +69,10 @@ public class TheloniteDruid extends CardImpl {
this.toughness = new MageInt(1);
// {1}{G}, {tap}, Sacrifice a creature: Forests you control become 2/3 creatures until end of turn. They're still lands.
ContinuousEffect effect = new BecomesCreatureAllEffect(new TheloniteDruidLandToken(), "Forests", filter, Duration.EndOfTurn);
effect.getDependencyTypes().add(DependencyType.BecomeForest);
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BecomesCreatureAllEffect(new TheloniteDruidLandToken(), "Forests", filter, Duration.EndOfTurn),
effect,
new ManaCostsImpl("{1}{G}"));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
@ -86,10 +90,11 @@ public class TheloniteDruid extends CardImpl {
}
class TheloniteDruidLandToken extends Token {
public TheloniteDruidLandToken() {
super("", "2/3 creatures");
cardType.add(CardType.CREATURE);
power = new MageInt(2);
toughness = new MageInt(3);
}
}
}

View file

@ -0,0 +1,58 @@
/*
* 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.sets.masterseditioniv;
import java.util.UUID;
import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class LastChance extends CardImpl {
public LastChance(UUID ownerId) {
super(ownerId, 125, "Last Chance", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}{R}");
this.expansionSetCode = "ME4";
// Take an extra turn after this one. At the beginning of that turn's end step, you lose the game.
this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect(true));
}
public LastChance(final LastChance card) {
super(card);
}
@Override
public LastChance copy() {
return new LastChance(this);
}
}

View file

@ -0,0 +1,84 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class ChaosCharm extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Wall");
static {
filter.add(new SubtypePredicate("Wall"));
}
public ChaosCharm(UUID ownerId) {
super(ownerId, 163, "Chaos Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "MIR";
// Choose one - Destroy target Wall
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
// or Chaos Charm deals 1 damage to target creature
Mode mode = new Mode();
mode.getEffects().add(new DamageTargetEffect(1));
mode.getTargets().add(new TargetCreaturePermanent());
this.getSpellAbility().addMode(mode);
// or target creature gains haste until end of turn.
mode = new Mode();
mode.getEffects().add(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
mode.getTargets().add(new TargetCreaturePermanent());
this.getSpellAbility().addMode(mode);
}
public ChaosCharm(final ChaosCharm card) {
super(card);
}
@Override
public ChaosCharm copy() {
return new ChaosCharm(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.PreventDamageToTargetEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class IvoryCharm extends CardImpl {
public IvoryCharm(UUID ownerId) {
super(ownerId, 227, "Ivory Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "MIR";
// Choose one - All creatures get -2/-0 until end of turn
this.getSpellAbility().addEffect(new BoostAllEffect(-2, 0, Duration.EndOfTurn));
// or tap target creature
Mode mode = new Mode();
mode.getEffects().add(new TapTargetEffect());
mode.getTargets().add(new TargetCreaturePermanent());
this.getSpellAbility().addMode(mode);
// or prevent the next 1 damage that would be dealt to target creature or player this turn.
mode = new Mode();
mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn, 1));
mode.getTargets().add(new TargetCreatureOrPlayer());
this.getSpellAbility().addMode(mode);
}
public IvoryCharm(final IvoryCharm card) {
super(card);
}
@Override
public IvoryCharm copy() {
return new IvoryCharm(this);
}
}

View file

@ -0,0 +1,92 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Mode;
import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AttachedToPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class SeedlingCharm extends CardImpl {
private static final FilterPermanent filter1 = new FilterPermanent("Aura attached to a creature");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("green creature");
static {
filter1.add(new SubtypePredicate("Aura"));
filter1.add(new AttachedToPredicate(new FilterCreaturePermanent()));
filter2.add(new ColorPredicate(ObjectColor.GREEN));
}
public SeedlingCharm(UUID ownerId) {
super(ownerId, 138, "Seedling Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}");
this.expansionSetCode = "MIR";
// Choose one - Return target Aura attached to a creature to its owner's hand
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter1));
// or regenerate target green creature
Mode mode = new Mode();
mode.getEffects().add(new RegenerateTargetEffect());
mode.getTargets().add(new TargetPermanent(filter2));
this.getSpellAbility().addMode(mode);
// or target creature gains trample until end of turn.
mode = new Mode();
mode.getEffects().add(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn));
mode.getTargets().add(new TargetCreaturePermanent());
this.getSpellAbility().addMode(mode);
}
public SeedlingCharm(final SeedlingCharm card) {
super(card);
}
@Override
public SeedlingCharm copy() {
return new SeedlingCharm(this);
}
}

View file

@ -0,0 +1,66 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class SereneHeart extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Auras");
static {
filter.add(new SubtypePredicate("Aura"));
}
public SereneHeart(UUID ownerId) {
super(ownerId, 140, "Serene Heart", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
this.expansionSetCode = "MIR";
// Destroy all Auras.
this.getSpellAbility().addEffect(new DestroyAllEffect(filter));
}
public SereneHeart(final SereneHeart card) {
super(card);
}
@Override
public SereneHeart copy() {
return new SereneHeart(this);
}
}

View file

@ -44,6 +44,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@ -57,10 +58,9 @@ public class ShallowGrave extends CardImpl {
super(ownerId, 39, "Shallow Grave", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{B}");
this.expansionSetCode = "MIR";
// Return the top creature card of your graveyard to the battlefield. That creature gains haste until end of turn. Exile it at the beginning of the next end step.
this.getSpellAbility().addEffect(new ShallowGraveEffect());
}
public ShallowGrave(final ShallowGrave card) {
@ -74,46 +74,49 @@ public class ShallowGrave extends CardImpl {
}
class ShallowGraveEffect extends OneShotEffect {
public ShallowGraveEffect() {
super(Outcome.Benefit);
this.staticText = "Return the top creature card of your graveyard to the battlefield. That creature gains haste until end of turn. Exile it at the beginning of the next end step";
}
public ShallowGraveEffect(final ShallowGraveEffect effect) {
super(effect);
}
@Override
public ShallowGraveEffect copy() {
return new ShallowGraveEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card lastCreatureCard = null;
for (Card card :controller.getGraveyard().getCards(game)) {
for (Card card : controller.getGraveyard().getCards(game)) {
if (card.getCardType().contains(CardType.CREATURE)) {
lastCreatureCard = card;
}
}
}
if (lastCreatureCard != null) {
if (controller.putOntoBattlefieldWithInfo(lastCreatureCard, game, Zone.GRAVEYARD, source.getSourceId())) {
FixedTarget fixedTarget = new FixedTarget(lastCreatureCard.getId());
// Gains Haste
ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
hasteEffect.setTargetPointer(fixedTarget);
game.addEffect(hasteEffect, source);
// Exile it at end of turn
ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD);
exileEffect.setTargetPointer(fixedTarget);
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
Permanent returnedCreature = game.getPermanent(lastCreatureCard.getId());
if (returnedCreature != null) {
FixedTarget fixedTarget = new FixedTarget(returnedCreature, game);
// Gains Haste
ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
hasteEffect.setTargetPointer(fixedTarget);
game.addEffect(hasteEffect, source);
// Exile it at end of turn
ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
exileEffect.setTargetPointer(fixedTarget);
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}
}
return true;

View file

@ -0,0 +1,67 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class TranquilDomain extends CardImpl {
private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("non-Aura enchantments");
static {
filter.add(Predicates.not(new SubtypePredicate("Aura")));
}
public TranquilDomain(UUID ownerId) {
super(ownerId, 143, "Tranquil Domain", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
this.expansionSetCode = "MIR";
// Destroy all non-Aura enchantments.
this.getSpellAbility().addEffect(new DestroyAllEffect(filter));
}
public TranquilDomain(final TranquilDomain card) {
super(card);
}
@Override
public TranquilDomain copy() {
return new TranquilDomain(this);
}
}

View file

@ -0,0 +1,65 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LoneFox
*/
public class UnfulfilledDesires extends CardImpl {
public UnfulfilledDesires(UUID ownerId) {
super(ownerId, 345, "Unfulfilled Desires", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{B}");
this.expansionSetCode = "MIR";
// {1}, Pay 1 life: Draw a card, then discard a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new ManaCostsImpl("{1}"));
ability.addCost(new PayLifeCost(1));
this.addAbility(ability);
}
public UnfulfilledDesires(final UnfulfilledDesires card) {
super(card);
}
@Override
public UnfulfilledDesires copy() {
return new UnfulfilledDesires(this);
}
}

View file

@ -0,0 +1,60 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author LoneFox
*/
public class UnyaroBeeSting extends CardImpl {
public UnyaroBeeSting(UUID ownerId) {
super(ownerId, 148, "Unyaro Bee Sting", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}");
this.expansionSetCode = "MIR";
// Unyaro Bee Sting deals 2 damage to target creature or player.
this.getSpellAbility().addEffect(new DamageTargetEffect(2));
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
}
public UnyaroBeeSting(final UnyaroBeeSting card) {
super(card);
}
@Override
public UnyaroBeeSting copy() {
return new UnyaroBeeSting(this);
}
}

View file

@ -0,0 +1,81 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.Game;
/**
*
* @author LoneFox
*/
public class VitalizingCascade extends CardImpl {
public VitalizingCascade(UUID ownerId) {
super(ownerId, 346, "Vitalizing Cascade", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{G}{W}");
this.expansionSetCode = "MIR";
// You gain X plus 3 life.
this.getSpellAbility().addEffect(new GainLifeEffect(new VitalizingCascadeValue()));
}
public VitalizingCascade(final VitalizingCascade card) {
super(card);
}
@Override
public VitalizingCascade copy() {
return new VitalizingCascade(this);
}
}
class VitalizingCascadeValue extends ManacostVariableValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
return super.calculate(game, sourceAbility, effect) + 3;
}
@Override
public VitalizingCascadeValue copy() {
return new VitalizingCascadeValue();
}
@Override
public String toString() {
return "X plus 3";
}
}

View file

@ -37,6 +37,7 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -47,9 +48,9 @@ import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
@ -175,9 +176,9 @@ class SoulFoundryEffect extends OneShotEffect {
Card imprinted = game.getCard(soulFoundry.getImprinted().get(0));
if (imprinted != null
&& game.getState().getZone(imprinted.getId()).equals(Zone.EXILED)) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(imprinted);
return token.putOntoBattlefield(1, game, source.getSourceId(), controller.getId());
PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
effect.setTargetPointer(new FixedTarget(imprinted.getId(), imprinted.getZoneChangeCounter(game)));
return effect.apply(game, source);
}
}
}

View file

@ -1,16 +1,16 @@
/*
* Copyright 2011 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
@ -20,7 +20,7 @@
* 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.
@ -28,26 +28,20 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.Cost;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.EmptyToken;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
/**
*
@ -55,13 +49,23 @@ import mage.util.CardUtil;
*/
public class Mirrorworks extends CardImpl {
private final static FilterArtifactPermanent filter = new FilterArtifactPermanent("another nontoken artifact");
static {
filter.add(new AnotherPredicate());
filter.add(Predicates.not(new TokenPredicate()));
}
public Mirrorworks(UUID ownerId) {
super(ownerId, 114, "Mirrorworks", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}");
this.expansionSetCode = "MBS";
// Whenever another nontoken artifact enters the battlefield under your control, you may pay {2}.
// If you do, put a token that's a copy of that artifact onto the battlefield.
this.addAbility(new MirrorworksAbility());
Effect effect = new DoIfCostPaid(new PutTokenOntoBattlefieldCopyTargetEffect(),
new ManaCostsImpl("{2}"), "Put a token that's a copy of that artifact onto the battlefield?");
effect.setText("you may pay {2}. If you do, put a token that's a copy of that artifact onto the battlefield");
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, effect, filter, false, SetTargetPointer.PERMANENT, null));
}
public Mirrorworks(final Mirrorworks card) {
@ -74,90 +78,3 @@ public class Mirrorworks extends CardImpl {
}
}
class MirrorworksAbility extends TriggeredAbilityImpl {
public MirrorworksAbility() {
super(Zone.BATTLEFIELD, new MirrorworksEffect());
}
public MirrorworksAbility(final MirrorworksAbility ability) {
super(ability);
}
@Override
public MirrorworksAbility copy() {
return new MirrorworksAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!event.getTargetId().equals(this.getSourceId())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null
&& permanent.getControllerId().equals(getControllerId())
&& !(permanent instanceof PermanentToken)
&& permanent.getCardType().contains(CardType.ARTIFACT)) {
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever another nontoken artifact enters the battlefield under your control, you may pay {2}. If you do, put a token that's a copy of that artifact onto the battlefield";
}
}
class MirrorworksEffect extends OneShotEffect {
public MirrorworksEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "put a token that's a copy of that artifact onto the battlefield";
}
public MirrorworksEffect(final MirrorworksEffect effect) {
super(effect);
}
@Override
public MirrorworksEffect copy() {
return new MirrorworksEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
UUID targetId = targetPointer.getFirst(game, source);
if (targetId != null && player != null) {
MageObject target = game.getPermanent(targetId);
if (target == null) {
target = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
}
if (target != null) {
Cost cost = new ManaCostsImpl("{2}");
if (player.chooseUse(outcome, new StringBuilder("Pay ").append(cost.getText()).append(" and put a token copy of ").append(target.getName()).append(" onto the battlefield").toString(), source, game)) {
cost.clearPaid();
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
if (target instanceof Permanent) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from((Permanent)target);
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
return true;
}
}
}
}
}
return false;
}
}

View file

@ -0,0 +1,81 @@
/*
* 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.sets.nemesis;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FadingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class ParallaxDementia extends CardImpl {
public ParallaxDementia(UUID ownerId) {
super(ownerId, 62, "Parallax Dementia", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.expansionSetCode = "NMS";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Fading 1
this.addAbility(new FadingAbility(1, this));
// Enchanted creature gets +3/+2.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 2, Duration.WhileOnBattlefield)));
// When Parallax Dementia leaves the battlefield, destroy enchanted creature. That creature can't be regenerated.
this.addAbility(new LeavesBattlefieldTriggeredAbility(new DestroyAttachedEffect("enchanted creature", true), false));
}
public ParallaxDementia(final ParallaxDementia card) {
super(card);
}
@Override
public ParallaxDementia copy() {
return new ParallaxDementia(this);
}
}

View file

@ -76,7 +76,7 @@ public class NumbingDose extends CardImpl {
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// Enchanted permanent doesn't untap during its controller's untap step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect("permanent")));
// At the beginning of the upkeep of enchanted permanent's controller, that player loses 1 life.
this.addAbility(new NumbingDoseTriggeredAbility());

View file

@ -30,19 +30,14 @@ package mage.sets.ninthedition;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.LoseLifeControllerAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -77,50 +72,3 @@ public class ContaminatedBond extends CardImpl {
return new ContaminatedBond(this);
}
}
class LoseLifeControllerAttachedEffect extends OneShotEffect {
protected DynamicValue amount;
public LoseLifeControllerAttachedEffect(int amount) {
this(new StaticValue(amount));
}
public LoseLifeControllerAttachedEffect(DynamicValue amount) {
super(Outcome.Damage);
this.amount = amount;
staticText = "its controller loses " + amount.toString() +" life";
}
public LoseLifeControllerAttachedEffect(final LoseLifeControllerAttachedEffect effect) {
super(effect);
this.amount = effect.amount.copy();
}
@Override
public LoseLifeControllerAttachedEffect copy() {
return new LoseLifeControllerAttachedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment == null) {
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
}
if (enchantment != null && enchantment.getAttachedTo() != null) {
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature == null) {
creature = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
}
if (creature != null) {
Player player = game.getPlayer(creature.getControllerId());
if (player != null) {
player.loseLife(amount.calculate(game, source, this), game);
return true;
}
}
}
return false;
}
}

View file

@ -28,14 +28,13 @@
package mage.sets.odyssey;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PreventAllDamageByAllEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TimingRule;
/**
@ -48,9 +47,9 @@ public class MomentsPeace extends CardImpl {
super(ownerId, 251, "Moment's Peace", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
this.expansionSetCode = "ODY";
// Prevent all combat damage that would be dealt this turn.
this.getSpellAbility().addEffect(new PreventAllDamageByAllEffect(Duration.EndOfTurn, true));
// Flashback {2}{G}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}"), TimingRule.INSTANT));
}

View file

@ -0,0 +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.sets.onslaught;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class FeverCharm extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Wizard creature");
static {
filter.add(new SubtypePredicate("Wizard"));
}
public FeverCharm(UUID ownerId) {
super(ownerId, 202, "Fever Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "ONS";
// Choose one - Target creature gains haste until end of turn
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// or target creature gets +2/+0 until end of turn
Mode mode = new Mode();
mode.getEffects().add(new BoostTargetEffect(2, 0, Duration.EndOfTurn));
mode.getTargets().add(new TargetCreaturePermanent());
this.getSpellAbility().addMode(mode);
// or Fever Charm deals 3 damage to target Wizard creature.
mode = new Mode();
mode.getEffects().add(new DamageTargetEffect(3));
mode.getTargets().add(new TargetCreaturePermanent(filter));
this.getSpellAbility().addMode(mode);
}
public FeverCharm(final FeverCharm card) {
super(card);
}
@Override
public FeverCharm copy() {
return new FeverCharm(this);
}
}

View file

@ -34,25 +34,13 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesSubtypeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -69,7 +57,7 @@ public class Imagecrafter extends CardImpl {
this.toughness = new MageInt(1);
// {tap}: Choose a creature type other than Wall. Target creature becomes that type until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenNonWallCreatureTypeTargetEffect(), new TapSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenCreatureTypeTargetEffect(true), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
@ -82,5 +70,5 @@ public class Imagecrafter extends CardImpl {
public Imagecrafter copy() {
return new Imagecrafter(this);
}
}
}

View file

@ -0,0 +1,86 @@
/*
* 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.sets.onslaught;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.TargetPermanent;
import mage.target.TargetPlayer;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author LoneFox
*/
public class MiseryCharm extends CardImpl {
private static final FilterPermanent filter1 = new FilterPermanent("Cleric");
private static final FilterCard filter2 = new FilterCard("Cleric card from your graveyard");
static {
filter1.add(new SubtypePredicate("Cleric"));
filter2.add(new SubtypePredicate("Cleric"));
}
public MiseryCharm(UUID ownerId) {
super(ownerId, 158, "Misery Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}");
this.expansionSetCode = "ONS";
// Choose one - Destroy target Cleric
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter1));
// or return target Cleric card from your graveyard to your hand
Mode mode = new Mode();
mode.getEffects().add(new ReturnToHandTargetEffect());
mode.getTargets().add(new TargetCardInYourGraveyard(filter2));
this.getSpellAbility().addMode(mode);
// or target player loses 2 life.
mode = new Mode();
mode.getEffects().add(new LoseLifeTargetEffect(2));
mode.getTargets().add(new TargetPlayer());
this.getSpellAbility().addMode(mode);
}
public MiseryCharm(final MiseryCharm card) {
super(card);
}
@Override
public MiseryCharm copy() {
return new MiseryCharm(this);
}
}

View file

@ -34,25 +34,13 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesSubtypeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -69,7 +57,7 @@ public class MistformMutant extends CardImpl {
this.toughness = new MageInt(4);
// {1}{U}: Choose a creature type other than Wall. Target creature becomes that type until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenNonWallCreatureTypeTargetEffect(), new ManaCostsImpl<>("{1}{U}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenCreatureTypeTargetEffect(true), new ManaCostsImpl<>("{1}{U}"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
@ -82,4 +70,4 @@ public class MistformMutant extends CardImpl {
public MistformMutant copy() {
return new MistformMutant(this);
}
}
}

View file

@ -0,0 +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.sets.onslaught;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AttachedToPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class PietyCharm extends CardImpl {
private static final FilterPermanent filter1 = new FilterPermanent("Aura attached to a creature");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Soldier creature");
static {
filter1.add(new SubtypePredicate("Aura"));
filter1.add(new AttachedToPredicate(new FilterCreaturePermanent()));
filter2.add(new SubtypePredicate("Soldier"));
}
public PietyCharm(UUID ownerId) {
super(ownerId, 49, "Piety Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "ONS";
// Choose one - Destroy target Aura attached to a creature
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter1));
// or target Soldier creature gets +2/+2 until end of turn
Mode mode = new Mode();
mode.getEffects().add(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
mode.getTargets().add(new TargetCreaturePermanent(filter2));
this.getSpellAbility().addMode(mode);
// or creatures you control gain vigilance until end of turn.
mode = new Mode();
mode.getEffects().add(new GainAbilityAllEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")));
this.getSpellAbility().addMode(mode);
}
public PietyCharm(final PietyCharm card) {
super(card);
}
@Override
public PietyCharm copy() {
return new PietyCharm(this);
}
}

View file

@ -34,7 +34,6 @@ import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesSubtypeAllEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
@ -59,8 +58,8 @@ public class Standardize extends CardImpl {
this.expansionSetCode = "ONS";
// Choose a creature type other than Wall. Each creature becomes that type until end of turn.
this.getSpellAbility().addEffect(new BecomesChosenNonWallCreatureTypeTargetEffect());
this.getSpellAbility().addEffect(new StandardizeEffect());
}
public Standardize(final Standardize card) {
@ -77,19 +76,19 @@ public class Standardize extends CardImpl {
class StandardizeEffect extends OneShotEffect {
public StandardizeEffect() {
super(Outcome.BoostCreature);
staticText = "choose a creature type other than wall, each creature's type becomes that type until end of turn";
}
public StandardizeEffect(final StandardizeEffect effect) {
super(effect);
}
public StandardizeEffect() {
super(Outcome.BoostCreature);
staticText = "choose a creature type other than wall, each creature's type becomes that type until end of turn";
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
}
public StandardizeEffect(final StandardizeEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
String chosenType = "";
if (player != null && permanent != null) {
@ -111,14 +110,13 @@ class StandardizeEffect extends OneShotEffect {
game.addEffect(effect, source);
return true;
}
}
return false;
}
@Override
public Effect copy() {
return new StandardizeEffect(this);
}
}
@Override
public Effect copy() {
return new StandardizeEffect(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.sets.onslaught;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class TrickeryCharm extends CardImpl {
public TrickeryCharm(UUID ownerId) {
super(ownerId, 119, "Trickery Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
this.expansionSetCode = "ONS";
// Choose one - Target creature gains flying until end of turn
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// or target creature becomes the creature type of your choice until end of turn
Mode mode = new Mode();
mode.getEffects().add(new BecomesChosenCreatureTypeTargetEffect());
mode.getTargets().add(new TargetCreaturePermanent());
this.getSpellAbility().addMode(mode);
// or look at the top four cards of your library, then put them back in any order.
mode = new Mode();
mode.getEffects().add(new LookLibraryControllerEffect(4));
this.getSpellAbility().addMode(mode);
}
public TrickeryCharm(final TrickeryCharm card) {
super(card);
}
@Override
public TrickeryCharm copy() {
return new TrickeryCharm(this);
}
}

View file

@ -0,0 +1,91 @@
/*
* 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.sets.onslaught;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.InsectToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class VitalityCharm extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Beast");
static {
filter.add(new SubtypePredicate("Beast"));
}
public VitalityCharm(UUID ownerId) {
super(ownerId, 296, "Vitality Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}");
this.expansionSetCode = "ONS";
// Choose one - Put a 1/1 green Insect creature token onto the battlefield
this.getSpellAbility().addEffect(new CreateTokenEffect(new InsectToken()));
// or target creature gets +1/+1 and gains trample until end of turn
Mode mode = new Mode();
Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
effect.setText("target creature gets +1/+1");
mode.getEffects().add(effect);
effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
effect.setText("and gains trample until end of turn");
mode.getEffects().add(effect);
mode.getTargets().add(new TargetCreaturePermanent());
this.getSpellAbility().addMode(mode);
// or regenerate target Beast.
mode = new Mode();
mode.getEffects().add(new RegenerateTargetEffect());
mode.getTargets().add(new TargetPermanent(filter));
this.getSpellAbility().addMode(mode);
}
public VitalityCharm(final VitalityCharm card) {
super(card);
}
@Override
public VitalityCharm copy() {
return new VitalityCharm(this);
}
}

View file

@ -34,7 +34,8 @@ import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.LastTimeCounterRemovedCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.CopyCardEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
@ -47,14 +48,11 @@ import mage.counters.CounterType;
/**
*
* @author Gal Lerman
*
*/
public class Chronozoa extends CardImpl {
private static final int timeCounters = 3;
private static final int numCopies = 2;
public Chronozoa(UUID ownerId) {
public Chronozoa(UUID ownerId) {
super(ownerId, 37, "Chronozoa", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "PLC";
this.subtype.add("Illusion");
@ -64,15 +62,17 @@ public class Chronozoa extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(timeCounters)));
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(timeCounters));
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
// When Chronozoa is put into a graveyard from play, if it had no time counters on it, put two tokens into play that are copies of it.
this.addAbility(new ConditionalTriggeredAbility(new DiesCreatureTriggeredAbility(new CopyCardEffect(this, numCopies), false),
new LastTimeCounterRemovedCondition(),
"When {this} dies, if it had no time counters on it, put two tokens that are copies of it onto the battlefield."));
Effect effect = new PutTokenOntoBattlefieldCopySourceEffect(2);
effect.setText("put two tokens into play that are copies of it");
this.addAbility(new ConditionalTriggeredAbility(new DiesCreatureTriggeredAbility(effect, false),
new LastTimeCounterRemovedCondition(),
"When {this} dies, if it had no time counters on it, put two tokens that are copies of it onto the battlefield."));
}
public Chronozoa(final Chronozoa card) {

View file

@ -29,24 +29,22 @@ package mage.sets.planechase2012;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
/**
@ -76,7 +74,7 @@ public class QuietDisrepair extends CardImpl {
this.addAbility(ability);
// At the beginning of your upkeep, choose one - Destroy enchanted permanent; or you gain 2 life.
ability = new BeginningOfUpkeepTriggeredAbility(new QuietDisrepairDestroyEffect(), TargetController.YOU, false);
ability = new BeginningOfUpkeepTriggeredAbility(new DestroyAttachedEffect("enchanted permanent"), TargetController.YOU, false);
Mode mode = new Mode();
mode.getEffects().add(new GainLifeEffect(2));
ability.addMode(mode);
@ -92,35 +90,3 @@ public class QuietDisrepair extends CardImpl {
return new QuietDisrepair(this);
}
}
class QuietDisrepairDestroyEffect extends OneShotEffect {
public QuietDisrepairDestroyEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Destroy enchanted permanent";
}
public QuietDisrepairDestroyEffect(final QuietDisrepairDestroyEffect effect) {
super(effect);
}
@Override
public QuietDisrepairDestroyEffect copy() {
return new QuietDisrepairDestroyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment == null) {
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
}
if (enchantment != null) {
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
if (enchanted != null) {
return enchanted.destroy(source.getSourceId(), game, false);
}
}
return false;
}
}

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