修正#角色面板 中伤害计算的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 dmgMsg = [], dmgData = [];
let dmgCalc = await Calc.calcData(profile, char, avatar); let dmgCalc = await Calc.calcData(profile, char, avatar, talent);
if (dmgCalc && dmgCalc.ret) { if (dmgCalc && dmgCalc.ret) {
lodash.forEach(dmgCalc.ret, (ds) => { lodash.forEach(dmgCalc.ret, (ds) => {
ds.dmg = Format.comma(ds.dmg, 1); ds.dmg = Format.comma(ds.dmg, 1);

View File

@ -91,11 +91,11 @@ let Calc = {
}, },
// 获取天赋数据 // 获取天赋数据
talent(profile, char) { talent(talentData, char) {
let ret = {}; let ret = {};
lodash.forEach(['a', 'e', 'q'], (key) => { lodash.forEach(['a', 'e', 'q'], (key) => {
let lv = profile.talent[key] * 1 || 1, let lv = talentData[key].level_current * 1 || 1,
lvKey = `Lv${lv}`; lvKey = `Lv${lv}`;
let map = {}; let map = {};
@ -236,7 +236,7 @@ let Calc = {
}) })
return retBuffs; return retBuffs;
}, },
async calcData(profile, char, avatar) { async calcData(profile, char, avatar, talentData) {
let charCalcData = await Calc.getCharCalcRule(char.name); let charCalcData = await Calc.getCharCalcRule(char.name);
//avatar.element; //avatar.element;
@ -244,12 +244,11 @@ let Calc = {
if (!charCalcData) { if (!charCalcData) {
return false; return false;
} }
let talent = Calc.talent(profile, char); let talent = Calc.talent(talentData, char);
let meta = { let meta = {
cons: profile.cons * 1, cons: avatar.actived_constellation_num * 1,
...profile.talent, talent
talent,
} }
let { buffs, details, defParams } = charCalcData; let { buffs, details, defParams } = charCalcData;