From 96f62705048505e066b435b9bfa690a77bbfc1f3 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 10:43:38 -0400 Subject: [PATCH 01/30] Implement Epicenter --- Mage.Sets/src/mage/cards/e/Epicenter.java | 107 ++++++++++++++++++++++ Mage.Sets/src/mage/sets/Odyssey.java | 1 + 2 files changed, 108 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/Epicenter.java diff --git a/Mage.Sets/src/mage/cards/e/Epicenter.java b/Mage.Sets/src/mage/cards/e/Epicenter.java new file mode 100644 index 00000000000..54ba912bc09 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/Epicenter.java @@ -0,0 +1,107 @@ +/* + * 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.e; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPlayer; + +/** + * + * @author TheElk801 + */ +public class Epicenter extends CardImpl { + + public Epicenter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}"); + + // Target player sacrifices a land. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "Target player"), + new InvertCondition(new CardsInControllerGraveCondition(7)), + "Target player sacrifices a land")); + // Threshold - Each player sacrifices all lands he or she controls instead if seven or more cards are in your graveyard. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new EpicenterEffect(), + new CardsInControllerGraveCondition(7), + "

Threshold - Each player sacrifices all lands he or she controls instead if seven or more cards are in your graveyard.")); + + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public Epicenter(final Epicenter card) { + super(card); + } + + @Override + public Epicenter copy() { + return new Epicenter(this); + } +} + +class EpicenterEffect extends OneShotEffect { + + EpicenterEffect() { + super(Outcome.DestroyPermanent); + staticText = "Each player sacrifices all lands he or she controls"; + } + + EpicenterEffect(final EpicenterEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + List permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game); + for (Permanent p : permanents) { + if (p.isLand()) { + p.sacrifice(source.getSourceId(), game); + } + } + + return true; + } + + @Override + public EpicenterEffect copy() { + return new EpicenterEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Odyssey.java b/Mage.Sets/src/mage/sets/Odyssey.java index 95a2a781028..5ae0522de03 100644 --- a/Mage.Sets/src/mage/sets/Odyssey.java +++ b/Mage.Sets/src/mage/sets/Odyssey.java @@ -155,6 +155,7 @@ public class Odyssey extends ExpansionSet { cards.add(new SetCardInfo("Ember Beast", 190, Rarity.COMMON, mage.cards.e.EmberBeast.class)); cards.add(new SetCardInfo("Engulfing Flames", 191, Rarity.UNCOMMON, mage.cards.e.EngulfingFlames.class)); cards.add(new SetCardInfo("Entomb", 132, Rarity.RARE, mage.cards.e.Entomb.class)); + cards.add(new SetCardInfo("Epicenter", 192, Rarity.RARE, mage.cards.e.Epicenter.class)); cards.add(new SetCardInfo("Escape Artist", 84, Rarity.COMMON, mage.cards.e.EscapeArtist.class)); cards.add(new SetCardInfo("Execute", 133, Rarity.UNCOMMON, mage.cards.e.Execute.class)); cards.add(new SetCardInfo("Extract", 85, Rarity.RARE, mage.cards.e.Extract.class)); From 03ace22662d2a1e1b1907bf05dd8ab5bcc376caf Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 11:14:59 -0400 Subject: [PATCH 02/30] Implement Infested Roothold --- .gitignore | 267 +++++++++--------- .../src/mage/cards/i/InfestedRoothold.java | 82 ++++++ Mage.Sets/src/mage/sets/Darksteel.java | 1 + 3 files changed, 217 insertions(+), 133 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/i/InfestedRoothold.java diff --git a/.gitignore b/.gitignore index 9a28f9ab18a..42b5e18e02e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,133 +1,134 @@ -syntax: glob - -# Mage.Client -Mage.Client/*.dck -Mage.Client/db -Mage.Client/gamelogs -Mage.Client/mageclient.log -Mage.Client/plugins/images -Mage.Client/plugins/plugin.data -Mage.Client/target -Mage.Common/target -/db -/gamelogs -/mageclient.log - -# Mage.Plugins -Mage.Plugins/Mage.Card.Plugin/target -Mage.Plugins/Mage.Counter.Plugin/target -Mage.Plugins/Mage.Theme.Plugin/target -Mage.Plugins/Mage.Rating.Plugin/target - -# Mage.Server -Mage.Server/config/init.txt -Mage.Server/saved -Mage.Server/target -Mage.Server/db -Mage.Server/cache -Mage.Server/mageserver.log -Mage.Server/magediag.log -Mage.Server/extensions -/saved -/db -/cache -/mageserver.log -/magediag.log -/extensions - -Mage.Server.Console/target/ -Mage.Server.Console/mageadmin.log -Mage.Server.Plugins/Mage.Deck.Constructed/target -Mage.Server.Plugins/Mage.Deck.Limited/target -Mage.Server.Plugins/Mage.Game.CanadianHighlanderDuel/target -Mage.Server.Plugins/Mage.Game.CommanderDuel/target -Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/target/ -Mage.Server.Plugins/Mage.Game.FreeForAll/target -Mage.Server.Plugins/Mage.Game.MomirDuel/target -Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/target -Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/target -Mage.Server.Plugins/Mage.Player.AI.DraftBot/target -Mage.Server.Plugins/Mage.Player.AI.MA/target -Mage.Server.Plugins/Mage.Player.AI/target -Mage.Server.Plugins/Mage.Player.AIMCTS/target -Mage.Server.Plugins/Mage.Player.AIMinimax/target -Mage.Server.Plugins/Mage.Player.Human/target -Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target -Mage.Server.Plugins/Mage.Tournament.Constructed/target -Mage.Server.Plugins/Mage.Tournament.Sealed/target - -# Mage.Sets -Mage.Sets/target - -# Mage.Stats -Mage.Stats/server.log -Mage.Stats/mageserver.log -Mage.Stats/magediag.log - -# Mage.Tests -Mage.Tests/target -Mage.Tests/cache -Mage.Tests/db -Mage.Tests/Mage.log -Mage.Tests/watchdog.log - -# Mage -Mage/target - -# Mage.Updater -Mage.Updater/target -mage.updater.client/target - -# Mage.Verify -Mage.Verify/target -Mage.Verify/AllCards.json.zip -Mage.Verify/AllSets.json.zip - -releases -Utils/author.txt -.DS_Store -.metadata -.project -.settings -.idea -syntax: regexp -\.class -\.jar -\.iml -\.ipr -\.iws -\.log -nbactions.xml -nbactions-*.xml -nb-configuration.xml -glob:Mage.Client/cheat.dck -glob:Mage.Client/test.dck -mage-bundle.zip -mage-stats-ws.war - -Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target -\.orig\..*$ -\.orig$ -\.chg\..*$ -\.rej$ -\.conflict\~$ -/Mage.Server.Plugins/Mage.Player.AIMCTS/target/ - -*.classpath -*.iml -hs_err*.log -/submitted - -/Mage.Server/config/ai.please.cast.this.txt -/Mage.Stats/target/ -/Utils/*_unimplemented.txt -*.netbeans_automatic_build -*.txt -Mage.Client/serverlist.txt -/bin/ -/out/ -/target/ - -client_secrets.json - -dependency-reduced-pom.xml +syntax: glob + +# Mage.Client +Mage.Client/*.dck +Mage.Client/db +Mage.Client/gamelogs +Mage.Client/mageclient.log +Mage.Client/plugins/images +Mage.Client/plugins/plugin.data +Mage.Client/target +Mage.Common/target +/db +/gamelogs +/mageclient.log + +# Mage.Plugins +Mage.Plugins/Mage.Card.Plugin/target +Mage.Plugins/Mage.Counter.Plugin/target +Mage.Plugins/Mage.Theme.Plugin/target +Mage.Plugins/Mage.Rating.Plugin/target + +# Mage.Server +Mage.Server/config/init.txt +Mage.Server/saved +Mage.Server/target +Mage.Server/db +Mage.Server/cache +Mage.Server/mageserver.log +Mage.Server/magediag.log +Mage.Server/extensions +/saved +/db +/cache +/mageserver.log +/magediag.log +/extensions + +Mage.Server.Console/target/ +Mage.Server.Console/mageadmin.log +Mage.Server.Plugins/Mage.Deck.Constructed/target +Mage.Server.Plugins/Mage.Deck.Limited/target +Mage.Server.Plugins/Mage.Game.CanadianHighlanderDuel/target +Mage.Server.Plugins/Mage.Game.CommanderDuel/target +Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/target/ +Mage.Server.Plugins/Mage.Game.FreeForAll/target +Mage.Server.Plugins/Mage.Game.MomirDuel/target +Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/target +Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/target +Mage.Server.Plugins/Mage.Player.AI.DraftBot/target +Mage.Server.Plugins/Mage.Player.AI.MA/target +Mage.Server.Plugins/Mage.Player.AI/target +Mage.Server.Plugins/Mage.Player.AIMCTS/target +Mage.Server.Plugins/Mage.Player.AIMinimax/target +Mage.Server.Plugins/Mage.Player.Human/target +Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target +Mage.Server.Plugins/Mage.Tournament.Constructed/target +Mage.Server.Plugins/Mage.Tournament.Sealed/target + +# Mage.Sets +Mage.Sets/target + +# Mage.Stats +Mage.Stats/server.log +Mage.Stats/mageserver.log +Mage.Stats/magediag.log + +# Mage.Tests +Mage.Tests/target +Mage.Tests/cache +Mage.Tests/db +Mage.Tests/Mage.log +Mage.Tests/watchdog.log + +# Mage +Mage/target + +# Mage.Updater +Mage.Updater/target +mage.updater.client/target + +# Mage.Verify +Mage.Verify/target +Mage.Verify/AllCards.json.zip +Mage.Verify/AllSets.json.zip + +releases +Utils/author.txt +.DS_Store +.metadata +.project +.settings +.idea +syntax: regexp +\.class +\.jar +\.iml +\.ipr +\.iws +\.log +nbactions.xml +nbactions-*.xml +nb-configuration.xml +glob:Mage.Client/cheat.dck +glob:Mage.Client/test.dck +mage-bundle.zip +mage-stats-ws.war + +Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target +\.orig\..*$ +\.orig$ +\.chg\..*$ +\.rej$ +\.conflict\~$ +/Mage.Server.Plugins/Mage.Player.AIMCTS/target/ + +*.classpath +*.iml +hs_err*.log +/submitted + +/Mage.Server/config/ai.please.cast.this.txt +/Mage.Stats/target/ +/Utils/*_unimplemented.txt +*.netbeans_automatic_build +*.txt +Mage.Client/serverlist.txt +/bin/ +/out/ +/target/ + +client_secrets.json + +dependency-reduced-pom.xml +/Mage.Server.Plugins/Mage.Game.PennyDreadfulCommanderFreeForAll/target/ \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/i/InfestedRoothold.java b/Mage.Sets/src/mage/cards/i/InfestedRoothold.java new file mode 100644 index 00000000000..44461f3d08c --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InfestedRoothold.java @@ -0,0 +1,82 @@ +/* + * 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.i; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterSpell; +import mage.filter.common.FilterArtifactCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.permanent.token.InsectToken; + +/** + * + * @author TheElk801 + */ +public class InfestedRoothold extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("an artifact spell"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public InfestedRoothold(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}"); + + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // Protection from artifacts + this.addAbility(new ProtectionAbility(new FilterArtifactCard("artifacts"))); + + // Whenever an opponent casts an artifact spell, you may create a 1/1 green Insect creature token. + this.addAbility(new SpellCastOpponentTriggeredAbility(new CreateTokenEffect(new InsectToken()), filter, true)); + + } + + public InfestedRoothold(final InfestedRoothold card) { + super(card); + } + + @Override + public InfestedRoothold copy() { + return new InfestedRoothold(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Darksteel.java b/Mage.Sets/src/mage/sets/Darksteel.java index 69c5208b9b9..e8ed522ed21 100644 --- a/Mage.Sets/src/mage/sets/Darksteel.java +++ b/Mage.Sets/src/mage/sets/Darksteel.java @@ -85,6 +85,7 @@ public class Darksteel extends ExpansionSet { cards.add(new SetCardInfo("Heartseeker", 124, Rarity.RARE, mage.cards.h.Heartseeker.class)); cards.add(new SetCardInfo("Hoverguard Observer", 22, Rarity.UNCOMMON, mage.cards.h.HoverguardObserver.class)); cards.add(new SetCardInfo("Hunger of the Nim", 46, Rarity.COMMON, mage.cards.h.HungerOfTheNim.class)); + cards.add(new SetCardInfo("Infested Roothold", 76, Rarity.UNCOMMON, mage.cards.i.InfestedRoothold.class)); cards.add(new SetCardInfo("Inflame", 64, Rarity.COMMON, mage.cards.i.Inflame.class)); cards.add(new SetCardInfo("Juggernaut", 125, Rarity.UNCOMMON, mage.cards.j.Juggernaut.class)); cards.add(new SetCardInfo("Karstoderm", 77, Rarity.UNCOMMON, mage.cards.k.Karstoderm.class)); From eea04a2ad3bb77111ceeaa18e80dda66273ff438 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 17:26:38 -0400 Subject: [PATCH 03/30] Implement Brown Ouphe --- Mage.Sets/src/mage/cards/b/BrownOuphe.java | 101 +++++++++++++++++++++ Mage.Sets/src/mage/sets/IceAge.java | 1 + Mage.Sets/src/mage/sets/Mirrodin.java | 1 + 3 files changed, 103 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BrownOuphe.java diff --git a/Mage.Sets/src/mage/cards/b/BrownOuphe.java b/Mage.Sets/src/mage/cards/b/BrownOuphe.java new file mode 100644 index 00000000000..5addadf05ca --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BrownOuphe.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityType; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.FilterStackObject; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.stack.StackAbility; +import mage.target.common.TargetActivatedOrTriggeredAbility; + +/** + * + * @author TheElk801 + */ +public class BrownOuphe extends CardImpl { + + private final static FilterStackObject filter = new FilterStackObject("ability from an artifact source"); + + static { + filter.add(new ArtifactSourcePredicate()); + } + + public BrownOuphe(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); + + this.subtype.add("Ouphe"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{G}, {tap}: Counter target activated ability from an artifact source. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl<>("{1}{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetActivatedOrTriggeredAbility(filter)); + this.addAbility(ability); + } + + public BrownOuphe(final BrownOuphe card) { + super(card); + } + + @Override + public BrownOuphe copy() { + return new BrownOuphe(this); + } +} + +class ArtifactSourcePredicate implements Predicate { + + public ArtifactSourcePredicate() { + } + + @Override + public boolean apply(Ability input, Game game) { + if (input instanceof StackAbility) { + return input.getSourceObject(game).isArtifact() && input.getAbilityType() == AbilityType.ACTIVATED; + } + return false; + } + + @Override + public String toString() { + return "Source(Artifact)"; + } +} diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index f3253150b0e..198c73249e9 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -75,6 +75,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Blue Scarab", 233, Rarity.UNCOMMON, mage.cards.b.BlueScarab.class)); cards.add(new SetCardInfo("Brainstorm", 61, Rarity.COMMON, mage.cards.b.Brainstorm.class)); cards.add(new SetCardInfo("Brand of Ill Omen", 177, Rarity.RARE, mage.cards.b.BrandOfIllOmen.class)); + cards.add(new SetCardInfo("Brown Ouphe", 116, Rarity.COMMON, mage.cards.b.BrownOuphe.class)); cards.add(new SetCardInfo("Brushland", 327, Rarity.RARE, mage.cards.b.Brushland.class)); cards.add(new SetCardInfo("Burnt Offering", 4, Rarity.COMMON, mage.cards.b.BurntOffering.class)); cards.add(new SetCardInfo("Caribou Range", 235, Rarity.RARE, mage.cards.c.CaribouRange.class)); diff --git a/Mage.Sets/src/mage/sets/Mirrodin.java b/Mage.Sets/src/mage/sets/Mirrodin.java index cff52492462..5d71a9de735 100644 --- a/Mage.Sets/src/mage/sets/Mirrodin.java +++ b/Mage.Sets/src/mage/sets/Mirrodin.java @@ -47,6 +47,7 @@ public class Mirrodin extends ExpansionSet { cards.add(new SetCardInfo("Bosh, Iron Golem", 147, Rarity.RARE, mage.cards.b.BoshIronGolem.class)); cards.add(new SetCardInfo("Bottle Gnomes", 148, Rarity.UNCOMMON, mage.cards.b.BottleGnomes.class)); cards.add(new SetCardInfo("Broodstar", 31, Rarity.RARE, mage.cards.b.Broodstar.class)); + cards.add(new SetCardInfo("Brown Ouphe", 115, Rarity.UNCOMMON, mage.cards.b.BrownOuphe.class)); cards.add(new SetCardInfo("Cathodion", 149, Rarity.UNCOMMON, mage.cards.c.Cathodion.class)); cards.add(new SetCardInfo("Chalice of the Void", 150, Rarity.RARE, mage.cards.c.ChaliceOfTheVoid.class)); cards.add(new SetCardInfo("Chimney Imp", 59, Rarity.COMMON, mage.cards.c.ChimneyImp.class)); From 60b75416f9176d91ff8fd376287b4b812d2cb5b8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 17:27:02 -0400 Subject: [PATCH 04/30] Implement Rust --- Mage.Sets/src/mage/cards/r/Rust.java | 90 ++++++++++++++++++++++++++++ Mage.Sets/src/mage/sets/Legends.java | 1 + 2 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/Rust.java diff --git a/Mage.Sets/src/mage/cards/r/Rust.java b/Mage.Sets/src/mage/cards/r/Rust.java new file mode 100644 index 00000000000..c1f5f4edc94 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/Rust.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.r; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityType; +import mage.constants.CardType; +import mage.filter.FilterStackObject; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.stack.StackAbility; +import mage.target.common.TargetActivatedOrTriggeredAbility; + +/** + * + * @author TheElk801 + */ +public class Rust extends CardImpl { + + private final static FilterStackObject filter = new FilterStackObject("ability from an artifact source"); + + static { + filter.add(new ArtifactSourcePredicate()); + } + + public Rust(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); + + // Counter target activated ability from an artifact source. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetActivatedOrTriggeredAbility(filter)); + } + + public Rust(final Rust card) { + super(card); + } + + @Override + public Rust copy() { + return new Rust(this); + } +} + +class ArtifactSourcePredicate implements Predicate { + + public ArtifactSourcePredicate() { + } + + @Override + public boolean apply(Ability input, Game game) { + if (input instanceof StackAbility) { + return input.getSourceObject(game).isArtifact() && input.getAbilityType() == AbilityType.ACTIVATED; + } + return false; + } + + @Override + public String toString() { + return "Source(Artifact)"; + } +} diff --git a/Mage.Sets/src/mage/sets/Legends.java b/Mage.Sets/src/mage/sets/Legends.java index 9e4b640185a..79d4725bb92 100644 --- a/Mage.Sets/src/mage/sets/Legends.java +++ b/Mage.Sets/src/mage/sets/Legends.java @@ -198,6 +198,7 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Ring of Immortals", 238, Rarity.RARE, mage.cards.r.RingOfImmortals.class)); cards.add(new SetCardInfo("Riven Turnbull", 294, Rarity.UNCOMMON, mage.cards.r.RivenTurnbull.class)); cards.add(new SetCardInfo("Rubinia Soulsinger", 296, Rarity.RARE, mage.cards.r.RubiniaSoulsinger.class)); + cards.add(new SetCardInfo("Rust", 49, Rarity.COMMON, mage.cards.r.Rust.class)); cards.add(new SetCardInfo("Sea Kings' Blessing", 75, Rarity.UNCOMMON, mage.cards.s.SeaKingsBlessing.class)); cards.add(new SetCardInfo("Segovian Leviathan", 76, Rarity.UNCOMMON, mage.cards.s.SegovianLeviathan.class)); cards.add(new SetCardInfo("Sentinel", 239, Rarity.RARE, mage.cards.s.Sentinel.class)); From 034f31690d198dea650a803e3be37cca8b924bbc Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 17:38:34 -0400 Subject: [PATCH 05/30] Implement Ouphe Vandals --- Mage.Sets/src/mage/cards/o/OupheVandals.java | 141 +++++++++++++++++++ Mage.Sets/src/mage/sets/FifthDawn.java | 1 + 2 files changed, 142 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OupheVandals.java diff --git a/Mage.Sets/src/mage/cards/o/OupheVandals.java b/Mage.Sets/src/mage/cards/o/OupheVandals.java new file mode 100644 index 00000000000..b888b30c8da --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OupheVandals.java @@ -0,0 +1,141 @@ +/* + * 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.o; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AbilityType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterStackObject; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.StackAbility; +import mage.game.stack.StackObject; +import mage.target.common.TargetActivatedOrTriggeredAbility; + +/** + * + * @author TheElk801 + */ +public class OupheVandals extends CardImpl { + + private final static FilterStackObject filter = new FilterStackObject("ability from an artifact source"); + + static { + filter.add(new ArtifactSourcePredicate()); + } + + public OupheVandals(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add("Ouphe"); + this.subtype.add("Rogue"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}, Sacrifice Ouphe Vandals: Counter target activated ability from an artifact source and destroy that artifact if it's on the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new OupheVandalsEffect(), new ManaCostsImpl<>("{G}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetActivatedOrTriggeredAbility(filter)); + this.addAbility(ability); + } + + public OupheVandals(final OupheVandals card) { + super(card); + } + + @Override + public OupheVandals copy() { + return new OupheVandals(this); + } +} + +class ArtifactSourcePredicate implements Predicate { + + public ArtifactSourcePredicate() { + } + + @Override + public boolean apply(Ability input, Game game) { + if (input instanceof StackAbility) { + return input.getSourceObject(game).isArtifact() && input.getAbilityType() == AbilityType.ACTIVATED; + } + return false; + } + + @Override + public String toString() { + return "Source(Artifact)"; + } +} + +class OupheVandalsEffect extends OneShotEffect { + + public OupheVandalsEffect() { + super(Outcome.Detriment); + this.staticText = "Counter target activated ability from an artifact source and destroy that artifact if it's on the battlefield."; + } + + public OupheVandalsEffect(final OupheVandalsEffect effect) { + super(effect); + } + + @Override + public OupheVandalsEffect copy() { + return new OupheVandalsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = source.getFirstTarget(); + StackObject stackObject = game.getStack().getStackObject(targetId); + if (targetId != null && game.getStack().counter(targetId, source.getSourceId(), game)) { + UUID permanentId = stackObject.getSourceId(); + if (permanentId != null) { + Permanent usedPermanent = game.getPermanent(permanentId); + if (usedPermanent != null) { + usedPermanent.destroy(source.getSourceId(), game, false); + } + } + return true; + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/FifthDawn.java b/Mage.Sets/src/mage/sets/FifthDawn.java index b1cd70b3244..d50c83b57c8 100644 --- a/Mage.Sets/src/mage/sets/FifthDawn.java +++ b/Mage.Sets/src/mage/sets/FifthDawn.java @@ -159,6 +159,7 @@ public class FifthDawn extends ExpansionSet { cards.add(new SetCardInfo("Night's Whisper", 55, Rarity.UNCOMMON, mage.cards.n.NightsWhisper.class)); cards.add(new SetCardInfo("Nim Grotesque", 56, Rarity.UNCOMMON, mage.cards.n.NimGrotesque.class)); cards.add(new SetCardInfo("Opaline Bracers", 141, Rarity.COMMON, mage.cards.o.OpalineBracers.class)); + cards.add(new SetCardInfo("Ouphe Vandals", 90, Rarity.UNCOMMON, mage.cards.o.OupheVandals.class)); cards.add(new SetCardInfo("Paradise Mantle", 142, Rarity.UNCOMMON, mage.cards.p.ParadiseMantle.class)); cards.add(new SetCardInfo("Pentad Prism", 143, Rarity.COMMON, mage.cards.p.PentadPrism.class)); cards.add(new SetCardInfo("Plasma Elemental", 34, Rarity.UNCOMMON, mage.cards.p.PlasmaElemental.class)); From 954968f01b4136fe26a48aec0460fa84f01a6a3b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 18:03:52 -0400 Subject: [PATCH 06/30] Implement Fatal Attraction --- .../src/mage/cards/f/FatalAttraction.java | 77 +++++++++++++++++++ Mage.Sets/src/mage/sets/FutureSight.java | 1 + 2 files changed, 78 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FatalAttraction.java diff --git a/Mage.Sets/src/mage/cards/f/FatalAttraction.java b/Mage.Sets/src/mage/cards/f/FatalAttraction.java new file mode 100644 index 00000000000..765c2f81cf5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FatalAttraction.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.f; + +import java.util.UUID; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageAttachedEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; + +/** + * + * @author TheElk801 + */ +public class FatalAttraction extends CardImpl { + + public FatalAttraction(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Fatal Attraction enters the battlefield, it deals 2 damage to enchanted creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DamageAttachedEffect(2))); + // At the beginning of your upkeep, Fatal Attraction deals 4 damage to enchanted creature. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DamageAttachedEffect(4), TargetController.YOU, false)); + } + + public FatalAttraction(final FatalAttraction card) { + super(card); + } + + @Override + public FatalAttraction copy() { + return new FatalAttraction(this); + } +} diff --git a/Mage.Sets/src/mage/sets/FutureSight.java b/Mage.Sets/src/mage/sets/FutureSight.java index e6a4ef8a76b..7ae3f363395 100644 --- a/Mage.Sets/src/mage/sets/FutureSight.java +++ b/Mage.Sets/src/mage/sets/FutureSight.java @@ -93,6 +93,7 @@ public class FutureSight extends ExpansionSet { cards.add(new SetCardInfo("Emberwilde Augur", 97, Rarity.COMMON, mage.cards.e.EmberwildeAugur.class)); cards.add(new SetCardInfo("Emblem of the Warmind", 112, Rarity.UNCOMMON, mage.cards.e.EmblemOfTheWarmind.class)); cards.add(new SetCardInfo("Epochrasite", 162, Rarity.RARE, mage.cards.e.Epochrasite.class)); + cards.add(new SetCardInfo("Fatal Attraction", 98, Rarity.COMMON, mage.cards.f.FatalAttraction.class)); cards.add(new SetCardInfo("Festering March", 65, Rarity.UNCOMMON, mage.cards.f.FesteringMarch.class)); cards.add(new SetCardInfo("Fleshwrither", 84, Rarity.UNCOMMON, mage.cards.f.Fleshwrither.class)); cards.add(new SetCardInfo("Flowstone Embrace", 113, Rarity.COMMON, mage.cards.f.FlowstoneEmbrace.class)); From 61d892c64da5895c320220987c5f494f01b5fed6 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 18:39:11 -0400 Subject: [PATCH 07/30] Implement Fighting Chance --- .../src/mage/cards/f/FightingChance.java | 100 ++++++++++++++++++ Mage.Sets/src/mage/sets/Exodus.java | 1 + 2 files changed, 101 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FightingChance.java diff --git a/Mage.Sets/src/mage/cards/f/FightingChance.java b/Mage.Sets/src/mage/cards/f/FightingChance.java new file mode 100644 index 00000000000..35565047617 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FightingChance.java @@ -0,0 +1,100 @@ +/* + * 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.f; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.common.FilterBlockingCreature; +import mage.game.Game; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class FightingChance extends CardImpl { + + private static final FilterBlockingCreature filter = new FilterBlockingCreature("Blocking creatures"); + + public FightingChance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}"); + + // For each blocking creature, flip a coin. If you win the flip, prevent all combat damage that would be dealt by that creature this turn. + this.getSpellAbility().addEffect(new FightingChanceEffect()); + } + + public FightingChance(final FightingChance card) { + super(card); + } + + @Override + public FightingChance copy() { + return new FightingChance(this); + } +} + +class FightingChanceEffect extends OneShotEffect { + + FightingChanceEffect() { + super(Outcome.Detriment); + staticText = "For each blocking creature, flip a coin. If you win the flip, prevent all combat damage that would be dealt by that creature this turn."; + } + + FightingChanceEffect(final FightingChanceEffect effect) { + super(effect); + } + + @Override + public FightingChanceEffect copy() { + return new FightingChanceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + for (UUID blocker : game.getCombat().getBlockers()) { + if (player.flipCoin(game)) { + PreventDamageByTargetEffect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); + effect.setTargetPointer(new FixedTarget(blocker)); + game.addEffect(effect, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Exodus.java b/Mage.Sets/src/mage/sets/Exodus.java index 0c95c4789d0..9e56ef0ac77 100644 --- a/Mage.Sets/src/mage/sets/Exodus.java +++ b/Mage.Sets/src/mage/sets/Exodus.java @@ -84,6 +84,7 @@ public class Exodus extends ExpansionSet { cards.add(new SetCardInfo("Ertai, Wizard Adept", 33, Rarity.RARE, mage.cards.e.ErtaiWizardAdept.class)); cards.add(new SetCardInfo("Exalted Dragon", 6, Rarity.RARE, mage.cards.e.ExaltedDragon.class)); cards.add(new SetCardInfo("Fade Away", 34, Rarity.COMMON, mage.cards.f.FadeAway.class)); + cards.add(new SetCardInfo("Fighting Chance", 82, Rarity.RARE, mage.cards.f.FightingChance.class)); cards.add(new SetCardInfo("Flowstone Flood", 83, Rarity.UNCOMMON, mage.cards.f.FlowstoneFlood.class)); cards.add(new SetCardInfo("Forbid", 35, Rarity.UNCOMMON, mage.cards.f.Forbid.class)); cards.add(new SetCardInfo("Fugue", 62, Rarity.UNCOMMON, mage.cards.f.Fugue.class)); From b20921453ff92ab7f7baaad228eaf230c0e84dae Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 22:30:01 -0400 Subject: [PATCH 08/30] Implement Arcbound Fiend --- Mage.Sets/src/mage/cards/a/ArcboundFiend.java | 114 ++++++++++++++++++ Mage.Sets/src/mage/sets/Darksteel.java | 1 + 2 files changed, 115 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/ArcboundFiend.java diff --git a/Mage.Sets/src/mage/cards/a/ArcboundFiend.java b/Mage.Sets/src/mage/cards/a/ArcboundFiend.java new file mode 100644 index 00000000000..9afa80df664 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArcboundFiend.java @@ -0,0 +1,114 @@ +/* + * 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.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FearAbility; +import mage.abilities.keyword.ModularAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class ArcboundFiend extends CardImpl { + + public ArcboundFiend(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + + this.subtype.add("Horror"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Fear + this.addAbility(FearAbility.getInstance()); + + // At the beginning of your upkeep, you may move a +1/+1 counter from target creature onto Arcbound Fiend. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new MoveCounterFromTargetToSourceEffect(), TargetController.YOU, true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // Modular 3 + this.addAbility(new ModularAbility(this, 3)); + } + + public ArcboundFiend(final ArcboundFiend card) { + super(card); + } + + @Override + public ArcboundFiend copy() { + return new ArcboundFiend(this); + } +} + +class MoveCounterFromTargetToSourceEffect extends OneShotEffect { + + public MoveCounterFromTargetToSourceEffect() { + super(Outcome.Detriment); + this.staticText = "move a +1/+1 counter from target creature onto {this}"; + } + + public MoveCounterFromTargetToSourceEffect(final MoveCounterFromTargetToSourceEffect effect) { + super(effect); + } + + @Override + public MoveCounterFromTargetToSourceEffect copy() { + return new MoveCounterFromTargetToSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourceObject = game.getPermanent(source.getSourceId()); + if (sourceObject != null && controller != null) { + Permanent fromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (fromPermanent != null && fromPermanent.getCounters(game).getCount(CounterType.P1P1) > 0) { + fromPermanent.removeCounters(CounterType.P1P1.createInstance(), game); + sourceObject.addCounters(CounterType.P1P1.createInstance(), source, game); + game.informPlayers("Moved a +1/+1 counter from " + fromPermanent.getLogName() + " to " + sourceObject.getLogName()); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Darksteel.java b/Mage.Sets/src/mage/sets/Darksteel.java index e8ed522ed21..5484869aa35 100644 --- a/Mage.Sets/src/mage/sets/Darksteel.java +++ b/Mage.Sets/src/mage/sets/Darksteel.java @@ -30,6 +30,7 @@ public class Darksteel extends ExpansionSet { cards.add(new SetCardInfo("Arcane Spyglass", 93, Rarity.COMMON, mage.cards.a.ArcaneSpyglass.class)); cards.add(new SetCardInfo("Arcbound Bruiser", 94, Rarity.COMMON, mage.cards.a.ArcboundBruiser.class)); cards.add(new SetCardInfo("Arcbound Crusher", 95, Rarity.UNCOMMON, mage.cards.a.ArcboundCrusher.class)); + cards.add(new SetCardInfo("Arcbound Fiend", 96, Rarity.UNCOMMON, mage.cards.a.ArcboundFiend.class)); cards.add(new SetCardInfo("Arcbound Hybrid", 97, Rarity.COMMON, mage.cards.a.ArcboundHybrid.class)); cards.add(new SetCardInfo("Arcbound Lancer", 98, Rarity.UNCOMMON, mage.cards.a.ArcboundLancer.class)); cards.add(new SetCardInfo("Arcbound Overseer", 99, Rarity.RARE, mage.cards.a.ArcboundOverseer.class)); From 6a491354798234a8c42d2998aa7283a370902760 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Aug 2017 07:54:43 -0400 Subject: [PATCH 09/30] Implement Carry Away --- Mage.Sets/src/mage/cards/c/CarryAway.java | 113 ++++++++++++++++++ Mage.Sets/src/mage/sets/Darksteel.java | 1 + .../common/FilterEquipmentPermanent.java | 58 +++++++++ .../common/TargetEquipmentPermanent.java | 64 ++++++++++ 4 files changed, 236 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CarryAway.java create mode 100644 Mage/src/main/java/mage/filter/common/FilterEquipmentPermanent.java create mode 100644 Mage/src/main/java/mage/target/common/TargetEquipmentPermanent.java diff --git a/Mage.Sets/src/mage/cards/c/CarryAway.java b/Mage.Sets/src/mage/cards/c/CarryAway.java new file mode 100644 index 00000000000..8a96d839e9c --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CarryAway.java @@ -0,0 +1,113 @@ +/* + * 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.target.common.TargetEquipmentPermanent; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.ControlEnchantedEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author TheElk801 + */ +public class CarryAway extends CardImpl { + + public CarryAway(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); + + this.subtype.add("Aura"); + + // Enchant Equipment + TargetPermanent auraTarget = new TargetEquipmentPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Carry Away enters the battlefield, unattach enchanted Equipment. + ability = new EntersBattlefieldTriggeredAbility(new CarryAwayEffect()); + this.addAbility(ability); + // You control enchanted Equipment. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect("equipment"))); + } + + public CarryAway(final CarryAway card) { + super(card); + } + + @Override + public CarryAway copy() { + return new CarryAway(this); + } +} + +class CarryAwayEffect extends OneShotEffect { + + public CarryAwayEffect() { + super(Outcome.Detriment); + this.staticText = "unattach enchanted equipment."; + } + + public CarryAwayEffect(final CarryAwayEffect effect) { + super(effect); + } + + @Override + public CarryAwayEffect copy() { + return new CarryAwayEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + Permanent enchantedEquipment = game.getPermanent(permanent.getAttachedTo()); + if (enchantedEquipment != null) { + Permanent equippedCreature = game.getPermanent(enchantedEquipment.getAttachedTo()); + if (equippedCreature != null) { + return equippedCreature.removeAttachment(enchantedEquipment.getId(), game); + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Darksteel.java b/Mage.Sets/src/mage/sets/Darksteel.java index 5484869aa35..d26fe1ecd7d 100644 --- a/Mage.Sets/src/mage/sets/Darksteel.java +++ b/Mage.Sets/src/mage/sets/Darksteel.java @@ -44,6 +44,7 @@ public class Darksteel extends ExpansionSet { cards.add(new SetCardInfo("Barbed Lightning", 55, Rarity.COMMON, mage.cards.b.BarbedLightning.class)); cards.add(new SetCardInfo("Blinkmoth Nexus", 163, Rarity.RARE, mage.cards.b.BlinkmothNexus.class)); cards.add(new SetCardInfo("Burden of Greed", 38, Rarity.COMMON, mage.cards.b.BurdenOfGreed.class)); + cards.add(new SetCardInfo("Carry Away", 19, Rarity.UNCOMMON, mage.cards.c.CarryAway.class)); cards.add(new SetCardInfo("Chimeric Egg", 106, Rarity.UNCOMMON, mage.cards.c.ChimericEgg.class)); cards.add(new SetCardInfo("Chittering Rats", 39, Rarity.COMMON, mage.cards.c.ChitteringRats.class)); cards.add(new SetCardInfo("Chromescale Drake", 20, Rarity.RARE, mage.cards.c.ChromescaleDrake.class)); diff --git a/Mage/src/main/java/mage/filter/common/FilterEquipmentPermanent.java b/Mage/src/main/java/mage/filter/common/FilterEquipmentPermanent.java new file mode 100644 index 00000000000..d89943199dc --- /dev/null +++ b/Mage/src/main/java/mage/filter/common/FilterEquipmentPermanent.java @@ -0,0 +1,58 @@ + +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.filter.common; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author TheElk801 + */ +public class FilterEquipmentPermanent extends FilterPermanent { + + public FilterEquipmentPermanent() { + this("equipment"); + } + + public FilterEquipmentPermanent(String name) { + super(name); + this.add(new SubtypePredicate(SubType.EQUIPMENT)); + } + + public FilterEquipmentPermanent(final FilterEquipmentPermanent filter) { + super(filter); + } + + @Override + public FilterEquipmentPermanent copy() { + return new FilterEquipmentPermanent(this); + } +} diff --git a/Mage/src/main/java/mage/target/common/TargetEquipmentPermanent.java b/Mage/src/main/java/mage/target/common/TargetEquipmentPermanent.java new file mode 100644 index 00000000000..fb8e266b272 --- /dev/null +++ b/Mage/src/main/java/mage/target/common/TargetEquipmentPermanent.java @@ -0,0 +1,64 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.target.common; + +import mage.filter.common.FilterEquipmentPermanent; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public class TargetEquipmentPermanent extends TargetPermanent { + + public TargetEquipmentPermanent() { + this(1, 1, new FilterEquipmentPermanent(), false); + } + + public TargetEquipmentPermanent(FilterEquipmentPermanent filter) { + this(1, 1, filter, false); + } + + public TargetEquipmentPermanent(int numTargets) { + this(numTargets, numTargets, new FilterEquipmentPermanent(), false); + } + + public TargetEquipmentPermanent(int minNumTargets, int maxNumTargets, FilterEquipmentPermanent filter, boolean notTarget) { + super(minNumTargets, maxNumTargets, filter, notTarget); + } + + public TargetEquipmentPermanent(final TargetEquipmentPermanent target) { + super(target); + } + + @Override + public TargetEquipmentPermanent copy() { + return new TargetEquipmentPermanent(this); + } +} From ae0bd855f00cd44387a02658ecb993d16d26f3f9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Aug 2017 10:00:32 -0400 Subject: [PATCH 10/30] Implement Caverns of Despair --- .../src/mage/cards/c/CavernsOfDespair.java | 123 ++++++++++++++++++ Mage.Sets/src/mage/sets/Legends.java | 1 + 2 files changed, 124 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CavernsOfDespair.java diff --git a/Mage.Sets/src/mage/cards/c/CavernsOfDespair.java b/Mage.Sets/src/mage/cards/c/CavernsOfDespair.java new file mode 100644 index 00000000000..fbfffffd5c7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CavernsOfDespair.java @@ -0,0 +1,123 @@ +/* + * 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.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SuperType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class CavernsOfDespair extends CardImpl { + + public CavernsOfDespair(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); + + this.addSuperType(SuperType.WORLD); + + // No more than two creatures can attack each combat. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CavernsOfDespairAttackRestrictionEffect())); + + // No more than two creatures can block each combat. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CavernsOfDespairBlockRestrictionEffect())); + } + + public CavernsOfDespair(final CavernsOfDespair card) { + super(card); + } + + @Override + public CavernsOfDespair copy() { + return new CavernsOfDespair(this); + } +} + +class CavernsOfDespairAttackRestrictionEffect extends RestrictionEffect { + + public CavernsOfDespairAttackRestrictionEffect() { + super(Duration.WhileOnBattlefield); + staticText = "No more than two creatures can attack each combat"; + } + + public CavernsOfDespairAttackRestrictionEffect(final CavernsOfDespairAttackRestrictionEffect effect) { + super(effect); + } + + @Override + public CavernsOfDespairAttackRestrictionEffect copy() { + return new CavernsOfDespairAttackRestrictionEffect(this); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return true; + } + + @Override + public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) { + return game.getCombat().getAttackers().size() < 2; + } +} + +class CavernsOfDespairBlockRestrictionEffect extends RestrictionEffect { + + public CavernsOfDespairBlockRestrictionEffect() { + super(Duration.WhileOnBattlefield); + staticText = "No more than two creatures can block each combat"; + } + + public CavernsOfDespairBlockRestrictionEffect(final CavernsOfDespairBlockRestrictionEffect effect) { + super(effect); + } + + @Override + public CavernsOfDespairBlockRestrictionEffect copy() { + return new CavernsOfDespairBlockRestrictionEffect(this); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return true; + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return game.getCombat().getBlockers().size() < 2; + } +} diff --git a/Mage.Sets/src/mage/sets/Legends.java b/Mage.Sets/src/mage/sets/Legends.java index 79d4725bb92..d813dfebdf0 100644 --- a/Mage.Sets/src/mage/sets/Legends.java +++ b/Mage.Sets/src/mage/sets/Legends.java @@ -78,6 +78,7 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Boris Devilboon", 263, Rarity.RARE, mage.cards.b.BorisDevilboon.class)); cards.add(new SetCardInfo("Carrion Ants", 4, Rarity.RARE, mage.cards.c.CarrionAnts.class)); cards.add(new SetCardInfo("Cat Warriors", 91, Rarity.COMMON, mage.cards.c.CatWarriors.class)); + cards.add(new SetCardInfo("Caverns of Despair", 136, Rarity.RARE, mage.cards.c.CavernsOfDespair.class)); cards.add(new SetCardInfo("Chain Lightning", 137, Rarity.COMMON, mage.cards.c.ChainLightning.class)); cards.add(new SetCardInfo("Chains of Mephistopheles", 5, Rarity.RARE, mage.cards.c.ChainsOfMephistopheles.class)); cards.add(new SetCardInfo("Chromium", 264, Rarity.RARE, mage.cards.c.Chromium.class)); From 2735bf523d0336bb6d670ae69c826f37eabd5853 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Aug 2017 21:12:09 -0400 Subject: [PATCH 11/30] Implement Amulet of Unmaking --- .../src/mage/cards/a/AmuletOfUnmaking.java | 78 +++++++++++++++++++ Mage.Sets/src/mage/sets/Mirage.java | 1 + 2 files changed, 79 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AmuletOfUnmaking.java diff --git a/Mage.Sets/src/mage/cards/a/AmuletOfUnmaking.java b/Mage.Sets/src/mage/cards/a/AmuletOfUnmaking.java new file mode 100644 index 00000000000..b41e36a527a --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AmuletOfUnmaking.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.a; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ColorlessManaCost; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public class AmuletOfUnmaking extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or enchantment"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public AmuletOfUnmaking(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}"); + + // {5}, {tap}, Exile Amulet of Unmaking: Exile target artifact, creature, or land. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect("Exile target artifact, creature or land"), new ColorlessManaCost(5)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public AmuletOfUnmaking(final AmuletOfUnmaking card) { + super(card); + } + + @Override + public AmuletOfUnmaking copy() { + return new AmuletOfUnmaking(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index 26c435290b0..72418f8f492 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -58,6 +58,7 @@ public class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Alarum", 206, Rarity.COMMON, mage.cards.a.Alarum.class)); cards.add(new SetCardInfo("Aleatory", 155, Rarity.UNCOMMON, mage.cards.a.Aleatory.class)); cards.add(new SetCardInfo("Amber Prison", 257, Rarity.RARE, mage.cards.a.AmberPrison.class)); + cards.add(new SetCardInfo("Amulet of Unmaking", 258, Rarity.RARE, mage.cards.a.AmuletOfUnmaking.class)); cards.add(new SetCardInfo("Ancestral Memories", 52, Rarity.RARE, mage.cards.a.AncestralMemories.class)); cards.add(new SetCardInfo("Armorer Guildmage", 156, Rarity.COMMON, mage.cards.a.ArmorerGuildmage.class)); cards.add(new SetCardInfo("Armor of Thorns", 104, Rarity.COMMON, mage.cards.a.ArmorOfThorns.class)); From 67c9cc84da3bfb2a843799bf1c347f9c59eb5e9d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Aug 2017 21:21:08 -0400 Subject: [PATCH 12/30] Implement Aphetto Exterminator --- .../src/mage/cards/a/AphettoExterminator.java | 74 +++++++++++++++++++ Mage.Sets/src/mage/sets/Legions.java | 1 + 2 files changed, 75 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AphettoExterminator.java diff --git a/Mage.Sets/src/mage/cards/a/AphettoExterminator.java b/Mage.Sets/src/mage/cards/a/AphettoExterminator.java new file mode 100644 index 00000000000..d2aa49be395 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AphettoExterminator.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class AphettoExterminator extends CardImpl { + + public AphettoExterminator(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Morph {3}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{B}"))); + + // When Aphetto Exterminator is turned face up, target creature gets -3/-3 until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new BoostTargetEffect(-3,-3,Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public AphettoExterminator(final AphettoExterminator card) { + super(card); + } + + @Override + public AphettoExterminator copy() { + return new AphettoExterminator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Legions.java b/Mage.Sets/src/mage/sets/Legions.java index a13b2e2f558..47c63b27e47 100644 --- a/Mage.Sets/src/mage/sets/Legions.java +++ b/Mage.Sets/src/mage/sets/Legions.java @@ -56,6 +56,7 @@ public class Legions extends ExpansionSet { this.ratioBoosterMythic = 8; cards.add(new SetCardInfo("Akroma, Angel of Wrath", 1, Rarity.RARE, mage.cards.a.AkromaAngelOfWrath.class)); cards.add(new SetCardInfo("Akroma's Devoted", 2, Rarity.UNCOMMON, mage.cards.a.AkromasDevoted.class)); + cards.add(new SetCardInfo("Aphetto Exterminator", 59, Rarity.UNCOMMON, mage.cards.a.AphettoExterminator.class)); cards.add(new SetCardInfo("Aven Envoy", 30, Rarity.COMMON, mage.cards.a.AvenEnvoy.class)); cards.add(new SetCardInfo("Aven Redeemer", 3, Rarity.COMMON, mage.cards.a.AvenRedeemer.class)); cards.add(new SetCardInfo("Aven Warhawk", 4, Rarity.UNCOMMON, mage.cards.a.AvenWarhawk.class)); From 515fb58bc0b610448031de33fe5534bbafb702c5 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 7 Aug 2017 14:22:09 -0400 Subject: [PATCH 13/30] Implement Balduvian Conjurer, Barrin's Unmaking, Each Mana Battery, Blood Hound and Boa Constrictor --- .../src/mage/cards/b/BalduvianConjurer.java | 91 ++++++++++++ .../src/mage/cards/b/BarrinsUnmaking.java | 129 +++++++++++++++++ .../src/mage/cards/b/BlackManaBattery.java | 83 +++++++++++ Mage.Sets/src/mage/cards/b/BloodHound.java | 136 ++++++++++++++++++ .../src/mage/cards/b/BlueManaBattery.java | 82 +++++++++++ .../src/mage/cards/b/BoaConstrictor.java | 66 +++++++++ .../src/mage/cards/g/GreenManaBattery.java | 82 +++++++++++ .../src/mage/cards/r/RedManaBattery.java | 82 +++++++++++ .../src/mage/cards/w/WhiteManaBattery.java | 82 +++++++++++ Mage.Sets/src/mage/sets/FourthEdition.java | 5 + Mage.Sets/src/mage/sets/IceAge.java | 1 + Mage.Sets/src/mage/sets/Invasion.java | 1 + Mage.Sets/src/mage/sets/Legends.java | 5 + Mage.Sets/src/mage/sets/MastersEditionII.java | 1 + Mage.Sets/src/mage/sets/MercadianMasques.java | 2 + .../RemoveAllCountersSourceEffect.java | 71 +++++++++ 16 files changed, 919 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BalduvianConjurer.java create mode 100644 Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java create mode 100644 Mage.Sets/src/mage/cards/b/BlackManaBattery.java create mode 100644 Mage.Sets/src/mage/cards/b/BloodHound.java create mode 100644 Mage.Sets/src/mage/cards/b/BlueManaBattery.java create mode 100644 Mage.Sets/src/mage/cards/b/BoaConstrictor.java create mode 100644 Mage.Sets/src/mage/cards/g/GreenManaBattery.java create mode 100644 Mage.Sets/src/mage/cards/r/RedManaBattery.java create mode 100644 Mage.Sets/src/mage/cards/w/WhiteManaBattery.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/counter/RemoveAllCountersSourceEffect.java diff --git a/Mage.Sets/src/mage/cards/b/BalduvianConjurer.java b/Mage.Sets/src/mage/cards/b/BalduvianConjurer.java new file mode 100644 index 00000000000..6336e5d2278 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BalduvianConjurer.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.game.permanent.token.Token; +import mage.target.TargetPermanent; + +/** + * + * @author TheElk801 + */ +public class BalduvianConjurer extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("snow land"); + + static { + filter.add(new SupertypePredicate(SuperType.SNOW)); + } + + public BalduvianConjurer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); + + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // {tap}: Target snow land becomes a 2/2 creature until end of turn. It's still a land. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new AnimatedLand(), false, true, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public BalduvianConjurer(final BalduvianConjurer card) { + super(card); + } + + @Override + public BalduvianConjurer copy() { + return new BalduvianConjurer(this); + } +} + +class AnimatedLand extends Token { + + public AnimatedLand() { + super("", "2/2 creature"); + this.cardType.add(CardType.CREATURE); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java b/Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java new file mode 100644 index 00000000000..b2c5c90c9be --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java @@ -0,0 +1,129 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class BarrinsUnmaking extends CardImpl { + + public BarrinsUnmaking(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + // Return target permanent to its owner's hand if that permanent shares a color with the most common color among all permanents or a color tied for most common. + this.getSpellAbility().addEffect(new BarrinsUnmakingEffect()); + this.getSpellAbility().addTarget(new TargetPermanent()); + } + + public BarrinsUnmaking(final BarrinsUnmaking card) { + super(card); + } + + @Override + public BarrinsUnmaking copy() { + return new BarrinsUnmaking(this); + } +} + +class BarrinsUnmakingEffect extends OneShotEffect { + + public BarrinsUnmakingEffect() { + super(Outcome.Detriment); + this.staticText = "Return target permanent to its owner's hand if that permanent shares a color with the most common color among all permanents or a color tied for most common."; + } + + public BarrinsUnmakingEffect(final BarrinsUnmakingEffect effect) { + super(effect); + } + + @Override + public BarrinsUnmakingEffect copy() { + return new BarrinsUnmakingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + FilterPermanent[] colorFilters = new FilterPermanent[6]; + int i = 0; + for (ObjectColor color : ObjectColor.getAllColors()) { + colorFilters[i] = new FilterPermanent(); + colorFilters[i].add(new ColorPredicate(color)); + i++; + } + int[] colorCounts = new int[6]; + i = 0; + for (ObjectColor color : ObjectColor.getAllColors()) { + colorFilters[i].add(new ColorPredicate(color)); + colorCounts[i] = new PermanentsOnBattlefieldCount(colorFilters[i]).calculate(game, source, this); + i++; + } + int max = 0; + for (i = 0; i < 5; i++) { + if (colorCounts[i] > max) { + max = colorCounts[i] * 1; + } + } + i = 0; + ObjectColor commonest = new ObjectColor(); + for (ObjectColor color : ObjectColor.getAllColors()) { + if (colorCounts[i] == max) { + commonest.addColor(color); + } + i++; + } + ObjectColor permColor = permanent.getColor(game); + if (permColor.shares(commonest)) { + Effect effect = new ReturnToHandTargetEffect(); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + return effect.apply(game, source); + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/b/BlackManaBattery.java b/Mage.Sets/src/mage/cards/b/BlackManaBattery.java new file mode 100644 index 00000000000..8e6449f4d12 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BlackManaBattery.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveVariableCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.IntPlusDynamicValue; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author TheElk801 + */ +public class BlackManaBattery extends CardImpl { + + public BlackManaBattery(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + + // {2}, {tap}: Put a charge counter on Black Mana Battery. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance(1)), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {tap}, Remove any number of charge counters from Black Mana Battery: Add {B} to your mana pool, then add an additional {B} to your mana pool for each charge counter removed this way. + ability = new DynamicManaAbility( + Mana.BlackMana(1), + new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new TapSourceCost(), + "Add {B} to your mana pool, then add {B} to your mana pool for each storage counter removed this way", + true, new CountersSourceCount(CounterType.STORAGE)); + ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), + "Remove X storage counters from {this}")); + this.addAbility(ability); + } + + public BlackManaBattery(final BlackManaBattery card) { + super(card); + } + + @Override + public BlackManaBattery copy() { + return new BlackManaBattery(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BloodHound.java b/Mage.Sets/src/mage/cards/b/BloodHound.java new file mode 100644 index 00000000000..7e5560d499c --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BloodHound.java @@ -0,0 +1,136 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RemoveAllCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author TheElk801 + */ +public class BloodHound extends CardImpl { + + public BloodHound(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add("Hound"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever you're dealt damage, you may put that many +1/+1 counters on Blood Hound. + this.addAbility(new BloodHoundTriggeredAbility()); + + // At the beginning of your end step, remove all +1/+1 counters from Blood Hound. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new RemoveAllCountersSourceEffect(CounterType.P1P1), TargetController.YOU, false)); + } + + public BloodHound(final BloodHound card) { + super(card); + } + + @Override + public BloodHound copy() { + return new BloodHound(this); + } +} + +class BloodHoundTriggeredAbility extends TriggeredAbilityImpl { + + public BloodHoundTriggeredAbility() { + super(Zone.BATTLEFIELD, new BloodHoundEffect(), true); + } + + public BloodHoundTriggeredAbility(final BloodHoundTriggeredAbility ability) { + super(ability); + } + + @Override + public BloodHoundTriggeredAbility copy() { + return new BloodHoundTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getTargetId().equals(this.getControllerId())) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you are dealt damage, you may put that many +1/+1 counters on {this}."; + } +} + +class BloodHoundEffect extends OneShotEffect { + + public BloodHoundEffect() { + super(Outcome.Benefit); + } + + public BloodHoundEffect(final BloodHoundEffect effect) { + super(effect); + } + + @Override + public BloodHoundEffect copy() { + return new BloodHoundEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.addCounters(CounterType.P1P1.createInstance((Integer) this.getValue("damageAmount")), source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/b/BlueManaBattery.java b/Mage.Sets/src/mage/cards/b/BlueManaBattery.java new file mode 100644 index 00000000000..410b81cb00a --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BlueManaBattery.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveVariableCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.IntPlusDynamicValue; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author TheElk801 + */ +public class BlueManaBattery extends CardImpl { + + public BlueManaBattery(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + // {2}, {tap}: Put a charge counter on Blue Mana Battery. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance(1)), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {tap}, Remove any number of charge counters from Blue Mana Battery: Add {U} to your mana pool, then add an additional {U} to your mana pool for each charge counter removed this way. + ability = new DynamicManaAbility( + Mana.BlueMana(1), + new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new TapSourceCost(), + "Add {U} to your mana pool, then add {U} to your mana pool for each storage counter removed this way", + true, new CountersSourceCount(CounterType.STORAGE)); + ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), + "Remove X storage counters from {this}")); + this.addAbility(ability); + } + + public BlueManaBattery(final BlueManaBattery card) { + super(card); + } + + @Override + public BlueManaBattery copy() { + return new BlueManaBattery(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BoaConstrictor.java b/Mage.Sets/src/mage/cards/b/BoaConstrictor.java new file mode 100644 index 00000000000..1200af9109f --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BoaConstrictor.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class BoaConstrictor extends CardImpl { + + public BoaConstrictor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}"); + + this.subtype.add("Snake"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {tap}: Boa Constrictor gets +3/+3 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn), new TapSourceCost())); + } + + public BoaConstrictor(final BoaConstrictor card) { + super(card); + } + + @Override + public BoaConstrictor copy() { + return new BoaConstrictor(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/GreenManaBattery.java b/Mage.Sets/src/mage/cards/g/GreenManaBattery.java new file mode 100644 index 00000000000..7a407edcc5b --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GreenManaBattery.java @@ -0,0 +1,82 @@ +/* + * 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.g; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveVariableCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.IntPlusDynamicValue; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author TheElk801 + */ +public class GreenManaBattery extends CardImpl { + + public GreenManaBattery(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + // {2}, {tap}: Put a charge counter on Green Mana Battery. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance(1)), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {tap}, Remove any number of charge counters from Green Mana Battery: Add {G} to your mana pool, then add an additional {G} to your mana pool for each charge counter removed this way. + ability = new DynamicManaAbility( + Mana.GreenMana(1), + new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new TapSourceCost(), + "Add {G} to your mana pool, then add {G} to your mana pool for each storage counter removed this way", + true, new CountersSourceCount(CounterType.STORAGE)); + ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), + "Remove X storage counters from {this}")); + this.addAbility(ability); + } + + public GreenManaBattery(final GreenManaBattery card) { + super(card); + } + + @Override + public GreenManaBattery copy() { + return new GreenManaBattery(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RedManaBattery.java b/Mage.Sets/src/mage/cards/r/RedManaBattery.java new file mode 100644 index 00000000000..2b6fbe11d03 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RedManaBattery.java @@ -0,0 +1,82 @@ +/* + * 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.r; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveVariableCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.IntPlusDynamicValue; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author TheElk801 + */ +public class RedManaBattery extends CardImpl { + + public RedManaBattery(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + // {2}, {tap}: Put a charge counter on Red Mana Battery. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance(1)), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {tap}, Remove any number of charge counters from Red Mana Battery: Add {R} to your mana pool, then add an additional {R} to your mana pool for each charge counter removed this way. + ability = new DynamicManaAbility( + Mana.RedMana(1), + new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new TapSourceCost(), + "Add {R} to your mana pool, then add {R} to your mana pool for each storage counter removed this way", + true, new CountersSourceCount(CounterType.STORAGE)); + ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), + "Remove X storage counters from {this}")); + this.addAbility(ability); + } + + public RedManaBattery(final RedManaBattery card) { + super(card); + } + + @Override + public RedManaBattery copy() { + return new RedManaBattery(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WhiteManaBattery.java b/Mage.Sets/src/mage/cards/w/WhiteManaBattery.java new file mode 100644 index 00000000000..fada4c7f921 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WhiteManaBattery.java @@ -0,0 +1,82 @@ +/* + * 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.w; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveVariableCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.IntPlusDynamicValue; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author TheElk801 + */ +public class WhiteManaBattery extends CardImpl { + + public WhiteManaBattery(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + // {2}, {tap}: Put a charge counter on White Mana Battery. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance(1)), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {tap}, Remove any number of charge counters from White Mana Battery: Add {W} to your mana pool, then add an additional {W} to your mana pool for each charge counter removed this way. + ability = new DynamicManaAbility( + Mana.WhiteMana(1), + new IntPlusDynamicValue(1, new RemovedCountersForCostValue()), + new TapSourceCost(), + "Add {W} to your mana pool, then add {W} to your mana pool for each storage counter removed this way", + true, new CountersSourceCount(CounterType.STORAGE)); + ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(), + "Remove X storage counters from {this}")); + this.addAbility(ability); + } + + public WhiteManaBattery(final WhiteManaBattery card) { + super(card); + } + + @Override + public WhiteManaBattery copy() { + return new WhiteManaBattery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/FourthEdition.java b/Mage.Sets/src/mage/sets/FourthEdition.java index 88073439fce..d4241a2d0b4 100644 --- a/Mage.Sets/src/mage/sets/FourthEdition.java +++ b/Mage.Sets/src/mage/sets/FourthEdition.java @@ -78,12 +78,14 @@ public class FourthEdition extends ExpansionSet { cards.add(new SetCardInfo("Bird Maiden", 195, Rarity.COMMON, mage.cards.b.BirdMaiden.class)); cards.add(new SetCardInfo("Birds of Paradise", 118, Rarity.RARE, mage.cards.b.BirdsOfParadise.class)); cards.add(new SetCardInfo("Black Knight", 5, Rarity.UNCOMMON, mage.cards.b.BlackKnight.class)); + cards.add(new SetCardInfo("Black Mana Battery", 316, Rarity.RARE, mage.cards.b.BlackManaBattery.class)); cards.add(new SetCardInfo("Black Vise", 317, Rarity.UNCOMMON, mage.cards.b.BlackVise.class)); cards.add(new SetCardInfo("Black Ward", 258, Rarity.UNCOMMON, mage.cards.b.BlackWard.class)); cards.add(new SetCardInfo("Blessing", 259, Rarity.RARE, mage.cards.b.Blessing.class)); cards.add(new SetCardInfo("Blight", 6, Rarity.UNCOMMON, mage.cards.b.Blight.class)); cards.add(new SetCardInfo("Blood Lust", 196, Rarity.COMMON, mage.cards.b.BloodLust.class)); cards.add(new SetCardInfo("Blue Elemental Blast", 63, Rarity.COMMON, mage.cards.b.BlueElementalBlast.class)); + cards.add(new SetCardInfo("Blue Mana Battery", 318, Rarity.RARE, mage.cards.b.BlueManaBattery.class)); cards.add(new SetCardInfo("Blue Ward", 260, Rarity.UNCOMMON, mage.cards.b.BlueWard.class)); cards.add(new SetCardInfo("Bog Imp", 7, Rarity.COMMON, mage.cards.b.BogImp.class)); cards.add(new SetCardInfo("Bog Wraith", 8, Rarity.UNCOMMON, mage.cards.b.BogWraith.class)); @@ -188,6 +190,7 @@ public class FourthEdition extends ExpansionSet { cards.add(new SetCardInfo("Grapeshot Catapult", 340, Rarity.COMMON, mage.cards.g.GrapeshotCatapult.class)); cards.add(new SetCardInfo("Gray Ogre", 218, Rarity.COMMON, mage.cards.g.GrayOgre.class)); cards.add(new SetCardInfo("Greed", 24, Rarity.RARE, mage.cards.g.Greed.class)); + cards.add(new SetCardInfo("Green Mana Battery", 341, Rarity.RARE, mage.cards.g.GreenManaBattery.class)); cards.add(new SetCardInfo("Green Ward", 277, Rarity.UNCOMMON, mage.cards.g.GreenWard.class)); cards.add(new SetCardInfo("Grizzly Bears", 134, Rarity.COMMON, mage.cards.g.GrizzlyBears.class)); cards.add(new SetCardInfo("Healing Salve", 278, Rarity.COMMON, mage.cards.h.HealingSalve.class)); @@ -297,6 +300,7 @@ public class FourthEdition extends ExpansionSet { cards.add(new SetCardInfo("Rag Man", 39, Rarity.RARE, mage.cards.r.RagMan.class)); cards.add(new SetCardInfo("Raise Dead", 40, Rarity.COMMON, mage.cards.r.RaiseDead.class)); cards.add(new SetCardInfo("Red Elemental Blast", 236, Rarity.COMMON, mage.cards.r.RedElementalBlast.class)); + cards.add(new SetCardInfo("Red Mana Battery", 361, Rarity.RARE, mage.cards.r.RedManaBattery.class)); cards.add(new SetCardInfo("Red Ward", 294, Rarity.UNCOMMON, mage.cards.r.RedWard.class)); cards.add(new SetCardInfo("Regeneration", 152, Rarity.COMMON, mage.cards.r.Regeneration.class)); cards.add(new SetCardInfo("Reverse Damage", 295, Rarity.RARE, mage.cards.r.ReverseDamage.class)); @@ -385,6 +389,7 @@ public class FourthEdition extends ExpansionSet { cards.add(new SetCardInfo("Web", 171, Rarity.RARE, mage.cards.w.Web.class)); cards.add(new SetCardInfo("Whirling Dervish", 172, Rarity.UNCOMMON, mage.cards.w.WhirlingDervish.class)); cards.add(new SetCardInfo("White Knight", 306, Rarity.UNCOMMON, mage.cards.w.WhiteKnight.class)); + cards.add(new SetCardInfo("White Mana Battery", 375, Rarity.RARE, mage.cards.w.WhiteManaBattery.class)); cards.add(new SetCardInfo("White Ward", 307, Rarity.UNCOMMON, mage.cards.w.WhiteWard.class)); cards.add(new SetCardInfo("Wild Growth", 173, Rarity.COMMON, mage.cards.w.WildGrowth.class)); cards.add(new SetCardInfo("Will-o'-the-Wisp", 55, Rarity.RARE, mage.cards.w.WillOTheWisp.class)); diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index 58fb05aeab8..f3e74505d14 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -64,6 +64,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Aurochs", 113, Rarity.COMMON, mage.cards.a.Aurochs.class)); cards.add(new SetCardInfo("Balduvian Barbarians", 172, Rarity.COMMON, mage.cards.b.BalduvianBarbarians.class)); cards.add(new SetCardInfo("Balduvian Bears", 114, Rarity.COMMON, mage.cards.b.BalduvianBears.class)); + cards.add(new SetCardInfo("Balduvian Conjurer", 58, Rarity.UNCOMMON, mage.cards.b.BalduvianConjurer.class)); cards.add(new SetCardInfo("Balduvian Hydra", 173, Rarity.RARE, mage.cards.b.BalduvianHydra.class)); cards.add(new SetCardInfo("Barbed Sextant", 287, Rarity.COMMON, mage.cards.b.BarbedSextant.class)); cards.add(new SetCardInfo("Battle Frenzy", 175, Rarity.COMMON, mage.cards.b.BattleFrenzy.class)); diff --git a/Mage.Sets/src/mage/sets/Invasion.java b/Mage.Sets/src/mage/sets/Invasion.java index 72a2a51d0b2..c738e1abd43 100644 --- a/Mage.Sets/src/mage/sets/Invasion.java +++ b/Mage.Sets/src/mage/sets/Invasion.java @@ -74,6 +74,7 @@ public class Invasion extends ExpansionSet { cards.add(new SetCardInfo("Aura Mutation", 232, Rarity.RARE, mage.cards.a.AuraMutation.class)); cards.add(new SetCardInfo("Aura Shards", 233, Rarity.UNCOMMON, mage.cards.a.AuraShards.class)); cards.add(new SetCardInfo("Backlash", 234, Rarity.UNCOMMON, mage.cards.b.Backlash.class)); + cards.add(new SetCardInfo("Barrin's Unmaking", 46, Rarity.COMMON, mage.cards.b.BarrinsUnmaking.class)); cards.add(new SetCardInfo("Benalish Emissary", 5, Rarity.UNCOMMON, mage.cards.b.BenalishEmissary.class)); cards.add(new SetCardInfo("Benalish Heralds", 6, Rarity.UNCOMMON, mage.cards.b.BenalishHeralds.class)); cards.add(new SetCardInfo("Benalish Lancer", 7, Rarity.COMMON, mage.cards.b.BenalishLancer.class)); diff --git a/Mage.Sets/src/mage/sets/Legends.java b/Mage.Sets/src/mage/sets/Legends.java index d813dfebdf0..6c6865ca0df 100644 --- a/Mage.Sets/src/mage/sets/Legends.java +++ b/Mage.Sets/src/mage/sets/Legends.java @@ -72,8 +72,10 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Barktooth Warbeard", 261, Rarity.UNCOMMON, mage.cards.b.BarktoothWarbeard.class)); cards.add(new SetCardInfo("Bartel Runeaxe", 262, Rarity.RARE, mage.cards.b.BartelRuneaxe.class)); cards.add(new SetCardInfo("Beasts of Bogardan", 133, Rarity.UNCOMMON, mage.cards.b.BeastsOfBogardan.class)); + cards.add(new SetCardInfo("Black Mana Battery", 216, Rarity.UNCOMMON, mage.cards.b.BlackManaBattery.class)); cards.add(new SetCardInfo("Blight", 3, Rarity.UNCOMMON, mage.cards.b.Blight.class)); cards.add(new SetCardInfo("Blood Lust", 135, Rarity.UNCOMMON, mage.cards.b.BloodLust.class)); + cards.add(new SetCardInfo("Blue Mana Battery", 217, Rarity.UNCOMMON, mage.cards.b.BlueManaBattery.class)); cards.add(new SetCardInfo("Boomerang", 48, Rarity.COMMON, mage.cards.b.Boomerang.class)); cards.add(new SetCardInfo("Boris Devilboon", 263, Rarity.RARE, mage.cards.b.BorisDevilboon.class)); cards.add(new SetCardInfo("Carrion Ants", 4, Rarity.RARE, mage.cards.c.CarrionAnts.class)); @@ -120,6 +122,7 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Gravity Sphere", 149, Rarity.RARE, mage.cards.g.GravitySphere.class)); cards.add(new SetCardInfo("Great Defender", 185, Rarity.UNCOMMON, mage.cards.g.GreatDefender.class)); cards.add(new SetCardInfo("Greed", 15, Rarity.RARE, mage.cards.g.Greed.class)); + cards.add(new SetCardInfo("Green Mana Battery", 223, Rarity.UNCOMMON, mage.cards.g.GreenManaBattery.class)); cards.add(new SetCardInfo("Gwendlyn Di Corci", 268, Rarity.RARE, mage.cards.g.GwendlynDiCorci.class)); cards.add(new SetCardInfo("Hazezon Tamar", 270, Rarity.RARE, mage.cards.h.HazezonTamar.class)); cards.add(new SetCardInfo("Headless Horseman", 16, Rarity.COMMON, mage.cards.h.HeadlessHorseman.class)); @@ -190,6 +193,7 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Ramses Overdark", 292, Rarity.RARE, mage.cards.r.RamsesOverdark.class)); cards.add(new SetCardInfo("Rasputin Dreamweaver", 293, Rarity.RARE, mage.cards.r.RasputinDreamweaver.class)); cards.add(new SetCardInfo("Recall", 70, Rarity.RARE, mage.cards.r.Recall.class)); + cards.add(new SetCardInfo("Red Mana Battery", 236, Rarity.UNCOMMON, mage.cards.r.RedManaBattery.class)); cards.add(new SetCardInfo("Reincarnation", 115, Rarity.UNCOMMON, mage.cards.r.Reincarnation.class)); cards.add(new SetCardInfo("Relic Barrier", 237, Rarity.UNCOMMON, mage.cards.r.RelicBarrier.class)); cards.add(new SetCardInfo("Remove Soul", 72, Rarity.COMMON, mage.cards.r.RemoveSoul.class)); @@ -245,6 +249,7 @@ public class Legends extends ExpansionSet { cards.add(new SetCardInfo("Wall of Putrid Flesh", 41, Rarity.UNCOMMON, mage.cards.w.WallOfPutridFlesh.class)); cards.add(new SetCardInfo("Wall of Wonder", 85, Rarity.UNCOMMON, mage.cards.w.WallOfWonder.class)); cards.add(new SetCardInfo("Whirling Dervish", 125, Rarity.UNCOMMON, mage.cards.w.WhirlingDervish.class)); + cards.add(new SetCardInfo("White Mana Battery", 244, Rarity.UNCOMMON, mage.cards.w.WhiteManaBattery.class)); cards.add(new SetCardInfo("Willow Satyr", 126, Rarity.RARE, mage.cards.w.WillowSatyr.class)); cards.add(new SetCardInfo("Winds of Change", 169, Rarity.UNCOMMON, mage.cards.w.WindsOfChange.class)); cards.add(new SetCardInfo("Wolverine Pack", 128, Rarity.COMMON, mage.cards.w.WolverinePack.class)); diff --git a/Mage.Sets/src/mage/sets/MastersEditionII.java b/Mage.Sets/src/mage/sets/MastersEditionII.java index a80272d1ad7..79023902049 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionII.java @@ -77,6 +77,7 @@ public class MastersEditionII extends ExpansionSet { cards.add(new SetCardInfo("Aurochs", 153, Rarity.COMMON, mage.cards.a.Aurochs.class)); cards.add(new SetCardInfo("Aysen Bureaucrats", 6, Rarity.COMMON, mage.cards.a.AysenBureaucrats.class)); cards.add(new SetCardInfo("Badlands", 225, Rarity.RARE, mage.cards.b.Badlands.class)); + cards.add(new SetCardInfo("Balduvian Conjurer", 40, Rarity.COMMON, mage.cards.b.BalduvianConjurer.class)); cards.add(new SetCardInfo("Balduvian Dead", 79, Rarity.UNCOMMON, mage.cards.b.BalduvianDead.class)); cards.add(new SetCardInfo("Balduvian Hydra", 118, Rarity.RARE, mage.cards.b.BalduvianHydra.class)); cards.add(new SetCardInfo("Balduvian Trading Post", 226, Rarity.RARE, mage.cards.b.BalduvianTradingPost.class)); diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index 26096d0e86a..807574c5951 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -66,6 +66,8 @@ public class MercadianMasques extends ExpansionSet { cards.add(new SetCardInfo("Black Market", 116, Rarity.RARE, mage.cards.b.BlackMarket.class)); cards.add(new SetCardInfo("Blaster Mage", 175, Rarity.COMMON, mage.cards.b.BlasterMage.class)); cards.add(new SetCardInfo("Blockade Runner", 60, Rarity.COMMON, mage.cards.b.BlockadeRunner.class)); + cards.add(new SetCardInfo("Blood Hound", 176, Rarity.RARE, mage.cards.b.BloodHound.class)); + cards.add(new SetCardInfo("Boa Constrictor", 231, Rarity.UNCOMMON, mage.cards.b.BoaConstrictor.class)); cards.add(new SetCardInfo("Bog Smugglers", 117, Rarity.COMMON, mage.cards.b.BogSmugglers.class)); cards.add(new SetCardInfo("Bog Witch", 118, Rarity.COMMON, mage.cards.b.BogWitch.class)); cards.add(new SetCardInfo("Brainstorm", 61, Rarity.COMMON, mage.cards.b.Brainstorm.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveAllCountersSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveAllCountersSourceEffect.java new file mode 100644 index 00000000000..10b24748f45 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveAllCountersSourceEffect.java @@ -0,0 +1,71 @@ +/* + * 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.abilities.effects.common.counter; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author TheElk801 + */ +public class RemoveAllCountersSourceEffect extends OneShotEffect { + + private final CounterType counterType; + + public RemoveAllCountersSourceEffect(CounterType counterType) { + super(Outcome.Neutral); + this.counterType = counterType; + staticText = "remove all " + counterType.getName() + " counters from {this}."; + } + + public RemoveAllCountersSourceEffect(RemoveAllCountersSourceEffect effect) { + super(effect); + this.counterType = effect.counterType; + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if(permanent != null) { + int count = permanent.getCounters(game).getCount(counterType); + permanent.removeCounters(counterType.getName(), count, game); + return true; + } + return false; + } + + @Override + public RemoveAllCountersSourceEffect copy() { + return new RemoveAllCountersSourceEffect(this); + } +} From 3abe707784c1cab8eddb69a7e93b2c4d884379c4 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 7 Aug 2017 20:54:18 -0400 Subject: [PATCH 14/30] Implement Bola Warrior, Brass Talon Chimera, Briar Patch and Brine Shaman --- Mage.Sets/src/mage/cards/b/BolaWarrior.java | 76 +++++++++++++++ .../src/mage/cards/b/BrassTalonChimera.java | 85 +++++++++++++++++ Mage.Sets/src/mage/cards/b/BriarPatch.java | 66 +++++++++++++ Mage.Sets/src/mage/cards/b/BrineShaman.java | 93 +++++++++++++++++++ Mage.Sets/src/mage/sets/IceAge.java | 1 + Mage.Sets/src/mage/sets/MastersEditionII.java | 1 + Mage.Sets/src/mage/sets/MercadianMasques.java | 1 + Mage.Sets/src/mage/sets/Nemesis.java | 1 + Mage.Sets/src/mage/sets/Visions.java | 1 + 9 files changed, 325 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BolaWarrior.java create mode 100644 Mage.Sets/src/mage/cards/b/BrassTalonChimera.java create mode 100644 Mage.Sets/src/mage/cards/b/BriarPatch.java create mode 100644 Mage.Sets/src/mage/cards/b/BrineShaman.java diff --git a/Mage.Sets/src/mage/cards/b/BolaWarrior.java b/Mage.Sets/src/mage/cards/b/BolaWarrior.java new file mode 100644 index 00000000000..fb33e2a0b2d --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BolaWarrior.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class BolaWarrior extends CardImpl { + + public BolaWarrior(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {R}, {tap}, Discard a card: Target creature can't block this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public BolaWarrior(final BolaWarrior card) { + super(card); + } + + @Override + public BolaWarrior copy() { + return new BolaWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BrassTalonChimera.java b/Mage.Sets/src/mage/cards/b/BrassTalonChimera.java new file mode 100644 index 00000000000..d78366e1ca6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BrassTalonChimera.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class BrassTalonChimera extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Beast creature you control"); + + static { + filter.add(new SubtypePredicate(SubType.CHIMERA)); + } + + public BrassTalonChimera(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + + this.subtype.add("Chimera"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Sacrifice Brass-Talon Chimera: Put a +2/+2 counter on target Chimera creature. It gains first strike. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P2P2.createInstance()), new SacrificeSourceCost()); + ability.addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield)); + ability.addTarget(new TargetCreaturePermanent(filter)); + } + + public BrassTalonChimera(final BrassTalonChimera card) { + super(card); + } + + @Override + public BrassTalonChimera copy() { + return new BrassTalonChimera(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BriarPatch.java b/Mage.Sets/src/mage/cards/b/BriarPatch.java new file mode 100644 index 00000000000..feef4a8020f --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BriarPatch.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.AttackedByCreatureTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class BriarPatch extends CardImpl { + + public BriarPatch(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); + + // Whenever a creature attacks you, it gets -1/-0 until end of turn. + Effect effect = new BoostTargetEffect(-1, 0, Duration.EndOfTurn); + effect.setText("it gets -1/-0"); + Ability ability = new AttackedByCreatureTriggeredAbility(Zone.BATTLEFIELD, effect, false, SetTargetPointer.PERMANENT); + this.getAbilities().add(ability); + } + + public BriarPatch(final BriarPatch card) { + super(card); + } + + @Override + public BriarPatch copy() { + return new BriarPatch(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BrineShaman.java b/Mage.Sets/src/mage/cards/b/BrineShaman.java new file mode 100644 index 00000000000..95b315b4a45 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BrineShaman.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetSpell; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class BrineShaman extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("noncreature spell"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public BrineShaman(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); + + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Shaman"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Sacrifice a creature: Target creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {1}{U}{U}, Sacrifice a creature: Counter target creature spell. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new ManaCostsImpl("{1}{U}{U}")); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public BrineShaman(final BrineShaman card) { + super(card); + } + + @Override + public BrineShaman copy() { + return new BrineShaman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index f3e74505d14..7b6062d378f 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -75,6 +75,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Blue Scarab", 233, Rarity.UNCOMMON, mage.cards.b.BlueScarab.class)); cards.add(new SetCardInfo("Brainstorm", 61, Rarity.COMMON, mage.cards.b.Brainstorm.class)); cards.add(new SetCardInfo("Brand of Ill Omen", 177, Rarity.RARE, mage.cards.b.BrandOfIllOmen.class)); + cards.add(new SetCardInfo("Brine Shaman", 3, Rarity.COMMON, mage.cards.b.BrineShaman.class)); cards.add(new SetCardInfo("Brown Ouphe", 116, Rarity.COMMON, mage.cards.b.BrownOuphe.class)); cards.add(new SetCardInfo("Brushland", 327, Rarity.RARE, mage.cards.b.Brushland.class)); cards.add(new SetCardInfo("Burnt Offering", 4, Rarity.COMMON, mage.cards.b.BurntOffering.class)); diff --git a/Mage.Sets/src/mage/sets/MastersEditionII.java b/Mage.Sets/src/mage/sets/MastersEditionII.java index 79023902049..c20addee7b6 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionII.java @@ -87,6 +87,7 @@ public class MastersEditionII extends ExpansionSet { cards.add(new SetCardInfo("Brainstorm", 42, Rarity.COMMON, mage.cards.b.Brainstorm.class)); cards.add(new SetCardInfo("Brassclaw Orcs", 119, Rarity.COMMON, BrassclawOrcs.class)); cards.add(new SetCardInfo("Brimstone Dragon", 120, Rarity.RARE, mage.cards.b.BrimstoneDragon.class)); + cards.add(new SetCardInfo("Brine Shaman", 80, Rarity.COMMON, mage.cards.b.BrineShaman.class)); cards.add(new SetCardInfo("Browse", 43, Rarity.UNCOMMON, mage.cards.b.Browse.class)); cards.add(new SetCardInfo("Burnout", 121, Rarity.UNCOMMON, mage.cards.b.Burnout.class)); cards.add(new SetCardInfo("Carapace", 155, Rarity.COMMON, mage.cards.c.Carapace.class)); diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index 807574c5951..ee14c79b3bb 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -71,6 +71,7 @@ public class MercadianMasques extends ExpansionSet { cards.add(new SetCardInfo("Bog Smugglers", 117, Rarity.COMMON, mage.cards.b.BogSmugglers.class)); cards.add(new SetCardInfo("Bog Witch", 118, Rarity.COMMON, mage.cards.b.BogWitch.class)); cards.add(new SetCardInfo("Brainstorm", 61, Rarity.COMMON, mage.cards.b.Brainstorm.class)); + cards.add(new SetCardInfo("Briar Patch", 232, Rarity.UNCOMMON, mage.cards.b.BriarPatch.class)); cards.add(new SetCardInfo("Bribery", 62, Rarity.RARE, mage.cards.b.Bribery.class)); cards.add(new SetCardInfo("Buoyancy", 63, Rarity.COMMON, mage.cards.b.Buoyancy.class)); cards.add(new SetCardInfo("Cackling Witch", 119, Rarity.UNCOMMON, mage.cards.c.CacklingWitch.class)); diff --git a/Mage.Sets/src/mage/sets/Nemesis.java b/Mage.Sets/src/mage/sets/Nemesis.java index 7f0cb545c69..471b321232f 100644 --- a/Mage.Sets/src/mage/sets/Nemesis.java +++ b/Mage.Sets/src/mage/sets/Nemesis.java @@ -67,6 +67,7 @@ public class Nemesis extends ExpansionSet { cards.add(new SetCardInfo("Belbe's Portal", 127, Rarity.RARE, mage.cards.b.BelbesPortal.class)); cards.add(new SetCardInfo("Blastoderm", 102, Rarity.COMMON, mage.cards.b.Blastoderm.class)); cards.add(new SetCardInfo("Blinding Angel", 3, Rarity.RARE, mage.cards.b.BlindingAngel.class)); + cards.add(new SetCardInfo("Bola Warrior", 78, Rarity.COMMON, mage.cards.b.BolaWarrior.class)); cards.add(new SetCardInfo("Carrion Wall", 54, Rarity.UNCOMMON, mage.cards.c.CarrionWall.class)); cards.add(new SetCardInfo("Cloudskate", 29, Rarity.COMMON, mage.cards.c.Cloudskate.class)); cards.add(new SetCardInfo("Daze", 30, Rarity.COMMON, mage.cards.d.Daze.class)); diff --git a/Mage.Sets/src/mage/sets/Visions.java b/Mage.Sets/src/mage/sets/Visions.java index f4f5d16e3bc..3cad14bac12 100644 --- a/Mage.Sets/src/mage/sets/Visions.java +++ b/Mage.Sets/src/mage/sets/Visions.java @@ -59,6 +59,7 @@ public class Visions extends ExpansionSet { cards.add(new SetCardInfo("Army Ants", 126, Rarity.UNCOMMON, mage.cards.a.ArmyAnts.class)); cards.add(new SetCardInfo("Betrayal", 26, Rarity.COMMON, mage.cards.b.Betrayal.class)); cards.add(new SetCardInfo("Blanket of Night", 2, Rarity.UNCOMMON, mage.cards.b.BlanketOfNight.class)); + cards.add(new SetCardInfo("Brass-Talon Chimera", 142, Rarity.UNCOMMON, mage.cards.b.BrassTalonChimera.class)); cards.add(new SetCardInfo("Breathstealer's Crypt", 127, Rarity.RARE, mage.cards.b.BreathstealersCrypt.class)); cards.add(new SetCardInfo("Breezekeeper", 27, Rarity.COMMON, mage.cards.b.Breezekeeper.class)); cards.add(new SetCardInfo("Bull Elephant", 51, Rarity.COMMON, mage.cards.b.BullElephant.class)); From e47798d6c9296bf68dd46c61b1ba7eaae445f68d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 8 Aug 2017 14:28:32 -0400 Subject: [PATCH 15/30] Implemented Call to Arms, Goham Djinn, Halam Djinn, Ruham Djinn, Sulam Djinn, Zanam Djinn, Heroic Defiance and Tsabo's Assassin, updated Barrin's Unmaking and Epicenter --- .../src/mage/cards/b/BarrinsUnmaking.java | 40 +--- Mage.Sets/src/mage/cards/c/CallToArms.java | 171 ++++++++++++++++++ Mage.Sets/src/mage/cards/e/Epicenter.java | 7 +- Mage.Sets/src/mage/cards/g/GohamDjinn.java | 72 ++++++++ Mage.Sets/src/mage/cards/h/HalamDjinn.java | 75 ++++++++ .../src/mage/cards/h/HeroicDefiance.java | 102 +++++++++++ Mage.Sets/src/mage/cards/r/RuhamDjinn.java | 76 ++++++++ Mage.Sets/src/mage/cards/s/SulamDjinn.java | 75 ++++++++ .../src/mage/cards/t/TsabosAssassin.java | 108 +++++++++++ Mage.Sets/src/mage/cards/z/ZanamDjinn.java | 75 ++++++++ Mage.Sets/src/mage/sets/IceAge.java | 1 + Mage.Sets/src/mage/sets/Invasion.java | 7 + .../src/mage/sets/MastersEditionIII.java | 1 + Mage.Sets/src/mage/sets/Planeshift.java | 1 + .../common/MostCommonColorCondition.java | 87 +++++++++ 15 files changed, 860 insertions(+), 38 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/c/CallToArms.java create mode 100644 Mage.Sets/src/mage/cards/g/GohamDjinn.java create mode 100644 Mage.Sets/src/mage/cards/h/HalamDjinn.java create mode 100644 Mage.Sets/src/mage/cards/h/HeroicDefiance.java create mode 100644 Mage.Sets/src/mage/cards/r/RuhamDjinn.java create mode 100644 Mage.Sets/src/mage/cards/s/SulamDjinn.java create mode 100644 Mage.Sets/src/mage/cards/t/TsabosAssassin.java create mode 100644 Mage.Sets/src/mage/cards/z/ZanamDjinn.java create mode 100644 Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java diff --git a/Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java b/Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java index b2c5c90c9be..2ef729a53cc 100644 --- a/Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java +++ b/Mage.Sets/src/mage/cards/b/BarrinsUnmaking.java @@ -28,9 +28,9 @@ package mage.cards.b; import java.util.UUID; -import mage.ObjectColor; import mage.abilities.Ability; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.MostCommonColorCondition; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; @@ -38,8 +38,6 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -54,7 +52,7 @@ public class BarrinsUnmaking extends CardImpl { public BarrinsUnmaking(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); - // Return target permanent to its owner's hand if that permanent shares a color with the most common color among all permanents or a color tied for most common. + // Return target permanent to its owner's hand if that permanent shares a color with the most common color among all permanents or a color tied for most common. this.getSpellAbility().addEffect(new BarrinsUnmakingEffect()); this.getSpellAbility().addTarget(new TargetPermanent()); } @@ -89,36 +87,8 @@ class BarrinsUnmakingEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { - FilterPermanent[] colorFilters = new FilterPermanent[6]; - int i = 0; - for (ObjectColor color : ObjectColor.getAllColors()) { - colorFilters[i] = new FilterPermanent(); - colorFilters[i].add(new ColorPredicate(color)); - i++; - } - int[] colorCounts = new int[6]; - i = 0; - for (ObjectColor color : ObjectColor.getAllColors()) { - colorFilters[i].add(new ColorPredicate(color)); - colorCounts[i] = new PermanentsOnBattlefieldCount(colorFilters[i]).calculate(game, source, this); - i++; - } - int max = 0; - for (i = 0; i < 5; i++) { - if (colorCounts[i] > max) { - max = colorCounts[i] * 1; - } - } - i = 0; - ObjectColor commonest = new ObjectColor(); - for (ObjectColor color : ObjectColor.getAllColors()) { - if (colorCounts[i] == max) { - commonest.addColor(color); - } - i++; - } - ObjectColor permColor = permanent.getColor(game); - if (permColor.shares(commonest)) { + Condition condition = new MostCommonColorCondition(permanent.getColor(game)); + if (condition.apply(game, source)) { Effect effect = new ReturnToHandTargetEffect(); effect.setTargetPointer(new FixedTarget(permanent.getId())); return effect.apply(game, source); diff --git a/Mage.Sets/src/mage/cards/c/CallToArms.java b/Mage.Sets/src/mage/cards/c/CallToArms.java new file mode 100644 index 00000000000..095cdba84a6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CallToArms.java @@ -0,0 +1,171 @@ +/* + * 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.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ChooseColorEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public class CallToArms extends CardImpl { + + public CallToArms(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + + // As Call to Arms enters the battlefield, choose a color and an opponent. + Effect effect = new ChooseColorEffect(Outcome.Detriment); +// effect.setText("choose a color and an opponent"); + Ability ability = new AsEntersBattlefieldAbility(effect); + effect = new ChooseOpponentEffect(Outcome.Benefit); + effect.setText("then choose an opponent"); + ability.addEffect(effect); + this.addAbility(ability); + + // White creatures get +1/+1 as long as the chosen color is the most common color among nontoken permanents the chosen player controls but isn't tied for most common. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CallToArmsEffect())); + + // When the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice Call to Arms. + this.addAbility(new SacAbility()); + } + + public CallToArms(final CallToArms card) { + super(card); + } + + @Override + public CallToArms copy() { + return new CallToArms(this); + } +} + +class CallToArmsEffect extends ContinuousEffectImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public CallToArmsEffect() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.Benefit); + staticText = "The chosen player's maximum hand size is four"; + } + + public CallToArmsEffect(final CallToArmsEffect effect) { + super(effect); + } + + @Override + public CallToArmsEffect copy() { + return new CallToArmsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + UUID playerId = (UUID) game.getState().getValue(source.getSourceId() + ChooseOpponentEffect.VALUE_KEY); + if (permanent != null) { + Player opponent = game.getPlayer(playerId); + if (opponent != null) { + ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color"); + Condition condition = new MostCommonColorCondition(color, true, new ControllerIdPredicate(playerId)); + if (condition.apply(game, source)) { + Effect effect = new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false); + return effect.apply(game, source); + } + } + } + return false; + } +} + +class SacAbility extends StateTriggeredAbility { + + public SacAbility() { + super(Zone.BATTLEFIELD, new SacrificeSourceEffect()); + } + + public SacAbility(final SacAbility ability) { + super(ability); + } + + @Override + public SacAbility copy() { + return new SacAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(getSourceId()); + UUID playerId = (UUID) game.getState().getValue(getSourceId() + ChooseOpponentEffect.VALUE_KEY); + if (permanent != null) { + Player opponent = game.getPlayer(playerId); + if (opponent != null) { + ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color"); + Condition condition = new MostCommonColorCondition(color, true, new ControllerIdPredicate(playerId)); + return !condition.apply(game, this); + } + } + return false; + } + + @Override + public String getRule() { + return "When the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice {this}"; + } + +} diff --git a/Mage.Sets/src/mage/cards/e/Epicenter.java b/Mage.Sets/src/mage/cards/e/Epicenter.java index 54ba912bc09..70f553a8b86 100644 --- a/Mage.Sets/src/mage/cards/e/Epicenter.java +++ b/Mage.Sets/src/mage/cards/e/Epicenter.java @@ -27,7 +27,7 @@ */ package mage.cards.e; -import java.util.List; +import java.util.Iterator; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.condition.InvertCondition; @@ -90,8 +90,9 @@ class EpicenterEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game); - for (Permanent p : permanents) { + Iterator permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game).iterator(); + while (permanents.hasNext()) { + Permanent p = permanents.next(); if (p.isLand()) { p.sacrifice(source.getSourceId(), game); } diff --git a/Mage.Sets/src/mage/cards/g/GohamDjinn.java b/Mage.Sets/src/mage/cards/g/GohamDjinn.java new file mode 100644 index 00000000000..69122228cae --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GohamDjinn.java @@ -0,0 +1,72 @@ +/* + * 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.g; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class GohamDjinn extends CardImpl { + + public GohamDjinn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}"); + + this.subtype.add("Djinn"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // {1}{B}: Regenerate Goham Djinn. + // Goham Djinn gets -2/-2 as long as black is the most common color among all permanents or is tied for most common. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(-2, -2, Duration.WhileOnBattlefield), + new MostCommonColorCondition(new ObjectColor(ObjectColor.BLACK)), + "{this} gets -2/-2 as long as black is the most common color among all permanents or is tied for most common"))); + } + + public GohamDjinn(final GohamDjinn card) { + super(card); + } + + @Override + public GohamDjinn copy() { + return new GohamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HalamDjinn.java b/Mage.Sets/src/mage/cards/h/HalamDjinn.java new file mode 100644 index 00000000000..337c546d595 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HalamDjinn.java @@ -0,0 +1,75 @@ +/* + * 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.h; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class HalamDjinn extends CardImpl { + + public HalamDjinn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}"); + + this.subtype.add("Djinn"); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Halam Djinn gets -2/-2 as long as red is the most common color among all permanents or is tied for most common. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(-2, -2, Duration.WhileOnBattlefield), + new MostCommonColorCondition(new ObjectColor(ObjectColor.RED)), + "{this} gets -2/-2 as long as red is the most common color among all permanents or is tied for most common"))); + } + + public HalamDjinn(final HalamDjinn card) { + super(card); + } + + @Override + public HalamDjinn copy() { + return new HalamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/cards/h/HeroicDefiance.java b/Mage.Sets/src/mage/cards/h/HeroicDefiance.java new file mode 100644 index 00000000000..48cf3fa128d --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HeroicDefiance.java @@ -0,0 +1,102 @@ +/* + * 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.h; + +import java.util.UUID; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author TheElk801 + */ +public class HeroicDefiance extends CardImpl { + + public HeroicDefiance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +3/+3 unless it shares a color with the most common color among all permanents or a color tied for most common. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield), + new HeroicDefianceCondition(), + "Enchanted creature gets +3/+3 unless it shares a color with the most common color among all permanents or a color tied for most common"))); + } + + public HeroicDefiance(final HeroicDefiance card) { + super(card); + } + + @Override + public HeroicDefiance copy() { + return new HeroicDefiance(this); + } +} + +class HeroicDefianceCondition implements Condition { + + public HeroicDefianceCondition() { + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + Condition condition = new MostCommonColorCondition(creature.getColor(game)); + return !condition.apply(game, source); + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/r/RuhamDjinn.java b/Mage.Sets/src/mage/cards/r/RuhamDjinn.java new file mode 100644 index 00000000000..44855fa0eac --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RuhamDjinn.java @@ -0,0 +1,76 @@ +/* + * 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.r; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class RuhamDjinn extends CardImpl { + + public RuhamDjinn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}"); + + this.subtype.add("Djinn"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // + // Ruham Djinn gets -2/-2 as long as white is the most common color among all permanents or is tied for most common. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(-2, -2, Duration.WhileOnBattlefield), + new MostCommonColorCondition(new ObjectColor(ObjectColor.WHITE)), + "{this} gets -2/-2 as long as white is the most common color among all permanents or is tied for most common"))); + } + + public RuhamDjinn(final RuhamDjinn card) { + super(card); + } + + @Override + public RuhamDjinn copy() { + return new RuhamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SulamDjinn.java b/Mage.Sets/src/mage/cards/s/SulamDjinn.java new file mode 100644 index 00000000000..f70101d31d8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SulamDjinn.java @@ -0,0 +1,75 @@ +/* + * 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.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class SulamDjinn extends CardImpl { + + public SulamDjinn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}"); + + this.subtype.add("Djinn"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Sulam Djinn gets -2/-2 as long as green is the most common color among all permanents or is tied for most common. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(-2, -2, Duration.WhileOnBattlefield), + new MostCommonColorCondition(new ObjectColor(ObjectColor.GREEN)), + "{this} gets -2/-2 as long as green is the most common color among all permanents or is tied for most common"))); + } + + public SulamDjinn(final SulamDjinn card) { + super(card); + } + + @Override + public SulamDjinn copy() { + return new SulamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TsabosAssassin.java b/Mage.Sets/src/mage/cards/t/TsabosAssassin.java new file mode 100644 index 00000000000..6a6ae1deb4f --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TsabosAssassin.java @@ -0,0 +1,108 @@ +/* + * 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.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class TsabosAssassin extends CardImpl { + + public TsabosAssassin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + + this.subtype.add("Zombie"); + this.subtype.add("Assassin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Destroy target creature if it shares a color with the most common color among all permanents or a color tied for most common. A creature destroyed this way can't be regenerated. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new TsabosAssasinEffect(),new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public TsabosAssassin(final TsabosAssassin card) { + super(card); + } + + @Override + public TsabosAssassin copy() { + return new TsabosAssassin(this); + } +} +class TsabosAssasinEffect extends OneShotEffect { + + public TsabosAssasinEffect() { + super(Outcome.Detriment); + this.staticText = "Destroy target creature if it shares a color with the most common color among all permanents or a color tied for most common. A creature destroyed this way can't be regenerated."; + } + + public TsabosAssasinEffect(final TsabosAssasinEffect effect) { + super(effect); + } + + @Override + public TsabosAssasinEffect copy() { + return new TsabosAssasinEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + Condition condition = new MostCommonColorCondition(permanent.getColor(game)); + if (condition.apply(game, source)) { + Effect effect = new DestroyTargetEffect(); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + return effect.apply(game, source); + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/z/ZanamDjinn.java b/Mage.Sets/src/mage/cards/z/ZanamDjinn.java new file mode 100644 index 00000000000..ebf6a06ed2d --- /dev/null +++ b/Mage.Sets/src/mage/cards/z/ZanamDjinn.java @@ -0,0 +1,75 @@ +/* + * 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.z; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MostCommonColorCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class ZanamDjinn extends CardImpl { + + public ZanamDjinn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}"); + + this.subtype.add("Djinn"); + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Zanam Djinn gets -2/-2 as long as blue is the most common color among all permanents or is tied for most common. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(-2, -2, Duration.WhileOnBattlefield), + new MostCommonColorCondition(new ObjectColor(ObjectColor.BLUE)), + "{this} gets -2/-2 as long as blue is the most common color among all permanents or is tied for most common"))); + } + + public ZanamDjinn(final ZanamDjinn card) { + super(card); + } + + @Override + public ZanamDjinn copy() { + return new ZanamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index 7b6062d378f..d63d6a81410 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -79,6 +79,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Brown Ouphe", 116, Rarity.COMMON, mage.cards.b.BrownOuphe.class)); cards.add(new SetCardInfo("Brushland", 327, Rarity.RARE, mage.cards.b.Brushland.class)); cards.add(new SetCardInfo("Burnt Offering", 4, Rarity.COMMON, mage.cards.b.BurntOffering.class)); + cards.add(new SetCardInfo("Call to Arms", 234, Rarity.RARE, mage.cards.c.CallToArms.class)); cards.add(new SetCardInfo("Caribou Range", 235, Rarity.RARE, mage.cards.c.CaribouRange.class)); cards.add(new SetCardInfo("Celestial Sword", 289, Rarity.RARE, mage.cards.c.CelestialSword.class)); cards.add(new SetCardInfo("Centaur Archer", 360, Rarity.UNCOMMON, mage.cards.c.CentaurArcher.class)); diff --git a/Mage.Sets/src/mage/sets/Invasion.java b/Mage.Sets/src/mage/sets/Invasion.java index c738e1abd43..55c2e631904 100644 --- a/Mage.Sets/src/mage/sets/Invasion.java +++ b/Mage.Sets/src/mage/sets/Invasion.java @@ -149,6 +149,8 @@ public class Invasion extends ExpansionSet { cards.add(new SetCardInfo("Glimmering Angel", 17, Rarity.COMMON, mage.cards.g.GlimmeringAngel.class)); cards.add(new SetCardInfo("Global Ruin", 18, Rarity.RARE, mage.cards.g.GlobalRuin.class)); cards.add(new SetCardInfo("Goblin Spy", 145, Rarity.UNCOMMON, mage.cards.g.GoblinSpy.class)); + cards.add(new SetCardInfo("Goham Djinn", 107, Rarity.UNCOMMON, mage.cards.g.GohamDjinn.class)); + cards.add(new SetCardInfo("Halam Djinn", 146, Rarity.UNCOMMON, mage.cards.h.HalamDjinn.class)); cards.add(new SetCardInfo("Hanna, Ship's Navigator", 249, Rarity.RARE, mage.cards.h.HannaShipsNavigator.class)); cards.add(new SetCardInfo("Harrow", 189, Rarity.COMMON, mage.cards.h.Harrow.class)); cards.add(new SetCardInfo("Harsh Judgment", 19, Rarity.RARE, mage.cards.h.HarshJudgment.class)); @@ -259,6 +261,7 @@ public class Invasion extends ExpansionSet { cards.add(new SetCardInfo("Rooting Kavu", 207, Rarity.UNCOMMON, mage.cards.r.RootingKavu.class)); cards.add(new SetCardInfo("Rout", 34, Rarity.RARE, mage.cards.r.Rout.class)); cards.add(new SetCardInfo("Ruby Leech", 161, Rarity.RARE, mage.cards.r.RubyLeech.class)); + cards.add(new SetCardInfo("Ruham Djinn", 35, Rarity.UNCOMMON, mage.cards.r.RuhamDjinn.class)); cards.add(new SetCardInfo("Sabertooth Nishoba", 268, Rarity.RARE, mage.cards.s.SabertoothNishoba.class)); cards.add(new SetCardInfo("Salt Marsh", 326, Rarity.UNCOMMON, mage.cards.s.SaltMarsh.class)); cards.add(new SetCardInfo("Samite Archer", 269, Rarity.UNCOMMON, mage.cards.s.SamiteArcher.class)); @@ -301,6 +304,7 @@ public class Invasion extends ExpansionSet { cards.add(new SetCardInfo("Stormscape Master", 76, Rarity.RARE, mage.cards.s.StormscapeMaster.class)); cards.add(new SetCardInfo("Strength of Unity", 40, Rarity.COMMON, mage.cards.s.StrengthOfUnity.class)); cards.add(new SetCardInfo("Stun", 172, Rarity.COMMON, mage.cards.s.Stun.class)); + cards.add(new SetCardInfo("Sulam Djinn", 212, Rarity.UNCOMMON, mage.cards.s.SulamDjinn.class)); cards.add(new SetCardInfo("Sulfur Vent", 328, Rarity.COMMON, mage.cards.s.SulfurVent.class)); cards.add(new SetCardInfo("Sunscape Apprentice", 41, Rarity.COMMON, mage.cards.s.SunscapeApprentice.class)); cards.add(new SetCardInfo("Sunscape Master", 42, Rarity.RARE, mage.cards.s.SunscapeMaster.class)); @@ -334,9 +338,11 @@ public class Invasion extends ExpansionSet { cards.add(new SetCardInfo("Treva, the Renewer", 280, Rarity.RARE, mage.cards.t.TrevaTheRenewer.class)); cards.add(new SetCardInfo("Tribal Flames", 176, Rarity.COMMON, mage.cards.t.TribalFlames.class)); cards.add(new SetCardInfo("Troll-Horn Cameo", 316, Rarity.UNCOMMON, mage.cards.t.TrollHornCameo.class)); + cards.add(new SetCardInfo("Tsabo's Assassin", 128, Rarity.RARE, mage.cards.t.TsabosAssassin.class)); cards.add(new SetCardInfo("Tsabo's Decree", 129, Rarity.RARE, mage.cards.t.TsabosDecree.class)); cards.add(new SetCardInfo("Tsabo's Web", 317, Rarity.RARE, mage.cards.t.TsabosWeb.class)); cards.add(new SetCardInfo("Tsabo Tavoc", 281, Rarity.RARE, mage.cards.t.TsaboTavoc.class)); + cards.add(new SetCardInfo("Tsabo's Assassin", 128, Rarity.RARE, mage.cards.t.TsabosAssassin.class)); cards.add(new SetCardInfo("Turf Wound", 177, Rarity.COMMON, mage.cards.t.TurfWound.class)); cards.add(new SetCardInfo("Twilight's Call", 130, Rarity.RARE, mage.cards.t.TwilightsCall.class)); cards.add(new SetCardInfo("Undermine", 282, Rarity.RARE, mage.cards.u.Undermine.class)); @@ -372,6 +378,7 @@ public class Invasion extends ExpansionSet { cards.add(new SetCardInfo("Yavimaya Barbarian", 290, Rarity.COMMON, mage.cards.y.YavimayaBarbarian.class)); cards.add(new SetCardInfo("Yavimaya Kavu", 291, Rarity.UNCOMMON, mage.cards.y.YavimayaKavu.class)); cards.add(new SetCardInfo("Yawgmoth's Agenda", 135, Rarity.RARE, mage.cards.y.YawgmothsAgenda.class)); + cards.add(new SetCardInfo("Zanam Djinn", 90, Rarity.UNCOMMON, mage.cards.z.ZanamDjinn.class)); cards.add(new SetCardInfo("Zap", 180, Rarity.COMMON, mage.cards.z.Zap.class)); } } diff --git a/Mage.Sets/src/mage/sets/MastersEditionIII.java b/Mage.Sets/src/mage/sets/MastersEditionIII.java index 8e1aafc209d..d4b950e4dad 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionIII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionIII.java @@ -77,6 +77,7 @@ public class MastersEditionIII extends ExpansionSet { cards.add(new SetCardInfo("Borrowing 100,000 Arrows", 31, Rarity.UNCOMMON, mage.cards.b.Borrowing100000Arrows.class)); cards.add(new SetCardInfo("Brilliant Plan", 32, Rarity.COMMON, mage.cards.b.BrilliantPlan.class)); cards.add(new SetCardInfo("Burning of Xinye", 89, Rarity.RARE, mage.cards.b.BurningOfXinye.class)); + cards.add(new SetCardInfo("Call to Arms", 4, Rarity.UNCOMMON, mage.cards.c.CallToArms.class)); cards.add(new SetCardInfo("Capture of Jingzhou", 33, Rarity.RARE, mage.cards.c.CaptureOfJingzhou.class)); cards.add(new SetCardInfo("Carrion Ants", 60, Rarity.UNCOMMON, mage.cards.c.CarrionAnts.class)); cards.add(new SetCardInfo("Chain Lightning", 90, Rarity.COMMON, mage.cards.c.ChainLightning.class)); diff --git a/Mage.Sets/src/mage/sets/Planeshift.java b/Mage.Sets/src/mage/sets/Planeshift.java index 9879435742e..73998c3b7eb 100644 --- a/Mage.Sets/src/mage/sets/Planeshift.java +++ b/Mage.Sets/src/mage/sets/Planeshift.java @@ -99,6 +99,7 @@ public class Planeshift extends ExpansionSet { cards.add(new SetCardInfo("Gaea's Might", 81, Rarity.COMMON, mage.cards.g.GaeasMight.class)); cards.add(new SetCardInfo("Gainsay", 26, Rarity.UNCOMMON, mage.cards.g.Gainsay.class)); cards.add(new SetCardInfo("Gerrard's Command", 109, Rarity.COMMON, mage.cards.g.GerrardsCommand.class)); + cards.add(new SetCardInfo("Heroic Defiance", 6, Rarity.COMMON, mage.cards.h.HeroicDefiance.class)); cards.add(new SetCardInfo("Hobble", 7, Rarity.COMMON, mage.cards.h.Hobble.class)); cards.add(new SetCardInfo("Honorable Scout", 8, Rarity.COMMON, mage.cards.h.HonorableScout.class)); cards.add(new SetCardInfo("Horned Kavu", 110, Rarity.COMMON, mage.cards.h.HornedKavu.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java new file mode 100644 index 00000000000..9e808722efd --- /dev/null +++ b/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java @@ -0,0 +1,87 @@ +/* + * 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.condition.common; + +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; + +/** + * + * @author TheElk801 + */ +public class MostCommonColorCondition implements Condition { + + protected ObjectColor compareColor; + protected boolean isMono; + protected Predicate predicate; + + public MostCommonColorCondition(ObjectColor color) { + this(color, false, null); + } + + //Use this one if you don't want a tie for most common and want to restrict to a player (literally only Call to Arms) + public MostCommonColorCondition(ObjectColor color, boolean isMono, Predicate predicate) { + this.compareColor = color; + this.isMono = isMono; + } + + @Override + public boolean apply(Game game, Ability source) { + FilterPermanent[] colorFilters = new FilterPermanent[6]; + int i = 0; + for (ObjectColor color : ObjectColor.getAllColors()) { + colorFilters[i] = new FilterPermanent(); + colorFilters[i].add(new ColorPredicate(color)); + if (predicate != null) { + colorFilters[i].add(predicate); + } + i++; + } + int[] colorCounts = new int[6]; + i = 0; + for (ObjectColor color : ObjectColor.getAllColors()) { + colorFilters[i].add(new ColorPredicate(color)); + colorCounts[i] = game.getBattlefield().count(colorFilters[i], source.getId(), source.getControllerId(), game); + i++; + } + int max = 0; + for (i = 0; i < 5; i++) { + if (colorCounts[i] > max) { + max = colorCounts[i] * 1; + } + } + i = 0; + ObjectColor commonest = new ObjectColor(); + for (ObjectColor color : ObjectColor.getAllColors()) { + if (colorCounts[i] == max) { + commonest.addColor(color); + } + i++; + } + if (compareColor.shares(commonest)) { + if (isMono) { + return !commonest.isMulticolored(); + } else { + return true; + } + } + return false; + } + + @Override + public String toString() { + if (!compareColor.isMulticolored()) { + return compareColor.getDescription() + " is the most common color among all permanents or is tied for most common"; + } else { + return "it shares a color with the most common color among all permanents or a color tied for most common"; + } + } +} From 8c664e942d6086825c0afd82fbcfeee8a0503736 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 5 Aug 2017 17:26:38 -0400 Subject: [PATCH 16/30] Implement Brown Ouphe --- Mage.Sets/src/mage/sets/IceAge.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index d63d6a81410..e8f9e590ce0 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -64,7 +64,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Aurochs", 113, Rarity.COMMON, mage.cards.a.Aurochs.class)); cards.add(new SetCardInfo("Balduvian Barbarians", 172, Rarity.COMMON, mage.cards.b.BalduvianBarbarians.class)); cards.add(new SetCardInfo("Balduvian Bears", 114, Rarity.COMMON, mage.cards.b.BalduvianBears.class)); - cards.add(new SetCardInfo("Balduvian Conjurer", 58, Rarity.UNCOMMON, mage.cards.b.BalduvianConjurer.class)); + cards.add(new SetCardInfo("Balduvian Conjurer", 58, Rarity.UNCOMMON, mage.cards.b.BalduvianConjurer.class)); cards.add(new SetCardInfo("Balduvian Hydra", 173, Rarity.RARE, mage.cards.b.BalduvianHydra.class)); cards.add(new SetCardInfo("Barbed Sextant", 287, Rarity.COMMON, mage.cards.b.BarbedSextant.class)); cards.add(new SetCardInfo("Battle Frenzy", 175, Rarity.COMMON, mage.cards.b.BattleFrenzy.class)); @@ -75,11 +75,11 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Blue Scarab", 233, Rarity.UNCOMMON, mage.cards.b.BlueScarab.class)); cards.add(new SetCardInfo("Brainstorm", 61, Rarity.COMMON, mage.cards.b.Brainstorm.class)); cards.add(new SetCardInfo("Brand of Ill Omen", 177, Rarity.RARE, mage.cards.b.BrandOfIllOmen.class)); - cards.add(new SetCardInfo("Brine Shaman", 3, Rarity.COMMON, mage.cards.b.BrineShaman.class)); - cards.add(new SetCardInfo("Brown Ouphe", 116, Rarity.COMMON, mage.cards.b.BrownOuphe.class)); + cards.add(new SetCardInfo("Brine Shaman", 3, Rarity.COMMON, mage.cards.b.BrineShaman.class)); + cards.add(new SetCardInfo("Brown Ouphe", 116, Rarity.COMMON, mage.cards.b.BrownOuphe.class)); cards.add(new SetCardInfo("Brushland", 327, Rarity.RARE, mage.cards.b.Brushland.class)); cards.add(new SetCardInfo("Burnt Offering", 4, Rarity.COMMON, mage.cards.b.BurntOffering.class)); - cards.add(new SetCardInfo("Call to Arms", 234, Rarity.RARE, mage.cards.c.CallToArms.class)); + cards.add(new SetCardInfo("Call to Arms", 234, Rarity.RARE, mage.cards.c.CallToArms.class)); cards.add(new SetCardInfo("Caribou Range", 235, Rarity.RARE, mage.cards.c.CaribouRange.class)); cards.add(new SetCardInfo("Celestial Sword", 289, Rarity.RARE, mage.cards.c.CelestialSword.class)); cards.add(new SetCardInfo("Centaur Archer", 360, Rarity.UNCOMMON, mage.cards.c.CentaurArcher.class)); From 10e1e9d3ab313f8d0122d6f7914491dfa49beddf Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 8 Aug 2017 17:46:04 -0400 Subject: [PATCH 17/30] Implemented Break Open --- Mage.Sets/src/mage/cards/b/BreakOpen.java | 103 ++++++++++++++++++++++ Mage.Sets/src/mage/sets/Onslaught.java | 1 + 2 files changed, 104 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BreakOpen.java diff --git a/Mage.Sets/src/mage/cards/b/BreakOpen.java b/Mage.Sets/src/mage/cards/b/BreakOpen.java new file mode 100644 index 00000000000..44cda67427b --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BreakOpen.java @@ -0,0 +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.cards.b; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.other.FaceDownPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class BreakOpen extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Face-down creature an opponent controls"); + + static { + filter.add(new FaceDownPredicate()); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public BreakOpen(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); + + // Turn target face-down creature an opponent controls face up. + this.getSpellAbility().addEffect(new TurnFaceUpTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public BreakOpen(final BreakOpen card) { + super(card); + } + + @Override + public BreakOpen copy() { + return new BreakOpen(this); + } +} + +class TurnFaceUpTargetEffect extends OneShotEffect { + + public TurnFaceUpTargetEffect() { + super(Outcome.Benefit); + this.staticText = "Turn target face-down creature an opponen controls face up."; + } + + public TurnFaceUpTargetEffect(final TurnFaceUpTargetEffect effect) { + super(effect); + } + + @Override + public TurnFaceUpTargetEffect copy() { + return new TurnFaceUpTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID target = targetPointer.getFirst(game, source); + if (target != null) { + Permanent permanent = game.getPermanent(target); + if (permanent != null) { + return permanent.turnFaceUp(game, source.getControllerId()); + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index 5339c73962e..3437ea31a94 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -56,6 +56,7 @@ public class Onslaught extends ExpansionSet { cards.add(new SetCardInfo("Bloodline Shaman", 249, Rarity.UNCOMMON, mage.cards.b.BloodlineShaman.class)); cards.add(new SetCardInfo("Bloodstained Mire", 313, Rarity.RARE, mage.cards.b.BloodstainedMire.class, new CardGraphicInfo(new ObjectColor("RB"), null,false))); cards.add(new SetCardInfo("Boneknitter", 128, Rarity.UNCOMMON, mage.cards.b.Boneknitter.class)); + cards.add(new SetCardInfo("Break Open", 190, Rarity.COMMON, mage.cards.b.BreakOpen.class)); cards.add(new SetCardInfo("Brightstone Ritual", 191, Rarity.COMMON, mage.cards.b.BrightstoneRitual.class)); cards.add(new SetCardInfo("Broodhatch Nantuko", 250, Rarity.UNCOMMON, mage.cards.b.BroodhatchNantuko.class)); cards.add(new SetCardInfo("Cabal Archon", 129, Rarity.UNCOMMON, mage.cards.c.CabalArchon.class)); From 7838049c146c6ad811ca736fd75fc5b9dfc8ea81 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Aug 2017 08:23:24 -0400 Subject: [PATCH 18/30] Implemented Carrion --- Mage.Sets/src/mage/cards/c/Carrion.java | 65 +++++++++++++++++++ Mage.Sets/src/mage/sets/Mirage.java | 1 + .../token/CarrionBlackInsectToken.java | 47 ++++++++++++++ .../token/NestOfScarabsBlackInsectToken.java | 2 +- 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/c/Carrion.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java diff --git a/Mage.Sets/src/mage/cards/c/Carrion.java b/Mage.Sets/src/mage/cards/c/Carrion.java new file mode 100644 index 00000000000..36707992bd3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/Carrion.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.CarrionBlackInsectToken; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class Carrion extends CardImpl { + + public Carrion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{B}"); + + // As an additional cost to cast Carrion, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), false))); + + // Put X 0/1 black Insect creature tokens onto the battlefield, where X is the sacrificed creature's power. + this.getSpellAbility().addEffect(new CreateTokenEffect(new CarrionBlackInsectToken(), new SacrificeCostCreaturesPower())); + } + + public Carrion(final Carrion card) { + super(card); + } + + @Override + public Carrion copy() { + return new Carrion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index 72418f8f492..255d8661b96 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -82,6 +82,7 @@ public class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Cadaverous Bloom", 318, Rarity.RARE, mage.cards.c.CadaverousBloom.class)); cards.add(new SetCardInfo("Cadaverous Knight", 8, Rarity.COMMON, mage.cards.c.CadaverousKnight.class)); cards.add(new SetCardInfo("Canopy Dragon", 107, Rarity.RARE, mage.cards.c.CanopyDragon.class)); + cards.add(new SetCardInfo("Carrion", 9, Rarity.RARE, mage.cards.c.Carrion.class)); cards.add(new SetCardInfo("Celestial Dawn", 210, Rarity.RARE, mage.cards.c.CelestialDawn.class)); cards.add(new SetCardInfo("Cerulean Wyvern", 57, Rarity.UNCOMMON, mage.cards.c.CeruleanWyvern.class)); cards.add(new SetCardInfo("Chaos Charm", 163, Rarity.COMMON, mage.cards.c.ChaosCharm.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java b/Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java new file mode 100644 index 00000000000..764b99070a2 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java @@ -0,0 +1,47 @@ +/* +* 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.game.permanent.token; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author TheElk801 + */ +public class CarrionBlackInsectToken extends Token { + + public CarrionBlackInsectToken() { + super("Insect", "0/1 black Insect creature token"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Insect"); + power = new MageInt(0); + toughness = new MageInt(1); + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java b/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java index 8434fa6d65b..565e0863049 100644 --- a/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java @@ -37,7 +37,7 @@ import mage.MageInt; public class NestOfScarabsBlackInsectToken extends Token { public NestOfScarabsBlackInsectToken() { - super("Insect", "1/1 black Insect token"); + super("Insect", "1/1 black Insect creature token"); cardType.add(CardType.CREATURE); color.setBlack(true); subtype.add("Insect"); From c77971e588330934209f36ced4a52f836370174f Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Aug 2017 12:03:13 -0400 Subject: [PATCH 19/30] Implemented Cephalid Pathmage --- .../src/mage/cards/c/CephalidPathmage.java | 77 +++++++++++++++++++ Mage.Sets/src/mage/sets/Legions.java | 1 + 2 files changed, 78 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CephalidPathmage.java diff --git a/Mage.Sets/src/mage/cards/c/CephalidPathmage.java b/Mage.Sets/src/mage/cards/c/CephalidPathmage.java new file mode 100644 index 00000000000..7dfd9e2ebc5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CephalidPathmage.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class CephalidPathmage extends CardImpl { + + public CephalidPathmage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.subtype.add("Cephalid"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Cephalid Pathmage is unblockable. + this.addAbility(new CantBeBlockedSourceAbility()); + + // {tap}, Sacrifice Cephalid Pathmage: Target creature is unblockable this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(Duration.EndOfTurn), new SacrificeSourceCost()); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CephalidPathmage(final CephalidPathmage card) { + super(card); + } + + @Override + public CephalidPathmage copy() { + return new CephalidPathmage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Legions.java b/Mage.Sets/src/mage/sets/Legions.java index 47c63b27e47..ca0b546f054 100644 --- a/Mage.Sets/src/mage/sets/Legions.java +++ b/Mage.Sets/src/mage/sets/Legions.java @@ -69,6 +69,7 @@ public class Legions extends ExpansionSet { cards.add(new SetCardInfo("Brood Sliver", 120, Rarity.RARE, mage.cards.b.BroodSliver.class)); cards.add(new SetCardInfo("Caller of the Claw", 121, Rarity.RARE, mage.cards.c.CallerOfTheClaw.class)); cards.add(new SetCardInfo("Canopy Crawler", 122, Rarity.UNCOMMON, mage.cards.c.CanopyCrawler.class)); + cards.add(new SetCardInfo("Cephalid Pathmage", 31, Rarity.COMMON, mage.cards.c.CephalidPathmage.class)); cards.add(new SetCardInfo("Chromeshell Crab", 32, Rarity.RARE, mage.cards.c.ChromeshellCrab.class)); cards.add(new SetCardInfo("Clickslither", 90, Rarity.RARE, mage.cards.c.Clickslither.class)); cards.add(new SetCardInfo("Cloudreach Cavalry", 7, Rarity.UNCOMMON, mage.cards.c.CloudreachCavalry.class)); From 75853463e99dd6ae7245c79c4951fbc6d7b434f3 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Aug 2017 12:09:50 -0400 Subject: [PATCH 20/30] Implemented Cephalid Inkshrouder --- .../src/mage/cards/c/CephalidInkshrouder.java | 71 +++++++++++++++++++ Mage.Sets/src/mage/sets/Judgment.java | 1 + 2 files changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CephalidInkshrouder.java diff --git a/Mage.Sets/src/mage/cards/c/CephalidInkshrouder.java b/Mage.Sets/src/mage/cards/c/CephalidInkshrouder.java new file mode 100644 index 00000000000..8f2c4260edd --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CephalidInkshrouder.java @@ -0,0 +1,71 @@ +/* + * 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.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public class CephalidInkshrouder extends CardImpl { + + public CephalidInkshrouder(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.subtype.add("Cephalid"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Discard a card: Cephalid Inkshrouder gains shroud until end of turn and is unblockable this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(ShroudAbility.getInstance(),Duration.EndOfTurn), new DiscardCardCost()); + ability.addEffect(new CantBeBlockedSourceEffect(Duration.EndOfTurn)); + this.addAbility(ability); + } + + public CephalidInkshrouder(final CephalidInkshrouder card) { + super(card); + } + + @Override + public CephalidInkshrouder copy() { + return new CephalidInkshrouder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Judgment.java b/Mage.Sets/src/mage/sets/Judgment.java index b1cb49a0261..7443e32904e 100644 --- a/Mage.Sets/src/mage/sets/Judgment.java +++ b/Mage.Sets/src/mage/sets/Judgment.java @@ -78,6 +78,7 @@ public class Judgment extends ExpansionSet { cards.add(new SetCardInfo("Canopy Claws", 108, Rarity.COMMON, mage.cards.c.CanopyClaws.class)); cards.add(new SetCardInfo("Centaur Rootcaster", 109, Rarity.COMMON, mage.cards.c.CentaurRootcaster.class)); cards.add(new SetCardInfo("Cephalid Constable", 35, Rarity.RARE, mage.cards.c.CephalidConstable.class)); + cards.add(new SetCardInfo("Cephalid Inkshrouder", 36, Rarity.UNCOMMON, mage.cards.c.CephalidInkshrouder.class)); cards.add(new SetCardInfo("Chastise", 8, Rarity.UNCOMMON, mage.cards.c.Chastise.class)); cards.add(new SetCardInfo("Commander Eesha", 9, Rarity.RARE, mage.cards.c.CommanderEesha.class)); cards.add(new SetCardInfo("Crush of Wurms", 110, Rarity.RARE, mage.cards.c.CrushOfWurms.class)); From 050b2d0c1ca54d5f7a5790adfd77d51f9ea126f1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Aug 2017 12:15:45 -0400 Subject: [PATCH 21/30] Implemented Ceremonial Guard --- .../src/mage/cards/c/CeremonialGuard.java | 69 +++++++++++++++++++ Mage.Sets/src/mage/sets/MercadianMasques.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CeremonialGuard.java diff --git a/Mage.Sets/src/mage/cards/c/CeremonialGuard.java b/Mage.Sets/src/mage/cards/c/CeremonialGuard.java new file mode 100644 index 00000000000..11ebeef6d60 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CeremonialGuard.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.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksOrBlocksTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DestroySourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author TheElk801 + */ +public class CeremonialGuard extends CardImpl { + + public CeremonialGuard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Ceremonial Guard attacks or blocks, destroy it at end of combat. + this.addAbility(new AttacksOrBlocksTriggeredAbility( + new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroySourceEffect())), + false)); + } + + public CeremonialGuard(final CeremonialGuard card) { + super(card); + } + + @Override + public CeremonialGuard copy() { + return new CeremonialGuard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index ee14c79b3bb..25b51eb5dab 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -87,6 +87,7 @@ public class MercadianMasques extends ExpansionSet { cards.add(new SetCardInfo("Cave-In", 180, Rarity.RARE, mage.cards.c.CaveIn.class)); cards.add(new SetCardInfo("Cavern Crawler", 181, Rarity.COMMON, mage.cards.c.CavernCrawler.class)); cards.add(new SetCardInfo("Cave Sense", 179, Rarity.COMMON, mage.cards.c.CaveSense.class)); + cards.add(new SetCardInfo("Ceremonial Guard", 182, Rarity.COMMON, mage.cards.c.CeremonialGuard.class)); cards.add(new SetCardInfo("Chambered Nautilus", 64, Rarity.UNCOMMON, mage.cards.c.ChamberedNautilus.class)); cards.add(new SetCardInfo("Charisma", 66, Rarity.RARE, mage.cards.c.Charisma.class)); cards.add(new SetCardInfo("Cho-Arrim Alchemist", 8, Rarity.RARE, mage.cards.c.ChoArrimAlchemist.class)); From 91ca015cac543d83f63b935daadf30dd8a314da8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Aug 2017 19:09:43 -0400 Subject: [PATCH 22/30] Implemented Chain of Acid, Chain of Silence, and Chain of Smog --- Mage.Sets/src/mage/cards/c/ChainOfAcid.java | 120 ++++++++++++++++ .../src/mage/cards/c/ChainOfSilence.java | 132 ++++++++++++++++++ Mage.Sets/src/mage/cards/c/ChainOfSmog.java | 107 ++++++++++++++ Mage.Sets/src/mage/sets/Onslaught.java | 3 + 4 files changed, 362 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ChainOfAcid.java create mode 100644 Mage.Sets/src/mage/cards/c/ChainOfSilence.java create mode 100644 Mage.Sets/src/mage/cards/c/ChainOfSmog.java diff --git a/Mage.Sets/src/mage/cards/c/ChainOfAcid.java b/Mage.Sets/src/mage/cards/c/ChainOfAcid.java new file mode 100644 index 00000000000..5f139733891 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChainOfAcid.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class ChainOfAcid extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("noncreature permanent"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public ChainOfAcid(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + // Destroy target noncreature permanent. Then that permanent's controller may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainOfAcidEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public ChainOfAcid(final ChainOfAcid card) { + super(card); + } + + @Override + public ChainOfAcid copy() { + return new ChainOfAcid(this); + } +} + +class ChainOfAcidEffect extends OneShotEffect { + + ChainOfAcidEffect() { + super(Outcome.Damage); + this.staticText = "Target player discards two cards. That player may copy this spell and may choose a new target for that copy."; + } + + ChainOfAcidEffect(final ChainOfAcidEffect effect) { + super(effect); + } + + @Override + public ChainOfAcidEffect copy() { + return new ChainOfAcidEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + UUID targetId = source.getFirstTarget(); + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + Player affectedPlayer = game.getPlayer(permanent.getControllerId()); + if (affectedPlayer != null) { + Effect effect = new DestroyTargetEffect(); + effect.setTargetPointer(new FixedTarget(targetId)); + effect.apply(game, source); + if (affectedPlayer.chooseUse(Outcome.Copy, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + spell.createCopyOnStack(game, source, affectedPlayer.getId(), true); + game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + '.'); + } + } + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/c/ChainOfSilence.java b/Mage.Sets/src/mage/cards/c/ChainOfSilence.java new file mode 100644 index 00000000000..d2780688ddb --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChainOfSilence.java @@ -0,0 +1,132 @@ +/* + * 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.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class ChainOfSilence extends CardImpl { + + public ChainOfSilence(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); + + + // Prevent all damage target creature would deal this turn. That creature's controller may sacrifice a land. If the player does, he or she may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainOfSilenceEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ChainOfSilence(final ChainOfSilence card) { + super(card); + } + + @Override + public ChainOfSilence copy() { + return new ChainOfSilence(this); + } +} +class ChainOfSilenceEffect extends OneShotEffect { + + public ChainOfSilenceEffect() { + super(Outcome.PreventDamage); + } + + public ChainOfSilenceEffect(final ChainOfSilenceEffect effect) { + super(effect); + } + + @Override + public ChainOfSilenceEffect copy() { + return new ChainOfSilenceEffect(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) { + return false; + } + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + ContinuousEffect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn); + game.addEffect(effect, source); + Player player = game.getPlayer(permanent.getControllerId()); + TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ')'), true); + if (player.chooseTarget(Outcome.Sacrifice, target, source, game)) { + Permanent land = game.getPermanent(target.getFirstTarget()); + if (land != null && land.sacrifice(source.getSourceId(), game)) { + if (player.chooseUse(outcome, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + StackObject newStackObject = spell.createCopyOnStack(game, source, player.getId(), true); + if (newStackObject != null && newStackObject instanceof Spell) { + String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); + if (activateMessage.startsWith(" casts ")) { + activateMessage = activateMessage.substring(6); + } + game.informPlayers(player.getLogName() + ' ' + activateMessage); + } + } + } + } + } + return true; + } + + return false; + } + + @Override + public String getText(Mode mode) { + return "Prevent all damage target creature would deal this turn. That creature's controller may sacrifice a land. If the player does, he or she may copy this spell and may choose a new target for that copy"; + } + +} diff --git a/Mage.Sets/src/mage/cards/c/ChainOfSmog.java b/Mage.Sets/src/mage/cards/c/ChainOfSmog.java new file mode 100644 index 00000000000..3c5e696bd5c --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChainOfSmog.java @@ -0,0 +1,107 @@ +/* + * 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.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class ChainOfSmog extends CardImpl { + + public ChainOfSmog(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); + + // Target player discards two cards. That player may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainOfSmogEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public ChainOfSmog(final ChainOfSmog card) { + super(card); + } + + @Override + public ChainOfSmog copy() { + return new ChainOfSmog(this); + } +} + +class ChainOfSmogEffect extends OneShotEffect { + + ChainOfSmogEffect() { + super(Outcome.Damage); + this.staticText = "Target player discards two cards. That player may copy this spell and may choose a new target for that copy."; + } + + ChainOfSmogEffect(final ChainOfSmogEffect effect) { + super(effect); + } + + @Override + public ChainOfSmogEffect copy() { + return new ChainOfSmogEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + UUID targetId = source.getFirstTarget(); + Player affectedPlayer = game.getPlayer(targetId); + if (affectedPlayer != null) { + Effect effect = new DiscardTargetEffect(2); + effect.setTargetPointer(new FixedTarget(targetId)); + effect.apply(game, source); + if (affectedPlayer.chooseUse(Outcome.Copy, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + spell.createCopyOnStack(game, source, affectedPlayer.getId(), true); + game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + '.'); + } + } + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index 3437ea31a94..80f9e9d99a9 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -65,7 +65,10 @@ public class Onslaught extends ExpansionSet { cards.add(new SetCardInfo("Catapult Master", 10, Rarity.RARE, mage.cards.c.CatapultMaster.class)); cards.add(new SetCardInfo("Catapult Squad", 11, Rarity.UNCOMMON, mage.cards.c.CatapultSquad.class)); cards.add(new SetCardInfo("Centaur Glade", 251, Rarity.UNCOMMON, mage.cards.c.CentaurGlade.class)); + cards.add(new SetCardInfo("Chain of Acid", 252, Rarity.UNCOMMON, mage.cards.c.ChainOfAcid.class)); cards.add(new SetCardInfo("Chain of Plasma", 193, Rarity.UNCOMMON, mage.cards.c.ChainOfPlasma.class)); + cards.add(new SetCardInfo("Chain of Silence", 12, Rarity.UNCOMMON, mage.cards.c.ChainOfSilence.class)); + cards.add(new SetCardInfo("Chain of Smog", 132, Rarity.UNCOMMON, mage.cards.c.ChainOfSmog.class)); cards.add(new SetCardInfo("Chain of Vapor", 73, Rarity.UNCOMMON, mage.cards.c.ChainOfVapor.class)); cards.add(new SetCardInfo("Charging Slateback", 194, Rarity.COMMON, mage.cards.c.ChargingSlateback.class)); cards.add(new SetCardInfo("Choking Tethers", 74, Rarity.COMMON, mage.cards.c.ChokingTethers.class)); From 6af09943682f52de7b3dca92ecd6f096b5ceb3c0 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Aug 2017 19:09:43 -0400 Subject: [PATCH 23/30] Implemented Chain of Acid, Chain of Silence, and Chain of Smog --- Mage.Sets/src/mage/cards/c/ChainOfAcid.java | 120 ++++++++++++++++ .../src/mage/cards/c/ChainOfSilence.java | 132 ++++++++++++++++++ Mage.Sets/src/mage/cards/c/ChainOfSmog.java | 107 ++++++++++++++ Mage.Sets/src/mage/sets/Onslaught.java | 3 + 4 files changed, 362 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ChainOfAcid.java create mode 100644 Mage.Sets/src/mage/cards/c/ChainOfSilence.java create mode 100644 Mage.Sets/src/mage/cards/c/ChainOfSmog.java diff --git a/Mage.Sets/src/mage/cards/c/ChainOfAcid.java b/Mage.Sets/src/mage/cards/c/ChainOfAcid.java new file mode 100644 index 00000000000..e7ae7f47c8b --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChainOfAcid.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class ChainOfAcid extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("noncreature permanent"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public ChainOfAcid(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + // Destroy target noncreature permanent. Then that permanent's controller may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainOfAcidEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public ChainOfAcid(final ChainOfAcid card) { + super(card); + } + + @Override + public ChainOfAcid copy() { + return new ChainOfAcid(this); + } +} + +class ChainOfAcidEffect extends OneShotEffect { + + ChainOfAcidEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy target noncreature permanent. Then that permanent's controller may copy this spell and may choose a new target for that copy."; + } + + ChainOfAcidEffect(final ChainOfAcidEffect effect) { + super(effect); + } + + @Override + public ChainOfAcidEffect copy() { + return new ChainOfAcidEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + UUID targetId = source.getFirstTarget(); + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + Player affectedPlayer = game.getPlayer(permanent.getControllerId()); + if (affectedPlayer != null) { + Effect effect = new DestroyTargetEffect(); + effect.setTargetPointer(new FixedTarget(targetId)); + effect.apply(game, source); + if (affectedPlayer.chooseUse(Outcome.Copy, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + spell.createCopyOnStack(game, source, affectedPlayer.getId(), true); + game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + '.'); + } + } + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/c/ChainOfSilence.java b/Mage.Sets/src/mage/cards/c/ChainOfSilence.java new file mode 100644 index 00000000000..d2780688ddb --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChainOfSilence.java @@ -0,0 +1,132 @@ +/* + * 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.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class ChainOfSilence extends CardImpl { + + public ChainOfSilence(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); + + + // Prevent all damage target creature would deal this turn. That creature's controller may sacrifice a land. If the player does, he or she may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainOfSilenceEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ChainOfSilence(final ChainOfSilence card) { + super(card); + } + + @Override + public ChainOfSilence copy() { + return new ChainOfSilence(this); + } +} +class ChainOfSilenceEffect extends OneShotEffect { + + public ChainOfSilenceEffect() { + super(Outcome.PreventDamage); + } + + public ChainOfSilenceEffect(final ChainOfSilenceEffect effect) { + super(effect); + } + + @Override + public ChainOfSilenceEffect copy() { + return new ChainOfSilenceEffect(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) { + return false; + } + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + ContinuousEffect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn); + game.addEffect(effect, source); + Player player = game.getPlayer(permanent.getControllerId()); + TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ')'), true); + if (player.chooseTarget(Outcome.Sacrifice, target, source, game)) { + Permanent land = game.getPermanent(target.getFirstTarget()); + if (land != null && land.sacrifice(source.getSourceId(), game)) { + if (player.chooseUse(outcome, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + StackObject newStackObject = spell.createCopyOnStack(game, source, player.getId(), true); + if (newStackObject != null && newStackObject instanceof Spell) { + String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); + if (activateMessage.startsWith(" casts ")) { + activateMessage = activateMessage.substring(6); + } + game.informPlayers(player.getLogName() + ' ' + activateMessage); + } + } + } + } + } + return true; + } + + return false; + } + + @Override + public String getText(Mode mode) { + return "Prevent all damage target creature would deal this turn. That creature's controller may sacrifice a land. If the player does, he or she may copy this spell and may choose a new target for that copy"; + } + +} diff --git a/Mage.Sets/src/mage/cards/c/ChainOfSmog.java b/Mage.Sets/src/mage/cards/c/ChainOfSmog.java new file mode 100644 index 00000000000..5f6d76f0e4d --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChainOfSmog.java @@ -0,0 +1,107 @@ +/* + * 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.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class ChainOfSmog extends CardImpl { + + public ChainOfSmog(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); + + // Target player discards two cards. That player may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainOfSmogEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public ChainOfSmog(final ChainOfSmog card) { + super(card); + } + + @Override + public ChainOfSmog copy() { + return new ChainOfSmog(this); + } +} + +class ChainOfSmogEffect extends OneShotEffect { + + ChainOfSmogEffect() { + super(Outcome.Discard); + this.staticText = "Target player discards two cards. That player may copy this spell and may choose a new target for that copy."; + } + + ChainOfSmogEffect(final ChainOfSmogEffect effect) { + super(effect); + } + + @Override + public ChainOfSmogEffect copy() { + return new ChainOfSmogEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + UUID targetId = source.getFirstTarget(); + Player affectedPlayer = game.getPlayer(targetId); + if (affectedPlayer != null) { + Effect effect = new DiscardTargetEffect(2); + effect.setTargetPointer(new FixedTarget(targetId)); + effect.apply(game, source); + if (affectedPlayer.chooseUse(Outcome.Copy, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + spell.createCopyOnStack(game, source, affectedPlayer.getId(), true); + game.informPlayers(affectedPlayer.getLogName() + " copies " + spell.getName() + '.'); + } + } + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index 3437ea31a94..80f9e9d99a9 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -65,7 +65,10 @@ public class Onslaught extends ExpansionSet { cards.add(new SetCardInfo("Catapult Master", 10, Rarity.RARE, mage.cards.c.CatapultMaster.class)); cards.add(new SetCardInfo("Catapult Squad", 11, Rarity.UNCOMMON, mage.cards.c.CatapultSquad.class)); cards.add(new SetCardInfo("Centaur Glade", 251, Rarity.UNCOMMON, mage.cards.c.CentaurGlade.class)); + cards.add(new SetCardInfo("Chain of Acid", 252, Rarity.UNCOMMON, mage.cards.c.ChainOfAcid.class)); cards.add(new SetCardInfo("Chain of Plasma", 193, Rarity.UNCOMMON, mage.cards.c.ChainOfPlasma.class)); + cards.add(new SetCardInfo("Chain of Silence", 12, Rarity.UNCOMMON, mage.cards.c.ChainOfSilence.class)); + cards.add(new SetCardInfo("Chain of Smog", 132, Rarity.UNCOMMON, mage.cards.c.ChainOfSmog.class)); cards.add(new SetCardInfo("Chain of Vapor", 73, Rarity.UNCOMMON, mage.cards.c.ChainOfVapor.class)); cards.add(new SetCardInfo("Charging Slateback", 194, Rarity.COMMON, mage.cards.c.ChargingSlateback.class)); cards.add(new SetCardInfo("Choking Tethers", 74, Rarity.COMMON, mage.cards.c.ChokingTethers.class)); From abb3a680fc51d3a8e965ecb03e14b06b176bc1ff Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 10 Aug 2017 08:01:32 -0400 Subject: [PATCH 24/30] Implemented Chain Stasis --- Mage.Sets/src/mage/cards/c/ChainStasis.java | 131 ++++++++++++++++++++ Mage.Sets/src/mage/sets/Homelands.java | 1 + 2 files changed, 132 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ChainStasis.java diff --git a/Mage.Sets/src/mage/cards/c/ChainStasis.java b/Mage.Sets/src/mage/cards/c/ChainStasis.java new file mode 100644 index 00000000000..4db9cb1646d --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChainStasis.java @@ -0,0 +1,131 @@ +/* + * 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.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public class ChainStasis extends CardImpl { + + public ChainStasis(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); + + // You may tap or untap target creature. Then that creature's controller may pay {2}{U}. If the player does, he or she may copy this spell and may choose a new target for that copy. + this.getSpellAbility().addEffect(new ChainStasisEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ChainStasis(final ChainStasis card) { + super(card); + } + + @Override + public ChainStasis copy() { + return new ChainStasis(this); + } +} + +class ChainStasisEffect extends OneShotEffect { + + public ChainStasisEffect() { + super(Outcome.Benefit); + } + + public ChainStasisEffect(final ChainStasisEffect effect) { + super(effect); + } + + @Override + public ChainStasisEffect copy() { + return new ChainStasisEffect(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) { + return false; + } + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + Effect effect = new MayTapOrUntapTargetEffect(); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); + effect.apply(game, source); + Player player = game.getPlayer(permanent.getControllerId()); + Cost cost = new ManaCostsImpl("{2}{U}"); + if (cost.pay(source, game, player.getId(), controller.getId(), false)) { + if (player.chooseUse(outcome, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + StackObject newStackObject = spell.createCopyOnStack(game, source, player.getId(), true); + if (newStackObject != null && newStackObject instanceof Spell) { + String activateMessage = ((Spell) newStackObject).getActivatedMessage(game); + if (activateMessage.startsWith(" casts ")) { + activateMessage = activateMessage.substring(6); + } + game.informPlayers(player.getLogName() + ' ' + activateMessage); + } + } + } + } + return true; + } + + return false; + } + + @Override + public String getText(Mode mode + ) { + return "You may tap or untap target creature. Then that creature's controller may pay {2}{U}. If the player does, he or she may copy this spell and may choose a new target for that copy"; + } + +} diff --git a/Mage.Sets/src/mage/sets/Homelands.java b/Mage.Sets/src/mage/sets/Homelands.java index 5c5ec0f9b15..2a39d1d41d6 100644 --- a/Mage.Sets/src/mage/sets/Homelands.java +++ b/Mage.Sets/src/mage/sets/Homelands.java @@ -91,6 +91,7 @@ public class Homelands extends ExpansionSet { cards.add(new SetCardInfo("Castle Sengir", 138, Rarity.UNCOMMON, mage.cards.c.CastleSengir.class)); cards.add(new SetCardInfo("Cemetery Gate", 4, Rarity.COMMON, CemeteryGate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Cemetery Gate", 5, Rarity.COMMON, CemeteryGate.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Chain Stasis", 28, Rarity.RARE, mage.cards.c.ChainStasis.class)); cards.add(new SetCardInfo("Chandler", 88, Rarity.COMMON, mage.cards.c.Chandler.class)); cards.add(new SetCardInfo("Clockwork Gnomes", 127, Rarity.COMMON, mage.cards.c.ClockworkGnomes.class)); cards.add(new SetCardInfo("Coral Reef", 29, Rarity.COMMON, mage.cards.c.CoralReef.class)); From fcd6edfe6f047a6782b8cae7004f7c750bc5cb81 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 10 Aug 2017 08:18:27 -0400 Subject: [PATCH 25/30] Implemented Charmed Griffin, added filter, fixed Hunted Wumpus wording --- .../src/mage/cards/c/CharmedGriffin.java | 117 ++++++++++++++++++ Mage.Sets/src/mage/cards/h/HuntedWumpus.java | 2 +- Mage.Sets/src/mage/sets/MercadianMasques.java | 1 + .../FilterArtifactOrEnchantmentCard.java | 58 +++++++++ 4 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/c/CharmedGriffin.java create mode 100644 Mage/src/main/java/mage/filter/common/FilterArtifactOrEnchantmentCard.java diff --git a/Mage.Sets/src/mage/cards/c/CharmedGriffin.java b/Mage.Sets/src/mage/cards/c/CharmedGriffin.java new file mode 100644 index 00000000000..0ad523dcfb7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CharmedGriffin.java @@ -0,0 +1,117 @@ +/* + * 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.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +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.FilterArtifactOrEnchantmentCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author TheElk801 + */ +public class CharmedGriffin extends CardImpl { + + public CharmedGriffin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); + + this.subtype.add("Griffin"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Charmed Griffin enters the battlefield, each other player may put an artifact or enchantment card onto the battlefield from his or her hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CharmedGriffinEffect(), false)); + } + + public CharmedGriffin(final CharmedGriffin card) { + super(card); + } + + @Override + public CharmedGriffin copy() { + return new CharmedGriffin(this); + } +} + +class CharmedGriffinEffect extends OneShotEffect { + + public CharmedGriffinEffect() { + super(Outcome.Detriment); + this.staticText = "each other player may put an artifact or enchantment card onto the battlefield from his or her hand"; + } + + public CharmedGriffinEffect(final CharmedGriffinEffect effect) { + super(effect); + } + + @Override + public CharmedGriffinEffect copy() { + return new CharmedGriffinEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + if (!playerId.equals(controller.getId())) { + Player player = game.getPlayer(playerId); + if (player != null) { + TargetCardInHand target = new TargetCardInHand(new FilterArtifactOrEnchantmentCard()); + if (target.canChoose(source.getSourceId(), playerId, game) + && player.chooseUse(Outcome.Neutral, "Put an artifact or enchantment card from your hand onto the battlefield?", source, game) + && player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + } + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/h/HuntedWumpus.java b/Mage.Sets/src/mage/cards/h/HuntedWumpus.java index 7b564be2f6e..4a9c36862ff 100644 --- a/Mage.Sets/src/mage/cards/h/HuntedWumpus.java +++ b/Mage.Sets/src/mage/cards/h/HuntedWumpus.java @@ -97,7 +97,7 @@ class HuntedWumpusEffect extends OneShotEffect { if (player != null) { TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); if (target.canChoose(source.getSourceId(), playerId, game) - && player.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", source, game) + && player.chooseUse(Outcome.Neutral, "Put a creature card from your hand onto the battlefield?", source, game) && player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index 25b51eb5dab..b90516b712f 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -90,6 +90,7 @@ public class MercadianMasques extends ExpansionSet { cards.add(new SetCardInfo("Ceremonial Guard", 182, Rarity.COMMON, mage.cards.c.CeremonialGuard.class)); cards.add(new SetCardInfo("Chambered Nautilus", 64, Rarity.UNCOMMON, mage.cards.c.ChamberedNautilus.class)); cards.add(new SetCardInfo("Charisma", 66, Rarity.RARE, mage.cards.c.Charisma.class)); + cards.add(new SetCardInfo("Charmed Griffin", 7, Rarity.UNCOMMON, mage.cards.c.CharmedGriffin.class)); cards.add(new SetCardInfo("Cho-Arrim Alchemist", 8, Rarity.RARE, mage.cards.c.ChoArrimAlchemist.class)); cards.add(new SetCardInfo("Cho-Arrim Bruiser", 9, Rarity.RARE, mage.cards.c.ChoArrimBruiser.class)); cards.add(new SetCardInfo("Cho-Arrim Legate", 10, Rarity.UNCOMMON, mage.cards.c.ChoArrimLegate.class)); diff --git a/Mage/src/main/java/mage/filter/common/FilterArtifactOrEnchantmentCard.java b/Mage/src/main/java/mage/filter/common/FilterArtifactOrEnchantmentCard.java new file mode 100644 index 00000000000..40b087fbb44 --- /dev/null +++ b/Mage/src/main/java/mage/filter/common/FilterArtifactOrEnchantmentCard.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.filter.common; + +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author TheElk801 + */ +public class FilterArtifactOrEnchantmentCard extends FilterCard { + + public FilterArtifactOrEnchantmentCard() { + this("artifact or enchantment card"); + } + + public FilterArtifactOrEnchantmentCard(String name) { + super(name); + this.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public FilterArtifactOrEnchantmentCard(final FilterArtifactOrEnchantmentCard filter) { + super(filter); + } + + @Override + public FilterArtifactOrEnchantmentCard copy() { + return new FilterArtifactOrEnchantmentCard(this); + } +} \ No newline at end of file From 946cab13551a895c9dbd91ba535e125e3580f8fc Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 10 Aug 2017 08:37:16 -0400 Subject: [PATCH 26/30] Implemented Chieftain en-Dal --- .../src/mage/cards/c/ChieftainEnDal.java | 69 +++++++++++++++++++ Mage.Sets/src/mage/sets/Nemesis.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ChieftainEnDal.java diff --git a/Mage.Sets/src/mage/cards/c/ChieftainEnDal.java b/Mage.Sets/src/mage/cards/c/ChieftainEnDal.java new file mode 100644 index 00000000000..dfb6edf9d55 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChieftainEnDal.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.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author TheElk801 + */ +public class ChieftainEnDal extends CardImpl { + + public ChieftainEnDal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Chieftain en-Dal attacks, attacking creatures gain first strike until end of turn. + Ability ability = new AttacksTriggeredAbility(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterAttackingCreature()), false); + this.addAbility(ability); + } + + public ChieftainEnDal(final ChieftainEnDal card) { + super(card); + } + + @Override + public ChieftainEnDal copy() { + return new ChieftainEnDal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Nemesis.java b/Mage.Sets/src/mage/sets/Nemesis.java index 471b321232f..c8fc24f514b 100644 --- a/Mage.Sets/src/mage/sets/Nemesis.java +++ b/Mage.Sets/src/mage/sets/Nemesis.java @@ -69,6 +69,7 @@ public class Nemesis extends ExpansionSet { cards.add(new SetCardInfo("Blinding Angel", 3, Rarity.RARE, mage.cards.b.BlindingAngel.class)); cards.add(new SetCardInfo("Bola Warrior", 78, Rarity.COMMON, mage.cards.b.BolaWarrior.class)); cards.add(new SetCardInfo("Carrion Wall", 54, Rarity.UNCOMMON, mage.cards.c.CarrionWall.class)); + cards.add(new SetCardInfo("Chieftain en-Dal", 4, Rarity.UNCOMMON, mage.cards.c.ChieftainEnDal.class)); cards.add(new SetCardInfo("Cloudskate", 29, Rarity.COMMON, mage.cards.c.Cloudskate.class)); cards.add(new SetCardInfo("Daze", 30, Rarity.COMMON, mage.cards.d.Daze.class)); cards.add(new SetCardInfo("Death Pit Offering", 56, Rarity.RARE, mage.cards.d.DeathPitOffering.class)); From 976f2ff1ac68364c4e50ca65249819ad4fd4ea71 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 10 Aug 2017 08:52:16 -0400 Subject: [PATCH 27/30] Implemented Coiling Woodworm --- .../src/mage/cards/c/CoilingWoodworm.java | 76 +++++++++++++++++++ Mage.Sets/src/mage/sets/Nemesis.java | 1 + 2 files changed, 77 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CoilingWoodworm.java diff --git a/Mage.Sets/src/mage/cards/c/CoilingWoodworm.java b/Mage.Sets/src/mage/cards/c/CoilingWoodworm.java new file mode 100644 index 00000000000..da59c1bc16d --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CoilingWoodworm.java @@ -0,0 +1,76 @@ +/* + * 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.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author TheElk801 + */ +public class CoilingWoodworm extends CardImpl { + + final static FilterPermanent filterLands = new FilterPermanent("Forests you control"); + + static { + filterLands.add(new SubtypePredicate(SubType.FOREST)); + } + + public CoilingWoodworm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add("Insect"); + this.subtype.add("Worm"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Coiling Woodworm's power is equal to the number of Forests on the battlefield. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); + } + + public CoilingWoodworm(final CoilingWoodworm card) { + super(card); + } + + @Override + public CoilingWoodworm copy() { + return new CoilingWoodworm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Nemesis.java b/Mage.Sets/src/mage/sets/Nemesis.java index c8fc24f514b..e783b4849a4 100644 --- a/Mage.Sets/src/mage/sets/Nemesis.java +++ b/Mage.Sets/src/mage/sets/Nemesis.java @@ -71,6 +71,7 @@ public class Nemesis extends ExpansionSet { cards.add(new SetCardInfo("Carrion Wall", 54, Rarity.UNCOMMON, mage.cards.c.CarrionWall.class)); cards.add(new SetCardInfo("Chieftain en-Dal", 4, Rarity.UNCOMMON, mage.cards.c.ChieftainEnDal.class)); cards.add(new SetCardInfo("Cloudskate", 29, Rarity.COMMON, mage.cards.c.Cloudskate.class)); + cards.add(new SetCardInfo("Coiling Woodworm", 103, Rarity.UNCOMMON, mage.cards.c.CoilingWoodworm.class)); cards.add(new SetCardInfo("Daze", 30, Rarity.COMMON, mage.cards.d.Daze.class)); cards.add(new SetCardInfo("Death Pit Offering", 56, Rarity.RARE, mage.cards.d.DeathPitOffering.class)); cards.add(new SetCardInfo("Defender en-Vec", 5, Rarity.COMMON, mage.cards.d.DefenderEnVec.class)); From 4038aa3408ee0848797dba10e744b7386a526d9d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 10 Aug 2017 09:03:19 -0400 Subject: [PATCH 28/30] Implemented Chill Haunting --- Mage.Sets/src/mage/cards/c/ChillHaunting.java | 69 +++++++++++++++++++ Mage.Sets/src/mage/sets/Scourge.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ChillHaunting.java diff --git a/Mage.Sets/src/mage/cards/c/ChillHaunting.java b/Mage.Sets/src/mage/cards/c/ChillHaunting.java new file mode 100644 index 00000000000..4b678c04116 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChillHaunting.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.c; + +import java.util.UUID; +import mage.abilities.costs.common.ExileXFromYourGraveCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class ChillHaunting extends CardImpl { + + public ChillHaunting(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}"); + + // As an additional cost to cast Chill Haunting, exile X creature cards from your graveyard. + this.getSpellAbility().addCost(new ExileXFromYourGraveCost(new FilterCreatureCard("cards from your graveyard"))); + + // Target creature gets -X/-X until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + DynamicValue xval = new SignInversionDynamicValue(new GetXValue()); + this.getSpellAbility().addEffect(new BoostTargetEffect(xval, xval, Duration.EndOfTurn)); + } + + public ChillHaunting(final ChillHaunting card) { + super(card); + } + + @Override + public ChillHaunting copy() { + return new ChillHaunting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Scourge.java b/Mage.Sets/src/mage/sets/Scourge.java index 6a9cd21d011..73d0ee6c7d4 100644 --- a/Mage.Sets/src/mage/sets/Scourge.java +++ b/Mage.Sets/src/mage/sets/Scourge.java @@ -73,6 +73,7 @@ public class Scourge extends ExpansionSet { cards.add(new SetCardInfo("Carbonize", 83, Rarity.UNCOMMON, mage.cards.c.Carbonize.class)); cards.add(new SetCardInfo("Carrion Feeder", 59, Rarity.COMMON, mage.cards.c.CarrionFeeder.class)); cards.add(new SetCardInfo("Chartooth Cougar", 84, Rarity.COMMON, mage.cards.c.ChartoothCougar.class)); + cards.add(new SetCardInfo("Chill Haunting", 60, Rarity.UNCOMMON, mage.cards.c.ChillHaunting.class)); cards.add(new SetCardInfo("Claws of Wirewood", 114, Rarity.UNCOMMON, mage.cards.c.ClawsOfWirewood.class)); cards.add(new SetCardInfo("Clutch of Undeath", 61, Rarity.COMMON, mage.cards.c.ClutchOfUndeath.class)); cards.add(new SetCardInfo("Coast Watcher", 30, Rarity.COMMON, mage.cards.c.CoastWatcher.class)); From da77fbf90b5418bfbcaaabf3384955062d9e4184 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 10 Aug 2017 09:27:11 -0400 Subject: [PATCH 29/30] Implemented Cleansing --- Mage.Sets/src/mage/cards/c/Cleansing.java | 111 ++++++++++++++++++++++ Mage.Sets/src/mage/sets/TheDark.java | 1 + 2 files changed, 112 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/Cleansing.java diff --git a/Mage.Sets/src/mage/cards/c/Cleansing.java b/Mage.Sets/src/mage/cards/c/Cleansing.java new file mode 100644 index 00000000000..efc3bf62019 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/Cleansing.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.Iterator; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public class Cleansing extends CardImpl { + + public Cleansing(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}{W}{W}"); + + // For each land, destroy that land unless any player pays 1 life. + this.getSpellAbility().addEffect(new CleansingEffect()); + } + + public Cleansing(final Cleansing card) { + super(card); + } + + @Override + public Cleansing copy() { + return new Cleansing(this); + } +} + +class CleansingEffect extends OneShotEffect { + + CleansingEffect() { + super(Outcome.DestroyPermanent); + staticText = "For each land, destroy that land unless any player pays 1 life"; + } + + CleansingEffect(final CleansingEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Iterator permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game).iterator(); + while (permanents.hasNext()) { + boolean paidLife = false; + Permanent p = permanents.next(); + if (p.isLand()) { + paidLife = false; + game.informPlayers("Any player may pay 1 life to prevent the destruction of " + p.getLogName() + " controlled by " + game.getPlayer(p.getControllerId()).getLogName() + "."); + PayLifeCost cost = new PayLifeCost(1); + for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { + Player player = game.getPlayer(playerId); + cost.clearPaid(); + if (cost.canPay(source, source.getSourceId(), player.getId(), game) + && player.chooseUse(outcome, "Pay 1 life to prevent this?", source, game)) { + if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { + game.informPlayers(player.getLogName() + " pays 1 life to prevent the destruction of " + p.getLogName()); + paidLife = true; + } + } + } + if (!paidLife) { + p.destroy(source.getSourceId(), game, false); + } + } + } + + return true; + } + + @Override + public CleansingEffect copy() { + return new CleansingEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheDark.java b/Mage.Sets/src/mage/sets/TheDark.java index 8aa4a1ab4f7..529f694b705 100644 --- a/Mage.Sets/src/mage/sets/TheDark.java +++ b/Mage.Sets/src/mage/sets/TheDark.java @@ -68,6 +68,7 @@ public class TheDark extends ExpansionSet { cards.add(new SetCardInfo("Carnivorous Plant", 38, Rarity.COMMON, mage.cards.c.CarnivorousPlant.class)); cards.add(new SetCardInfo("Cave People", 59, Rarity.UNCOMMON, mage.cards.c.CavePeople.class)); cards.add(new SetCardInfo("City of Shadows", 113, Rarity.RARE, mage.cards.c.CityOfShadows.class)); + cards.add(new SetCardInfo("Cleansing", 77, Rarity.RARE, mage.cards.c.Cleansing.class)); cards.add(new SetCardInfo("Coal Golem", 96, Rarity.UNCOMMON, mage.cards.c.CoalGolem.class)); cards.add(new SetCardInfo("Dance of Many", 21, Rarity.RARE, mage.cards.d.DanceOfMany.class)); cards.add(new SetCardInfo("Dark Heart of the Wood", 117, Rarity.COMMON, mage.cards.d.DarkHeartOfTheWood.class)); From 1e1bb6c3ba66e30adc6f2f8c19b47adc00f135bb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 10 Aug 2017 09:34:03 -0400 Subject: [PATCH 30/30] Implemented Chime of Night --- Mage.Sets/src/mage/cards/c/ChimeOfNight.java | 84 ++++++++++++++++++++ Mage.Sets/src/mage/sets/UrzasDestiny.java | 1 + 2 files changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ChimeOfNight.java diff --git a/Mage.Sets/src/mage/cards/c/ChimeOfNight.java b/Mage.Sets/src/mage/cards/c/ChimeOfNight.java new file mode 100644 index 00000000000..85d0e436bba --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChimeOfNight.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import java.util.UUID; +import mage.ObjectColor; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.Ability; +import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author TheElk801 + */ +public class ChimeOfNight extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public ChimeOfNight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Chime of Night is put into a graveyard from the battlefield, destroy target nonblack creature. + ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetPermanent(filter)); + } + + public ChimeOfNight(final ChimeOfNight card) { + super(card); + } + + @Override + public ChimeOfNight copy() { + return new ChimeOfNight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/UrzasDestiny.java b/Mage.Sets/src/mage/sets/UrzasDestiny.java index 42e434817a1..8d85982e311 100644 --- a/Mage.Sets/src/mage/sets/UrzasDestiny.java +++ b/Mage.Sets/src/mage/sets/UrzasDestiny.java @@ -73,6 +73,7 @@ public class UrzasDestiny extends ExpansionSet { cards.add(new SetCardInfo("Capashen Standard", 4, Rarity.COMMON, mage.cards.c.CapashenStandard.class)); cards.add(new SetCardInfo("Capashen Templar", 5, Rarity.COMMON, mage.cards.c.CapashenTemplar.class)); cards.add(new SetCardInfo("Carnival of Souls", 55, Rarity.RARE, mage.cards.c.CarnivalOfSouls.class)); + cards.add(new SetCardInfo("Chime of Night", 56, Rarity.COMMON, mage.cards.c.ChimeOfNight.class)); cards.add(new SetCardInfo("Colos Yearling", 79, Rarity.COMMON, mage.cards.c.ColosYearling.class)); cards.add(new SetCardInfo("Compost", 102, Rarity.UNCOMMON, mage.cards.c.Compost.class)); cards.add(new SetCardInfo("Covetous Dragon", 80, Rarity.RARE, mage.cards.c.CovetousDragon.class));