diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/combat')
3 files changed, 27 insertions, 27 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt index 959a303e8..656ac7b9d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt @@ -61,7 +61,7 @@ import kotlin.math.roundToLong object GhostCounter { val config get() = SkyHanniMod.feature.combat.ghostCounter - val hidden get() = ProfileStorageData.profileSpecific?.ghostCounter + val storage get() = ProfileStorageData.profileSpecific?.ghostCounter private var display = emptyList<List<Any>>() var ghostCounterV3File = File("." + File.separator + "config" + File.separator + "ChatTriggers" + File.separator + "modules" + File.separator + "GhostCounterV3" + File.separator + ".persistantData.json") @@ -127,7 +127,7 @@ object GhostCounter { } val avgMagicFind = when (Option.TOTALDROPS.get()) { 0.0 -> "0" - else -> "${((((hidden?.totalMF!! / Option.TOTALDROPS.get()) + Math.ulp(1.0)) * 100) / 100).roundToPrecision(2)}" + else -> "${((((storage?.totalMF!! / Option.TOTALDROPS.get()) + Math.ulp(1.0)) * 100) / 100).roundToPrecision(2)}" } val xpHourFormatting = textFormatting.xpHourFormatting @@ -151,9 +151,9 @@ object GhostCounter { } val bestiaryFormatting = textFormatting.bestiaryFormatting - val currentKill = hidden?.bestiaryCurrentKill?.toInt() ?: 0 - val killNeeded = hidden?.bestiaryKillNeeded?.toInt() ?: 0 - val nextLevel = hidden?.bestiaryNextLevel?.toInt() ?: -1 + val currentKill = storage?.bestiaryCurrentKill?.toInt() ?: 0 + val killNeeded = storage?.bestiaryKillNeeded?.toInt() ?: 0 + val nextLevel = storage?.bestiaryNextLevel?.toInt() ?: -1 val bestiary = if (config.showMax) { when (nextLevel) { 26 -> bestiaryFormatting.maxed.replace("%currentKill%", currentKill.addSeparators()) @@ -283,7 +283,7 @@ object GhostCounter { Option.KILLCOMBO.add(num) Option.SKILLXPGAINED.add(gained * num.roundToLong()) Option.SKILLXPGAINED.add(gained * num.roundToLong(), true) - hidden?.bestiaryCurrentKill = hidden?.bestiaryCurrentKill?.plus(num) ?: num + storage?.bestiaryCurrentKill = storage?.bestiaryCurrentKill?.plus(num) ?: num } lastXp = res } @@ -385,7 +385,7 @@ object GhostCounter { Option.SORROWCOUNT, Option.VOLTACOUNT, Option.PLASMACOUNT, Option.GHOSTLYBOOTS -> { opt.add(1.0) opt.add(1.0, true) - hidden?.totalMF = hidden?.totalMF?.plus(group("mf").substring(4).toDouble()) + storage?.totalMF = storage?.totalMF?.plus(group("mf").substring(4).toDouble()) ?: group("mf").substring(4).toDouble() Option.TOTALDROPS.add(1.0) if (opt == Option.SORROWCOUNT) @@ -424,16 +424,16 @@ object GhostCounter { val currentLevel = group("nextLevel").toInt() when (val nextLevel = if (currentLevel >= 25) 26 else currentLevel + 1) { 26 -> { - hidden?.bestiaryNextLevel = 26.0 - hidden?.bestiaryCurrentKill = 250_000.0 - hidden?.bestiaryKillNeeded = 0.0 + storage?.bestiaryNextLevel = 26.0 + storage?.bestiaryCurrentKill = 250_000.0 + storage?.bestiaryKillNeeded = 0.0 } else -> { val killNeeded: Int = bestiaryData[nextLevel] ?: -1 - hidden?.bestiaryNextLevel = nextLevel.toDouble() - hidden?.bestiaryCurrentKill = 0.0 - hidden?.bestiaryKillNeeded = killNeeded.toDouble() + storage?.bestiaryNextLevel = nextLevel.toDouble() + storage?.bestiaryCurrentKill = 0.0 + storage?.bestiaryKillNeeded = killNeeded.toDouble() } } update() @@ -459,7 +459,7 @@ object GhostCounter { val bestiaryNextLevel = if ("§\\wGhost".toRegex().matches(ghostStack.displayName)) 1 else ghostStack.displayName.substring(8) .romanToDecimal() + 1 - hidden?.bestiaryNextLevel = bestiaryNextLevel.toDouble() + storage?.bestiaryNextLevel = bestiaryNextLevel.toDouble() var kills = 0.0 for (line in ghostStack.getLore()) { val l = line.removeColor().trim() @@ -467,8 +467,8 @@ object GhostCounter { kills = "Kills: (.*)".toRegex().find(l)?.groupValues?.get(1)?.formatNumber()?.toDouble() ?: 0.0 } ghostXPPattern.matchMatcher(line.removeColor().trim()) { - hidden?.bestiaryCurrentKill = if (kills > 0) kills else group("current").formatNumber().toDouble() - hidden?.bestiaryKillNeeded = group("total").formatNumber().toDouble() + storage?.bestiaryCurrentKill = if (kills > 0) kills else group("current").formatNumber().toDouble() + storage?.bestiaryKillNeeded = group("total").formatNumber().toDouble() } } update() @@ -476,10 +476,10 @@ object GhostCounter { @SubscribeEvent fun onConfigLoad(event: ConfigLoadEvent) { - if (hidden?.configUpdateVersion == 0) { + if (storage?.configUpdateVersion == 0) { config.textFormatting.bestiaryFormatting.base = " &6Bestiary %display%: &b%value%" chat("§e[SkyHanni] Your GhostCounter config has been automatically adjusted.") - hidden?.configUpdateVersion = CONFIG_VALUE_VERSION + storage?.configUpdateVersion = CONFIG_VALUE_VERSION } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt index 70832980c..69094b991 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostData.kt @@ -63,28 +63,28 @@ object GhostData { if (s) session[this] = session[this]?.plus(i) ?: i else - GhostCounter.hidden?.data?.set(this, GhostCounter.hidden?.data?.get(this)?.plus(i) ?: i) + GhostCounter.storage?.data?.set(this, GhostCounter.storage?.data?.get(this)?.plus(i) ?: i) } fun set(i: Double, s: Boolean = false) { if (s) session[this] = i else - GhostCounter.hidden?.data?.set(this, i) + GhostCounter.storage?.data?.set(this, i) } fun getInt(s: Boolean = false): Int { return if (s) session[this]?.roundToInt() ?: 0 else - GhostCounter.hidden?.data?.get(this)?.roundToInt() ?: 0 + GhostCounter.storage?.data?.get(this)?.roundToInt() ?: 0 } fun get(s: Boolean = false): Double { return if (s) session[this] ?: 0.0 else - GhostCounter.hidden?.data?.get(this) ?: 0.0 + GhostCounter.storage?.data?.get(this) ?: 0.0 } } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt index 6dffc62fc..b5b833423 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt @@ -17,7 +17,7 @@ object GhostUtil { opt.set(0.0) opt.set(0.0, true) } - GhostCounter.hidden?.totalMF = 0.0 + GhostCounter.storage?.totalMF = 0.0 GhostCounter.update() } @@ -79,7 +79,7 @@ object GhostUtil { GhostData.Option.VOLTACOUNT.add(json["VoltaCount"].asDouble) GhostData.Option.GHOSTLYBOOTS.add(json["GhostlyBootsCount"].asDouble) GhostData.Option.KILLS.add(json["ghostsKilled"].asDouble) - GhostCounter.hidden?.totalMF = GhostCounter.hidden?.totalMF?.plus(json["TotalMF"].asDouble) + GhostCounter.storage?.totalMF = GhostCounter.storage?.totalMF?.plus(json["TotalMF"].asDouble) ?: json["TotalMF"].asDouble GhostData.Option.TOTALDROPS.add(json["TotalDrops"].asDouble) c.ctDataImported = true @@ -120,7 +120,7 @@ object GhostUtil { ) fun String.formatBestiary(currentKill: Int, killNeeded: Int): String { - val bestiaryNextLevel = GhostCounter.hidden?.bestiaryNextLevel + val bestiaryNextLevel = GhostCounter.storage?.bestiaryNextLevel val currentLevel = bestiaryNextLevel?.let { if (it.toInt() < 0) "25" else "${it.toInt() - 1}" } ?: "§cNo Bestiary Level Data!" val nextLevel = bestiaryNextLevel?.let { if (GhostCounter.config.showMax) "25" else "${it.toInt()}" } @@ -141,4 +141,4 @@ object GhostUtil { private fun percent(number: Double) = 100.0.coerceAtMost(((number / 250_000) * 100).roundToPrecision(4)).toString() -}
\ No newline at end of file +} |
