From d3d23da1e5df782004cfea2dfa0ba64406524a10 Mon Sep 17 00:00:00 2001 From: Kokomi <592981798@qq.com> Date: Fri, 9 Sep 2022 10:49:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3enka=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90=E6=9B=B4=E6=96=B0dmg=E4=BF=AE=E6=AD=A3=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/profile-data/enka-data.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/components/profile-data/enka-data.js b/components/profile-data/enka-data.js index b41f5524..fac72f26 100644 --- a/components/profile-data/enka-data.js +++ b/components/profile-data/enka-data.js @@ -33,7 +33,7 @@ const attrMap = { } let EnkaData = { - getProfile (data) { + getProfile(data) { let char = Character.get(data.avatarId) let profile = new ProfileData({ id: char.id }) profile.setBasic({ @@ -54,7 +54,7 @@ let EnkaData = { } return EnkaData.dataFix(profile) }, - getAttr (data) { + getAttr(data) { let ret = {} let attrKey = { // atk: 2001, @@ -105,7 +105,7 @@ let EnkaData = { return ret }, - getArtifact (data) { + getArtifact(data) { let ret = {} let get = function (d) { @@ -144,7 +144,7 @@ let EnkaData = { }) return ret }, - getWeapon (data) { + getWeapon(data) { let ds = {} lodash.forEach(data, (temp) => { if (temp.flat && temp.flat.itemType === 'ITEM_WEAPON') { @@ -161,7 +161,7 @@ let EnkaData = { affix: (lodash.values(weapon.affixMap)[0] || 0) + 1 } }, - getTalent (charid, ds = {}) { + getTalent(charid, ds = {}) { let char = Character.get(charid) let { talentId = {}, talentElem = {}, talentKey = {} } = char.meta let elem = '' @@ -185,7 +185,7 @@ let EnkaData = { talent: ret } }, - dataFix (ret) { + dataFix(ret) { if (ret._fix) { return ret } @@ -209,7 +209,9 @@ let EnkaData = { } 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 return ret }