From b4a8fbf6593060e0691973807e30fe1e896b87da Mon Sep 17 00:00:00 2001 From: Kokomi <1379177109@qq.com> Date: Mon, 23 Oct 2023 10:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=98=9F=E9=93=81=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E7=9B=B8=E5=85=B3=E5=B7=B2=E7=9F=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin.js | 1 - components/Meta.js | 2 +- models/Avatar.js | 5 ----- models/Character.js | 3 +-- models/Player.js | 4 ---- models/artis/Artis.js | 6 ++++-- models/character/CharId.js | 8 ++++---- resources/meta-sr/artifact/index.js | 17 ++++++++++------- resources/meta-sr/artifact/meta.js | 2 +- 9 files changed, 21 insertions(+), 27 deletions(-) diff --git a/apps/admin.js b/apps/admin.js index da30af4c..fb19a74d 100644 --- a/apps/admin.js +++ b/apps/admin.js @@ -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 diff --git a/components/Meta.js b/components/Meta.js index 0cd445f1..c57934a5 100644 --- a/components/Meta.js +++ b/components/Meta.js @@ -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 diff --git a/models/Avatar.js b/models/Avatar.js index 4fe4cf86..ea829d84 100644 --- a/models/Avatar.js +++ b/models/Avatar.js @@ -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 } diff --git a/models/Character.js b/models/Character.js index 5c9a2f92..73cb2f25 100644 --- a/models/Character.js +++ b/models/Character.js @@ -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] } diff --git a/models/Player.js b/models/Player.js index ec2388ae..1dc0e8d5 100644 --- a/models/Player.js +++ b/models/Player.js @@ -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) } diff --git a/models/artis/Artis.js b/models/artis/Artis.js index a377caa8..69ede787 100644 --- a/models/artis/Artis.js +++ b/models/artis/Artis.js @@ -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 diff --git a/models/character/CharId.js b/models/character/CharId.js index 40fe6995..384423fa 100644 --- a/models/character/CharId.js +++ b/models/character/CharId.js @@ -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 }, diff --git a/resources/meta-sr/artifact/index.js b/resources/meta-sr/artifact/index.js index 6fafae78..d2534dc0 100644 --- a/resources/meta-sr/artifact/index.js +++ b/resources/meta-sr/artifact/index.js @@ -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, diff --git a/resources/meta-sr/artifact/meta.js b/resources/meta-sr/artifact/meta.js index 5ff4c4e0..2b182fdc 100644 --- a/resources/meta-sr/artifact/meta.js +++ b/resources/meta-sr/artifact/meta.js @@ -79,7 +79,7 @@ export const artiAbbr = { 泰科铵的镭射球场: '泰科铵的球场', 泰科铵的弧光赛道: '泰科铵的赛道', 伊须磨洲的残船鲸落: '伊须磨洲的鲸落', - 伊须磨洲的坼裂缆索: '伊须磨洲的缆索', + 伊须磨洲的坼裂缆索: '伊须磨洲的缆索' } export const artiSetAbbr = { 盗匪荒漠的废土客: '虚数套',