From 713110eb0377b0861f587cbcf130902923d11895 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 1 Jan 2020 22:43:49 -0500 Subject: [PATCH] Implemented Atris, Oracle of Half-Truths --- .../mage/cards/a/AtrisOracleOfHalfTruths.java | 98 +++++++++++++++++++ .../src/mage/sets/TherosBeyondDeath.java | 1 + 2 files changed, 99 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AtrisOracleOfHalfTruths.java diff --git a/Mage.Sets/src/mage/cards/a/AtrisOracleOfHalfTruths.java b/Mage.Sets/src/mage/cards/a/AtrisOracleOfHalfTruths.java new file mode 100644 index 0000000000..abd199c79c --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AtrisOracleOfHalfTruths.java @@ -0,0 +1,98 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AtrisOracleOfHalfTruths extends CardImpl { + + public AtrisOracleOfHalfTruths(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ADVISOR); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Menace + this.addAbility(new MenaceAbility()); + + // When Atris, Oracle of Half-Truths enters the battlefield, target opponent looks at the top three cards of your library and separates them into a face-down pile and a face-up pile. Put one pile into your hand and the other into your graveyard. + this.addAbility(new EntersBattlefieldTriggeredAbility(new AtrisOracleOfHalfTruthsEffect())); + } + + private AtrisOracleOfHalfTruths(final AtrisOracleOfHalfTruths card) { + super(card); + } + + @Override + public AtrisOracleOfHalfTruths copy() { + return new AtrisOracleOfHalfTruths(this); + } +} + +class AtrisOracleOfHalfTruthsEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("cards for the face-down pile"); + + AtrisOracleOfHalfTruthsEffect() { + super(Outcome.Benefit); + this.staticText = "target opponent looks at the top three cards of your library " + + "and separates them into a face-down pile and a face-up pile. " + + "Put one pile into your hand and the other into your graveyard"; + } + + private AtrisOracleOfHalfTruthsEffect(final AtrisOracleOfHalfTruthsEffect effect) { + super(effect); + } + + @Override + public AtrisOracleOfHalfTruthsEffect copy() { + return new AtrisOracleOfHalfTruthsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player targetOpponent = game.getPlayer(getTargetPointer().getFirst(game, source)); + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || targetOpponent == null || sourceObject == null) { + return false; + } + Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 3)); + + TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter); + targetOpponent.choose(outcome, cards, target, game); + Cards faceDownPile = new CardsImpl(target.getTargets()); + cards.removeAll(target.getTargets()); + controller.revealCards(sourceObject.getIdName() + " - cards in face-up pile", cards, game); + game.informPlayers(targetOpponent.getLogName() + " puts " + faceDownPile.size() + " card(s) into the face-down pile"); + if (controller.chooseUse(outcome, "Choose a pile to put in your hand.", null, + "Face-down", "Face-up", source, game)) { + controller.moveCards(faceDownPile, Zone.HAND, source, game); + controller.moveCards(cards, Zone.GRAVEYARD, source, game); + } else { + controller.moveCards(faceDownPile, Zone.GRAVEYARD, source, game); + controller.moveCards(cards, Zone.HAND, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index 235a557b50..fa2fb7d6b2 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -33,6 +33,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Ashiok, Nightmare Muse", 208, Rarity.MYTHIC, mage.cards.a.AshiokNightmareMuse.class)); cards.add(new SetCardInfo("Ashiok, Sculptor of Fears", 274, Rarity.MYTHIC, mage.cards.a.AshiokSculptorOfFears.class)); cards.add(new SetCardInfo("Athreos, Shroud-Veiled", 269, Rarity.MYTHIC, mage.cards.a.AthreosShroudVeiled.class)); + cards.add(new SetCardInfo("Atris, Oracle of Half-Truths", 209, Rarity.RARE, mage.cards.a.AtrisOracleOfHalfTruths.class)); cards.add(new SetCardInfo("Banishing Light", 4, Rarity.UNCOMMON, mage.cards.b.BanishingLight.class)); cards.add(new SetCardInfo("Brine Giant", 44, Rarity.COMMON, mage.cards.b.BrineGiant.class)); cards.add(new SetCardInfo("Cling to Dust", 87, Rarity.UNCOMMON, mage.cards.c.ClingToDust.class));