From 55e422de40c8f34e584a94f7946a4cee9fa9e2d8 Mon Sep 17 00:00:00 2001 From: Kokomi <102026640+yoimiya-kokomi@users.noreply.github.com> Date: Sat, 17 Dec 2022 12:37:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=97=A0=E5=A4=A9=E8=B5=8B=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=E9=9D=A2=E6=9D=BF=E6=95=B0=E6=8D=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/ProfileRank.js | 1 + models/ProfileDmg.js | 2 +- models/character-lib/CharTalent.js | 27 +++++++++++++++---------- resources/character/profile-detail.css | 3 +++ resources/character/profile-detail.less | 1 + 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/apps/character/ProfileRank.js b/apps/character/ProfileRank.js index 66206293..e2c9ae1b 100644 --- a/apps/character/ProfileRank.js +++ b/apps/character/ProfileRank.js @@ -105,6 +105,7 @@ export async function refreshRank (e) { return true } e.reply('面板数据刷新中,等待时间可能较长,请耐心等待...') + await ProfileRank.resetRank(groupId) let groupUids = await Common.getGroupUids(e) let count = 0 for (let qq in groupUids) { diff --git a/models/ProfileDmg.js b/models/ProfileDmg.js index d97ab029..16a4bbe1 100644 --- a/models/ProfileDmg.js +++ b/models/ProfileDmg.js @@ -39,7 +39,7 @@ export default class ProfileDmg extends Base { let talentData = profile.talent || {} let detail = char.detail lodash.forEach(['a', 'e', 'q'], (key) => { - let level = lodash.isNumber(talentData[key]) ? talentData[key] : (talentData[key].level || 1) + let level = lodash.isNumber(talentData[key]) ? talentData[key] : (talentData[key]?.level || 1) let map = {} if (detail.talentData) { lodash.forEach(char.detail.talentData[key], (ds, key) => { diff --git a/models/character-lib/CharTalent.js b/models/character-lib/CharTalent.js index 070ca9f7..215c67e5 100644 --- a/models/character-lib/CharTalent.js +++ b/models/character-lib/CharTalent.js @@ -1,6 +1,6 @@ /** -* 角色天赋相关处理 -* */ + * 角色天赋相关处理 + * */ import lodash from 'lodash' const CharTalent = { @@ -19,6 +19,20 @@ const CharTalent = { if (lodash.isNumber(ds)) { value = ds } + if (mode !== 'level') { + // 基于original计算level + value = value || ds.original || ds.level_original || ds.level || ds.level_current + if (value > 10) { + mode = 'level' + } else { + original = value + if (key === 'a') { + level = aPlus ? value + 1 : value + } else { + level = cons >= consTalent[key] ? (value + 3) : value + } + } + } if (mode === 'level') { // 基于level计算original value = value || ds.level || ds.level_current || ds.original || ds.level_original @@ -28,15 +42,6 @@ const CharTalent = { } else { original = cons >= consTalent[key] ? (value - 3) : value } - } else { - // 基于original计算level - value = value || ds.original || ds.level_original || ds.level || ds.level_current - original = value - if (key === 'a') { - level = aPlus ? value + 1 : value - } else { - level = cons >= consTalent[key] ? (value + 3) : value - } } ret[key] = { level, original } }) diff --git a/resources/character/profile-detail.css b/resources/character/profile-detail.css index 3312381d..10d3d5f3 100644 --- a/resources/character/profile-detail.css +++ b/resources/character/profile-detail.css @@ -65,6 +65,9 @@ body { border-radius: 4px; overflow: hidden; } +.detail ul.attr { + background: rgba(0, 0, 0, 0.2); +} .detail ul.attr li { width: 300px; font-size: 17px; diff --git a/resources/character/profile-detail.less b/resources/character/profile-detail.less index 50cbf4a5..88fe847d 100644 --- a/resources/character/profile-detail.less +++ b/resources/character/profile-detail.less @@ -74,6 +74,7 @@ body { .detail ul.attr { // backdrop-filter: blur(4px); + background: rgba(0, 0, 0, .2); li { width: 300px;