diff options
| author | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2024-09-26 23:11:34 -0400 |
|---|---|---|
| committer | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2024-09-26 23:11:34 -0400 |
| commit | 0eb126c592a995d7543b844dc552a9cc4ee0f36c (patch) | |
| tree | 864bd9fbee4cd0ac06140dbdaee9785575b9abb4 /src/main/java/de | |
| parent | 0a26a5c74daedc2f3ff2090f55e38aae863fbe5a (diff) | |
| download | Skyblocker-0eb126c592a995d7543b844dc552a9cc4ee0f36c.tar.gz Skyblocker-0eb126c592a995d7543b844dc552a9cc4ee0f36c.tar.bz2 Skyblocker-0eb126c592a995d7543b844dc552a9cc4ee0f36c.zip | |
New Quiz question + tiny refactor
Diffstat (limited to 'src/main/java/de')
| -rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/Trivia.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/Trivia.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/Trivia.java index 874907c3..b1954d50 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/Trivia.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/Trivia.java @@ -2,6 +2,7 @@ package de.hysky.skyblocker.skyblock.dungeon.puzzle; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.waypoint.FairySouls; +import de.hysky.skyblocker.utils.SkyblockTime; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.chat.ChatFilterResult; import de.hysky.skyblocker.utils.chat.ChatPatternListener; @@ -24,6 +25,8 @@ public class Trivia extends ChatPatternListener { private List<String> solutions = Collections.emptyList(); public Trivia() { + //FIXME I think its worth replacing this with something less fragile and is capable of handing multiple lines + //perhaps manual incremental reading based off the start of a question super("^ +(?:([A-Za-z,' ]*\\?)| ([ⓐⓑⓒ]) ([a-zA-Z0-9 ]+))$"); } @@ -50,9 +53,7 @@ public class Trivia extends ChatPatternListener { try { String trimmedQuestion = question.trim(); if (trimmedQuestion.equals("What SkyBlock year is it?")) { - long currentTime = System.currentTimeMillis() / 1000L; - long diff = currentTime - 1560276000; - int year = (int) (diff / 446400 + 1); + int year = SkyblockTime.skyblockYear.get(); solutions = Collections.singletonList("Year " + year); } else { String[] questionAnswers = answers.get(trimmedQuestion); @@ -79,7 +80,9 @@ public class Trivia extends ChatPatternListener { answers.put("What is the status of Maxor, Storm, Goldor, and Necron?", new String[]{"The Wither Lords"}); answers.put("Which brother is on the Spider's Den?", new String[]{"Rick"}); answers.put("What is the name of Rick's brother?", new String[]{"Pat"}); - answers.put("What is the name of the Painter in the Hub?", new String[]{"Marco"}); + //Full Question: "What is the name of the vendor in the Hub who sells stained glass?" + //The solver cannot handle multiple lines right now and just sees "glass?" as the question + answers.put("glass?", new String[]{"Wool Weaver"}); answers.put("What is the name of the person that upgrades pets?", new String[]{"Kat"}); answers.put("What is the name of the lady of the Nether?", new String[]{"Elle"}); answers.put("Which villager in the Village gives you a Rogue Sword?", new String[]{"Jamie"}); |
