forked from External/mage
Improved and fixed cards texts:
* fixed wrong texts for draw card abilities; * added multi-effects text generation instead copy-paste (concatBy).
This commit is contained in:
parent
83cf370cc6
commit
f6585ef734
23 changed files with 144 additions and 140 deletions
|
|
@ -42,6 +42,7 @@ public class Effects extends ArrayList<Effect> {
|
|||
public String getText(Mode mode) {
|
||||
StringBuilder sbText = new StringBuilder();
|
||||
String lastRule = null;
|
||||
int effectNum = 0;
|
||||
for (Effect effect : this) {
|
||||
String endString = "";
|
||||
String nextRule = effect.getText(mode);
|
||||
|
|
@ -50,9 +51,16 @@ public class Effects extends ArrayList<Effect> {
|
|||
if (nextRule == null || nextRule.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
effectNum++;
|
||||
|
||||
// concat effects (default: each effect with a new sentence)
|
||||
String concatPrefix = effect.getConcatPrefix();
|
||||
if (effectNum > 1 && !concatPrefix.isEmpty() && !concatPrefix.equals(".")) {
|
||||
nextRule = concatPrefix + " " + nextRule;
|
||||
}
|
||||
|
||||
if (nextRule != null) {
|
||||
if (nextRule.startsWith("and ") || nextRule.startsWith("with ")) {
|
||||
if (nextRule.startsWith("and ") || nextRule.startsWith("with ") || nextRule.startsWith("then ")) {
|
||||
endString = " ";
|
||||
} else if (nextRule.startsWith(",") || nextRule.startsWith(" ")) {
|
||||
endString = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue