diff --git a/Mage.Sets/src/mage/sets/commander/Flusterstorm.java b/Mage.Sets/src/mage/sets/commander/Flusterstorm.java new file mode 100644 index 00000000000..affe033ee58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/Flusterstorm.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.sets.commander; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.keyword.StormAbility; +import mage.cards.CardImpl; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetSpell; + +/** + * + * @author Plopman + */ +public class Flusterstorm extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); + static { + filter.add(Predicates.or(new CardTypePredicate(Constants.CardType.INSTANT), new CardTypePredicate(Constants.CardType.SORCERY))); + } + + public Flusterstorm(UUID ownerId) { + super(ownerId, 46, "Flusterstorm", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "CMD"; + + this.color.setBlue(true); + + // Counter target instant or sorcery spell unless its controller pays {1}. + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManaCostsImpl("{1}"))); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + // Storm + this.addAbility(new StormAbility()); + } + + public Flusterstorm(final Flusterstorm card) { + super(card); + } + + @Override + public Flusterstorm copy() { + return new Flusterstorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/FaerieMacabre.java b/Mage.Sets/src/mage/sets/modernmasters/FaerieMacabre.java new file mode 100644 index 00000000000..4021ea96f70 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/FaerieMacabre.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.modernmasters; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class FaerieMacabre extends mage.sets.shadowmoor.FaerieMacabre { + + public FaerieMacabre(UUID ownerId) { + super(ownerId); + this.cardNumber = 86; + this.expansionSetCode = "MMA"; + } + + public FaerieMacabre(final FaerieMacabre card) { + super(card); + } + + @Override + public FaerieMacabre copy() { + return new FaerieMacabre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/SharedAnimosity.java b/Mage.Sets/src/mage/sets/morningtide/SharedAnimosity.java new file mode 100644 index 00000000000..1ebf6b3c070 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/SharedAnimosity.java @@ -0,0 +1,139 @@ +/* + * 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.morningtide; + +import java.awt.List; +import java.util.ArrayList; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.AttacksCreatureYourControlTriggeredAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.ChangelingAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.PermanentIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author Plopman + */ +public class SharedAnimosity extends CardImpl { + + public SharedAnimosity(UUID ownerId) { + super(ownerId, 104, "Shared Animosity", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "MOR"; + + this.color.setRed(true); + + // Whenever a creature you control attacks, it gets +1/+0 until end of turn for each other attacking creature that shares a creature type with it. + this.addAbility(new AttacksCreatureYourControlTriggeredAbility(new SharedAnimosityEffect(), false, true)); + } + + public SharedAnimosity(final SharedAnimosity card) { + super(card); + } + + @Override + public SharedAnimosity copy() { + return new SharedAnimosity(this); + } +} + +class SharedAnimosityEffect extends ContinuousEffectImpl { + + private int power; + + public SharedAnimosityEffect() { + super(Constants.Duration.EndOfTurn, Constants.Layer.PTChangingEffects_7, Constants.SubLayer.ModifyPT_7c, Constants.Outcome.BoostCreature); + + } + + public SharedAnimosityEffect(final SharedAnimosityEffect effect) { + super(effect); + this.power = effect.power; + } + + @Override + public SharedAnimosityEffect copy() { + return new SharedAnimosityEffect(this); + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + Permanent permanent = game.getPermanent(this.targetPointer.getFirst(game, source)); + if (permanent != null) { + + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(Predicates.not(new PermanentIdPredicate(this.targetPointer.getFirst(game, source)))); + filter.add(new AttackingPredicate()); + boolean isChangeling = false; + for(Ability ability : permanent.getAbilities()){ + if(ability instanceof ChangelingAbility){ + isChangeling = true; + } + } + if(!isChangeling){ + ArrayList> predicateList = new ArrayList>(); + for(String subtype : permanent.getSubtype()){ + predicateList.add(new SubtypePredicate(subtype)); + } + filter.add(Predicates.or(predicateList)); + } + + power = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game).size(); + } + targetPointer.init(game, source); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent target = (Permanent) game.getPermanent(this.targetPointer.getFirst(game, source)); + if (target != null) { + target.addPower(power); + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + return "it gets +1/+0 until end of turn for each other attacking creature that shares a creature type with it"; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/FaerieMacabre.java b/Mage.Sets/src/mage/sets/shadowmoor/FaerieMacabre.java new file mode 100644 index 00000000000..15038e7375e --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/FaerieMacabre.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.shadowmoor; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author Plopman + */ +public class FaerieMacabre extends CardImpl { + + public FaerieMacabre(UUID ownerId) { + super(ownerId, 66, "Faerie Macabre", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Faerie"); + this.subtype.add("Rogue"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Discard Faerie Macabre: Exile up to two target cards from graveyards. + Ability ability = new SimpleActivatedAbility(Constants.Zone.HAND, new ExileTargetEffect(), new DiscardSourceCost()); + ability.addTarget(new TargetCardInGraveyard(0, 2, new FilterCard("cards from graveyards"))); + this.addAbility(ability); + } + + public FaerieMacabre(final FaerieMacabre card) { + super(card); + } + + @Override + public FaerieMacabre copy() { + return new FaerieMacabre(this); + } +} + +class ExileTargetEffect extends OneShotEffect { + + public ExileTargetEffect() { + super(Constants.Outcome.Exile); + } + + public ExileTargetEffect(final ExileTargetEffect effect) { + super(effect); + } + + @Override + public ExileTargetEffect copy() { + return new ExileTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for(UUID uuid : source.getTargets().get(0).getTargets()){ + Card card = game.getCard(uuid); + if (card != null) { + card.moveToExile(null, "Faerie Macabre", source.getSourceId(), game); + } + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Exile up to two target cards from graveyards"; + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/AncestralVision.java b/Mage.Sets/src/mage/sets/timespiral/AncestralVision.java new file mode 100644 index 00000000000..8e6be35a7c4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/AncestralVision.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.sets.timespiral; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.target.TargetPlayer; + +/** + * + * @author Plopman + */ +public class AncestralVision extends CardImpl { + + public AncestralVision(UUID ownerId) { + super(ownerId, 48, "Ancestral Vision", Rarity.RARE, new CardType[]{CardType.SORCERY}, ""); + this.expansionSetCode = "TSP"; + + // Suspend 4-{U} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("U"), this)); + // Target player draws three cards. + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DrawCardTargetEffect(3)); + } + + public AncestralVision(final AncestralVision card) { + super(card); + } + + @Override + public AncestralVision copy() { + return new AncestralVision(this); + } +}