diff --git a/CHANGELOG.md b/CHANGELOG.md index 831bb23b..c0d9bfb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -# 2.4.0 Dev +# 2.4.0 -* !!!尚未完成,不推荐切换至Dev!!! * 初步支持星铁面板数据获取与展示 -* 面板属性计算暂未包含武器及圣遗物Buff,面板数据暂不准确 + * 可使用`#星铁更新面板`来获取面板信息,通过`#希儿面板`来进行查看 + * 部分角色的伤害计算,以及圣遗物评分功能仍在补全中 + * 使用Miao-Yunzai可使用`*`来代填`#星铁`前缀,并能区分游戏使用不同UID,目前仍在Dev版本,请等待后续更新 # 2.3.8 diff --git a/apps/profile/ProfileChange.js b/apps/profile/ProfileChange.js index fe17403e..6c7152f3 100644 --- a/apps/profile/ProfileChange.js +++ b/apps/profile/ProfileChange.js @@ -55,6 +55,7 @@ const ProfileChange = { ret.char = char.id ret.mode = regRet[3] === '换' ? '面板' : regRet[3] ret.uid = regRet[1] || regRet[4] || '' + ret.game = char.game msg = regRet[5] // 更换匹配 @@ -147,13 +148,15 @@ const ProfileChange = { * @param uid * @param charid * @param ds + * @param game * @returns {ProfileData|boolean} */ - getProfile (uid, charid, ds) { + getProfile (uid, charid, ds, game = 'gs') { if (!charid) { return false } - let player = Player.create(uid) + + let player = Player.create(uid, game) let source = player.getProfile(charid) let dc = ds.char || {} @@ -180,7 +183,7 @@ const ProfileChange = { let id = cfg.char || source.id let key = cuid + ':' + id if (!profiles[key]) { - let cPlayer = Player.create(cuid) + let cPlayer = Player.create(cuid, game) profiles[key] = cPlayer.getProfile(id) || {} } return profiles[key]?.id ? profiles[key] : source @@ -194,6 +197,7 @@ const ProfileChange = { fetter: source.fetter || 10, elem: char.elem, dataSource: 'change', + _source: 'change', promote }, char.game, false) @@ -201,9 +205,12 @@ const ProfileChange = { let wCfg = ds.weapon || {} let wSource = getSource(wCfg).weapon || {} let weapon = Weapon.get(wCfg?.weapon || wSource?.name || defWeapon[char.weaponType], char.game, char.weaponType) - if (!weapon || weapon.type !== char.weaponType) { - weapon = Weapon.get(defWeapon[char.weaponType], char.game) + if (char.isGs) { + if (!weapon || weapon.type !== char.weaponType) { + weapon = Weapon.get(defWeapon[char.weaponType], char.game) + } } + let wDs = { name: weapon.name, star: weapon.star, diff --git a/apps/profile/ProfileDetail.js b/apps/profile/ProfileDetail.js index 8085664e..e559d4b1 100644 --- a/apps/profile/ProfileDetail.js +++ b/apps/profile/ProfileDetail.js @@ -28,8 +28,12 @@ let ProfileDetail = { e.reply('面板替换功能已禁用...') return true } + if (pc.game === 'sr') { + e.reply('星铁面板暂不支持面板替换,请等待后续升级...') + return true + } e.uid = pc.uid || e.runtime.uid - profileChange = ProfileChange.getProfile(e.uid, pc.char, pc.change) + profileChange = ProfileChange.getProfile(e.uid, pc.char, pc.change, pc.game) if (profileChange && profileChange.char) { msg = `#${profileChange.char?.name}${pc.mode || '面板'}` e._profile = profileChange diff --git a/models/AvatarArtis.js b/models/AvatarArtis.js index ae2fd76c..78a3d921 100644 --- a/models/AvatarArtis.js +++ b/models/AvatarArtis.js @@ -75,9 +75,9 @@ export default class AvatarArtis extends Base { arti.set = artiObj.setName || arti.set || '' arti.level = ds.level || arti.level || 1 arti.star = artiObj.getStarById(ds.id) || arti.star || 5 - - if (ds.mainId && ds.attrs) { - let attr = artiObj.getAttrData(ds.mainId, ds.attrs, arti.level, arti.star, idx) + let attrIds = ds.attrIds || ds.attrs + if (ds.mainId && attrIds) { + let attr = artiObj.getAttrData(ds.mainId, attrIds, arti.level, arti.star, idx) if (attr) { arti.mainId = ds.mainId arti.main = attr.main || arti.main || {} @@ -85,6 +85,8 @@ export default class AvatarArtis extends Base { } else { console.log('attr id error', ds.main, ds.mainId, idx, arti.level, arti.star) } + } else { + arti.attrs = [] } return } else { @@ -160,9 +162,9 @@ export default class AvatarArtis extends Base { if (this.isSr) { tmp.id = ds.id tmp.mainId = ds.main?.id - tmp.attrs = [] + tmp.attrIds = [] lodash.forEach(ds.attrs, (as) => { - tmp.attrs.push([ + tmp.attrIds.push([ as?.id || '', as?.count || 1, as?.step || 0 diff --git a/models/player/HomoApi.js b/models/player/HomoApi.js index 0208efd1..47c7feb0 100644 --- a/models/player/HomoApi.js +++ b/models/player/HomoApi.js @@ -94,13 +94,13 @@ const HomoData = { id: ds.ID, level: ds.Level || 1, mainId: ds.MainAffixID, - attrs: [] + attrIds: [] } lodash.forEach(ds.RelicSubAffix, (s) => { if (!s.SubAffixID) { return true } - tmp.attrs.push([s.SubAffixID, s.Cnt, s.Step || 0].join(',')) + tmp.attrIds.push([s.SubAffixID, s.Cnt, s.Step || 0].join(',')) }) ret[ds.Type] = tmp }) diff --git a/models/profile/ArtisMark.js b/models/profile/ArtisMark.js index 83ccd20f..83ec144d 100644 --- a/models/profile/ArtisMark.js +++ b/models/profile/ArtisMark.js @@ -189,7 +189,7 @@ let ArtisMark = { let ds = artis[idx] if (ds) { // 不再支持非id格式的面板 - if (!ds.attrs || !ds.mainId) { + if ((!ds.attrIds && !ds.attr) || !ds.mainId) { return false } }