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

50 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 calc from './calc.js'
2023-10-25 19:03:33 +00:00
import { mainAttr, subAttr, attrMap, attrNameMap, mainIdMap, attrIdMap } from './extra.js'
import { setAlias, setAbbr } from './alias.js'
import { usefulAttr } from './artis-mark.js'
let setMeta = Meta.create('gs', 'artiSet')
let artiMeta = Meta.create('gs', 'arti')
2023-10-20 08:59:06 +00:00
2023-10-24 19:34:36 +00:00
let artis = Data.readJSON('resources/meta-gs/artifact/data.json', 'miao')
2023-11-07 21:01:31 +00:00
let setIds = {}
lodash.forEach(artis, (ds) => {
let artiSet = {
name: ds.name,
effect: ds.effect,
2023-11-07 21:01:31 +00:00
idxs: {}
}
2023-10-20 08:59:06 +00:00
setMeta.addDataItem(ds.name, artiSet)
2023-11-07 21:01:31 +00:00
lodash.forEach(ds.idxs, (as, idx) => {
if (as.name) {
2023-10-20 08:59:06 +00:00
let tmp = {
set: ds.name,
name: as.name,
idx
}
2023-11-07 21:01:31 +00:00
artiSet.idxs[idx] = as.name
2023-10-20 08:59:06 +00:00
artiMeta.addDataItem(as.name, tmp)
2023-11-07 21:01:31 +00:00
setIds[artiSet.name] = setIds[artiSet.name] || as.id.toString().slice(0, 2)
}
})
})
2023-10-25 19:03:33 +00:00
setMeta.addAbbr(setAbbr)
setMeta.addAlias(setAlias)
2023-11-07 21:01:31 +00:00
setMeta.addAlias(setIds)
artiMeta.addMeta({
2023-10-25 19:03:33 +00:00
mainAttr, subAttr, attrMap, attrNameMap, mainIdMap, attrIdMap,
artiBuffs: calc,
usefulAttr
2023-10-20 08:59:06 +00:00
})
setMeta.addMeta({
artiBuffs: calc
})