diff --git a/apps/frontend/src/app/Data/Characters/HuTao/index.tsx b/apps/frontend/src/app/Data/Characters/HuTao/index.tsx index e5d5fc7984..a95058c15a 100644 --- a/apps/frontend/src/app/Data/Characters/HuTao/index.tsx +++ b/apps/frontend/src/app/Data/Characters/HuTao/index.tsx @@ -1,7 +1,7 @@ import type { CharacterKey, ElementKey } from '@genshin-optimizer/gi/consts' import { allElementWithPhyKeys } from '@genshin-optimizer/gi/consts' import { allStats } from '@genshin-optimizer/gi/stats' -import { input, target } from '../../../Formula' +import { input } from '../../../Formula' import { equal, equalStr, @@ -111,18 +111,20 @@ const atk = equal( const infusion = equalStr('on', condAfterlife, elementKey) const [condA1Path, condA1] = cond(key, 'FlutterBy') -const critRateTeam_1Disp = greaterEq( +const critRateTeam_1 = greaterEq( input.asc, 1, - equal('on', condA1, percent(dm.passive1.critRateInc), { - ...KeyMap.info('critRate_'), - isTeamBuff: true, - }) + equal( + 'on', + condA1, + unequal( + input.activeCharKey, + input.charKey, + percent(dm.passive1.critRateInc), + { ...KeyMap.info('critRate_'), isTeamBuff: true } + ) + ) ) -const critRateTeam_1 = unequal(key, target.charKey, critRateTeam_1Disp, { - ...KeyMap.info('critRate_'), - isTeamBuff: true, -}) const [condA4Path, condA4] = cond(key, 'SanguineRouge') const pyro_dmg_ = greaterEq( input.asc, @@ -131,18 +133,20 @@ const pyro_dmg_ = greaterEq( ) const [condC4Path, condC4] = cond(key, 'GardenOfEternalRest') -const critRateTeam_2Disp = greaterEq( +const critRateTeam_2 = greaterEq( input.constellation, 4, - equal('on', condC4, percent(dm.constellation4.critRateInc), { - ...KeyMap.info('critRate_'), - isTeamBuff: true, - }) + equal( + 'on', + condC4, + unequal( + input.activeCharKey, + input.charKey, + percent(dm.constellation4.critRateInc), + { ...KeyMap.info('critRate_'), isTeamBuff: true } + ) + ) ) -const critRateTeam_2 = unequal(key, target.charKey, critRateTeam_2Disp, { - ...KeyMap.info('critRate_'), - isTeamBuff: true, -}) const [condC6Path, condC6] = cond(key, 'ButterflysEmbrace') const critRate_ = greaterEq( @@ -401,12 +405,13 @@ const sheet: ICharacterSheet = { value: condA1, path: condA1Path, teamBuff: true, + canShow: unequal(input.activeCharKey, input.charKey, 1), name: ct.ch('paramita.end'), states: { on: { fields: [ { - node: critRateTeam_1Disp, + node: critRateTeam_1, }, { text: stg('duration'), @@ -445,12 +450,13 @@ const sheet: ICharacterSheet = { value: condC4, path: condC4Path, teamBuff: true, + canShow: unequal(input.activeCharKey, input.charKey, 1), name: ct.ch('constellation4.condName'), states: { on: { fields: [ { - node: critRateTeam_2Disp, + node: critRateTeam_2, }, { text: stg('duration'), diff --git a/apps/frontend/src/app/Data/Characters/RaidenShogun/index.tsx b/apps/frontend/src/app/Data/Characters/RaidenShogun/index.tsx index 40215e0fd4..290591b47a 100644 --- a/apps/frontend/src/app/Data/Characters/RaidenShogun/index.tsx +++ b/apps/frontend/src/app/Data/Characters/RaidenShogun/index.tsx @@ -1,7 +1,7 @@ import { objKeyMap } from '@genshin-optimizer/common/util' import type { CharacterKey } from '@genshin-optimizer/gi/consts' import { allStats } from '@genshin-optimizer/gi/stats' -import { input, target } from '../../../Formula' +import { input } from '../../../Formula' import { constant, equal, @@ -15,7 +15,6 @@ import { sum, unequal, } from '../../../Formula/utils' -import KeyMap from '../../../KeyMap' import { cond, st, stg } from '../../SheetUtil' import CharacterSheet from '../CharacterSheet' import type { ICharacterSheet } from '../ICharacterSheet.d' @@ -125,7 +124,9 @@ function skillDmg(atkType: number[]) { const energyCosts = [40, 50, 60, 70, 80, 90] const [condSkillEyeTeamPath, condSkillEyeTeam] = cond(key, 'skillEyeTeam') -const skillEyeTeamBurstDmgIncDisp = infoMut( +const skillEyeTeamBurstDmgInc = unequal( + input.activeCharKey, + input.charKey, prod( lookup( condSkillEyeTeam, @@ -136,13 +137,7 @@ const skillEyeTeamBurstDmgIncDisp = infoMut( fixed: 2, unit: '%', }) - ), - { ...KeyMap.info('burst_dmg_'), isTeamBuff: true } -) -const skillEyeTeamBurstDmgInc = unequal( - key, - target.charKey, - skillEyeTeamBurstDmgIncDisp + ) ) const resolveStacks = [10, 20, 30, 40, 50, 60] @@ -211,7 +206,7 @@ const c4AtkBonus_ = greaterEq( equal( 'c4', condC4, - unequal(input.activeCharKey, target.charKey, dm.constellation4.atk_bonus) + unequal(input.activeCharKey, input.charKey, dm.constellation4.atk_bonus) ) ) @@ -392,6 +387,7 @@ const sheet: ICharacterSheet = { value: condSkillEyeTeam, path: condSkillEyeTeamPath, teamBuff: true, + canShow: unequal(input.activeCharKey, input.charKey, 1), name: ct.ch('skill.partyCost'), states: Object.fromEntries( energyCosts.map((c) => [ @@ -400,7 +396,7 @@ const sheet: ICharacterSheet = { name: `${c}`, fields: [ { - node: skillEyeTeamBurstDmgIncDisp, + node: skillEyeTeamBurstDmgInc, }, ], }, @@ -583,7 +579,7 @@ const sheet: ICharacterSheet = { value: condC4, path: condC4Path, teamBuff: true, - canShow: unequal(input.activeCharKey, target.charKey, 1), + canShow: unequal(input.activeCharKey, input.charKey, 1), name: ct.ch('c4.expires'), states: { c4: { diff --git a/apps/frontend/src/app/Data/SheetUtil.tsx b/apps/frontend/src/app/Data/SheetUtil.tsx index cbb97daa94..96aa0d5d08 100644 --- a/apps/frontend/src/app/Data/SheetUtil.tsx +++ b/apps/frontend/src/app/Data/SheetUtil.tsx @@ -86,12 +86,12 @@ function NameTrans({ } export function activeCharBuff( - buffTargetKey: string | StrNode, + key: string | StrNode, node: NumNode, info: Info ) { return [ infoMut(node, { ...info, isTeamBuff: true }), - equal(input.activeCharKey, buffTargetKey, node), + equal(input.activeCharKey, key, node), ] } diff --git a/apps/frontend/src/app/Data/Weapons/Catalyst/AThousandFloatingDreams/index.tsx b/apps/frontend/src/app/Data/Weapons/Catalyst/AThousandFloatingDreams/index.tsx index df4190f1ab..23f75eabf8 100644 --- a/apps/frontend/src/app/Data/Weapons/Catalyst/AThousandFloatingDreams/index.tsx +++ b/apps/frontend/src/app/Data/Weapons/Catalyst/AThousandFloatingDreams/index.tsx @@ -62,7 +62,6 @@ const team_eleMasDisp = equal( subscript(input.weapon.refinement, team_eleMasArr), { ...KeyMap.info('eleMas'), isTeamBuff: true } ) -// Apply to non-equipped character const team_eleMas = unequal(input.charKey, target.charKey, team_eleMasDisp) export const data = dataObjForWeaponSheet(key, data_gen, { diff --git a/apps/frontend/src/app/Data/Weapons/Catalyst/ThrillingTalesOfDragonSlayers/index.tsx b/apps/frontend/src/app/Data/Weapons/Catalyst/ThrillingTalesOfDragonSlayers/index.tsx index fdb5ff6e25..bdff61d367 100644 --- a/apps/frontend/src/app/Data/Weapons/Catalyst/ThrillingTalesOfDragonSlayers/index.tsx +++ b/apps/frontend/src/app/Data/Weapons/Catalyst/ThrillingTalesOfDragonSlayers/index.tsx @@ -40,6 +40,7 @@ const sheet: IWeaponSheet = { value: condPassive, path: condPassivePath, name: trm('condName'), + canShow: unequal(input.activeCharKey, input.charKey, 1), teamBuff: true, header: headerTemplate(key, st('conditional')), states: { diff --git a/apps/frontend/src/app/Data/Weapons/Catalyst/WanderingEvenstar/index.tsx b/apps/frontend/src/app/Data/Weapons/Catalyst/WanderingEvenstar/index.tsx index 98d06c2b79..2c80a85fe3 100644 --- a/apps/frontend/src/app/Data/Weapons/Catalyst/WanderingEvenstar/index.tsx +++ b/apps/frontend/src/app/Data/Weapons/Catalyst/WanderingEvenstar/index.tsx @@ -28,7 +28,6 @@ const selfAtk = equal( ) ) const teamAtkDisp = equal(input.weapon.key, key, prod(percent(0.3), selfAtk)) -// Apply to non-equipped character const teamAtk = unequal(input.activeCharKey, input.charKey, teamAtkDisp) const data = dataObjForWeaponSheet( diff --git a/apps/frontend/src/app/Data/Weapons/Claymore/MakhairaAquamarine/index.tsx b/apps/frontend/src/app/Data/Weapons/Claymore/MakhairaAquamarine/index.tsx index 7e9f5c4a4e..85b686d1a6 100644 --- a/apps/frontend/src/app/Data/Weapons/Claymore/MakhairaAquamarine/index.tsx +++ b/apps/frontend/src/app/Data/Weapons/Claymore/MakhairaAquamarine/index.tsx @@ -28,7 +28,6 @@ const selfAtk = equal( ) ) const teamAtkDisp = equal(input.weapon.key, key, prod(percent(0.3), selfAtk)) -// Apply to non-equipped character const teamAtk = unequal(input.activeCharKey, input.charKey, teamAtkDisp) const data = dataObjForWeaponSheet( diff --git a/apps/frontend/src/app/Data/Weapons/Polearm/CalamityQueller/index.tsx b/apps/frontend/src/app/Data/Weapons/Polearm/CalamityQueller/index.tsx index c11ae23a25..51e6ded61c 100644 --- a/apps/frontend/src/app/Data/Weapons/Polearm/CalamityQueller/index.tsx +++ b/apps/frontend/src/app/Data/Weapons/Polearm/CalamityQueller/index.tsx @@ -9,6 +9,7 @@ import { lookup, prod, subscript, + unequal, } from '../../../../Formula/utils' import { cond, st, trans } from '../../../SheetUtil' import type { IWeaponSheet } from '../../IWeaponSheet' @@ -21,6 +22,7 @@ const data_gen = allStats.weapon.data[key] const [, trm] = trans('weapon', key) const [condStackPath, condStack] = cond(key, 'stack') +const [condOffFieldPath, condOffField] = cond(key, 'offField') const dmg_ = [-1, 0.12, 0.15, 0.18, 0.21, 0.24] const atk_ = [-1, 0.032, 0.04, 0.048, 0.056, 0.064] @@ -33,10 +35,10 @@ const dmg_Nodes = Object.fromEntries( ) const atkInc = prod( compareEq( - input.charKey, - input.activeCharKey, - constant(1, { name: trm('active') }), - constant(2, { name: trm('inactive') }) + condOffField, + 'on', + constant(2, { name: trm('inactive') }), + constant(1, { name: trm('active') }) ), lookup( condStack, @@ -78,6 +80,19 @@ const sheet: IWeaponSheet = { ]) ), }, + { + canShow: unequal(condStack, undefined, 1), + value: condOffField, + path: condOffFieldPath, + teamBuff: true, + header: headerTemplate(key, st('conditional')), + name: st('charOffField'), + states: { + on: { + fields: [], + }, + }, + }, ], } export default new WeaponSheet(key, sheet, data_gen, data) diff --git a/apps/frontend/src/app/Data/Weapons/Sword/SwordOfDescension/index.tsx b/apps/frontend/src/app/Data/Weapons/Sword/SwordOfDescension/index.tsx index 92f9f36dbc..16aa6e7e18 100644 --- a/apps/frontend/src/app/Data/Weapons/Sword/SwordOfDescension/index.tsx +++ b/apps/frontend/src/app/Data/Weapons/Sword/SwordOfDescension/index.tsx @@ -21,7 +21,6 @@ import { dataObjForWeaponSheet } from '../../util' const key: WeaponKey = 'SwordOfDescension' const data_gen = allStats.weapon.data[key] -// Check equipped character is Traveler const atk = lookup( input.charKey, objKeyMap(allTravelerKeys, (_) => constant(66)), diff --git a/apps/frontend/src/app/Data/Weapons/Sword/XiphosMoonlight/index.tsx b/apps/frontend/src/app/Data/Weapons/Sword/XiphosMoonlight/index.tsx index 9ec05489a0..643a58ea7b 100644 --- a/apps/frontend/src/app/Data/Weapons/Sword/XiphosMoonlight/index.tsx +++ b/apps/frontend/src/app/Data/Weapons/Sword/XiphosMoonlight/index.tsx @@ -1,6 +1,6 @@ import type { WeaponKey } from '@genshin-optimizer/gi/consts' import { allStats } from '@genshin-optimizer/gi/stats' -import { input, target } from '../../../../Formula' +import { input } from '../../../../Formula' import { equal, infoMut, @@ -35,8 +35,11 @@ const teamEnerRech_disp = equal( key, prod(percent(0.3), selfEnerRech_) ) -// Apply to non-equipped character -const teamEnerRech_ = unequal(input.charKey, target.charKey, teamEnerRech_disp) +const teamEnerRech_ = unequal( + input.activeCharKey, + input.charKey, + teamEnerRech_disp +) const data = dataObjForWeaponSheet( key,