Skip to content

Commit

Permalink
Fix misc sheet issues (#2593)
Browse files Browse the repository at this point in the history
* Fix Citlali C1 buff

* Add header for Mav claymore

* Add Mavuika c2 def exception until c6

* Change Citlali c2 to only apply to active char
  • Loading branch information
nguyentvan7 authored Jan 10, 2025
1 parent 451d0e2 commit 2c28359
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 35 deletions.
3 changes: 2 additions & 1 deletion libs/gi/localization/assets/locales/en/char_Mavuika.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"c1Cond": "After gaining Fighting Spirit",
"c2RingCond": "In Ring of Searing Radiance form",
"c2FlameCond": "In Flamestrider form",
"flamestriderDmg": "Flamestrider DMG"
"flamestriderDmg": "Flamestrider DMG",
"c2Exception": "Enemy DEF Reduction will not apply to Flamestrider or Burst hits until C6"
}
51 changes: 35 additions & 16 deletions libs/gi/sheets/src/Characters/Citlali/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { objKeyMap, range } from '@genshin-optimizer/common/util'
import {
objKeyMap,
objKeyValMap,
objMap,
range,
} from '@genshin-optimizer/common/util'
import type { CharacterKey } from '@genshin-optimizer/gi/consts'
import { allStats } from '@genshin-optimizer/gi/stats'
import {
Expand Down Expand Up @@ -150,14 +155,24 @@ const a4IceStorm_dmgInc = greaterEq(
)

const [condC1BladeConsumePath, condC1BladeConsume] = cond(key, 'c1BladeConsume')
const c1BladeConsume_dmgInc = greaterEq(
input.constellation,
1,
equal(
condC1BladeConsume,
'on',
prod(input.total.eleMas, percent(dm.constellation1.dmgInc))
)
const c1BladeConsume_dmgInc_disp = objKeyValMap(
['normal', 'charged', 'plunging', 'skill', 'burst'],
(key) => [
`${key}_dmgInc`,
greaterEq(
input.constellation,
1,
equal(
condC1BladeConsume,
'on',
prod(input.total.eleMas, percent(dm.constellation1.dmgInc))
),
{ path: `${key}_dmgInc`, isTeamBuff: true }
),
]
)
const c1BladeConsume_dmgInc = objMap(c1BladeConsume_dmgInc_disp, (node) =>
unequal(target.charKey, key, node)
)

const c2EleMas = greaterEq(input.constellation, 2, dm.constellation2.selfEleMas)
Expand All @@ -168,7 +183,11 @@ const c2ShieldEleMas_disp = greaterEq(
equal(condC2ShieldEleMas, 'on', dm.constellation2.teamEleMas),
{ path: 'eleMas', isTeamBuff: true }
)
const c2ShieldEleMas = unequal(target.charKey, key, c2ShieldEleMas_disp)
const c2ShieldEleMas = unequal(
target.charKey,
key,
equal(target.charKey, input.activeCharKey, c2ShieldEleMas_disp)
)

const c2NsFreezeMelt_pyro_enemyRes_ = greaterEq(
input.constellation,
Expand Down Expand Up @@ -238,8 +257,8 @@ const dmgFormulas = {
}),
skullDmg: dmgNode('atk', dm.burst.skullDmg, 'burst'),
},
onstellation1: {
c1BladeConsume_dmgInc,
constellation1: {
...c1BladeConsume_dmgInc_disp,
},
constellation4: {
dmg: greaterEq(
Expand Down Expand Up @@ -274,7 +293,7 @@ export const data = dataObjForCharacterSheet(key, dmgFormulas, {
a1NsFreezeMelt_pyro_enemyRes_,
c2NsFreezeMelt_pyro_enemyRes_
),
all_dmgInc: c1BladeConsume_dmgInc,
...c1BladeConsume_dmgInc,
eleMas: c2ShieldEleMas,
pyro_dmg_: c6NsConsumed_pyro_dmg_,
hydro_dmg_: c6NsConsumed_hydro_dmg_,
Expand Down Expand Up @@ -507,9 +526,9 @@ const sheet: TalentSheet = {
states: {
on: {
fields: [
{
node: c1BladeConsume_dmgInc,
},
...Object.values(c1BladeConsume_dmgInc_disp).map((node) => ({
node,
})),
{
text: st('triggerQuota'),
value: dm.constellation1.triggerQuota,
Expand Down
56 changes: 38 additions & 18 deletions libs/gi/sheets/src/Characters/Mavuika/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
greaterEq,
infoMut,
input,
lessThan,
lookup,
naught,
percent,
Expand Down Expand Up @@ -217,6 +218,12 @@ const c2RingForm_enemyDefRed_ = greaterEq(
2,
equal(condC2RingForm, 'on', dm.constellation2.enemyDefRed_)
)
const antiC2RingForm_enemyDefRed_ = lessThan(
input.constellation,
6,
prod(-1, c2RingForm_enemyDefRed_)
)

const c2FlameForm_normal_dmgInc = greaterEq(
input.constellation,
2,
Expand Down Expand Up @@ -266,12 +273,14 @@ const flameNormalAddl = {
...hitEle.pyro,
premod: {
normal_dmgInc: sum(flameNormal_dmgInc, c2FlameForm_normal_dmgInc),
enemyDefRed_: antiC2RingForm_enemyDefRed_,
},
}
const flameChargedAddl = {
...hitEle.pyro,
premod: {
charged_dmgInc: sum(flameCharged_dmgInc, c2FlameForm_charged_dmgInc),
enemyDefRed_: antiC2RingForm_enemyDefRed_,
},
}
const dmgFormulas = {
Expand Down Expand Up @@ -328,7 +337,9 @@ const dmgFormulas = {
'skill'
),
// TODO: Check what damage type this is
sprintDmg: dmgNode('atk', dm.skill.sprintDmg, 'skill'),
sprintDmg: dmgNode('atk', dm.skill.sprintDmg, 'skill', {
premod: { enemyDefRed_: antiC2RingForm_enemyDefRed_ },
}),
chargedCyclicDmg: dmgNode(
'atk',
dm.skill.chargedCyclicDmg,
Expand All @@ -349,13 +360,18 @@ const dmgFormulas = {
'atk',
dm.skill.plungeDmg,
'plunging_impact',
hitEle.pyro,
{
premod: { enemyDefRed_: antiC2RingForm_enemyDefRed_ },
...hitEle.pyro,
},
undefined,
'skill'
),
},
burst: {
skillDmg: dmgNode('atk', dm.burst.skillDmg, 'burst'),
skillDmg: dmgNode('atk', dm.burst.skillDmg, 'burst', {
premod: { enemyDefRed_: antiC2RingForm_enemyDefRed_ },
}),
sunfell_dmgInc,
flameNormal_dmgInc,
flameCharged_dmgInc,
Expand Down Expand Up @@ -537,21 +553,6 @@ const sheet: TalentSheet = {
},
],
},
ct.condTem('constellation2', {
path: condC2RingFormPath,
value: condC2RingForm,
teamBuff: true,
name: ct.ch('c2RingCond'),
states: {
on: {
fields: [
{
node: c2RingForm_enemyDefRed_,
},
],
},
},
}),
]),

burst: ct.talentTem('burst', [
Expand Down Expand Up @@ -701,6 +702,25 @@ const sheet: TalentSheet = {
},
},
}),
ct.condTem('constellation2', {
path: condC2RingFormPath,
value: condC2RingForm,
teamBuff: true,
name: ct.ch('c2RingCond'),
states: {
on: {
fields: [
{
canShow: (data) => data.get(input.constellation).value < 6,
text: ct.ch('c2Exception'),
},
{
node: c2RingForm_enemyDefRed_,
},
],
},
},
}),
]),
constellation3: ct.talentTem('constellation3', [
{ fields: [{ node: burstC3 }] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const sheet: IWeaponSheet = {
{
value: condNightsoul,
path: condNightsoulPath,
header: headerTemplate(key, st('conditional')),
canShow: equal(condPassive, 'on', 1),
name: st('nightsoul.blessing'),
states: {
Expand Down

0 comments on commit 2c28359

Please sign in to comment.