修正#角色面板 中伤害计算的bug

This commit is contained in:
yoimiya-kokomi 2022-04-24 05:52:28 +08:00
parent dd3a3074e5
commit ef4f899f6e
2 changed files with 7 additions and 8 deletions

View File

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

View File

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