From 19f71ba68332fe4dbcbbbcc298118202d8b62f37 Mon Sep 17 00:00:00 2001 From: Evan Kranzler <theelk801@gmail.com> Date: Thu, 23 Sep 2021 09:16:34 -0400 Subject: [PATCH] [MIC] Implemented Ruinous Intrusion --- .../src/mage/cards/r/RuinousIntrusion.java | 79 +++++++++++++++++++ .../src/mage/sets/MidnightHuntCommander.java | 1 + 2 files changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RuinousIntrusion.java diff --git a/Mage.Sets/src/mage/cards/r/RuinousIntrusion.java b/Mage.Sets/src/mage/cards/r/RuinousIntrusion.java new file mode 100644 index 0000000000..b46997f519 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RuinousIntrusion.java @@ -0,0 +1,79 @@ +package mage.cards.r; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.counters.CounterType; +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 java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RuinousIntrusion extends CardImpl { + + public RuinousIntrusion(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}"); + + // Exile target artifact or enchantment. Put X +1/+1 counters on target creature you control, where X is the mana value of the permanent exiled this way. + this.getSpellAbility().addEffect(new RuinousIntrusionEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT)); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + } + + private RuinousIntrusion(final RuinousIntrusion card) { + super(card); + } + + @Override + public RuinousIntrusion copy() { + return new RuinousIntrusion(this); + } +} + +class RuinousIntrusionEffect extends OneShotEffect { + + RuinousIntrusionEffect() { + super(Outcome.Benefit); + staticText = "exile target artifact or enchantment. Put X +1/+1 counters on target creature you control, " + + "where X is the mana value of the permanent exiled this way"; + } + + private RuinousIntrusionEffect(final RuinousIntrusionEffect effect) { + super(effect); + } + + @Override + public RuinousIntrusionEffect copy() { + return new RuinousIntrusionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (player == null || permanent == null) { + return false; + } + int mv = permanent.getManaValue(); + player.moveCards(permanent, Zone.EXILED, source, game); + if (mv < 1) { + return true; + } + Permanent creature = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + if (creature != null) { + creature.addCounters(CounterType.P1P1.createInstance(mv), source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/MidnightHuntCommander.java b/Mage.Sets/src/mage/sets/MidnightHuntCommander.java index 5460a3e54f..a1dc1677f8 100644 --- a/Mage.Sets/src/mage/sets/MidnightHuntCommander.java +++ b/Mage.Sets/src/mage/sets/MidnightHuntCommander.java @@ -117,6 +117,7 @@ public final class MidnightHuntCommander extends ExpansionSet { cards.add(new SetCardInfo("Riders of Gavony", 93, Rarity.RARE, mage.cards.r.RidersOfGavony.class)); cards.add(new SetCardInfo("Rogue's Passage", 179, Rarity.UNCOMMON, mage.cards.r.RoguesPassage.class)); cards.add(new SetCardInfo("Rooftop Storm", 103, Rarity.RARE, mage.cards.r.RooftopStorm.class)); + cards.add(new SetCardInfo("Ruinous Intrusion", 28, Rarity.RARE, mage.cards.r.RuinousIntrusion.class)); cards.add(new SetCardInfo("Ruthless Deathfang", 154, Rarity.UNCOMMON, mage.cards.r.RuthlessDeathfang.class)); cards.add(new SetCardInfo("Selesnya Sanctuary", 180, Rarity.UNCOMMON, mage.cards.s.SelesnyaSanctuary.class)); cards.add(new SetCardInfo("Shamanic Revelation", 143, Rarity.RARE, mage.cards.s.ShamanicRevelation.class));