diff options
author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-30 13:44:36 +0900 |
---|---|---|
committer | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-30 13:44:36 +0900 |
commit | e8c892d34f2d6ecc26cae1fe814a41b64513b49e (patch) | |
tree | 5439645d3a2216a9b7aa249486a2ea73cc6118d1 /src/main/java/kr/syeyoung | |
parent | bb30d83ee52938bc860643d2bfd5b2059b35cc07 (diff) | |
download | Skyblock-Dungeons-Guide-e8c892d34f2d6ecc26cae1fe814a41b64513b49e.tar.gz Skyblock-Dungeons-Guide-e8c892d34f2d6ecc26cae1fe814a41b64513b49e.tar.bz2 Skyblock-Dungeons-Guide-e8c892d34f2d6ecc26cae1fe814a41b64513b49e.zip |
All puzzle solver, done
Diffstat (limited to 'src/main/java/kr/syeyoung')
3 files changed, 55 insertions, 47 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java index a564c487..2d25168f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java @@ -63,7 +63,8 @@ public class DungeonsGuide "cf6d49d3-4f1e-4ec9-836e-049573793ddd.roomdata", "cf44c95c-950e-49e0-aa4c-82c2b18d0acc.roomdata", "d3e61abf-4198-4520-a950-a03761a0eb6f.roomdata", - "ffd5411b-6ff4-4f60-b387-72f00510ec50.roomdata" + "ffd5411b-6ff4-4f60-b387-72f00510ec50.roomdata", + "b2dce4ed-2bda-4303-a4d7-3ebb914db318.roomdata" }; for (String str:files) { try { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java index 29c251d2..43482cce 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java @@ -76,7 +76,7 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { LinkedList<Action> solved = null; boolean pushed = false; copied[playerY][playerX] = 2; - if (board[resY][resX] == 1 && board[playerY][playerX] != 2) { + if (board[resY][resX] == 1) { if (!push(copied, resX, resY, dir.x, dir.y)) { continue; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java index a7de1664..5acd0b52 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java @@ -7,6 +7,7 @@ import kr.syeyoung.dungeonsguide.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.math.NumberUtils; import java.awt.*; import java.util.*; @@ -18,54 +19,54 @@ public class RoomProcessorTrivia extends GeneralRoomProcessor { public RoomProcessorTrivia(DungeonRoom dungeonRoom) { super(dungeonRoom); - for (Map.Entry<String, String[]> answer : answers.entrySet()) { - StringBuilder sb = new StringBuilder(); - for (String s : answer.getValue()) { - sb.append(s).append(','); - } - dungeonRoom.getDungeonRoomInfo().getProperties().put(answer.getKey(), sb.toString()); - } +// for (Map.Entry<String, String[]> answer : answers.entrySet()) { +// StringBuilder sb = new StringBuilder(); +// for (String s : answer.getValue()) { +// sb.append(s).append(','); +// } +// dungeonRoom.getDungeonRoomInfo().getProperties().put(answer.getKey(), sb.toString()); +// } } private List<String> questionDialog = new ArrayList<String>(); private boolean questionDialogStart = false; - private static final Map<String, String[]> answers = new HashMap<String,String[]>() {{ - put("what is the status of the watcher?", new String[]{"stalker"}); - put("what is the status of bonzo?", new String[]{"new necromancer"}); - put("what is the status of scarf?", new String[]{"apprentice necromancer"}); - put("what is the status of the professor?", new String[]{"professor"}); - put("what is the status of thorn?", new String[]{"shaman necromancer"}); - put("what is the status of livid?", new String[]{"master necromancer"}); - put("what is the status of sadan?", new String[]{"necromancer lord"}); - put("what is the status of maxor?", new String[]{"young wither"}); - put("what is the status of goldor?", new String[]{"wither soldier"}); - put("what is the status of storm?", new String[]{"elementalist"}); - put("what is the status of necron?", new String[]{"wither lord"}); - put("how many total fairy souls are there?", new String[]{"209 fairy souls"}); - put("how many fairy souls are there in spider's den?", new String[]{"17"}); - put("how many fairy souls are there in the end?", new String[]{"12"}); - put("how many fairy souls are there in the barn?", new String[]{"7"}); - put("how many fairy souls are there in mushroom desert?", new String[]{"8"}); - put("how many fairy souls are there in blazing fortress?", new String[]{"19"}); - put("how many fairy souls are there in the park?", new String[]{"11"}); - put("how many fairy souls are there in jerry's workshop?", new String[]{"5"}); - put("how many fairy souls are there in the hub?", new String[]{"79"}); - put("how many fairy souls are there in deep caverns?", new String[]{"21"}); - put("how many fairy souls are there in gold mine?", new String[]{"12"}); - put("how many fairy souls are there in dungeon hub?", new String[]{"7"}); - put("which brother is on the spider's den?", new String[]{"rick"}); - put("what is the name of rick's brother?", new String[]{"pat"}); - put("what is the name of the painter in the hub?", new String[]{"marco"}); - put("what is the name of the person that upgrades pets?", new String[]{"kat"}); - put("what is the name of the lady of the nether?", new String[]{"elle"}); - put("which villager in the village gives you a rogue sword?", new String[]{"jamie"}); - put("how many unique minions are there?", new String[]{"52"}); - put("which of these enemies does not spawn in the spider's den?", new String[]{"zombie spider","cave spider","broodfather"}); - put("which of these monsters only spawns at night?", new String[]{"zombie villager","ghast"}); - put("which of these is not a dragon in the end?", new String[]{"zoomer dragon","weak dragon","stonk dragon","holy dragon","boomer dragon","stable dragon"}); - }}; +// private static final Map<String, String[]> answers = new HashMap<String,String[]>() {{ +// put("what is the status of the watcher?", new String[]{"stalker"}); +// put("what is the status of bonzo?", new String[]{"new necromancer"}); +// put("what is the status of scarf?", new String[]{"apprentice necromancer"}); +// put("what is the status of the professor?", new String[]{"professor"}); +// put("what is the status of thorn?", new String[]{"shaman necromancer"}); +// put("what is the status of livid?", new String[]{"master necromancer"}); +// put("what is the status of sadan?", new String[]{"necromancer lord"}); +// put("what is the status of maxor?", new String[]{"young wither"}); +// put("what is the status of goldor?", new String[]{"wither soldier"}); +// put("what is the status of storm?", new String[]{"elementalist"}); +// put("what is the status of necron?", new String[]{"wither lord"}); +// put("how many total fairy souls are there?", new String[]{"209 fairy souls"}); +// put("how many fairy souls are there in spider's den?", new String[]{"17"}); +// put("how many fairy souls are there in the end?", new String[]{"12"}); +// put("how many fairy souls are there in the barn?", new String[]{"7"}); +// put("how many fairy souls are there in mushroom desert?", new String[]{"8"}); +// put("how many fairy souls are there in blazing fortress?", new String[]{"19"}); +// put("how many fairy souls are there in the park?", new String[]{"11"}); +// put("how many fairy souls are there in jerry's workshop?", new String[]{"5"}); +// put("how many fairy souls are there in the hub?", new String[]{"79"}); +// put("how many fairy souls are there in deep caverns?", new String[]{"21"}); +// put("how many fairy souls are there in gold mine?", new String[]{"12"}); +// put("how many fairy souls are there in dungeon hub?", new String[]{"7"}); +// put("which brother is on the spider's den?", new String[]{"rick"}); +// put("what is the name of rick's brother?", new String[]{"pat"}); +// put("what is the name of the painter in the hub?", new String[]{"marco"}); +// put("what is the name of the person that upgrades pets?", new String[]{"kat"}); +// put("what is the name of the lady of the nether?", new String[]{"elle"}); +// put("which villager in the village gives you a rogue sword?", new String[]{"jamie"}); +// put("how many unique minions are there?", new String[]{"52"}); +// put("which of these enemies does not spawn in the spider's den?", new String[]{"zombie spider","cave spider","broodfather"}); +// put("which of these monsters only spawns at night?", new String[]{"zombie villager","ghast"}); +// put("which of these is not a dragon in the end?", new String[]{"zoomer dragon","weak dragon","stonk dragon","holy dragon","boomer dragon","stable dragon"}); +// }}; @Override public void chatReceived(IChatComponent chat) { super.chatReceived(chat); @@ -73,6 +74,7 @@ public class RoomProcessorTrivia extends GeneralRoomProcessor { System.out.println(ch2 + " / "+chat.getFormattedText()); if (chat.getFormattedText().contains("§r§6§lQuestion ")) { questionDialogStart = true; + questionDialog.clear(); } if (questionDialogStart && (chat.getFormattedText().startsWith("§r ") || chat.getFormattedText().trim().startsWith("§r§6 "))) { @@ -88,8 +90,9 @@ public class RoomProcessorTrivia extends GeneralRoomProcessor { private void parseDialog() { String question = TextUtils.stripColor(questionDialog.get(1)).trim(); String answerA = getAnswer(questionDialog.get(2)); - String answerB = getAnswer(questionDialog.get(2)); - String answerC = getAnswer(questionDialog.get(2)); + String answerB = getAnswer(questionDialog.get(3)); + String answerC = getAnswer(questionDialog.get(4)); + System.out.println("question ::"+question+" :: answerC"+answerC); String theRealAnswer = match(question, answerA, answerB, answerC); if (theRealAnswer == null) @@ -118,7 +121,11 @@ public class RoomProcessorTrivia extends GeneralRoomProcessor { } private boolean match(String[] match, String match2) { for (String s : match) { - if (s.equalsIgnoreCase(match2)) return true; + if (NumberUtils.isNumber(s)) { + if (match2.toLowerCase().contains(s)) return true; + } else { + if (match2.equalsIgnoreCase(s)) return true; + } } return false; } |