[MAT] Implement Spark Rupture

This commit is contained in:
theelk801 2023-05-02 17:42:47 -04:00
parent e8892badf1
commit effc3683da
3 changed files with 123 additions and 0 deletions

View file

@ -0,0 +1,121 @@
package mage.cards.s;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterPlaneswalkerPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SparkRupture extends CardImpl {
public SparkRupture(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
// When Spark Rupture enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
// Each planeswalker with one or more loyalty counters on it loses all abilities and is a creature with power and toughness each equal to the number of loyalty counters on it.
this.addAbility(new SimpleStaticAbility(new SparkRuptureEffect()));
}
private SparkRupture(final SparkRupture card) {
super(card);
}
@Override
public SparkRupture copy() {
return new SparkRupture(this);
}
}
class SparkRuptureEffect extends ContinuousEffectImpl {
private static final FilterPermanent filter = new FilterPlaneswalkerPermanent();
static {
filter.add(CounterType.LOYALTY.getPredicate());
}
SparkRuptureEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
staticText = "each planeswalker with one or more loyalty counters on it loses all abilities " +
"and is a creature with power and toughness each equal to the number of loyalty counters on it";
}
private SparkRuptureEffect(final SparkRuptureEffect effect) {
super(effect);
}
@Override
public SparkRuptureEffect copy() {
return new SparkRuptureEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
switch (layer) {
case TypeChangingEffects_4:
affectedObjectList.clear();
for (Permanent permanent : game.getBattlefield().getActivePermanents(
filter, source.getControllerId(), source, game
)) {
affectedObjectList.add(new MageObjectReference(permanent, game));
permanent.removeAllCardTypes(game);
permanent.addCardType(game, CardType.CREATURE);
}
return true;
case AbilityAddingRemovingEffects_6:
for (MageObjectReference mor : getAffectedObjects()) {
Permanent permanent = mor.getPermanent(game);
if (permanent != null) {
int counters = permanent.getCounters(game).getCount(CounterType.LOYALTY);
permanent.getPower().setModifiedBaseValue(counters);
permanent.getToughness().setModifiedBaseValue(counters);
}
}
return true;
case PTChangingEffects_7:
if (sublayer != SubLayer.SetPT_7b) {
return false;
}
for (MageObjectReference mor : getAffectedObjects()) {
Permanent permanent = mor.getPermanent(game);
if (permanent != null) {
permanent.removeAllAbilities(source.getSourceId(), game);
}
}
return true;
}
return false;
}
@Override
public boolean hasLayer(Layer layer) {
switch (layer) {
case AbilityAddingRemovingEffects_6:
case TypeChangingEffects_4:
case PTChangingEffects_7:
return true;
}
return false;
}
}

View file

@ -22,6 +22,7 @@ public final class MarchOfTheMachineTheAftermath extends ExpansionSet {
this.hasBoosters = false; // temporary this.hasBoosters = false; // temporary
cards.add(new SetCardInfo("Jolrael, Voice of Zhalfir", 33, Rarity.RARE, mage.cards.j.JolraelVoiceOfZhalfir.class)); cards.add(new SetCardInfo("Jolrael, Voice of Zhalfir", 33, Rarity.RARE, mage.cards.j.JolraelVoiceOfZhalfir.class));
cards.add(new SetCardInfo("Spark Rupture", 5, Rarity.RARE, mage.cards.s.SparkRupture.class));
cards.add(new SetCardInfo("The Kenriths' Royal Funeral", 34, Rarity.RARE, mage.cards.t.TheKenrithsRoyalFuneral.class)); cards.add(new SetCardInfo("The Kenriths' Royal Funeral", 34, Rarity.RARE, mage.cards.t.TheKenrithsRoyalFuneral.class));
} }
} }

View file

