From efffc5355214b128a8cfa5f6902df2960e1efe88 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 10 Sep 2019 20:53:43 -0400 Subject: [PATCH] Implemented Feasting Troll King --- .../src/mage/cards/f/FeastingTrollKing.java | 71 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FeastingTrollKing.java diff --git a/Mage.Sets/src/mage/cards/f/FeastingTrollKing.java b/Mage.Sets/src/mage/cards/f/FeastingTrollKing.java new file mode 100644 index 0000000000..7ceaa6025c --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FeastingTrollKing.java @@ -0,0 +1,71 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.CastFromHandSourceCondition; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.game.permanent.token.FoodToken; +import mage.target.common.TargetControlledPermanent; +import mage.watchers.common.CastFromHandWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FeastingTrollKing extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent(SubType.FOOD, "Foods"); + + public FeastingTrollKing(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}{G}{G}"); + + this.subtype.add(SubType.TROLL); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // When Feasting Troll King enters the battlefield, if you cast it from your hand, create three Food tokens. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new FoodToken(), 3)), + CastFromHandSourceCondition.instance, "When {this} enters the battlefield, " + + "if you cast it from your hand, create three Food tokens." + ), new CastFromHandWatcher()); + + // Sacrifice three Foods: Return Feasting Troll King from your graveyard to the battlefield. Activate this ability only during your turn. + this.addAbility(new ActivateIfConditionActivatedAbility( + Zone.BATTLEFIELD, + new ReturnSourceFromGraveyardToHandEffect(), + new SacrificeTargetCost(new TargetControlledPermanent(3, filter)), + MyTurnCondition.instance + )); + } + + private FeastingTrollKing(final FeastingTrollKing card) { + super(card); + } + + @Override + public FeastingTrollKing copy() { + return new FeastingTrollKing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index b59cbbad27..c947fc7809 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -55,6 +55,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Faerie Formation", 316, Rarity.RARE, mage.cards.f.FaerieFormation.class)); cards.add(new SetCardInfo("Faerie Guidemother", 11, Rarity.COMMON, mage.cards.f.FaerieGuidemother.class)); cards.add(new SetCardInfo("Faerie Vandal", 45, Rarity.UNCOMMON, mage.cards.f.FaerieVandal.class)); + cards.add(new SetCardInfo("Feasting Troll King", 152, Rarity.RARE, mage.cards.f.FeastingTrollKing.class)); cards.add(new SetCardInfo("Fireborn Knight", 210, Rarity.UNCOMMON, mage.cards.f.FirebornKnight.class)); cards.add(new SetCardInfo("Flaxen Intruder", 155, Rarity.UNCOMMON, mage.cards.f.FlaxenIntruder.class)); cards.add(new SetCardInfo("Foulmire Knight", 90, Rarity.UNCOMMON, mage.cards.f.FoulmireKnight.class));