From 668808a7d59858a34f8d62d2fa607299e26e5954 Mon Sep 17 00:00:00 2001 From: Cameron Merkel <44722506+Cguy7777@users.noreply.github.com> Date: Thu, 6 Jun 2024 18:23:24 -0500 Subject: [PATCH] [M3C] Implement Aggressive Biomancy (#12401) --- .../src/mage/cards/a/AggressiveBiomancy.java | 85 +++++++++++++++++++ .../mage/sets/ModernHorizons3Commander.java | 2 + 2 files changed, 87 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AggressiveBiomancy.java diff --git a/Mage.Sets/src/mage/cards/a/AggressiveBiomancy.java b/Mage.Sets/src/mage/cards/a/AggressiveBiomancy.java new file mode 100644 index 00000000000..a6ae3f6726c --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AggressiveBiomancy.java @@ -0,0 +1,85 @@ +package mage.cards.a; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.effects.common.FightTargetSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * @author Cguy7777 + */ +public final class AggressiveBiomancy extends CardImpl { + + public AggressiveBiomancy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{G}{U}"); + + // Create X tokens that are copies of target creature you control, except they have + // "When this creature enters the battlefield, it fights up to one target creature you don't control." + this.getSpellAbility().addEffect(new AggressiveBiomancyEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + } + + private AggressiveBiomancy(final AggressiveBiomancy card) { + super(card); + } + + @Override + public AggressiveBiomancy copy() { + return new AggressiveBiomancy(this); + } +} + +class AggressiveBiomancyEffect extends OneShotEffect { + + AggressiveBiomancyEffect() { + super(Outcome.Copy); + this.staticText = "Create X tokens that are copies of target creature you control, " + + "except they have \"When this creature enters the battlefield, " + + "it fights up to one target creature you don't control.\""; + } + + private AggressiveBiomancyEffect(final AggressiveBiomancyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent creatureToCopy = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); + if (controller == null || creatureToCopy == null) { + return false; + } + + Ability fightAbility = new EntersBattlefieldTriggeredAbility( + new FightTargetSourceEffect().setText("it fights up to one target creature you don't control")); + fightAbility.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); + + CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect( + source.getControllerId(), + null, + false, + source.getManaCostsToPay().getX()); + effect.addAdditionalAbilities(fightAbility); + effect.setTargetPointer(new FixedTarget(creatureToCopy, game)); + return effect.apply(game, source); + } + + @Override + public AggressiveBiomancyEffect copy() { + return new AggressiveBiomancyEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java b/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java index f8987ed68a6..05eef45af75 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons3Commander.java @@ -29,6 +29,8 @@ public final class ModernHorizons3Commander extends ExpansionSet { cards.add(new SetCardInfo("Aetherstorm Roc", 164, Rarity.RARE, mage.cards.a.AetherstormRoc.class)); cards.add(new SetCardInfo("Aethertide Whale", 175, Rarity.RARE, mage.cards.a.AethertideWhale.class)); cards.add(new SetCardInfo("Aetherworks Marvel", 281, Rarity.MYTHIC, mage.cards.a.AetherworksMarvel.class)); + cards.add(new SetCardInfo("Aggressive Biomancy", 69, Rarity.RARE, mage.cards.a.AggressiveBiomancy.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Aggressive Biomancy", 121, Rarity.RARE, mage.cards.a.AggressiveBiomancy.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Akroma's Will", 165, Rarity.RARE, mage.cards.a.AkromasWill.class)); cards.add(new SetCardInfo("All Is Dust", 152, Rarity.MYTHIC, mage.cards.a.AllIsDust.class)); cards.add(new SetCardInfo("Altar of the Goyf", 282, Rarity.UNCOMMON, mage.cards.a.AltarOfTheGoyf.class));