From ef4f899f6eef23653f954629232373b2432f8447 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Sun, 24 Apr 2022 05:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3#=E8=A7=92=E8=89=B2=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=20=E4=B8=AD=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character.js | 2 +- components/Calc.js | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/character.js b/apps/character.js index 657697ff..918efffc 100644 --- a/apps/character.js +++ b/apps/character.js @@ -633,7 +633,7 @@ export async function renderProfile(e, char, render) { }); let dmgMsg = [], dmgData = []; - let dmgCalc = await Calc.calcData(profile, char, avatar); + let dmgCalc = await Calc.calcData(profile, char, avatar, talent); if (dmgCalc && dmgCalc.ret) { lodash.forEach(dmgCalc.ret, (ds) => { ds.dmg = Format.comma(ds.dmg, 1); diff --git a/components/Calc.js b/components/Calc.js index 55717350..1c59fb66 100644 --- a/components/Calc.js +++ b/components/Calc.js @@ -91,11 +91,11 @@ let Calc = { }, // 获取天赋数据 - talent(profile, char) { + talent(talentData, char) { let ret = {}; lodash.forEach(['a', 'e', 'q'], (key) => { - let lv = profile.talent[key] * 1 || 1, + let lv = talentData[key].level_current * 1 || 1, lvKey = `Lv${lv}`; let map = {}; @@ -236,7 +236,7 @@ let Calc = { }) return retBuffs; }, - async calcData(profile, char, avatar) { + async calcData(profile, char, avatar, talentData) { let charCalcData = await Calc.getCharCalcRule(char.name); //avatar.element; @@ -244,12 +244,11 @@ let Calc = { if (!charCalcData) { return false; } - let talent = Calc.talent(profile, char); + let talent = Calc.talent(talentData, char); let meta = { - cons: profile.cons * 1, - ...profile.talent, - talent, + cons: avatar.actived_constellation_num * 1, + talent } let { buffs, details, defParams } = charCalcData;