From 4f942d1630093b940329da3e7c88148c17399fed Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 1 Apr 2023 10:06:45 -0400 Subject: [PATCH] [MOM] Implement Oracle of Tragedy --- .../src/mage/cards/o/OracleOfTragedy.java | 60 +++++++++++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 1 + 2 files changed, 61 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OracleOfTragedy.java diff --git a/Mage.Sets/src/mage/cards/o/OracleOfTragedy.java b/Mage.Sets/src/mage/cards/o/OracleOfTragedy.java new file mode 100644 index 0000000000..e93a972031 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OracleOfTragedy.java @@ -0,0 +1,60 @@ +package mage.cards.o; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.EntersBattlefieldOrDiesSourceTriggeredAbility; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.abilities.effects.common.ShuffleIntoLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.SubType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ManaValuePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OracleOfTragedy extends CardImpl { + + private static final FilterCard filter = new FilterCard("cards with mana value 3 or greater from your graveyard"); + + static { + filter.add(new ManaValuePredicate(ComparisonType.MORE_THAN, 2)); + } + + public OracleOfTragedy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // When Oracle of Tragedy enters the battlefield or dies, choose one -- + // * Draw a card, then discard a card. + Ability ability = new EntersBattlefieldOrDiesSourceTriggeredAbility( + new DrawDiscardControllerEffect(1, 1), false + ); + + // * Shuffle up to four target cards with mana value 3 or greater from your graveyard into your library. + ability.addMode(new Mode(new ShuffleIntoLibraryTargetEffect().setText( + "shuffle up to four target cards with mana value 3 or greater from your graveyard into your library" + )).addTarget(new TargetCardInYourGraveyard(0, 4, filter))); + this.addAbility(ability); + } + + private OracleOfTragedy(final OracleOfTragedy card) { + super(card); + } + + @Override + public OracleOfTragedy copy() { + return new OracleOfTragedy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 769398afb9..27dac82453 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -52,6 +52,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Mountain", 280, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mutagen Connoisseur", 248, Rarity.UNCOMMON, mage.cards.m.MutagenConnoisseur.class)); cards.add(new SetCardInfo("Negate", 68, Rarity.COMMON, mage.cards.n.Negate.class)); + cards.add(new SetCardInfo("Oracle of Tragedy", 71, Rarity.UNCOMMON, mage.cards.o.OracleOfTragedy.class)); cards.add(new SetCardInfo("Phyrexian Gargantua", 121, Rarity.UNCOMMON, mage.cards.p.PhyrexianGargantua.class)); cards.add(new SetCardInfo("Phyrexian Pegasus", 324, Rarity.COMMON, mage.cards.p.PhyrexianPegasus.class)); cards.add(new SetCardInfo("Phyrexian Skyflayer", 143, Rarity.UNCOMMON, mage.cards.p.PhyrexianSkyflayer.class));