From 258ce763e59ec9af1d5e0186dfe9cce707ff2a3e Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Wed, 1 Dec 2021 23:30:44 -0500 Subject: [PATCH] Fix #8494 --- Mage.Sets/src/mage/cards/a/AlphaBrawl.java | 23 +++++++++------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AlphaBrawl.java b/Mage.Sets/src/mage/cards/a/AlphaBrawl.java index bdc752290f..ef8cb04aa6 100644 --- a/Mage.Sets/src/mage/cards/a/AlphaBrawl.java +++ b/Mage.Sets/src/mage/cards/a/AlphaBrawl.java @@ -1,4 +1,3 @@ - package mage.cards.a; import java.util.UUID; @@ -8,8 +7,10 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.constants.TargetController; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.PermanentIdPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -21,19 +22,12 @@ import mage.target.common.TargetCreaturePermanent; */ public final class AlphaBrawl extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); - - static { - filter.add(TargetController.OPPONENT.getControllerPredicate()); - } - public AlphaBrawl(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{6}{R}{R}"); - // Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature. this.getSpellAbility().addEffect(new AlphaBrawlEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE)); } @@ -49,8 +43,6 @@ public final class AlphaBrawl extends CardImpl { class AlphaBrawlEffect extends OneShotEffect { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public AlphaBrawlEffect() { super(Outcome.Damage); staticText = "Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature"; @@ -62,7 +54,10 @@ class AlphaBrawlEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent creature = game.getPermanent(source.getFirstTarget()); + UUID targetId = source.getFirstTarget(); + FilterCreaturePermanent filter = new FilterCreaturePermanent("each other creature that player controls"); + filter.add(Predicates.not(new PermanentIdPredicate(targetId))); + Permanent creature = game.getPermanent(targetId); if (creature != null) { Player player = game.getPlayer(creature.getControllerId()); if (player != null) { @@ -84,4 +79,4 @@ class AlphaBrawlEffect extends OneShotEffect { return new AlphaBrawlEffect(this); } -} \ No newline at end of file +}