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 misc sheet issues #2593

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
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"
}
45 changes: 30 additions & 15 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 Down Expand Up @@ -238,8 +253,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 +289,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 +522,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
Loading