@ -48767,6 +48767,7 @@ Vineglimmer Snarl|March of the Machine Commander|444|R||Land|||As Vineglimmer Sn
Goro-Goro and Satoru|March of the Machine Commander|445|M|{U}{B}{R}|Legendary Creature - Goblin Human|3|4|Whenever one or more creatures you control that entered the battlefield this turn deal combat damage to a player, create a 5/5 red Dragon Spirit creature token with flying.${1}{R}: Creatures you control gain haste until end of turn.| Goro-Goro and Satoru|March of the Machine Commander|445|M|{U}{B}{R}|Legendary Creature - Goblin Human|3|4|Whenever one or more creatures you control that entered the battlefield this turn deal combat damage to a player, create a 5/5 red Dragon Spirit creature token with flying.${1}{R}: Creatures you control gain haste until end of turn.|
Katilda and Lier|March of the Machine Commander|446|M|{G}{W}{U}|Legendary Creature - Human|3|3|Whenever you cast a Human spell, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost.| Katilda and Lier|March of the Machine Commander|446|M|{G}{W}{U}|Legendary Creature - Human|3|3|Whenever you cast a Human spell, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost.|
Slimefoot and Squee|March of the Machine Commander|447|M|{B}{R}{G}|Legendary Creature - Fungus Goblin|3|3|Whenever Slimefoot and Squee enters the battlefield or attacks, create a 1/1 green Saproling creature token.${1}{B}{R}{G}, Sacrifice a Saproling: Return Slimefoot and Squee and up to one other target creature card from your graveyard to the battlefield. Activate only as a sorcery.| Slimefoot and Squee|March of the Machine Commander|447|M|{B}{R}{G}|Legendary Creature - Fungus Goblin|3|3|Whenever Slimefoot and Squee enters the battlefield or attacks, create a 1/1 green Saproling creature token.${1}{B}{R}{G}, Sacrifice a Saproling: Return Slimefoot and Squee and up to one other target creature card from your graveyard to the battlefield. Activate only as a sorcery.|
Spark Rupture|March of the Machine: The Aftermath|5|R|{2}{W}|Enchantment|||When Spark Rupture enters the battlefield, draw a card.$Each planeswalker with one or more loyalty counters on it loses all abilities and is a creature with power and toughness each equal to the number of loyalty counters on it.|
Jolrael, Voice of Zhalfir|March of the Machine: The Aftermath|33|R|{2}{G}{U}|Legendary Creature - Human Druid|3|3|At the beginning of combat on your turn, up to one target land you control becomes an X/X green and blue Bird creature with flying and haste until end of turn, where X is the number of cards in your hand. It's still a land.$Whenever a land creature you control deals combat damage to a player, draw a card.| Jolrael, Voice of Zhalfir|March of the Machine: The Aftermath|33|R|{2}{G}{U}|Legendary Creature - Human Druid|3|3|At the beginning of combat on your turn, up to one target land you control becomes an X/X green and blue Bird creature with flying and haste until end of turn, where X is the number of cards in your hand. It's still a land.$Whenever a land creature you control deals combat damage to a player, draw a card.|
The Kenriths' Royal Funeral|March of the Machine: The Aftermath|34|R|{2}{W}{B}|Legendary Enchantment|||When The Kenriths' Royal Funeral enters the battlefield, exile up to two target legendary creature cards from your graveyard. You draw X cards and you lose X life, where X is the greatest mana value among cards exiled this way.$Legendary spells you cast cost {1} less to cast for each card exiled with The Kenriths' Royal Funeral.| The Kenriths' Royal Funeral|March of the Machine: The Aftermath|34|R|{2}{W}{B}|Legendary Enchantment|||When The Kenriths' Royal Funeral enters the battlefield, exile up to two target legendary creature cards from your graveyard. You draw X cards and you lose X life, where X is the greatest mana value among cards exiled this way.$Legendary spells you cast cost {1} less to cast for each card exiled with The Kenriths' Royal Funeral.|
Frodo, Sauron's Bane|The Lord of the Rings: Tales of Middle-earth|18|R|{W}|Legendary Creature - Halfling Citizen|1|2|{W/B}{W/B}: If Frodo, Sauron's Bane is a Citizen, it becomes a Halfling Scout with base power and toughness 2/3 and lifelink.${B}{B}{B}: If Frodo is a Scout, it becomes a Halfling Rogue with "Whenever this creature deals combat damage to a player, that player loses the game if the Ring has tempted you four or more times this game. Otherwise, the Ring tempts you."| Frodo, Sauron's Bane|The Lord of the Rings: Tales of Middle-earth|18|R|{W}|Legendary Creature - Halfling Citizen|1|2|{W/B}{W/B}: If Frodo, Sauron's Bane is a Citizen, it becomes a Halfling Scout with base power and toughness 2/3 and lifelink.${B}{B}{B}: If Frodo is a Scout, it becomes a Halfling Rogue with "Whenever this creature deals combat damage to a player, that player loses the game if the Ring has tempted you four or more times this game. Otherwise, the Ring tempts you."|