From 40f2a1031a51bc5ece9af3d6db9b0a18b14642f6 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 31 May 2022 21:41:34 -0400 Subject: [PATCH] [CLB] Implemented Spectacular Showdown --- .../src/mage/cards/s/SpectacularShowdown.java | 117 ++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SpectacularShowdown.java diff --git a/Mage.Sets/src/mage/cards/s/SpectacularShowdown.java b/Mage.Sets/src/mage/cards/s/SpectacularShowdown.java new file mode 100644 index 0000000000..8793f202a7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SpectacularShowdown.java @@ -0,0 +1,117 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.combat.GoadTargetEffect; +import mage.abilities.keyword.OverloadAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; +import mage.target.targetpointer.FixedTargets; + +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * @author TheElk801 + */ +public final class SpectacularShowdown extends CardImpl { + + public SpectacularShowdown(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}"); + + // Put a double strike counter on target creature, then goad each creature that had a double strike counter put on it this way. + this.getSpellAbility().addEffect(new SpectacularShowdownEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Overload {4}{R}{R}{R} + this.addAbility(new OverloadAbility( + this, new SpectacularShowdownOverloadEffect(), + new ManaCostsImpl<>("{4}{R}{R}{R}") + )); + } + + private SpectacularShowdown(final SpectacularShowdown card) { + super(card); + } + + @Override + public SpectacularShowdown copy() { + return new SpectacularShowdown(this); + } +} + +class SpectacularShowdownEffect extends OneShotEffect { + + SpectacularShowdownEffect() { + super(Outcome.Benefit); + staticText = "put a double strike counter on target creature, " + + "then goad each creature that had a double strike counter put on it this way"; + } + + private SpectacularShowdownEffect(final SpectacularShowdownEffect effect) { + super(effect); + } + + @Override + public SpectacularShowdownEffect copy() { + return new SpectacularShowdownEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent == null || !permanent.addCounters( + CounterType.DOUBLE_STRIKE.createInstance(), source, game + )) { + return false; + } + game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTarget(permanent, game)), source); + return true; + } +} + +class SpectacularShowdownOverloadEffect extends OneShotEffect { + + SpectacularShowdownOverloadEffect() { + super(Outcome.Benefit); + } + + private SpectacularShowdownOverloadEffect(final SpectacularShowdownOverloadEffect effect) { + super(effect); + } + + @Override + public SpectacularShowdownOverloadEffect copy() { + return new SpectacularShowdownOverloadEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + List permanents = game + .getBattlefield() + .getActivePermanents( + StaticFilters.FILTER_PERMANENT_CREATURE, + source.getControllerId(), source, game + ) + .stream() + .filter(permanent -> permanent.addCounters( + CounterType.DOUBLE_STRIKE.createInstance(), source, game + )) + .collect(Collectors.toList()); + if (permanents.isEmpty()) { + return false; + } + game.addEffect(new GoadTargetEffect().setTargetPointer(new FixedTargets(permanents, game)), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 4c9f42c5b8..9cfbd84d69 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -269,6 +269,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Skullwinder", 256, Rarity.UNCOMMON, mage.cards.s.Skullwinder.class)); cards.add(new SetCardInfo("Sky Diamond", 337, Rarity.COMMON, mage.cards.s.SkyDiamond.class)); cards.add(new SetCardInfo("Slaughter the Strong", 43, Rarity.UNCOMMON, mage.cards.s.SlaughterTheStrong.class)); + cards.add(new SetCardInfo("Spectacular Showdown", 679, Rarity.RARE, mage.cards.s.SpectacularShowdown.class)); cards.add(new SetCardInfo("Spire Garden", 361, Rarity.RARE, mage.cards.s.SpireGarden.class)); cards.add(new SetCardInfo("Steadfast Unicorn", 44, Rarity.COMMON, mage.cards.s.SteadfastUnicorn.class)); cards.add(new SetCardInfo("Stirge", 150, Rarity.COMMON, mage.cards.s.Stirge.class));