Implemented Scheming Symmetry

This commit is contained in:
Evan Kranzler 2019-06-22 20:49:38 -04:00
parent 5c36acd190
commit 3a99a801ad
2 changed files with 77 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));