aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java4
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java15
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java18
3 files changed, 30 insertions, 7 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java
index bab5ba42..ceaff8a2 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java
@@ -54,7 +54,7 @@ public class RoomProcessorRiddle extends GeneralRoomProcessor {
}
if (foundMatch) {
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §eRiddle §7:: "+ch2.split(":")[0].trim()+" §fhas the reward!"));
- final String name = TextUtils.stripColor(ch2.split(":")[0]).replace("[NPC] ","").toLowerCase();
+ final String name = TextUtils.stripColor(ch2.split(":")[0]).replace("[NPC] ","").trim();
final BlockPos low = getDungeonRoom().getMin();
final BlockPos high = getDungeonRoom().getMax();
World w = getDungeonRoom().getContext().getWorld();
@@ -63,7 +63,7 @@ public class RoomProcessorRiddle extends GeneralRoomProcessor {
public boolean apply(@Nullable EntityArmorStand input) {
BlockPos pos = input.getPosition();
return low.getX() < pos.getX() && pos.getX() < high.getX()
- && low.getZ() < pos.getZ() && pos.getZ() < high.getZ() && input.getName().toLowerCase().contains(name);
+ && low.getZ() < pos.getZ() && pos.getZ() < high.getZ() && TextUtils.stripColor(input.getName()).equalsIgnoreCase(name);
}
});
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java
index 19911a34..b3511dec 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java
@@ -170,7 +170,20 @@ public class RoomProcessorTicTacToeSolver extends GeneralRoomProcessor {
if (!FeatureRegistry.SOLVER_TICTACTOE.isEnabled()) return;
if (chosePos != -1) {
BlockPos block = board.getOffsetPointList().get(chosePos).getBlockPos(getDungeonRoom());
- RenderUtils.highlightBlock(block, new Color(0,255,255,50), partialTicks, true);
+ boolean whoseturn = false; // false => hype true => me
+ if (lastBoard != null) {
+ int ones = 0;
+ int negativeones = 0;
+ for (byte[] bytes : lastBoard) {
+ for (byte aByte : bytes) {
+ if (aByte == 1) ones++;
+ else if (aByte == -1) negativeones++;
+ }
+ }
+ whoseturn = ones < negativeones;
+ }
+ RenderUtils.highlightBlock(block, whoseturn ? new Color(0,255,255,50)
+ : new Color(255, 201, 0,50), partialTicks, true);
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java
index 652206c2..c529670e 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java
@@ -58,10 +58,10 @@ public abstract class GeneralBossfightProcessor implements BossfightProcessor {
for (String nextPhase : currentPhase.getNextPhases()) {
PhaseData phaseData = phases.get(nextPhase);
if (phaseData == null) continue;
- if (phaseData.signatureMsgs.contains(chat.getFormattedText())) {
- currentPhase = phaseData;
- onPhaseChange();
- return;
+ if (phaseData.signatureMsgs.contains(chat.getFormattedText().replace(" ", ""))) {
+ currentPhase = phaseData;
+ onPhaseChange();
+ return;
}
}
}
@@ -115,10 +115,20 @@ public abstract class GeneralBossfightProcessor implements BossfightProcessor {
@Data
@Builder
public static class PhaseData {
+ private PhaseData(String phase, Set<String> signatureMsgs, Set<String> nextPhase) {
+ this.phase = phase;
+ this.nextPhases = new HashSet<>(nextPhase);
+ this.signatureMsgs = new HashSet<>();
+ for (String signatureMsg : signatureMsgs) {
+ this.signatureMsgs.add(signatureMsg.replace(" ", ""));
+ }
+ }
+
private String phase;
@Singular
private Set<String> signatureMsgs;
@Singular
private Set<String> nextPhases;
+
}
}