From 6ad29ab2d656a821807f408d50100efabd5e4f24 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 9 Sep 2019 16:33:45 -0400 Subject: [PATCH] Implemented Turn into a Pumpkin --- .../src/mage/cards/t/TurnIntoAPumpkin.java | 47 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 48 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TurnIntoAPumpkin.java diff --git a/Mage.Sets/src/mage/cards/t/TurnIntoAPumpkin.java b/Mage.Sets/src/mage/cards/t/TurnIntoAPumpkin.java new file mode 100644 index 0000000000..9324626581 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TurnIntoAPumpkin.java @@ -0,0 +1,47 @@ +package mage.cards.t; + +import mage.abilities.condition.common.AdamantCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.FoodToken; +import mage.target.common.TargetNonlandPermanent; +import mage.watchers.common.ManaSpentToCastWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TurnIntoAPumpkin extends CardImpl { + + public TurnIntoAPumpkin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}"); + + // Return target nonland permanent to its owner's hand. Draw a card. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("Draw a card.")); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + + // Adamant — If at least three blue mana was spent to cast this spell, create a Food token. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new CreateTokenEffect(new FoodToken()), AdamantCondition.BLUE, + "
Adamant — If at least three blue mana " + + "was spent to cast this spell, create a Food token." + )); + this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher()); + } + + private TurnIntoAPumpkin(final TurnIntoAPumpkin card) { + super(card); + } + + @Override + public TurnIntoAPumpkin copy() { + return new TurnIntoAPumpkin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 02c84a95a8..3551493e21 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -97,6 +97,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class)); cards.add(new SetCardInfo("Tome of Legends", 332, Rarity.RARE, mage.cards.t.TomeOfLegends.class)); cards.add(new SetCardInfo("Tournament Grounds", 248, Rarity.UNCOMMON, mage.cards.t.TournamentGrounds.class)); + cards.add(new SetCardInfo("Turn into a Pumpkin", 69, Rarity.UNCOMMON, mage.cards.t.TurnIntoAPumpkin.class)); cards.add(new SetCardInfo("Wind-Scarred Crag", 308, Rarity.COMMON, mage.cards.w.WindScarredCrag.class)); cards.add(new SetCardInfo("Wintermoor Commander", 205, Rarity.UNCOMMON, mage.cards.w.WintermoorCommander.class)); cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class));