diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-03-29 21:57:32 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-03-29 21:57:32 -0400 |
| commit | 0bca0d24a20ca713dd1c9ef042dcc64d3b795fef (patch) | |
| tree | 0728e3980702198590855466c3606c8fc71446dc /src/main/java/tlIItools/Effect.java | |
| parent | 4d059f250889cae60ecf82ccfbd159b546a89949 (diff) | |
Fix up ReplPair
There was something in ReplPair that was causing issues. Since we don't
need any of the fancy ReplPair functionality, I ripped it all out, since
it was causing issues (probably sorting-related, with a comparator or
something missing somewhere)
Diffstat (limited to 'src/main/java/tlIItools/Effect.java')
| -rw-r--r-- | src/main/java/tlIItools/Effect.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/tlIItools/Effect.java b/src/main/java/tlIItools/Effect.java index 3efec6de..5c8b203a 100644 --- a/src/main/java/tlIItools/Effect.java +++ b/src/main/java/tlIItools/Effect.java @@ -291,10 +291,10 @@ public class Effect { // Expand aliases first. - for (ReplPair repl : replList) { + for (ReplPair repl : replList) { fmt = fmt.replaceAll(repl.find, repl.replace); } - + if (minValue <= 0 && maxValue <= 0) { fmt = fmt.replaceAll("<C\\|([^|>]+)\\|([^|>]+)>", "$1"); } @@ -310,9 +310,9 @@ public class Effect { if (minPer >= 0 && maxPer >= 0) { fmt = fmt.replaceAll("<MC\\|([^|>]+)\\|([^|>]+)>", "$2"); } - + if (fmt.contains("<") || fmt.contains(">")) { - AffixLister.errOut.printf("WARN: Details for effect %s are malformated (contains < or >):\n\t%s\n", type, fmt); + AffixLister.errOut.printf("WARN: Details for effect %s are malformatted (contains < or >):\n\t%s\n", type, fmt); } sb.append(String.format(fmt, Math.abs(minValue), Math.abs(maxValue), duration, damageType.toLowerCase(), level, resist, name, Math.abs(minPer), Math.abs(maxPer), range, maxCount, pulse)); @@ -434,7 +434,11 @@ public class Effect { } else { efct.hasDuration = true; - efct.duration = Double.parseDouble(splits[1]); + if (splits[1].equalsIgnoreCase("instant")) { + efct.duration = -1; + } else { + efct.duration = Double.parseDouble(splits[1]); + } } } else if (ln.contains("<FLOAT>MIN:")) { efct.minValue = Double.parseDouble(splits[1]); |
