[SPM] Implement Miles Morales / Ultimate Spider-Man

This commit is contained in:
theelk801 2025-08-30 16:39:17 -04:00
parent 49a3b1176e
commit 2db69b4ba5
3 changed files with 131 additions and 3 deletions

View file

@ -0,0 +1,103 @@
package mage.cards.m;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.effects.common.continuous.BecomesColorSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.effects.common.counter.DoubleCounterOnEachPermanentEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardSetInfo;
import mage.cards.ModalDoubleFacedCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MilesMorales extends ModalDoubleFacedCard {
private static final FilterPermanent filter = new FilterControlledPermanent("Spider and legendary creature you control");
static {
filter.add(Predicates.or(
SubType.SPIDER.getPredicate(),
Predicates.and(
SuperType.LEGENDARY.getPredicate(),
CardType.CREATURE.getPredicate()
)));
}
public MilesMorales(UUID ownerId, CardSetInfo setInfo) {
super(
ownerId, setInfo,
new SuperType[]{SuperType.LEGENDARY}, new CardType[]{CardType.CREATURE}, new SubType[]{SubType.HUMAN, SubType.CITIZEN, SubType.HERO}, "{1}{G}",
"Ultimate Spider-Man",
new SuperType[]{SuperType.LEGENDARY}, new CardType[]{CardType.CREATURE}, new SubType[]{SubType.SPIDER, SubType.HUMAN, SubType.HERO}, "{3}{R}{G}{W}"
);
this.getLeftHalfCard().setPT(1, 2);
this.getRightHalfCard().setPT(4, 3);
// When Miles Morales enters, put a +1/+1 counter on each of up to two target creatures.
Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
ability.addTarget(new TargetCreaturePermanent(0, 2));
this.addAbility(ability);
// {3}{R}{G}{W}: Transform Miles Morales. Activate only as a sorcery.
this.getLeftHalfCard().addAbility(new ActivateAsSorceryActivatedAbility(
new TransformSourceEffect(), new ManaCostsImpl<>("{3}{R}{G}{W}")
));
// Ultimate Spider-Man
// First strike
this.getRightHalfCard().addAbility(FirstStrikeAbility.getInstance());
// Haste
this.getRightHalfCard().addAbility(HasteAbility.getInstance());
// Camouflage -- {2}: Put a +1/+1 counter on Ultimate Spider-Man. He gains hexproof and becomes colorless until end of turn.
ability = new SimpleActivatedAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new GenericManaCost(2)
);
ability.addEffect(new GainAbilitySourceEffect(
HexproofAbility.getInstance(), Duration.EndOfTurn
).setText("He gains hexproof"));
ability.addEffect(new BecomesColorSourceEffect(
ObjectColor.COLORLESS, Duration.EndOfTurn
).setText("and becomes colorless until end of turn"));
this.getRightHalfCard().addAbility(ability.withFlavorWord("Camouflage"));
// Whenever you attack, double the number of each kind of counter on each Spider and legendary creature you control.
this.getRightHalfCard().addAbility(new AttacksWithCreaturesTriggeredAbility(
new DoubleCounterOnEachPermanentEffect(null, filter), 1
));
}
private MilesMorales(final MilesMorales card) {
super(card);
}
@Override
public MilesMorales copy() {
return new MilesMorales(this);
}
}

View file

