Finished uhc progress

This commit is contained in:
2025-09-04 20:17:15 +02:00
parent 6f90d0caa5
commit 1646cb7492
3 changed files with 40 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import { STARS } from "@/data/hypixel/uhc"
export function getUhcStar(score: number): number {
export function getUhcStarValue(score: number): number {
for (let i = STARS.length - 1; i >= 0; i--) {
if (score >= STARS[i].value) {
return i + 1
@@ -8,3 +8,16 @@ export function getUhcStar(score: number): number {
}
return 1
}
export function getUhcStar(score: number) {
const current = getUhcStarValue(score)
return STARS.at(current - 1)!
}
export function getNextUhcStar(score: number) {
const current = getUhcStarValue(score)
if (current === 15) return STARS.at(-1)!
return STARS.at(current)!
}