feat : no longer limit stats choosing

This commit is contained in:
2026-09-17 18:30:40 +07:00 Unverified
parent 95bee94186
commit 6c3c1f16ab
4 changed files with 38 additions and 26 deletions
+10
View File
@@ -44,6 +44,8 @@ export function targetStatIconName(value: string): string | null {
export function recommendedStatIconName(value: string): string | null {
if (value === "CRIT Rate%/CRIT DMG%") return "critrate";
if (value === "CRIT Rate%") return "critrate";
if (value === "CRIT DMG%") return "critdmg";
if (value === "Healing Bonus%") return "healing-bonus";
if (value.endsWith(" DMG%")) return "elemental-bonus";
@@ -52,6 +54,14 @@ export function recommendedStatIconName(value: string): string | null {
return ["hp", "atk", "def", "em", "er"].includes(base) ? base : null;
}
export function recommendedStatOptionConflicts(option: string, selected: readonly string[]): boolean {
const combined = "CRIT Rate%/CRIT DMG%";
const individual = ["CRIT Rate%", "CRIT DMG%"];
return option === combined
? individual.some((stat) => selected.includes(stat))
: individual.includes(option) && selected.includes(combined);
}
export function recommendedStatElement(value: string): string | null {
const match = /^(Anemo|Geo|Electro|Dendro|Hydro|Pyro|Cryo) DMG%$/u.exec(value);
return match?.[1] ?? null;