Card ability stringbuilder updates + support AdditionalDesc

This commit is contained in:
Northmoc
2021-09-24 17:56:47 -04:00
parent 6c62df0a48
commit a8db6f9370

View File

@@ -2257,6 +2257,23 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
sb.append("(As this Saga enters and after your draw step, add a lore counter. Sacrifice after ");
sb.append(TextUtil.toRoman(getFinalChapterNr())).append(".)").append(linebreak);
}
// add As an additional cost to Permanent spells
if (state.getFirstAbility() != null && type.isPermanent()) {
SpellAbility first = state.getFirstAbility();
if (first.isSpell()) {
Cost cost = first.getPayCosts();
if (cost != null && !cost.isOnlyManaCost()) {
String additionalDesc = "";
if (state.getFirstAbility().hasParam("AdditionalDesc")) {
additionalDesc = state.getFirstAbility().getParam("AdditionalDesc");
}
sb.append(cost.toString().replace("\n", "")).append(" ").append(additionalDesc);
sb.append(linebreak);
}
}
}
if (monstrous) {
sb.append("Monstrous\r\n");
}
@@ -2267,6 +2284,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
sb.append("Manifested\r\n");
}
sb.append(keywordsToText(getUnhiddenKeywords(state)));
if ((keywordsToText(getUnhiddenKeywords(state))).length() > 0) {
sb.append(linebreak);
}
// Process replacement effects first so that "enters the battlefield tapped"
// and "as ~ enters the battlefield, choose...", etc can be printed
@@ -2285,18 +2305,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
}
}
// add As an additional cost to Permanent spells
if (state.getFirstAbility() != null && type.isPermanent()) {
SpellAbility first = state.getFirstAbility();
if (first.isSpell()) {
Cost cost = first.getPayCosts();
if (cost != null && !cost.isOnlyManaCost()) {
sb.append(cost.toString());
sb.append(linebreak);
}
}
}
if (this.getRules() != null && state.getView().getState().equals(CardStateName.Original)) {
// try to look which what card this card can be meld to
// only show this info if this card does not has the meld Effect itself