From be23f19a327e34e80766601a2b8f4ec5e0521c52 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Wed, 20 Jan 2021 09:47:54 -0600 Subject: [PATCH] Fixed text for costs starting with "and" --- Mage/src/main/java/mage/abilities/costs/CostsImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/abilities/costs/CostsImpl.java b/Mage/src/main/java/mage/abilities/costs/CostsImpl.java index bda046a5ee..496b4099ce 100644 --- a/Mage/src/main/java/mage/abilities/costs/CostsImpl.java +++ b/Mage/src/main/java/mage/abilities/costs/CostsImpl.java @@ -51,7 +51,15 @@ public class CostsImpl extends ArrayList implements Costs for (T cost : this) { String textCost = cost.getText(); if (textCost != null && !textCost.isEmpty()) { - sbText.append(Character.toUpperCase(textCost.charAt(0))).append(textCost.substring(1)).append(", "); + if (textCost.startsWith("and")) { + if (sbText.length() > 1) { + // Remove "," from previous cost + sbText.deleteCharAt(sbText.length() - 2); + } + sbText.append(textCost).append(", "); + } else { + sbText.append(Character.toUpperCase(textCost.charAt(0))).append(textCost.substring(1)).append(", "); + } } } if (sbText.length() > 1) {