From 18f159415acf6964ea2b458c33e39e4b754f3544 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 4 Sep 2020 17:13:10 -0400 Subject: [PATCH] [ZNR] Implemented Adventure Awaits --- .../src/mage/cards/a/AdventureAwaits.java | 80 +++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + 2 files changed, 81 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AdventureAwaits.java diff --git a/Mage.Sets/src/mage/cards/a/AdventureAwaits.java b/Mage.Sets/src/mage/cards/a/AdventureAwaits.java new file mode 100644 index 0000000000..af2bddc334 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AdventureAwaits.java @@ -0,0 +1,80 @@ +package mage.cards.a; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AdventureAwaits extends CardImpl { + + public AdventureAwaits(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); + + // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. If you don't put a card into your hand this way, draw a card. + this.getSpellAbility().addEffect(new AdventureAwaitsEffect()); + } + + private AdventureAwaits(final AdventureAwaits card) { + super(card); + } + + @Override + public AdventureAwaits copy() { + return new AdventureAwaits(this); + } +} + +class AdventureAwaitsEffect extends OneShotEffect { + + AdventureAwaitsEffect() { + super(Outcome.Benefit); + staticText = "Look at the top five cards of your library. " + + "You may reveal a creature card from among them and put it into your hand. " + + "Put the rest on the bottom of your library in a random order. " + + "If you don't put a card into your hand this way, draw a card."; + } + + private AdventureAwaitsEffect(final AdventureAwaitsEffect effect) { + super(effect); + } + + @Override + public AdventureAwaitsEffect copy() { + return new AdventureAwaitsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 5)); + TargetCard target = new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_CREATURE); + player.choose(outcome, cards, target, game); + Card card = game.getCard(target.getFirstTarget()); + if (card != null && player.chooseUse(outcome, "Put " + card.getName() + " into your hand?", + "Otherwise draw a card", "Put into hand", "Draw a card", source, game + )) { + player.moveCards(card, Zone.HAND, source, game); + cards.remove(card); + player.putCardsOnBottomOfLibrary(cards, game, source, false); + } else { + player.putCardsOnBottomOfLibrary(cards, game, source, false); + player.drawCards(1, source.getSourceId(), game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index cf8ad7045c..d57a217169 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -75,6 +75,7 @@ public final class ZendikarRising extends ExpansionSet { this.maxCardNumberInBooster = 280; cards.add(new SetCardInfo("Acquisitions Expert", 89, Rarity.UNCOMMON, mage.cards.a.AcquisitionsExpert.class)); + cards.add(new SetCardInfo("Adventure Awaits", 177, Rarity.COMMON, mage.cards.a.AdventureAwaits.class)); cards.add(new SetCardInfo("Akoum Hellhound", 133, Rarity.COMMON, mage.cards.a.AkoumHellhound.class)); cards.add(new SetCardInfo("Akoum Teeth", 134, Rarity.UNCOMMON, mage.cards.a.AkoumTeeth.class)); cards.add(new SetCardInfo("Akoum Warrior", 134, Rarity.UNCOMMON, mage.cards.a.AkoumWarrior.class));