[MOM] Implement See Double

This commit is contained in:
theelk801 2023-04-16 21:09:19 -04:00
parent 1578ffb3bc
commit 784ae47675
2 changed files with 91 additions and 0 deletions

View file

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

View file

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