[SPM] Implement Origin of Spider-Man

This commit is contained in:
theelk801 2025-07-23 16:40:48 -04:00
parent a0c58c829a
commit cfb062a47d
3 changed files with 127 additions and 0 deletions

View file

@ -0,0 +1,93 @@
package mage.cards.o;
import mage.abilities.Ability;
import mage.abilities.common.SagaAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Spider21Token;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class OriginOfSpiderMan extends CardImpl {
public OriginOfSpiderMan(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.subtype.add(SubType.SAGA);
// (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)
SagaAbility sagaAbility = new SagaAbility(this);
// I -- Create a 2/1 green Spider creature token with reach.
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, new CreateTokenEffect(new Spider21Token()));
// II -- Put a +1/+1 counter on target creature you control. It becomes a legendary Spider Hero in addition to its other types.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_II,
new Effects(
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new OriginOfSpiderManEffect()
), new TargetControlledCreaturePermanent()
);
// III -- Target creature you control gains double strike until end of turn.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_III,
new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance()),
new TargetControlledCreaturePermanent()
);
this.addAbility(sagaAbility);
}
private OriginOfSpiderMan(final OriginOfSpiderMan card) {
super(card);
}
@Override
public OriginOfSpiderMan copy() {
return new OriginOfSpiderMan(this);
}
}
class OriginOfSpiderManEffect extends ContinuousEffectImpl {
OriginOfSpiderManEffect() {
super(Duration.Custom, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
staticText = "It becomes a legendary Spider Hero in addition to its other types";
}
private OriginOfSpiderManEffect(final OriginOfSpiderManEffect effect) {
super(effect);
}
@Override
public OriginOfSpiderManEffect copy() {
return new OriginOfSpiderManEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null) {
discard();
return false;
}
permanent.addSuperType(game, SuperType.LEGENDARY);
permanent.addSubType(game, SubType.SPIDER);
permanent.addSubType(game, SubType.HERO);
return true;
}
}

View file

@ -1,6 +1,7 @@
package mage.sets;
import mage.cards.ExpansionSet;
import mage.constants.Rarity;
import mage.constants.SetType;
/**
@ -18,5 +19,7 @@ public final class MarvelsSpiderMan extends ExpansionSet {
super("Marvel's Spider-Man", "SPM", ExpansionSet.buildDate(2025, 9, 26), SetType.EXPANSION);
this.blockName = "Marvel's Spider-Man"; // for sorting in GUI
this.hasBasicLands = false; // temporary
cards.add(new SetCardInfo("Origin of Spider-Man", 9, Rarity.RARE, mage.cards.o.OriginOfSpiderMan.class));
}
}

View file

@ -0,0 +1,31 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.keyword.ReachAbility;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author TheElk801
*/
public final class Spider21Token extends TokenImpl {
public Spider21Token() {
super("Spider Token", "2/1 green Spider creature token with reach");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add(SubType.SPIDER);
power = new MageInt(2);
toughness = new MageInt(1);
this.addAbility(ReachAbility.getInstance());
}
private Spider21Token(final Spider21Token token) {
super(token);
}
public Spider21Token copy() {
return new Spider21Token(this);
}
}