diff --git a/Mage.Sets/src/mage/sets/coldsnap/ColdsteelHeart.java b/Mage.Sets/src/mage/sets/coldsnap/ColdsteelHeart.java new file mode 100644 index 0000000000..33be1dc2fe --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/ColdsteelHeart.java @@ -0,0 +1,119 @@ +/* + * 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.coldsnap; + +import java.util.UUID; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.ChooseColorEffect; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author Plopman + */ +public class ColdsteelHeart extends CardImpl { + + public ColdsteelHeart(UUID ownerId) { + super(ownerId, 136, "Coldsteel Heart", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + + // Coldsteel Heart enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + // As Coldsteel Heart enters the battlefield, choose a color. + this.addAbility(new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral))); + // {tap}: Add one mana of the chosen color to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new ColdsteelHeartManaEffect(), new TapSourceCost())); + } + + public ColdsteelHeart(final ColdsteelHeart card) { + super(card); + } + + @Override + public ColdsteelHeart copy() { + return new ColdsteelHeart(this); + } +} + +class ColdsteelHeartManaEffect extends ManaEffect { + + public ColdsteelHeartManaEffect() { + super(); + staticText = "Add one mana of the chosen color to your mana pool"; + } + + public ColdsteelHeartManaEffect(final ColdsteelHeartManaEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); + switch(color.toString()) { + case "W": + player.getManaPool().addMana(Mana.WhiteMana, game, source); + break; + case "B": + player.getManaPool().addMana(Mana.BlackMana, game, source); + break; + case "U": + player.getManaPool().addMana(Mana.BlueMana, game, source); + break; + case "G": + player.getManaPool().addMana(Mana.GreenMana, game, source); + break; + case "R": + player.getManaPool().addMana(Mana.RedMana, game, source); + break; + } + return true; + } + return false; + } + + @Override + public ColdsteelHeartManaEffect copy() { + return new ColdsteelHeartManaEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander/FellwarStone.java b/Mage.Sets/src/mage/sets/commander/FellwarStone.java new file mode 100644 index 0000000000..a755802ae4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/FellwarStone.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.commander; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class FellwarStone extends mage.sets.ninthedition.FellwarStone { + + public FellwarStone(UUID ownerId) { + super(ownerId); + this.cardNumber = 248; + this.expansionSetCode = "CMD"; + } + + public FellwarStone(final FellwarStone card) { + super(card); + } + + @Override + public FellwarStone copy() { + return new FellwarStone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/GuardianIdol.java b/Mage.Sets/src/mage/sets/fifthdawn/GuardianIdol.java new file mode 100644 index 0000000000..f7b352ae95 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/GuardianIdol.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.sets.fifthdawn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BecomesCreatureSourceEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author Plopman + */ +public class GuardianIdol extends CardImpl { + + public GuardianIdol(UUID ownerId) { + super(ownerId, 128, "Guardian Idol", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "5DN"; + + // Guardian Idol enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + // {tap}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + // {2}: Guardian Idol becomes a 2/2 Golem artifact creature until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new GolemToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{2}"))); + } + + public GuardianIdol(final GuardianIdol card) { + super(card); + } + + @Override + public GuardianIdol copy() { + return new GuardianIdol(this); + } +} + +class GolemToken extends Token { + + public GolemToken() { + super("Golem", "a 2/2 Golem artifact creature token"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + subtype.add("Golem"); + power = new MageInt(2); + toughness = new MageInt(2); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/fifthedition/FellwarStone.java b/Mage.Sets/src/mage/sets/fifthedition/FellwarStone.java new file mode 100644 index 0000000000..3e6ab7f940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/FellwarStone.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.fifthedition; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class FellwarStone extends mage.sets.ninthedition.FellwarStone { + + public FellwarStone(UUID ownerId) { + super(ownerId); + this.cardNumber = 369; + this.expansionSetCode = "5ED"; + } + + public FellwarStone(final FellwarStone card) { + super(card); + } + + @Override + public FellwarStone copy() { + return new FellwarStone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/FellwarStone.java b/Mage.Sets/src/mage/sets/fourthedition/FellwarStone.java new file mode 100644 index 0000000000..167b8ac265 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/FellwarStone.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class FellwarStone extends mage.sets.ninthedition.FellwarStone { + + public FellwarStone(UUID ownerId) { + super(ownerId); + this.cardNumber = 337; + this.expansionSetCode = "4ED"; + } + + public FellwarStone(final FellwarStone card) { + super(card); + } + + @Override + public FellwarStone copy() { + return new FellwarStone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/HighMarket.java b/Mage.Sets/src/mage/sets/mercadianmasques/HighMarket.java new file mode 100644 index 0000000000..a43cf187fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/HighMarket.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.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author Plopman + */ +public class HighMarket extends CardImpl { + + public HighMarket(UUID ownerId) { + super(ownerId, 320, "High Market", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "MMQ"; + + // {tap}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + // {tap}, Sacrifice a creature: You gain 1 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.addAbility(ability); + } + + public HighMarket(final HighMarket card) { + super(card); + } + + @Override + public HighMarket copy() { + return new HighMarket(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/ParallaxTide.java b/Mage.Sets/src/mage/sets/nemesis/ParallaxTide.java new file mode 100644 index 0000000000..902ad75d58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/ParallaxTide.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.sets.nemesis; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.ExileTargetForSourceEffect; +import mage.abilities.effects.common.ReturnFromExileForSourceEffect; +import mage.abilities.keyword.FadingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author Plopman + */ +public class ParallaxTide extends CardImpl { + + public ParallaxTide(UUID ownerId) { + super(ownerId, 37, "Parallax Tide", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); + this.expansionSetCode = "NMS"; + + this.color.setBlue(true); + + // Fading 5 + this.addAbility(new FadingAbility(5, this)); + // Remove a fade counter from Parallax Tide: Exile target land. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Parallax Tide Exile"), new RemoveCountersSourceCost(CounterType.FADE.createInstance())); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + // When Parallax Tide leaves the battlefield, each player returns to the battlefield all cards he or she owns exiled with Parallax Tide. + this.addAbility(new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), splitCard)); + } + + public ParallaxTide(final ParallaxTide card) { + super(card); + } + + @Override + public ParallaxTide copy() { + return new ParallaxTide(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/SkyshroudClaim.java b/Mage.Sets/src/mage/sets/nemesis/SkyshroudClaim.java new file mode 100644 index 0000000000..641e632837 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/SkyshroudClaim.java @@ -0,0 +1,67 @@ +/* + * 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.nemesis; + +import java.util.UUID; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Plopman + */ +public class SkyshroudClaim extends CardImpl { + + private static final FilterLandCard filter = new FilterLandCard("Forest"); + static { + filter.add(new SubtypePredicate("Forest")); + } + public SkyshroudClaim(UUID ownerId) { + super(ownerId, 117, "Skyshroud Claim", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "NMS"; + + this.color.setGreen(true); + + // Search your library for up to two Forest cards and put them onto the battlefield. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, filter ), false)); + } + + public SkyshroudClaim(final SkyshroudClaim card) { + super(card); + } + + @Override + public SkyshroudClaim copy() { + return new SkyshroudClaim(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/FellwarStone.java b/Mage.Sets/src/mage/sets/ninthedition/FellwarStone.java new file mode 100644 index 0000000000..3230cd5990 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/FellwarStone.java @@ -0,0 +1,153 @@ +/* + * 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.ninthedition; + +import java.util.List; +import java.util.UUID; +import mage.Mana; +import mage.abilities.Abilities; +import mage.abilities.Ability; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.ManaAbility; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author Plopman + */ +public class FellwarStone extends CardImpl { + + public FellwarStone(UUID ownerId) { + super(ownerId, 297, "Fellwar Stone", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "9ED"; + + // {tap}: Add to your mana pool one mana of any color that a land an opponent controls could produce. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new FellwarStoneEffect(), new TapSourceCost())); + } + + public FellwarStone(final FellwarStone card) { + super(card); + } + + @Override + public FellwarStone copy() { + return new FellwarStone(this); + } +} + +class FellwarStoneEffect extends ManaEffect { + + private static final FilterPermanent filter = new FilterLandPermanent(); + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public FellwarStoneEffect() { + super(); + staticText = "Add to your mana pool one mana of any color that a land an opponent controls could produce"; + } + + public FellwarStoneEffect(final FellwarStoneEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + List lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); + Mana types = new Mana(); + for (Permanent land : lands) { + Abilities mana = land.getAbilities().getManaAbilities(Zone.BATTLEFIELD); + for (ManaAbility ability : mana) { + types.add(ability.getNetMana(game)); + } + } + Choice choice = new ChoiceImpl(true); + choice.setMessage("Pick a mana color"); + if (types.getBlack() > 0) { + choice.getChoices().add("Black"); + } + if (types.getRed() > 0) { + choice.getChoices().add("Red"); + } + if (types.getBlue() > 0) { + choice.getChoices().add("Blue"); + } + if (types.getGreen() > 0) { + choice.getChoices().add("Green"); + } + if (types.getWhite() > 0) { + choice.getChoices().add("White"); + } + if (types.getAny() > 0) { + choice.getChoices().add("Black"); + choice.getChoices().add("Red"); + choice.getChoices().add("Blue"); + choice.getChoices().add("Green"); + choice.getChoices().add("White"); + } + if (choice.getChoices().size() > 0) { + Player player = game.getPlayer(source.getControllerId()); + if (choice.getChoices().size() == 1) { + choice.setChoice(choice.getChoices().iterator().next()); + } else { + player.choose(outcome, choice, game); + } + if (choice.getChoice().equals("Black")) { + player.getManaPool().addMana(Mana.BlackMana, game, source); + } else if (choice.getChoice().equals("Blue")) { + player.getManaPool().addMana(Mana.BlueMana, game, source); + } else if (choice.getChoice().equals("Red")) { + player.getManaPool().addMana(Mana.RedMana, game, source); + } else if (choice.getChoice().equals("Green")) { + player.getManaPool().addMana(Mana.GreenMana, game, source); + } else if (choice.getChoice().equals("White")) { + player.getManaPool().addMana(Mana.WhiteMana, game, source); + } + } + return true; + } + + @Override + public FellwarStoneEffect copy() { + return new FellwarStoneEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/portal/Devastation.java b/Mage.Sets/src/mage/sets/portal/Devastation.java new file mode 100644 index 0000000000..2058f9eaae --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Devastation.java @@ -0,0 +1,68 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author Plopman + */ +public class Devastation extends CardImpl { + + + private static final FilterPermanent filter = new FilterPermanent("creatures and lands"); + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); + } + public Devastation(UUID ownerId) { + super(ownerId, 128, "Devastation", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); + this.expansionSetCode = "POR"; + + this.color.setRed(true); + + // Destroy all creatures and lands. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public Devastation(final Devastation card) { + super(card); + } + + @Override + public Devastation copy() { + return new Devastation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/PersonalTutor.java b/Mage.Sets/src/mage/sets/portal/PersonalTutor.java new file mode 100644 index 0000000000..4a4683c713 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/PersonalTutor.java @@ -0,0 +1,67 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Plopman + */ +public class PersonalTutor extends CardImpl { + private static final FilterCard filter = new FilterCard("Sorcery card"); + static{ + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public PersonalTutor(UUID ownerId) { + super(ownerId, 65, "Personal Tutor", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "POR"; + + this.color.setBlue(true); + + // Search your library for a sorcery card and reveal that card. Shuffle your library, then put the card on top of it. + this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true)); + } + + public PersonalTutor(final PersonalTutor card) { + super(card); + } + + @Override + public PersonalTutor copy() { + return new PersonalTutor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/TemporalManipulation.java b/Mage.Sets/src/mage/sets/portalsecondage/TemporalManipulation.java new file mode 100644 index 0000000000..375b71c631 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/TemporalManipulation.java @@ -0,0 +1,59 @@ +/* + * 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.portalsecondage; + +import java.util.UUID; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author Plopman + */ +public class TemporalManipulation extends CardImpl { + + public TemporalManipulation(UUID ownerId) { + super(ownerId, 54, "Temporal Manipulation", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); + this.expansionSetCode = "PO2"; + + this.color.setBlue(true); + // Take an extra turn after this one. + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect()); + } + + public TemporalManipulation(final TemporalManipulation card) { + super(card); + } + + @Override + public TemporalManipulation copy() { + return new TemporalManipulation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/BurningOfXinye.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/BurningOfXinye.java new file mode 100644 index 0000000000..f189cf192e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/BurningOfXinye.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.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author Plopman + */ +public class BurningOfXinye extends CardImpl { + + public BurningOfXinye(UUID ownerId) { + super(ownerId, 104, "Burning of Xinye", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{R}{R}"); + this.expansionSetCode = "PTK"; + + this.color.setRed(true); + + // You destroy four lands you control, then target opponent destroys four lands he or she controls. Then Burning of Xinye deals 4 damage to each creature. + this.getSpellAbility().addTarget(new TargetOpponent()); + this.getSpellAbility().addEffect(new BurningOfXinyeEffect()); + this.getSpellAbility().addEffect(new DamageAllEffect(4, new FilterCreaturePermanent())); + } + + public BurningOfXinye(final BurningOfXinye card) { + super(card); + } + + @Override + public BurningOfXinye copy() { + return new BurningOfXinye(this); + } +} + + +class BurningOfXinyeEffect extends OneShotEffect{ + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent(); + + public BurningOfXinyeEffect() { + super(Outcome.DestroyPermanent); + staticText = "You destroy four lands you control, then target opponent destroys four lands he or she controls"; + } + + public BurningOfXinyeEffect ( BurningOfXinyeEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean abilityApplied = false; + + Player controller = game.getPlayer(source.getControllerId()); + + if (controller != null) { + abilityApplied |= playerDestroys(game, source, controller); + } + + Player opponent = game.getPlayer(source.getFirstTarget()); + + if (controller != null) { + abilityApplied |= playerDestroys(game, source, opponent); + } + return abilityApplied; + } + + public boolean playerDestroys(Game game, Ability source,Player player){ + boolean abilityApplied = false; + + int realCount = game.getBattlefield().countAll(filter, player.getId(), game); + int amount = Math.min(4, realCount); + + Target target = new TargetControlledPermanent(amount, amount, filter, true); + target.setRequired(true); + if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) { + while (!target.isChosen() && target.canChoose(player.getId(), game) && player.isInGame()) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + } + + for ( int idx = 0; idx < target.getTargets().size(); idx++) { + Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx)); + + if ( permanent != null ) { + abilityApplied |= permanent.destroy(source.getSourceId(), game, false); + } + } + } + return abilityApplied; + } + + @Override + public BurningOfXinyeEffect copy() { + return new BurningOfXinyeEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/CaptureOfJingzhou.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/CaptureOfJingzhou.java new file mode 100644 index 0000000000..e9f2839c6f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/CaptureOfJingzhou.java @@ -0,0 +1,60 @@ +/* + * 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.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author Plopman + */ +public class CaptureOfJingzhou extends CardImpl { + + public CaptureOfJingzhou(UUID ownerId) { + super(ownerId, 38, "Capture of Jingzhou", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); + this.expansionSetCode = "PTK"; + + this.color.setBlue(true); + + // Take an extra turn after this one. + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect()); + } + + public CaptureOfJingzhou(final CaptureOfJingzhou card) { + super(card); + } + + @Override + public CaptureOfJingzhou copy() { + return new CaptureOfJingzhou(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ThreeVisits.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ThreeVisits.java new file mode 100644 index 0000000000..a44356de41 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ThreeVisits.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.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Plopman + */ +public class ThreeVisits extends CardImpl { + + private static final FilterLandCard filter = new FilterLandCard("Forest"); + static { + filter.add(new SubtypePredicate("Forest")); + } + + public ThreeVisits(UUID ownerId) { + super(ownerId, 153, "Three Visits", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "PTK"; + + this.color.setGreen(true); + + // Search your library for a Forest card and put that card onto the battlefield. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter))); + + } + + public ThreeVisits(final ThreeVisits card) { + super(card); + } + + @Override + public ThreeVisits copy() { + return new ThreeVisits(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/CompulsiveResearch.java b/Mage.Sets/src/mage/sets/ravnika/CompulsiveResearch.java new file mode 100644 index 0000000000..bad9ca4940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/CompulsiveResearch.java @@ -0,0 +1,104 @@ +/* + * 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.ravnika; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetDiscard; + +/** + * + * @author Plopman + */ +public class CompulsiveResearch extends CardImpl { + + public CompulsiveResearch(UUID ownerId) { + super(ownerId, 40, "Compulsive Research", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "RAV"; + + this.color.setBlue(true); + + // Target player draws three cards. Then that player discards two cards unless he or she discards a land card. + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new DrawCardTargetEffect(3)); + this.getSpellAbility().addEffect(new CompulsiveResearchDiscardEffect()); + } + + public CompulsiveResearch(final CompulsiveResearch card) { + super(card); + } + + @Override + public CompulsiveResearch copy() { + return new CompulsiveResearch(this); + } +} +class CompulsiveResearchDiscardEffect extends OneShotEffect { + + public CompulsiveResearchDiscardEffect() { + super(Outcome.Discard); + this.staticText = "Then that player discards two cards unless he or she discards a land card"; + } + + public CompulsiveResearchDiscardEffect(final CompulsiveResearchDiscardEffect effect) { + super(effect); + } + + @Override + public CompulsiveResearchDiscardEffect copy() { + return new CompulsiveResearchDiscardEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source)); + if (targetPlayer != null && !targetPlayer.getHand().isEmpty()) { + TargetDiscard target = new TargetDiscard(targetPlayer.getId()); + targetPlayer.choose(Outcome.Discard, target, source.getSourceId(), game); + Card card = targetPlayer.getHand().get(target.getFirstTarget(), game); + if (card != null) { + targetPlayer.discard(card, source, game); + if (!card.getCardType().contains(CardType.LAND) && !targetPlayer.getHand().isEmpty()) { + targetPlayer.discard(1, source, game); + } + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/FellwarStone.java b/Mage.Sets/src/mage/sets/thedark/FellwarStone.java new file mode 100644 index 0000000000..6aca0cea9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/FellwarStone.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.thedark; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class FellwarStone extends mage.sets.ninthedition.FellwarStone { + + public FellwarStone(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "DRK"; + } + + public FellwarStone(final FellwarStone card) { + super(card); + } + + @Override + public FellwarStone copy() { + return new FellwarStone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/PrismaticLens.java b/Mage.Sets/src/mage/sets/timespiral/PrismaticLens.java new file mode 100644 index 0000000000..69d276bf33 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/PrismaticLens.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.timespiral; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.mana.AnyColorManaAbility; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author Plopman + */ +public class PrismaticLens extends CardImpl { + + public PrismaticLens(UUID ownerId) { + super(ownerId, 262, "Prismatic Lens", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "TSP"; + + // {tap}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + // {1}, {tap}: Add one mana of any color to your mana pool. + Ability ability = new AnyColorManaAbility(new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public PrismaticLens(final PrismaticLens card) { + super(card); + } + + @Override + public PrismaticLens copy() { + return new PrismaticLens(this); + } +}