From 64e7deab818095dc12198e310ed309c21447d2cb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 16 Jun 2018 22:04:08 -0400 Subject: [PATCH] Implemented Nicol Bolas, the Ravager/Nicol Bolas, the Arisen --- .../src/mage/cards/n/NicolBolasTheArisen.java | 110 ++++++++++++++++++ .../mage/cards/n/NicolBolasTheRavager.java | 63 ++++++++++ Mage.Sets/src/mage/sets/CoreSet2019.java | 2 + 3 files changed, 175 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java create mode 100644 Mage.Sets/src/mage/cards/n/NicolBolasTheRavager.java diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java b/Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java new file mode 100644 index 00000000000..825c0d5c41c --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NicolBolasTheArisen.java @@ -0,0 +1,110 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCreatureOrPlaneswalker; + +/** + * + * @author TheElk801 + */ +public final class NicolBolasTheArisen extends CardImpl { + + private static final FilterCard filter = new FilterCard("creature or planeswalker card from a graveyard"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.PLANESWALKER) + )); + } + + public NicolBolasTheArisen(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, ""); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.BOLAS); + + this.color.setBlue(true); + this.color.setBlack(true); + this.color.setRed(true); + this.nightCard = true; + this.transformable = true; + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7)); + + // +2: Draw two cards. + this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(2), 2)); + + // −3: Nicol Bolas, the Arisen deals 10 damage to target creature or planeswalker. + Ability ability = new LoyaltyAbility(new DamageTargetEffect(10), -3); + ability.addTarget(new TargetCreatureOrPlaneswalker()); + this.addAbility(ability); + + // −4: Put target creature or planeswalker card from a graveyard onto the battlefield under your control. + ability = new LoyaltyAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), -4); + ability.addTarget(new TargetCardInGraveyard(filter)); + this.addAbility(ability); + + // −12: Exile all but the bottom card of target player's library. + ability = new LoyaltyAbility(new NicolBolasTheArisenEffect(), -12); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public NicolBolasTheArisen(final NicolBolasTheArisen card) { + super(card); + } + + @Override + public NicolBolasTheArisen copy() { + return new NicolBolasTheArisen(this); + } +} + +class NicolBolasTheArisenEffect extends OneShotEffect { + + public NicolBolasTheArisenEffect() { + super(Outcome.Benefit); + this.staticText = "Exile all but the bottom card of target player's library."; + } + + public NicolBolasTheArisenEffect(final NicolBolasTheArisenEffect effect) { + super(effect); + } + + @Override + public NicolBolasTheArisenEffect copy() { + return new NicolBolasTheArisenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + Player controller = game.getPlayer(source.getControllerId()); + if (targetPlayer == null || controller == null) { + return false; + } + return controller.moveCards(targetPlayer.getLibrary().getTopCards(game, targetPlayer.getLibrary().size() - 1), Zone.EXILED, source, game); + } +} diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasTheRavager.java b/Mage.Sets/src/mage/cards/n/NicolBolasTheRavager.java new file mode 100644 index 00000000000..b6c5f0efd2e --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NicolBolasTheRavager.java @@ -0,0 +1,63 @@ +package mage.cards.n; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Gender; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author TheElk801 + */ +public final class NicolBolasTheRavager extends CardImpl { + + public NicolBolasTheRavager(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.ELDER); + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + this.transformable = true; + this.secondSideCardClazz = NicolBolasTheArisen.class; + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Nicol Bolas, the Ravager enters the battlefield, each opponent discards a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect(new StaticValue(1), false, TargetController.OPPONENT))); + + // {4}{U}{B}{R}: Exile Nicol Bolas, the Ravager, then return him to the battlefield transformed under his owner's control. Activate this ability only any time you could cast a sorcerry. + this.addAbility(new TransformAbility()); + this.addAbility(new ActivateAsSorceryActivatedAbility( + Zone.BATTLEFIELD, + new ExileAndReturnTransformedSourceEffect(Gender.MALE), + new ManaCostsImpl("{4}{U}{B}{R}") + )); + } + + public NicolBolasTheRavager(final NicolBolasTheRavager card) { + super(card); + } + + @Override + public NicolBolasTheRavager copy() { + return new NicolBolasTheRavager(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 5a6a84e1d73..8651ae4538e 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -102,6 +102,8 @@ public final class CoreSet2019 extends ExpansionSet { cards.add(new SetCardInfo("Mist-Cloaked Herald", 310, Rarity.COMMON, mage.cards.m.MistCloakedHerald.class)); cards.add(new SetCardInfo("Murder", 110, Rarity.UNCOMMON, mage.cards.m.Murder.class)); cards.add(new SetCardInfo("Nexus of Fate", 306, Rarity.MYTHIC, mage.cards.n.NexusOfFate.class)); + cards.add(new SetCardInfo("Nicol Bolas, the Arisen", 218, Rarity.MYTHIC, mage.cards.n.NicolBolasTheArisen.class)); + cards.add(new SetCardInfo("Nicol Bolas, the Ravager", 218, Rarity.MYTHIC, mage.cards.n.NicolBolasTheRavager.class)); cards.add(new SetCardInfo("Oakenform", 191, Rarity.COMMON, mage.cards.o.Oakenform.class)); cards.add(new SetCardInfo("Omenspeaker", 64, Rarity.COMMON, mage.cards.o.Omenspeaker.class)); cards.add(new SetCardInfo("Onakke Ogre", 153, Rarity.COMMON, mage.cards.o.OnakkeOgre.class));