From 65af9459a3a2fd89200de3a0891561b158098ae2 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 6 Sep 2021 20:23:48 -0400 Subject: [PATCH] [MID] Implemented Tainted Adversary --- .../src/mage/cards/t/TaintedAdversary.java | 103 ++++++++++++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 1 + Utils/mtg-cards-data.txt | 1 + 3 files changed, 105 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TaintedAdversary.java diff --git a/Mage.Sets/src/mage/cards/t/TaintedAdversary.java b/Mage.Sets/src/mage/cards/t/TaintedAdversary.java new file mode 100644 index 0000000000..081a5f9c84 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TaintedAdversary.java @@ -0,0 +1,103 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.token.ZombieDecayedToken; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TaintedAdversary extends CardImpl { + + public TaintedAdversary(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); + + this.subtype.add(SubType.ZOMBIE); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // When Tainted Adversary enters the battlefield, you may pay {2}{B} any number of times. When you pay this cost one or more times, put that many +1/+1 counters on Tainted Adversary, then create twice that many black 2/2 Zombie creature tokens with decayed. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TaintedAdversaryEffect())); + } + + private TaintedAdversary(final TaintedAdversary card) { + super(card); + } + + @Override + public TaintedAdversary copy() { + return new TaintedAdversary(this); + } +} + +class TaintedAdversaryEffect extends OneShotEffect { + + TaintedAdversaryEffect() { + super(Outcome.Benefit); + staticText = "you may pay {2}{B} any number of times. When you pay this cost " + + "one or more times, put that many +1/+1 counters on {this}, " + + "then create twice that many black 2/2 Zombie creature tokens with decayed"; + } + + private TaintedAdversaryEffect(final TaintedAdversaryEffect effect) { + super(effect); + } + + @Override + public TaintedAdversaryEffect copy() { + return new TaintedAdversaryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cost cost = new ManaCostsImpl<>("{2}{B}"); + int amount = 0; + while (player.canRespond()) { + cost.clearPaid(); + if (cost.canPay(source, source, source.getControllerId(), game) + && player.chooseUse( + outcome, "Pay {2}{B}? You have paid this cost " + + amount + " time" + (amount != 1 ? "s" : ""), source, game + ) && cost.pay(source, game, source, source.getControllerId(), false)) { + amount++; + } + break; + } + if (amount == 0) { + return false; + } + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)), + false, "put that many +1/+1 counters on {this}, then create " + + "twice that many black 2/2 Zombie creature tokens with decayed" + ); + ability.addEffect(new CreateTokenEffect(new ZombieDecayedToken(), 2 * amount)); + game.fireReflexiveTriggeredAbility(ability, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index b14853f363..cce260f8f5 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -88,6 +88,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Stormrider Spirit", 79, Rarity.COMMON, mage.cards.s.StormriderSpirit.class)); cards.add(new SetCardInfo("Sungold Barrage", 36, Rarity.COMMON, mage.cards.s.SungoldBarrage.class)); cards.add(new SetCardInfo("Swamp", 272, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); + cards.add(new SetCardInfo("Tainted Adversary", 124, Rarity.MYTHIC, mage.cards.t.TaintedAdversary.class)); cards.add(new SetCardInfo("Tavern Ruffian", 163, Rarity.COMMON, mage.cards.t.TavernRuffian.class)); cards.add(new SetCardInfo("Tavern Smasher", 163, Rarity.COMMON, mage.cards.t.TavernSmasher.class)); cards.add(new SetCardInfo("Thermo-Alchemist", 164, Rarity.UNCOMMON, mage.cards.t.ThermoAlchemist.class)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index b88e3458e5..bf85bb6767 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -42208,6 +42208,7 @@ Graveyard Glutton|Innistrad: Midnight Hunt|104|R||Creature - Werewolf|4|4|Ward Hobbling Zombie|Innistrad: Midnight Hunt|106|C|{2}{B}|Creature - Zombie|2|2|Deathtouch$When Hobbling Zombie dies, create a 2/2 black Zombie creature with decayed.| Infernal Grasp|Innistrad: Midnight Hunt|107|U|{1}{B}|Instant|||Destroy target creature. You lose 2 life.| Jadar, Ghoulcaller of Nephalia|Innistrad: Midnight Hunt|108|R|{1}{B}|Legendary Creature - Human Wizard|1|1|At the beginning of your end step, if you control no creatures with decayed, create a 2/2 black Zombie creature token with decayed.| +Tainted Adversary|Innistrad: Midnight Hunt|124|M|{1}{B}|Creature - Zombie|2|3|Deathtouch$When Tainted Adversary enters the battlefield, you may pay {2}{B} any number of times. When you pay this cost one or more times, put that many +1/+1 counters on Tainted Adversary, then create twice that many black 2/2 Zombie creature tokens with decayed.| Brimstone Vandal|Innistrad: Midnight Hunt|130|C|{2}{R}|Creature - Devil|2|3|Menace$If it's neither day nor night, it becomes day as Brimstone Vandal enters the battlefield.$Whenever day becomes night or night becomes day, Brimstone Vandal deals 1 damage to each opponent.| Curse of Shaken Faith|Innistrad: Midnight Hunt|134|R|{1}{R}|Enchantment - Aura Curse|||Enchant player$Whenever enchanted player casts a spell other than the first spell they cast each turn or copies a spell, Curse of Shaken Faith deals 2 damage to them.| Famished Foragers|Innistrad: Midnight Hunt|138|C|{3}{R}|Creature - Vampire|4|3|When Famished Foragers enters the battlefield, if an opponent lost life this turn, add {R}{R}{R}.${2}{R}, Discard a card: Draw a card.|