From 9ad7c4c83d56b6acbbf014fb87b7c6cef36034e9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 24 Apr 2019 12:54:40 -0400 Subject: [PATCH] fixed Niv-Mizzet Reborn allowing players to select cards that aren't exactly two colors --- .../src/mage/cards/n/NivMizzetReborn.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/NivMizzetReborn.java b/Mage.Sets/src/mage/cards/n/NivMizzetReborn.java index 761aac8740..2e034d4878 100644 --- a/Mage.Sets/src/mage/cards/n/NivMizzetReborn.java +++ b/Mage.Sets/src/mage/cards/n/NivMizzetReborn.java @@ -75,11 +75,18 @@ class NivMizzetRebornEffect extends OneShotEffect { this.color2 = color2; } - private TargetCard getTarget() { + private FilterCard makeFilter() { FilterCard filter = new FilterCard(getDescription()); - filter.add(new ColorPredicate(new ObjectColor(color1 + color2))); - filter.add(Predicates.not(new ColorPredicate(new ObjectColor(getOtherColors())))); - return new TargetCardInLibrary(filter); + filter.add(new ColorPredicate(new ObjectColor(color1))); + filter.add(new ColorPredicate(new ObjectColor(color2))); + for (char c : getOtherColors().toCharArray()) { + filter.add(Predicates.not(new ColorPredicate(new ObjectColor("" + c)))); + } + return filter; + } + + private TargetCard getTarget() { + return new TargetCardInLibrary(makeFilter()); } private String getDescription() { @@ -99,9 +106,7 @@ class NivMizzetRebornEffect extends OneShotEffect { } private boolean isInCards(Cards cards, Game game) { - FilterCard filter = new FilterCard(getDescription()); - filter.add(new ColorPredicate(new ObjectColor(color1 + color2))); - filter.add(Predicates.not(new ColorPredicate(new ObjectColor(getOtherColors())))); + FilterCard filter = makeFilter(); return cards.getCards(game).stream().anyMatch(card -> filter.match(card, game)); } }