- 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).

This commit is contained in:
Agetian
2015-06-08 12:40:57 +00:00
parent 2434b00879
commit c6d7561e80

View File

@@ -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);