From a30b894dd0298b3276492dd21e2be4f9d533eca8 Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:39:57 -0700 Subject: [PATCH 1/7] Fix Scroll duration --- .../src/Artifacts/ScrollOfTheHeroOfCinderCity/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gi/sheets/src/Artifacts/ScrollOfTheHeroOfCinderCity/index.tsx b/libs/gi/sheets/src/Artifacts/ScrollOfTheHeroOfCinderCity/index.tsx index 3bc516d6cb..627e8b839d 100644 --- a/libs/gi/sheets/src/Artifacts/ScrollOfTheHeroOfCinderCity/index.tsx +++ b/libs/gi/sheets/src/Artifacts/ScrollOfTheHeroOfCinderCity/index.tsx @@ -123,7 +123,7 @@ const sheet: SetEffectSheet = { })), { text: stg('duration'), - value: 10, + value: 15, unit: 's', }, ], @@ -156,7 +156,7 @@ const sheet: SetEffectSheet = { })), { text: stg('duration'), - value: 10, + value: 20, unit: 's', }, ], From 112d252e0608227b6d46ef84b444f85e7119ab9f Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:57:06 -0700 Subject: [PATCH 2/7] Fix HMR --- .../src/CharacterDisplay/FormulaModal.tsx | 4 +- .../src/CharacterDisplay/StatModal.tsx | 6 +- libs/gi/ui/src/components/FieldDisplay.tsx | 4 +- .../gi/ui/src/components/OptTargetWrapper.tsx | 55 +++++++++++++++++++ libs/gi/ui/src/components/index.ts | 1 + .../ui/src/components/weapon/WeaponCard.tsx | 4 +- .../src/components/weapon/WeaponCardNano.tsx | 4 +- .../src/components/weapon/WeaponCardPico.tsx | 4 +- .../src/components/weapon/WeaponFullCard.tsx | 4 +- libs/gi/ui/src/context/OptTargetContext.tsx | 54 +----------------- libs/gi/ui/src/context/index.ts | 2 +- libs/gi/ui/src/util/getCalcDisplay.tsx | 8 +-- 12 files changed, 79 insertions(+), 71 deletions(-) create mode 100644 libs/gi/ui/src/components/OptTargetWrapper.tsx diff --git a/libs/gi/page-team/src/CharacterDisplay/FormulaModal.tsx b/libs/gi/page-team/src/CharacterDisplay/FormulaModal.tsx index 0e046695f7..ddf7dc43af 100644 --- a/libs/gi/page-team/src/CharacterDisplay/FormulaModal.tsx +++ b/libs/gi/page-team/src/CharacterDisplay/FormulaModal.tsx @@ -11,7 +11,7 @@ import { AmpReactionModeText, DataContext, FormulaDataContext, - getCalcDisplay, + GetCalcDisplay, getDisplayHeader, getDisplaySections, resolveInfo, @@ -139,7 +139,7 @@ function FormulaAccordian({ node }: { node: CalcResult }) { }, [scrollRef, node, contextNode]) const { variant, subVariant } = resolveInfo(node.info) - const calcDisplay = getCalcDisplay(node) + const calcDisplay = GetCalcDisplay(node) return ( - {getCalcDisplay(specialNode).valueString} + {GetCalcDisplay(specialNode).valueString} ) } diff --git a/libs/gi/ui/src/components/FieldDisplay.tsx b/libs/gi/ui/src/components/FieldDisplay.tsx index 8c25c0a27a..318fece0a7 100644 --- a/libs/gi/ui/src/components/FieldDisplay.tsx +++ b/libs/gi/ui/src/components/FieldDisplay.tsx @@ -26,7 +26,7 @@ import { import type { ReactNode } from 'react' import React, { Suspense, useCallback, useContext, useMemo } from 'react' import { DataContext, FormulaDataContext } from '../context' -import { getCalcDisplay, resolveInfo } from '../util' +import { GetCalcDisplay, resolveInfo } from '../util' import { AmpReactionModeText } from './AmpReactionModeText' export function FieldsDisplay({ @@ -136,7 +136,7 @@ export function NodeFieldDisplay({ const { unit, fixed, variant, subVariant } = resolveInfo( (calcRes?.info ?? compareCalcRes?.info)! ) - const calcDisplay = getCalcDisplay((calcRes ?? compareCalcRes)!) + const calcDisplay = GetCalcDisplay((calcRes ?? compareCalcRes)!) const diff = calcValue - compareCalcValue const pctDiff = diff --git a/libs/gi/ui/src/components/OptTargetWrapper.tsx b/libs/gi/ui/src/components/OptTargetWrapper.tsx new file mode 100644 index 0000000000..f39049bd32 --- /dev/null +++ b/libs/gi/ui/src/components/OptTargetWrapper.tsx @@ -0,0 +1,55 @@ +import type { MainSubStatKey } from '@genshin-optimizer/gi/consts' +import { TeamCharacterContext, useOptConfig } from '@genshin-optimizer/gi/db-ui' +import type { OptNode } from '@genshin-optimizer/gi/wr' +import { forEachNodes } from '@genshin-optimizer/gi/wr' +import type { ReactNode } from 'react' +import { useContext, useMemo } from 'react' +import { DataContext } from '../context/DataContext' +import type { OptTargetContextObj } from '../context/OptTargetContext' +import { + defOptTargetContextObj, + OptTargetContext, +} from '../context/OptTargetContext' +import { optimizeNodesForScaling } from '../util' + +export function OptTargetWrapper({ children }: { children: ReactNode }) { + const { + teamChar: { optConfigId, key: characterKey }, + } = useContext(TeamCharacterContext) + + const buildSetting = useOptConfig(optConfigId)! + const dataContextValue = useContext(DataContext) + const optTargetContextObj = useMemo((): OptTargetContextObj => { + const { statFilters, optimizationTarget } = buildSetting + if (!optimizationTarget) return defOptTargetContextObj + + const { nodes } = optimizeNodesForScaling( + dataContextValue.teamData, + characterKey, + optimizationTarget, + statFilters + ) + if (!nodes) return defOptTargetContextObj + + return { + target: optimizationTarget, + scalesWith: getScalesWith(nodes), + } + }, [buildSetting, characterKey, dataContextValue.teamData]) + + if (!optTargetContextObj) return children + return ( + + {children} + + ) +} + +function getScalesWith(nodes: OptNode[]) { + const scalesWith = new Set() + forEachNodes( + nodes, + (node) => node.operation === 'read' && scalesWith.add(node.path[1]) + ) + return scalesWith as Set +} diff --git a/libs/gi/ui/src/components/index.ts b/libs/gi/ui/src/components/index.ts index 3d702a9006..8c6734595f 100644 --- a/libs/gi/ui/src/components/index.ts +++ b/libs/gi/ui/src/components/index.ts @@ -15,6 +15,7 @@ export * from './InfoComponent' export * from './LevelSelect' export * from './loadout' export * from './NoArtWarning' +export * from './OptTargetWrapper' export * from './PercentBadge' export * from './RefinementDropdown' export * from './StatDisplay' diff --git a/libs/gi/ui/src/components/weapon/WeaponCard.tsx b/libs/gi/ui/src/components/weapon/WeaponCard.tsx index 49f985b7b1..885a0b0c50 100644 --- a/libs/gi/ui/src/components/weapon/WeaponCard.tsx +++ b/libs/gi/ui/src/components/weapon/WeaponCard.tsx @@ -33,7 +33,7 @@ import { import type { ReactNode } from 'react' import { Suspense, useCallback, useMemo } from 'react' import { Trans, useTranslation } from 'react-i18next' -import { getCalcDisplay, resolveInfo } from '../../util' +import { GetCalcDisplay, resolveInfo } from '../../util' import { LocationAutocomplete, LocationName } from '../character' import { WeaponName } from './WeaponTrans' @@ -194,7 +194,7 @@ export function WeaponCardObj({ {icon} {name} - {getCalcDisplay(node).valueString} + {GetCalcDisplay(node).valueString} ) })} diff --git a/libs/gi/ui/src/components/weapon/WeaponCardNano.tsx b/libs/gi/ui/src/components/weapon/WeaponCardNano.tsx index 5b9fb07029..181ea7841e 100644 --- a/libs/gi/ui/src/components/weapon/WeaponCardNano.tsx +++ b/libs/gi/ui/src/components/weapon/WeaponCardNano.tsx @@ -18,7 +18,7 @@ import BusinessCenterIcon from '@mui/icons-material/BusinessCenter' import { Box, CardActionArea, Chip, Typography } from '@mui/material' import type { ReactNode } from 'react' import { useCallback, useMemo } from 'react' -import { getCalcDisplay, resolveInfo } from '../../util' +import { GetCalcDisplay, resolveInfo } from '../../util' import { CharIconSide } from '../character' import { WeaponNameTooltip } from './WeaponNameTooltip' @@ -205,7 +205,7 @@ function WeaponStat({ node }: { node: CalcResult }) { > {icon} - {getCalcDisplay(node).valueString} + {GetCalcDisplay(node).valueString} ) diff --git a/libs/gi/ui/src/components/weapon/WeaponCardPico.tsx b/libs/gi/ui/src/components/weapon/WeaponCardPico.tsx index 17a190db70..b0f3170182 100644 --- a/libs/gi/ui/src/components/weapon/WeaponCardPico.tsx +++ b/libs/gi/ui/src/components/weapon/WeaponCardPico.tsx @@ -10,7 +10,7 @@ import { getLevelString } from '@genshin-optimizer/gi/util' import { dataObjForWeapon, uiInput as input } from '@genshin-optimizer/gi/wr' import { Box, Typography } from '@mui/material' import { useMemo } from 'react' -import { getCalcDisplay, resolveInfo } from '../../util' +import { GetCalcDisplay, resolveInfo } from '../../util' import { WeaponNameTooltip } from './WeaponNameTooltip' export function WeaponCardPico({ weaponId }: { weaponId: string }) { @@ -98,7 +98,7 @@ function WeaponStatPico({ node }: { node: CalcResult }) { const { icon } = resolveInfo(node.info) return ( - {icon} {getCalcDisplay(node).valueString} + {icon} {GetCalcDisplay(node).valueString} ) } diff --git a/libs/gi/ui/src/components/weapon/WeaponFullCard.tsx b/libs/gi/ui/src/components/weapon/WeaponFullCard.tsx index 21ebea2e04..f477cab08c 100644 --- a/libs/gi/ui/src/components/weapon/WeaponFullCard.tsx +++ b/libs/gi/ui/src/components/weapon/WeaponFullCard.tsx @@ -12,7 +12,7 @@ import { getLevelString } from '@genshin-optimizer/gi/util' import { dataObjForWeapon, uiInput as input } from '@genshin-optimizer/gi/wr' import { Box, Typography } from '@mui/material' import { useMemo } from 'react' -import { getCalcDisplay, resolveInfo } from '../../util' +import { GetCalcDisplay, resolveInfo } from '../../util' import { WeaponName } from './WeaponTrans' export function WeaponFullCard({ weaponId }: { weaponId: string }) { const weapon = useWeapon(weaponId) @@ -88,7 +88,7 @@ function WeaponStat({ node }: { node: CalcResult }) { const { icon } = resolveInfo(node.info) return Number.isNaN(node.value) ? null : ( - {icon} {getCalcDisplay(node).valueString} + {icon} {GetCalcDisplay(node).valueString} ) } diff --git a/libs/gi/ui/src/context/OptTargetContext.tsx b/libs/gi/ui/src/context/OptTargetContext.tsx index ce7a7de520..916f27fabd 100644 --- a/libs/gi/ui/src/context/OptTargetContext.tsx +++ b/libs/gi/ui/src/context/OptTargetContext.tsx @@ -1,59 +1,11 @@ import type { MainSubStatKey } from '@genshin-optimizer/gi/consts' -import { TeamCharacterContext, useOptConfig } from '@genshin-optimizer/gi/db-ui' -import type { OptNode } from '@genshin-optimizer/gi/wr' -import { forEachNodes } from '@genshin-optimizer/gi/wr' -import type { ReactNode } from 'react' -import { createContext, useContext, useMemo } from 'react' -import { optimizeNodesForScaling } from '../util' -import { DataContext } from './DataContext' -type OptTargetContextObj = { +import { createContext } from 'react' +export type OptTargetContextObj = { target: string[] | undefined scalesWith: Set } -const defOptTargetContextObj = { +export const defOptTargetContextObj = { target: undefined, scalesWith: new Set(), } as OptTargetContextObj export const OptTargetContext = createContext(defOptTargetContextObj) - -export function OptTargetWrapper({ children }: { children: ReactNode }) { - const { - teamChar: { optConfigId, key: characterKey }, - } = useContext(TeamCharacterContext) - - const buildSetting = useOptConfig(optConfigId)! - const dataContextValue = useContext(DataContext) - const optTargetContextObj = useMemo((): OptTargetContextObj => { - const { statFilters, optimizationTarget } = buildSetting - if (!optimizationTarget) return defOptTargetContextObj - - const { nodes } = optimizeNodesForScaling( - dataContextValue.teamData, - characterKey, - optimizationTarget, - statFilters - ) - if (!nodes) return defOptTargetContextObj - - return { - target: optimizationTarget, - scalesWith: getScalesWith(nodes), - } - }, [buildSetting, characterKey, dataContextValue.teamData]) - - if (!optTargetContextObj) return children - return ( - - {children} - - ) -} - -function getScalesWith(nodes: OptNode[]) { - const scalesWith = new Set() - forEachNodes( - nodes, - (node) => node.operation === 'read' && scalesWith.add(node.path[1]) - ) - return scalesWith as Set -} diff --git a/libs/gi/ui/src/context/index.ts b/libs/gi/ui/src/context/index.ts index 9a645ecc5f..66bfa7345a 100644 --- a/libs/gi/ui/src/context/index.ts +++ b/libs/gi/ui/src/context/index.ts @@ -1,6 +1,6 @@ export * from './DataContext' export * from './FormulaDataContext' export * from './GraphContext' -export * from './OptTargetContext' +export { OptTargetContext } from './OptTargetContext' export * from './SillyContext' export * from './SnowContext' diff --git a/libs/gi/ui/src/util/getCalcDisplay.tsx b/libs/gi/ui/src/util/getCalcDisplay.tsx index ca0b319009..531740096d 100644 --- a/libs/gi/ui/src/util/getCalcDisplay.tsx +++ b/libs/gi/ui/src/util/getCalcDisplay.tsx @@ -73,7 +73,7 @@ function SourceDisplay({ source }: { source: string | undefined }) { return null } -export function getCalcDisplay( +export function GetCalcDisplay( node: CalcResult ): CalcDisplay { if ((node as any)[displayKey]) { @@ -151,12 +151,12 @@ function computeFormulaDisplay( prec: Infinity, formula: '', valueString: valueString(node.value, info.unit, info.fixed), - formulas: [...new Set(ops.flatMap((op) => getCalcDisplay(op).formulas))], + formulas: [...new Set(ops.flatMap((op) => GetCalcDisplay(op).formulas))], } const components: ReactNode[] = [] function addComponents(node: CalcResult, p: number) { - const display = getCalcDisplay(node) + const display = GetCalcDisplay(node) if (p > display.prec) components.push('(') if (display.name && (node.info.pivot || node.meta.op === 'const')) components.push( @@ -177,7 +177,7 @@ function computeFormulaDisplay( case 'mul': case 'min': case 'max': { - if (ops.length === 1) result.prec = getCalcDisplay(ops[0]).prec + if (ops.length === 1) result.prec = GetCalcDisplay(ops[0]).prec else result.prec = details[op].prec const { head, sep, tail, prec } = details[op] components.push(head) From b83d330fb5908b3000236750dec25adca33319ed Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Sat, 12 Oct 2024 08:57:18 -0700 Subject: [PATCH 3/7] Fix Clorinde duration --- libs/gi/sheets/src/Characters/Clorinde/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/gi/sheets/src/Characters/Clorinde/index.tsx b/libs/gi/sheets/src/Characters/Clorinde/index.tsx index c248a1e574..dca13920ef 100644 --- a/libs/gi/sheets/src/Characters/Clorinde/index.tsx +++ b/libs/gi/sheets/src/Characters/Clorinde/index.tsx @@ -64,8 +64,8 @@ const dm = { thrust3Heal: skillParam_gen.skill[s++][0], bondHealConvert: skillParam_gen.skill[s++][0], bladeDmg: skillParam_gen.skill[s++], + bladeInterval: skillParam_gen.skill[s++][0], duration: skillParam_gen.skill[s++][0], - idk9: skillParam_gen.skill[s++][0], cd: skillParam_gen.skill[s++][0], }, burst: { @@ -411,10 +411,16 @@ const sheet: TalentSheet = { name: ct.chg(`skill.skillParams.5`), }), }, + { + text: ct.chg('skill.skillParams.6'), + value: dm.skill.bladeInterval, + unit: 's', + }, { text: stg('duration'), value: dm.skill.duration, unit: 's', + fixed: 1, }, { text: stg('cd'), From e3391fb7f6d54ac4269300aaa0a32b348ba5453f Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Sat, 12 Oct 2024 09:02:24 -0700 Subject: [PATCH 4/7] Fix inconsistent spacing --- libs/gi/ui/src/components/FieldDisplay.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/gi/ui/src/components/FieldDisplay.tsx b/libs/gi/ui/src/components/FieldDisplay.tsx index 318fece0a7..d58afc9371 100644 --- a/libs/gi/ui/src/components/FieldDisplay.tsx +++ b/libs/gi/ui/src/components/FieldDisplay.tsx @@ -87,7 +87,12 @@ export function BasicFieldDisplay({ return ( From 2e3be7bc99ea2ddd85ca27e703caf36c6e9329ec Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Sat, 12 Oct 2024 09:06:17 -0700 Subject: [PATCH 5/7] Fix Sethos multipliers --- libs/gi/sheets/src/Characters/Sethos/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/gi/sheets/src/Characters/Sethos/index.tsx b/libs/gi/sheets/src/Characters/Sethos/index.tsx index 74f1a56df2..767f9022fb 100644 --- a/libs/gi/sheets/src/Characters/Sethos/index.tsx +++ b/libs/gi/sheets/src/Characters/Sethos/index.tsx @@ -42,17 +42,17 @@ const dm = { skillParam_gen.auto[a++], // 3 ], }, - plunging: { - dmg: skillParam_gen.auto[a++], - low: skillParam_gen.auto[a++], - high: skillParam_gen.auto[a++], - }, charged: { aimed: skillParam_gen.auto[a++], fullyAimed: skillParam_gen.auto[a++], shadowAtk: skillParam_gen.auto[a++], shadowEm: skillParam_gen.auto[a++], }, + plunging: { + dmg: skillParam_gen.auto[a++], + low: skillParam_gen.auto[a++], + high: skillParam_gen.auto[a++], + }, skill: { dmg: skillParam_gen.skill[s++], energyRegen: skillParam_gen.skill[s++][0], From 9e52e14ec463520ffbdfd21439c298f05bfbd269 Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Sat, 12 Oct 2024 10:12:32 -0700 Subject: [PATCH 6/7] Fix Xilonen sheet logic --- .../assets/locales/en/char_Xilonen.json | 5 +- .../sheets/src/Characters/Xilonen/index.tsx | 95 +++++++++++++------ 2 files changed, 70 insertions(+), 30 deletions(-) diff --git a/libs/gi/localization/assets/locales/en/char_Xilonen.json b/libs/gi/localization/assets/locales/en/char_Xilonen.json index c6b9978531..48e8340e69 100644 --- a/libs/gi/localization/assets/locales/en/char_Xilonen.json +++ b/libs/gi/localization/assets/locales/en/char_Xilonen.json @@ -1,6 +1,7 @@ { - "sourceCond": "Source Samples are active", - "geoSourceActive": "Geo Source Sample activated", + "sourceCond": "Nighsoul Points hit the maximum", + "sourceActive": "Source Samples activated", + "geoSourceActive": "Geo Source Sample activated", "c4Cond": "Under the Blooming Blessing effect", "c6Cond": "In the Imperishable Night's Blessing state", "ns_dmg": "Blade Roller Plunge DMG", diff --git a/libs/gi/sheets/src/Characters/Xilonen/index.tsx b/libs/gi/sheets/src/Characters/Xilonen/index.tsx index 5951747a65..db8065845b 100644 --- a/libs/gi/sheets/src/Characters/Xilonen/index.tsx +++ b/libs/gi/sheets/src/Characters/Xilonen/index.tsx @@ -14,7 +14,6 @@ import { sum, tally, target, - threshold, } from '@genshin-optimizer/gi/wr' import { cond, st, stg } from '../../SheetUtil' import { CharacterSheet } from '../CharacterSheet' @@ -114,18 +113,13 @@ const [condSourceActivePath, condSourceActive] = cond(key, 'sourceActive') const [condNsBlessingPath, condNsBlessing] = cond(key, 'nsBlessing') const buffableEle = ['pyro', 'hydro', 'cryo', 'electro'] as const const convertedSources = sum(...buffableEle.map((ele) => tally[ele])) -const geoSourcePossible = threshold( - input.constellation, - 2, - 1, - threshold(convertedSources, 3, equal(condNsBlessing, 'on', 1), 1) -) +const geoSourcePossible = lessThan(convertedSources, 3, 1) const skill_enemyRes_ = subscript(input.total.skillIndex, dm.skill.enemyRes_, { unit: '%', }) -const sourceActive_geo_enemyRes_ = equal( - condSourceActive, - 'on', +const sourceActive_geo_enemyRes_ = greaterEq( + sum(equal(condSourceActive, 'on', 1), equal(condNsBlessing, 'on', 1)), + 1, equal(geoSourcePossible, 1, skill_enemyRes_) ) const sourceActive_other_enemyRes_ = objKeyValMap(buffableEle, (ele) => [ @@ -158,13 +152,21 @@ const c2_sourceActive_geo_all_dmg_ = greaterEq( equal( condSourceActive, 'on', - equal(target.charEle, 'geo', dm.constellation2.geo_critDMG_) + equal( + geoSourcePossible, + 1, + equal(target.charEle, 'geo', dm.constellation2.geo_critDMG_) + ) ) ) const c2_sourceActive_pyro_atk_disp = greaterEq( input.constellation, 2, - equal(condSourceActive, 'on', dm.constellation2.pyro_atk_), + greaterEq( + tally.pyro, + 1, + equal(condSourceActive, 'on', dm.constellation2.pyro_atk_) + ), { path: 'atk_', isTeamBuff: true } ) const c2_sourceActive_pyro_atk_ = equal( @@ -175,7 +177,11 @@ const c2_sourceActive_pyro_atk_ = equal( const c2_sourceActive_hydro_hp_disp = greaterEq( input.constellation, 2, - equal(condSourceActive, 'on', dm.constellation2.hydro_hp_), + greaterEq( + tally.hydro, + 1, + equal(condSourceActive, 'on', dm.constellation2.hydro_hp_) + ), { path: 'hp_', isTeamBuff: true } ) const c2_sourceActive_hydro_hp_ = equal( @@ -186,7 +192,11 @@ const c2_sourceActive_hydro_hp_ = equal( const c2_sourceActive_cryo_critDMG_disp = greaterEq( input.constellation, 2, - equal(condSourceActive, 'on', dm.constellation2.cryo_critDMG_), + greaterEq( + tally.cryo, + 1, + equal(condSourceActive, 'on', dm.constellation2.cryo_critDMG_) + ), { path: 'critDMG_', isTeamBuff: true } ) const c2_sourceActive_cryo_critDMG_ = equal( @@ -367,6 +377,17 @@ const sheet: TalentSheet = { }, ], }, + ct.headerTem('passive1', { + canShow: lessThan(convertedSources, 2, 1), + fields: [ + { + node: a1_normal_dmg_, + }, + { + node: a1_plunging_dmg_, + }, + ], + }), ]), skill: ct.talentTem('skill', [ @@ -402,14 +423,12 @@ const sheet: TalentSheet = { on: { fields: [ { - node: sourceActive_geo_enemyRes_, + text: ct.ch('sourceActive'), }, - ...Object.values(sourceActive_other_enemyRes_).map((node) => ({ - node, - })), { text: stg('duration'), value: dm.skill.sourceDuration, + unit: 's', }, ], }, @@ -419,6 +438,7 @@ const sheet: TalentSheet = { path: condNsBlessingPath, value: condNsBlessing, name: st('nightsoul.blessing'), + canShow: equal(geoSourcePossible, 1, 1), teamBuff: true, states: { on: { @@ -430,34 +450,53 @@ const sheet: TalentSheet = { }, }, }), - ct.headerTem('passive1', { + ct.headerTem('skill', { + teamBuff: true, fields: [ { - node: a1_normal_dmg_, - }, - { - node: a1_plunging_dmg_, + node: sourceActive_geo_enemyRes_, }, + ...Object.values(sourceActive_other_enemyRes_).map((node) => ({ + node, + })), ], }), ct.headerTem('constellation2', { - canShow: equal(condSourceActive, 'on', 1), teamBuff: true, + // Only show when any Source Sample is active + canShow: greaterEq( + sum(equal(geoSourcePossible, 1, 1), equal(condSourceActive, 'on', 1)), + 1, + 1 + ), fields: [ { + canShow: (data) => data.get(geoSourcePossible).value === 1, text: ct.ch('geoSourceActive'), }, { - node: c2_sourceActive_geo_all_dmg_, + node: infoMut( + { ...c2_sourceActive_geo_all_dmg_ }, + { variant: 'geo' } + ), }, { - node: c2_sourceActive_pyro_atk_disp, + node: infoMut( + { ...c2_sourceActive_pyro_atk_disp }, + { variant: 'pyro' } + ), }, { - node: c2_sourceActive_hydro_hp_disp, + node: infoMut( + { ...c2_sourceActive_hydro_hp_disp }, + { variant: 'hydro' } + ), }, { - node: c2_sourceActive_cryo_critDMG_disp, + node: infoMut( + { ...c2_sourceActive_cryo_critDMG_disp }, + { variant: 'cryo' } + ), }, ], }), From e49bd497426ec37523dc92ed6fc42a3345aacf31 Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Sat, 12 Oct 2024 10:25:49 -0700 Subject: [PATCH 7/7] Fix error --- libs/gi/page-archive/src/TabWeapon.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/gi/page-archive/src/TabWeapon.tsx b/libs/gi/page-archive/src/TabWeapon.tsx index c99570856e..5923f19b74 100644 --- a/libs/gi/page-archive/src/TabWeapon.tsx +++ b/libs/gi/page-archive/src/TabWeapon.tsx @@ -23,9 +23,9 @@ import { i18n } from '@genshin-optimizer/gi/i18n' import { getWeaponSheet } from '@genshin-optimizer/gi/sheets' import { getWeaponStat } from '@genshin-optimizer/gi/stats' import { + GetCalcDisplay, SubstatMultiAutocomplete, WeaponName, - getCalcDisplay, resolveInfo, } from '@genshin-optimizer/gi/ui' import type { CalcResult } from '@genshin-optimizer/gi/uidata' @@ -126,8 +126,8 @@ export default function TabWeapon() { const mainNode = weaponUIData.get(input.weapon.main) const subNode = weaponUIData.get(input.weapon.sub) cache.set(wKey, { - main: getCalcDisplay(mainNode).valueString, - sub: getCalcDisplay(subNode).valueString, + main: GetCalcDisplay(mainNode).valueString, + sub: GetCalcDisplay(subNode).valueString, }) }) return cache @@ -367,7 +367,7 @@ function StatDisplay({ node }: { node: CalcResult }) { {icon} {name} - {getCalcDisplay(node).valueString} + {GetCalcDisplay(node).valueString} ) }