miao-plugin/resources/meta-sr/artifact/index.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-10-20 08:59:06 +00:00
import { Data, Meta } from '#miao'
import lodash from 'lodash'
import artiBuffs from './calc.js'
2023-10-25 19:03:33 +00:00
import { mainAttr, subAttr, attrMap } from './meta.js'
import { artiSetAbbr, aliasCfg, artiAbbr } from './alias.js'
import { usefulAttr } from './artis-mark.js'
let data = Data.readJSON('/resources/meta-sr/artifact/data.json', 'miao')
let metaData = Data.readJSON('/resources/meta-sr/artifact/meta.json', 'miao')
let setMeta = Meta.create('sr', 'artiSet')
2023-10-23 02:56:47 +00:00
let artiMeta = Meta.create('sr', 'arti')
2023-10-20 08:59:06 +00:00
let idMap = {}
lodash.forEach(data, (setData) => {
let artiSet = {
name: setData.name,
effect: setData.skill,
2023-11-07 21:01:31 +00:00
idxs: {}
}
2023-10-20 08:59:06 +00:00
setMeta.addDataItem(artiSet.name, artiSet)
lodash.forEach(setData.idxs, (ds, idx) => {
2023-10-23 02:56:47 +00:00
artiMeta.addDataItem(ds.name, {
...ds,
set: setData.name,
setId: setData.id,
idx
})
2023-10-23 02:56:47 +00:00
idMap[ds.name] = lodash.keys(ds.ids).join(',')
2023-11-07 21:01:31 +00:00
artiSet.idxs[idx] = ds.name
})
})
2023-05-21 18:13:38 +00:00
2023-10-25 19:03:33 +00:00
setMeta.addAbbr(artiSetAbbr)
setMeta.addAlias(aliasCfg)
2023-10-20 08:59:06 +00:00
2023-10-25 19:03:33 +00:00
artiMeta.addAbbr(artiAbbr)
2023-10-23 02:56:47 +00:00
artiMeta.addAlias(idMap, true)
artiMeta.addMeta({
2023-10-25 19:03:33 +00:00
artiBuffs, metaData, usefulAttr, mainAttr, subAttr, attrMap
2023-10-20 08:59:06 +00:00
})