Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Peak Patrol Song issues #2502

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions libs/gi/sheets/src/Weapons/Sword/PeakPatrolSong/index.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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'
Expand All @@ -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) =>
Expand All @@ -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: {
Expand Down Expand Up @@ -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' },
],
},
Expand Down
Loading