[LTC] Implement Sauron, Lord of the Rings

This commit is contained in:
theelk801 2023-05-30 19:36:49 -04:00
parent 794a1dbb59
commit 0e010241a9
2 changed files with 101 additions and 0 deletions

View file

@ -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);
}
}

View file

@ -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("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("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("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("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("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)); cards.add(new SetCardInfo("The Great Henge", 348, Rarity.MYTHIC, mage.cards.t.TheGreatHenge.class));