Skip to content

Commit

Permalink
Add 4.3 first half content
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentvan7 committed Dec 19, 2023
1 parent 0bef26b commit 29c173b
Show file tree
Hide file tree
Showing 63 changed files with 1,983 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import type { ArtifactSetKey } from '@genshin-optimizer/consts'
import { input } from '../../../Formula'
import type { Data } from '../../../Formula/type'
import { equal, greaterEq, sum } from '../../../Formula/utils'
import KeyMap from '../../../KeyMap'
import { cond, st, trans } from '../../SheetUtil'

Check warning on line 6 in apps/frontend/src/app/Data/Artifacts/NighttimeWhispersInTheEchoingWoods/index.tsx

View workflow job for this annotation

GitHub Actions / lint

'trans' is defined but never used. Allowed unused vars must match /^_/u
import { ArtifactSheet, setHeaderTemplate } from '../ArtifactSheet'
import type { IArtifactSheet } from '../IArtifactSheet'
import { dataObjForArtifactSheet } from '../dataUtil'

const key: ArtifactSetKey = 'NighttimeWhispersInTheEchoingWoods'
const setHeader = setHeaderTemplate(key)

const set2 = greaterEq(input.artSet.NighttimeWhispersInTheEchoingWoods, 2, 0.18)

const [condAfterSkillPath, condAfterSkill] = cond(key, 'afterSkill')
const afterSkill_geo_dmg_ = greaterEq(
input.artSet.NighttimeWhispersInTheEchoingWoods,
4,
equal(condAfterSkill, 'on', 0.2, KeyMap.info('geo_dmg_'))
)

const [condCrystallizePath, condCrystallize] = cond(key, 'crystallize')
const crystallize_geo_dmg_ = greaterEq(
input.artSet.NighttimeWhispersInTheEchoingWoods,
4,
equal(
condAfterSkill,
'on',
equal(condCrystallize, 'on', 0.2 * 1.5, KeyMap.info('geo_dmg_'))
)
)

export const data: Data = dataObjForArtifactSheet(key, {
premod: {
atk_: set2,
geo_dmg_: sum(afterSkill_geo_dmg_, crystallize_geo_dmg_),
},
})

const sheet: IArtifactSheet = {
name: 'Nighttime Whispers In The Echoing Woods',
rarity: [4, 5],
setEffects: {
2: { document: [{ header: setHeader(2), fields: [{ node: set2 }] }] },
4: {
document: [
{
header: setHeader(4),
value: condAfterSkill,
path: condAfterSkillPath,
name: st('hitOp.skill'),
states: {
on: {
fields: [
{
node: afterSkill_geo_dmg_,
},
],
},
},
},
{
header: setHeader(4),
value: condCrystallize,
path: condCrystallizePath,
canShow: equal(condAfterSkill, 'on', 1),
name: st('protectedByShieldCrystal'),
states: {
on: {
fields: [
{
node: crystallize_geo_dmg_,
},
],
},
},
},
],
},
},
}
export default new ArtifactSheet(key, sheet, data)
91 changes: 91 additions & 0 deletions apps/frontend/src/app/Data/Artifacts/SongOfDaysPast/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import type { ArtifactSetKey } from '@genshin-optimizer/consts'
import { objKeyMap, range } from '@genshin-optimizer/util'
import { input } from '../../../Formula'
import type { Data } from '../../../Formula/type'
import { constant, greaterEq, lookup, naught } from '../../../Formula/utils'
import { cond, st, stg, trans } from '../../SheetUtil'
import { ArtifactSheet, setHeaderTemplate } from '../ArtifactSheet'
import type { IArtifactSheet } from '../IArtifactSheet'
import { dataObjForArtifactSheet } from '../dataUtil'

const key: ArtifactSetKey = 'SongOfDaysPast'
const setHeader = setHeaderTemplate(key)
const [, trm] = trans('artifact', key)

const set2 = greaterEq(input.artSet.SongOfDaysPast, 2, 0.15)

const healingArr = range(1000, 15000, 1000)
const [condHealingPath, condHealing] = cond(key, 'healing')
const healing_dmgInc = greaterEq(
input.artSet.SongOfDaysPast,
4,
lookup(
condHealing,
objKeyMap(healingArr, (healAmt) => constant(healAmt * 0.08)),
naught
)
)
const normal_dmgInc = { ...healing_dmgInc }
const charged_dmgInc = { ...healing_dmgInc }
const plunging_dmgInc = { ...healing_dmgInc }
const skill_dmgInc = { ...healing_dmgInc }
const burst_dmgInc = { ...healing_dmgInc }

export const data: Data = dataObjForArtifactSheet(key, {
premod: {
heal_: set2,
normal_dmgInc,
charged_dmgInc,
plunging_dmgInc,
skill_dmgInc,
burst_dmgInc,
},
})

const sheet: IArtifactSheet = {
name: 'Song of Days Past',
rarity: [4, 5],
setEffects: {
2: { document: [{ header: setHeader(2), fields: [{ node: set2 }] }] },
4: {
document: [
{
header: setHeader(4),
value: condHealing,
path: condHealingPath,
name: trm('condName'),
states: objKeyMap(healingArr, (heal) => ({
name: `${heal}`,
fields: [
{
node: normal_dmgInc,
},
{
node: charged_dmgInc,
},
{
node: plunging_dmgInc,
},
{
node: skill_dmgInc,
},
{
node: burst_dmgInc,
},
{
text: st('triggerQuota'),
value: 5,
},
{
text: stg('duration'),
value: 10,
unit: 's',
},
],
})),
},
],
},
},
}
export default new ArtifactSheet(key, sheet, data)
4 changes: 4 additions & 0 deletions apps/frontend/src/app/Data/Artifacts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import LuckyDog from './LuckyDog'
import MaidenBeloved from './MaidenBeloved'
import MarechausseeHunter from './MarechausseeHunter'
import MartialArtist from './MartialArtist'
import NighttimeWhispersInTheEchoingWoods from './NighttimeWhispersInTheEchoingWoods'
import NoblesseOblige from './NoblesseOblige'
import NymphsDream from './NymphsDream'
import OceanHuedClam from './OceanHuedClam'
Expand All @@ -45,6 +46,7 @@ import ResolutionOfSojourner from './ResolutionOfSojourner'
import RetracingBolide from './RetracingBolide'
import Scholar from './Scholar'
import ShimenawasReminiscence from './ShimenawasReminiscence'
import SongOfDaysPast from './SongOfDaysPast'
import TenacityOfTheMillelith from './TenacityOfTheMillelith'
import TheExile from './TheExile'
import ThunderingFury from './ThunderingFury'
Expand Down Expand Up @@ -82,6 +84,7 @@ const artifacts: Record<ArtifactSetKey, ArtifactSheet> = {
MaidenBeloved,
MarechausseeHunter,
MartialArtist,
NighttimeWhispersInTheEchoingWoods,
NoblesseOblige,
NymphsDream,
OceanHuedClam,
Expand All @@ -94,6 +97,7 @@ const artifacts: Record<ArtifactSetKey, ArtifactSheet> = {
RetracingBolide,
Scholar,
ShimenawasReminiscence,
SongOfDaysPast,
TenacityOfTheMillelith,
TheExile,
ThunderingFury,
Expand Down
Loading

0 comments on commit 29c173b

Please sign in to comment.