From e9c47a46442b9d6d49a91872cf9c6d2e436f00ff Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 4 Aug 2017 16:36:00 -0400 Subject: [PATCH] Implement Coffin Puppets --- Mage.Sets/src/mage/cards/c/CoffinPuppets.java | 87 +++++++++++++++++++ Mage.Sets/src/mage/cards/c/CommonCause.java | 1 - Mage.Sets/src/mage/sets/Prophecy.java | 1 + 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/c/CoffinPuppets.java diff --git a/Mage.Sets/src/mage/cards/c/CoffinPuppets.java b/Mage.Sets/src/mage/cards/c/CoffinPuppets.java new file mode 100644 index 0000000000..1a53273b65 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CoffinPuppets.java @@ -0,0 +1,87 @@ +/* + * 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.cards.c; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.CompoundCondition; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.IsStepCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author TheElk801 + */ +public class CoffinPuppets extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control a Swamp"); + + static { + filter.add(new SubtypePredicate(SubType.SWAMP)); + } + + public CoffinPuppets(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Sacrifice two lands: Return Coffin Puppets from your graveyard to the battlefield. Activate this ability only during your upkeep and only if you control a Swamp. + Condition condition = new CompoundCondition("during your upkeep and only if you control a Swamp",new PermanentsOnTheBattlefieldCondition(filter), new IsStepCondition(PhaseStep.UPKEEP)); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToBattlefieldEffect(), + new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true)), + condition); + this.addAbility(ability); + } + + public CoffinPuppets(final CoffinPuppets card) { + super(card); + } + + @Override + public CoffinPuppets copy() { + return new CoffinPuppets(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CommonCause.java b/Mage.Sets/src/mage/cards/c/CommonCause.java index ed85ca4dd5..5fb8e60e47 100644 --- a/Mage.Sets/src/mage/cards/c/CommonCause.java +++ b/Mage.Sets/src/mage/cards/c/CommonCause.java @@ -82,7 +82,6 @@ class AllColorCondition implements Condition { public boolean apply(Game game, Ability source) { FilterCreaturePermanent filter = new FilterCreaturePermanent("Nonartifact creatures"); filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); -// Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); ObjectColor allColor = new ObjectColor("WUBRG"); for (Permanent thing : game.getBattlefield().getAllActivePermanents(filter, game)) { allColor = allColor.intersection(thing.getColor(game)); diff --git a/Mage.Sets/src/mage/sets/Prophecy.java b/Mage.Sets/src/mage/sets/Prophecy.java index 25af469773..0a6bea024a 100644 --- a/Mage.Sets/src/mage/sets/Prophecy.java +++ b/Mage.Sets/src/mage/sets/Prophecy.java @@ -74,6 +74,7 @@ public class Prophecy extends ExpansionSet { cards.add(new SetCardInfo("Chimeric Idol", 136, Rarity.UNCOMMON, mage.cards.c.ChimericIdol.class)); cards.add(new SetCardInfo("Citadel of Pain", 86, Rarity.UNCOMMON, mage.cards.c.CitadelOfPain.class)); cards.add(new SetCardInfo("Coastal Hornclaw", 31, Rarity.COMMON, mage.cards.c.CoastalHornclaw.class)); + cards.add(new SetCardInfo("Coffin Puppets", 60, Rarity.RARE, mage.cards.c.CoffinPuppets.class)); cards.add(new SetCardInfo("Copper-Leaf Angel", 137, Rarity.RARE, mage.cards.c.CopperLeafAngel.class)); cards.add(new SetCardInfo("Darba", 111, Rarity.UNCOMMON, mage.cards.d.Darba.class)); cards.add(new SetCardInfo("Denying Wind", 32, Rarity.RARE, mage.cards.d.DenyingWind.class));