From ece8248f11edbee2eeac8b5309287dd30ac83f96 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 25 Jul 2015 11:34:04 +0300 Subject: [PATCH] Implement cards: Destructive Flow, Radiant Kavu, and Warped Devotion --- .../sets/eighthedition/WarpedDevotion.java | 107 ++++++++++++++++++ .../mage/sets/planeshift/DestructiveFlow.java | 71 ++++++++++++ .../src/mage/sets/planeshift/RadiantKavu.java | 76 +++++++++++++ .../mage/sets/planeshift/WarpedDevotion.java | 54 +++++++++ 4 files changed, 308 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/eighthedition/WarpedDevotion.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/DestructiveFlow.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/RadiantKavu.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/WarpedDevotion.java diff --git a/Mage.Sets/src/mage/sets/eighthedition/WarpedDevotion.java b/Mage.Sets/src/mage/sets/eighthedition/WarpedDevotion.java new file mode 100644 index 00000000000..62f78c48d0f --- /dev/null +++ b/Mage.Sets/src/mage/sets/eighthedition/WarpedDevotion.java @@ -0,0 +1,107 @@ +/* + * 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; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.Card; +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; +import mage.game.events.ZoneChangeEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LoneFox + */ +public class WarpedDevotion extends CardImpl { + + public WarpedDevotion(UUID ownerId) { + super(ownerId, 172, "Warped Devotion", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "8ED"; + + // Whenever a permanent is returned to a player's hand, that player discards a card. + this.addAbility(new WarpedDevotionTriggeredAbility()); + } + + public WarpedDevotion(final WarpedDevotion card) { + super(card); + } + + @Override + public WarpedDevotion copy() { + return new WarpedDevotion(this); + } +} + +class WarpedDevotionTriggeredAbility extends TriggeredAbilityImpl { + + public WarpedDevotionTriggeredAbility() { + super(Zone.BATTLEFIELD, new DiscardTargetEffect(1), false); + } + + public WarpedDevotionTriggeredAbility(final WarpedDevotionTriggeredAbility ability) { + super(ability); + } + + public WarpedDevotionTriggeredAbility copy() { + return new WarpedDevotionTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ZONE_CHANGE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + ZoneChangeEvent zce = (ZoneChangeEvent)event; + if(zce.getFromZone() == Zone.BATTLEFIELD && zce.getToZone() == Zone.HAND) { + Card card = game.getCard(event.getTargetId()); + if(card != null) { + for(Effect effect: getEffects()) { + effect.setTargetPointer(new FixedTarget(card.getOwnerId())); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a permanent is returned to a player's hand, that player discards a card"; + } + +} diff --git a/Mage.Sets/src/mage/sets/planeshift/DestructiveFlow.java b/Mage.Sets/src/mage/sets/planeshift/DestructiveFlow.java new file mode 100644 index 00000000000..79dff24deeb --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/DestructiveFlow.java @@ -0,0 +1,71 @@ +/* + * 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.planeshift; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.SacrificeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author LoneFox + */ +public class DestructiveFlow extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic land"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + } + + public DestructiveFlow(UUID ownerId) { + super(ownerId, 102, "Destructive Flow", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{R}{G}"); + this.expansionSetCode = "PLS"; + + // At the beginning of each player's upkeep, that player sacrifices a nonbasic land. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(filter, 1, "that player"), + TargetController.ANY, false)); + + } + + public DestructiveFlow(final DestructiveFlow card) { + super(card); + } + + @Override + public DestructiveFlow copy() { + return new DestructiveFlow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/RadiantKavu.java b/Mage.Sets/src/mage/sets/planeshift/RadiantKavu.java new file mode 100644 index 00000000000..b460f739148 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/RadiantKavu.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.planeshift; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventAllDamageByAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class RadiantKavu extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue and black creatures"); + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLUE), new ColorPredicate(ObjectColor.BLACK))); + } + + public RadiantKavu(UUID ownerId) { + super(ownerId, 120, "Radiant Kavu", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}{G}{W}"); + this.expansionSetCode = "PLS"; + this.subtype.add("Kavu"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {R}{G}{W}: Prevent all combat damage blue creatures and black creatures would deal this turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, (new PreventAllDamageByAllEffect(filter, + Duration.EndOfTurn, true)), new ManaCostsImpl("{R}{G}{W}"))); + } + + public RadiantKavu(final RadiantKavu card) { + super(card); + } + + @Override + public RadiantKavu copy() { + return new RadiantKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/WarpedDevotion.java b/Mage.Sets/src/mage/sets/planeshift/WarpedDevotion.java new file mode 100644 index 00000000000..776a40c4dce --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/WarpedDevotion.java @@ -0,0 +1,54 @@ +/* + * 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.planeshift; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WarpedDevotion extends mage.sets.eighthedition.WarpedDevotion { + + public WarpedDevotion(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "PLS"; + this.rarity = Rarity.UNCOMMON; + } + + public WarpedDevotion(final WarpedDevotion card) { + super(card); + } + + @Override + public WarpedDevotion copy() { + return new WarpedDevotion(this); + } +}