From f8a333eea83cd8644d61ff9986cdf07750389258 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Fri, 6 May 2022 06:56:04 +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=E6=96=B0=E5=A2=9E=E5=88=BB?= =?UTF-8?q?=E6=99=B4=E3=80=81=E9=98=BF=E8=B4=9D=E5=A4=9A=E3=80=81=E9=A6=99?= =?UTF-8?q?=E8=8F=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 15 +++++--- components/Calc.js | 10 ++--- components/models/Character.js | 8 ++-- resources/meta/character/阿贝多/calc.js | 44 ++++++++++++++++++++++ resources/meta/character/香菱/calc.js | 27 +++++++++++++ resources/meta/weapons/calc.js | 18 +-------- 6 files changed, 92 insertions(+), 30 deletions(-) create mode 100644 resources/meta/character/阿贝多/calc.js create mode 100644 resources/meta/character/香菱/calc.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 023f01b6..b712872e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,19 @@ +# 1.4.1 + +* `#角色面板` 伤害计算新增部分角色 + * 目前支持:雷神、胡桃、魈、神子、甘雨、宵宫、公子、绫人、绫华、心海、钟离、刻晴、阿贝多、香菱 + # 1.4.0 * 增加 `#深渊配队` 功能 - * 根据当前账号的角色练度及本期深渊出场数据,推荐较匹配的配队方案 - * 深渊出场数据来自胡桃API,为SnapGenshin用户自主上传的深渊挑战记录,感谢SG团队 - * 配队方案仅供参考 + * 根据当前账号的角色练度及本期深渊出场数据,推荐较匹配的配队方案 + * 深渊出场数据来自胡桃API,为SnapGenshin用户自主上传的深渊挑战记录,感谢SG团队 + * 配队方案仅供参考 * `#角色面板` 伤害计算新增部分角色 * 目前支持:雷神、胡桃、魈、神子、甘雨、宵宫、公子、绫人、绫华、心海、钟离 * `#角色面板` 一些功能升级与调整 - * 支持对治疗量、护盾量的计算与展示 - * 修复冰融化、少女4等buff等buff遗漏或错误导致的伤害计算偏差 + * 支持对治疗量、护盾量的计算与展示 + * 修复冰融化、少女4等buff等buff遗漏或错误导致的伤害计算偏差 * `#老婆` 功能支持对jpeg格式的图片格式识别 # 1.3.0 diff --git a/components/Calc.js b/components/Calc.js index fd5ac840..677f40a3 100644 --- a/components/Calc.js +++ b/components/Calc.js @@ -326,7 +326,7 @@ let Calc = { let { calc } = ds; - let dmgFn = function (pctNum = 0, talent = false, ele = false, mode = "talent") { + let dmgFn = function (pctNum = 0, talent = false, ele = false, basicNum = 0, mode = "talent") { let { atk, dmg, cdmg, cpct } = attr; // 攻击区 let atkNum = calc(atk); @@ -403,8 +403,8 @@ let Calc = { let ret = {}; if (mode === "basic") { ret = { - dmg: pctNum * dmgNum * (1 + cdmgNum) * defNum * kNum * eleNum, - avg: pctNum * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum + dmg: basicNum * dmgNum * (1 + cdmgNum) * defNum * kNum * eleNum, + avg: basicNum * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum } } else { // 计算最终伤害 @@ -421,8 +421,8 @@ let Calc = { return ret; }; - dmgFn.basic = function (pctNum = 0, talent = false, ele = false) { - return dmgFn(pctNum, talent, ele, "basic"); + dmgFn.basic = function (basicNum = 0, talent = false, ele = false) { + return dmgFn(0, talent, ele, basicNum, "basic"); } dmgFn.heal = function (num) { diff --git a/components/models/Character.js b/components/models/Character.js index 26569766..4a43b3b5 100644 --- a/components/models/Character.js +++ b/components/models/Character.js @@ -154,9 +154,11 @@ let idSort = {}; lodash.forEach(charPosIdx, (chars, pos) => { chars = chars.split(","); lodash.forEach(chars, (name, idx) => { - let id = YunzaiApps.mysInfo['roleIdToName'](name); - if (id) { - idSort[id] = pos * 100 + idx; + if (global.YunzaiApps) { + let id = YunzaiApps.mysInfo['roleIdToName'](name); + if (id) { + idSort[id] = pos * 100 + idx; + } } }) }) diff --git a/resources/meta/character/阿贝多/calc.js b/resources/meta/character/阿贝多/calc.js new file mode 100644 index 00000000..dda45502 --- /dev/null +++ b/resources/meta/character/阿贝多/calc.js @@ -0,0 +1,44 @@ +export const details = [{ + title: "E阳华伤害", + talent: "e", + dmg: ({ talent }, dmg) => dmg(talent.e['技能伤害'], 'e') +}, { + title: "E刹那之花伤害", + dmg: ({ talent, attr, calc }, { basic }) => { + let ret = talent.e['刹那之花伤害'] * calc(attr.def) / 100 + attr.e.plus; + return basic(ret, 'e'); + } +}, { + title: "E刹那之花(打半血)", + params: { + half: true + }, + dmg: ({ talent, attr, calc }, { basic }) => { + let ret = talent.e['刹那之花伤害'] * calc(attr.def) / 100 + attr.e.plus; + return basic(ret, 'e'); + } +}, { + title: "Q总伤害", + check: ({ cons }) => cons < 2, + params: { buff: 0 }, + dmg: ({ talent }, dmg) => dmg(talent.q['爆发伤害'] + talent.q['生灭之花伤害'] * 7, 'q') +}, { + title: "满BuffQ总伤害", + cons: 2, + dmg: ({ talent }, dmg) => dmg(talent.q['爆发伤害'] + talent.q['生灭之花伤害'] * 7, 'q') +}]; + +export const mainAttr = "def,atk,cpct,cdmg"; + +export const buffs = [{ + title: "阿贝多被动:刹那之花对生命值低于50%的敌人造成的伤害提高25%", + data: { + eDmg: ({ params }) => params.half ? 25 : 0 + } +}, { + title: "阿贝多2命:4每层Buff提高Q [qPlus]伤害", + cons: 2, + data: { + qPlus: ({ params, attr, calc }) => params.buff === 0 ? 0 : calc(attr.def) * 1.2 + } +}] diff --git a/resources/meta/character/香菱/calc.js b/resources/meta/character/香菱/calc.js new file mode 100644 index 00000000..c2ece66d --- /dev/null +++ b/resources/meta/character/香菱/calc.js @@ -0,0 +1,27 @@ +export const details = [{ + title: "锅巴单口伤害", + dmg: ({ talent }, dmg) => dmg(talent.e['喷火伤害'], 'e') +}, { + title: "锅巴单口蒸发", + dmg: ({ talent }, dmg) => dmg(talent.e['喷火伤害'], 'e', 'zf') +}, { + title: "旋火轮单次伤害", + showDetail: true, + dmg: ({ talent, }, dmg) => dmg(talent.q['旋火轮伤害'], 'q') +}, { + title: "旋火轮单次蒸发", + dmg: ({ talent, }, dmg) => dmg(talent.q['旋火轮伤害'], 'q', 'zf') +}]; + +export const mainAttr = "atk,cpct,cdmg"; + +export const buffs = [{ + cons: 1, + title: "香菱1命:锅巴降低敌人火抗15", + data: { + kx: 15 + } +}, { + title: "元素精通:蒸发融化伤害提高[zf]%", + mastery: "zf,rh" +}] diff --git a/resources/meta/weapons/calc.js b/resources/meta/weapons/calc.js index c64a7b60..8b984d46 100644 --- a/resources/meta/weapons/calc.js +++ b/resources/meta/weapons/calc.js @@ -92,12 +92,6 @@ let polearm = { dmg: step(12) } }, - "天空之脊": { - title: "暴击率提升[_cpct]%", - refine: { - _cpct: step(8) - } - }, "护摩之杖": { title: "角色生命低于50%时额外获得[atkPlus]攻击力", data: { @@ -396,12 +390,7 @@ let bow = { a2Dmg: step(8) } }], - "天空之翼": { - title: "暴击伤害提高20%", - refine: { - //cdmg: step(20) - } - }, + "若水": { title: "生命值提高[hpPct]%,伤害提高[dmg]%", refine: { @@ -570,11 +559,6 @@ let sword = { } }], "天空之刃": [{ - title: "暴击率提高[_cpct]%", - refine: { - _cpct: step(4) - } - }, { title: "普攻与重击的伤害值提高[aPlus]", data: { aPlus: ({ attr, calc, refine }) => calc(attr.atk) * step(20)[refine] / 100,