From dbdcf7e924a85b3255cefcdd93376160441144d3 Mon Sep 17 00:00:00 2001 From: Loki Date: Sat, 15 Oct 2011 10:48:17 +0300 Subject: [PATCH] cards --- .../src/mage/sets/conflux/EmberWeaver.java | 91 ++++++++++++++++ .../src/mage/sets/conflux/MatcaRioters.java | 69 ++++++++++++ .../sets/ravnika/ClutchOfTheUndercity.java | 102 ++++++++++++++++++ .../mage/sets/ravnika/DimirHouseGuard.java | 74 +++++++++++++ .../mage/sets/ravnika/DimirInfiltrator.java | 68 ++++++++++++ .../src/mage/sets/ravnika/DizzySpell.java | 67 ++++++++++++ .../mage/sets/ravnika/DriftOfPhantasms.java | 68 ++++++++++++ .../src/mage/sets/ravnika/FiremaneAngel.java | 6 +- .../mage/sets/ravnika/MuddleTheMixture.java | 75 +++++++++++++ .../abilities/keyword/TransmuteAbility.java | 89 +++++++++++++++ 10 files changed, 708 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/conflux/EmberWeaver.java create mode 100644 Mage.Sets/src/mage/sets/conflux/MatcaRioters.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/ClutchOfTheUndercity.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/DimirHouseGuard.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/DimirInfiltrator.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/DizzySpell.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/DriftOfPhantasms.java create mode 100644 Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java create mode 100644 Mage/src/mage/abilities/keyword/TransmuteAbility.java diff --git a/Mage.Sets/src/mage/sets/conflux/EmberWeaver.java b/Mage.Sets/src/mage/sets/conflux/EmberWeaver.java new file mode 100644 index 00000000000..fac732b158c --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/EmberWeaver.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conflux; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.ControlsPermanentCondition; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; + +/** + * @author Loki + */ +public class EmberWeaver extends CardImpl { + private static final FilterPermanent redPermanentFilter = new FilterPermanent("red"); + + static { + redPermanentFilter.setUseColor(true); + redPermanentFilter.getColor().setRed(true); + } + + public EmberWeaver(UUID ownerId) { + super(ownerId, 81, "Ember Weaver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "CON"; + this.subtype.add("Spider"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + this.addAbility(ReachAbility.getInstance()); + // As long as you control a red permanent, Ember Weaver gets +1/+0 and has first strike. + this.addAbility( + new SimpleStaticAbility( + Constants.Zone.BATTLEFIELD, + new ConditionalContinousEffect( + new BoostSourceEffect(1, 0, Constants.Duration.WhileOnBattlefield), + new ControlsPermanentCondition(redPermanentFilter), "{this} gets +1/+0 as long as you control a red permanent"))); + this.addAbility( + new SimpleStaticAbility( + Constants.Zone.BATTLEFIELD, + new ConditionalContinousEffect( + new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Constants.Duration.WhileOnBattlefield), + new ControlsPermanentCondition(redPermanentFilter), "{this} has first strike as long as you control a red permanent"))); + + } + + public EmberWeaver(final EmberWeaver card) { + super(card); + } + + @Override + public EmberWeaver copy() { + return new EmberWeaver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conflux/MatcaRioters.java b/Mage.Sets/src/mage/sets/conflux/MatcaRioters.java new file mode 100644 index 00000000000..30579e5d7b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conflux/MatcaRioters.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.conflux; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.DomainValue; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.cards.CardImpl; + +/** + * + * @author Loki + */ +public class MatcaRioters extends CardImpl { + + public MatcaRioters(UUID ownerId) { + super(ownerId, 84, "Matca Rioters", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "CON"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Domain - Matca Rioters's power and toughness are each equal to the number of basic land types among lands you control. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(new DomainValue(), new DomainValue(), Constants.Duration.EndOfGame))); + } + + public MatcaRioters(final MatcaRioters card) { + super(card); + } + + @Override + public MatcaRioters copy() { + return new MatcaRioters(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/ClutchOfTheUndercity.java b/Mage.Sets/src/mage/sets/ravnika/ClutchOfTheUndercity.java new file mode 100644 index 00000000000..ae4fac050a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/ClutchOfTheUndercity.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnika; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * @author Loki + */ +public class ClutchOfTheUndercity extends CardImpl { + + public ClutchOfTheUndercity(UUID ownerId) { + super(ownerId, 197, "Clutch of the Undercity", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}{B}"); + this.expansionSetCode = "RAV"; + + this.color.setBlue(true); + this.color.setBlack(true); + + // Return target permanent to its owner's hand. Its controller loses 3 life. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addEffect(new ClutchOfTheUndercityEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Transmute {1}{U}{B} + this.addAbility(new TransmuteAbility("{1}{U}{B}")); + } + + public ClutchOfTheUndercity(final ClutchOfTheUndercity card) { + super(card); + } + + @Override + public ClutchOfTheUndercity copy() { + return new ClutchOfTheUndercity(this); + } +} + +class ClutchOfTheUndercityEffect extends OneShotEffect { + ClutchOfTheUndercityEffect() { + super(Constants.Outcome.Damage); + staticText = "Its controller loses 3 life"; + } + + ClutchOfTheUndercityEffect(final ClutchOfTheUndercityEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent p = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(source), Constants.Zone.BATTLEFIELD); + if (p != null) { + Player player = game.getPlayer(p.getControllerId()); + if (player != null) { + player.loseLife(3, game); + return true; + } + } + return false; + } + + @Override + public ClutchOfTheUndercityEffect copy() { + return new ClutchOfTheUndercityEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/DimirHouseGuard.java b/Mage.Sets/src/mage/sets/ravnika/DimirHouseGuard.java new file mode 100644 index 00000000000..96b5213e01d --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/DimirHouseGuard.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnika; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FearAbility; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.CardImpl; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author Loki + */ +public class DimirHouseGuard extends CardImpl { + + public DimirHouseGuard(UUID ownerId) { + super(ownerId, 83, "Dimir House Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Skeleton"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + this.addAbility(FearAbility.getInstance()); + // Sacrifice a creature: Regenerate Dimir House Guard. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + // Transmute {1}{B}{B} + this.addAbility(new TransmuteAbility("{1}{B}{B}")); + } + + public DimirHouseGuard(final DimirHouseGuard card) { + super(card); + } + + @Override + public DimirHouseGuard copy() { + return new DimirHouseGuard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/DimirInfiltrator.java b/Mage.Sets/src/mage/sets/ravnika/DimirInfiltrator.java new file mode 100644 index 00000000000..4a353f7fd75 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/DimirInfiltrator.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.ravnika; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.TransmuteAbility; +import mage.abilities.keyword.UnblockableAbility; +import mage.cards.CardImpl; + +/** + * + * @author Loki + */ +public class DimirInfiltrator extends CardImpl { + + public DimirInfiltrator(UUID ownerId) { + super(ownerId, 203, "Dimir Infiltrator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}{B}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Spirit"); + + this.color.setBlue(true); + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Dimir Infiltrator is unblockable. + this.addAbility(UnblockableAbility.getInstance()); + // Transmute {1}{U}{B} + this.addAbility(new TransmuteAbility("{1}{U}{B}")); + } + + public DimirInfiltrator(final DimirInfiltrator card) { + super(card); + } + + @Override + public DimirInfiltrator copy() { + return new DimirInfiltrator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/DizzySpell.java b/Mage.Sets/src/mage/sets/ravnika/DizzySpell.java new file mode 100644 index 00000000000..efed10cea63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/DizzySpell.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.ravnika; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class DizzySpell extends CardImpl { + + public DizzySpell(UUID ownerId) { + super(ownerId, 43, "Dizzy Spell", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "RAV"; + + this.color.setBlue(true); + + // Target creature gets -3/-0 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(-3, 0, Constants.Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Transmute {1}{U}{U} + this.addAbility(new TransmuteAbility("{1}{U}{U}")); + } + + public DizzySpell(final DizzySpell card) { + super(card); + } + + @Override + public DizzySpell copy() { + return new DizzySpell(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/DriftOfPhantasms.java b/Mage.Sets/src/mage/sets/ravnika/DriftOfPhantasms.java new file mode 100644 index 00000000000..1cb004e6b72 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/DriftOfPhantasms.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.ravnika; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.CardImpl; + +/** + * + * @author Loki + */ +public class DriftOfPhantasms extends CardImpl { + + public DriftOfPhantasms(UUID ownerId) { + super(ownerId, 46, "Drift of Phantasms", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Spirit"); + + this.color.setBlue(true); + this.power = new MageInt(0); + this.toughness = new MageInt(5); + + this.addAbility(DefenderAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); + // Transmute {1}{U}{U} + this.addAbility(new TransmuteAbility("{1}{U}{U}")); + } + + public DriftOfPhantasms(final DriftOfPhantasms card) { + super(card); + } + + @Override + public DriftOfPhantasms copy() { + return new DriftOfPhantasms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnika/FiremaneAngel.java b/Mage.Sets/src/mage/sets/ravnika/FiremaneAngel.java index 24a57364654..e2552e34210 100644 --- a/Mage.Sets/src/mage/sets/ravnika/FiremaneAngel.java +++ b/Mage.Sets/src/mage/sets/ravnika/FiremaneAngel.java @@ -33,8 +33,10 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.OnlyDuringUpkeepCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; @@ -64,7 +66,9 @@ public class FiremaneAngel extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(1), Constants.TargetController.YOU, true)); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Constants.Zone.GRAVEYARD, new GainLifeEffect(1), Constants.TargetController.YOU, true)); // {6}{R}{R}{W}{W}: Return Firemane Angel from your graveyard to the battlefield. Activate this ability only during your upkeep. - this.addAbility(new SimpleActivatedAbility(Constants.Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{6}{R}{R}{W}{W}"))); + Ability ability = new SimpleActivatedAbility(Constants.Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{6}{R}{R}{W}{W}")); + ability.addCost(new OnlyDuringUpkeepCost()); + this.addAbility(ability); } public FiremaneAngel(final FiremaneAngel card) { diff --git a/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java b/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java new file mode 100644 index 00000000000..97a075b2ebb --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.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.ravnika; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.CardImpl; +import mage.filter.Filter; +import mage.filter.FilterSpell; +import mage.target.TargetSpell; + +/** + * + * @author Loki + */ +public class MuddleTheMixture extends CardImpl { + private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); + + static { + filter.getCardType().add(CardType.INSTANT); + filter.getCardType().add(CardType.SORCERY); + filter.setNotScopeCardType(Filter.ComparisonScope.Any); + } + + public MuddleTheMixture(UUID ownerId) { + super(ownerId, 60, "Muddle the Mixture", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}"); + this.expansionSetCode = "RAV"; + + this.color.setBlue(true); + + // Counter target instant or sorcery spell. + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + // Transmute {1}{U}{U} + this.addAbility(new TransmuteAbility("{1}{U}{U}")); + } + + public MuddleTheMixture(final MuddleTheMixture card) { + super(card); + } + + @Override + public MuddleTheMixture copy() { + return new MuddleTheMixture(this); + } +} diff --git a/Mage/src/mage/abilities/keyword/TransmuteAbility.java b/Mage/src/mage/abilities/keyword/TransmuteAbility.java new file mode 100644 index 00000000000..6898c662e75 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/TransmuteAbility.java @@ -0,0 +1,89 @@ +package mage.abilities.keyword; + +import mage.Constants; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.DiscardSourceCost; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author Loki + */ +public class TransmuteAbility extends SimpleActivatedAbility { + public TransmuteAbility(String manaCost) { + super(Constants.Zone.HAND, new TransmuteEffect(), new ManaCostsImpl(manaCost)); + this.addCost(new DiscardSourceCost()); + } + + public TransmuteAbility(final TransmuteAbility ability) { + super(ability); + } + + @Override + public SimpleActivatedAbility copy() { + return new TransmuteAbility(this); + } + + @Override + public String getRule() { + return "Transmute " + this.getManaCosts().getText(); + } +} + +class TransmuteEffect extends OneShotEffect { + TransmuteEffect() { + super(Constants.Outcome.Benefit); + staticText = "Transmute"; + } + + TransmuteEffect(final TransmuteEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card sourceCard = game.getCard(source.getSourceId()); + + if (sourceCard != null && player != null) { + FilterCard filter = new FilterCard("card with converted mana cost " + sourceCard.getManaCost().convertedManaCost()); + filter.setConvertedManaCost(sourceCard.getManaCost().convertedManaCost()); + filter.setConvertedManaCostComparison(Filter.ComparisonType.Equal); + TargetCardInLibrary target = new TargetCardInLibrary(1, filter); + player.searchLibrary(target, game); + if (target.getTargets().size() > 0) { + Cards revealed = new CardsImpl(); + for (UUID cardId : target.getTargets()) { + Card card = player.getLibrary().remove(cardId, game); + if (card != null) { + card.moveToZone(Constants.Zone.HAND, source.getId(), game, false); + revealed.add(card); + } + } + player.shuffleLibrary(game); + player.revealCards("Search", revealed, game); + } + } + + + return true; + } + + @Override + public TransmuteEffect copy() { + return new TransmuteEffect(this); + } +}