From 0e010241a9ee6fe2cd219d4e2f7a3c3dcdbd2384 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 30 May 2023 19:36:49 -0400 Subject: [PATCH] [LTC] Implement Sauron, Lord of the Rings --- .../mage/cards/s/SauronLordOfTheRings.java | 100 ++++++++++++++++++ .../sets/TalesOfMiddleEarthCommander.java | 1 + 2 files changed, 101 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SauronLordOfTheRings.java diff --git a/Mage.Sets/src/mage/cards/s/SauronLordOfTheRings.java b/Mage.Sets/src/mage/cards/s/SauronLordOfTheRings.java new file mode 100644 index 0000000000..d30ab637ea --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SauronLordOfTheRings.java @@ -0,0 +1,100 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.MillCardsControllerEffect; +import mage.abilities.effects.keyword.AmassEffect; +import mage.abilities.effects.keyword.TheRingTemptsYouEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.predicate.mageobject.CommanderPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SauronLordOfTheRings extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a commander an opponent controls"); + + static { + filter.add(CommanderPredicate.instance); + filter.add(TargetController.OPPONENT.getControllerPredicate()); + } + + public SauronLordOfTheRings(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{B}{R}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.AVATAR); + this.subtype.add(SubType.HORROR); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + // When you cast this spell, amass Orcs 5, mill five cards, then return a creature card from your graveyard to the battlefield. + Ability ability = new CastSourceTriggeredAbility( + new AmassEffect(5, SubType.ORC).setText("amass Orcs 5") + ); + ability.addEffect(new MillCardsControllerEffect(5).concatBy(",")); + ability.addEffect(new SauronLordOfTheRingsEffect()); + this.addAbility(ability); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Whenever a commander an opponent controls dies, the Ring tempts you. + this.addAbility(new DiesCreatureTriggeredAbility(new TheRingTemptsYouEffect(), false, filter)); + } + + private SauronLordOfTheRings(final SauronLordOfTheRings card) { + super(card); + } + + @Override + public SauronLordOfTheRings copy() { + return new SauronLordOfTheRings(this); + } +} + +class SauronLordOfTheRingsEffect extends OneShotEffect { + + SauronLordOfTheRingsEffect() { + super(Outcome.Benefit); + staticText = ", then return a creature card from your graveyard to the battlefield"; + } + + private SauronLordOfTheRingsEffect(final SauronLordOfTheRingsEffect effect) { + super(effect); + } + + @Override + public SauronLordOfTheRingsEffect copy() { + return new SauronLordOfTheRingsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null || player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game) < 1) { + return false; + } + TargetCard target = new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD); + target.setNotTarget(true); + player.choose(outcome, target, source, game); + Card card = game.getCard(target.getFirstTarget()); + return card != null && player.moveCards(card, Zone.BATTLEFIELD, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java index e4494f6608..ab7149af9b 100644 --- a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java +++ b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java @@ -28,6 +28,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet { cards.add(new SetCardInfo("Radagast, Wizard of Wilds", 66, Rarity.RARE, mage.cards.r.RadagastWizardOfWilds.class)); cards.add(new SetCardInfo("Rings of Brighthearth", 352, Rarity.MYTHIC, mage.cards.r.RingsOfBrighthearth.class)); cards.add(new SetCardInfo("Sam, Loyal Attendant", 7, Rarity.MYTHIC, mage.cards.s.SamLoyalAttendant.class)); + cards.add(new SetCardInfo("Sauron, Lord of the Rings", 4, Rarity.MYTHIC, mage.cards.s.SauronLordOfTheRings.class)); cards.add(new SetCardInfo("Shadowspear", 353, Rarity.MYTHIC, mage.cards.s.Shadowspear.class)); cards.add(new SetCardInfo("Sol Ring", 284, Rarity.UNCOMMON, mage.cards.s.SolRing.class)); cards.add(new SetCardInfo("The Great Henge", 348, Rarity.MYTHIC, mage.cards.t.TheGreatHenge.class));