[SPM] implement Superior Spider-Man

This commit is contained in:
jmlundeen 2025-09-05 15:57:48 -05:00
parent 3fc3b9da1a
commit f7c239c1fe
3 changed files with 165 additions and 0 deletions

View file

@ -0,0 +1,106 @@
package mage.cards.s;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CopyEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInGraveyard;
import mage.util.functions.CopyApplier;
import java.util.UUID;
/**
*
* @author Jmlundeen
*/
public final class SuperiorSpiderMan extends CardImpl {
public SuperiorSpiderMan(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{B}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.SPIDER);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.HERO);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Mind Swap -- You may have Superior Spider-Man enter as a copy of any creature card in a graveyard, except his name is Superior Spider-Man and he's a 4/4 Spider Human Hero in addition to his other types. When you do, exile that card.
this.addAbility(new EntersBattlefieldAbility(new SuperiorSpiderManCopyEffect(), true));
}
private SuperiorSpiderMan(final SuperiorSpiderMan card) {
super(card);
}
@Override
public SuperiorSpiderMan copy() {
return new SuperiorSpiderMan(this);
}
}
class SuperiorSpiderManCopyEffect extends OneShotEffect {
SuperiorSpiderManCopyEffect() {
super(Outcome.Copy);
this.staticText = "as a copy of any creature card in a graveyard, except his name is Superior Spider-Man " +
"and hes a 4/4 Spider Human Hero in addition to his other types. When you do, exile that card.";
}
private SuperiorSpiderManCopyEffect(final SuperiorSpiderManCopyEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Target target = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"));
target.withNotTarget(true);
if (target.canChoose(source.getControllerId(), source, game)) {
player.choose(outcome, target, source, game);
Card copyFromCard = game.getCard(target.getFirstTarget());
if (copyFromCard != null) {
Permanent newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game);
newBluePrint.assignNewId();
SuperiorSpiderManCopyApplier applier = new SuperiorSpiderManCopyApplier();
applier.apply(game, newBluePrint, source, source.getSourceId());
CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, source.getSourceId());
game.addEffect(copyEffect, source);
copyFromCard.moveToExile(null, "", source, game);
}
}
return true;
}
return false;
}
@Override
public SuperiorSpiderManCopyEffect copy() {
return new SuperiorSpiderManCopyEffect(this);
}
}
class SuperiorSpiderManCopyApplier extends CopyApplier {
@Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) {
blueprint.setName("Superior Spider-Man");
blueprint.getPower().setModifiedBaseValue(4);
blueprint.getToughness().setModifiedBaseValue(4);
blueprint.addSubType(SubType.SPIDER, SubType.HUMAN, SubType.HERO);
return true;
}
}

View file

@ -261,6 +261,8 @@ public final class MarvelsSpiderMan extends ExpansionSet {
cards.add(new SetCardInfo("Sudden Strike", 19, Rarity.UNCOMMON, mage.cards.s.SuddenStrike.class)); cards.add(new SetCardInfo("Sudden Strike", 19, Rarity.UNCOMMON, mage.cards.s.SuddenStrike.class));
cards.add(new SetCardInfo("Sun-Spider, Nimble Webber", 154, Rarity.UNCOMMON, mage.cards.s.SunSpiderNimbleWebber.class)); cards.add(new SetCardInfo("Sun-Spider, Nimble Webber", 154, Rarity.UNCOMMON, mage.cards.s.SunSpiderNimbleWebber.class));
cards.add(new SetCardInfo("Superior Foes of Spider-Man", 96, Rarity.UNCOMMON, mage.cards.s.SuperiorFoesOfSpiderMan.class)); cards.add(new SetCardInfo("Superior Foes of Spider-Man", 96, Rarity.UNCOMMON, mage.cards.s.SuperiorFoesOfSpiderMan.class));
cards.add(new SetCardInfo("Superior Spider-Man", 155, Rarity.RARE, mage.cards.s.SuperiorSpiderMan.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Superior Spider-Man", 275, Rarity.RARE, mage.cards.s.SuperiorSpiderMan.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Supportive Parents", 119, Rarity.UNCOMMON, mage.cards.s.SupportiveParents.class)); cards.add(new SetCardInfo("Supportive Parents", 119, Rarity.UNCOMMON, mage.cards.s.SupportiveParents.class));
cards.add(new SetCardInfo("Swamp", 191, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Swamp", 191, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Swamp", 196, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Swamp", 196, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));

View file

@ -0,0 +1,57 @@
package org.mage.test.cards.single.spm;
import mage.abilities.keyword.LifelinkAbility;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author Jmlundeen
*/
public class SuperiorSpiderManTest extends CardTestPlayerBase {
/*
Superior Spider-Man
{2}{U}{B}
Legendary Creature - Spider Human Hero
Mind Swap -- You may have Superior Spider- Man enter as a copy of any creature card in a graveyard, except his name is Superior Spider-Man and he's a 4/4 Spider Human Hero in addition to his other types. When you do, exile that card.
4/4
*/
private static final String superiorSpiderMan = "Superior Spider-Man";
/*
Adelbert Steiner
{1}{W}
Legendary Creature - Human Knight
Lifelink
Adelbert Steiner gets +1/+1 for each Equipment you control.
2/1
*/
private static final String adelbertSteiner = "Adelbert Steiner";
@Test
public void testSuperiorSpiderMan() {
setStrictChooseMode(true);
addCard(Zone.HAND, playerA, superiorSpiderMan);
addCard(Zone.GRAVEYARD, playerA, adelbertSteiner);
addCard(Zone.BATTLEFIELD, playerA, "Underground Sea", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, superiorSpiderMan);
setChoice(playerA, true);
setChoice(playerA, adelbertSteiner);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertExileCount(playerA, 1);
assertSubtype(superiorSpiderMan, SubType.KNIGHT);
assertSubtype(superiorSpiderMan, SubType.SPIDER);
assertSubtype(superiorSpiderMan, SubType.HERO);
assertSubtype(superiorSpiderMan, SubType.HUMAN);
assertAbility(playerA, superiorSpiderMan, LifelinkAbility.getInstance(), true);
}
}