From 0de3fb0cb632f42b42b60b29f455539ec0618248 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 3 May 2023 09:47:44 -0400 Subject: [PATCH] [MAT] Implement Niv-Mizzet, Supreme --- .../src/mage/cards/n/NivMizzetSupreme.java | 81 +++++++++++++++++++ .../sets/MarchOfTheMachineTheAftermath.java | 1 + 2 files changed, 82 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NivMizzetSupreme.java diff --git a/Mage.Sets/src/mage/cards/n/NivMizzetSupreme.java b/Mage.Sets/src/mage/cards/n/NivMizzetSupreme.java new file mode 100644 index 0000000000..df69221a57 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NivMizzetSupreme.java @@ -0,0 +1,81 @@ +package mage.cards.n; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HexproofFromMonocoloredAbility; +import mage.abilities.keyword.JumpStartAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class NivMizzetSupreme extends CardImpl { + + public NivMizzetSupreme(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DRAGON); + this.subtype.add(SubType.AVATAR); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Hexproof from monocolored + this.addAbility(HexproofFromMonocoloredAbility.getInstance()); + + // Each instant and sorcery card in your graveyard that's exactly two colors has jump-start. + this.addAbility(new SimpleStaticAbility(new NivMizzetSupremeEffect())); + } + + private NivMizzetSupreme(final NivMizzetSupreme card) { + super(card); + } + + @Override + public NivMizzetSupreme copy() { + return new NivMizzetSupreme(this); + } +} + +class NivMizzetSupremeEffect extends ContinuousEffectImpl { + NivMizzetSupremeEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "each instant and sorcery card in your graveyard that's exactly two colors has jump-start"; + } + + private NivMizzetSupremeEffect(final NivMizzetSupremeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + for (Card card : controller.getGraveyard().getCards(game)) { + if (card.isInstantOrSorcery(game) && card.getColor(game).getColorCount() == 2) { + game.getState().addOtherAbility(card, new JumpStartAbility(card)); + } + } + return true; + } + + @Override + public NivMizzetSupremeEffect copy() { + return new NivMizzetSupremeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java b/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java index 46169747d2..a171c6fa4f 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java @@ -35,6 +35,7 @@ public final class MarchOfTheMachineTheAftermath extends ExpansionSet { cards.add(new SetCardInfo("Kolaghan Warmonger", 17, Rarity.UNCOMMON, mage.cards.k.KolaghanWarmonger.class)); cards.add(new SetCardInfo("Markov Baron", 14, Rarity.UNCOMMON, mage.cards.m.MarkovBaron.class)); cards.add(new SetCardInfo("Metropolis Reformer", 4, Rarity.RARE, mage.cards.m.MetropolisReformer.class)); + cards.add(new SetCardInfo("Niv-Mizzet, Supreme", 40, Rarity.RARE, mage.cards.n.NivMizzetSupreme.class)); cards.add(new SetCardInfo("Rebuild the City", 43, Rarity.RARE, mage.cards.r.RebuildTheCity.class)); cards.add(new SetCardInfo("Reckless Handling", 19, Rarity.UNCOMMON, mage.cards.r.RecklessHandling.class)); cards.add(new SetCardInfo("Samut, Vizier of Naktamun", 45, Rarity.MYTHIC, mage.cards.s.SamutVizierOfNaktamun.class));