diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BlessingsOfNature.java b/Mage.Sets/src/mage/sets/avacynrestored/BlessingsOfNature.java new file mode 100644 index 0000000000..4891221ba5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/BlessingsOfNature.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.sets.avacynrestored; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.MiracleAbility; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanentAmount; + +/** + * + * @author North + */ +public class BlessingsOfNature extends CardImpl { + + public BlessingsOfNature(UUID ownerId) { + super(ownerId, 168, "Blessings of Nature", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{G}"); + this.expansionSetCode = "AVR"; + + this.color.setGreen(true); + + // Distribute four +1/+1 counters among any number of target creatures. + this.getSpellAbility().addEffect(new BlessingsOfNatureEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(4)); + + this.addAbility(new MiracleAbility(new ManaCostsImpl("{G}"))); + } + + public BlessingsOfNature(final BlessingsOfNature card) { + super(card); + } + + @Override + public BlessingsOfNature copy() { + return new BlessingsOfNature(this); + } +} + +class BlessingsOfNatureEffect extends OneShotEffect { + + public BlessingsOfNatureEffect() { + super(Outcome.BoostCreature); + this.staticText = "Distribute four +1/+1 counters among any number of target creatures"; + } + + public BlessingsOfNatureEffect(final BlessingsOfNatureEffect effect) { + super(effect); + } + + @Override + public BlessingsOfNatureEffect copy() { + return new BlessingsOfNatureEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + if (source.getTargets().size() > 0) { + Target multiTarget = source.getTargets().get(0); + for (UUID target : multiTarget.getTargets()) { + Permanent permanent = game.getPermanent(target); + if (permanent != null) { + permanent.addCounters(CounterType.P1P1.createInstance(multiTarget.getTargetAmount(target)), game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/PrimalSurge.java b/Mage.Sets/src/mage/sets/avacynrestored/PrimalSurge.java new file mode 100644 index 0000000000..c58d9cca88 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/PrimalSurge.java @@ -0,0 +1,121 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.avacynrestored; + +import java.util.List; +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author North + */ +public class PrimalSurge extends CardImpl { + + public PrimalSurge(UUID ownerId) { + super(ownerId, 189, "Primal Surge", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{8}{G}{G}"); + this.expansionSetCode = "AVR"; + + this.color.setGreen(true); + + // Exile the top card of your library. If it's a permanent card, you may put it onto the battlefield. If you do, repeat this process. + this.getSpellAbility().addEffect(new PrimalSurgeEffect()); + } + + public PrimalSurge(final PrimalSurge card) { + super(card); + } + + @Override + public PrimalSurge copy() { + return new PrimalSurge(this); + } +} + +class PrimalSurgeEffect extends OneShotEffect { + + public PrimalSurgeEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "Exile the top card of your library. If it's a permanent card, you may put it onto the battlefield. If you do, repeat this process"; + } + + public PrimalSurgeEffect(final PrimalSurgeEffect effect) { + super(effect); + } + + @Override + public PrimalSurgeEffect copy() { + return new PrimalSurgeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + boolean repeat; + do { + repeat = false; + if (player.getLibrary().size() > 0) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToExile(null, "", source.getId(), game); + List cardType = card.getCardType(); + if ((cardType.contains(CardType.ARTIFACT) || cardType.contains(CardType.CREATURE) + || cardType.contains(CardType.ENCHANTMENT) || cardType.contains(CardType.LAND) + || cardType.contains(CardType.PLANESWALKER)) + && player.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", game)) { + card.moveToZone(Zone.BATTLEFIELD, source.getId(), game, false); + + Permanent permanent = game.getPermanent(card.getId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(card.getId(), Zone.BATTLEFIELD); + } + if (permanent != null) { + repeat = true; + } + } + } + } + } while (repeat); + + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ReforgeTheSoul.java b/Mage.Sets/src/mage/sets/avacynrestored/ReforgeTheSoul.java new file mode 100644 index 0000000000..b8d7086e51 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/ReforgeTheSoul.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.avacynrestored; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.MiracleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author North + */ +public class ReforgeTheSoul extends CardImpl { + + public ReforgeTheSoul(UUID ownerId) { + super(ownerId, 151, "Reforge the Soul", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "AVR"; + + this.color.setRed(true); + + // Each player discards his or her hand and draws seven cards. + this.getSpellAbility().addEffect(new ReforgeTheSoulEffect()); + + this.addAbility(new MiracleAbility(new ManaCostsImpl("{1}{R}"))); + } + + public ReforgeTheSoul(final ReforgeTheSoul card) { + super(card); + } + + @Override + public ReforgeTheSoul copy() { + return new ReforgeTheSoul(this); + } +} + +class ReforgeTheSoulEffect extends OneShotEffect { + + public ReforgeTheSoulEffect() { + super(Outcome.DrawCard); + this.staticText = "Each player discards his or her hand and draws seven cards"; + } + + public ReforgeTheSoulEffect(final ReforgeTheSoulEffect effect) { + super(effect); + } + + @Override + public ReforgeTheSoulEffect copy() { + return new ReforgeTheSoulEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getHand().getCards(game)) { + player.discard(card, source, game); + } + + player.drawCards(7, game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/Terminus.java b/Mage.Sets/src/mage/sets/avacynrestored/Terminus.java new file mode 100644 index 0000000000..5a241cdd30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/Terminus.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.avacynrestored; + +import java.util.List; +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.MiracleAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class Terminus extends CardImpl { + + public Terminus(UUID ownerId) { + super(ownerId, 38, "Terminus", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{W}"); + this.expansionSetCode = "AVR"; + + this.color.setWhite(true); + + + // Put all creatures on the bottom of their owners' libraries. + this.getSpellAbility().addEffect(new TerminusEffect()); + + this.addAbility(new MiracleAbility(new ManaCostsImpl("{W}"))); + } + + public Terminus(final Terminus card) { + super(card); + } + + @Override + public Terminus copy() { + return new Terminus(this); + } +} + +class TerminusEffect extends OneShotEffect { + + public TerminusEffect() { + super(Outcome.Removal); + this.staticText = "Put all creatures on the bottom of their owners' libraries"; + } + + public TerminusEffect(final TerminusEffect effect) { + super(effect); + } + + @Override + public TerminusEffect copy() { + return new TerminusEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + List permanents = game.getBattlefield().getActivePermanents( + new FilterCreaturePermanent(), source.getControllerId(), source.getId(), game); + for (Permanent permanent : permanents) { + permanent.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ThunderousWrath.java b/Mage.Sets/src/mage/sets/avacynrestored/ThunderousWrath.java new file mode 100644 index 0000000000..8677de1207 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/ThunderousWrath.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.sets.avacynrestored; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.MiracleAbility; +import mage.cards.CardImpl; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author North + */ +public class ThunderousWrath extends CardImpl { + + public ThunderousWrath(UUID ownerId) { + super(ownerId, 160, "Thunderous Wrath", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{R}{R}"); + this.expansionSetCode = "AVR"; + + this.color.setRed(true); + + // Thunderous Wrath deals 5 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(5)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + + this.addAbility(new MiracleAbility(new ManaCostsImpl("{R}"))); + } + + public ThunderousWrath(final ThunderousWrath card) { + super(card); + } + + @Override + public ThunderousWrath copy() { + return new ThunderousWrath(this); + } +}