mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
修正查他人时排行榜uid记录不准确的问题
This commit is contained in:
parent
734c0105d7
commit
92c7fa8ef5
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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 })
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user