修复冰融化、少女4等buff等buff遗漏或错误导致的数据计算问题

This commit is contained in:
yoimiya-kokomi 2022-05-02 16:32:31 +08:00
parent 5613993879
commit d0eecaa958
4 changed files with 24 additions and 6 deletions

View File

@ -2,6 +2,8 @@
* `#角色面板` 伤害计算新增部分角色
* 目前支持:雷神、胡桃、魈、神子、甘雨、宵宫、公子、绫人、绫华、心海
* `#老婆` 功能支持对jpeg格式的图片格式识别
* 修复冰融化、少女4等buff等buff遗漏或错误导致的数据计算问题
# 1.3.0

View File

@ -76,7 +76,8 @@ let Calc = {
ret[val] = {
base: attr[key] * 1 || 0,
plus: 0,
pct: 0
pct: 0,
inc: 0
}
})
@ -228,7 +229,7 @@ let Calc = {
attr[tRet[1]][tRet[2].toLowerCase()] += val * 1 || 0;
return;
}
let aRet = /^(hp|def|atk|mastery|cpct|cdmg|heal|recharge|dmg|phy)(Plus|Pct)?$/.exec(key);
let aRet = /^(hp|def|atk|mastery|cpct|cdmg|heal|recharge|dmg|phy)(Plus|Pct|Inc)?$/.exec(key);
if (aRet) {
attr[aRet[1]][aRet[2] ? aRet[2].toLowerCase() : "plus"] += val * 1 || 0;
return;
@ -372,7 +373,13 @@ let Calc = {
let eleNum = 1;
if (ele) {
// todo 更详细
eleNum = (attr.element === "水" ? { zf: 2 } : { zf: 1.5, rh: 2 })[ele] || 1;
let eleMap = {
'水': { zf: 2 },
'火': { zf: 1.5, rh: 2 },
'冰': { rh: 1.5 }
}
eleNum = (eleMap[attr.element] || {})[ele] || 1;
if (attr[ele]) {
eleNum = eleNum * (1 + attr[ele] / 100);
}
@ -446,6 +453,9 @@ let Calc = {
if (detail.check && !detail.check(Calc.getDs(attr, meta, params))) {
return;
}
if (detail.cons && meta.cons * 1 < detail.cons * 1) {
return;
}
let dmg = Calc.getDmgFn({ attr, avatar, enemyLv }),
basicDmgRet;
let ds = lodash.merge({ talent }, Calc.getDs(attr, meta, params));
@ -454,7 +464,7 @@ let Calc = {
basicDmgRet = detail.dmg ? detail.dmg(ds, dmg) : detail.heal(ds, function (num) {
let { attr, calc } = ds;
return {
avg: num * (1 + calc(attr.heal) / 100)
avg: num * (1 + calc(attr.heal) / 100) * (1 + attr.heal.inc / 100)
}
});
detail.userIdx = detailMap.length;
@ -503,7 +513,7 @@ let Calc = {
let dmgCalcRet = detail.dmg ? detail.dmg(ds, dmg) : detail.heal(ds, function (num) {
let { attr, calc } = ds;
return {
avg: num * (1 + calc(attr.heal) / 100)
avg: num * (1 + calc(attr.heal) / 100) * (1 + attr.heal.inc / 100)
}
});
rowData.push({

View File

@ -5,7 +5,7 @@ export const details = [{
title: "水母每跳治疗",
heal: ({ attr, talent, calc }, heal) => {
let t = talent.e['治疗量2'], hp = calc(attr.hp);
return heal(hp * t[0] / 100 + t[1]);
return heal(hp * t[0] / 100 + t[1] * 1);
}
}, {
cons: 2,

View File

@ -184,5 +184,11 @@ export const buffs = {
data: {
aPlus: ({ attr }) => (attr.atk.base + attr.atk.plus + attr.atk.pct * attr.atk.base / 100) * 0.7
}
},
"被怜爱的少女4": {
title: "释放E或Q的10秒内受治疗加成提高20%",
data: {
healInc: 20
}
}
}