mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
improve
This commit is contained in:
@@ -82,7 +82,7 @@ public abstract class SpellAbilityEffect {
|
|||||||
String stackDesc = params.get("StackDescription");
|
String stackDesc = params.get("StackDescription");
|
||||||
if (stackDesc != null) {
|
if (stackDesc != null) {
|
||||||
String[] reps = null;
|
String[] reps = null;
|
||||||
if (stackDesc.startsWith("REP")) {
|
if (stackDesc.startsWith("REP") && Lang.getInstance() instanceof LangEnglish) {
|
||||||
reps = stackDesc.substring(4).split(" & ");
|
reps = stackDesc.substring(4).split(" & ");
|
||||||
stackDesc = "SpellDescription";
|
stackDesc = "SpellDescription";
|
||||||
}
|
}
|
||||||
@@ -91,19 +91,17 @@ public abstract class SpellAbilityEffect {
|
|||||||
if (params.get("SpellDescription") != null) {
|
if (params.get("SpellDescription") != null) {
|
||||||
String spellDesc = CardTranslation.translateSingleDescriptionText(params.get("SpellDescription"),
|
String spellDesc = CardTranslation.translateSingleDescriptionText(params.get("SpellDescription"),
|
||||||
sa.getHostCard().getName());
|
sa.getHostCard().getName());
|
||||||
if (Lang.getInstance() instanceof LangEnglish && reps != null) {
|
if (spellDesc.contains("(")) { //trim reminder text from StackDesc
|
||||||
|
spellDesc = spellDesc.substring(0, spellDesc.indexOf("(") - 1);
|
||||||
|
}
|
||||||
|
if (reps != null) {
|
||||||
for (String s : reps) {
|
for (String s : reps) {
|
||||||
String[] rep = s.split("_",2);
|
String[] rep = s.split("_",2);
|
||||||
spellDesc = spellDesc.replaceFirst(rep[0], rep[1]);
|
spellDesc = spellDesc.replaceFirst(rep[0], rep[1]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (spellDesc.contains("(")) { //trim reminder text from StackDesc
|
|
||||||
spellDesc = spellDesc.substring(0, spellDesc.indexOf("(") - 1);
|
|
||||||
}
|
|
||||||
if (reps == null) {
|
|
||||||
sb.append(spellDesc);
|
|
||||||
} else {
|
|
||||||
tokenizeString(sa, sb, spellDesc);
|
tokenizeString(sa, sb, spellDesc);
|
||||||
|
} else {
|
||||||
|
sb.append(spellDesc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sa.getTargets() != null && !sa.getTargets().isEmpty() && reps == null) {
|
if (sa.getTargets() != null && !sa.getTargets().isEmpty() && reps == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user