aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/overlays
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/overlays')
-rw-r--r--src/main/kotlin/dulkirmod/overlays/SlayerTracker.kt26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/overlays/SlayerTracker.kt b/src/main/kotlin/dulkirmod/overlays/SlayerTracker.kt
new file mode 100644
index 0000000..dc1e956
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/overlays/SlayerTracker.kt
@@ -0,0 +1,26 @@
+package dulkirmod.overlays
+
+import cc.polyfrost.oneconfig.hud.TextHud
+import dulkirmod.utils.SlayerTrackerUtil.averageBossesPerHour
+import dulkirmod.utils.SlayerTrackerUtil.averageSpawnKillTime
+import dulkirmod.utils.SlayerTrackerUtil.averageXPPerHour
+import dulkirmod.utils.SlayerTrackerUtil.currentSlayerType
+import dulkirmod.utils.SlayerTrackerUtil.sessionXP
+import java.text.NumberFormat
+
+class SlayerTracker : TextHud(false) {
+ override fun getLines(lines: MutableList<String>?, example: Boolean) {
+ if (currentSlayerType != "" && !example) {
+ val trimmedSlayer = if (currentSlayerType == "Endermen") {
+ "Enderman"
+ } else {
+ currentSlayerType.trimEnd('s')
+ }
+ lines?.add("Slayer: $trimmedSlayer")
+ lines?.add("Session XP: ${NumberFormat.getInstance().format(sessionXP)}")
+ lines?.add("Average Spawn + Kill Time: ${"%.2f".format(averageSpawnKillTime)}s")
+ lines?.add("Average Bosses Per Hour: ${"%.1f".format(averageBossesPerHour)}")
+ lines?.add("Average XP Per Hour: ${NumberFormat.getInstance().format(averageXPPerHour)}")
+ }
+ }
+} \ No newline at end of file