feat : no longer limit stats choosing
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user