@ -4,11 +4,15 @@ import mage.cards.ExpansionSet;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.SetType; import mage.constants.SetType;
import java.util.Arrays;
import java.util.List;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
public final class MarvelsSpiderMan extends ExpansionSet { public final class MarvelsSpiderMan extends ExpansionSet {
private static final List<String> unfinished = Arrays.asList("Eddie Brock", "Gwen Stacy", "Miles Morales", "Norman Osborn", "Peter Parker");
private static final MarvelsSpiderMan instance = new MarvelsSpiderMan(); private static final MarvelsSpiderMan instance = new MarvelsSpiderMan();
public static MarvelsSpiderMan getInstance() { public static MarvelsSpiderMan getInstance() {
@ -62,6 +66,10 @@ public final class MarvelsSpiderMan extends ExpansionSet {
cards.add(new SetCardInfo("Masked Meower", 82, Rarity.COMMON, mage.cards.m.MaskedMeower.class)); cards.add(new SetCardInfo("Masked Meower", 82, Rarity.COMMON, mage.cards.m.MaskedMeower.class));
cards.add(new SetCardInfo("Mechanical Mobster", 168, Rarity.COMMON, mage.cards.m.MechanicalMobster.class)); cards.add(new SetCardInfo("Mechanical Mobster", 168, Rarity.COMMON, mage.cards.m.MechanicalMobster.class));
cards.add(new SetCardInfo("Merciless Enforcers", 58, Rarity.COMMON, mage.cards.m.MercilessEnforcers.class)); cards.add(new SetCardInfo("Merciless Enforcers", 58, Rarity.COMMON, mage.cards.m.MercilessEnforcers.class));
cards.add(new SetCardInfo("Miles Morales", 108, Rarity.MYTHIC, mage.cards.m.MilesMorales.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Miles Morales", 200, Rarity.MYTHIC, mage.cards.m.MilesMorales.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Miles Morales", 211, Rarity.MYTHIC, mage.cards.m.MilesMorales.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Miles Morales", 234, Rarity.MYTHIC, mage.cards.m.MilesMorales.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Mountain", 192, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 192, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Mountain", 197, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 197, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Multiversal Passage", 180, Rarity.RARE, mage.cards.m.MultiversalPassage.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Multiversal Passage", 180, Rarity.RARE, mage.cards.m.MultiversalPassage.class, NON_FULL_USE_VARIOUS));
@ -135,5 +143,7 @@ public final class MarvelsSpiderMan extends ExpansionSet {
cards.add(new SetCardInfo("Whoosh!", 48, Rarity.COMMON, mage.cards.w.Whoosh.class)); cards.add(new SetCardInfo("Whoosh!", 48, Rarity.COMMON, mage.cards.w.Whoosh.class));
cards.add(new SetCardInfo("Wild Pack Squad", 23, Rarity.COMMON, mage.cards.w.WildPackSquad.class)); cards.add(new SetCardInfo("Wild Pack Squad", 23, Rarity.COMMON, mage.cards.w.WildPackSquad.class));
cards.add(new SetCardInfo("With Great Power...", 24, Rarity.RARE, mage.cards.w.WithGreatPower.class)); cards.add(new SetCardInfo("With Great Power...", 24, Rarity.RARE, mage.cards.w.WithGreatPower.class));
cards.removeIf(setCardInfo -> unfinished.contains(setCardInfo.getName()));
} }
} }

View file

@ -4,12 +4,14 @@ package mage.abilities.effects.common.counter;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.counters.Counter;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author Susucr * @author Susucr
@ -23,7 +25,9 @@ public class DoubleCounterOnEachPermanentEffect extends OneShotEffect {
super(Outcome.BoostCreature); super(Outcome.BoostCreature);
this.counterType = counterType; this.counterType = counterType;
this.filter = filter.copy(); this.filter = filter.copy();
this.staticText = "double the number of " + counterType.getName() + " counters on each " + filter.getMessage(); this.staticText = "double the number of " +
(counterType != null ? (counterType.getName() + " counters") : "each kind of counter") +
" on each " + filter.getMessage();
} }
private DoubleCounterOnEachPermanentEffect(final DoubleCounterOnEachPermanentEffect effect) { private DoubleCounterOnEachPermanentEffect(final DoubleCounterOnEachPermanentEffect effect) {
@ -39,8 +43,19 @@ public class DoubleCounterOnEachPermanentEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game); for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
for (Permanent permanent : permanents) { if (counterType == null) {
List<Counter> counters = permanent
.getCounters(game)
.values()
.stream()
.map(Counter::copy)
.collect(Collectors.toList());
for (Counter counter : counters) {
permanent.addCounters(counter, source, game);
}
continue;
}
int existingCounters = permanent.getCounters(game).getCount(counterType); int existingCounters = permanent.getCounters(game).getCount(counterType);
if (existingCounters > 0) { if (existingCounters > 0) {
permanent.addCounters(counterType.createInstance(existingCounters), source.getControllerId(), source, game); permanent.addCounters(counterType.createInstance(existingCounters), source.getControllerId(), source, game);