From 86ae40acfea3828343ec80aefec65466da853e4c Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Fri, 10 Sep 2021 18:49:47 -0500 Subject: [PATCH] [MID] Primal Adversary --- .../src/mage/cards/p/PrimalAdversary.java | 114 ++++++++++++++++++ .../src/mage/sets/InnistradMidnightHunt.java | 1 + 2 files changed, 115 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PrimalAdversary.java diff --git a/Mage.Sets/src/mage/cards/p/PrimalAdversary.java b/Mage.Sets/src/mage/cards/p/PrimalAdversary.java new file mode 100644 index 0000000000..9fec1f83c1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PrimalAdversary.java @@ -0,0 +1,114 @@ +package mage.cards.p; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfAnyNumberCostPaid; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.token.TokenImpl; +import mage.target.TargetPermanent; + +/** + * + * @author weirddan455 + */ +public final class PrimalAdversary extends CardImpl { + + public PrimalAdversary(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.WOLF); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // When Primal Adversary enters the battlefield, you may pay {1}{G} any number of times. + // When you pay this cost one or more times, put that many +1/+1 counters on Primal Adversary, + // then up to that many target lands you control become 3/3 Wolf creatures with haste that are still lands. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DoIfAnyNumberCostPaid( + new PrimalAdversaryEffect(), new ManaCostsImpl<>("{1}{G}") + ))); + } + + private PrimalAdversary(final PrimalAdversary card) { + super(card); + } + + @Override + public PrimalAdversary copy() { + return new PrimalAdversary(this); + } +} + +class PrimalAdversaryEffect extends OneShotEffect { + + public PrimalAdversaryEffect() { + super(Outcome.Benefit); + staticText = "put that many +1/+1 counters on Primal Adversary, " + + "then up to that many target lands you control become 3/3 Wolf creatures with haste that are still lands"; + } + + private PrimalAdversaryEffect(final PrimalAdversaryEffect effect) { + super(effect); + } + + @Override + public PrimalAdversaryEffect copy() { + return new PrimalAdversaryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Integer timesPaid = (Integer) getValue("timesPaid"); + if (timesPaid == null || timesPaid <= 0) { + return false; + } + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(timesPaid)), + false, staticText + ); + ability.addEffect(new BecomesCreatureTargetEffect(new PrimalAdversaryToken(), false, true, Duration.Custom)); + ability.addTarget(new TargetPermanent(0, timesPaid, StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS)); + game.fireReflexiveTriggeredAbility(ability, source); + return true; + } +} + +class PrimalAdversaryToken extends TokenImpl { + + public PrimalAdversaryToken() { + super("", "3/3 Wolf creature with haste that's still a land"); + this.cardType.add(CardType.CREATURE); + this.subtype.add(SubType.WOLF); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + this.addAbility(HasteAbility.getInstance()); + } + + private PrimalAdversaryToken(final PrimalAdversaryToken token) { + super(token); + } + + @Override + public PrimalAdversaryToken copy() { + return new PrimalAdversaryToken(this); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index c83f186362..44e424b406 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -146,6 +146,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { cards.add(new SetCardInfo("Play with Fire", 154, Rarity.UNCOMMON, mage.cards.p.PlayWithFire.class)); cards.add(new SetCardInfo("Poppet Factory", 71, Rarity.MYTHIC, mage.cards.p.PoppetFactory.class)); cards.add(new SetCardInfo("Poppet Stitcher", 71, Rarity.MYTHIC, mage.cards.p.PoppetStitcher.class)); + cards.add(new SetCardInfo("Primal Adversary", 194, Rarity.MYTHIC, mage.cards.p.PrimalAdversary.class)); cards.add(new SetCardInfo("Reckless Stormseeker", 157, Rarity.RARE, mage.cards.r.RecklessStormseeker.class)); cards.add(new SetCardInfo("Rite of Harmony", 236, Rarity.RARE, mage.cards.r.RiteOfHarmony.class)); cards.add(new SetCardInfo("Ritual Guardian", 30, Rarity.COMMON, mage.cards.r.RitualGuardian.class));