From 3d446c73a7e052a7ec820ccca6ea2fe75c7b59cb Mon Sep 17 00:00:00 2001 From: frzyc Date: Fri, 24 Jan 2025 22:14:35 -0500 Subject: [PATCH] some ZO fixes (#2609) --- libs/zzz/page-optimize/src/BaseStatCard.tsx | 1 + libs/zzz/solver/src/calc.ts | 5 +++-- libs/zzz/ui/src/Disc/DiscCard.tsx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/zzz/page-optimize/src/BaseStatCard.tsx b/libs/zzz/page-optimize/src/BaseStatCard.tsx index 14cfa47703..ebc1722093 100644 --- a/libs/zzz/page-optimize/src/BaseStatCard.tsx +++ b/libs/zzz/page-optimize/src/BaseStatCard.tsx @@ -55,6 +55,7 @@ export default function BaseStatCard({ [key]: v, }) } + float={getUnitStr(key) === '%'} inputProps={{ sx: { textAlign: 'right', minWidth: '5em' } }} InputProps={{ startAdornment: statKeyTextMap[key] ?? key, diff --git a/libs/zzz/solver/src/calc.ts b/libs/zzz/solver/src/calc.ts index b59de2f1ec..5fcddbfaf7 100644 --- a/libs/zzz/solver/src/calc.ts +++ b/libs/zzz/solver/src/calc.ts @@ -1,4 +1,4 @@ -import { objKeyMap } from '@genshin-optimizer/common/util' +import { clamp01, objKeyMap } from '@genshin-optimizer/common/util' import type { AnomalyDamageKey, AttributeDamageKey, @@ -23,7 +23,7 @@ export function getSum(baseStats: BaseStats, discs: DiscStats[]) { } } for (const [key, value] of Object.entries(sum)) { - if (value > 2 && disc2pEffect[key as DiscSetKey]) + if (value >= 2 && disc2pEffect[key as DiscSetKey]) for (const [k, v] of Object.entries(disc2pEffect[key as DiscSetKey])) sum[k] = s(k) + v } @@ -36,6 +36,7 @@ export function getSum(baseStats: BaseStats, discs: DiscStats[]) { sum['final_def'] = s('initial_def') * (1 + s('cond_def_')) + s('cond_def') sum['impact'] = s('impact') * (1 + s('impact_')) sum['anomMas'] = s('anomMas') * (1 + s('anomMas_')) + sum['crit_'] = clamp01(sum['crit_']) return sum } diff --git a/libs/zzz/ui/src/Disc/DiscCard.tsx b/libs/zzz/ui/src/Disc/DiscCard.tsx index 716cf236e5..5592c012ad 100644 --- a/libs/zzz/ui/src/Disc/DiscCard.tsx +++ b/libs/zzz/ui/src/Disc/DiscCard.tsx @@ -318,7 +318,7 @@ function SubstatDisplay({ > {' '} - {upgrades > 1 && +{upgrades}} + {upgrades > 1 && +{upgrades - 1}} {displayValue}