From 784ae47675b5d32b5dc4a78ee03318ba64e156d1 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 16 Apr 2023 21:09:19 -0400 Subject: [PATCH] [MOM] Implement See Double --- Mage.Sets/src/mage/cards/s/SeeDouble.java | 90 +++++++++++++++++++ .../src/mage/sets/MarchOfTheMachine.java | 1 + 2 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SeeDouble.java diff --git a/Mage.Sets/src/mage/cards/s/SeeDouble.java b/Mage.Sets/src/mage/cards/s/SeeDouble.java new file mode 100644 index 00000000000..30e87322a7b --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SeeDouble.java @@ -0,0 +1,90 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInOpponentGraveyardCondition; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.CopyTargetSpellEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetSpell; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SeeDouble extends CardImpl { + + public SeeDouble(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); + + // This spell can't be copied. + this.addAbility(new SimpleStaticAbility(Zone.STACK, new SeeDoubleEffect()).setRuleAtTheTop(true)); + + // Choose one. If an opponent has eight or more cards in their graveyard, you may choose both. + this.getSpellAbility().getModes().setChooseText( + "Choose one. If an opponent has eight or more cards in their graveyard, you may choose both." + ); + this.getSpellAbility().getModes().setMoreCondition(CardsInOpponentGraveyardCondition.EIGHT); + this.getSpellAbility().addHint(CardsInOpponentGraveyardCondition.EIGHT.getHint()); + + // * Copy target spell. You may choose new targets for the copy. + this.getSpellAbility().addEffect(new CopyTargetSpellEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + // * Create a token that's a copy of target creature. + this.getSpellAbility().addMode(new Mode(new CreateTokenCopyTargetEffect()) + .addTarget(new TargetCreaturePermanent())); + } + + private SeeDouble(final SeeDouble card) { + super(card); + } + + @Override + public SeeDouble copy() { + return new SeeDouble(this); + } +} + +class SeeDoubleEffect extends ReplacementEffectImpl { + + SeeDoubleEffect() { + super(Duration.WhileOnStack, Outcome.Benefit); + staticText = "this spell can't be copied"; + } + + private SeeDoubleEffect(final SeeDoubleEffect effect) { + super(effect); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.COPY_STACKOBJECT; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getTargetId().equals(source.getSourceId()); + } + + @Override + public SeeDoubleEffect copy() { + return new SeeDoubleEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 9a4648fce26..282ca5eb8f8 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -281,6 +281,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Sculpted Perfection", 253, Rarity.UNCOMMON, mage.cards.s.SculptedPerfection.class)); cards.add(new SetCardInfo("Seal from Existence", 35, Rarity.UNCOMMON, mage.cards.s.SealFromExistence.class)); cards.add(new SetCardInfo("Searing Barb", 163, Rarity.COMMON, mage.cards.s.SearingBarb.class)); + cards.add(new SetCardInfo("See Double", 77, Rarity.RARE, mage.cards.s.SeeDouble.class)); cards.add(new SetCardInfo("Seed of Hope", 204, Rarity.COMMON, mage.cards.s.SeedOfHope.class)); cards.add(new SetCardInfo("Seedpod Caretaker", 325, Rarity.UNCOMMON, mage.cards.s.SeedpodCaretaker.class)); cards.add(new SetCardInfo("Seer of Stolen Sight", 330, Rarity.UNCOMMON, mage.cards.s.SeerOfStolenSight.class));