修正伤害计算的问题

This commit is contained in:
Kokomi 2023-11-13 09:59:48 +08:00
parent 03d585484f
commit 2078ac56d0
2 changed files with 3 additions and 6 deletions

View File

@ -137,7 +137,7 @@ export default class ProfileDmg extends Base {
buffs = this.getBuffs(buffs)
let { msg } = DmgAttr.calcAttr({ originalAttr, buffs, meta, params: defParams || {} })
let { msg } = DmgAttr.calcAttr({ originalAttr, buffs, meta, params: defParams || {}, game })
let msgList = []
let ret = []
@ -172,7 +172,7 @@ export default class ProfileDmg extends Base {
detail = detail({ ...ds, attr, profile })
}
let params = lodash.merge({}, defParams, detail?.params || {})
let { attr, msg } = DmgAttr.calcAttr({ originalAttr, buffs, meta, params, talent: detail.talent || '' })
let { attr, msg } = DmgAttr.calcAttr({ originalAttr, buffs, meta, params, talent: detail.talent || '', game })
if (detail.isStatic) {
return
}

View File

@ -118,7 +118,7 @@ let DmgAttr = {
// 计算属性
calcAttr ({ originalAttr, buffs, meta, params = {}, incAttr = '', reduceAttr = '', talent = '', game = 'gs' }) {
let attr = DmgAttr.getAttr({ originalAttr, game: originalAttr.game })
let attr = DmgAttr.getAttr({ originalAttr, game })
let msg = []
let { attrMap } = Meta.getMeta(game, 'arti')
@ -202,9 +202,6 @@ let DmgAttr = {
}
let aRet = /^(hp|def|atk|mastery|cpct|cdmg|heal|recharge|dmg|phy|shield|speed)(Plus|Pct|Inc)?$/.exec(key)
if (aRet) {
if (aRet[1] === 'hp') {
console.log(val, key, attr[aRet[1]], val)
}
attr[aRet[1]][aRet[2] ? aRet[2].toLowerCase() : 'plus'] += val * 1 || 0
return
}