From 0230f8ed9b2be0830022bbac55f5fda3e360974c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Oct 2016 14:11:52 +0100 Subject: [PATCH] [C16] Added the cards with the undaunted keyword. --- Mage.Sets/src/mage/cards/c/CoastalBreach.java | 61 ++++++++ Mage.Sets/src/mage/cards/c/CurtainsCall.java | 63 ++++++++ .../src/mage/cards/d/DevastationTide.java | 48 +----- .../cards/d/DivergentTransformations.java | 140 ++++++++++++++++++ .../src/mage/cards/s/SeedsOfRenewal.java | 69 +++++++++ .../src/mage/cards/s/SublimeExhalation.java | 62 ++++++++ Mage.Sets/src/mage/sets/Commander2016.java | 5 + .../abilities/keyword/UndauntedAbility.java | 78 ++++++++++ Utils/keywords.txt | 1 + 9 files changed, 482 insertions(+), 45 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/c/CoastalBreach.java create mode 100644 Mage.Sets/src/mage/cards/c/CurtainsCall.java create mode 100644 Mage.Sets/src/mage/cards/d/DivergentTransformations.java create mode 100644 Mage.Sets/src/mage/cards/s/SeedsOfRenewal.java create mode 100644 Mage.Sets/src/mage/cards/s/SublimeExhalation.java create mode 100644 Mage/src/main/java/mage/abilities/keyword/UndauntedAbility.java diff --git a/Mage.Sets/src/mage/cards/c/CoastalBreach.java b/Mage.Sets/src/mage/cards/c/CoastalBreach.java new file mode 100644 index 0000000000..f2515fc231 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CoastalBreach.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; +import mage.abilities.keyword.UndauntedAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterNonlandPermanent; + +/** + * + * @author LevelX2 + */ +public class CoastalBreach extends CardImpl { + + public CoastalBreach(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{6}{U}"); + + // Undaunted + this.addAbility(new UndauntedAbility()); + // Return all nonland permanents to their owners' hands. + this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(new FilterNonlandPermanent())); + } + + public CoastalBreach(final CoastalBreach card) { + super(card); + } + + @Override + public CoastalBreach copy() { + return new CoastalBreach(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CurtainsCall.java b/Mage.Sets/src/mage/cards/c/CurtainsCall.java new file mode 100644 index 0000000000..20f8c9f76e --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CurtainsCall.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.UndauntedAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class CurtainsCall extends CardImpl { + + public CurtainsCall(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{B}"); + + // Undaunted + this.addAbility(new UndauntedAbility()); + // Destroy two target creatures. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent("creatures"), false)); + } + + public CurtainsCall(final CurtainsCall card) { + super(card); + } + + @Override + public CurtainsCall copy() { + return new CurtainsCall(this); + } +} diff --git a/Mage.Sets/src/mage/cards/d/DevastationTide.java b/Mage.Sets/src/mage/cards/d/DevastationTide.java index 1ab5251c8a..5f405d9122 100644 --- a/Mage.Sets/src/mage/cards/d/DevastationTide.java +++ b/Mage.Sets/src/mage/cards/d/DevastationTide.java @@ -27,23 +27,14 @@ */ package mage.cards.d; -import java.util.LinkedHashSet; -import java.util.Set; import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; import mage.abilities.keyword.MiracleAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Zone; import mage.filter.common.FilterNonlandPermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; /** * @@ -52,10 +43,10 @@ import mage.players.Player; public class DevastationTide extends CardImpl { public DevastationTide(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); // Return all nonland permanents to their owners' hands. - this.getSpellAbility().addEffect(new DevastationTideEffect()); + this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(new FilterNonlandPermanent())); // Miracle {1}{U} this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{1}{U}"))); @@ -70,36 +61,3 @@ public class DevastationTide extends CardImpl { return new DevastationTide(this); } } - -class DevastationTideEffect extends OneShotEffect { - - public DevastationTideEffect() { - super(Outcome.ReturnToHand); - staticText = "Return all nonland permanents to their owners' hands"; - } - - public DevastationTideEffect(final DevastationTideEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Set cardsToHand = new LinkedHashSet<>(); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { - cardsToHand.add((Card) permanent); - } - controller.moveCards(cardsToHand, Zone.HAND, source, game); - return true; - - } - return false; - } - - @Override - public DevastationTideEffect copy() { - return new DevastationTideEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/cards/d/DivergentTransformations.java b/Mage.Sets/src/mage/cards/d/DivergentTransformations.java new file mode 100644 index 0000000000..bbe1e6b6f6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DivergentTransformations.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.d; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.UndauntedAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class DivergentTransformations extends CardImpl { + + public DivergentTransformations(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{6}{R}"); + + // Undaunted + this.addAbility(new UndauntedAbility()); + // Exile two target creatures. For each of those creatures, its controller reveals cards from the top of his or her library until he or she reveals a creature card, puts that card onto the battlefield, then shuffles the rest into his or her library. + this.getSpellAbility().addEffect(new DivergentTransformationsEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent("creatures"), false)); + + } + + public DivergentTransformations(final DivergentTransformations card) { + super(card); + } + + @Override + public DivergentTransformations copy() { + return new DivergentTransformations(this); + } +} + +class DivergentTransformationsEffect extends OneShotEffect { + + public DivergentTransformationsEffect() { + super(Outcome.Detriment); + this.staticText = "Exile two target creatures. For each of those creatures, its controller reveals cards from the top of his or her library " + + "until he or she reveals a creature card, puts that card onto the battlefield, then shuffles the rest into his or her library"; + } + + public DivergentTransformationsEffect(final DivergentTransformationsEffect effect) { + super(effect); + } + + @Override + public DivergentTransformationsEffect copy() { + return new DivergentTransformationsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + List controllerList = new ArrayList<>(); + Cards toExile = new CardsImpl(); + for (UUID targetId : getTargetPointer().getTargets(game, source)) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + toExile.add(permanent); + controllerList.add(permanent.getControllerId()); + } + } + controller.moveCards(toExile, Zone.EXILED, source, game); + for (UUID playerId : controllerList) { + Player player = game.getPlayer(playerId); + if (player != null) { + if (player.getLibrary().size() > 0) { + Cards cards = new CardsImpl(); + Card card = player.getLibrary().removeFromTop(game); + cards.add(card); + while (!card.getCardType().contains(CardType.CREATURE) && player.getLibrary().size() > 0) { + card = player.getLibrary().removeFromTop(game); + cards.add(card); + } + + if (card.getCardType().contains(CardType.CREATURE)) { + card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId()); + } + + if (cards.size() > 0) { + player.revealCards(sourceObject.getIdName(), cards, game); + Set cardsToShuffle = cards.getCards(game); + cardsToShuffle.remove(card); + player.getLibrary().addAll(cardsToShuffle, game); + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/s/SeedsOfRenewal.java b/Mage.Sets/src/mage/cards/s/SeedsOfRenewal.java new file mode 100644 index 0000000000..98fcb0273c --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SeedsOfRenewal.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.keyword.UndauntedAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class SeedsOfRenewal extends CardImpl { + + public SeedsOfRenewal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{6}{G}"); + + // Undaunted + this.addAbility(new UndauntedAbility()); + // Return up to two target cards from your graveyard to your hand. Exile Seeds of Renewal. + Effect effect = new ReturnFromGraveyardToHandTargetEffect(); + effect.setText("Return up to two target cards from your graveyard to your hand"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 2, new FilterCard("card from your graveyard"))); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + + } + + public SeedsOfRenewal(final SeedsOfRenewal card) { + super(card); + } + + @Override + public SeedsOfRenewal copy() { + return new SeedsOfRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SublimeExhalation.java b/Mage.Sets/src/mage/cards/s/SublimeExhalation.java new file mode 100644 index 0000000000..6e77752015 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SublimeExhalation.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.s; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.keyword.UndauntedAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SublimeExhalation extends CardImpl { + + public SublimeExhalation(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{6}{W}"); + + // Undaunted (This spell costs {1} less to cast for each opponent.) + this.addAbility(new UndauntedAbility()); + + // Destroy all creatures. + getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent("creatures"))); + } + + public SublimeExhalation(final SublimeExhalation card) { + super(card); + } + + @Override + public SublimeExhalation copy() { + return new SublimeExhalation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2016.java b/Mage.Sets/src/mage/sets/Commander2016.java index 10cb1579a8..046f92ccbd 100644 --- a/Mage.Sets/src/mage/sets/Commander2016.java +++ b/Mage.Sets/src/mage/sets/Commander2016.java @@ -100,6 +100,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Chromatic Lantern", 247, Rarity.RARE, mage.cards.c.ChromaticLantern.class)); cards.add(new SetCardInfo("Citadel Siege", 62, Rarity.RARE, mage.cards.c.CitadelSiege.class)); cards.add(new SetCardInfo("Clan Defiance", 187, Rarity.RARE, mage.cards.c.ClanDefiance.class)); + cards.add(new SetCardInfo("Coastal Breach", 6, Rarity.RARE, mage.cards.c.CoastalBreach.class)); cards.add(new SetCardInfo("Coiling Oracle", 188, Rarity.COMMON, mage.cards.c.CoilingOracle.class)); cards.add(new SetCardInfo("Collective Voyage", 145, Rarity.RARE, mage.cards.c.CollectiveVoyage.class)); cards.add(new SetCardInfo("Command Tower", 286, Rarity.COMMON, mage.cards.c.CommandTower.class)); @@ -111,6 +112,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Crumbling Necropolis", 287, Rarity.UNCOMMON, mage.cards.c.CrumblingNecropolis.class)); cards.add(new SetCardInfo("Crystalline Crawler", 54, Rarity.RARE, mage.cards.c.CrystallineCrawler.class)); cards.add(new SetCardInfo("Cultivate", 146, Rarity.COMMON, mage.cards.c.Cultivate.class)); + cards.add(new SetCardInfo("Curtains' Call", 13, Rarity.RARE, mage.cards.c.CurtainsCall.class)); cards.add(new SetCardInfo("Custodi Soulbinders", 63, Rarity.RARE, mage.cards.c.CustodiSoulbinders.class)); cards.add(new SetCardInfo("Daretti, Scrap Savant", 123, Rarity.MYTHIC, mage.cards.d.DarettiScrapSavant.class)); cards.add(new SetCardInfo("Darksteel Citadel", 288, Rarity.UNCOMMON, mage.cards.d.DarksteelCitadel.class)); @@ -125,6 +127,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Disdainful Stroke", 88, Rarity.COMMON, mage.cards.d.DisdainfulStroke.class)); cards.add(new SetCardInfo("Dismal Backwater", 291, Rarity.COMMON, mage.cards.d.DismalBackwater.class)); cards.add(new SetCardInfo("Dispeller's Capsule", 64, Rarity.COMMON, mage.cards.d.DispellersCapsule.class)); + cards.add(new SetCardInfo("Divergent Transformations", 17, Rarity.RARE, mage.cards.d.DivergentTransformations.class)); cards.add(new SetCardInfo("Dragon Mage", 124, Rarity.RARE, mage.cards.d.DragonMage.class)); cards.add(new SetCardInfo("Dragonskull Summit", 292, Rarity.RARE, mage.cards.d.DragonskullSummit.class)); cards.add(new SetCardInfo("Dreadship Reef", 293, Rarity.UNCOMMON, mage.cards.d.DreadshipReef.class)); @@ -271,6 +274,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Scavenging Ooze", 166, Rarity.RARE, mage.cards.s.ScavengingOoze.class)); cards.add(new SetCardInfo("Seaside Citadel", 322, Rarity.UNCOMMON, mage.cards.s.SeasideCitadel.class)); cards.add(new SetCardInfo("Seat of the Synod", 323, Rarity.COMMON, mage.cards.s.SeatOfTheSynod.class)); + cards.add(new SetCardInfo("Seeds of Renewal", 24, Rarity.RARE, mage.cards.s.SeedsOfRenewal.class)); cards.add(new SetCardInfo("Selesnya Guildmage", 235, Rarity.UNCOMMON, mage.cards.s.SelesnyaGuildmage.class)); cards.add(new SetCardInfo("Selesnya Sanctuary", 324, Rarity.UNCOMMON, mage.cards.s.SelesnyaSanctuary.class)); cards.add(new SetCardInfo("Selvala, Explorer Returned", 220, Rarity.RARE, mage.cards.s.SelvalaExplorerReturned.class)); @@ -293,6 +297,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Spinerock Knoll", 327, Rarity.RARE, mage.cards.s.SpinerockKnoll.class)); cards.add(new SetCardInfo("Spitting Image", 236, Rarity.RARE, mage.cards.s.SpittingImage.class)); cards.add(new SetCardInfo("Stalking Vengeance", 134, Rarity.RARE, mage.cards.s.StalkingVengeance.class)); + cards.add(new SetCardInfo("Sublime Exhalation", 5, Rarity.RARE, mage.cards.s.SublimeExhalation.class)); cards.add(new SetCardInfo("Sunforger", 275, Rarity.RARE, mage.cards.s.Sunforger.class)); cards.add(new SetCardInfo("Sungrass Prairie", 328, Rarity.RARE, mage.cards.s.SungrassPrairie.class)); cards.add(new SetCardInfo("Sunpetal Grove", 329, Rarity.RARE, mage.cards.s.SunpetalGrove.class)); diff --git a/Mage/src/main/java/mage/abilities/keyword/UndauntedAbility.java b/Mage/src/main/java/mage/abilities/keyword/UndauntedAbility.java new file mode 100644 index 0000000000..857d47133b --- /dev/null +++ b/Mage/src/main/java/mage/abilities/keyword/UndauntedAbility.java @@ -0,0 +1,78 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.keyword; + +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ +public class UndauntedAbility extends SimpleStaticAbility { + + public UndauntedAbility() { + super(Zone.ALL, new UndauntedEffect()); + setRuleAtTheTop(true); + } + + public UndauntedAbility(final UndauntedAbility ability) { + super(ability); + } + + @Override + public SimpleStaticAbility copy() { + return new UndauntedAbility(this); + } + +} + +class UndauntedEffect extends CostModificationEffectImpl { + + public UndauntedEffect() { + super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST); + staticText = "undaunted (This spell costs {1} less to cast for each opponent.)"; + } + + public UndauntedEffect(final UndauntedEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + Mana mana = spellAbility.getManaCostsToPay().getMana(); + if (mana.getGeneric() > 0) { + int count = game.getOpponents(source.getControllerId()).size(); + int newCount = mana.getGeneric() - count; + if (newCount < 0) { + newCount = 0; + } + mana.setGeneric(newCount); + spellAbility.getManaCostsToPay().load(mana.toString()); + return true; + } + return false; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + return abilityToModify instanceof SpellAbility && abilityToModify.getSourceId().equals(source.getSourceId()); + } + + @Override + public UndauntedEffect copy() { + return new UndauntedEffect(this); + } +} diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 1f68aa71f9..55770906b6 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -74,6 +74,7 @@ Totem armor|new| Trample|instance| Tribute|number| Unblockable|new| +Undaunted|new| Undying|new| Unearth|cost| Unleash|new|