From 06ad9f5195f9d9ba83746bebab935588e2606cfe Mon Sep 17 00:00:00 2001 From: Aluxes <39981645+AshenAshes@users.noreply.github.com> Date: Fri, 1 Mar 2024 22:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E6=8E=92=E5=90=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81percent=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/profile/ProfileRank.js | 6 ++++-- models/ProfileRank.js | 3 ++- resources/meta-gs/character/旅行者/electro/calc.js | 2 +- resources/meta-sr/character/刃/calc.js | 2 +- resources/meta-sr/character/布洛妮娅/calc.js | 1 + resources/meta-sr/character/花火/calc.js | 1 + 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/profile/ProfileRank.js b/apps/profile/ProfileRank.js index e2bf2496..0a9c704c 100644 --- a/apps/profile/ProfileRank.js +++ b/apps/profile/ProfileRank.js @@ -206,9 +206,11 @@ async function renderCharRankList({ e, uids, char, mode, groupId }) { title = title.replace(/[ ·]*/g, '') } title = title.length > 10 ? title.replace(/伤害$/, '') : title + let tmpAvg = dmg.type !== 'text' ? Format.comma(dmg.avg, 1) : dmg.avg tmp.dmg = { title, - avg: Format.comma(dmg.avg, 1) + avg: tmpAvg, + rank: data.dmg.rank } } if (uid) { @@ -236,7 +238,7 @@ async function renderCharRankList({ e, uids, char, mode, groupId }) { tmp._mark = mark?._mark || 0 } tmp._formatmark = Format.comma(tmp._mark, 1) - tmp._dmg = dmg?.avg || 0 + tmp._dmg = (0 - tmp.dmg.rank) || 0 tmp._star = 5 - tmp.star list.push(tmp) } diff --git a/models/ProfileRank.js b/models/ProfileRank.js index f7836a6b..a52937f9 100644 --- a/models/ProfileRank.js +++ b/models/ProfileRank.js @@ -337,7 +337,8 @@ export default class ProfileRank { } } if (value && !lodash.isUndefined(value.score)) { - await redis.zAdd(typeKey, { score: value.score, value: this.uid }) + let tmpScore = value.score.toString().replaceAll('%', '') + await redis.zAdd(typeKey, { score: tmpScore, value: this.uid }) } if (!lodash.isNumber(rank)) { rank = await redis.zRevRank(typeKey, this.uid) diff --git a/resources/meta-gs/character/旅行者/electro/calc.js b/resources/meta-gs/character/旅行者/electro/calc.js index 4a762336..629efffe 100644 --- a/resources/meta-gs/character/旅行者/electro/calc.js +++ b/resources/meta-gs/character/旅行者/electro/calc.js @@ -19,7 +19,7 @@ export const details = [{ dmg: ({ talent }, dmg) => dmg(talent.q['威光落雷伤害'], 'q') }] -export const defDmgIdx = 2 +export const defDmgIdx = 1 export const mainAttr = 'atk,cpct,cdmg' export const buffs = [{ diff --git a/resources/meta-sr/character/刃/calc.js b/resources/meta-sr/character/刃/calc.js index 84fbb68a..6861d696 100644 --- a/resources/meta-sr/character/刃/calc.js +++ b/resources/meta-sr/character/刃/calc.js @@ -55,7 +55,7 @@ export const details = [{ } }] -export const defDmgIdx = 2 +export const defDmgIdx = 3 export const mainAttr = 'hp,atk,cpct,cdmg,speed' export const buffs = [{ diff --git a/resources/meta-sr/character/布洛妮娅/calc.js b/resources/meta-sr/character/布洛妮娅/calc.js index 2e7a6866..4df61a30 100644 --- a/resources/meta-sr/character/布洛妮娅/calc.js +++ b/resources/meta-sr/character/布洛妮娅/calc.js @@ -29,6 +29,7 @@ export const details = [{ } }] +export const defDmgIdx = 3 export const mainAttr = 'atk,cpct,cdmg' export const buffs = [{ diff --git a/resources/meta-sr/character/花火/calc.js b/resources/meta-sr/character/花火/calc.js index cc6e2836..74c81576 100644 --- a/resources/meta-sr/character/花火/calc.js +++ b/resources/meta-sr/character/花火/calc.js @@ -32,6 +32,7 @@ export const details = [{ } }] +export const defDmgIdx = 1 export const mainAttr = 'atk,cpct,cdmg' export const buffs = [{