init
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 1m31s

This commit is contained in:
2025-07-01 09:33:43 +07:00
parent 3a26f09a01
commit 331aba4489
156 changed files with 1206219 additions and 146 deletions

50
src/helper/calcData.ts Normal file
View File

@@ -0,0 +1,50 @@
import { mapingStats } from "@/lib/constant"
import { AffixDetail } from "@/types"
export function calcPromotion(level: number) {
if (level < 20) {
return 0
}
if (level < 30) {
return 1
}
if (level < 40) {
return 2
}
if (level < 50) {
return 3
}
if (level < 60) {
return 4
}
if (level < 70) {
return 5
}
return 6
}
export function calcRarity(rarity: string) {
if (rarity.includes("5")) {
return 5
}
if (rarity.includes("4")) {
return 4
}
if (rarity.includes("3")) {
return 3
}
return 1
}
export const calcAffixBonus = (affix: AffixDetail, stepCount: number, rollCount: number) => {
const data = affix;
if (!data) return 0;
if (mapingStats?.[data.property].unit === "%") {
return ((data.base * rollCount + data.step * stepCount) * 100).toFixed(1);
}
if (mapingStats?.[data.property].name === "SPD") {
return (data.base * rollCount + data.step * stepCount).toFixed(1);
}
return (data.base * rollCount + data.step * stepCount).toFixed(0);
}