From d3439c8af900c4b1110af43dc3f7419912884285 Mon Sep 17 00:00:00 2001 From: Cameron Merkel <44722506+Cguy7777@users.noreply.github.com> Date: Sat, 30 Nov 2024 11:46:42 -0600 Subject: [PATCH] [DSK] Implement Meathook Massacre II (#13085) --- .../src/mage/cards/m/MeathookMassacreII.java | 114 ++++++++++++++++++ .../src/mage/sets/DuskmournHouseOfHorror.java | 3 + 2 files changed, 117 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MeathookMassacreII.java diff --git a/Mage.Sets/src/mage/cards/m/MeathookMassacreII.java b/Mage.Sets/src/mage/cards/m/MeathookMassacreII.java new file mode 100644 index 000000000000..c26dab23580f --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MeathookMassacreII.java @@ -0,0 +1,114 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldWithCounterTargetEffect; +import mage.abilities.effects.common.SacrificeAllEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SuperType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author Cguy7777 + */ +public final class MeathookMassacreII extends CardImpl { + + public MeathookMassacreII(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{X}{X}{B}{B}{B}{B}"); + + this.supertype.add(SuperType.LEGENDARY); + + // When Meathook Massacre II enters, each player sacrifices X creatures of their choice. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new SacrificeAllEffect(GetXValue.instance, StaticFilters.FILTER_PERMANENT_CREATURES))); + + // Whenever a creature you control dies, you may pay 3 life. + // If you do, return that card under your control with a finality counter on it. + this.addAbility(new DiesCreatureTriggeredAbility( + new DoIfCostPaid( + new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect( + CounterType.FINALITY.createInstance()) + .setText("return that card under your control with a finality counter on it"), + new PayLifeCost(3)), + false, + StaticFilters.FILTER_CONTROLLED_A_CREATURE, + true)); + + // Whenever a creature an opponent controls dies, they may pay 3 life. + // If they don't, return that card under your control with a finality counter on it. + this.addAbility(new DiesCreatureTriggeredAbility( + new MeathookMassacreIIEffect(), + false, + StaticFilters.FILTER_OPPONENTS_PERMANENT_A_CREATURE, + true)); + } + + private MeathookMassacreII(final MeathookMassacreII card) { + super(card); + } + + @Override + public MeathookMassacreII copy() { + return new MeathookMassacreII(this); + } +} + +class MeathookMassacreIIEffect extends OneShotEffect { + + MeathookMassacreIIEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "they may pay 3 life. " + + "If they don't, return that card under your control with a finality counter on it"; + } + + private MeathookMassacreIIEffect(final MeathookMassacreIIEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = getTargetPointer().getControllerOfFirstTargetOrLKI(game, source); + if (player == null) { + return false; + } + + // Whenever a creature an opponent controls dies, they may pay 3 life. + // If they don't, return that card under your control with a finality counter on it. + Cost cost = new PayLifeCost(3); + if (player.chooseUse(Outcome.Detriment, "Pay 3 life to prevent this effect?", source, game) + && cost.pay(source, game, source, player.getId(), true)) { + return true; + } + + // If a token died, card will be null and nothing will be returned to the battlefield + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (card == null) { + return true; + } + new ReturnFromGraveyardToBattlefieldWithCounterTargetEffect(CounterType.FINALITY.createInstance()) + .setTargetPointer(new FixedTarget(card, game)) + .apply(game, source); + return true; + } + + @Override + public MeathookMassacreIIEffect copy() { + return new MeathookMassacreIIEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index 54a0d029ed08..0cb39c400999 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -148,6 +148,9 @@ private DuskmournHouseOfHorror() { cards.add(new SetCardInfo("Manifest Dread", 189, Rarity.COMMON, mage.cards.m.ManifestDread.class)); cards.add(new SetCardInfo("Marina Vendrell's Grimoire", 64, Rarity.RARE, mage.cards.m.MarinaVendrellsGrimoire.class)); cards.add(new SetCardInfo("Marvin, Murderous Mimic", 253, Rarity.RARE, mage.cards.m.MarvinMurderousMimic.class)); + cards.add(new SetCardInfo("Meathook Massacre II", 108, Rarity.MYTHIC, mage.cards.m.MeathookMassacreII.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Meathook Massacre II", 293, Rarity.MYTHIC, mage.cards.m.MeathookMassacreII.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Meathook Massacre II", 311, Rarity.MYTHIC, mage.cards.m.MeathookMassacreII.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Miasma Demon", 109, Rarity.UNCOMMON, mage.cards.m.MiasmaDemon.class)); cards.add(new SetCardInfo("Midnight Mayhem", 222, Rarity.UNCOMMON, mage.cards.m.MidnightMayhem.class)); cards.add(new SetCardInfo("Most Valuable Slayer", 144, Rarity.COMMON, mage.cards.m.MostValuableSlayer.class));