From 92c7fa8ef5025e90e3d7c3ee32d277657622bd03 Mon Sep 17 00:00:00 2001 From: Kokomi <102026640+yoimiya-kokomi@users.noreply.github.com> Date: Fri, 18 Nov 2022 03:40:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=9F=A5=E4=BB=96=E4=BA=BA?= =?UTF-8?q?=E6=97=B6=E6=8E=92=E8=A1=8C=E6=A6=9Cuid=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=B8=8D=E5=87=86=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/ProfileList.js | 3 ++- apps/character/ProfileRank.js | 3 ++- models/ProfileRank.js | 9 +++++++-- resources/meta/character/珊瑚宫心海/calc.js | 6 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/character/ProfileList.js b/apps/character/ProfileList.js index 9d954ed6..bd3ff2c7 100644 --- a/apps/character/ProfileList.js +++ b/apps/character/ProfileList.js @@ -29,7 +29,8 @@ export async function profileList (e) { // 获取面板数据 let profiles = Profile.getAll(uid) // 检测标志位 - await ProfileRank.setUidInfo({ uid, profiles, qq: e.user_id, uidType: isSelfUid ? 'ck' : 'bind' }) + let qq = (e.at && !e.atBot) ? e.at : e.qq + await ProfileRank.setUidInfo({ uid, profiles, qq, uidType: isSelfUid ? 'ck' : 'bind' }) let groupId = e.group_id if (groupId) { diff --git a/apps/character/ProfileRank.js b/apps/character/ProfileRank.js index b2c7b5bd..9887ad58 100644 --- a/apps/character/ProfileRank.js +++ b/apps/character/ProfileRank.js @@ -167,6 +167,7 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) { } tmp._mark = mark?.mark || 0 tmp._dmg = dmg?.avg || 0 + tmp._star = 5 - tmp.star list.push(tmp) } } @@ -176,7 +177,7 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) { list = lodash.sortBy(list, mode === 'mark' ? '_mark' : '_dmg').reverse() } else { title = `#${mode === 'mark' ? '最高分' : '最强'}排行` - list = lodash.sortBy(list, ['star', 'id']).reverse() + list = lodash.sortBy(list, ['uid', '_star', 'id']) } const rankCfg = await ProfileRank.getGroupCfg(groupId) diff --git a/models/ProfileRank.js b/models/ProfileRank.js index e7c913e6..00521214 100644 --- a/models/ProfileRank.js +++ b/models/ProfileRank.js @@ -228,12 +228,17 @@ export default class ProfileRank { delete data.isSelfUid data.uidType = 'ck' } + if (uidType === 'ck') { - data.qq = qq || data.qq || '' data.uidType = 'ck' + data.qq = qq || data.qq || '' } else { - data.qq = data.qq || qq || '' data.uidType = data.uidType || 'bind' + if (data.uidType === 'bind') { + data.qq = data.qq || qq || '' + } else { + data.qq = qq || data.qq || '' + } } await redis.set(`miao:rank:uid-info:${uid}`, JSON.stringify(data), { EX: 3600 * 24 * 365 }) } diff --git a/resources/meta/character/珊瑚宫心海/calc.js b/resources/meta/character/珊瑚宫心海/calc.js index b280ba70..6994ff3d 100644 --- a/resources/meta/character/珊瑚宫心海/calc.js +++ b/resources/meta/character/珊瑚宫心海/calc.js @@ -2,10 +2,10 @@ import lodash from 'lodash' export const details = [{ check: ({ cons }) => cons < 2, - title: '水母每跳治疗', + title: '半血水母每跳治疗', dmgKey: 'q', dmg: ({ attr, talent, calc }, { heal }) => { - let t = talent.e['治疗量2']; + let t = talent.e['治疗量2'] let hp = calc(attr.hp) return heal(hp * t[0] / 100 + t[1] * 1) } @@ -14,7 +14,7 @@ export const details = [{ title: '半血水母每跳治疗', dmgKey: 'q', dmg: ({ attr, talent, calc }, { heal }) => { - let t = talent.e['治疗量2']; + let t = talent.e['治疗量2'] let hp = calc(attr.hp) return heal(hp * t[0] / 100 + t[1] * 1 + hp * 0.045) }