From 07405fca0fcff4be8d54b68ef7795558889c6c60 Mon Sep 17 00:00:00 2001 From: Cameron Merkel <44722506+Cguy7777@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:10:58 -0600 Subject: [PATCH] [MKM] Implement Pyrotechnic Performer (#11900) --- .../mage/cards/p/PyrotechnicPerformer.java | 86 +++++++++++++++++++ .../src/mage/sets/MurdersAtKarlovManor.java | 4 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/p/PyrotechnicPerformer.java diff --git a/Mage.Sets/src/mage/cards/p/PyrotechnicPerformer.java b/Mage.Sets/src/mage/cards/p/PyrotechnicPerformer.java new file mode 100644 index 00000000000..e4b55c6cc84 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PyrotechnicPerformer.java @@ -0,0 +1,86 @@ +package mage.cards.p; + +import java.util.UUID; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpAllTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.DisguiseAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanentThisOrAnother; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * @author Cguy7777 + */ +public final class PyrotechnicPerformer extends CardImpl { + + private static final FilterPermanentThisOrAnother filter = new FilterPermanentThisOrAnother(StaticFilters.FILTER_CONTROLLED_CREATURE, true); + + public PyrotechnicPerformer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.VIASHINO); + this.subtype.add(SubType.ASSASSIN); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Disguise {R} + this.addAbility(new DisguiseAbility(this, new ManaCostsImpl<>("{R}"))); + + // Whenever Pyrotechnic Performer or another creature you control is turned face up, that creature deals damage equal to its power to each opponent. + this.addAbility(new TurnedFaceUpAllTriggeredAbility(new PyrotechnicPerformerEffect(), filter, true)); + } + + private PyrotechnicPerformer(final PyrotechnicPerformer card) { + super(card); + } + + @Override + public PyrotechnicPerformer copy() { + return new PyrotechnicPerformer(this); + } +} + +class PyrotechnicPerformerEffect extends OneShotEffect { + + PyrotechnicPerformerEffect() { + super(Outcome.Damage); + staticText = "that creature deals damage equal to its power to each opponent"; + } + + private PyrotechnicPerformerEffect(final PyrotechnicPerformerEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent turnedUpCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source); + if (turnedUpCreature == null) { + return false; + } + + for (UUID playerId : game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(playerId); + if (opponent == null) { + continue; + } + opponent.damage(turnedUpCreature.getPower().getValue(), turnedUpCreature.getId(), source, game); + } + return true; + } + + @Override + public PyrotechnicPerformerEffect copy() { + return new PyrotechnicPerformerEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java index 0836a5b63c3..99d125940de 100644 --- a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java +++ b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java @@ -12,7 +12,7 @@ import java.util.List; */ public final class MurdersAtKarlovManor extends ExpansionSet { - private static final List unfinished = Arrays.asList("Aurelia's Vindicator", "Bubble Smuggler", "Coveted Falcon", "Crowd-Control Warden", "Expose the Culprit", "Fugitive Codebreaker", "Lumbering Laundry", "Museum Nightwatch", "Pyrotechnic Performer", "Unyielding Gatekeeper"); + private static final List unfinished = Arrays.asList("Aurelia's Vindicator", "Bubble Smuggler", "Coveted Falcon", "Crowd-Control Warden", "Expose the Culprit", "Fugitive Codebreaker", "Lumbering Laundry", "Museum Nightwatch", "Unyielding Gatekeeper"); private static final MurdersAtKarlovManor instance = new MurdersAtKarlovManor(); @@ -207,6 +207,8 @@ public final class MurdersAtKarlovManor extends ExpansionSet { cards.add(new SetCardInfo("Proft's Eidetic Memory", 67, Rarity.RARE, mage.cards.p.ProftsEideticMemory.class)); cards.add(new SetCardInfo("Public Thoroughfare", 265, Rarity.COMMON, mage.cards.p.PublicThoroughfare.class)); cards.add(new SetCardInfo("Push // Pull", 250, Rarity.UNCOMMON, mage.cards.p.PushPull.class)); + cards.add(new SetCardInfo("Pyrotechnic Performer", 140, Rarity.RARE, mage.cards.p.PyrotechnicPerformer.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Pyrotechnic Performer", 407, Rarity.RARE, mage.cards.p.PyrotechnicPerformer.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Rakdos, Patron of Chaos", 224, Rarity.MYTHIC, mage.cards.r.RakdosPatronOfChaos.class)); cards.add(new SetCardInfo("Rakish Scoundrel", 225, Rarity.COMMON, mage.cards.r.RakishScoundrel.class)); cards.add(new SetCardInfo("Raucous Theater", 266, Rarity.RARE, mage.cards.r.RaucousTheater.class));