From c6d7561e80249f7fd82c19f79f11eb65063e8d57 Mon Sep 17 00:00:00 2001 From: Agetian Date: Mon, 8 Jun 2015 12:40:57 +0000 Subject: [PATCH] - When filtering out all colors and multicolor cands, make sure to show all lands (because they are all colorless cards, relying on color identity here is counter-intuitive). --- forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java b/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java index 44fb6f27149..c0497e369af 100644 --- a/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java +++ b/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java @@ -165,9 +165,10 @@ public class SFilterUtil { public boolean apply(PaperCard card) { CardRules rules = card.getRules(); ColorSet color = rules.getColor(); + boolean allColorsFilteredOut = colors == 0; //use color identity for lands, which allows filtering to just lands that can be played in your deck - boolean useColorIdentity = rules.getType().isLand(); + boolean useColorIdentity = rules.getType().isLand() && !allColorsFilteredOut; if (useColorIdentity) { color = rules.getColorIdentity(); } @@ -177,7 +178,7 @@ public class SFilterUtil { if (colors == 0) { //handle showing all multi-color cards if all 5 colors are filtered result = color.isMulticolor() || (wantColorless && color.isColorless()); } else if (colors != ColorSet.ALL_COLORS.getColor()) { - if (useColorIdentity) { + if (useColorIdentity && !allColorsFilteredOut) { result = color.hasAnyColor(colors); } else { result = rules.canCastWithAvailable(colors); @@ -186,7 +187,7 @@ public class SFilterUtil { } else { result = !color.isMulticolor(); if (colors != ColorSet.ALL_COLORS.getColor()) { - if (useColorIdentity) { + if (useColorIdentity && !allColorsFilteredOut) { result = result && color.hasAnyColor(colors); } else { result = result && rules.canCastWithAvailable(colors);