From 31c0c2b070d1ca2b12a31554dd482d63662a6f5d Mon Sep 17 00:00:00 2001 From: theelk801 Date: Mon, 5 Jun 2023 23:15:05 -0400 Subject: [PATCH] [LTR] Implement The Mouth of Sauron --- .../src/mage/cards/t/TheMouthOfSauron.java | 78 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 2 + 2 files changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TheMouthOfSauron.java diff --git a/Mage.Sets/src/mage/cards/t/TheMouthOfSauron.java b/Mage.Sets/src/mage/cards/t/TheMouthOfSauron.java new file mode 100644 index 0000000000..a17f91e4d8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheMouthOfSauron.java @@ -0,0 +1,78 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.MillCardsTargetEffect; +import mage.abilities.effects.keyword.AmassEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheMouthOfSauron extends CardImpl { + + public TheMouthOfSauron(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{B}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ADVISOR); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When The Mouth of Sauron enters the battlefield, target player mills three cards. Then amass Orcs X, where X is the number of instant and sorcery cards in that player's graveyard. + Ability ability = new EntersBattlefieldTriggeredAbility(new MillCardsTargetEffect(3)); + ability.addEffect(new TheMouthOfSauronEffect()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + private TheMouthOfSauron(final TheMouthOfSauron card) { + super(card); + } + + @Override + public TheMouthOfSauron copy() { + return new TheMouthOfSauron(this); + } +} + +class TheMouthOfSauronEffect extends OneShotEffect { + + TheMouthOfSauronEffect() { + super(Outcome.Benefit); + staticText = "Then amass Orcs X, where X is the number of instant and sorcery cards in that player's graveyard"; + } + + private TheMouthOfSauronEffect(final TheMouthOfSauronEffect effect) { + super(effect); + } + + @Override + public TheMouthOfSauronEffect copy() { + return new TheMouthOfSauronEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + return player != null && AmassEffect.doAmass( + player.getGraveyard() + .count(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game), + SubType.ORC, game, source + ) != null; + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 29bb8aa1cb..e22a471548 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -115,6 +115,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Tale of Tinuviel", 34, Rarity.UNCOMMON, mage.cards.t.TaleOfTinuviel.class)); cards.add(new SetCardInfo("The Balrog, Flame of Udun", 395, Rarity.RARE, mage.cards.t.TheBalrogFlameOfUdun.class)); cards.add(new SetCardInfo("The Bath Song", 40, Rarity.UNCOMMON, mage.cards.t.TheBathSong.class)); + cards.add(new SetCardInfo("The Mouth of Sauron", 216, Rarity.UNCOMMON, mage.cards.t.TheMouthOfSauron.class)); cards.add(new SetCardInfo("The One Ring", 246, Rarity.MYTHIC, mage.cards.t.TheOneRing.class)); cards.add(new SetCardInfo("The Shire", 260, Rarity.RARE, mage.cards.t.TheShire.class)); cards.add(new SetCardInfo("There and Back Again", 151, Rarity.RARE, mage.cards.t.ThereAndBackAgain.class)); @@ -131,5 +132,6 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Fiery Inscription", 126, Rarity.UNCOMMON, mage.cards.f.FieryInscription.class)); cards.add(new SetCardInfo("Gift of Strands", 170, Rarity.UNCOMMON, mage.cards.g.GiftOfStrands.class)); cards.add(new SetCardInfo("Oath of the Grey Host", 101, Rarity.UNCOMMON, mage.cards.o.OathOfTheGreyHost.class)); + cards.add(new SetCardInfo("The Mouth of Sauron", 216, Rarity.UNCOMMON, mage.cards.t.TheMouthOfSauron.class)); } }