From a86698c563fc449a72c27fce38452262df1c492e Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Wed, 27 Apr 2022 03:07:58 +0800 Subject: [PATCH] =?UTF-8?q?#=E8=A7=92=E8=89=B2=E9=9D=A2=E6=9D=BF=20?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97=E5=A2=9E=E5=8A=A0=E7=94=98?= =?UTF-8?q?=E9=9B=A8=20=E5=AE=8C=E5=96=84=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- apps/admin.js | 4 ++-- components/Calc.js | 8 ++++++-- resources/meta/character/甘雨/calc.js | 24 ++++++++++++++++++------ resources/meta/reliquaries/calc.js | 16 ++++++++-------- resources/meta/weapons/calc.js | 6 +++--- 6 files changed, 38 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a25dd81a..5610c7bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ #1.2.0 * `#角色面板` 增加伤害计算功能 - * 目前支持角色:雷神、胡桃、魈 + * 目前支持角色:雷神、胡桃、魈、神子、甘雨 * 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果 * 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示 * `#获取游戏角色详情`命令在服务侧增加基于UID的天频度限制 diff --git a/apps/admin.js b/apps/admin.js index f766b020..0ed72329 100644 --- a/apps/admin.js +++ b/apps/admin.js @@ -185,7 +185,7 @@ export async function updateMiaoPlugin(e) { exec(command, function (error, stdout, stderr) { if (error) { if (/Yunzai not found/.test(error)) { - e.reply("自动重启失败,请使用 npm run start 命令启动Yunzai-Bot"); + e.reply("自动重启失败,请手动重启以应用新版喵喵。请使用 npm run start 命令启动Yunzai-Bot"); } else { e.reply("重启失败!\nError code: " + error.code + "\n" + error.stack + "\n 请稍后重试。"); } @@ -195,5 +195,5 @@ export async function updateMiaoPlugin(e) { }, 1000); }); - + return true; } \ No newline at end of file diff --git a/components/Calc.js b/components/Calc.js index 45e330ea..b5374643 100644 --- a/components/Calc.js +++ b/components/Calc.js @@ -359,14 +359,18 @@ let Calc = { let defNum = (lv + 100) / ((lv + 100) + (enemyLv + 100) * (1 - enemyDef) * (1 - enemyIgnore)); // 抗性区 + let kx = 10 - (attr.kx || 0); let kNum = 0.9; + if (kx >= 0) { + kNum = (100 - kx) / 100; + } else { + kNum = 1 - kx / 200 + } // 反应区 let eleNum = 1; if (ele) { eleNum = { zf: 1.5, rh: 2 }[ele] || 1; - - if (attr[ele]) { eleNum = eleNum * (1 + attr[ele] / 100); } diff --git a/resources/meta/character/甘雨/calc.js b/resources/meta/character/甘雨/calc.js index 05b8dc5d..252d54e9 100644 --- a/resources/meta/character/甘雨/calc.js +++ b/resources/meta/character/甘雨/calc.js @@ -1,18 +1,30 @@ -export const details = []; +export const details = [{ + title: "霜华绽发伤害", + dmg: ({ talent }, dmg) => dmg(talent.a['霜华矢·霜华绽发伤害'], 'a2') +}, { + title: "霜华矢两段总伤害", + dmg: ({ talent }, dmg) => dmg(talent.a['霜华矢·霜华绽发伤害'] + talent.a['霜华矢命中伤害'], 'a2') +}, { + title: "霜华矢两段+融化", + dmg: ({ talent }, dmg) => dmg(talent.a['霜华矢·霜华绽发伤害'] + talent.a['霜华矢命中伤害'], 'a2', 'rh') +}, { + title: "Q单个冰凌伤害", + params: { + q: 1 + }, + dmg: ({ talent }, dmg) => dmg(talent.q['冰棱伤害'], 'q') +}]; -export const defParams = { - -}; export const buffs = [{ cons: 1, title: "1命效果:霜华失命中减少敌人15%冰抗", data: { - kx: 15 + kx: ({ params }) => params.q ? 0 : 15 } }, { cons: 4, title: "4命效果:大招领域内敌人受到的伤害提升25%", data: { - dmg: 25 + dmg: ({ params }) => params.q ? 25 : 0 } }]; \ No newline at end of file diff --git a/resources/meta/reliquaries/calc.js b/resources/meta/reliquaries/calc.js index 423f74bf..5451fca5 100644 --- a/resources/meta/reliquaries/calc.js +++ b/resources/meta/reliquaries/calc.js @@ -45,7 +45,7 @@ export const buffs = { } }, "流浪大地的乐团4": { - check: ({ weaponType }) => ['法器', '弓'].includes(weaponType), + check: ({ weaponType }) => ['法器', '弓'].includes(weaponType), title: "乐团4:角色重击造成的伤害提高35%", data: { a2Dmg: 35 @@ -71,12 +71,12 @@ export const buffs = { } }, "炽烈的炎之魔女4": { - check:({element})=>element === "火", - title: "魔女4:蒸发、融化伤害提高15%,2层获得15%火元素伤害加成", + check: ({ element }) => element === "火", + title: "魔女4:蒸发、融化伤害提高15%,1层额外提高7.5%火元素伤害加成", data: { zf: 15, rh: 15, - dmg: 15 + dmg: ({ params }) => (params.mn || 1) * 7.5 } }, "昔日宗室之仪2": { @@ -92,14 +92,14 @@ export const buffs = { } }, "冰风迷途的勇士4": { - check:({element})=>element === "冰", + check: ({ element }) => element === "冰", title: "冰套4:攻击处于冰元素影响下的敌人时,暴击率提高20%", data: { cpct: 20 } }, "沉沦之心4": { - check:({element})=>element === "水", + check: ({ element }) => element === "水", title: "水套4:施放元素战技后,普攻与重击伤害提高30%", data: { aDmg: 30, @@ -129,14 +129,14 @@ export const buffs = { } }, "平息鸣雷的尊者4": { - check:({element})=>element === "雷", + check: ({ element }) => element === "雷", title: "平雷4:对处于雷元素影响下的敌人造成的伤害提升35%", data: { dmg: 35 } }, "渡过烈火的贤人4": { - check:({element})=>element === "火", + check: ({ element }) => element === "火", title: "渡火4:对处于火元素影响下的敌人造成的伤害提升35%", data: { dmg: 35 diff --git a/resources/meta/weapons/calc.js b/resources/meta/weapons/calc.js index 6d8f6bc7..2aa78bb5 100644 --- a/resources/meta/weapons/calc.js +++ b/resources/meta/weapons/calc.js @@ -16,6 +16,7 @@ let polearm = { } }, "匣里灭辰": { + check: ({ element }) => ['水', '火'].includes(element), title: "对于水或或元素影响的敌人造成伤害提高[dmg]%", refine: { dmg: [20, 24, 28, 32, 36] @@ -83,9 +84,8 @@ let polearm = { "护摩之杖": { title: "角色生命低于50%时额外获得[atkPlus]攻击力", data: { - atkPlus: ({ attr, refine }) => { - let { hp } = attr, - totalHp = hp.base + hp.plus + hp.pct * hp.base / 100; + atkPlus: ({ attr, refine,calc }) => { + let totalHp = calc(attr.hp); return totalHp * ([0.8, 1, 1.2, 1.4, 1.6][refine] + [1, 1.2, 1.4, 1.6, 1.8][refine]) / 100 } }