diff --git a/Mage.Sets/src/mage/sets/darksteel/ArcboundReclaimer.java b/Mage.Sets/src/mage/sets/darksteel/ArcboundReclaimer.java new file mode 100644 index 0000000000..d51c547fb3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/ArcboundReclaimer.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.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.keyword.ModularAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterArtifactCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class ArcboundReclaimer extends CardImpl { + + public ArcboundReclaimer(UUID ownerId) { + super(ownerId, 101, "Arcbound Reclaimer", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "DST"; + this.subtype.add("Golem"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Remove a +1/+1 counter from Arcbound Reclaimer: Put target artifact card from your graveyard on top of your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true),new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard"))); + this.addAbility(ability); + + // Modular 2 + this.addAbility(new ModularAbility(this, 2)); + } + + public ArcboundReclaimer(final ArcboundReclaimer card) { + super(card); + } + + @Override + public ArcboundReclaimer copy() { + return new ArcboundReclaimer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eighthedition/Sanctimony.java b/Mage.Sets/src/mage/sets/eighthedition/Sanctimony.java new file mode 100644 index 0000000000..44404e63bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/eighthedition/Sanctimony.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.eighthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Sanctimony extends mage.sets.seventhedition.Sanctimony { + + public Sanctimony(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "8ED"; + } + + public Sanctimony(final Sanctimony card) { + super(card); + } + + @Override + public Sanctimony copy() { + return new Sanctimony(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/Delay.java b/Mage.Sets/src/mage/sets/futuresight/Delay.java new file mode 100644 index 0000000000..0f6974bcc3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/Delay.java @@ -0,0 +1,132 @@ +/* + * 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.futuresight; + +import java.util.UUID; +import mage.abilities.Abilities; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class Delay extends CardImpl { + + public Delay(UUID ownerId) { + super(ownerId, 35, "Delay", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "FUT"; + + this.color.setBlue(true); + + // Counter target spell. If the spell is countered this way, exile it with three time counters on it instead of putting it into its owner's graveyard. If it doesn't have suspend, it gains suspend. + this.getSpellAbility().addEffect(new DelayEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public Delay(final Delay card) { + super(card); + } + + @Override + public Delay copy() { + return new Delay(this); + } +} + +class DelayEffect extends OneShotEffect { + + public DelayEffect() { + super(Outcome.Benefit); + this.staticText = "Counter target spell. If the spell is countered this way, exile it with three time counters on it instead of putting it into its owner's graveyard. If it doesn't have suspend, it gains suspend"; + } + + public DelayEffect(final DelayEffect effect) { + super(effect); + } + + @Override + public DelayEffect copy() { + return new DelayEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); + if (controller != null && spell != null) { + Effect effect = new CounterTargetWithReplacementEffect(Zone.EXILED); + effect.setTargetPointer(targetPointer); + Card card = game.getCard(spell.getSourceId()); + if (card != null && effect.apply(game, source) && Zone.EXILED.equals(game.getState().getZone(card.getId()))) { + boolean hasSuspend = false; + for (Ability ability :card.getAbilities()) { + if (ability instanceof SuspendAbility) { + hasSuspend = true; + break; + } + } + card.addCounters(CounterType.TIME.createInstance(3), game); + if (!hasSuspend) { + // add suspend ability + // TODO: Find a better solution for giving suspend to a card. + // If the exiled card leaves exile by another way, the abilites won't be removed from the card + Abilities oldAbilities = card.getAbilities().copy(); + SuspendAbility suspendAbility = new SuspendAbility(3, null, card); + card.addAbility(suspendAbility); + + for (Ability ability :card.getAbilities()) { + if (!oldAbilities.contains(ability)) { + ability.setControllerId(source.getControllerId()); + game.getState().addAbility(ability, card.getId(), card); + } + } + + } + game.informPlayers(new StringBuilder(controller.getName()).append(" suspends (").append(3).append(") ").append(card.getName()).toString()); + + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/EyesOfTheWisent.java b/Mage.Sets/src/mage/sets/lorwyn/EyesOfTheWisent.java new file mode 100644 index 0000000000..6a6e575307 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/EyesOfTheWisent.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.permanent.token.Token; + +/** + * + * @author LevelX2 + */ +public class EyesOfTheWisent extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a blue spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public EyesOfTheWisent(UUID ownerId) { + super(ownerId, 210, "Eyes of the Wisent", Rarity.RARE, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elemental"); + + this.color.setGreen(true); + + // Whenever an opponent casts a blue spell during your turn, you may put a 4/4 green Elemental creature token onto the battlefield. + this.addAbility(new SpellCastOpponentTriggeredAbility(new CreateTokenEffect(new EyesOfTheWisentElementalToken()), filter, true)); + } + + public EyesOfTheWisent(final EyesOfTheWisent card) { + super(card); + } + + @Override + public EyesOfTheWisent copy() { + return new EyesOfTheWisent(this); + } +} + +class EyesOfTheWisentElementalToken extends Token { + + public EyesOfTheWisentElementalToken() { + super("Elemental", "4/4 green Elemental creature token"); + this.setOriginalExpansionSetCode("MMA"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Elemental"); + power = new MageInt(4); + toughness = new MageInt(4); + + + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/seventhedition/Sanctimony.java b/Mage.Sets/src/mage/sets/seventhedition/Sanctimony.java new file mode 100644 index 0000000000..a413f2e783 --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/Sanctimony.java @@ -0,0 +1,73 @@ +/* + * 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.seventhedition; + +import java.util.UUID; +import mage.abilities.common.TapForManaAllTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LevelX2 + */ +public class Sanctimony extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("an opponent taps a Mountain"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + filter.add(new SubtypePredicate("Mountain")); + } + + public Sanctimony(UUID ownerId) { + super(ownerId, 39, "Sanctimony", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "7ED"; + + this.color.setWhite(true); + + // Whenever an opponent taps a Mountain for mana, you may gain 1 life. + this.addAbility(new TapForManaAllTriggeredAbility(new GainLifeEffect(1), filter, SetTargetPointer.NONE)); + } + + public Sanctimony(final Sanctimony card) { + super(card); + } + + @Override + public Sanctimony copy() { + return new Sanctimony(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WheelOfSunAndMoon.java b/Mage.Sets/src/mage/sets/shadowmoor/WheelOfSunAndMoon.java new file mode 100644 index 0000000000..2a72c839f4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/WheelOfSunAndMoon.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author LevelX2 + */ +public class WheelOfSunAndMoon extends CardImpl { + + public WheelOfSunAndMoon(UUID ownerId) { + super(ownerId, 243, "Wheel of Sun and Moon", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G/W}{G/W}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Aura"); + + this.color.setGreen(true); + this.color.setWhite(true); + + // Enchant player + TargetPlayer auraTarget = new TargetPlayer(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + + // If a card would be put into enchanted player's graveyard from anywhere, instead that card is revealed and put on the bottom of that player's library. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WheelOfSunAndMoonEffect())); + } + + public WheelOfSunAndMoon(final WheelOfSunAndMoon card) { + super(card); + } + + @Override + public WheelOfSunAndMoon copy() { + return new WheelOfSunAndMoon(this); + } +} + +class WheelOfSunAndMoonEffect extends ReplacementEffectImpl { + + public WheelOfSunAndMoonEffect() { + super(Duration.WhileOnBattlefield, Outcome.Damage); + staticText = "If a card would be put into enchanted player's graveyard from anywhere, instead that card is revealed and put on the bottom of that player's library"; + } + + public WheelOfSunAndMoonEffect(final WheelOfSunAndMoonEffect effect) { + super(effect); + } + + @Override + public WheelOfSunAndMoonEffect copy() { + return new WheelOfSunAndMoonEffect(this); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (EventType.ZONE_CHANGE.equals(event.getType())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getToZone().equals(Zone.GRAVEYARD)) { + Card card = game.getCard(event.getTargetId()); + if (card != null) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null && + card.getOwnerId().equals(enchantment.getAttachedTo())) { + return true; + } + } + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + Card card = game.getCard(event.getTargetId()); + if (card != null) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Cards cards = new CardsImpl(card); + controller.revealCards(sourceObject.getLogName(), cards, game); + controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, zEvent.getFromZone(), false, true); + return true; + } + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java b/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java new file mode 100644 index 0000000000..fec94eac07 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java @@ -0,0 +1,234 @@ +/* + * 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.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ChooseColorEffect; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.TriggeredManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ManaEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class GauntletOfPower extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("a basic land"); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public GauntletOfPower(UUID ownerId) { + super(ownerId, 255, "Gauntlet of Power", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "TSP"; + + // As Gauntlet of Power enters the battlefield, choose a color. + this.addAbility(new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral))); + // Creatures of the chosen color get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GauntletOfPowerEffect1())); + + // Whenever a basic land is tapped for mana of the chosen color, its controller adds one mana of that color to his or her mana pool. + this.addAbility(new TapForManaAllTriggeredAbility(new GauntletOfPowerEffectEffect2(), filter, SetTargetPointer.PERMANENT)); + } + + public GauntletOfPower(final GauntletOfPower card) { + super(card); + } + + @Override + public GauntletOfPower copy() { + return new GauntletOfPower(this); + } +} + +class GauntletOfPowerEffect1 extends ContinuousEffectImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public GauntletOfPowerEffect1() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + staticText = "Creatures of the chosen color get +1/+1"; + } + + public GauntletOfPowerEffect1(final GauntletOfPowerEffect1 effect) { + super(effect); + } + + @Override + public GauntletOfPowerEffect1 copy() { + return new GauntletOfPowerEffect1(this); + } + + @Override + public boolean apply(Game game, Ability source) { + ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); + if (color != null) { + for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (perm.getColor().contains(color)) { + perm.addPower(1); + perm.addToughness(1); + } + } + } + return true; + } + +} + +class TapForManaAllTriggeredAbility extends TriggeredManaAbility { + + private final FilterPermanent filter; + private final SetTargetPointer setTargetPointer; + + public TapForManaAllTriggeredAbility(ManaEffect effect, FilterPermanent filter, SetTargetPointer setTargetPointer) { + super(Zone.BATTLEFIELD, effect, false); + this.filter = filter; + this.setTargetPointer = setTargetPointer; + } + + public TapForManaAllTriggeredAbility(TapForManaAllTriggeredAbility ability) { + super(ability); + this.filter = ability.filter.copy(); + this.setTargetPointer = ability.setTargetPointer; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); + if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) { + ManaEvent mEvent = (ManaEvent) event; + ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color"); + if (color != null) { + Mana mana = mEvent.getMana(); + boolean colorFits = false; + if (color.isBlack() && mana.getBlack() > 0) { + colorFits = true; + } else if (color.isBlue() && mana.getBlue() > 0) { + colorFits = true; + } else if (color.isGreen() && mana.getGreen() > 0) { + colorFits = true; + } else if (color.isWhite() && mana.getWhite() > 0) { + colorFits = true; + } else if (color.isRed() && mana.getRed() > 0) { + colorFits = true; + } + if (colorFits) { + + for (Effect effect : getEffects()) { + effect.setValue("mana", mEvent.getMana()); + } + switch (setTargetPointer) { + case PERMANENT: + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + break; + case PLAYER: + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); + break; + } + return true; + } + } + } + } + return false; + } + + @Override + public TapForManaAllTriggeredAbility copy() { + return new TapForManaAllTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever " + filter.getMessage() + " for mana, " + super.getRule(); + } +} + +class GauntletOfPowerEffectEffect2 extends ManaEffect { + + public GauntletOfPowerEffectEffect2() { + super(); + staticText = "its controller adds one mana of that color to his or her mana pool"; + } + + public GauntletOfPowerEffectEffect2(final GauntletOfPowerEffectEffect2 effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + if(land != null){ + Player player = game.getPlayer(land.getControllerId()); + Mana mana = (Mana) getValue("mana"); + if (player != null && mana != null) { + player.getManaPool().addMana(mana, game, source); + return true; + } + } + return false; + } + + @Override + public Mana getMana(Game game, Ability source) { + return null; + } + + @Override + public GauntletOfPowerEffectEffect2 copy() { + return new GauntletOfPowerEffectEffect2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Sanctimony.java b/Mage.Sets/src/mage/sets/urzasdestiny/Sanctimony.java new file mode 100644 index 0000000000..94f9888e8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Sanctimony.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.urzasdestiny; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Sanctimony extends mage.sets.seventhedition.Sanctimony { + + public Sanctimony(UUID ownerId) { + super(ownerId); + this.cardNumber = 16; + this.expansionSetCode = "UDS"; + } + + public Sanctimony(final Sanctimony card) { + super(card); + } + + @Override + public Sanctimony copy() { + return new Sanctimony(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Scald.java b/Mage.Sets/src/mage/sets/urzassaga/Scald.java new file mode 100644 index 0000000000..eafb6077c4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Scald.java @@ -0,0 +1,73 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.abilities.common.TapForManaAllTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LevelX2 + */ +public class Scald extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a player taps an Island"); + + static { + filter.add(new SubtypePredicate("Island")); + } + + public Scald(UUID ownerId) { + super(ownerId, 211, "Scald", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "USG"; + + this.color.setRed(true); + + // Whenever a player taps an Island for mana, Scald deals 1 damage to that player. + this.addAbility(new TapForManaAllTriggeredAbility( + new DamageTargetEffect(1, true, "that player"), + filter, + SetTargetPointer.PLAYER)); + } + + public Scald(final Scald card) { + super(card); + } + + @Override + public Scald copy() { + return new Scald(this); + } +}