From 3bd10a2b2b06b59bff8e4d9b7944d8abaafee82f Mon Sep 17 00:00:00 2001 From: Styxo Date: Sat, 28 May 2016 12:26:49 +0200 Subject: [PATCH] Added Faerie Tautings, Heat Shimmer and Spring Cleaning --- .../src/mage/sets/lorwyn/FaerieTautings.java | 96 ++++++++++++++++ .../src/mage/sets/lorwyn/HeatShimmer.java | 106 ++++++++++++++++++ .../src/mage/sets/lorwyn/SpringCleaning.java | 74 ++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/FaerieTautings.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/HeatShimmer.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/SpringCleaning.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/FaerieTautings.java b/Mage.Sets/src/mage/sets/lorwyn/FaerieTautings.java new file mode 100644 index 0000000000..c2552b775f --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/FaerieTautings.java @@ -0,0 +1,96 @@ +/* + * 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.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author Styxo + */ +public class FaerieTautings extends CardImpl { + + public FaerieTautings(UUID ownerId) { + super(ownerId, 112, "Faerie Tautings", Rarity.UNCOMMON, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Faerie"); + + // Whenever you cast a spell during an opponent's turn, you may have each opponent lose 1 life + this.addAbility(new FaerieTautingsTriggeredAbility()); + + } + + public FaerieTautings(final FaerieTautings card) { + super(card); + } + + @Override + public FaerieTautings copy() { + return new FaerieTautings(this); + } +} + +class FaerieTautingsTriggeredAbility extends TriggeredAbilityImpl { + + FaerieTautingsTriggeredAbility() { + super(Zone.BATTLEFIELD, new LoseLifeOpponentsEffect(1), true); + } + + FaerieTautingsTriggeredAbility(final FaerieTautingsTriggeredAbility ability) { + super(ability); + } + + @Override + public FaerieTautingsTriggeredAbility copy() { + return new FaerieTautingsTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.controllerId) + && game.getOpponents(this.controllerId).contains(game.getActivePlayerId()); + } + + @Override + public String getRule() { + return "Whenever you cast a spell during an opponent's turn, " + super.getRule(); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/HeatShimmer.java b/Mage.Sets/src/mage/sets/lorwyn/HeatShimmer.java new file mode 100644 index 0000000000..f1d53d2ffd --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/HeatShimmer.java @@ -0,0 +1,106 @@ +/* + * 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.abilities.Ability; +import mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author Styxo + */ +public class HeatShimmer extends CardImpl { + + public HeatShimmer(UUID ownerId) { + super(ownerId, 175, "Heat Shimmer", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}"); + this.expansionSetCode = "LRW"; + + // Put a token that's a copy of target creature onto the battlefield. That token has haste and "At the beginning of the end step, exile this permanent." + this.getSpellAbility().addEffect(new HeatShimmerEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public HeatShimmer(final HeatShimmer card) { + super(card); + } + + @Override + public HeatShimmer copy() { + return new HeatShimmer(this); + } +} + +class HeatShimmerEffect extends OneShotEffect { + + public HeatShimmerEffect() { + super(Outcome.Copy); + this.staticText = "Put a token that's a copy of target creature onto the battlefield. That token has haste and \"At the beginning of the end step, exile this permanent.\""; + } + + public HeatShimmerEffect(final HeatShimmerEffect effect) { + super(effect); + } + + @Override + public HeatShimmerEffect copy() { + return new HeatShimmerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + if (controller != null && permanent != null) { + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + Effect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfTurnStepPostDelayedTriggeredAbility(exileEffect), false).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/SpringCleaning.java b/Mage.Sets/src/mage/sets/lorwyn/SpringCleaning.java new file mode 100644 index 0000000000..cc6eb77030 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/SpringCleaning.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.lorwyn; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DoIfClashWonEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author Styxo + */ +public class SpringCleaning extends CardImpl { + + private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("enchantments your opponents control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + } + + public SpringCleaning(UUID ownerId) { + super(ownerId, 236, "Spring Cleaning", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "LRW"; + + // Destroy target enchantment. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetEnchantmentPermanent()); + + // Clash with an opponent. If you win, destroy all enchantments your opponents control. + this.getSpellAbility().addEffect(new DoIfClashWonEffect(new DestroyAllEffect(filter))); + } + + public SpringCleaning(final SpringCleaning card) { + super(card); + } + + @Override + public SpringCleaning copy() { + return new SpringCleaning(this); + } +}