From f78bfce802974b07b882fa9d1920bb2ef03da38e Mon Sep 17 00:00:00 2001 From: Rob Schnautz Date: Mon, 21 Jan 2019 03:31:16 +0000 Subject: [PATCH] RNA looks at artifact casting cost only --- .../main/java/forge/itemmanager/ColumnDef.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/forge-gui/src/main/java/forge/itemmanager/ColumnDef.java b/forge-gui/src/main/java/forge/itemmanager/ColumnDef.java index 47143aeb7d4..74dc7c3b1ad 100644 --- a/forge-gui/src/main/java/forge/itemmanager/ColumnDef.java +++ b/forge-gui/src/main/java/forge/itemmanager/ColumnDef.java @@ -567,16 +567,24 @@ public enum ColumnDef { private static String toLandsLast(final InventoryItem i) { //nonland? return !(((IPaperCard) i).getRules().getType().isLand()) ? - "0" + toColorlessArtifactsLast(i) + "0" + toArtifactsWithColorlessCostsLast(i) //land : "1"; } - /**Returns 1 for colorless artifacts, otherwise 0 and continues sorting. + /**Returns 1 for artifacts without color shards in their mana cost, otherwise 0 and continues sorting. + As of 2019, colored artifacts appear here if there are no colored shards in their casting cost. @param i A paper card. @return Part of a sortable numeric string.*/ - private static String toColorlessArtifactsLast(final InventoryItem i) { - return !(((IPaperCard) i).getRules().getType().isArtifact() && toColor(i).isColorless()) + private static String toArtifactsWithColorlessCostsLast(final InventoryItem i) { + forge.card.mana.ManaCost manaCost = ((IPaperCard) i).getRules().getManaCost(); + + return !(((IPaperCard) i).getRules().getType().isArtifact() && (toColor(i).isColorless() || + //If it isn't colorless, see if it can be paid with only white, only blue, only black. + //No need to check others since three-color hybrid shards don't exist. + manaCost.canBePaidWithAvaliable(MagicColor.WHITE) && + manaCost.canBePaidWithAvaliable(MagicColor.BLUE) && + manaCost.canBePaidWithAvaliable(MagicColor.BLACK))) ? "0" + toSplitLast(i): "1"; }