From 98f659b098cd4b4c290988955f92f4975c7bb780 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 14 Sep 2018 14:11:43 -0400 Subject: [PATCH] Implemented Connive // Concoct --- .../src/mage/cards/c/ConniveConcoct.java | 103 ++++++++++++++++++ Mage.Sets/src/mage/sets/GuildsOfRavnica.java | 1 + 2 files changed, 104 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ConniveConcoct.java diff --git a/Mage.Sets/src/mage/cards/c/ConniveConcoct.java b/Mage.Sets/src/mage/cards/c/ConniveConcoct.java new file mode 100644 index 0000000000..8441c314a0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ConniveConcoct.java @@ -0,0 +1,103 @@ +package mage.cards.c; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardSetInfo; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author TheElk801 + */ +public final class ConniveConcoct extends SplitCard { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creature with power 2 or less"); + + static { + filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 3)); + } + + public ConniveConcoct(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U/B}{U/B}", "{3}{U}{B}", SpellAbilityType.SPLIT); + + // Connive + // Gain control of target creature with power 2 or less. + this.getLeftHalfCard().getSpellAbility().addEffect( + new GainControlTargetEffect(Duration.Custom) + ); + this.getLeftHalfCard().getSpellAbility().addTarget( + new TargetCreaturePermanent(filter) + ); + + // Concoct + // Surveil 3, then return a creature card from your graveyard to the battlefield. + this.getRightHalfCard().getSpellAbility().addEffect(new ConcoctEffect()); + } + + public ConniveConcoct(final ConniveConcoct card) { + super(card); + } + + @Override + public ConniveConcoct copy() { + return new ConniveConcoct(this); + } +} + +class ConcoctEffect extends OneShotEffect { + + private static final FilterCard filter + = new FilterCreatureCard("creature card in your graveyard"); + + public ConcoctEffect() { + super(Outcome.Benefit); + this.staticText = "Surveil 3, then return a creature card " + + "from your graveyard to the battlefield."; + } + + public ConcoctEffect(final ConcoctEffect effect) { + super(effect); + } + + @Override + public ConcoctEffect copy() { + return new ConcoctEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + player.surveil(3, source, game); + Target target = new TargetCardInYourGraveyard(filter); + target.setNotTarget(true); + if (player.choose(outcome, target, source.getSourceId(), game)) { + Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(); + effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game)); + effect.apply(game, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java index 2560f5a599..dff7ea3402 100644 --- a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -45,6 +45,7 @@ public final class GuildsOfRavnica extends ExpansionSet { cards.add(new SetCardInfo("Command the Storm", 94, Rarity.COMMON, mage.cards.c.CommandTheStorm.class)); cards.add(new SetCardInfo("Conclave Guildmage", 162, Rarity.UNCOMMON, mage.cards.c.ConclaveGuildmage.class)); cards.add(new SetCardInfo("Conclave Tribunal", 6, Rarity.UNCOMMON, mage.cards.c.ConclaveTribunal.class)); + cards.add(new SetCardInfo("Connive // Concoct", 222, Rarity.RARE, mage.cards.c.ConniveConcoct.class)); cards.add(new SetCardInfo("Crackling Drake", 163, Rarity.UNCOMMON, mage.cards.c.CracklingDrake.class)); cards.add(new SetCardInfo("Darkblade Agent", 164, Rarity.COMMON, mage.cards.d.DarkbladeAgent.class)); cards.add(new SetCardInfo("Deadly Visit", 68, Rarity.COMMON, mage.cards.d.DeadlyVisit.class));