From 6f2deb7c64ec69c31451e0125a6a9dcf629e4819 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Tue, 26 Apr 2022 04:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=20#=E8=8E=B7=E5=8F=96=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E8=A7=92=E8=89=B2=E8=AF=A6=E6=83=85=20=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=A2=9E=E5=8A=A0=E5=89=A9=E4=BD=99=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E7=9A=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character.js | 6 +++++- components/Profile.js | 2 ++ resources/meta/character/八重神子/calc.js | 5 +---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/character.js b/apps/character.js index 31647098..511345c2 100644 --- a/apps/character.js +++ b/apps/character.js @@ -427,6 +427,10 @@ export async function getProfile(e) { if (!data) { return true; } + let leftMsg = ""; + if (!lodash.isUndefined(data.leftCount)) { + leftMsg = `今日剩余${data.leftCount}次请求机会。` + } if (!data.chars) { e.reply("获取角色面板数据失败,请确认角色已在游戏内橱窗展示,并开放了查看详情。设置完毕后请5分钟后再进行请求~"); } else { @@ -440,7 +444,7 @@ export async function getProfile(e) { if (ret.length === 0) { e.reply("获取角色面板数据失败,未能请求到角色数据。请确认角色已在游戏内橱窗展示,并开放了查看详情。设置完毕后请5分钟后再进行请求~") } else { - e.reply(`获取角色面板数据成功!本次获取成功角色: ${ret.join(", ")} 。\n你可以使用 #角色名+面板 来查看详细角色面板属性了`) + e.reply(`获取角色面板数据成功!本次获取成功角色: ${ret.join(", ")} 。\n你可以使用 #角色名+面板 来查看详细角色面板属性了。${leftMsg}`) } } diff --git a/components/Profile.js b/components/Profile.js index f9ca5238..6bb2789f 100644 --- a/components/Profile.js +++ b/components/Profile.js @@ -259,11 +259,13 @@ let Profile = { // 请求成功Bot侧对该uid冷却10分钟 // 请勿将时间改短,10分钟之内若发起请求会命中服务侧的uid缓存,返回之前的数据,并导致服务侧重新计时 await redis.set(`miao:role-all:${uid}`, 'pending', { EX: 600 }); + let leftCount = data.leftCount; data = data.data; let userData = {}; if (data && data["角色名称"]) { userData = Profile.save(uid, data) } + userData.leftCount = leftCount; return userData; }, diff --git a/resources/meta/character/八重神子/calc.js b/resources/meta/character/八重神子/calc.js index fc977a5e..cc6bb899 100644 --- a/resources/meta/character/八重神子/calc.js +++ b/resources/meta/character/八重神子/calc.js @@ -17,10 +17,7 @@ export const details = [{ export const buffs = [{ title: `被动天赋:基于元素精通提高杀生樱伤害[eDmg]%`, data: { - "eDmg": ({ attr, calc }) => { - console.log(attr.mastery, calc(attr.mastery)) - return calc(attr.mastery) * 0.15 - } + "eDmg": ({ attr, calc }) => calc(attr.mastery) * 0.15 } }, { check: ({ cons }) => cons >= 4,