调整星铁面板更新时的保存逻辑

This commit is contained in:
Kokomi 2023-05-16 13:04:43 +08:00
parent 838f102996
commit fddcfeef60
21 changed files with 747 additions and 571 deletions

View File

@ -86,7 +86,7 @@ const ProfileChange = {
let wRet = /^(?:等?级?([1-9][0-9])?级?)?\s*(?:([1-5一二三四五满])?精炼?([1-5一二三四五])?)?\s*(?:等?级?([1-9][0-9])?级?)?\s*(.*)$/.exec(txt) let wRet = /^(?:等?级?([1-9][0-9])?级?)?\s*(?:([1-5一二三四五满])?精炼?([1-5一二三四五])?)?\s*(?:等?级?([1-9][0-9])?级?)?\s*(.*)$/.exec(txt)
if (wRet && wRet[5]) { if (wRet && wRet[5]) {
let weaponName = lodash.trim(wRet[5]) let weaponName = lodash.trim(wRet[5])
let weapon = Weapon.get(weaponName) let weapon = Weapon.get(weaponName, ret.char.game)
if (weapon || weaponName === '武器' || Weapon.isWeaponSet(weaponName)) { if (weapon || weaponName === '武器' || Weapon.isWeaponSet(weaponName)) {
let affix = wRet[2] || wRet[3] let affix = wRet[2] || wRet[3]
affix = { : 1, : 2, : 3, : 4, : 5, : 5 }[affix] || affix * 1 affix = { : 1, : 2, : 3, : 4, : 5, : 5 }[affix] || affix * 1
@ -195,14 +195,14 @@ const ProfileChange = {
elem: char.elem, elem: char.elem,
dataSource: 'change', dataSource: 'change',
promote promote
}, false) }, char.game, false)
// 设置武器 // 设置武器
let wCfg = ds.weapon || {} let wCfg = ds.weapon || {}
let wSource = getSource(wCfg).weapon || {} let wSource = getSource(wCfg).weapon || {}
let weapon = Weapon.get(wCfg?.weapon || wSource?.name || defWeapon[char.weaponType], char.weaponType) let weapon = Weapon.get(wCfg?.weapon || wSource?.name || defWeapon[char.weaponType], char.game, char.weaponType)
if (!weapon || weapon.type !== char.weaponType) { if (!weapon || weapon.type !== char.weaponType) {
weapon = Weapon.get(defWeapon[char.weaponType]) weapon = Weapon.get(defWeapon[char.weaponType], char.game)
} }
let wDs = { let wDs = {
name: weapon.name, name: weapon.name,

View File

@ -40,7 +40,10 @@ let ProfileDetail = {
msg = msg.replace(uidRet[0], '') msg = msg.replace(uidRet[0], '')
} }
let name = msg.replace(/#|老婆|老公/g, '').trim() if (/星铁/.test(msg)) {
e.isSr = true
}
let name = msg.replace(/#|老婆|老公|星铁|原神/g, '').trim()
msg = msg.replace('面版', '面板') msg = msg.replace('面版', '面板')
let dmgRet = /(?:伤害|武器)(\d?)$/.exec(name) let dmgRet = /(?:伤害|武器)(\d?)$/.exec(name)
let dmgIdx = 0 let dmgIdx = 0
@ -145,7 +148,7 @@ let ProfileDetail = {
attr[`${key}Plus`] = fn(a[key2] - base[key2]) attr[`${key}Plus`] = fn(a[key2] - base[key2])
}) })
let weapon = Weapon.get(profile.weapon.name) let weapon = Weapon.get(profile.weapon.name, char.game)
let w = profile.weapon let w = profile.weapon
let wCfg = {} let wCfg = {}
if (mode === 'weapon') { if (mode === 'weapon') {

View File

@ -61,7 +61,7 @@ const ProfileList = {
isSelfUid = uids.join(',').split(',').includes(uid + '') isSelfUid = uids.join(',').split(',').includes(uid + '')
} }
let rank = false let rank = false
let servName = Player.getProfileServName(uid)
let hasNew = false let hasNew = false
let newCount = 0 let newCount = 0
@ -75,6 +75,7 @@ const ProfileList = {
const cfg = await Data.importCfg('cfg') const cfg = await Data.importCfg('cfg')
// 获取面板数据 // 获取面板数据
let player = Player.create(e) let player = Player.create(e)
let servName = Player.getProfileServName(uid, player.game)
if (!player.hasProfile) { if (!player.hasProfile) {
await player.refresh({ profile: true }) await player.refresh({ profile: true })
} }

View File

@ -1,7 +1,7 @@
import { ProfileData, Weapon } from '#miao.models' import { ProfileData, Weapon } from '#miao.models'
export const ProfileWeapon = { export const ProfileWeapon = {
async calc (profile) { async calc (profile, game = 'gs') {
let ret = [] let ret = []
await Weapon.forEach(async (w) => { await Weapon.forEach(async (w) => {
let weaponRet = w.getData('name,star,abbr,icon') let weaponRet = w.getData('name,star,abbr,icon')
@ -13,7 +13,7 @@ export const ProfileWeapon = {
let tempProfile = new ProfileData({ let tempProfile = new ProfileData({
...profile.getData('uid,id,level,cons,fetter,elem,promote,talent,artis'), ...profile.getData('uid,id,level,cons,fetter,elem,promote,talent,artis'),
dataSource: 'change' dataSource: 'change'
}, false) }, game, false)
tempProfile.setWeapon({ tempProfile.setWeapon({
name: w.name, name: w.name,

View File

@ -5,28 +5,31 @@ import Base from './Base.js'
import { Format } from '#miao' import { Format } from '#miao'
import { ArtifactSet } from './index.js' import { ArtifactSet } from './index.js'
import { artiMap, attrMap, mainIdMap, attrIdMap } from '../resources/meta/artifact/index.js' import { artiMap, attrMap, mainIdMap, attrIdMap } from '../resources/meta/artifact/index.js'
import { idMap as idMapSR, artiMap as artiMapSR, metaData as metaDataSR } from '../resources/meta-sr/artifact/index.js'
import lodash from 'lodash' import lodash from 'lodash'
class Artifact extends Base { class Artifact extends Base {
static getAttrs static getAttrs
constructor (name) { constructor (name, game = 'gs') {
super() super()
let cache = this._getCache(`arti:${name}`) let cache = this._getCache(`arti:${game}:${name}`)
if (cache) { if (cache) {
return cache return cache
} }
let data = artiMap[name] this.game = game
let data = (this.isGs ? artiMap : artiMapSR)[name]
if (!data) { if (!data) {
return false return false
} }
this.name = name this.id = data.id || ''
this.name = data.name
this.meta = data this.meta = data
return this._cache() return this._cache()
} }
get artiSet () { get artiSet () {
return ArtifactSet.get(this.set) return ArtifactSet.get(this.set, this.game)
} }
get setName () { get setName () {
@ -34,12 +37,18 @@ class Artifact extends Base {
} }
get img () { get img () {
return `meta/artifact/imgs/${this.setName}/${this.idx}.webp` return this.isGs ? `meta/artifact/imgs/${this.setName}/${this.idx}.webp` : `meta-sr/artifact/imgs/${this.setName}/arti-${this.idx}.webp`
} }
static get (name) { static get (name, game = 'gs') {
if (artiMap[name]) { if (!name) {
return new Artifact(name) return false
}
if (game === 'sr') {
name = idMapSR[name]?.name || name
}
if ((game === 'gs' ? artiMap : artiMapSR)[name]) {
return new Artifact(name, game)
} }
return false return false
} }
@ -96,6 +105,37 @@ class Artifact extends Base {
}) })
return ret return ret
} }
getStarById (id) {
return this.meta.ids[id] || ''
}
getAttrData (mainId, attrData, level = 1, star = 5) {
let starCfg = metaDataSR.starData[star]
let mainCfg = starCfg.main[mainId]
if (!mainId || !mainCfg) {
return false
}
let main = {
id: mainId,
key: mainCfg.key,
value: mainCfg.base + mainCfg.step * level
}
let attrs = []
lodash.forEach(attrData, (ds) => {
let attrCfg = starCfg.sub[ds.id]
attrs.push({
...ds,
key: attrCfg.key,
value: attrCfg.base * ds.count + attrCfg.step * ds.step
})
})
return {
main,
attrs
}
}
} }
export default Artifact export default Artifact

View File

@ -8,8 +8,9 @@ import { Format, Data } from '#miao'
import ArtisMark from './profile/ArtisMark.js' import ArtisMark from './profile/ArtisMark.js'
export default class AvatarArtis extends Base { export default class AvatarArtis extends Base {
constructor (charid = 0) { constructor (charid = 0, game = 'gs') {
super() super()
this.game = game
this.charid = charid this.charid = charid
this.artis = {} this.artis = {}
} }
@ -49,40 +50,64 @@ export default class AvatarArtis extends Base {
return ArtisMark.getKeyTitleMap() return ArtisMark.getKeyTitleMap()
} }
setArtisData (ds = {}, profile = false) { setArtisData (ds = {}, isProfile = false) {
// let force = !this.hasArtis || ArtisMark.hasAttr(ds) || !ArtisMark.hasAttr(this.artis) if (!isProfile || (isProfile && ArtisMark.hasAttr(ds))) {
if (!profile || (profile && ArtisMark.hasAttr(ds))) { for (let idx = 1; idx <= (this.isGs ? 5 : 6); idx++) {
for (let idx = 1; idx <= 5; idx++) {
if (ds[idx] || ds[`arti${idx}`]) { if (ds[idx] || ds[`arti${idx}`]) {
this.setArtis(idx, ds[idx] || ds[`arti${idx}`], profile) this.setArtis(idx, ds[idx] || ds[`arti${idx}`], isProfile)
} }
} }
} }
} }
setArtis (idx = 1, ds = {}, profile = false) { setArtis (idx = 1, ds = {}, isProfile = false) {
idx = idx.toString().replace('arti', '') idx = idx.toString().replace('arti', '')
this.artis[idx] = this.artis[idx] || {} this.artis[idx] = this.artis[idx] || {}
let arti = this.artis[idx] let arti = this.artis[idx]
if (profile) { let artiObj
arti.name = ds._name || ds.name || arti.name || '' if (this.isSr) {
arti.set = ds._set || Artifact.getSetNameByArti(arti._name) || ds.set || '' artiObj = Artifact.get(ds.id, this.game)
arti.level = ds._level || ds.level || 1 if (!artiObj) {
arti.star = ds._star || ds.star || 5 return false
arti.main = ds.main }
arti.attrs = ds.attrs arti.id = artiObj.id || ds.id || arti.id || ''
return true arti.name = artiObj.name || arti.name || ''
} arti.set = artiObj.setName || arti.set || ''
arti.name = ds.name || arti.name || '' arti.level = ds.level || arti.level || 1
arti.set = ds.set || Artifact.getSetNameByArti(arti.name) || '' arti.star = artiObj.getStarById(ds.id) || arti.star || 5
arti.level = ds.level || 1
arti.star = ds.star || 5
if (ds.mainId || ds.main) { if (ds.mainId && ds.attrs) {
arti._name = ds._name || ds.name || arti._name || arti.name let attr = artiObj.getAttrData(ds.mainId, ds.attrs, arti.level, arti.star)
arti._set = ds._set || Artifact.getSetNameByArti(arti._name) || arti._set || '' if (attr) {
arti._level = ds._level || ds.level || arti._level || arti.level arti.mainId = ds.mainId
arti._star = ds._star || ds.star || arti._star || arti.star || 5 arti.main = attr.main || arti.main || {}
arti.attrs = attr.attrs || arti.attrs || {}
} else {
console.log('attr id error', ds.main, arti.level, arti.star)
}
}
return
} else {
if (isProfile) {
arti.name = ds._name || ds.name || arti.name || ''
arti.set = ds._set || Artifact.getSetNameByArti(arti._name) || ds.set || ''
arti.level = ds._level || ds.level || 1
arti.star = ds._star || ds.star || 5
arti.main = ds.main
arti.attrs = ds.attrs
return true
}
arti.name = ds.name || arti.name || ''
arti.set = ds.set || Artifact.getSetNameByArti(arti.name) || ''
arti.level = ds.level || 1
arti.star = ds.star || 5
if (ds.mainId || ds.main) {
arti._name = ds._name || ds.name || arti._name || arti.name
arti._set = ds._set || Artifact.getSetNameByArti(arti._name) || arti._set || ''
arti._level = ds._level || ds.level || arti._level || arti.level
arti._star = ds._star || ds.star || arti._star || arti.star || 5
}
} }
// 存在面板数据,更新面板数据 // 存在面板数据,更新面板数据
@ -104,6 +129,7 @@ export default class AvatarArtis extends Base {
forEach (fn) { forEach (fn) {
lodash.forEach(this.artis, (ds, idx) => { lodash.forEach(this.artis, (ds, idx) => {
console.log(ds, this.game, ds.mainId, ds.main)
if (ds.name) { if (ds.name) {
fn(ds, idx) fn(ds, idx)
} }
@ -123,14 +149,29 @@ export default class AvatarArtis extends Base {
toJSON () { toJSON () {
let ret = {} let ret = {}
for (let idx = 1; idx <= 5; idx++) { for (let idx = 1; idx <= (this.isGs ? 5 : 6); idx++) {
let ds = this.artis[idx] let ds = this.artis[idx]
if (ds) { if (!ds) {
let tmp = { continue
name: ds.name || '', }
level: ds.level || 1, let tmp = {
star: ds.star || 5 level: ds.level || 1,
} star: ds.star || 5
}
console.log('tojson', 'isSr')
if (this.isSr) {
tmp.id = ds.id
tmp.mainId = ds.main?.id
tmp.attrs = []
lodash.forEach(ds.attrs, (as) => {
tmp.attrs.push({
id: as?.id,
count: as?.count,
step: as?.step
})
})
} else {
tmp.name = ds.name || ''
if ((ds.mainId && ds.attrIds) || (ds.main && ds.attrs)) { if ((ds.mainId && ds.attrIds) || (ds.main && ds.attrs)) {
if ((ds._name && ds._name !== ds.name) || (ds._level && ds._level !== ds.level) || (ds._star && ds._star !== ds.star)) { if ((ds._name && ds._name !== ds.name) || (ds._level && ds._level !== ds.level) || (ds._star && ds._star !== ds.star)) {
tmp._name = ds._name || null tmp._name = ds._name || null
@ -150,8 +191,8 @@ export default class AvatarArtis extends Base {
} }
} }
} }
ret[idx] = tmp
} }
ret[idx] = tmp
} }
return ret return ret
} }

View File

@ -63,9 +63,10 @@ export default class AvatarData extends Base {
return { return {
enka: 'Enka.Network', enka: 'Enka.Network',
miao: '喵喵Api', miao: '喵喵Api',
mgg: 'MiniGG-API', mgg: 'MiniGG-Api',
hutao: 'Hutao-Enka', hutao: 'Hutao-Enka',
mys: '米游社' mys: '米游社',
lulu: '路路Api'
}[this._source] || this._source }[this._source] || this._source
} }
@ -92,7 +93,7 @@ export default class AvatarData extends Base {
} }
initArtis () { initArtis () {
this.artis = new AvatarArtis(this.id) this.artis = new AvatarArtis(this.id, this.game)
} }
_get (key) { _get (key) {
@ -123,11 +124,12 @@ export default class AvatarData extends Base {
this._costume = ds.costume || this._costume || 0 this._costume = ds.costume || this._costume || 0
this.elem = ds.elem || this.elem || this.char.elem || '' this.elem = ds.elem || this.elem || this.char.elem || ''
this.promote = lodash.isUndefined(ds.promote) ? (this.promote || AttrCalc.calcPromote(this.level)) : (ds.promote || 0) this.promote = lodash.isUndefined(ds.promote) ? (this.promote || AttrCalc.calcPromote(this.level)) : (ds.promote || 0)
this.trees = ds.trees || this.trees || []
this._source = ds._source || ds.dataSource || this._source || '' this._source = ds._source || ds.dataSource || this._source || ''
this._time = ds._time || this._time || now this._time = ds._time || this._time || now
this._update = ds._update || this._update || ds._time || now this._update = ds._update || this._update || ds._time || now
this._talent = ds._talent || this._talent || ds._time || now this._talent = ds._talent || this._talent || ds._time || now
// 存在数据源时更新时间 // 存在数据源时更新时间
if (source) { if (source) {
this._update = now this._update = now
@ -142,13 +144,13 @@ export default class AvatarData extends Base {
} }
setWeapon (ds = {}) { setWeapon (ds = {}) {
let w = Weapon.get(ds.name || ds.id, this.game)
let w = Weapon.get(ds.name)
if (!w) { if (!w) {
return false return false
} }
this.weapon = { this.weapon = {
name: ds.name, id: ds.id || w.id,
name: ds.name || w.name,
level: ds.level || ds.lv || 1, level: ds.level || ds.lv || 1,
promote: lodash.isUndefined(ds.promote) ? AttrCalc.calcPromote(ds.level || ds.lv || 1) : (ds.promote || 0), promote: lodash.isUndefined(ds.promote) ? AttrCalc.calcPromote(ds.level || ds.lv || 1) : (ds.promote || 0),
affix: ds.affix, affix: ds.affix,
@ -182,7 +184,7 @@ export default class AvatarData extends Base {
if (!this.isProfile) { if (!this.isProfile) {
return false return false
} }
return ProfileData.create(this) return ProfileData.create(this, this.game)
} }
// 判断当前profileData是否具备有效圣遗物信息 // 判断当前profileData是否具备有效圣遗物信息
@ -192,9 +194,12 @@ export default class AvatarData extends Base {
// toJSON 供保存使用 // toJSON 供保存使用
toJSON () { toJSON () {
let keys = this.isGs ?
'name,id,elem,level,promote,fetter,costume,cons,talent:originalTalent' :
'name,id,elem,level,promote,cons,talent:originalTalent,trees'
return { return {
...this.getData('name,id,elem,level,promote,fetter,costume,cons,talent:originalTalent'), ...this.getData(keys),
weapon: Data.getData(this.weapon, 'name,level,promote,affix'), weapon: Data.getData(this.weapon, this.isGs ? 'name,level,promote,affix' : 'id,level,promote,affix'),
...this.getData('artis,_source,_time,_update,_talent') ...this.getData('artis,_source,_time,_update,_talent')
} }
} }
@ -208,7 +213,7 @@ export default class AvatarData extends Base {
} }
} else { } else {
return { return {
...(this.getData(keys || 'id,name,level,star,cons,fetter,elem,abbr,weapon,talent,artisSet') || {}), ...(this.getData(keys || 'id,name,level,star,cons,elem,abbr,weapon,talent,artisSet,trees') || {}),
...Data.getData(imgs, 'face,qFace,gacha,preview') ...Data.getData(imgs, 'face,qFace,gacha,preview')
} }
} }

View File

@ -94,11 +94,11 @@ export default class Base {
delete metaMap[id] delete metaMap[id]
} }
isSr () { get isSr () {
return this.game === 'sr' return this.game === 'sr'
} }
isGs () { get isGs () {
return !this.isSr return !this.isSr
} }
} }

View File

@ -226,9 +226,26 @@ class Character extends Base {
return CharImg.getCardImg(this.name, se, def) return CharImg.getCardImg(this.name, se, def)
} }
// 设置旅行者数据 // 设置天赋数据
getAvatarTalent (talent = {}, cons = 0, mode = 'original') { getAvatarTalent (talent = {}, cons = 0, mode = 'original') {
return CharTalent.getAvatarTalent(this.id, talent, cons, mode, this.talentCons) return CharTalent.getAvatarTalent(this, talent, cons, mode)
}
getTalentKey (id) {
if (this.talentId[id]) {
return this.talentId[id]
}
if (this.isSr) {
id = (id + '').replace(this.id, '')
return {
'001': 'a',
'002': 'e',
'003': 'q',
'004': 't',
'007': 'z'
}[id]
}
return false
} }
// 检查老婆类型 // 检查老婆类型

View File

@ -169,7 +169,6 @@ export default class Player extends Base {
// 获取Avatar角色 // 获取Avatar角色
getAvatar (id, create = false) { getAvatar (id, create = false) {
let char = Character.get(id) let char = Character.get(id)
console.log('getAvatar', char.id)
let avatars = this._avatars let avatars = this._avatars
if (this.isGs) { if (this.isGs) {
// 兼容处理旅行者的情况 // 兼容处理旅行者的情况
@ -178,7 +177,7 @@ export default class Player extends Base {
} }
} }
if (!avatars[id] && create) { if (!avatars[id] && create) {
avatars[id] = AvatarData.create({ id }) avatars[id] = AvatarData.create({ id }, '', this.game)
} }
return avatars[id] || false return avatars[id] || false
} }

View File

@ -10,8 +10,8 @@ import { attrMap } from '../resources/meta/artifact/index.js'
import CharArtis from './profile/CharArtis.js' import CharArtis from './profile/CharArtis.js'
export default class ProfileArtis extends AvatarArtis { export default class ProfileArtis extends AvatarArtis {
constructor (charid = 0, elem = '') { constructor (charid = 0, elem = '', game = 'gs') {
super(charid) super(charid, game)
this.elem = elem this.elem = elem
} }
@ -85,6 +85,7 @@ export default class ProfileArtis extends AvatarArtis {
} }
} else { } else {
let artifact = Artifact.get(arti.name) let artifact = Artifact.get(arti.name)
console.log(arti.main, arti.mainId, arti)
artis[idx] = { artis[idx] = {
name: artifact.name, name: artifact.name,
set: artifact.setName, set: artifact.setName,

View File

@ -6,9 +6,9 @@ import AttrCalc from './profile/AttrCalc.js'
import CharImg from './character/CharImg.js' import CharImg from './character/CharImg.js'
export default class ProfileData extends AvatarData { export default class ProfileData extends AvatarData {
constructor (ds = {}, calc = true) { constructor (ds = {}, game = 'gs', calc = true) {
super(ds) super(ds, game)
if (calc && !this.isSr) { if (calc) {
this.calcAttr() this.calcAttr()
} }
} }
@ -53,8 +53,8 @@ export default class ProfileData extends AvatarData {
return this.hasData && !!ProfileDmg.dmgRulePath(this.name) return this.hasData && !!ProfileDmg.dmgRulePath(this.name)
} }
static create (ds) { static create (ds, game = 'gs') {
let profile = new ProfileData(ds) let profile = new ProfileData(ds, game)
if (!profile) { if (!profile) {
return false return false
} }
@ -62,7 +62,7 @@ export default class ProfileData extends AvatarData {
} }
initArtis () { initArtis () {
this.artis = new ProfileArtis(this.id, this.elem) this.artis = new ProfileArtis(this.id, this.elem, this.game)
} }
setAttr (ds) { setAttr (ds) {
@ -76,7 +76,7 @@ export default class ProfileData extends AvatarData {
} }
calcAttr () { calcAttr () {
this._attr = AttrCalc.create(this) this._attr = AttrCalc.create(this, this.game)
this.attr = this._attr.calc() this.attr = this._attr.calc()
this.base = this._attr.getBase() this.base = this._attr.getBase()
} }
@ -88,6 +88,7 @@ export default class ProfileData extends AvatarData {
// 获取当前profileData的圣遗物评分withDetail=false仅返回简略信息 // 获取当前profileData的圣遗物评分withDetail=false仅返回简略信息
getArtisMark (withDetail = true) { getArtisMark (withDetail = true) {
if (this.hasData) { if (this.hasData) {
console.log(this.game)
return this.artis.getMarkDetail(withDetail) return this.artis.getMarkDetail(withDetail)
} }
return {} return {}

View File

@ -1,16 +1,18 @@
import Base from './Base.js' import Base from './Base.js'
import { Data } from '#miao' import { Data } from '#miao'
import { weaponData, weaponAbbr, weaponAlias, weaponType, weaponSet } from '../resources/meta/weapon/index.js' import { weaponData, weaponAbbr, weaponAlias, weaponType, weaponSet } from '../resources/meta/weapon/index.js'
import { weaponData as weaponDataSR, weaponAlias as weaponAliasSR } from '../resources/meta-sr/weapon/index.js'
import lodash from 'lodash' import lodash from 'lodash'
class Weapon extends Base { class Weapon extends Base {
constructor (name) { constructor (name, game = 'gs') {
super(name) super(name)
let meta = weaponData[name] let meta = game === 'gs' ? weaponData[name] : weaponDataSR[name]
if (!meta) { if (!meta) {
return false return false
} }
let cache = this._getCache(`weapon:${name}`) let cache = this._getCache(`weapon:${game}:${name}`)
if (cache) { if (cache) {
return cache return cache
} }
@ -19,6 +21,7 @@ class Weapon extends Base {
this.meta = meta this.meta = meta
this.type = meta.type this.type = meta.type
this.star = meta.star this.star = meta.star
this.game = game
return this._cache() return this._cache()
} }
@ -31,14 +34,22 @@ class Weapon extends Base {
} }
get img () { get img () {
return `meta/weapon/${this.type}/${this.name}/icon.webp` return `meta/${this.isGs ? 'meta' : 'meta-sr'}/${this.type}/${this.name}/icon.webp`
} }
get imgs () { get imgs () {
return { if (this.isGs) {
icon: `meta/weapon/${this.type}/${this.name}/icon.webp`, return {
icon2: `meta/weapon/${this.type}/${this.name}/awaken.webp`, icon: `meta/weapon/${this.type}/${this.name}/icon.webp`,
gacha: `meta/weapon/${this.type}/${this.name}/gacha.webp` icon2: `meta/weapon/${this.type}/${this.name}/awaken.webp`,
gacha: `meta/weapon/${this.type}/${this.name}/gacha.webp`
}
} else {
return {
icon: `meta/weapon-sr/${this.type}/${this.name}/icon.webp`,
icon2: `meta/weapon-sr/${this.type}/${this.name}/icon-s.webp`,
gacha: `meta/weapon-sr/${this.type}/${this.name}/splash.webp`
}
} }
} }
@ -67,12 +78,13 @@ class Weapon extends Base {
return weaponSet.includes(name) return weaponSet.includes(name)
} }
static get (name, type = '') { static get (name, game = 'gs', type = '') {
name = lodash.trim(name) name = lodash.trim(name)
if (weaponAlias[name]) { let alias = game === 'gs' ? weaponAlias : weaponAliasSR
return new Weapon(weaponAlias[name]) if (alias[name]) {
return new Weapon(alias[name], game)
} }
if (type) { if (type && game === 'gs') {
let name2 = name + (weaponType[type] || type) let name2 = name + (weaponType[type] || type)
if (weaponAlias[name2]) { if (weaponAlias[name2]) {
return new Weapon(weaponAlias[name2]) return new Weapon(weaponAlias[name2])
@ -96,7 +108,7 @@ class Weapon extends Base {
if (this._detail) { if (this._detail) {
return this._detail return this._detail
} }
const path = 'resources/meta/weapon' const path = this.isGs ? 'resources/meta/weapon' : 'resources/meta/weapon-sr'
try { try {
this._detail = Data.readJSON(`${path}/${this.type}/${this.name}/data.json`, 'miao') this._detail = Data.readJSON(`${path}/${this.type}/${this.name}/data.json`, 'miao')
} catch (e) { } catch (e) {

View File

@ -5,9 +5,10 @@ import lodash from 'lodash'
const CharTalent = { const CharTalent = {
// 处理获取天赋数据 // 处理获取天赋数据
getAvatarTalent (id, talent, cons, mode, consTalent = {}) { getAvatarTalent (char, talent, cons, mode) {
let { id, talentCons, game } = char
let ret = {} let ret = {}
lodash.forEach(['a', 'e', 'q'], (key) => { lodash.forEach(game === 'gs' ? ['a', 'e', 'q'] : ['a', 'e', 'q', 't'], (key) => {
let ds = talent[key] let ds = talent[key]
if (!ds) { if (!ds) {
return false return false
@ -26,10 +27,10 @@ const CharTalent = {
mode = 'level' mode = 'level'
} else { } else {
original = value original = value
if (key === 'a') { if (key === 'a' && char.isGs) {
level = aPlus ? value + 1 : value level = aPlus ? value + 1 : value
} else { } else {
level = cons >= consTalent[key] ? (value + 3) : value level = cons >= talentCons[key] ? (value + 3) : value
} }
} }
} }
@ -37,10 +38,10 @@ const CharTalent = {
// 基于level计算original // 基于level计算original
value = value || ds.level || ds.level_current || ds.original || ds.level_original value = value || ds.level || ds.level_current || ds.original || ds.level_original
level = value level = value
if (key === 'a') { if (key === 'a' && char.isGs) {
original = aPlus ? value - 1 : value original = aPlus ? value - 1 : value
} else { } else {
original = cons >= consTalent[key] ? (value - 3) : value original = cons >= talentCons[key] ? (value - 3) : value
} }
} }
ret[key] = { level, original } ret[key] = { level, original }

View File

@ -38,17 +38,17 @@ export default {
}, },
updatePlayer (player, data) { updatePlayer (player, data) {
player.setBasicData(Data.getData(data, 'name:NickName,face:HeadIconID,level:Level,word:WorldLevel,sign:Signature')) try {
console.log('avatars', data.avatars) player.setBasicData(Data.getData(data, 'name:NickName,face:HeadIconID,level:Level,word:WorldLevel,sign:Signature'))
lodash.forEach(data.avatars, (ds, id) => { lodash.forEach(data.avatars, (ds, id) => {
console.log('ret1', ds) let ret = LuluData.setAvatar(player, ds)
let ret = LuluData.setAvatar(player, ds) if (ret) {
console.log('ret2', ret, ds) player._update.push(ds.AvatarID)
if (ret) { }
console.log('done', id) })
player._update.push(id) } catch (e) {
} console.log(e)
}) }
}, },
// 获取冷却时间 // 获取冷却时间
@ -59,51 +59,58 @@ export default {
const LuluData = { const LuluData = {
setAvatar (player, data) { setAvatar (player, data) {
console.log('data', data.AvatarID, data)
console.log('data.ID', data.AvatarID)
let char = Character.get(data.AvatarID) let char = Character.get(data.AvatarID)
console.log('char.id', char.id, char.name)
if (!char) { if (!char) {
return false return false
} }
let avatar = player.getAvatar(char.id, true) let avatar = player.getAvatar(char.id, true)
console.log('setAvatar', avatar)
let setData = { let setData = {
level: data.Level, level: data.Level,
promote: data.Promotion, promote: data.Promotion,
cons: data.Rank || 0, cons: data.Rank || 0,
weapon: Data.getData(data.EquipmentID, 'id:ID,promote:Promotion,level:Level'), weapon: Data.getData(data.EquipmentID, 'id:ID,promote:Promotion,level:Level,affix:Rank'),
...LuluData.getTalent(data.BehaviorList, char.talentId), ...LuluData.getTalent(data.BehaviorList, char),
artis: LuluData.getArtis(data.RelicList) artis: LuluData.getArtis(data.RelicList)
} }
console.log('char.setData', setData)
avatar.setAvatar(setData, 'lulu') avatar.setAvatar(setData, 'lulu')
return avatar return avatar
}, },
getTalent (ds, talentId = {}) { getTalent (ds, char) {
let talent = {} let talent = {}
let behaviors = [] let trees = []
let talentId = char.talentId
lodash.forEach(ds, (d) => { lodash.forEach(ds, (d) => {
let key = talentId[d.BehaviorID] let key = char.getTalentKey(d.BehaviorID)
if (key || d.Level > 1) { if (key || d.Level > 1) {
talent[key || d.BehaviorID] = d.Level talent[key || d.BehaviorID] = d.Level
} else { } else {
behaviors.push(d.BehaviorID) trees.push(d.BehaviorID)
} }
}) })
return { talent, behaviors } return { talent, trees }
}, },
getArtis (artis) { getArtis (artis) {
let ret = {} let ret = {}
lodash.forEach(artis, (ds) => { lodash.forEach(artis, (ds) => {
let tmp = Data.getData('id:ID,main:MainAffixID,level:Level') let tmp = {
tmp.attrs = [] id: ds.ID,
level: ds.Level || 1,
mainId: ds.MainAffixID,
attrs: []
}
lodash.forEach(ds.RelicSubAffix, (s) => { lodash.forEach(ds.RelicSubAffix, (s) => {
tmp.attrs.push(Data.getData(s, 'id:SubAffixID,count:Cnt,step:Step')) if (!s.SubAffixID) {
return true
}
tmp.attrs.push({
id: s.SubAffixID,
count: s.Cnt,
step: s.Step || 0
})
}) })
ret[ds.Type] = tmp ret[ds.Type] = tmp
}) })
console.log(lodash.keys(ret))
return ret return ret
} }
} }

View File

@ -13,6 +13,7 @@ class AttrCalc {
constructor (profile) { constructor (profile) {
this.profile = profile this.profile = profile
this.char = profile.char this.char = profile.char
this.game = profile.game
} }
/** /**
@ -48,9 +49,11 @@ class AttrCalc {
*/ */
calc () { calc () {
this.attr = ProfileAttr.create({}) this.attr = ProfileAttr.create({})
this.addAttr('recharge', 100, true) if (this.profile.isGs) {
this.addAttr('cpct', 5, true) this.addAttr('recharge', 100, true)
this.addAttr('cdmg', 50, true) this.addAttr('cpct', 5, true)
this.addAttr('cdmg', 50, true)
}
this.setCharAttr() this.setCharAttr()
this.setWeaponAttr() this.setWeaponAttr()
this.setArtisAttr() this.setArtisAttr()
@ -123,7 +126,7 @@ class AttrCalc {
*/ */
setWeaponAttr () { setWeaponAttr () {
let wData = this.profile?.weapon || {} let wData = this.profile?.weapon || {}
let weapon = Weapon.get(wData?.name) let weapon = Weapon.get(wData?.name || wData?.id, this.game)
let wCalcRet = weapon.calcAttr(wData.level, wData.promote) let wCalcRet = weapon.calcAttr(wData.level, wData.promote)
if (wCalcRet) { if (wCalcRet) {

View File

@ -78,7 +78,8 @@
</div> </div>
<div class="copyright data-source"> <div class="copyright data-source">
数据源:{{ {miao:'喵喵API', 'enka':'Enka.Network', 'mgg':'MiniGG-API', mys:'米游社', 'hutao':'Hutao-Enka' }[data.source]||data.source }} {{data.updateTime}} 数据源:{{ {miao:'喵喵API', 'enka':'Enka.Network', 'mgg':'MiniGG-API', mys:'米游社', 'hutao':'Hutao-Enka', 'lulu':'路路Api'
}[data.source]||data.source }} {{data.updateTime}}
</div> </div>
{{else}} {{else}}
{{if custom}} {{if custom}}

View File

@ -0,0 +1,24 @@
import { Data } from '#miao'
import lodash from 'lodash'
let data = Data.readJSON('/resources/meta-sr/artifact/data.json', 'miao')
let meta = Data.readJSON('/resources/meta-sr/artifact/meta.json', 'miao')
let artiMap = {}
let idMap = {}
lodash.forEach(data, (setData) => {
lodash.forEach(setData.idxs, (ds, idx) => {
artiMap[ds.name] = {
...ds,
set: setData.name,
setId: setData.id,
idx
}
idMap[ds.name] = artiMap[ds.name]
lodash.forEach(ds.ids, (star, id) => {
idMap[id] = artiMap[ds.name]
})
})
})
export const metaData = meta
export { artiMap, idMap }

View File

@ -41,463 +41,469 @@
"defPct" "defPct"
] ]
}, },
"mainAttr": { "starData": {
"2": { "2": {
"1": { "main": {
"key": "stance", "1": {
"base": 0.04147200011757768, "key": "stance",
"step": 0.014514999934858639 "base": 0.04147200076840818,
"step": 0.014515000162646174
},
"2": {
"key": "recharge",
"base": 0.01244200044311583,
"step": 0.004355000331997871
},
"3": {
"key": "hpPct",
"base": 0.027648000279441476,
"step": 0.009677000343799591
},
"4": {
"key": "atkPct",
"base": 0.027648000279441476,
"step": 0.009677000343799591
},
"5": {
"key": "defPct",
"base": 0.03456000052392483,
"step": 0.012096000602468848
},
"6": {
"key": "ice",
"base": 0.024883000878617167,
"step": 0.008708999957889318
},
"7": {
"key": "elec",
"base": 0.024883000878617167,
"step": 0.008708999957889318
},
"8": {
"key": "wind",
"base": 0.024883000878617167,
"step": 0.008708999957889318
},
"9": {
"key": "quantum",
"base": 0.024883000878617167,
"step": 0.008708999957889318
},
"10": {
"key": "imaginary",
"base": 0.024883000878617167,
"step": 0.008708999957889318
}
}, },
"2": { "sub": {
"key": "recharge", "1": {
"base": 0.012442000247860399, "key": "hp",
"step": 0.00435500026365376 "base": 13.548016000073403,
}, "step": 1.693502000765875
"3": { },
"key": "hpPct", "2": {
"base": 0.02764799984555448, "key": "atk",
"step": 0.009677000191936 "base": 6.774008000502363,
}, "step": 0.8467510011978447
"4": { },
"key": "atkPct", "3": {
"base": 0.02764799984555448, "key": "def",
"step": 0.009677000191936 "base": 6.774008000502363,
}, "step": 0.8467510011978447
"5": { },
"key": "defPct", "4": {
"base": 0.03455999998156608, "key": "hpPct",
"step": 0.01209600041264328 "base": 0.013824000488966703,
}, "step": 0.0017280005849897861
"6": { },
"key": "ice", "5": {
"base": 0.024883000488122, "key": "atkPct",
"step": 0.0087089998212168 "base": 0.013824000488966703,
}, "step": 0.0017280005849897861
"7": { },
"key": "elec", "6": {
"base": 0.024883000488122, "key": "defPct",
"step": 0.0087089998212168 "base": 0.017280000261962414,
}, "step": 0.002160000381991267
"8": { },
"key": "wind", "7": {
"base": 0.024883000488122, "key": "speed",
"step": 0.0087089998212168 "base": 1,
}, "step": 0.10000000009313226
"9": { },
"key": "quantum", "8": {
"base": 0.024883000488122, "key": "cpct",
"step": 0.0087089998212168 "base": 0.010368000715970993,
}, "step": 0.001296000787988305
"10": { },
"key": "imaginary", "9": {
"base": 0.024883000488122, "key": "cdmg",
"step": 0.0087089998212168 "base": 0.020736000733450055,
"step": 0.0025920008774846792
},
"10": {
"key": "effPct",
"base": 0.013824000488966703,
"step": 0.0017280005849897861
},
"11": {
"key": "effDef",
"base": 0.013824000488966703,
"step": 0.0017280005849897861
},
"12": {
"key": "stance",
"base": 0.020736000733450055,
"step": 0.0025920008774846792
}
} }
}, },
"3": { "3": {
"1": { "main": {
"key": "stance", "1": {
"base": 0.062207999128628635, "key": "stance",
"step": 0.02177300060457928 "base": 0.06220800010487437,
"step": 0.02177300094626844
},
"2": {
"key": "recharge",
"base": 0.018662000307813287,
"step": 0.006532000144943595
},
"3": {
"key": "hpPct",
"base": 0.04147200076840818,
"step": 0.014515000162646174
},
"4": {
"key": "atkPct",
"base": 0.04147200076840818,
"step": 0.014515000162646174
},
"5": {
"key": "defPct",
"base": 0.05184000078588724,
"step": 0.018143999855965376
},
"6": {
"key": "ice",
"base": 0.037324999924749136,
"step": 0.01306400028988719
},
"7": {
"key": "elec",
"base": 0.037324999924749136,
"step": 0.01306400028988719
},
"8": {
"key": "wind",
"base": 0.037324999924749136,
"step": 0.01306400028988719
},
"9": {
"key": "quantum",
"base": 0.037324999924749136,
"step": 0.01306400028988719
},
"10": {
"key": "imaginary",
"base": 0.037324999924749136,
"step": 0.01306400028988719
}
}, },
"2": { "sub": {
"key": "recharge", "1": {
"base": 0.01866200001494584, "key": "hp",
"step": 0.00653200004243528 "base": 20.32202300033532,
}, "step": 2.540253001032397
"3": { },
"key": "hpPct", "2": {
"base": 0.04147200011757768, "key": "atk",
"step": 0.014514999934858639 "base": 10.161012000171468,
}, "step": 1.2701260005123913
"4": { },
"key": "atkPct", "3": {
"base": 0.04147200011757768, "key": "def",
"step": 0.014514999934858639 "base": 10.161012000171468,
}, "step": 1.2701260005123913
"5": { },
"key": "defPct", "4": {
"base": 0.051839999972349116, "key": "hpPct",
"step": 0.01814399957122704 "base": 0.020736000733450055,
}, "step": 0.0025920008774846792
"6": { },
"key": "ice", "5": {
"base": 0.037324999338998556, "key": "atkPct",
"step": 0.01306400008487056 "base": 0.020736000733450055,
}, "step": 0.0025920008774846792
"7": { },
"key": "elec", "6": {
"base": 0.037324999338998556, "key": "defPct",
"step": 0.01306400008487056 "base": 0.02592000039294362,
}, "step": 0.0032400002237409353
"8": { },
"key": "wind", "7": {
"base": 0.037324999338998556, "key": "speed",
"step": 0.01306400008487056 "base": 1.2000000001862645,
}, "step": 0.10000000009313226
"9": { },
"key": "quantum", "8": {
"base": 0.037324999338998556, "key": "cpct",
"step": 0.01306400008487056 "base": 0.015552000375464559,
}, "step": 0.0019440008327364922
"10": { },
"key": "imaginary", "9": {
"base": 0.037324999338998556, "key": "cdmg",
"step": 0.01306400008487056 "base": 0.031104000052437186,
"step": 0.0038880009669810534
},
"10": {
"key": "effPct",
"base": 0.020736000733450055,
"step": 0.0025920008774846792
},
"11": {
"key": "effDef",
"base": 0.020736000733450055,
"step": 0.0025920008774846792
},
"12": {
"key": "stance",
"base": 0.031104000052437186,
"step": 0.0038880009669810534
}
} }
}, },
"4": { "4": {
"1": { "main": {
"key": "stance", "1": {
"base": 0.08294399953666344, "key": "stance",
"step": 0.029029999171225358 "base": 0.08294400083832443,
"step": 0.029029999626800418
},
"2": {
"key": "recharge",
"base": 0.024883000878617167,
"step": 0.008708999957889318
},
"3": {
"key": "hpPct",
"base": 0.05529600055888295,
"step": 0.01935399998910725
},
"4": {
"key": "atkPct",
"base": 0.05529600055888295,
"step": 0.01935399998910725
},
"5": {
"key": "defPct",
"base": 0.0691199996508658,
"step": 0.024192000506445765
},
"6": {
"key": "ice",
"base": 0.04976600036025047,
"step": 0.017417999915778637
},
"7": {
"key": "elec",
"base": 0.04976600036025047,
"step": 0.017417999915778637
},
"8": {
"key": "wind",
"base": 0.04976600036025047,
"step": 0.017417999915778637
},
"9": {
"key": "quantum",
"base": 0.04976600036025047,
"step": 0.017417999915778637
},
"10": {
"key": "imaginary",
"base": 0.04976600036025047,
"step": 0.017417999915778637
}
}, },
"2": { "sub": {
"key": "recharge", "1": {
"base": 0.024883000488122, "key": "hp",
"step": 0.0087089998212168 "base": 27.09603099990636,
}, "step": 3.3870039999019355
"3": { },
"key": "hpPct", "2": {
"base": 0.05529599969110896, "key": "atk",
"step": 0.01935399968538008 "base": 13.548016000073403,
}, "step": 1.693502000765875
"4": { },
"key": "atkPct", "3": {
"base": 0.05529599969110896, "key": "def",
"step": 0.01935399968538008 "base": 13.548016000073403,
}, "step": 1.693502000765875
"5": { },
"key": "defPct", "4": {
"base": 0.06911999856614832, "key": "hpPct",
"step": 0.02419200012679464 "base": 0.027648000279441476,
}, "step": 0.0034560004714876413
"6": { },
"key": "ice", "5": {
"base": 0.04976599957926016, "key": "atkPct",
"step": 0.0174179996424336 "base": 0.027648000279441476,
}, "step": 0.0034560004714876413
"7": { },
"key": "elec", "6": {
"base": 0.04976599957926016, "key": "defPct",
"step": 0.0174179996424336 "base": 0.03456000052392483,
}, "step": 0.0043200000654906034
"8": { },
"key": "wind", "7": {
"base": 0.04976599957926016, "key": "speed",
"step": 0.0174179996424336 "base": 1.6000000005587935,
}, "step": 0.20000000018626451
"9": { },
"key": "quantum", "8": {
"base": 0.04976599957926016, "key": "cpct",
"step": 0.0174179996424336 "base": 0.020736000733450055,
}, "step": 0.0025920008774846792
"10": { },
"key": "imaginary", "9": {
"base": 0.04976599957926016, "key": "cdmg",
"step": 0.0174179996424336 "base": 0.04147200076840818,
"step": 0.0051840003579854965
},
"10": {
"key": "effPct",
"base": 0.027648000279441476,
"step": 0.0034560004714876413
},
"11": {
"key": "effDef",
"base": 0.027648000279441476,
"step": 0.0034560004714876413
},
"12": {
"key": "stance",
"base": 0.04147200076840818,
"step": 0.0051840003579854965
}
} }
}, },
"5": { "5": {
"1": { "main": {
"key": "stance", "1": {
"base": 0.10367999924620631, "key": "stance",
"step": 0.036287999840946 "base": 0.10368000087328255,
"step": 0.03628800041042268
},
"2": {
"key": "recharge",
"base": 0.031104000052437186,
"step": 0.010886001167818904
},
"3": {
"key": "hpPct",
"base": 0.0691199996508658,
"step": 0.024192000506445765
},
"4": {
"key": "atkPct",
"base": 0.0691199996508658,
"step": 0.024192000506445765
},
"5": {
"key": "defPct",
"base": 0.08639999991282821,
"step": 0.030240000458434224
},
"6": {
"key": "ice",
"base": 0.06220800010487437,
"step": 0.02177300094626844
},
"7": {
"key": "elec",
"base": 0.06220800010487437,
"step": 0.02177300094626844
},
"8": {
"key": "wind",
"base": 0.06220800010487437,
"step": 0.02177300094626844
},
"9": {
"key": "quantum",
"base": 0.06220800010487437,
"step": 0.02177300094626844
},
"10": {
"key": "imaginary",
"base": 0.06220800010487437,
"step": 0.02177300094626844
}
}, },
"2": { "sub": {
"key": "recharge", "1": {
"base": 0.031103999564314318, "key": "hp",
"step": 0.01088600099698216 "base": 33.870039001107216,
}, "step": 4.23375500086695
"3": { },
"key": "hpPct", "2": {
"base": 0.06911999856614832, "key": "atk",
"step": 0.02419200012679464 "base": 16.935019000666216,
}, "step": 2.1168770007789135
"4": { },
"key": "atkPct", "3": {
"base": 0.06911999856614832, "key": "def",
"step": 0.02419200012679464 "base": 16.935019000666216,
}, "step": 2.1168770007789135
"5": { },
"key": "defPct", "4": {
"base": 0.08639999855693135, "key": "hpPct",
"step": 0.03023999998387032 "base": 0.03456000052392483,
}, "step": 0.0043200000654906034
"6": { },
"key": "ice", "5": {
"base": 0.062207999128628635, "key": "atkPct",
"step": 0.02177300060457928 "base": 0.03456000052392483,
}, "step": 0.0043200000654906034
"7": { },
"key": "elec", "6": {
"base": 0.062207999128628635, "key": "defPct",
"step": 0.02177300060457928 "base": 0.043199999956414104,
}, "step": 0.005399999907240272
"8": { },
"key": "wind", "7": {
"base": 0.062207999128628635, "key": "speed",
"step": 0.02177300060457928 "base": 2,
}, "step": 0.3000000002793968
"9": { },
"key": "quantum", "8": {
"base": 0.062207999128628635, "key": "cpct",
"step": 0.02177300060457928 "base": 0.02592000039294362,
}, "step": 0.0032400002237409353
"10": { },
"key": "imaginary", "9": {
"base": 0.062207999128628635, "key": "cdmg",
"step": 0.02177300060457928 "base": 0.05184000078588724,
} "step": 0.006480000447481871
} },
}, "10": {
"subAttr": { "key": "effPct",
"2": { "base": 0.03456000052392483,
"1": { "step": 0.0043200000654906034
"key": "hp", },
"base": 13.548015787460994, "11": {
"step": 1.6935019741893238 "key": "effDef",
}, "base": 0.03456000052392483,
"2": { "step": 0.0043200000654906034
"key": "atk", },
"base": 6.774007894196158, "12": {
"step": 0.846750987909569 "key": "stance",
}, "base": 0.05184000078588724,
"3": { "step": 0.006480000447481871
"key": "def", }
"base": 6.774007894196158,
"step": 0.846750987909569
},
"4": {
"key": "hpPct",
"base": 0.0138240002720232,
"step": 0.00172800055787184
},
"5": {
"key": "atkPct",
"base": 0.0138240002720232,
"step": 0.00172800055787184
},
"6": {
"key": "defPct",
"base": 0.01727999999078304,
"step": 0.00216000034809384
},
"7": {
"key": "speed",
"base": 0.9999999843067494,
"step": 0.0999999985238072
},
"8": {
"key": "cpct",
"base": 0.01036800055326336,
"step": 0.00129600076764984
},
"9": {
"key": "cdmg",
"base": 0.020736000408034798,
"step": 0.00259200083680776
},
"10": {
"key": "effPct",
"base": 0.0138240002720232,
"step": 0.00172800055787184
},
"11": {
"key": "effDef",
"base": 0.0138240002720232,
"step": 0.00172800055787184
},
"12": {
"key": "stance",
"base": 0.020736000408034798,
"step": 0.00259200083680776
}
},
"3": {
"1": {
"key": "hp",
"base": 20.322022681416723,
"step": 2.54025296116757
},
"2": {
"key": "atk",
"base": 10.16101184071216,
"step": 1.2701259805799858
},
"3": {
"key": "def",
"base": 10.16101184071216,
"step": 1.2701259805799858
},
"4": {
"key": "hpPct",
"base": 0.020736000408034798,
"step": 0.00259200083680776
},
"5": {
"key": "atkPct",
"base": 0.020736000408034798,
"step": 0.00259200083680776
},
"6": {
"key": "defPct",
"base": 0.025919999986174558,
"step": 0.0032400001728948
},
"7": {
"key": "speed",
"base": 1.1999999813543638,
"step": 0.0999999985238072
},
"8": {
"key": "cpct",
"base": 0.01555200013140312,
"step": 0.0019440008022287999
},
"9": {
"key": "cdmg",
"base": 0.031103999564314318,
"step": 0.00388800090596568
},
"10": {
"key": "effPct",
"base": 0.020736000408034798,
"step": 0.00259200083680776
},
"11": {
"key": "effDef",
"base": 0.020736000408034798,
"step": 0.00259200083680776
},
"12": {
"key": "stance",
"base": 0.031103999564314318,
"step": 0.00388800090596568
}
},
"4": {
"1": {
"key": "hp",
"base": 27.096030574681556,
"step": 3.387003946748833
},
"2": {
"key": "atk",
"base": 13.548015787460994,
"step": 1.6935019741893238
},
"3": {
"key": "def",
"base": 13.548015787460994,
"step": 1.6935019741893238
},
"4": {
"key": "hpPct",
"base": 0.02764799984555448,
"step": 0.00345600041725176
},
"5": {
"key": "atkPct",
"base": 0.02764799984555448,
"step": 0.00345600041725176
},
"6": {
"key": "defPct",
"base": 0.03455999998156608,
"step": 0.00431999999769576
},
"7": {
"key": "speed",
"base": 1.5999999754495926,
"step": 0.1999999970476144
},
"8": {
"key": "cpct",
"base": 0.020736000408034798,
"step": 0.00259200083680776
},
"9": {
"key": "cdmg",
"base": 0.04147200011757768,
"step": 0.00518400027663168
},
"10": {
"key": "effPct",
"base": 0.02764799984555448,
"step": 0.00345600041725176
},
"11": {
"key": "effDef",
"base": 0.02764799984555448,
"step": 0.00345600041725176
},
"12": {
"key": "stance",
"base": 0.04147200011757768,
"step": 0.00518400027663168
}
},
"5": {
"1": {
"key": "hp",
"base": 33.87003846957621,
"step": 4.233754934425572
},
"2": {
"key": "atk",
"base": 16.93501873490072,
"step": 2.116876967558232
},
"3": {
"key": "def",
"base": 16.93501873490072,
"step": 2.116876967558232
},
"4": {
"key": "hpPct",
"base": 0.03455999998156608,
"step": 0.00431999999769576
},
"5": {
"key": "atkPct",
"base": 0.03455999998156608,
"step": 0.00431999999769576
},
"6": {
"key": "defPct",
"base": 0.04319999927846568,
"step": 0.00539999982249672
},
"7": {
"key": "speed",
"base": 1.9999999686134988,
"step": 0.2999999955714216
},
"8": {
"key": "cpct",
"base": 0.025919999986174558,
"step": 0.0032400001728948
},
"9": {
"key": "cdmg",
"base": 0.051839999972349116,
"step": 0.0064800003457896
},
"10": {
"key": "effPct",
"base": 0.03455999998156608,
"step": 0.00431999999769576
},
"11": {
"key": "effDef",
"base": 0.03455999998156608,
"step": 0.00431999999769576
},
"12": {
"key": "stance",
"base": 0.051839999972349116,
"step": 0.0064800003457896
} }
} }
} }

View File

@ -0,0 +1,13 @@
import { Data } from '#miao'
import lodash from 'lodash'
let data = Data.readJSON('/resources/meta-sr/weapon/data.json', 'miao')
let aliasMap = {}
lodash.forEach(data, (ds) => {
aliasMap[ds.id] = ds.id
aliasMap[ds.name] = ds.id
})
export const weaponAlias = aliasMap
export const weaponData = data

View File

@ -18,6 +18,7 @@ lodash.forEach(artis, (ds) => {
if (as.name) { if (as.name) {
artiMap[as.name] = { artiMap[as.name] = {
set: ds.name, set: ds.name,
name: as.name,
idx idx
} }
artiSet.sets[idx] = as.name artiSet.sets[idx] = as.name