修正星铁面板相关已知问题

This commit is contained in:
Kokomi 2023-10-23 10:56:47 +08:00
parent d196b36eb2
commit b4a8fbf659
9 changed files with 21 additions and 27 deletions

View File

@ -103,7 +103,6 @@ async function updateRes (e) {
command = 'git checkout . && git pull'
}
exec(command, { cwd: `${resPath}/miao-res-plus/` }, function (error, stdout, stderr) {
console.log(stdout)
if (/(Already up[ -]to[ -]date|已经是最新的)/.test(stdout)) {
e.reply('目前所有图片都已经是最新了~')
return true

View File

@ -159,7 +159,7 @@ const Meta = {
let id = Meta.getId(currGame, type, txt)
if (id) {
let data = Meta.getData(currGame, type, id)
return { game, id, data }
return { game: currGame, id, data }
}
}
return false

View File

@ -51,11 +51,6 @@ export default class Avatar extends Base {
get isMaxTalent () {
let maxLv = [1, 2, 4, 6, 8, 10]?.[this.promote - 1] || 10
let minTalent = lodash.min(lodash.map(this.talent, (ds) => ds.original))
if (this.name === '卡维') {
console.log(
'kaka', maxLv, minTalent, this.promote
)
}
return minTalent >= maxLv
}

View File

@ -13,8 +13,6 @@ import CharId from './character/CharId.js'
import CharMeta from './character/CharMeta.js'
import CharCfg from './character/CharCfg.js'
let { wifeMap } = CharId
let metaKey = 'abbr,star,elem,weapon,talentId,talentCons,eta'.split(',')
const detailKey = 'title,allegiance,birth,astro,desc,cncv,jpcv,costume,baseAttr,growAttr,materials,talent,talentData,cons,passive,attr'.split(',')
@ -71,6 +69,7 @@ class Character extends Base {
}
_get (key) {
if (metaKey.includes(key)) {
return this.meta[key]
}

View File

@ -178,10 +178,6 @@ export default class Player extends Base {
// 设置角色数据
setAvatar (ds, source = '') {
let avatar = this.getAvatar(ds.id, true)
if (!avatar.setAvatar) {
console.log(this._avatars)
console.log(avatar, ds)
}
avatar.setAvatar(ds, source)
}

View File

@ -161,13 +161,15 @@ export default class Artis extends Base {
this.eachIdx((ds, idx) => {
let key = this.isGs ? 'name' : 'id'
let tmp = {
level: ds.level || 1,
star: ds.star || 5
level: ds.level || 1
}
if (!ds[key]) {
return true
}
tmp[key] = ds[key]
if (this.isGs) {
tmp.star = ds.star || 5
}
// 如果不为面板数据则不保存mainId和attrIds
if (!this.isProfile) {
ret[idx] = tmp

View File

@ -46,6 +46,10 @@ const CharId = {
return { id, data, name, game, elem: em || elem }
}
let match = Meta.matchGame(game, 'char', ds)
if (match) {
return ret(match.data, match.game)
}
if (game !== 'sr') {
// 尝试使用元素起始匹配
let em = Format.matchElem(ds, '', true)
@ -56,10 +60,6 @@ const CharId = {
}
}
}
let match = Meta.matchGame(game, 'char', ds)
if (match) {
return ret(match.data, match.game)
}
// 无匹配结果
return false
},

View File

@ -9,7 +9,7 @@ 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')
let artiMeta = Meta.create('sr', 'artis')
let artiMeta = Meta.create('sr', 'arti')
let artiMap = {}
let idMap = {}
@ -30,12 +30,15 @@ lodash.forEach(data, (setData) => {
setId: setData.id,
idx
}
artiMeta.addDataItem(ds.name, ds)
idMap[ds.name] = artiMap[ds.name]
lodash.forEach(ds.ids, (star, id) => {
idMap[id] = artiMap[ds.name]
artiMeta.addDataItem(ds.name, {
...ds,
set: setData.name,
setId: setData.id,
idx
})
idMap[ds.name] = lodash.keys(ds.ids).join(',')
artiSet.sets[idx] = ds.name
})
})
@ -44,7 +47,7 @@ setMeta.addAbbr(metaCfg.artiSetAbbr)
setMeta.addAlias(metaCfg.aliasCfg)
artiMeta.addAbbr(metaCfg.artiAbbr)
artiMeta.addAlias(idMap, false)
artiMeta.addAlias(idMap, true)
artiMeta.addMeta({
artiBuffs,
metaData,

View File

@ -79,7 +79,7 @@ export const artiAbbr = {
泰科铵的镭射球场: '泰科铵的球场',
泰科铵的弧光赛道: '泰科铵的赛道',
伊须磨洲的残船鲸落: '伊须磨洲的鲸落',
伊须磨洲的坼裂缆索: '伊须磨洲的缆索',
伊须磨洲的坼裂缆索: '伊须磨洲的缆索'
}
export const artiSetAbbr = {
盗匪荒漠的废土客: '虚数套',