From 7838049c146c6ad811ca736fd75fc5b9dfc8ea81 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Aug 2017 08:23:24 -0400 Subject: [PATCH] Implemented Carrion --- Mage.Sets/src/mage/cards/c/Carrion.java | 65 +++++++++++++++++++ Mage.Sets/src/mage/sets/Mirage.java | 1 + .../token/CarrionBlackInsectToken.java | 47 ++++++++++++++ .../token/NestOfScarabsBlackInsectToken.java | 2 +- 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/c/Carrion.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java diff --git a/Mage.Sets/src/mage/cards/c/Carrion.java b/Mage.Sets/src/mage/cards/c/Carrion.java new file mode 100644 index 0000000000..36707992bd --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/Carrion.java @@ -0,0 +1,65 @@ +/* + * 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.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.CarrionBlackInsectToken; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class Carrion extends CardImpl { + + public Carrion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{B}"); + + // As an additional cost to cast Carrion, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), false))); + + // Put X 0/1 black Insect creature tokens onto the battlefield, where X is the sacrificed creature's power. + this.getSpellAbility().addEffect(new CreateTokenEffect(new CarrionBlackInsectToken(), new SacrificeCostCreaturesPower())); + } + + public Carrion(final Carrion card) { + super(card); + } + + @Override + public Carrion copy() { + return new Carrion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index 72418f8f49..255d8661b9 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -82,6 +82,7 @@ public class Mirage extends ExpansionSet { cards.add(new SetCardInfo("Cadaverous Bloom", 318, Rarity.RARE, mage.cards.c.CadaverousBloom.class)); cards.add(new SetCardInfo("Cadaverous Knight", 8, Rarity.COMMON, mage.cards.c.CadaverousKnight.class)); cards.add(new SetCardInfo("Canopy Dragon", 107, Rarity.RARE, mage.cards.c.CanopyDragon.class)); + cards.add(new SetCardInfo("Carrion", 9, Rarity.RARE, mage.cards.c.Carrion.class)); cards.add(new SetCardInfo("Celestial Dawn", 210, Rarity.RARE, mage.cards.c.CelestialDawn.class)); cards.add(new SetCardInfo("Cerulean Wyvern", 57, Rarity.UNCOMMON, mage.cards.c.CeruleanWyvern.class)); cards.add(new SetCardInfo("Chaos Charm", 163, Rarity.COMMON, mage.cards.c.ChaosCharm.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java b/Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java new file mode 100644 index 0000000000..764b99070a --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/CarrionBlackInsectToken.java @@ -0,0 +1,47 @@ +/* +* 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.game.permanent.token; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author TheElk801 + */ +public class CarrionBlackInsectToken extends Token { + + public CarrionBlackInsectToken() { + super("Insect", "0/1 black Insect creature token"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Insect"); + power = new MageInt(0); + toughness = new MageInt(1); + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java b/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java index 8434fa6d65..565e086304 100644 --- a/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/NestOfScarabsBlackInsectToken.java @@ -37,7 +37,7 @@ import mage.MageInt; public class NestOfScarabsBlackInsectToken extends Token { public NestOfScarabsBlackInsectToken() { - super("Insect", "1/1 black Insect token"); + super("Insect", "1/1 black Insect creature token"); cardType.add(CardType.CREATURE); color.setBlack(true); subtype.add("Insect");