From 2072af6681c4a40f7747f334dd95ded488991851 Mon Sep 17 00:00:00 2001 From: Van Nguyen <36019388+nguyentvan7@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:58:29 -0700 Subject: [PATCH] Fix Peak Patrol Song issues --- .../Weapons/Sword/PeakPatrolSong/index.tsx | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/libs/gi/sheets/src/Weapons/Sword/PeakPatrolSong/index.tsx b/libs/gi/sheets/src/Weapons/Sword/PeakPatrolSong/index.tsx index 1cdf2bad3e..354ca7fd9e 100644 --- a/libs/gi/sheets/src/Weapons/Sword/PeakPatrolSong/index.tsx +++ b/libs/gi/sheets/src/Weapons/Sword/PeakPatrolSong/index.tsx @@ -1,6 +1,5 @@ -import { objKeyMap, range } from '@genshin-optimizer/common/util' -import { type WeaponKey } from '@genshin-optimizer/gi/consts' -import { allEleDmgKeys } from '@genshin-optimizer/gi/keymap' +import { objKeyMap, objKeyValMap, range } from '@genshin-optimizer/common/util' +import { allElementKeys, type WeaponKey } from '@genshin-optimizer/gi/consts' import { equal, input, @@ -9,8 +8,6 @@ import { naught, prod, subscript, - target, - unequal, } from '@genshin-optimizer/gi/wr' import { cond, st, stg, trans } from '../../../SheetUtil' import type { IWeaponSheet } from '../../IWeaponSheet' @@ -31,7 +28,8 @@ const odeStacks_def_ = lookup( ), naught ) -const odeStacks_ele_dmg_ = objKeyMap(allEleDmgKeys, () => +const odeStacks_ele_dmg_ = objKeyValMap(allElementKeys, (ele) => [ + `${ele}_dmg_`, lookup( condOdeStacks, objKeyMap(odeStacksArr, (stack) => @@ -41,26 +39,23 @@ const odeStacks_ele_dmg_ = objKeyMap(allEleDmgKeys, () => ) ), naught - ) -) + ), +]) const [condOdeMaxedPath, condOdeMaxed] = cond(key, 'odeMaxed') const ele_dmg_arr = [-1, 0.08, 0.1, 0.12, 0.14, 0.16] const defFactor = prod(min(input.total.def, 3200), 1 / 1000) -const ele_dmg_disp = objKeyMap(allEleDmgKeys, (key) => +const ele_dmg_ = objKeyValMap(allElementKeys, (key) => [ + `${key}_dmg_`, equal( condOdeMaxed, 'on', prod( defFactor, subscript(input.weapon.refinement, ele_dmg_arr, { unit: '%' }) - ), - { path: key, isTeamBuff: true } - ) -) -const ele_dmg_ = objKeyMap(allEleDmgKeys, (key) => - unequal(input.charKey, target.charKey, ele_dmg_disp[key]) -) + ) + ), +]) const data = dataObjForWeaponSheet(key, { premod: { @@ -105,7 +100,7 @@ const sheet: IWeaponSheet = { states: { on: { fields: [ - ...Object.values(ele_dmg_disp).map((node) => ({ node })), + ...Object.values(ele_dmg_).map((node) => ({ node })), { text: stg('duration'), value: 15, unit: 's' }, ], },