修正伤害计算下静态Buff被重复计算导致的错误

This commit is contained in:
Kokomi 2022-11-24 11:54:27 +08:00
parent 7f4705c64e
commit 5b23ea3349
3 changed files with 9 additions and 2 deletions

View File

@ -153,6 +153,9 @@ export default class ProfileDmg extends Base {
}
let params = lodash.merge({}, defParams, detail.params || {})
let { attr } = DmgAttr.calcAttr({ originalAttr, buffs, meta, params, talent: detail.talent || '' })
if (detail.isStatic) {
return
}
if (detail.check && !detail.check(DmgAttr.getDs(attr, meta, params))) {
return
}

View File

@ -132,7 +132,9 @@ let DmgAttr = {
}
}
}
if (buff.isStatic) {
return
}
// 如果存在rule则进行计算
if (buff.check && !buff.check(ds)) {
return

View File

@ -37,6 +37,7 @@ let DmgBuffs = {
if (lodash.isPlainObject(weaponCfg)) {
weaponCfg = [weaponCfg]
}
let ret = []
lodash.forEach(weaponCfg, (ds) => {
if (ds.isStatic) {
return true
@ -50,8 +51,9 @@ let DmgBuffs = {
ds.data[key] = ({ refine }) => r[refine] * (ds.buffCount || 1)
})
}
ret.push(ds)
})
return weaponCfg
return ret
},
getBuffs (profile, buffs = []) {