From 3a99a801ada9f52973c07514620cc556bb7d2d34 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 22 Jun 2019 20:49:38 -0400 Subject: [PATCH] Implemented Scheming Symmetry --- .../src/mage/cards/s/SchemingSymmetry.java | 76 +++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2020.java | 1 + 2 files changed, 77 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SchemingSymmetry.java diff --git a/Mage.Sets/src/mage/cards/s/SchemingSymmetry.java b/Mage.Sets/src/mage/cards/s/SchemingSymmetry.java new file mode 100644 index 0000000000..a7073d0f8c --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SchemingSymmetry.java @@ -0,0 +1,76 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SchemingSymmetry extends CardImpl { + + public SchemingSymmetry(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}"); + + // Choose two target players. Each of them searches their library for a card, then shuffles their library and puts that card on top of it. + this.getSpellAbility().addEffect(new SchemingSymmetryEffect()); + this.getSpellAbility().addTarget(new TargetPlayer(2)); + } + + private SchemingSymmetry(final SchemingSymmetry card) { + super(card); + } + + @Override + public SchemingSymmetry copy() { + return new SchemingSymmetry(this); + } +} + +class SchemingSymmetryEffect extends OneShotEffect { + + SchemingSymmetryEffect() { + super(Outcome.Benefit); + staticText = "Choose two target players. Each of them searches their library for a card, " + + "then shuffles their library and puts that card on top of it."; + } + + private SchemingSymmetryEffect(final SchemingSymmetryEffect effect) { + super(effect); + } + + @Override + public SchemingSymmetryEffect copy() { + return new SchemingSymmetryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + source.getTargets() + .get(0) + .getTargets() + .stream() + .map(playerId -> game.getPlayer(playerId)) + .filter(player -> player != null) + .forEach(player -> { + TargetCardInLibrary targetCard = new TargetCardInLibrary(); + if (player.searchLibrary(targetCard, source, game)) { + Cards cards = new CardsImpl(); + cards.add(targetCard.getFirstTarget()); + player.shuffleLibrary(source, game); + player.putCardsOnTopOfLibrary(cards, game, source, false); + } + }); + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/CoreSet2020.java b/Mage.Sets/src/mage/sets/CoreSet2020.java index eb5fd36016..d5829343b2 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2020.java +++ b/Mage.Sets/src/mage/sets/CoreSet2020.java @@ -150,6 +150,7 @@ public final class CoreSet2020 extends ExpansionSet { cards.add(new SetCardInfo("Rotting Regisaur", 111, Rarity.RARE, mage.cards.r.RottingRegisaur.class)); cards.add(new SetCardInfo("Rugged Highlands", 250, Rarity.COMMON, mage.cards.r.RuggedHighlands.class)); cards.add(new SetCardInfo("Rule of Law", 35, Rarity.UNCOMMON, mage.cards.r.RuleOfLaw.class)); + cards.add(new SetCardInfo("Scheming Symmetry", 113, Rarity.RARE, mage.cards.s.SchemingSymmetry.class)); cards.add(new SetCardInfo("Scholar of the Ages", 74, Rarity.UNCOMMON, mage.cards.s.ScholarOfTheAges.class)); cards.add(new SetCardInfo("Scoured Barrens", 251, Rarity.COMMON, mage.cards.s.ScouredBarrens.class)); cards.add(new SetCardInfo("Scuttlemutt", 238, Rarity.UNCOMMON, mage.cards.s.Scuttlemutt.class));