From 7ec6f5f57562b2559a496577d62bd3fd7ed9c0ac Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 8 Sep 2020 12:18:58 -0400 Subject: [PATCH] [ZNR] Implemented Agadeem's Awakening / Agadeem, the Undercrypt --- .../mage/cards/a/AgadeemTheUndercrypt.java | 42 +++++++++ .../src/mage/cards/a/AgadeemsAwakening.java | 93 +++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 4 + Utils/mtg-cards-data.txt | 2 + 4 files changed, 141 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AgadeemTheUndercrypt.java create mode 100644 Mage.Sets/src/mage/cards/a/AgadeemsAwakening.java diff --git a/Mage.Sets/src/mage/cards/a/AgadeemTheUndercrypt.java b/Mage.Sets/src/mage/cards/a/AgadeemTheUndercrypt.java new file mode 100644 index 0000000000..7b29c4fee1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AgadeemTheUndercrypt.java @@ -0,0 +1,42 @@ +package mage.cards.a; + +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.common.TapSourceUnlessPaysEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AgadeemTheUndercrypt extends CardImpl { + + public AgadeemTheUndercrypt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.modalDFC = true; + this.nightCard = true; + + // As Agadeem, the Undercrypt enters the battlefield, you may pay 3 life. If you don't, it enters the battlefield tapped. + this.addAbility(new AsEntersBattlefieldAbility( + new TapSourceUnlessPaysEffect(new PayLifeCost(3)), + "you may pay 3 life. If you don't, it enters the battlefield tapped" + )); + + // {T}: Add {B}. + this.addAbility(new BlackManaAbility()); + } + + private AgadeemTheUndercrypt(final AgadeemTheUndercrypt card) { + super(card); + } + + @Override + public AgadeemTheUndercrypt copy() { + return new AgadeemTheUndercrypt(this); + } +} diff --git a/Mage.Sets/src/mage/cards/a/AgadeemsAwakening.java b/Mage.Sets/src/mage/cards/a/AgadeemsAwakening.java new file mode 100644 index 0000000000..27bdac168a --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AgadeemsAwakening.java @@ -0,0 +1,93 @@ +package mage.cards.a; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetadjustment.TargetAdjuster; + +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * @author TheElk801 + */ +public final class AgadeemsAwakening extends CardImpl { + + public AgadeemsAwakening(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{B}{B}"); + + this.modalDFC = true; + this.secondSideCardClazz = mage.cards.a.AgadeemTheUndercrypt.class; + + // Return from your graveyard to the battlefield any number of target creature cards that each have a different converted mana cost X or less. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect().setText( + "return from your graveyard to the battlefield any number of target creature cards " + + "that each have a different converted mana cost X or less" + )); + } + + private AgadeemsAwakening(final AgadeemsAwakening card) { + super(card); + } + + @Override + public AgadeemsAwakening copy() { + return new AgadeemsAwakening(this); + } +} + +enum AgadeemsAwakeningAdjuster implements TargetAdjuster { + instance; + + @Override + public void adjustTargets(Ability ability, Game game) { + ability.getTargets().clear(); + ability.addTarget(new AgadeemsAwakeningTarget(ability.getManaCostsToPay().getX())); + } +} + +class AgadeemsAwakeningTarget extends TargetCardInYourGraveyard { + + private static final FilterCard filter + = new FilterCreatureCard("creature cards that each have a different converted mana cost X or less"); + private final int xValue; + + AgadeemsAwakeningTarget(int xValue) { + super(0, Integer.MAX_VALUE, filter, true); + this.xValue = xValue; + } + + private AgadeemsAwakeningTarget(final AgadeemsAwakeningTarget target) { + super(target); + this.xValue = target.xValue; + } + + @Override + public AgadeemsAwakeningTarget copy() { + return new AgadeemsAwakeningTarget(this); + } + + @Override + public Set possibleTargets(UUID sourceId, UUID playerId, Game game) { + Set possibleTargets = super.possibleTargets(sourceId, playerId, game); + Set cmcs = this.getTargets() + .stream() + .map(game::getCard) + .map(MageObject::getConvertedManaCost) + .collect(Collectors.toSet()); + possibleTargets.removeIf(uuid -> { + Card card = game.getCard(uuid); + return card != null && (cmcs.contains(card.getConvertedManaCost()) || card.getConvertedManaCost() > xValue); + }); + return possibleTargets; + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index a2d7581dbb..ca99fd0492 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -13,6 +13,8 @@ import java.util.List; public final class ZendikarRising extends ExpansionSet { private static final List unfinished = Arrays.asList( + "Agadeem's Awakening", + "Agadeem, the Undercrypt", "Akoum Warrior", "Akoum Teeth", "Bala Ged Recovery", @@ -98,6 +100,8 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Acquisitions Expert", 89, Rarity.UNCOMMON, mage.cards.a.AcquisitionsExpert.class)); cards.add(new SetCardInfo("Adventure Awaits", 177, Rarity.COMMON, mage.cards.a.AdventureAwaits.class)); + cards.add(new SetCardInfo("Agadeem's Awakening", 90, Rarity.MYTHIC, mage.cards.a.AgadeemsAwakening.class)); + cards.add(new SetCardInfo("Agadeem, the Undercrypt", 90, Rarity.MYTHIC, mage.cards.a.AgadeemTheUndercrypt.class)); cards.add(new SetCardInfo("Akoum Hellhound", 133, Rarity.COMMON, mage.cards.a.AkoumHellhound.class)); cards.add(new SetCardInfo("Akoum Teeth", 134, Rarity.UNCOMMON, mage.cards.a.AkoumTeeth.class)); cards.add(new SetCardInfo("Akoum Warrior", 134, Rarity.UNCOMMON, mage.cards.a.AkoumWarrior.class)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 34997b2787..3308f8805c 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -38812,6 +38812,8 @@ Umara Wizard|Zendikar Rising|86|U|{4}{U}|Creature - Merfolk Wizard|4|3|Whenever Windrider Wizard|Zendikar Rising|87|U|{2}{U}|Creature - Human Wizard|2|2|Flying$Whenever you cast an instant, sorcery, or Wizard spell, you may draw a card. If you do, discard a card.| Zulaport Duelist|Zendikar Rising|88|C|{U}|Creature - Human Rogue|1|1|Flash$When Zulaport Duelist enters the battlefield, up to one target creature gets -2/-0 until end of turn. Its controller mills two cards.| Acquisitions Expert|Zendikar Rising|89|U|{1}{B}|Creature - Human Rogue|1|2|When Acquisitions Expert enters the battlefield, target opponent reveals a number of cards from their hand equal to the number of creatures in your party. You choose one of those cards. That player discards that card.| +Agadeem's Awakening|Zendikar Rising|90|M|{X}{B}{B}{B}|Sorcery|||Return from your graveyard to the battlefield any number of target creature cards that each have a different converted mana cost X or less.| +Agadeem, the Undercrypt|Zendikar Rising|90|M||Land|||As Agadeem, the Undercrypt enters the battlefield, you may pay 3 life. If you don't, it enters the battlefield tapped.${T}: Add {B}.| Blackbloom Bog|Zendikar Rising|91|U||Land|||Blackbloom Bog enters the battlefield tapped.${T}: Add {B}.| Blackbloom Rogue|Zendikar Rising|91|U|{2}{B}|Creature - Human Rogue|2|3|Menace$Blackbloom Rogue gets +3/+0 as long as an opponent has eight or more cards in their graveyard.| Blood Beckoning|Zendikar Rising|92|C|{B}|Sorcery|||Kicker {3}$Return target creature card from your graveyard to your hand. If this spell was kicked, instead return two target creature cards from your graveyard to your hand.|