diff --git a/Mage.Sets/src/mage/sets/fifthdawn/AllSunsDawn.java b/Mage.Sets/src/mage/sets/fifthdawn/AllSunsDawn.java new file mode 100644 index 00000000000..c0b66f291f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/AllSunsDawn.java @@ -0,0 +1,52 @@ +/* + * 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.fifthdawn; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AllSunsDawn extends mage.sets.modernmasters2015.AllSunsDawn { + + public AllSunsDawn(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "5DN"; + } + + public AllSunsDawn(final AllSunsDawn card) { + super(card); + } + + @Override + public AllSunsDawn copy() { + return new AllSunsDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/HordeOfNotions.java b/Mage.Sets/src/mage/sets/lorwyn/HordeOfNotions.java new file mode 100644 index 00000000000..de87235ec59 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/HordeOfNotions.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.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class HordeOfNotions extends CardImpl { + + private final static FilterCard filter = new FilterCard("Elemental card from your graveyard"); + + static { + filter.add(new SubtypePredicate("Elemental")); + } + + public HordeOfNotions(UUID ownerId) { + super(ownerId, 249, "Horde of Notions", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}"); + this.expansionSetCode = "LRW"; + this.supertype.add("Legendary"); + this.subtype.add("Elemental"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + + // {W}{U}{B}{R}{G}: You may play target Elemental card from your graveyard without paying its mana cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HordeOfNotionsEffect(), new ManaCostsImpl<>("{W}{U}{B}{R}{G}")); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + } + + public HordeOfNotions(final HordeOfNotions card) { + super(card); + } + + @Override + public HordeOfNotions copy() { + return new HordeOfNotions(this); + } +} + +class HordeOfNotionsEffect extends OneShotEffect { + + public HordeOfNotionsEffect() { + super(Outcome.PlayForFree); + this.staticText = "You may play target Elemental card from your graveyard without paying its mana cost"; + } + + public HordeOfNotionsEffect(final HordeOfNotionsEffect effect) { + super(effect); + } + + @Override + public HordeOfNotionsEffect copy() { + return new HordeOfNotionsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (card != null ) { + // Probably there is no Elemental land, but who knows + if (card.getCardType().contains(CardType.LAND) && controller.canPlayLand() && + controller.chooseUse(outcome, "Play " + card.getName() + " from your graveyard for free?", game)) { + controller.playLand(card, game); + } else { + if (card.getSpellAbility().canChooseTarget(game) && + controller.chooseUse(outcome, "Play " + card.getName() + " from your graveyard for free?", game)) { + controller.cast(card.getSpellAbility(), game, true); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters2015/AllSunsDawn.java b/Mage.Sets/src/mage/sets/modernmasters2015/AllSunsDawn.java new file mode 100644 index 00000000000..6d596b03bb1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters2015/AllSunsDawn.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.sets.modernmasters2015; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class AllSunsDawn extends CardImpl { + + public AllSunsDawn(UUID ownerId) { + super(ownerId, 138, "All Suns' Dawn", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{G}"); + this.expansionSetCode = "MMB"; + + // For each color, return up to one target card of that color from your graveyard to your hand. + this.getSpellAbility().addEffect(new AllSunsDawnEffect()); + // Exile All Suns' Dawn. + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + } + + public AllSunsDawn(final AllSunsDawn card) { + super(card); + } + + @Override + public AllSunsDawn copy() { + return new AllSunsDawn(this); + } +} + +class AllSunsDawnEffect extends OneShotEffect { + + public AllSunsDawnEffect() { + super(Outcome.ReturnToHand); + this.staticText = "For each color, return up to one target card of that color from your graveyard to your hand. Exile {this}"; + } + + public AllSunsDawnEffect(final AllSunsDawnEffect effect) { + super(effect); + } + + @Override + public AllSunsDawnEffect copy() { + return new AllSunsDawnEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (ObjectColor objectColor :ObjectColor.getAllColors()) { + FilterCard filterColor = new FilterCard("up to one " + objectColor.getDescription() + " card to return to your hand"); + filterColor.add(new ColorPredicate(objectColor)); + if (controller.getGraveyard().count(filterColor, game) > 0) { + TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(0, 1, filterColor); + controller.chooseTarget(outcome, target, source, game); + if (!target.getTargets().isEmpty()) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true); + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters2015/HordeOfNotions.java b/Mage.Sets/src/mage/sets/modernmasters2015/HordeOfNotions.java new file mode 100644 index 00000000000..56561d3bf81 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters2015/HordeOfNotions.java @@ -0,0 +1,52 @@ +/* + * 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.modernmasters2015; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class HordeOfNotions extends mage.sets.lorwyn.HordeOfNotions { + + public HordeOfNotions(UUID ownerId) { + super(ownerId); + this.cardNumber = 178; + this.expansionSetCode = "MMB"; + } + + public HordeOfNotions(final HordeOfNotions card) { + super(card); + } + + @Override + public HordeOfNotions copy() { + return new HordeOfNotions(this); + } +} diff --git a/Mage/src/mage/ObjectColor.java b/Mage/src/mage/ObjectColor.java index a1851065ccc..812e45f1876 100644 --- a/Mage/src/mage/ObjectColor.java +++ b/Mage/src/mage/ObjectColor.java @@ -340,4 +340,13 @@ public class ObjectColor implements Serializable, Copyable, Compara return o1 - o2; } + public static List getAllColors() { + List colors = new ArrayList<>(); + colors.add(ObjectColor.WHITE); + colors.add(ObjectColor.BLUE); + colors.add(ObjectColor.BLACK); + colors.add(ObjectColor.RED); + colors.add(ObjectColor.GREEN); + return colors; + } }