From e4d8530a6a66c3ff09a71b51b65dfcf8960e5e25 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Sun, 5 Jun 2022 15:53:13 +0800 Subject: [PATCH] =?UTF-8?q?`#=E6=9B=B4=E6=96=B0=E9=9D=A2=E6=9D=BF`=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=AD=A6=E5=99=A8=E7=B1=BB=E5=9E=8B=E3=80=81?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E4=BC=A4=E5=AE=B3=E5=AD=97=E6=AE=B5=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++-- components/Calc.js | 3 +-- components/data/enka.js | 4 ++-- components/models/Character.js | 13 ++++++++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 723a1733..7571313e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,17 @@ +# 1.7.1 + +* `#更新面板` 功能fix + * 修正武器类型、元素伤害字段导致的伤害计算问题 + * 夜兰 请在游戏内不出场状况下获取面板属性 + # 1.7.0 * `#更新面板` 功能升级 * 该功能可直接使用,不再需要token * 在查询新用户时会自动使用,自动使用的CD 12小时 * 支持国际服UID,目前暂不支持2及5开头的UID - * 服务来自enka api,部分网络可能无法请求,请使用科学处理,后续会增加转发服务。 - * 由于服务逻辑与之前数据不一致,部分角色的属性及伤害计算可能会不准确,如有发现请反馈给喵喵。已知问题(夜兰) + * 服务来自enka api,部分网络可能无法请求,请科学处理,后续会增加转发服务。 + * 由于服务逻辑与之前数据不一致,部分角色的属性及伤害计算可能会不准确,如有发现请反馈给喵喵 * `#面板`、`#更新面板`、`#角色面板`、`#角色伤害`、`#圣遗物列表`不再需要绑定cookie,支持查他人 * 使用`#面板`命令可查看已获取面板数据的角色列表 * 默认查询自己UID,同时也可通过命令+uid方式指定查询对象 diff --git a/components/Calc.js b/components/Calc.js index 6a09ec8e..f28468c9 100644 --- a/components/Calc.js +++ b/components/Calc.js @@ -124,9 +124,8 @@ let Calc = { } let char = Character.get(profile.id); - //ret.weaponType = avatar.weapon.type_name; - ret.weaponType = ""; ret.weapon = profile.weapon; + ret.weaponType = char.weaponType; ret.element = eleMap[char.elem.toLowerCase()]; ret.refine = (profile.weapon.affix * 1 - 1) || 0; diff --git a/components/data/enka.js b/components/data/enka.js index 0a9ff1c8..d066c381 100644 --- a/components/data/enka.js +++ b/components/data/enka.js @@ -236,11 +236,11 @@ let Data = { switch (id) { case 10000052: // 雷神被动加成fix - attr.dmgBonus = Math.min(0, attr.dmgBonus - (attr.recharge - 100) * 0.4) + attr.dmgBonus = Math.max(0, attr.dmgBonus - (attr.recharge - 100) * 0.4) break; case 10000041: // 莫娜被动fix - attr.dmgBonus = Math.min(0, attr.dmgBonus - attr.recharge * 0.2) + attr.dmgBonus = Math.max(0, attr.dmgBonus - attr.recharge * 0.2) break; /* case 10000060: diff --git a/components/models/Character.js b/components/models/Character.js index 4a43b3b5..eb18a7c9 100644 --- a/components/models/Character.js +++ b/components/models/Character.js @@ -78,7 +78,6 @@ class Character extends Base { } checkAvatars(avatars) { - if (!lodash.includes([20000000, 10000005, 10000007], this.id * 1)) { return; } @@ -97,6 +96,18 @@ class Character extends Base { lodash.extend(this, getMeta('荧')); } } + + get weaponType() { + const map = { + sword: "单手剑", + catalyst: "法器", + bow: "弓", + claymore: "双手剑", + polearm: "长柄武器" + } + let weaponType = this.weapon || ""; + return map[weaponType.toLowerCase()] || ""; + } } let getMeta = function (name) {