Merge remote-tracking branch 'magefree/master'

This commit is contained in:
Samuel Sandeen 2016-07-23 17:44:44 -04:00
commit a535d9d0e8
472 changed files with 12169 additions and 7729 deletions

View file

@ -43,7 +43,7 @@ public class AnthologyDivineVsDemonic extends ExpansionSet {
}
private AnthologyDivineVsDemonic() {
super("Duel Decks: Anthology, Divine vs. Demonic", "DD3A", "mage.sets.anthologydivinevsdemonic", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
super("Duel Decks: Anthology, Divine vs. Demonic", "DD3DVD", "mage.sets.anthologydivinevsdemonic", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
this.blockName = "Duel Decks: Anthology";
this.hasBasicLands = false;
}

View file

@ -43,7 +43,7 @@ public class AnthologyElvesVsGoblins extends ExpansionSet {
}
private AnthologyElvesVsGoblins() {
super("Duel Decks: Anthology, Elves vs. Goblins", "DD3B", "mage.sets.anthologyelvesvsgoblins", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
super("Duel Decks: Anthology, Elves vs. Goblins", "DD3EVG", "mage.sets.anthologyelvesvsgoblins", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
this.blockName = "Duel Decks: Anthology";
this.hasBasicLands = false;
}

View file

@ -43,7 +43,7 @@ public class AnthologyGarrukVsLiliana extends ExpansionSet {
}
private AnthologyGarrukVsLiliana() {
super("Duel Decks: Anthology, Garruk vs. Liliana", "DD3C", "mage.sets.anthologygarrukvsliliana", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
super("Duel Decks: Anthology, Garruk vs. Liliana", "DD3GVL", "mage.sets.anthologygarrukvsliliana", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
this.blockName = "Duel Decks: Anthology";
this.hasBasicLands = false;
}

View file

@ -43,7 +43,7 @@ public class AnthologyJaceVsChandra extends ExpansionSet {
}
private AnthologyJaceVsChandra() {
super("Duel Decks: Anthology, Jace vs. Chandra", "DD3D", "mage.sets.anthologyjacevschandra", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
super("Duel Decks: Anthology, Jace vs. Chandra", "DD3JVC", "mage.sets.anthologyjacevschandra", new GregorianCalendar(2014, 12, 5).getTime(), SetType.SUPPLEMENTAL);
this.blockName = "Duel Decks: Anthology";
this.hasBasicLands = false;
}

View file

@ -47,8 +47,8 @@ public class EldritchMoon extends ExpansionSet {
super("Eldritch Moon", "EMN", "mage.sets.eldritchmoon", new GregorianCalendar(2016, 7, 26).getTime(), SetType.EXPANSION);
this.blockName = "Shadows over Innistrad";
this.hasBoosters = true;
this.numBoosterLands = 0;
this.numBoosterCommon = 10;
this.numBoosterLands = 1;
this.numBoosterCommon = 9;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 8;

View file

@ -44,7 +44,7 @@ public class FTVDragons extends ExpansionSet {
}
private FTVDragons() {
super("From the Vault: Dragons", "FVD", "mage.sets.ftvdragons", new GregorianCalendar(2008, 8, 29).getTime(), SetType.SUPPLEMENTAL);
super("From the Vault: Dragons", "DRB", "mage.sets.ftvdragons", new GregorianCalendar(2008, 8, 29).getTime(), SetType.SUPPLEMENTAL);
this.hasBasicLands = false;
}
}

View file

@ -44,7 +44,7 @@ public class FTVExiled extends ExpansionSet {
}
private FTVExiled() {
super("From the Vault: Exiled", "FVE", "mage.sets.ftvexiled", new GregorianCalendar(2009, 8, 28).getTime(), SetType.SUPPLEMENTAL);
super("From the Vault: Exiled", "V09", "mage.sets.ftvexiled", new GregorianCalendar(2009, 8, 28).getTime(), SetType.SUPPLEMENTAL);
this.hasBasicLands = false;
}
}

View file

@ -44,7 +44,7 @@ public class FTVLegends extends ExpansionSet {
}
private FTVLegends() {
super("From the Vault: Legends", "FVL", "mage.sets.ftvlegends", new GregorianCalendar(2011, 8, 26).getTime(), SetType.SUPPLEMENTAL);
super("From the Vault: Legends", "V11", "mage.sets.ftvlegends", new GregorianCalendar(2011, 8, 26).getTime(), SetType.SUPPLEMENTAL);
this.hasBasicLands = false;
}
}

View file

@ -44,7 +44,7 @@ public class FTVRelics extends ExpansionSet {
}
private FTVRelics() {
super("From the Vault: Relics", "FVR", "mage.sets.ftvrelics", new GregorianCalendar(2010, 8, 27).getTime(), SetType.SUPPLEMENTAL);
super("From the Vault: Relics", "V10", "mage.sets.ftvrelics", new GregorianCalendar(2010, 8, 27).getTime(), SetType.SUPPLEMENTAL);
this.hasBasicLands = false;
}
}

View file

@ -28,7 +28,6 @@
package mage.sets;
import java.util.GregorianCalendar;
import mage.cards.ExpansionSet;
import mage.constants.SetType;
@ -45,7 +44,7 @@ public class Nemesis extends ExpansionSet {
}
private Nemesis() {
super("Nemesis", "NMS", "mage.sets.nemesis", new GregorianCalendar(2000, 1, 5).getTime(), SetType.EXPANSION);
super("Nemesis", "NEM", "mage.sets.nemesis", new GregorianCalendar(2000, 1, 5).getTime(), SetType.EXPANSION);
this.blockName = "Masques";
this.parentSet = MercadianMasques.getInstance();
this.hasBasicLands = false;

View file

@ -44,7 +44,7 @@ public class PDSSlivers extends ExpansionSet {
}
private PDSSlivers() {
super("Premium Deck Series: Slivers", "PDS", "mage.sets.pdsslivers", new GregorianCalendar(2009, 11, 1).getTime(), SetType.SUPPLEMENTAL);
super("Premium Deck Series: Slivers", "H09", "mage.sets.pdsslivers", new GregorianCalendar(2009, 11, 1).getTime(), SetType.SUPPLEMENTAL);
this.hasBasicLands = false;
}
}

View file

@ -66,7 +66,7 @@ public class AgonizingDemise extends CardImpl {
this.addAbility(new KickerAbility("{1}{R}"));
// Destroy target nonblack creature. It can't be regenerated.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterNonBlackCreature));
//If Agonizing Demise was kicked, it deals damage equal to that creature's power to the creature's controller.

View file

@ -28,13 +28,12 @@
package mage.sets.alarareborn;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
import mage.abilities.keyword.CascadeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetCreaturePermanent;
/**
@ -48,9 +47,6 @@ public class DemonicDread extends CardImpl {
super(ownerId, 38, "Demonic Dread", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{R}");
this.expansionSetCode = "ARB";
// Cascade
this.addAbility(new CascadeAbility());

View file

@ -28,17 +28,13 @@
package mage.sets.apocalypse;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.filter.common.FilterEnchantmentPermanent;
/**
*
@ -52,7 +48,7 @@ public class TranquilPath extends CardImpl {
// Destroy all enchantments.
this.getSpellAbility().addEffect(new TranquilPathEffect());
this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterEnchantmentPermanent("enchantments")));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
@ -67,34 +63,3 @@ public class TranquilPath extends CardImpl {
}
}
class TranquilPathEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent("");
static {
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public TranquilPathEffect() {
super(Outcome.DestroyPermanent);
staticText = "Destroy all enchantments";
}
public TranquilPathEffect(final TranquilPathEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
permanent.destroy(source.getSourceId(), game, false);
}
return true;
}
@Override
public TranquilPathEffect copy() {
return new TranquilPathEffect(this);
}
}

View file

@ -52,12 +52,12 @@ public class AbuJafar extends CardImpl {
this.power = new MageInt(0);
this.toughness = new MageInt(1);
FilterCreaturePermanent filter = new FilterCreaturePermanent();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures blocking or blocked by it");
filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()),
new BlockingAttackerIdPredicate(this.getId())));
// When Abu Ja'far dies, destroy all creatures blocking or blocked by it. They can't be regenerated.
this.addAbility(new DiesTriggeredAbility(new DestroyAllEffect(filter), true));
this.addAbility(new DiesTriggeredAbility(new DestroyAllEffect(filter, true), false));
}
public AbuJafar(final AbuJafar card) {

View file

@ -39,11 +39,11 @@ import mage.filter.common.FilterAttackingCreature;
*
* @author fireshoes
*/
public class ArmyOfAllah extends CardImpl {
public class ArmyOfAllah1 extends CardImpl {
private static final FilterAttackingCreature filter = new FilterAttackingCreature("Attacking creatures");
public ArmyOfAllah(UUID ownerId) {
public ArmyOfAllah1(UUID ownerId) {
super(ownerId, 56, "Army of Allah", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}{W}");
this.expansionSetCode = "ARN";
@ -51,12 +51,12 @@ public class ArmyOfAllah extends CardImpl {
this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, filter, false));
}
public ArmyOfAllah(final ArmyOfAllah card) {
public ArmyOfAllah1(final ArmyOfAllah1 card) {
super(card);
}
@Override
public ArmyOfAllah copy() {
return new ArmyOfAllah(this);
public ArmyOfAllah1 copy() {
return new ArmyOfAllah1(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.arabiannights;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class ArmyOfAllah2 extends ArmyOfAllah1 {
public ArmyOfAllah2(UUID ownerId) {
super(ownerId);
this.cardNumber = 57;
}
public ArmyOfAllah2(final ArmyOfAllah2 card) {
super(card);
}
@Override
public ArmyOfAllah2 copy() {
return new ArmyOfAllah2(this);
}
}

View file

@ -42,9 +42,9 @@ import mage.constants.Rarity;
*
* @author LoneFox
*/
public class NafsAsp extends CardImpl {
public class NafsAsp1 extends CardImpl {
public NafsAsp(UUID ownerId) {
public NafsAsp1(UUID ownerId) {
super(ownerId, 36, "Nafs Asp", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
this.expansionSetCode = "ARN";
this.subtype.add("Snake");
@ -58,12 +58,12 @@ public class NafsAsp extends CardImpl {
false, true));
}
public NafsAsp(final NafsAsp card) {
public NafsAsp1(final NafsAsp1 card) {
super(card);
}
@Override
public NafsAsp copy() {
return new NafsAsp(this);
public NafsAsp1 copy() {
return new NafsAsp1(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.arabiannights;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class NafsAsp2 extends NafsAsp1 {
public NafsAsp2(UUID ownerId) {
super(ownerId);
this.cardNumber = 37;
}
public NafsAsp2(final NafsAsp2 card) {
super(card);
}
@Override
public NafsAsp2 copy() {
return new NafsAsp2(this);
}
}

View file

@ -56,13 +56,13 @@ import mage.target.TargetPermanent;
*
* @author MarcoMarin
*/
public class Oubliette extends CardImpl {
public class Oubliette1 extends CardImpl {
public Counters godHelpMe = null;
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature");
public Oubliette(UUID ownerId) {
public Oubliette1(UUID ownerId) {
super(ownerId, 11, "Oubliette", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}");
this.expansionSetCode = "ARN";
@ -77,13 +77,13 @@ public class Oubliette extends CardImpl {
this.addAbility(ability2);
}
public Oubliette(final Oubliette card) {
public Oubliette1(final Oubliette1 card) {
super(card);
}
@Override
public Oubliette copy() {
return new Oubliette(this);
public Oubliette1 copy() {
return new Oubliette1(this);
}
}
@ -134,7 +134,7 @@ class OublietteEffect extends OneShotEffect {
}
//((Oubliette)enchantment.getMainCard()).godHelpMe = enchantedCreature.getCounters(game); //why doesn't work? should return the same card, no?
((Oubliette) game.getCard(source.getSourceId())).godHelpMe = enchantedCreature.getCounters(game).copy();
((Oubliette1) game.getCard(source.getSourceId())).godHelpMe = enchantedCreature.getCounters(game).copy();
/*
if (!(enchantedCreature instanceof Token)) {
@ -220,7 +220,7 @@ class OublietteReturnEffect extends OneShotEffect {
if (oubliette == null) {
return false;//1st stab at getting those counters back
}
for (Counter c : ((Oubliette) oubliette).godHelpMe.values()) { //would be nice if could just use that copy function to set the whole field
for (Counter c : ((Oubliette1) oubliette).godHelpMe.values()) { //would be nice if could just use that copy function to set the whole field
if (c != null) {
newPermanent.getCounters(game).addCounter(c);
}

View file

@ -0,0 +1,51 @@
/*
* 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.arabiannights;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class Oubliette2 extends Oubliette1 {
public Oubliette2(UUID ownerId) {
super(ownerId);
this.cardNumber = 12;
}
public Oubliette2(final Oubliette2 card) {
super(card);
}
@Override
public Oubliette2 copy() {
return new Oubliette2(this);
}
}

View file

@ -41,11 +41,11 @@ import mage.filter.common.FilterBlockingCreature;
*
* @author MarcoMarin
*/
public class Piety extends CardImpl {
public class Piety1 extends CardImpl {
public static final FilterBlockingCreature filter = new FilterBlockingCreature();
public Piety(UUID ownerId) {
public Piety1(UUID ownerId) {
super(ownerId, 64, "Piety", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}");
this.expansionSetCode = "ARN";
@ -54,12 +54,12 @@ public class Piety extends CardImpl {
//this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_POST, "end Piety", true, new BoostAllEffect(0, 3, Duration.EndOfTurn, filter, false)));
}
public Piety(final Piety card) {
public Piety1(final Piety1 card) {
super(card);
}
@Override
public Piety copy() {
return new Piety(this);
public Piety1 copy() {
return new Piety1(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.arabiannights;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class Piety2 extends Piety1 {
public Piety2(UUID ownerId) {
super(ownerId);
this.cardNumber = 65;
}
public Piety2(final Piety2 card) {
super(card);
}
@Override
public Piety2 copy() {
return new Piety2(this);
}
}

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -55,7 +55,7 @@ public class ChasmGuide extends CardImpl {
// <i>Rally</i> Whenever Chasm Guide or another Ally enters the battlefield under your control, creatures you control gain haste until end of turn.
this.addAbility(new AllyEntersBattlefieldTriggeredAbility(
new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false));
new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false));
}
public ChasmGuide(final ChasmGuide card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -55,7 +55,7 @@ public class FiremantleMage extends CardImpl {
// <i>Rally</i> Whenver Firemantle Mage or another Ally enters the battlefield under your control, creatures you control gain menace until end of turn.
this.addAbility(new AllyEntersBattlefieldTriggeredAbility(
new GainAbilityControlledEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false));
new GainAbilityControlledEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false));
}
public FiremantleMage(final FiremantleMage card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -55,7 +55,7 @@ public class KorBladewhirl extends CardImpl {
// <i>Rally</i> Whenever Kor Bladewhirl or another Ally enters the battlefield under your control, creatures you control gain first strike until end of turn.
this.addAbility(new AllyEntersBattlefieldTriggeredAbility(
new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false));
new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false));
}
public KorBladewhirl(final KorBladewhirl card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
/**
*
@ -55,7 +55,7 @@ public class OnduChampion extends CardImpl {
// <i>Rally</i> Whenever Ondu Champion or another Ally enters the battlefield under your control, creatures you control gain trample until end of turn.
this.addAbility(new AllyEntersBattlefieldTriggeredAbility(
new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false));
new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false));
}
public OnduChampion(final OnduChampion card) {

View file

@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.ColorlessPredicate;
*/
public class RuinationGuide extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Other colorless creatures you control");
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("colorless creatures");
static {
filter.add(new ColorlessPredicate());

View file

@ -73,7 +73,7 @@ public class KiraGreatGlassSpinner extends CardImpl {
// Creatures you control have "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability."
Effect effect = new CounterTargetEffect();
effect.setText("counter that spell or ability");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new KiraGreatGlassSpinnerAbility(effect), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures you control"))),
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new KiraGreatGlassSpinnerAbility(effect), Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures"))),
new CreatureWasTargetedThisTurnWatcher());
}

View file

@ -40,12 +40,15 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.MeldCard;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
import mage.game.permanent.PermanentMeld;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTargets;
@ -105,7 +108,18 @@ class EerieInterludeEffect extends OneShotEffect {
Cards cardsToReturn = new CardsImpl();
for (Card exiled : toExile) {
if (((Permanent) exiled).getZoneChangeCounter(game) == game.getState().getZoneChangeCounter(exiled.getId()) - 1) {
if (exiled instanceof PermanentMeld) {
MeldCard meldCard = (MeldCard) ((PermanentCard) exiled).getCard();
Card topCard = meldCard.getTopHalfCard();
Card bottomCard = meldCard.getBottomHalfCard();
if (topCard.getZoneChangeCounter(game) == meldCard.getTopLastZoneChangeCounter()) {
cardsToReturn.add(topCard);
}
if (bottomCard.getZoneChangeCounter(game) == meldCard.getBottomLastZoneChangeCounter()) {
cardsToReturn.add(bottomCard);
}
}
else if (exiled.getZoneChangeCounter(game) == game.getState().getZoneChangeCounter(exiled.getId()) - 1) {
cardsToReturn.add(exiled);
}
}

View file

@ -29,24 +29,16 @@ package mage.sets.bornofthegods;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
import mage.abilities.effects.PayCostToAttackBlockEffectImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.combat.CantAttackBlockUnlessPaysSourceEffect;
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.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
/**
@ -84,53 +76,3 @@ public class FloodtideSerpent extends CardImpl {
return new FloodtideSerpent(this);
}
}
class FloodtideSerpentReplacementEffect extends ReplacementEffectImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an enchantment you control");
static {
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
FloodtideSerpentReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Neutral);
staticText = "{this} can't attack unless you return an enchantment you control to its owner's hand <i>(This cost is paid as attackers are declared.)</i>";
}
FloodtideSerpentReplacementEffect(FloodtideSerpentReplacementEffect effect) {
super(effect);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player player = game.getPlayer(event.getPlayerId());
if (player != null) {
ReturnToHandChosenControlledPermanentCost attackCost = new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter));
if (attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game)
&& player.chooseUse(Outcome.Neutral, "Return an enchantment you control to hand to attack?", source, game)) {
if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true, null)) {
return false;
}
}
return true;
}
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == EventType.DECLARE_ATTACKER;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getSourceId().equals(source.getSourceId());
}
@Override
public FloodtideSerpentReplacementEffect copy() {
return new FloodtideSerpentReplacementEffect(this);
}
}

View file

@ -46,8 +46,6 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public class DanceOfShadows extends CardImpl {
static private FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control");
public DanceOfShadows (UUID ownerId) {
super(ownerId, 108, "Dance of Shadows", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
this.expansionSetCode = "CHK";
@ -55,12 +53,12 @@ public class DanceOfShadows extends CardImpl {
// Creatures you control get +1/+0 and gain fear until end of turn. (They can't be blocked except by artifact creatures and/or black creatures.)
Effect effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, filter);
Effect effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, new FilterCreaturePermanent());
effect.setText("Creatures you control get +1/+0");
this.getSpellAbility().addEffect(effect);
effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, filter);
effect = new GainAbilityControlledEffect(FearAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent());
effect.setText("and gain fear until end of turn");
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(FearAbility.getInstance(), Duration.EndOfTurn, filter));
this.getSpellAbility().addEffect(effect);
}
public DanceOfShadows (final DanceOfShadows card) {

View file

@ -0,0 +1,88 @@
/*
* 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.chronicles;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.OpponentControlsPermanentCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
/**
*
* @author nigelzor
*/
public class BeastsOfBogardan extends CardImpl {
private static final FilterCard protectionFilter = new FilterCard("red");
private static final FilterPermanent controlFilter = new FilterPermanent("nontoken white permanent");
static {
protectionFilter.add(new ColorPredicate(ObjectColor.RED));
controlFilter.add(new ColorPredicate(ObjectColor.WHITE));
controlFilter.add(Predicates.not(new TokenPredicate()));
}
public BeastsOfBogardan(UUID ownerId) {
super(ownerId, 45, "Beasts of Bogardan", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}");
this.expansionSetCode = "CHR";
this.subtype.add("Beast");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Protection from red
this.addAbility(new ProtectionAbility(protectionFilter));
// Beasts of Bogardan gets +1/+1 as long as an opponent controls a nontoken white permanent.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield),
new OpponentControlsPermanentCondition(controlFilter),
"{this} gets +1/+1 as long as an opponent controls a nontoken white permanent")));
}
public BeastsOfBogardan(final BeastsOfBogardan card) {
super(card);
}
@Override
public BeastsOfBogardan copy() {
return new BeastsOfBogardan(this);
}
}

View file

@ -34,21 +34,21 @@ import mage.constants.Rarity;
*
* @author LevelX2
*/
public class UrzasMine extends mage.sets.fifthedition.UrzasMine {
public class UrzasMine1 extends mage.sets.fifthedition.UrzasMine {
public UrzasMine(UUID ownerId) {
public UrzasMine1(UUID ownerId) {
super(ownerId);
this.cardNumber = 94;
this.expansionSetCode = "CHR";
this.rarity = Rarity.UNCOMMON;
}
public UrzasMine(final UrzasMine card) {
public UrzasMine1(final UrzasMine1 card) {
super(card);
}
@Override
public UrzasMine copy() {
return new UrzasMine(this);
public UrzasMine1 copy() {
return new UrzasMine1(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasMine2 extends UrzasMine1 {
public UrzasMine2(UUID ownerId) {
super(ownerId);
this.cardNumber = 95;
}
public UrzasMine2(final UrzasMine2 card) {
super(card);
}
@Override
public UrzasMine2 copy() {
return new UrzasMine2(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasMine3 extends UrzasMine1 {
public UrzasMine3(UUID ownerId) {
super(ownerId);
this.cardNumber = 96;
}
public UrzasMine3(final UrzasMine3 card) {
super(card);
}
@Override
public UrzasMine3 copy() {
return new UrzasMine3(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasMine4 extends UrzasMine1 {
public UrzasMine4(UUID ownerId) {
super(ownerId);
this.cardNumber = 97;
}
public UrzasMine4(final UrzasMine4 card) {
super(card);
}
@Override
public UrzasMine4 copy() {
return new UrzasMine4(this);
}
}

View file

@ -34,21 +34,21 @@ import mage.constants.Rarity;
*
* @author LevelX2
*/
public class UrzasPowerPlant extends mage.sets.fifthedition.UrzasPowerPlant {
public class UrzasPowerPlant1 extends mage.sets.fifthedition.UrzasPowerPlant {
public UrzasPowerPlant(UUID ownerId) {
public UrzasPowerPlant1(UUID ownerId) {
super(ownerId);
this.cardNumber = 98;
this.expansionSetCode = "CHR";
this.rarity = Rarity.UNCOMMON;
}
public UrzasPowerPlant(final UrzasPowerPlant card) {
public UrzasPowerPlant1(final UrzasPowerPlant1 card) {
super(card);
}
@Override
public UrzasPowerPlant copy() {
return new UrzasPowerPlant(this);
public UrzasPowerPlant1 copy() {
return new UrzasPowerPlant1(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasPowerPlant2 extends UrzasPowerPlant1 {
public UrzasPowerPlant2(UUID ownerId) {
super(ownerId);
this.cardNumber = 99;
}
public UrzasPowerPlant2(final UrzasPowerPlant2 card) {
super(card);
}
@Override
public UrzasPowerPlant2 copy() {
return new UrzasPowerPlant2(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasPowerPlant3 extends UrzasPowerPlant1 {
public UrzasPowerPlant3(UUID ownerId) {
super(ownerId);
this.cardNumber = 100;
}
public UrzasPowerPlant3(final UrzasPowerPlant3 card) {
super(card);
}
@Override
public UrzasPowerPlant3 copy() {
return new UrzasPowerPlant3(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasPowerPlant4 extends UrzasPowerPlant1 {
public UrzasPowerPlant4(UUID ownerId) {
super(ownerId);
this.cardNumber = 101;
}
public UrzasPowerPlant4(final UrzasPowerPlant4 card) {
super(card);
}
@Override
public UrzasPowerPlant4 copy() {
return new UrzasPowerPlant4(this);
}
}

View file

@ -34,21 +34,21 @@ import mage.constants.Rarity;
*
* @author LevelX2
*/
public class UrzasTower extends mage.sets.fifthedition.UrzasTower {
public class UrzasTower1 extends mage.sets.fifthedition.UrzasTower {
public UrzasTower(UUID ownerId) {
public UrzasTower1(UUID ownerId) {
super(ownerId);
this.cardNumber = 102;
this.expansionSetCode = "CHR";
this.rarity = Rarity.UNCOMMON;
}
public UrzasTower(final UrzasTower card) {
public UrzasTower1(final UrzasTower1 card) {
super(card);
}
@Override
public UrzasTower copy() {
return new UrzasTower(this);
public UrzasTower1 copy() {
return new UrzasTower1(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasTower2 extends UrzasTower1 {
public UrzasTower2(UUID ownerId) {
super(ownerId);
this.cardNumber = 103;
}
public UrzasTower2(final UrzasTower2 card) {
super(card);
}
@Override
public UrzasTower2 copy() {
return new UrzasTower2(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasTower3 extends UrzasTower1 {
public UrzasTower3(UUID ownerId) {
super(ownerId);
this.cardNumber = 104;
}
public UrzasTower3(final UrzasTower3 card) {
super(card);
}
@Override
public UrzasTower3 copy() {
return new UrzasTower3(this);
}
}

View file

@ -0,0 +1,51 @@
/*
* 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.chronicles;
import java.util.UUID;
/**
*
* @author fwannmacher
*/
public class UrzasTower4 extends UrzasTower1 {
public UrzasTower4(UUID ownerId) {
super(ownerId);
this.cardNumber = 105;
}
public UrzasTower4(final UrzasTower4 card) {
super(card);
}
@Override
public UrzasTower4 copy() {
return new UrzasTower4(this);
}
}

View file

@ -32,8 +32,8 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -50,7 +50,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/
public class LovisaColdeyes extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control that's a Barbarian, a Warrior, or a Berserker");
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that's a Barbarian, a Warrior, or a Berserker");
static {
filter.add(Predicates.or(new SubtypePredicate("Barbarian"), new SubtypePredicate("Warrior"), new SubtypePredicate("Berserker")));
@ -64,11 +64,11 @@ public class LovisaColdeyes extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Each creature you control that's a Barbarian, a Warrior, or a Berserker gets +2/+2 and has haste.
Effect effect = new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter, false);
effect.setText("Each creature you control that's a Barbarian, a Warrior, or a Berserker gets +2/+2");
// Each creature that's a Barbarian, a Warrior, or a Berserker gets +2/+2 and has haste.
Effect effect = new BoostAllEffect(2, 2, Duration.WhileOnBattlefield, filter, false);
effect.setText("Each creature that's a Barbarian, a Warrior, or a Berserker gets +2/+2");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
effect = new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
effect = new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
effect.setText("and has haste");
ability.addEffect(effect);
this.addAbility(ability);

View file

@ -69,7 +69,7 @@ public class CrosissCharm extends CardImpl {
this.getSpellAbility().addMode(mode);
// or destroy target artifact.
mode = new Mode();
mode.getEffects().add(new DestroyTargetEffect(true));
mode.getEffects().add(new DestroyTargetEffect());
Target target = new TargetArtifactPermanent();
mode.getTargets().add(target);
this.getSpellAbility().addMode(mode);

View file

@ -102,6 +102,7 @@ class DaxosSpiritToken extends Token {
DaxosSpiritToken() {
super("Spirit", "white and black Spirit enchantment creature token with \"This creature's power and toughness are each equal to the number of experience counters you have.\"");
this.setOriginalExpansionSetCode("C15");
setTokenType(2);
cardType.add(CardType.ENCHANTMENT);
cardType.add(CardType.CREATURE);
color.setWhite(true);

View file

@ -31,16 +31,15 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
@ -103,7 +102,7 @@ class CoercivePortalEffect extends OneShotEffect {
}
if (carnageCount > homageCount) {
new SacrificeSourceEffect().apply(game, source);
new CoercivePortalDestroyEffect().apply(game, source);
new DestroyAllEffect(new FilterNonlandPermanent()).apply(game, source);
} else {
controller.drawCards(1, game);
}
@ -112,31 +111,3 @@ class CoercivePortalEffect extends OneShotEffect {
return false;
}
}
class CoercivePortalDestroyEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterNonlandPermanent();
public CoercivePortalDestroyEffect() {
super(Outcome.DestroyPermanent);
staticText = "sacrifice Coercive Portal and destroy all nonland permanents";
}
public CoercivePortalDestroyEffect(final CoercivePortalDestroyEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
permanent.destroy(source.getSourceId(), game, false);
}
return true;
}
@Override
public CoercivePortalDestroyEffect copy() {
return new CoercivePortalDestroyEffect(this);
}
}

View file

@ -58,7 +58,7 @@ public class LostInTheWoods extends CardImpl {
// Whenever a creature attacks you or a planeswalker you control, reveal the top card of your library. If it's a Forest card, remove that creature from combat. Then put the revealed card on the bottom of your library.
this.addAbility(new AttacksAllTriggeredAbility(new LostInTheWoodsEffect(), true, new FilterCreaturePermanent(), SetTargetPointer.PERMANENT, true));
this.addAbility(new AttacksAllTriggeredAbility(new LostInTheWoodsEffect(), false, new FilterCreaturePermanent(), SetTargetPointer.PERMANENT, true));
}
public LostInTheWoods(final LostInTheWoods card) {

View file

@ -0,0 +1,213 @@
/*
* 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.darksteel;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.EquipAbility;
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.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetCard;
import mage.util.CardUtil;
import org.apache.log4j.Logger;
/**
*
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/
public class Spellbinder extends CardImpl {
public Spellbinder(UUID ownerId) {
super(ownerId, 143, "Spellbinder", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "DST";
this.subtype.add("Equipment");
// Imprint - When Spellbinder enters the battlefield, you may exile an instant card from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SpellbinderImprintEffect(), true, "<i>Imprint &mdash; </i>"));
// Whenever equipped creature deals combat damage to a player, you may copy the exiled card. If you do, you may cast the copy without paying its mana cost.
this.addAbility(new SpellbinderTriggeredAbility());
// Equip {4}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(4)));
}
public Spellbinder(final Spellbinder card) {
super(card);
}
@Override
public Spellbinder copy() {
return new Spellbinder(this);
}
}
class SpellbinderTriggeredAbility extends TriggeredAbilityImpl {
SpellbinderTriggeredAbility() {
super(Zone.BATTLEFIELD, new SpellbinderCopyEffect(), true);
}
SpellbinderTriggeredAbility(final SpellbinderTriggeredAbility ability) {
super(ability);
}
@Override
public SpellbinderTriggeredAbility copy() {
return new SpellbinderTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
Permanent p = game.getPermanent(event.getSourceId());
return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId());
}
@Override
public String getRule() {
return "Whenever equipped creature deals combat damage to a player, you may copy the exiled card. If you do, you may cast the copy without paying its mana cost.";
}
}
class SpellbinderImprintEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("instant card");
static {
filter.add(new CardTypePredicate(CardType.INSTANT));
}
public SpellbinderImprintEffect() {
super(Outcome.Benefit);
staticText = "you may exile an instant card from your hand";
}
public SpellbinderImprintEffect(SpellbinderImprintEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null) {
if (controller.getHand().size() > 0) {
TargetCard target = new TargetCard(Zone.HAND, filter);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
&& controller.choose(Outcome.Benefit, controller.getHand(), target, game)) {
Card card = controller.getHand().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getIdName() + " (Imprint)", source.getSourceId(), game, Zone.HAND, true);
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.imprint(card.getId(), game);
permanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + card.getLogName() + "]"), game);
}
}
}
}
return true;
}
return false;
}
@Override
public SpellbinderImprintEffect copy() {
return new SpellbinderImprintEffect(this);
}
}
class SpellbinderCopyEffect extends OneShotEffect {
public SpellbinderCopyEffect() {
super(Outcome.Copy);
this.staticText = "You may copy the exiled card. If you do, you may cast the copy without paying its mana cost";
}
public SpellbinderCopyEffect(final SpellbinderCopyEffect effect) {
super(effect);
}
@Override
public SpellbinderCopyEffect copy() {
return new SpellbinderCopyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent spellbinder = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (spellbinder != null && spellbinder.getImprinted() != null && !spellbinder.getImprinted().isEmpty()) {
Card imprintedInstant = game.getCard(spellbinder.getImprinted().get(0));
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()).equals(Zone.EXILED)) {
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append("?").toString(), source, game)) {
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
if (copiedCard != null) {
game.getExile().add(source.getSourceId(), "", copiedCard);
game.getState().setZone(copiedCard.getId(), Zone.EXILED);
if (controller.chooseUse(outcome, "Cast the copied card without paying mana cost?", source, game)) {
if (copiedCard.getSpellAbility() != null) {
controller.cast(copiedCard.getSpellAbility(), game, true);
} else {
Logger.getLogger(SpellbinderCopyEffect.class).error("Spellbinder: spell ability == null " + copiedCard.getName());
}
}
}
}
}
}
return true;
}
return false;
}
}

View file

@ -170,7 +170,7 @@ class DevelopmentEffect extends OneShotEffect {
boolean putToken = true;
for (UUID opponentUuid : opponents) {
Player opponent = game.getPlayer(opponentUuid);
if (opponent != null && opponent.chooseUse(Outcome.Detriment,
if (opponent != null && opponent.chooseUse(Outcome.Detriment,
"Allow " + player.getLogName() + " to draw a card instead? (" + Integer.toString(i+1) + ")", source, game)) {
game.informPlayers(opponent.getLogName() + " had chosen to let " + player.getLogName() + " draw a card.");
player.drawCards(1, game);
@ -179,7 +179,7 @@ class DevelopmentEffect extends OneShotEffect {
}
}
if (putToken) {
new CreateTokenEffect(new ElementalToken()).apply(game, source);
new CreateTokenEffect(new ElementalToken("DIS", 1)).apply(game, source);
}
}

View file

@ -42,7 +42,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
@ -72,7 +72,7 @@ public class DragonlordKolaghan extends CardImpl {
// Other creatures you control have haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent(), true)));
new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true)));
// Whenever an opponent casts a creature or planeswalker spell with the same name as a card in their graveyard, that player loses 10 life.
Effect effect = new LoseLifeTargetEffect(10);

View file

@ -29,12 +29,15 @@ package mage.sets.dragonsoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.AttackingCreatureCount;
import mage.abilities.dynamicvalue.common.AttackingFilterCreatureCount;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
@ -66,7 +69,12 @@ public class FoulTongueShriek extends CardImpl {
}
class FoulTongueShriekEffect extends OneShotEffect {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
public FoulTongueShriekEffect() {
super(Outcome.Benefit);
this.staticText = "Target opponent loses 1 life for each attacking creature you control. You gain that much life";
@ -86,7 +94,7 @@ class FoulTongueShriekEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
Player targetOpponent = game.getPlayer(getTargetPointer().getFirst(game, source));
if (controller != null && targetOpponent != null) {
int amount = new AttackingCreatureCount().calculate(game, source, this);
int amount = new AttackingFilterCreatureCount(filter).calculate(game, source, this);
if (amount > 0) {
targetOpponent.loseLife(amount, game);
controller.gainLife(amount, game);

View file

@ -34,7 +34,7 @@ import mage.abilities.keyword.MadnessAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetCreaturePermanent;
/**
*
@ -48,7 +48,8 @@ public class AlchemistsGreeting extends CardImpl {
// Alchemist's Greeting deals 4 damage to target creature.
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// Madness {1}{R}
this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{1}{R}")));
}

View file

@ -1,87 +1,103 @@
/*
* 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.eldritchmoon;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.GainLifeTargetEffect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.keyword.EscalateAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterAttackingCreature;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
/**
*
* @author emerald000
*/
public class BlessedAlliance extends CardImpl {
public BlessedAlliance(UUID ownerId) {
super(ownerId, 13, "Blessed Alliance", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
this.expansionSetCode = "EMN";
// Escalate {2}
this.addAbility(new EscalateAbility(new GenericManaCost(2)));
// Choose one or more
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(3);
// Target player gains 4 life.
this.getSpellAbility().addEffect(new GainLifeTargetEffect(4));
this.getSpellAbility().addTarget(new TargetPlayer());
// Untap up to two target creatures.
Mode mode = new Mode();
mode.getEffects().add(new UntapTargetEffect());
mode.getTargets().add(new TargetCreaturePermanent(0, 2));
this.getSpellAbility().addMode(mode);
// Target opponent sacrifices an attacking creature.
mode = new Mode();
mode.getEffects().add(new SacrificeEffect(new FilterAttackingCreature(), 1, "Target player"));
mode.getTargets().add(new TargetOpponent());
this.getSpellAbility().addMode(mode);
}
public BlessedAlliance(final BlessedAlliance card) {
super(card);
}
@Override
public BlessedAlliance copy() {
return new BlessedAlliance(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeTargetEffect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.keyword.EscalateAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.FilterPlayer;
import mage.filter.common.FilterAttackingCreature;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.PlayerPredicate;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author emerald000
*/
public class BlessedAlliance extends CardImpl {
private static final FilterPlayer filterSacrifice = new FilterPlayer("opponent to sacrifice an attacking creature");
private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creatures to untap");
private static final FilterPlayer filterGainLife = new FilterPlayer("player to gain life");
static {
filterSacrifice.add(new PlayerPredicate(TargetController.OPPONENT));
}
public BlessedAlliance(UUID ownerId) {
super(ownerId, 13, "Blessed Alliance", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
this.expansionSetCode = "EMN";
// Escalate {2}
this.addAbility(new EscalateAbility(new GenericManaCost(2)));
// Choose one or more
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(3);
// Target player gains 4 life.
Effect effect = new GainLifeTargetEffect(4);
effect.setText("Target player gains 4 life");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterGainLife));
// Untap up to two target creatures.
Mode mode = new Mode();
effect = new UntapTargetEffect();
effect.setText("Untap up to two target creatures");
mode.getEffects().add(effect);
mode.getTargets().add(new TargetCreaturePermanent(0, 2, filterCreature, false));
this.getSpellAbility().addMode(mode);
// Target opponent sacrifices an attacking creature.
mode = new Mode();
mode.getEffects().add(new SacrificeEffect(new FilterAttackingCreature(), 1, "Target opponent"));
mode.getTargets().add(new TargetPlayer(1, 1, false, filterSacrifice));
this.getSpellAbility().addMode(mode);
}
public BlessedAlliance(final BlessedAlliance card) {
super(card);
}
@Override
public BlessedAlliance copy() {
return new BlessedAlliance(this);
}
}

View file

@ -30,7 +30,8 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.EscalateAbility;
import mage.abilities.keyword.FirstStrikeAbility;
@ -38,6 +39,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
/**
@ -46,24 +48,32 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class BorrowedHostility extends CardImpl {
private static final FilterCreaturePermanent filterBoost = new FilterCreaturePermanent("creature to get +3/+0");
private static final FilterCreaturePermanent filterFirstStrike = new FilterCreaturePermanent("creature to gain first strike");
public BorrowedHostility(UUID ownerId) {
super(ownerId, 121, "Borrowed Hostility", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "EMN";
// Escalate {3}
this.addAbility(new EscalateAbility(new ManaCostsImpl<>("{3}")));
// Choose one or both &mdash;
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(2);
// Target creature gets +3/+0 until end of turn.;
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new BoostControlledEffect(3, 0, Duration.EndOfTurn));
Effect effect = new BoostTargetEffect(3, 0, Duration.EndOfTurn);
effect.setText("Target creature gets +3/+0 until end of turn");
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterBoost));
this.getSpellAbility().addEffect(effect);
// Target creature gains first strike until end of turn.
Mode mode = new Mode();
mode.getEffects().add(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn));
mode.getTargets().add(new TargetCreaturePermanent());
effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
effect.setText("Target creature gains first strike until end of turn");
mode.getEffects().add(effect);
mode.getTargets().add(new TargetCreaturePermanent(filterFirstStrike));
this.getSpellAbility().addMode(mode);
}

View file

@ -37,7 +37,7 @@ import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.MeldCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
@ -52,7 +52,7 @@ import mage.game.stack.Spell;
*
* @author LevelX2
*/
public class BriselaVoiceOfNightmares extends CardImpl {
public class BriselaVoiceOfNightmares extends MeldCard {
public BriselaVoiceOfNightmares(UUID ownerId) {
super(ownerId, 15, "Brisela, Voice of Nightmares", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "");
@ -67,12 +67,16 @@ public class BriselaVoiceOfNightmares extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
// Your opponents can't cast spells with converted mana cost 3 or less.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BriselaVoiceOfNightmaresCantCastEffect()));
}

View file

@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CastSourceTriggeredAbility;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
@ -70,7 +71,9 @@ public class BrunaTheFadingLight extends CardImpl {
this.toughness = new MageInt(7);
// When you cast Bruna, the Fading Light, you may return target Angel or Human creature card from your graveyard to the battlefield.
Ability ability = new CastSourceTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), true);
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
effect.setText("you may return target Angel or Human creature card from your graveyard to the battlefield");
Ability ability = new CastSourceTriggeredAbility(effect, true);
ability.addTarget(new TargetCardInYourGraveyard(filter));
this.addAbility(ability);

View file

@ -53,7 +53,7 @@ public class CemeteryRecruitment extends CardImpl {
// Return target creature card from your graveyard to your hand. If it's a Zombie card, draw a card.
this.getSpellAbility().addEffect(new CemeteryRecruitmentEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 1, new FilterCreatureCard("creature card from your graveyard")));
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
}
public CemeteryRecruitment(final CemeteryRecruitment card) {

View file

@ -68,7 +68,7 @@ class CertainDeathEffect extends OneShotEffect {
public CertainDeathEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Destroy target creature. Its controler loses 2 life and you gain 2 life";
this.staticText = "Destroy target creature. Its controller loses 2 life and you gain 2 life";
}
public CertainDeathEffect(final CertainDeathEffect effect) {

View file

@ -36,7 +36,7 @@ import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
import mage.cards.MeldCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
@ -46,7 +46,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
*
* @author LevelX2
*/
public class ChitteringHost extends CardImpl {
public class ChitteringHost extends MeldCard {
public ChitteringHost(UUID ownerId) {
super(ownerId, 96, "Chittering Host", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "");
@ -57,18 +57,21 @@ public class ChitteringHost extends CardImpl {
this.toughness = new MageInt(6);
this.nightCard = true; // Meld card
// Haste
this.addAbility(HasteAbility.getInstance());
// Menace <i>(This creature can't be blocked except by two or more creatures.
this.addAbility(new MenaceAbility());
// When Chittering Host enters the battlefield, other creatures you control get +1/+0 and gain menace until end of turn.
Effect effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, true);
effect.setText("other creatures you control get +1/+0");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
effect = new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("other creatures"), true);
effect.setText("and gain menace until end of turn");
ability.addEffect(effect);
this.addAbility(ability);
}
public ChitteringHost(final ChitteringHost card) {

View file

@ -28,17 +28,22 @@
package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -66,7 +71,7 @@ public class ClearShot extends CardImpl {
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addEffect(effect);
effect = new DamageTargetEffect(new TargetPermanentPowerCount(), true, "target creature you don't control", true);
effect = new ClearShotDamageEffect();
effect.setText("It deals damage equal to its power to target creature you don't control");
effect.setTargetPointer(new SecondTargetPointer());
this.getSpellAbility().addEffect(effect);
@ -83,3 +88,34 @@ public class ClearShot extends CardImpl {
return new ClearShot(this);
}
}
class ClearShotDamageEffect extends OneShotEffect {
public ClearShotDamageEffect() {
super(Outcome.Damage);
this.staticText = "It deals damage equal to its power to target creature you don't control";
}
public ClearShotDamageEffect(final ClearShotDamageEffect effect) {
super(effect);
}
@Override
public ClearShotDamageEffect copy() {
return new ClearShotDamageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent ownCreature = game.getPermanent(source.getFirstTarget());
if (ownCreature != null) {
int damage = ownCreature.getPower().getValue();
Permanent targetCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (targetCreature != null) {
targetCreature.damage(damage, ownCreature.getId(), game, false, true);
return true;
}
}
return false;
}
}

View file

@ -30,6 +30,7 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@ -77,7 +78,9 @@ public class CollectiveEffort extends CardImpl {
this.expansionSetCode = "EMN";
// Escalate &mdash; Tap an untapped creature you control.
this.addAbility(new EscalateAbility(new TapTargetCost(new TargetControlledCreaturePermanent(filterUntapped))));
Cost cost = new TapTargetCost(new TargetControlledCreaturePermanent(filterUntapped));
cost.setText("&mdash; Tap an untapped creature you control");
this.addAbility(new EscalateAbility(cost));
// Choose one or more &mdash;
this.getSpellAbility().getModes().setMinModes(1);

View file

@ -45,7 +45,6 @@ public class ContingencyPlan extends CardImpl {
public ContingencyPlan(UUID ownerId) {
super(ownerId, 52, "Contingency Plan", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}");
this.expansionSetCode = "EMN";
this.supertype.add("SOrcery");
// Look at the top five cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(5),

View file

@ -34,7 +34,6 @@ import mage.abilities.condition.common.DeliriumCondition;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
@ -44,7 +43,7 @@ import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.events.GameEvent;
import mage.target.common.TargetCardInGraveyard;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
@ -69,12 +68,13 @@ public class CropSigil extends CardImpl {
// <i>Delirium</i> &mdash; {2}{G}, Sacrifice Crop Sigil: Return up to one target creature card and up to one target land card from your graveyard to your hand.
// Activate this ability only if there are four or more card types among cards in your graveyard.
Effect effect = new ReturnToHandTargetEffect(true, true);
effect.setText("Return up to one target creature card and up to one target land card from your graveyard to your hand");
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{2}{G}"), DeliriumCondition.getInstance());
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(true, true), new ManaCostsImpl<>("{2}{G}"),
DeliriumCondition.getInstance(),
"<i>Delirium</i> &mdash; {2}{G}, Sacrifice {this}: Return up to one target creature card and up to one target land card from your graveyard to your hand. "
+ "Activate this ability only if there are four or more card types among cards in your graveyard");
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCardInGraveyard(0, 1, filterCreature));
ability.addTarget(new TargetCardInGraveyard(0, 1, filterLand));
ability.addTarget(new TargetCardInYourGraveyard(0, 1, filterCreature));
ability.addTarget(new TargetCardInYourGraveyard(0, 1, filterLand));
this.addAbility(ability);
}

View file

@ -77,8 +77,10 @@ public class Cryptbreaker extends CardImpl {
this.addAbility(ability);
// Tap three untapped Zombies you control: You draw a card and you lose 1 life.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new TapTargetCost(new TargetControlledCreaturePermanent(3, 3, filter, true)));
Effect effect = new LoseLifeSourceControllerEffect(1);
Effect effect = new DrawCardSourceControllerEffect(1);
effect.setText("You draw a card");
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapTargetCost(new TargetControlledCreaturePermanent(3, 3, filter, true)));
effect = new LoseLifeSourceControllerEffect(1);
effect.setText("and you lose 1 life");
ability.addEffect(effect);
this.addAbility(ability);

View file

@ -41,8 +41,8 @@ import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.ZombieToken;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
@ -62,9 +62,9 @@ public class DarkSalvation extends CardImpl {
Effect effect = new CreateTokenTargetEffect(new ZombieToken(), new ManacostVariableValue());
effect.setText("Target player puts X 2/2 black Zombie creature tokens onto the battlefield");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false));
DynamicValue value = new ZombiesControlledByTargetPlayerCount();
DynamicValue value = new ZombiesControlledByTargetCreaturesControllerCount();
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false));
effect = new BoostTargetEffect(value, value, Duration.EndOfTurn, true);
effect.setTargetPointer(new SecondTargetPointer());
effect.setText(", then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls");
@ -81,7 +81,7 @@ public class DarkSalvation extends CardImpl {
}
}
class ZombiesControlledByTargetCreaturesControllerCount implements DynamicValue {
class ZombiesControlledByTargetPlayerCount implements DynamicValue {
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombies");
@ -90,15 +90,15 @@ class ZombiesControlledByTargetCreaturesControllerCount implements DynamicValue
}
@Override
public ZombiesControlledByTargetCreaturesControllerCount copy() {
return new ZombiesControlledByTargetCreaturesControllerCount();
public ZombiesControlledByTargetPlayerCount copy() {
return new ZombiesControlledByTargetPlayerCount();
}
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Permanent targetCreature = game.getPermanent(effect.getTargetPointer().getFirst(game, sourceAbility));
if (targetCreature != null) {
int value = game.getBattlefield().countAll(filter, targetCreature.getControllerId(), game);
Player player = game.getPlayer(sourceAbility.getTargets().get(0).getFirstTarget());
if (player != null) {
int value = game.getBattlefield().countAll(filter, player.getId(), game);
return -1 * value;
} else {
return 0;

View file

@ -59,7 +59,6 @@ public class DistemperOfTheBlood extends CardImpl {
effect.setText("and gains trample until end of turn");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
// Madness {R}
this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{R}")));

View file

@ -58,7 +58,7 @@ import mage.players.Player;
*/
public class DocentOfPerfection extends CardImpl {
private static final FilterSpell filterSpell = new FilterSpell("instant or sorcery spell");
private static final FilterSpell filterSpell = new FilterSpell("an instant or sorcery spell");
static {
filterSpell.add(Predicates.or(

View file

@ -56,7 +56,8 @@ public class DrogskolShieldmate extends CardImpl {
this.addAbility(FlashAbility.getInstance());
// When Drogskol Shieldmate enters the battlefield, other creatures you control get +0/+1 until end of turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new BoostControlledEffect(0, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), true), false));
this.addAbility(new EntersBattlefieldTriggeredAbility(
new BoostControlledEffect(0, 1, Duration.EndOfTurn, new FilterCreaturePermanent("creatures"), true), false));
}
public DrogskolShieldmate(final DrogskolShieldmate card) {

View file

@ -62,6 +62,7 @@ public class DuskFeaster extends CardImpl {
// <i>Delirium</i> &mdash; Dusk Feaster costs {2} less to cast if there are four or more card types among cards in your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.STACK, new DuskFeasterCostReductionEffect()));
// Flying
this.addAbility(FlyingAbility.getInstance());
}
@ -80,7 +81,7 @@ class DuskFeasterCostReductionEffect extends CostModificationEffectImpl {
DuskFeasterCostReductionEffect() {
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
staticText = "{this} costs {2} less to cast if there are four or more card types among cards in your graveyard";
staticText = "<i>Delirium</i> &mdash; {this} costs {2} less to cast if there are four or more card types among cards in your graveyard";
}
DuskFeasterCostReductionEffect(final DuskFeasterCostReductionEffect effect) {
@ -105,7 +106,7 @@ class DuskFeasterCostReductionEffect extends CostModificationEffectImpl {
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
boolean hasDelirium = false;
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
@ -116,9 +117,9 @@ class DuskFeasterCostReductionEffect extends CostModificationEffectImpl {
int number = foundCardTypes.size();
hasDelirium = number > 3;
}
return abilityToModify.getSourceId().equals(source.getSourceId())
&& (abilityToModify instanceof SpellAbility)
return abilityToModify.getSourceId().equals(source.getSourceId())
&& (abilityToModify instanceof SpellAbility)
&& hasDelirium;
}

View file

@ -1,78 +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.eldritchmoon;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CastSourceTriggeredAbility;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.EmergeAbility;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.target.TargetPermanent;
/**
*
* @author emerald000
*/
public class ElderDeepFiend extends CardImpl {
public ElderDeepFiend(UUID ownerId) {
super(ownerId, 5, "Elder Deep-Fiend", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{8}");
this.expansionSetCode = "EMN";
this.subtype.add("Eldrazi");
this.subtype.add("Octopus");
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// Flash
this.addAbility(FlashAbility.getInstance());
// Emerge {5}{U}{U}
this.addAbility(new EmergeAbility(this, new ManaCostsImpl<>("{5}{U}{U}")));
// When you cast Elder Deep-Fiend, tap up to four target permanents.
Ability ability = new CastSourceTriggeredAbility(new TapTargetEffect());
ability.addTarget(new TargetPermanent(0, 4, new FilterPermanent("permanents to tap"), false));
this.addAbility(ability);
}
public ElderDeepFiend(final ElderDeepFiend card) {
super(card);
}
@Override
public ElderDeepFiend copy() {
return new ElderDeepFiend(this);
}
}
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CastSourceTriggeredAbility;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.EmergeAbility;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.target.TargetPermanent;
/**
*
* @author emerald000
*/
public class ElderDeepFiend extends CardImpl {
public ElderDeepFiend(UUID ownerId) {
super(ownerId, 5, "Elder Deep-Fiend", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{8}");
this.expansionSetCode = "EMN";
this.subtype.add("Eldrazi");
this.subtype.add("Octopus");
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// Flash
this.addAbility(FlashAbility.getInstance());
// Emerge {5}{U}{U}
this.addAbility(new EmergeAbility(this, new ManaCostsImpl<>("{5}{U}{U}")));
// When you cast Elder Deep-Fiend, tap up to four target permanents.
Ability ability = new CastSourceTriggeredAbility(new TapTargetEffect());
ability.addTarget(new TargetPermanent(0, 4, new FilterPermanent("permanent"), false));
this.addAbility(ability);
}
public ElderDeepFiend(final ElderDeepFiend card) {
super(card);
}
@Override
public ElderDeepFiend copy() {
return new ElderDeepFiend(this);
}
}

View file

@ -33,6 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -54,7 +55,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/
public class EmrakulsEvangel extends CardImpl {
public EmrakulsEvangel(UUID ownerId) {
super(ownerId, 156, "Emrakul's Evangel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "EMN";
@ -63,9 +64,11 @@ public class EmrakulsEvangel extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// {T}, Sacrifice Emrakul's Evangel and any number of other non-Eldrazi creatures:
// {T}, Sacrifice Emrakul's Evangel and any number of other non-Eldrazi creatures:
// Put a 3/2 colorless Eldrazi Horror creature token onto the battlefield for each creature sacrificed this way.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new EmrakulsEvangelEffect(), new EmrakulsEvangelCost()));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EmrakulsEvangelEffect(), new TapSourceCost());
ability.addCost(new EmrakulsEvangelCost());
this.addAbility(ability);
}
public EmrakulsEvangel(final EmrakulsEvangel card) {
@ -79,14 +82,14 @@ public class EmrakulsEvangel extends CardImpl {
}
class EmrakulsEvangelCost extends CostImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("non-Eldrazi creatures you control");
static {
filter.add(new AnotherPredicate());
filter.add(Predicates.not(new SubtypePredicate("Eldrazi")));
}
}
private int numSacrificed = 1; // always sacrifices self at least
public EmrakulsEvangelCost() {
@ -117,7 +120,7 @@ class EmrakulsEvangelCost extends CostImpl {
}
return paid;
}
public int getNumSacrificed() {
return numSacrificed;
}
@ -125,7 +128,7 @@ class EmrakulsEvangelCost extends CostImpl {
@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
Permanent permanent = game.getPermanent(sourceId);
return permanent != null && game.getPlayer(controllerId).canPaySacrificeCost(permanent, sourceId, controllerId, game);
}
@ -136,25 +139,25 @@ class EmrakulsEvangelCost extends CostImpl {
}
class EmrakulsEvangelEffect extends OneShotEffect {
EmrakulsEvangelEffect() {
super(Outcome.Sacrifice);
this.staticText = "Sacrifice {this} and any number of other non-Eldrazi creatures: Put a 3/2 colorless Eldrazi Horror creature token onto the battlefield for each creature sacrificed this way.";
this.staticText = "Put a 3/2 colorless Eldrazi Horror creature token onto the battlefield for each creature sacrificed this way.";
}
EmrakulsEvangelEffect(final EmrakulsEvangelEffect effect) {
super(effect);
}
@Override
public EmrakulsEvangelEffect copy() {
return new EmrakulsEvangelEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
if (player != null) {
int tokensToCreate = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof EmrakulsEvangelCost) {

View file

@ -57,7 +57,7 @@ import mage.filter.predicate.permanent.ControllerPredicate;
public class FinalIteration extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Wizards");
private static final FilterSpell filterSpell = new FilterSpell("instant or sorcery spell");
private static final FilterSpell filterSpell = new FilterSpell("an instant or sorcery spell");
static {
filter.add(new SubtypePredicate("Wizard"));
@ -82,7 +82,7 @@ public class FinalIteration extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Wizards you control get +2/+1 and have flying.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 1, Duration.WhileOnBattlefield, filter, true));
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 1, Duration.WhileOnBattlefield, filter, false));
Effect effect = new GainAbilityAllEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
effect.setText("and have flying");
ability.addEffect(effect);

View file

@ -93,7 +93,7 @@ class FortunesFavorEffect extends OneShotEffect {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && targetOpponent != null && sourceObject != null) {
Cards cards = new CardsImpl();
cards.addAll(controller.getLibrary().getTopCards(game, 1));
cards.addAll(controller.getLibrary().getTopCards(game, 4));
TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, new FilterCard("cards for the face-down pile"));
targetOpponent.choose(outcome, cards, target, game);
@ -101,7 +101,7 @@ class FortunesFavorEffect extends OneShotEffect {
faceDownPile.addAll(target.getTargets());
cards.removeAll(target.getTargets());
controller.revealCards(sourceObject.getIdName() + " - cards in face-up pile", cards, game);
game.informPlayers(targetOpponent.getLogName() + " puts " + faceDownPile.size() + "card(s) into the face-down pile");
game.informPlayers(targetOpponent.getLogName() + " puts " + faceDownPile.size() + " card(s) into the face-down pile");
MessageToClient message = new MessageToClient("Put the face-down pile into your hand?", "(If you say yes, the face-up pile goes to the graveyard.)");
if (controller.chooseUse(outcome, message, source, game)) {
controller.moveCards(faceDownPile, Zone.HAND, source, game);

View file

@ -60,7 +60,7 @@ public class FurybladeVampire extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// At the beginning of combat on your turn, you may discard a card. If you do, Furyblade Vampire gets +3/+0 until end of turn.
Ability ability = new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD,
new DoIfCostPaid(new BoostSourceEffect(3, 0, Duration.EndOfTurn), new DiscardCardCost(), "Discard a card to get {this} +3/+0 until end of turn?", true), TargetController.YOU, false, false);
new DoIfCostPaid(new BoostSourceEffect(3, 0, Duration.EndOfTurn), new DiscardCardCost(), "Discard a card for {this} to get +3/+0 until end of turn?", true), TargetController.YOU, false, false);
this.addAbility(ability);
}

View file

@ -32,6 +32,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardAllEffect;
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
import mage.abilities.mana.ColorlessManaAbility;
@ -56,7 +57,9 @@ public class GeierReachSanitarium extends CardImpl {
// {2}, {T}: Each player draws a card, then discards a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardAllEffect(1), new GenericManaCost(2));
ability.addEffect(new DiscardEachPlayerEffect());
Effect effect = new DiscardEachPlayerEffect();
effect.setText(", then discards a card");
ability.addEffect(effect);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}

View file

@ -29,15 +29,17 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.condition.common.MeldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.MeldEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.constants.TargetController;
/**
*
@ -56,12 +58,19 @@ public class GiselaTheBrokenBlade extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
// At the beginning of your end step, if you both own and control Gisela, the Broken Blade and a creature named Bruna, the Fading Light, exile them, then meld them into Brisela, Voice of Nightmares.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("Meld ability not implemeted yet.")));
this.addAbility(new ConditionalTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(new MeldEffect("Bruna, the Fading Light", new BriselaVoiceOfNightmares(ownerId)), TargetController.YOU, false),
new MeldCondition("Bruna, the Fading Light"),
"At the beginning of your end step, if you both own and control {this} and a creature named Bruna, the Fading Light, exile them, "
+ "then meld them into Brisela, Voice of Nightmares."));
}
public GiselaTheBrokenBlade(final GiselaTheBrokenBlade card) {

View file

@ -33,6 +33,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.MenaceAbility;
@ -52,7 +53,7 @@ import mage.target.common.TargetCardInYourGraveyard;
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/
public class GrafHarvest extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Zombies you control");
static {
@ -64,8 +65,10 @@ public class GrafHarvest extends CardImpl {
this.expansionSetCode = "EMN";
// Zombies you control have menace.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new MenaceAbility(), Duration.WhileOnBattlefield, filter)));
Effect effect = new GainAbilityAllEffect(new MenaceAbility(), Duration.WhileOnBattlefield, filter);
effect.setText("Zombies you control have menace. <i>(They can't be blocked except by two or more creatures.)</i>");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// {3}{B}, Exile a creature card from your graveyard: Put a 2/2 black Zombie creature token onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieToken()), new ManaCostsImpl("{3}{B}"));
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("a creature card from your graveyard"))));

View file

@ -29,16 +29,18 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.condition.common.MeldCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.MeldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.constants.TargetController;
/**
*
* @author LevelX2
* @author emerald000
*/
public class GrafRats extends CardImpl {
@ -50,7 +52,11 @@ public class GrafRats extends CardImpl {
this.toughness = new MageInt(1);
// At the beginning of combat on your turn, if you both own and control Graf Rats and a creature named Midnight Scavengers, exile them, then meld them into Chittering Host.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("Meld ability not implemeted yet.")));
this.addAbility(new ConditionalTriggeredAbility(
new BeginningOfCombatTriggeredAbility(new MeldEffect("Midnight Scavengers", new ChitteringHost(ownerId)), TargetController.YOU, false),
new MeldCondition("Midnight Scavengers"),
"At the beginning of combat on your turn, if you both own and control {this} and a creature named Midnight Scavengers, exile them, then meld them into Chittering Host."));
}
public GrafRats(final GrafRats card) {

View file

@ -66,7 +66,7 @@ public class GrimFlayer extends CardImpl {
// and the rest back on top of your library in any order.
Effect effect = new LookLibraryAndPickControllerEffect(
new StaticValue(3), false, new StaticValue(3), new FilterCard(), Zone.LIBRARY, true, false, true, Zone.GRAVEYARD, false);
effect.setText("look at the top three cards of your library. Put any number of them into your graveyard and the rest on top of your library in any order");
effect.setText("look at the top three cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order");
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(effect, false));
// <i>Delirium</i> &mdash; Grim Flayer gets +2/+2 as long as there are four or more card types among cards in your graveyard.

View file

@ -30,10 +30,11 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MeldCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.common.MeldEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.mana.ColorlessManaAbility;
@ -63,7 +64,11 @@ public class HanweirBattlements extends CardImpl {
this.addAbility(ability);
// {3}{R}{R},{T}: If you both own and control Hanweir Battlements and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("Meld ability not implemeted yet.")));
ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new MeldEffect("Hanweir Garrison", new HanweirTheWrithingTownship(ownerId)),
new ManaCostsImpl("{3}{R}{R}"), new MeldCondition("Hanweir Garrison"),
"{3}{R}{R}, {T}: If you both own and control {this} and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.");
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public HanweirBattlements(final HanweirBattlements card) {

View file

@ -33,7 +33,7 @@ import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.MeldCard;
import mage.constants.CardType;
import mage.constants.Rarity;
@ -41,7 +41,7 @@ import mage.constants.Rarity;
*
* @author LevelX2
*/
public class HanweirTheWrithingTownship extends CardImpl {
public class HanweirTheWrithingTownship extends MeldCard {
public HanweirTheWrithingTownship(UUID ownerId) {
super(ownerId, 130, "Hanweir, the Writhing Township", Rarity.RARE, new CardType[]{CardType.CREATURE}, "");
@ -56,8 +56,10 @@ public class HanweirTheWrithingTownship extends CardImpl {
// Trample
this.addAbility(TrampleAbility.getInstance());
// Haste
this.addAbility(HasteAbility.getInstance());
// Whenever Hanweir, the Writhing Township attacks, put two 3/2 colorless Eldrazi Horror creature tokens onto the battlefield tapped and attacking.
this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new EldraziHorrorToken(), 2, true, true), false));
}

View file

@ -127,7 +127,8 @@ class IdentityThiefEffect extends OneShotEffect {
public IdentityThiefEffect() {
super(Outcome.Detriment);
staticText = "you may exile another target nontoken creature. If you do, {this} becomes a copy of that creature until end of turn. Return that card to the battlefield under its owner's control at the beginning of the next end step";
staticText = "you may exile another target nontoken creature. If you do, {this} becomes a copy of that creature until end of turn. "
+ "Return the exiled card to the battlefield under its owner's control at the beginning of the next end step";
}
public IdentityThiefEffect(final IdentityThiefEffect effect) {

View file

@ -31,6 +31,7 @@ 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.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -46,7 +47,7 @@ import mage.target.common.TargetCardInYourGraveyard;
*/
public class IroncladSlayer extends CardImpl {
private final static FilterCard filter = new FilterCard("Aura or Equipment card");
private final static FilterCard filter = new FilterCard("Aura or Equipment card from your graveyard");
static {
filter.add(Predicates.or(new SubtypePredicate("Aura"), new SubtypePredicate("Equipment")));
@ -61,7 +62,9 @@ public class IroncladSlayer extends CardImpl {
this.toughness = new MageInt(2);
// When Ironclad Slayer enters the battlefield, you may return target Aura or Equipment card from your graveyard to your hand.
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true);
Effect effect = new ReturnToHandTargetEffect();
effect.setText("you may return target Aura or Equipment card from your graveyard to your hand");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, true);
ability.addTarget(new TargetCardInYourGraveyard(filter));
this.addAbility(ability);
}

View file

@ -54,7 +54,7 @@ import mage.target.common.TargetOpponent;
*/
public class IshkanahGrafwidow extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("each Spider you control");
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Spider you control");
static {
filter.add(new SubtypePredicate("Spider"));

View file

@ -53,7 +53,7 @@ public class KessigProwler extends CardImpl {
this.toughness = new MageInt(1);
this.canTransform = true;
this.secondSideCard = new SinousPredator(ownerId);
this.secondSideCard = new SinuousPredator(ownerId);
// {4}{G}: Transform Kessig Prowler.
this.addAbility(new TransformAbility());

View file

@ -30,9 +30,11 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.OnEventTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.IntCompareCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.LifelinkAbility;
@ -40,9 +42,8 @@ import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.common.PlayerGainedLifeWatcher;
/**
@ -51,6 +52,8 @@ import mage.watchers.common.PlayerGainedLifeWatcher;
*/
public class LoneRider extends CardImpl {
private static final String ruleText = "At the beginning of the end step, if you gained 3 or more life this turn, transform {this}";
public LoneRider(UUID ownerId) {
super(ownerId, 33, "Lone Rider", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.expansionSetCode = "EMN";
@ -70,8 +73,8 @@ public class LoneRider extends CardImpl {
// At the beginning of the end step, if you gained 3 or more life this turn, transform Lone Rider.
this.addAbility(new TransformAbility());
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), TargetController.ANY,
new YouGainedLifeCondition(Condition.ComparisonType.GreaterThan, 2), false), new PlayerGainedLifeWatcher());
TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new TransformSourceEffect(true));
this.addAbility(new ConditionalTriggeredAbility(triggered, new YouGainedLifeCondition(Condition.ComparisonType.GreaterThan, 2), ruleText), new PlayerGainedLifeWatcher());
}
public LoneRider(final LoneRider card) {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.MeldCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
@ -93,7 +94,7 @@ class LongRoadHomeEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getSourceId(), game)) {
if (permanent.moveToExile(source.getSourceId(), "Long Road Home", source.getSourceId(), game)) {
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
// only if permanent is in exile (tokens would be stop to exist)
if (exile != null && !exile.isEmpty()) {
@ -147,7 +148,14 @@ class LongRoadHomeReturnFromExileEffect extends OneShotEffect {
if (card != null && objectToReturn.refersTo(card, game)) {
Player owner = game.getPlayer(card.getOwnerId());
if (owner != null) {
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(objectToReturn), source);
if (card instanceof MeldCard) {
MeldCard meldCard = (MeldCard) card;
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(new MageObjectReference(meldCard.getTopHalfCard(), game)), source);
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(new MageObjectReference(meldCard.getBottomHalfCard(), game)), source);
}
else {
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(objectToReturn), source);
}
owner.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null);
}
}

View file

@ -32,15 +32,11 @@ import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
@ -64,8 +60,7 @@ public class MindsDilation extends CardImpl {
// Whenever an opponent casts his or her first spell each turn, that player exiles the top card of his or her library. If it's a nonland card,
// you may cast it without paying its mana cost.
Ability ability = new MindsDilationTriggeredAbility(new MindsDilationEffect(), false);
this.addAbility(ability, new SpellsCastWatcher());
this.addAbility(new MindsDilationTriggeredAbility(new MindsDilationEffect(), false), new SpellsCastWatcher());
}
public MindsDilation(final MindsDilation card) {
@ -113,7 +108,7 @@ class MindsDilationTriggeredAbility extends SpellCastOpponentTriggeredAbility {
@Override
public String getRule() {
return "Whenever an opponent casts his or her first spell each turn, that player exiles the top card of his or her library."
+ " If it's a nonland card, you may cast it without paying its mana cost";
+ " If it's a nonland card, you may cast it without paying its mana cost.";
}
}
@ -121,7 +116,7 @@ class MindsDilationEffect extends OneShotEffect {
MindsDilationEffect() {
super(Outcome.Benefit);
this.staticText = "that player exiles the top card of his or her library. If it's a nonland card, you may cast it without paying its mana cost.";
this.staticText = "that player exiles the top card of his or her library. If it's a nonland card, you may cast it without paying its mana cost";
}
MindsDilationEffect(final MindsDilationEffect effect) {
@ -140,12 +135,13 @@ class MindsDilationEffect extends OneShotEffect {
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
if (controller != null && sourceObject != null && opponent != null) {
if (opponent.getLibrary().size() > 0) {
Card card = opponent.getLibrary().removeFromTop(game);
if (card != null) {
opponent.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new MindsDilationCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);
Card card = opponent.getLibrary().getFromTop(game);
if (card != null && opponent.moveCards(card, Zone.EXILED, source, game)) {
if (!card.getCardType().contains(CardType.LAND)) {
if (controller.chooseUse(outcome, "Cast " + card.getLogName() + " without paying its mana cost from exile?", source, game)) {
controller.cast(card.getSpellAbility(), game, true);
}
}
}
}
return true;
@ -153,41 +149,3 @@ class MindsDilationEffect extends OneShotEffect {
return false;
}
}
class MindsDilationCastFromExileEffect extends AsThoughEffectImpl {
MindsDilationCastFromExileEffect() {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit);
staticText = "If it's a nonland card, you may cast it without paying its mana cost";
}
MindsDilationCastFromExileEffect(final MindsDilationCastFromExileEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public MindsDilationCastFromExileEffect copy() {
return new MindsDilationCastFromExileEffect(this);
}
@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
UUID targetId = getTargetPointer().getFirst(game, source);
Player controller = game.getPlayer(source.getControllerId());
if (targetId != null && controller != null) {
Card card = game.getCard(targetId);
if (card != null && !card.getCardType().contains(CardType.LAND) && game.getState().getZone(targetId) == Zone.EXILED) {
if (controller.chooseUse(outcome, "Cast " + card.getLogName() + "?", source, game)) {
controller.cast(card.getSpellAbility(), game, true);
}
return true;
}
}
return false;
}
}

View file

@ -108,7 +108,9 @@ class MirrorwingDragonCopyTriggeredAbility extends TriggeredAbilityImpl {
private boolean checkSpell(Spell spell, Game game) {
if (spell != null
&& (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {
boolean noTargets = true;
for (TargetAddress addr : TargetAddress.walk(spell)) {
noTargets = false;
Target targetInstance = addr.getTarget(spell);
for (UUID target : targetInstance.getTargets()) {
Permanent permanent = game.getPermanent(target);
@ -117,6 +119,9 @@ class MirrorwingDragonCopyTriggeredAbility extends TriggeredAbilityImpl {
}
}
}
if (noTargets) {
return false;
}
getEffects().get(0).setValue("triggeringSpell", spell);
return true;
}
@ -126,7 +131,7 @@ class MirrorwingDragonCopyTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever a player casts an instant or sorcery spell that targets only {this}, "
+ "that player copies that spell for each creature he or she controls that the spell could target. "
+ "that player copies that spell for each other creature he or she controls that the spell could target. "
+ "Each copy targets a different one of those creatures.";
}
}
@ -135,7 +140,7 @@ class MirrorwingDragonCopySpellEffect extends CopySpellForEachItCouldTargetEffec
public MirrorwingDragonCopySpellEffect() {
this(new FilterControlledCreaturePermanent());
this.staticText = "that player copies that spell for each creature he or she controls that the spell could target. Each copy targets a different one of those creatures.";
this.staticText = "that player copies that spell for each other creature he or she controls that the spell could target. Each copy targets a different one of those creatures.";
}
public MirrorwingDragonCopySpellEffect(MirrorwingDragonCopySpellEffect effect) {
@ -167,6 +172,17 @@ class MirrorwingDragonCopySpellEffect extends CopySpellForEachItCouldTargetEffec
@Override
protected void modifyCopy(Spell copy, Game game, Ability source) {
Spell spell = getSpell(game, source);
copy.setControllerId(spell.getControllerId());
}
@Override
protected boolean okUUIDToCopyFor(UUID potentialTarget, Game game, Ability source, Spell spell) {
Permanent permanent = game.getPermanent(potentialTarget);
if (permanent == null || !permanent.getControllerId().equals(spell.getControllerId())) {
return false;
}
return true;
}
@Override

View file

@ -60,8 +60,7 @@ public class NoosegrafMob extends CardImpl {
this.toughness = new MageInt(0);
// Noosegraf Mob enters the battlefield with five +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)),
"{this} enters the battlefield with five +1/+1 counters on it"));
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)), "with five +1/+1 counters on it"));
// Whenever a player casts a spell, remove a +1/+1 counter from Noosegraf Mob. If you do, put a 2/2 black Zombie creature token onto the battlefield.
this.addAbility(new SpellCastAllTriggeredAbility(new NoosegrafMobEffect(), false));

View file

@ -86,7 +86,7 @@ class PermeatingMassEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability ability) {
Permanent copyTo = game.getPermanent(getTargetPointer().getFirst(game, ability));
Permanent copyTo = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, ability));
if (copyTo != null) {
Permanent copyFrom = game.getPermanent(ability.getSourceId());
if (copyFrom != null) {

View file

@ -30,6 +30,7 @@ package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -52,7 +53,9 @@ public class PrimalDruid extends CardImpl {
this.toughness = new MageInt(3);
// When Primal Druid dies, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.
this.addAbility(new DiesTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true), true));
Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true);
effect.setText("you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library");
this.addAbility(new DiesTriggeredAbility(effect, true));
}

View file

@ -45,13 +45,13 @@ import mage.game.events.GameEvent.EventType;
*/
public class Providence extends CardImpl {
private static String abilityText = "at the beginning of your first upkeep, your life total becomes 26";
private static String abilityText = "at the beginning of the first upkeep, your life total becomes 26";
public Providence(UUID ownerId) {
super(ownerId, 37, "Providence", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{W}{W}");
this.expansionSetCode = "EMN";
// You may reveal this card from your opening hand. If you do, at the beginning of your first upkeep, your life total becomes 26.
// You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, your life total becomes 26.
Ability ability = new ChancellorAbility(new ProvidenceDelayedTriggeredAbility(), abilityText);
ability.setRuleAtTheTop(true);
this.addAbility(ability);
@ -87,7 +87,7 @@ class ProvidenceDelayedTriggeredAbility extends DelayedTriggeredAbility {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return game.getActivePlayerId().equals(controllerId);
return true;
}
@Override

View file

@ -28,8 +28,10 @@
package mage.sets.eldritchmoon;
import java.util.UUID;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -51,11 +53,16 @@ public class RuthlessDisposal extends CardImpl {
this.expansionSetCode = "EMN";
// As an additional cost to cast Ruthless Disposal, discard a card and sacrifice a creature.
this.getSpellAbility().addCost(new DiscardTargetCost(new TargetCardInHand(new FilterCard("card to discard"))));
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
this.getSpellAbility().addCost(new DiscardTargetCost(new TargetCardInHand(new FilterCard("a card"))));
Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent());
cost.setText("As an additional cost to cast {this}, sacrifice a creature");
this.getSpellAbility().addCost(cost);
// Two target creatures each get -13/-13 until end of turn.
Effect effect = new BoostTargetEffect(-13, -13, Duration.EndOfTurn);
effect.setText("Two target creatures each get -13/-13 until end of turn");
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
this.getSpellAbility().addEffect(new BoostTargetEffect(-13, -13, Duration.EndOfTurn));
this.getSpellAbility().addEffect(effect);
}

View file

@ -33,6 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.Mode;
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.DamageTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
@ -43,14 +44,16 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.FilterPlayer;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.PlayerPredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
/**
*
@ -58,6 +61,14 @@ import mage.target.common.TargetOpponent;
*/
public class SavageAlliance extends CardImpl {
private static final FilterPlayer filterPlayer = new FilterPlayer("player whose creatures gain trample");
private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature to deal 2 damage to");
private static final FilterPlayer filterOpponent = new FilterPlayer("opponent whose creatures get dealt damage");
static {
filterOpponent.add(new PlayerPredicate(TargetController.OPPONENT));
}
public SavageAlliance(UUID ownerId) {
super(ownerId, 140, "Savage Alliance", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{R}");
this.expansionSetCode = "EMN";
@ -71,18 +82,20 @@ public class SavageAlliance extends CardImpl {
// Creatures target player controls gain trample until end of turn.
this.getSpellAbility().addEffect(new SavageAllianceGainTrampleEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterPlayer));
// Savage Alliance deals 2 damage to target creature.;
Mode mode = new Mode();
mode.getEffects().add(new DamageTargetEffect(2));
mode.getTargets().add(new TargetCreaturePermanent());
Effect effect = new DamageTargetEffect(2);
effect.setText("{this} deals 2 damage to target creature");
mode.getEffects().add(effect);
mode.getTargets().add(new TargetCreaturePermanent(filterCreature));
this.getSpellAbility().addMode(mode);
// Savage Alliance deals 1 damage to each creature target opponent controls.
mode = new Mode();
mode.getEffects().add(new SavageAllianceDamageEffect());
mode.getTargets().add(new TargetOpponent());
mode.getTargets().add(new TargetPlayer(1, 1, false, filterOpponent));
this.getSpellAbility().addMode(mode);
}

View file

@ -48,9 +48,10 @@ import mage.filter.common.FilterControlledCreaturePermanent;
public class SelflessSpirit extends CardImpl {
public SelflessSpirit(UUID ownerId) {
super(ownerId, 40, "Selfless Soul", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}");
super(ownerId, 40, "Selfless Spirit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.expansionSetCode = "EMN";
this.subtype.add("Spirit");
this.subtype.add("Cleric");
this.power = new MageInt(2);
this.toughness = new MageInt(1);

View file

@ -49,7 +49,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class SigardianPriest extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Human sources");
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Human creature");
static {
filter.add(Predicates.not(new SubtypePredicate("Human")));

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