对无天赋等级的面板数据增加容错

This commit is contained in:
Kokomi 2022-12-17 12:37:55 +08:00
parent 8ccda3e7b6
commit 55e422de40
5 changed files with 22 additions and 12 deletions

View File

@ -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) {

View File

@ -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) => {

View File

@ -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 }
})

View File

@ -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;

View File

@ -74,6 +74,7 @@ body {
.detail ul.attr {
// backdrop-filter: blur(4px);
background: rgba(0, 0, 0, .2);
li {
width: 300px;