From 1a0fd2ffa8d06cbe09a0fa43f13dde133edfdf44 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 26 Jan 2024 16:44:36 -0500 Subject: [PATCH] [MKM] Implement Deadly Complicatoin --- .../src/mage/cards/d/DeadlyComplication.java | 91 +++++++++++++++++++ .../src/mage/sets/MurdersAtKarlovManor.java | 1 + 2 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DeadlyComplication.java diff --git a/Mage.Sets/src/mage/cards/d/DeadlyComplication.java b/Mage.Sets/src/mage/cards/d/DeadlyComplication.java new file mode 100644 index 00000000000..7a1671de236 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DeadlyComplication.java @@ -0,0 +1,91 @@ +package mage.cards.d; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.SuspectedPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DeadlyComplication extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledCreaturePermanent("suspected creature you control"); + + static { + filter.add(SuspectedPredicate.instance); + } + + public DeadlyComplication(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{R}"); + + // Choose one or both -- + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(2); + + // * Destroy target creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // * Put a +1/+1 counter on target suspected creature you control. You may have it become no longer suspected. + this.getSpellAbility().addMode(new Mode(new AddCountersTargetEffect(CounterType.P1P1.createInstance())) + .addEffect(new DeadlyComplicationEffect()) + .addTarget(new TargetPermanent(filter))); + } + + private DeadlyComplication(final DeadlyComplication card) { + super(card); + } + + @Override + public DeadlyComplication copy() { + return new DeadlyComplication(this); + } +} + +class DeadlyComplicationEffect extends OneShotEffect { + + DeadlyComplicationEffect() { + super(Outcome.Benefit); + staticText = "You may have it become no longer suspected"; + } + + private DeadlyComplicationEffect(final DeadlyComplicationEffect effect) { + super(effect); + } + + @Override + public DeadlyComplicationEffect copy() { + return new DeadlyComplicationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (player != null && permanent != null && player.chooseUse( + outcome, "Have " + permanent.getName() + " no longer be suspected?", source, game + )) { + permanent.setSuspected(false, game, source); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java index 41a3e9dbf11..acae9c70963 100644 --- a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java +++ b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java @@ -55,6 +55,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet { cards.add(new SetCardInfo("Culvert Ambusher", 158, Rarity.UNCOMMON, mage.cards.c.CulvertAmbusher.class)); cards.add(new SetCardInfo("Curious Cadaver", 194, Rarity.UNCOMMON, mage.cards.c.CuriousCadaver.class)); cards.add(new SetCardInfo("Curious Inquiry", 51, Rarity.UNCOMMON, mage.cards.c.CuriousInquiry.class)); + cards.add(new SetCardInfo("Deadly Complication", 195, Rarity.UNCOMMON, mage.cards.d.DeadlyComplication.class)); cards.add(new SetCardInfo("Deduce", 52, Rarity.COMMON, mage.cards.d.Deduce.class)); cards.add(new SetCardInfo("Defenestrated Phantom", 11, Rarity.COMMON, mage.cards.d.DefenestratedPhantom.class)); cards.add(new SetCardInfo("Demand Answers", 122, Rarity.COMMON, mage.cards.d.DemandAnswers.class));