diff --git a/Mage.Sets/src/mage/cards/n/Nazgul.java b/Mage.Sets/src/mage/cards/n/Nazgul.java index 7a0cae5a5d0..5b4ecc947e0 100644 --- a/Mage.Sets/src/mage/cards/n/Nazgul.java +++ b/Mage.Sets/src/mage/cards/n/Nazgul.java @@ -1,9 +1,9 @@ package mage.cards.n; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.TheRingTemptsYouTriggeredAbility; import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.abilities.effects.keyword.TheRingTemptsYouEffect; @@ -16,8 +16,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.game.Game; -import mage.game.events.GameEvent; import java.util.UUID; @@ -26,6 +24,8 @@ import java.util.UUID; */ public final class Nazgul extends CardImpl { + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.WRAITH); + public Nazgul(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); @@ -41,7 +41,9 @@ public final class Nazgul extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new TheRingTemptsYouEffect())); // Whenever the Ring tempts you, put a +1/+1 counter on each Wraith you control. - this.addAbility(new NazgulTriggeredAbility()); + this.addAbility(new TheRingTemptsYouTriggeredAbility( + new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter) + )); // A deck can have up to nine cards named Nazgul. this.addAbility(new SimpleStaticAbility( @@ -58,32 +60,3 @@ public final class Nazgul extends CardImpl { return new Nazgul(this); } } - -class NazgulTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterPermanent filter = new FilterControlledPermanent(SubType.WRAITH); - - NazgulTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter)); - setTriggerPhrase("Whenever the Ring tempts you, "); - } - - private NazgulTriggeredAbility(final NazgulTriggeredAbility ability) { - super(ability); - } - - @Override - public NazgulTriggeredAbility copy() { - return new NazgulTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.TEMPTED_BY_RING; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return isControlledBy(event.getPlayerId()); - } -} diff --git a/Mage.Sets/src/mage/cards/s/SauronTheDarkLord.java b/Mage.Sets/src/mage/cards/s/SauronTheDarkLord.java new file mode 100644 index 00000000000..5197c6b48a2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SauronTheDarkLord.java @@ -0,0 +1,81 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.common.TheRingTemptsYouTriggeredAbility; +import mage.abilities.costs.common.DiscardHandCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.keyword.AmassEffect; +import mage.abilities.effects.keyword.TheRingTemptsYouEffect; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SetTargetPointer; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SauronTheDarkLord extends CardImpl { + + private static final FilterControlledPermanent filter + = new FilterControlledPermanent("legendary artifact or legendary creature"); + private static final FilterPermanent filter2 + = new FilterControlledPermanent(SubType.ARMY, "an Army you control"); + + static { + filter.add(SuperType.LEGENDARY.getPredicate()); + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.CREATURE.getPredicate() + )); + } + + public SauronTheDarkLord(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{B}{R}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.AVATAR); + this.subtype.add(SubType.HORROR); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // Ward--Sacrifice a legendary artifact or legendary creature. + this.addAbility(new WardAbility(new SacrificeTargetCost(filter))); + + // Whenever an opponent casts a spell, amass Orcs 1. + this.addAbility(new SpellCastOpponentTriggeredAbility( + new AmassEffect(1, SubType.ORC), false + )); + + // Whenever an Army you control deals combat damage to a player, the Ring tempts you. + this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility( + new TheRingTemptsYouEffect(), filter2, false, + SetTargetPointer.NONE, true + )); + + // Whenever the Ring tempts you, you may discard your hand. If you do, draw four cards. + this.addAbility(new TheRingTemptsYouTriggeredAbility( + new DoIfCostPaid(new DrawCardSourceControllerEffect(4), new DiscardHandCost()) + )); + } + + private SauronTheDarkLord(final SauronTheDarkLord card) { + super(card); + } + + @Override + public SauronTheDarkLord copy() { + return new SauronTheDarkLord(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 3baf1ed2aba..85fd10af227 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -170,6 +170,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Saruman of Many Colors", 223, Rarity.MYTHIC, mage.cards.s.SarumanOfManyColors.class)); cards.add(new SetCardInfo("Saruman the White", 67, Rarity.UNCOMMON, mage.cards.s.SarumanTheWhite.class)); cards.add(new SetCardInfo("Saruman's Trickery", 68, Rarity.UNCOMMON, mage.cards.s.SarumansTrickery.class)); + cards.add(new SetCardInfo("Sauron, the Dark Lord", 224, Rarity.MYTHIC, mage.cards.s.SauronTheDarkLord.class)); cards.add(new SetCardInfo("Sauron, the Lidless Eye", 288, Rarity.MYTHIC, mage.cards.s.SauronTheLidlessEye.class)); cards.add(new SetCardInfo("Sauron, the Necromancer", 106, Rarity.RARE, mage.cards.s.SauronTheNecromancer.class)); cards.add(new SetCardInfo("Scroll of Isildur", 69, Rarity.RARE, mage.cards.s.ScrollOfIsildur.class)); diff --git a/Mage/src/main/java/mage/abilities/common/TheRingTemptsYouTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/TheRingTemptsYouTriggeredAbility.java new file mode 100644 index 00000000000..e636182aae8 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/common/TheRingTemptsYouTriggeredAbility.java @@ -0,0 +1,37 @@ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * @author TheElk801 + */ +public class TheRingTemptsYouTriggeredAbility extends TriggeredAbilityImpl { + + public TheRingTemptsYouTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + setTriggerPhrase("Whenever the Ring tempts you, "); + } + + private TheRingTemptsYouTriggeredAbility(final TheRingTemptsYouTriggeredAbility ability) { + super(ability); + } + + @Override + public TheRingTemptsYouTriggeredAbility copy() { + return new TheRingTemptsYouTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TEMPTED_BY_RING; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return isControlledBy(event.getPlayerId()); + } +}