修正enka数据源更新dmg修正的异常

This commit is contained in:
Kokomi 2022-09-09 10:49:31 +08:00
parent 42521f37d4
commit d3d23da1e5

View File

@ -33,7 +33,7 @@ const attrMap = {
} }
let EnkaData = { let EnkaData = {
getProfile (data) { getProfile(data) {
let char = Character.get(data.avatarId) let char = Character.get(data.avatarId)
let profile = new ProfileData({ id: char.id }) let profile = new ProfileData({ id: char.id })
profile.setBasic({ profile.setBasic({
@ -54,7 +54,7 @@ let EnkaData = {
} }
return EnkaData.dataFix(profile) return EnkaData.dataFix(profile)
}, },
getAttr (data) { getAttr(data) {
let ret = {} let ret = {}
let attrKey = { let attrKey = {
// atk: 2001, // atk: 2001,
@ -105,7 +105,7 @@ let EnkaData = {
return ret return ret
}, },
getArtifact (data) { getArtifact(data) {
let ret = {} let ret = {}
let get = function (d) { let get = function (d) {
@ -144,7 +144,7 @@ let EnkaData = {
}) })
return ret return ret
}, },
getWeapon (data) { getWeapon(data) {
let ds = {} let ds = {}
lodash.forEach(data, (temp) => { lodash.forEach(data, (temp) => {
if (temp.flat && temp.flat.itemType === 'ITEM_WEAPON') { if (temp.flat && temp.flat.itemType === 'ITEM_WEAPON') {
@ -161,7 +161,7 @@ let EnkaData = {
affix: (lodash.values(weapon.affixMap)[0] || 0) + 1 affix: (lodash.values(weapon.affixMap)[0] || 0) + 1
} }
}, },
getTalent (charid, ds = {}) { getTalent(charid, ds = {}) {
let char = Character.get(charid) let char = Character.get(charid)
let { talentId = {}, talentElem = {}, talentKey = {} } = char.meta let { talentId = {}, talentElem = {}, talentKey = {} } = char.meta
let elem = '' let elem = ''
@ -185,7 +185,7 @@ let EnkaData = {
talent: ret talent: ret
} }
}, },
dataFix (ret) { dataFix(ret) {
if (ret._fix) { if (ret._fix) {
return ret return ret
} }
@ -209,7 +209,9 @@ let EnkaData = {
} }
let { name, affix } = weapon let { name, affix } = weapon
// 修正武器的加伤 // 修正武器的加伤
attr.dmg = Math.max(0, attr.dmg - wDmg[name] - wDmg[name] * (affix - 1) / 4) if (wDmg[name]) {
attr.dmg = Math.max(0, attr.dmg - wDmg[name] - wDmg[name] * (affix - 1) / 4)
}
ret._fix = true ret._fix = true
return ret return ret
} }