From 6067362a0f7f1dd6be650e7855ad8c7c6a48dbe7 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 3 Jun 2023 09:17:09 -0400 Subject: [PATCH] [LTR] Implement Mines of Moria --- Mage.Sets/src/mage/cards/m/MinesOfMoria.java | 75 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 76 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MinesOfMoria.java diff --git a/Mage.Sets/src/mage/cards/m/MinesOfMoria.java b/Mage.Sets/src/mage/cards/m/MinesOfMoria.java new file mode 100644 index 0000000000..47e8c54761 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MinesOfMoria.java @@ -0,0 +1,75 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.TreasureToken; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MinesOfMoria extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledCreaturePermanent(); + + static { + filter.add(SuperType.LEGENDARY.getPredicate()); + } + + private static final Condition condition + = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.EQUAL_TO, 0); + private static final Hint hint = new ConditionHint(condition, "You control a legendary creature"); + + public MinesOfMoria(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.supertype.add(SuperType.LEGENDARY); + + // Mines of Moria enters the battlefield tapped unless you control a legendary creature. + this.addAbility(new EntersBattlefieldAbility( + new ConditionalOneShotEffect(new TapSourceEffect(), condition, ""), + "tapped unless you control a legendary creature" + ).addHint(hint)); + + // {T}: Add {R}. + this.addAbility(new RedManaAbility()); + + // {3}{R}, {T}, Exile three cards from your graveyard: Create two Treasure tokens. + Ability ability = new SimpleActivatedAbility( + new CreateTokenEffect(new TreasureToken(), 2), new ManaCostsImpl<>("{3}{R}") + ); + ability.addCost(new TapSourceCost()); + ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3))); + this.addAbility(ability); + } + + private MinesOfMoria(final MinesOfMoria card) { + super(card); + } + + @Override + public MinesOfMoria copy() { + return new MinesOfMoria(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index 7a033fde16..23e0ec9afa 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -64,6 +64,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Mauhur, Uruk-hai Captain", 214, Rarity.UNCOMMON, mage.cards.m.MauhurUrukHaiCaptain.class)); cards.add(new SetCardInfo("Meriadoc Brandybuck", 177, Rarity.UNCOMMON, mage.cards.m.MeriadocBrandybuck.class)); cards.add(new SetCardInfo("Minas Tirith", 256, Rarity.RARE, mage.cards.m.MinasTirith.class)); + cards.add(new SetCardInfo("Mines of Moria", 257, Rarity.RARE, mage.cards.m.MinesOfMoria.class)); cards.add(new SetCardInfo("Moria Marauder", 138, Rarity.RARE, mage.cards.m.MoriaMarauder.class)); cards.add(new SetCardInfo("Mount Doom", 258, Rarity.MYTHIC, mage.cards.m.MountDoom.class)); cards.add(new SetCardInfo("Mountain", 268, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));