mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Straighten out stringbuilder for Sac<X costs
This commit is contained in:
@@ -74,10 +74,17 @@ public class CostSacrifice extends CostPartWithList {
|
|||||||
@Override
|
@Override
|
||||||
public final String toString() {
|
public final String toString() {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
if (getAmount().equals("X")) {
|
||||||
|
sb.append("You may sacrifice ");
|
||||||
|
} else {
|
||||||
sb.append("Sacrifice ");
|
sb.append("Sacrifice ");
|
||||||
|
}
|
||||||
|
|
||||||
if (payCostFromSource()) {
|
if (payCostFromSource()) {
|
||||||
sb.append(getType());
|
sb.append(getType());
|
||||||
|
} else if (getAmount().equals("X")) {
|
||||||
|
String typeDesc = getType().toLowerCase().replace(";","s and/or ");
|
||||||
|
sb.append("any number of ").append(typeDesc).append("s");
|
||||||
} else {
|
} else {
|
||||||
final String desc = ObjectUtils.firstNonNull(getTypeDescription(), getType());
|
final String desc = ObjectUtils.firstNonNull(getTypeDescription(), getType());
|
||||||
sb.append(Cost.convertAmountTypeToWords(convertAmount(), getAmount(), desc));
|
sb.append(Cost.convertAmountTypeToWords(convertAmount(), getAmount(), desc));
|
||||||
|
|||||||
Reference in New Issue
Block a user