aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2021-08-28 01:51:35 -0400
committerMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2021-08-28 01:51:35 -0400
commit34e7b0aab54d9e5d456a68ae0f3c379c27c43857 (patch)
tree9591fd7eaa19246f79c73e48f22c6a55747ffd96 /src/main/kotlin
parent522979cdbad781bb5cc7e43d2b5c9db36b80da11 (diff)
downloadSkytilsMod-34e7b0aab54d9e5d456a68ae0f3c379c27c43857.tar.gz
SkytilsMod-34e7b0aab54d9e5d456a68ae0f3c379c27c43857.tar.bz2
SkytilsMod-34e7b0aab54d9e5d456a68ae0f3c379c27c43857.zip
very important change but the change of winning lottery is 1 in 300mil
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/skytils/skytilsmod/mixins/hooks/forge/SplashProgressHook.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/kotlin/skytils/skytilsmod/mixins/hooks/forge/SplashProgressHook.kt b/src/main/kotlin/skytils/skytilsmod/mixins/hooks/forge/SplashProgressHook.kt
index 119863d9..6706f6c5 100644
--- a/src/main/kotlin/skytils/skytilsmod/mixins/hooks/forge/SplashProgressHook.kt
+++ b/src/main/kotlin/skytils/skytilsmod/mixins/hooks/forge/SplashProgressHook.kt
@@ -26,14 +26,17 @@ val gifs = mapOf(
90.0 to ResourceLocation("skytils", "sychiccat.png"),
96.0 to ResourceLocation("skytils", "azoopet.gif"),
99.0 to ResourceLocation("skytils", "abdpfp.gif"),
- // this is the chance of winning the jackpot on the lottery
- 100 - 1 / 13_983_816.0 to ResourceLocation("skytils", "jamcat.gif")
+ // this is the chance of winning the jackpot on the lottery, but even less due to a loss of precision
+ 100 - 100 * 1 / 302_575_350.0 to ResourceLocation("skytils", "jamcat.gif")
)
fun setForgeGif(resourceLocation: ResourceLocation): ResourceLocation {
return if (Utils.noSychic) resourceLocation else {
val weight = Random.nextDouble() * 100
- (gifs.entries.reversed().find { weight >= it.key }?.value ?: ResourceLocation("skytils", "sychicpet.gif")).also {
+ (gifs.entries.reversed().find { weight >= it.key }?.value ?: ResourceLocation(
+ "skytils",
+ "sychicpet.gif"
+ )).also {
println("Rolled a $weight, displaying ${it.resourcePath}")
}
}