From 1b173e7b3dce2cc698487ac04ce0afb4d59bbe20 Mon Sep 17 00:00:00 2001 From: Kokomi <1379177109@qq.com> Date: Sat, 14 Oct 2023 14:00:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=9F=E9=93=81=E9=9D=A2=E6=9D=BF=E5=8F=98?= =?UTF-8?q?=E6=8D=A2=E6=94=AF=E6=8C=81=E4=BF=9D=E7=95=99=E8=A1=8C=E8=BF=B9?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/profile/ProfileChange.js | 29 ++++++++++++++++------------- models/AvatarData.js | 28 +++++++++++++++++++++++++++- models/Weapon.js | 7 +++++-- resources/meta-sr/artifact/meta.js | 6 +++--- resources/meta-sr/weapon/meta.js | 4 ++-- 5 files changed, 53 insertions(+), 21 deletions(-) diff --git a/apps/profile/ProfileChange.js b/apps/profile/ProfileChange.js index 28eb519d..680524a8 100644 --- a/apps/profile/ProfileChange.js +++ b/apps/profile/ProfileChange.js @@ -39,20 +39,20 @@ const ProfileChange = { const isGs = game === 'gs' const keyMap = isGs ? { artis: '圣遗物', - arti1: '花', - arti2: '毛,羽,羽毛', - arti3: '沙,沙漏,表', - arti4: '杯,杯子', - arti5: '头,冠', + arti1: '花,生之花', + arti2: '毛,羽,羽毛,死之羽', + arti3: '沙,沙漏,表,时之沙', + arti4: '杯,杯子,空之杯', + arti5: '头,冠,理之冠,礼冠,帽子,帽', weapon: '武器' } : { artis: '圣遗物,遗器', - arti1: '头,帽子', - arti2: '手,手套', - arti3: '衣,衣服,甲,躯干', - arti4: '鞋,靴,鞋子,靴子', - arti5: '球', - artis6: '绳', + arti1: '头,帽子,头部', + arti2: '手,手套,手部', + arti3: '衣,衣服,甲,躯干,', + arti4: '鞋,靴,鞋子,靴子,脚,脚部', + arti5: '球,位面球', + artis6: '绳,线,链接绳,连接绳', weapon: '武器,光锥' } let keyTitleMap = {} @@ -80,7 +80,10 @@ const ProfileChange = { let keyRet = keyReg.exec(txt) if (keyRet && keyRet[4]) { let char = Character.get(lodash.trim(keyRet[2])) - if (char && (char.game === game)) { + if (char) { + if (char.game !== game) { + return true + } lodash.forEach(keyRet[4].split('+'), (key) => { key = lodash.trim(key) let type = keyTitleMap[key] @@ -90,7 +93,7 @@ const ProfileChange = { type } }) - } else if (!['武器', '光锥', '花', '手'].includes(keyRet[4])) { + } else if (keyRet[4].length > 2) { return true } } diff --git a/models/AvatarData.js b/models/AvatarData.js index 9b188309..38e1d4b3 100644 --- a/models/AvatarData.js +++ b/models/AvatarData.js @@ -124,12 +124,16 @@ export default class AvatarData extends Base { this._costume = ds.costume || this._costume || 0 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.trees = ds.trees || this.trees || [] + this.trees = this.trees || [] this._source = ds._source || this._source || '' this._time = ds._time || this._time || now this._update = ds._update || this._update || ds._time || now this._talent = ds._talent || this._talent || ds._time || now + if (ds.trees) { + this.setTrees(ds.trees) + } + // 存在数据源时更新时间 if (source) { this._update = now @@ -143,6 +147,28 @@ export default class AvatarData extends Base { } } + setTrees (ds) { + this.trees = [] + let prefix = '' + let map = {} + lodash.forEach(this.char?.detail?.tree || {}, (ds, key) => { + let ret = /(\d{4})(\d{3})/.exec(key) + if (ret && ret[1] && ret[2]) { + prefix = prefix || ret[1] + map[ret[2]] = key + } + }) + if (prefix) { + for (let i = 0; i <= 3; i++) { + map[`10${i}`] = `${prefix}10${i}` + } + } + lodash.forEach(ds,(id)=>{ + let ret = /\d{4}(\d{3})/.exec(id) + this.trees.push(map[ret?.[1] || id] || id) + }) + } + setWeapon (ds = {}) { let w = Weapon.get(ds.name || ds.id, this.game) if (!w) { diff --git a/models/Weapon.js b/models/Weapon.js index fd5f6a86..3ccc3330 100644 --- a/models/Weapon.js +++ b/models/Weapon.js @@ -74,8 +74,11 @@ class Weapon extends Base { } get maxAffix () { - let datas = this.detail?.affixData?.datas || {} - return (datas['0'] && datas['0'][4]) ? 5 : 1 + if(this.isSr){ + return 5 + } + let data = this.detail?.affixData?.datas || {} + return (data['0'] && data['0'][4]) ? 5 : 1 } static isWeaponSet (name) { diff --git a/resources/meta-sr/artifact/meta.js b/resources/meta-sr/artifact/meta.js index ecf93c7a..15b27beb 100644 --- a/resources/meta-sr/artifact/meta.js +++ b/resources/meta-sr/artifact/meta.js @@ -82,7 +82,7 @@ export const abbr = { 伊须磨洲的坼裂缆索: '伊须磨洲的缆索', 盗匪荒漠的废土客: '虚数套', - 繁星璀璨的天才: '繁星', + 繁星璀璨的天才: '量子套', 激奏雷电的乐队: '雷套', 熔岩锻铸的火匠: '火套', 晨昏交界的翔鹰: '风套', @@ -109,14 +109,14 @@ export const abbr = { let aliasCfg = { 盗匪荒漠的废土客: '虚数套,废土', - 繁星璀璨的天才: '繁星', + 繁星璀璨的天才: '量子套', 激奏雷电的乐队: '雷套,雷电', 熔岩锻铸的火匠: '火套', 晨昏交界的翔鹰: '风套', 野穗伴行的快枪手: '快枪手,快枪', 密林卧雪的猎人: '冰套', 流星追迹的怪盗: '怪盗', - 街头出身的拳王: '拳王', + 街头出身的拳王: '拳王,物理套', 云无留迹的过客: '过客,云无留迹', 戍卫风雪的铁卫: '铁卫,风雪', 净庭教宗的圣骑士: '圣骑士,圣骑士', diff --git a/resources/meta-sr/weapon/meta.js b/resources/meta-sr/weapon/meta.js index c3409fa5..15dc32dd 100644 --- a/resources/meta-sr/weapon/meta.js +++ b/resources/meta-sr/weapon/meta.js @@ -106,8 +106,8 @@ let aliasCfg = { '睿见': '', '「我」的诞生': '我的诞生', '别让世界静下来': '让世界静下来', - '天才们的休憩': '天才的休憩', - '早餐的仪式感': '早餐', + '天才们的休憩': '天才的休憩,天才', + '早餐的仪式感': '早餐,仪式感', '今日亦是和平的一日': '和平的一日,和平一日', '银河铁道之夜': '银河铁道,星穹铁道之夜,星穹铁道', '拂晓之前': '拂晓'