From d0eecaa958562a7d9489b8b8d69e413d5c6e54cf Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Mon, 2 May 2022 16:32:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=86=B0=E8=9E=8D=E5=8C=96?= =?UTF-8?q?=E3=80=81=E5=B0=91=E5=A5=B34=E7=AD=89buff=E7=AD=89buff=E9=81=97?= =?UTF-8?q?=E6=BC=8F=E6=88=96=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=AE=A1=E7=AE=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ components/Calc.js | 20 ++++++++++++++----- .../meta/character/珊瑚宫心海/calc.js | 2 +- resources/meta/reliquaries/calc.js | 6 ++++++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43226207..1fe603dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ * `#角色面板` 伤害计算新增部分角色 * 目前支持:雷神、胡桃、魈、神子、甘雨、宵宫、公子、绫人、绫华、心海 +* `#老婆` 功能支持对jpeg格式的图片格式识别 +* 修复冰融化、少女4等buff等buff遗漏或错误导致的数据计算问题 # 1.3.0 diff --git a/components/Calc.js b/components/Calc.js index f1f0d80e..2c5fd68f 100644 --- a/components/Calc.js +++ b/components/Calc.js @@ -76,7 +76,8 @@ let Calc = { ret[val] = { base: attr[key] * 1 || 0, plus: 0, - pct: 0 + pct: 0, + inc: 0 } }) @@ -228,7 +229,7 @@ let Calc = { attr[tRet[1]][tRet[2].toLowerCase()] += val * 1 || 0; return; } - let aRet = /^(hp|def|atk|mastery|cpct|cdmg|heal|recharge|dmg|phy)(Plus|Pct)?$/.exec(key); + let aRet = /^(hp|def|atk|mastery|cpct|cdmg|heal|recharge|dmg|phy)(Plus|Pct|Inc)?$/.exec(key); if (aRet) { attr[aRet[1]][aRet[2] ? aRet[2].toLowerCase() : "plus"] += val * 1 || 0; return; @@ -372,7 +373,13 @@ let Calc = { let eleNum = 1; if (ele) { // todo 更详细 - eleNum = (attr.element === "水" ? { zf: 2 } : { zf: 1.5, rh: 2 })[ele] || 1; + let eleMap = { + '水': { zf: 2 }, + '火': { zf: 1.5, rh: 2 }, + '冰': { rh: 1.5 } + } + + eleNum = (eleMap[attr.element] || {})[ele] || 1; if (attr[ele]) { eleNum = eleNum * (1 + attr[ele] / 100); } @@ -446,6 +453,9 @@ let Calc = { if (detail.check && !detail.check(Calc.getDs(attr, meta, params))) { return; } + if (detail.cons && meta.cons * 1 < detail.cons * 1) { + return; + } let dmg = Calc.getDmgFn({ attr, avatar, enemyLv }), basicDmgRet; let ds = lodash.merge({ talent }, Calc.getDs(attr, meta, params)); @@ -454,7 +464,7 @@ let Calc = { basicDmgRet = detail.dmg ? detail.dmg(ds, dmg) : detail.heal(ds, function (num) { let { attr, calc } = ds; return { - avg: num * (1 + calc(attr.heal) / 100) + avg: num * (1 + calc(attr.heal) / 100) * (1 + attr.heal.inc / 100) } }); detail.userIdx = detailMap.length; @@ -503,7 +513,7 @@ let Calc = { let dmgCalcRet = detail.dmg ? detail.dmg(ds, dmg) : detail.heal(ds, function (num) { let { attr, calc } = ds; return { - avg: num * (1 + calc(attr.heal) / 100) + avg: num * (1 + calc(attr.heal) / 100) * (1 + attr.heal.inc / 100) } }); rowData.push({ diff --git a/resources/meta/character/珊瑚宫心海/calc.js b/resources/meta/character/珊瑚宫心海/calc.js index b9e3e49f..ae0e654c 100644 --- a/resources/meta/character/珊瑚宫心海/calc.js +++ b/resources/meta/character/珊瑚宫心海/calc.js @@ -5,7 +5,7 @@ export const details = [{ title: "水母每跳治疗", heal: ({ attr, talent, calc }, heal) => { let t = talent.e['治疗量2'], hp = calc(attr.hp); - return heal(hp * t[0] / 100 + t[1]); + return heal(hp * t[0] / 100 + t[1] * 1); } }, { cons: 2, diff --git a/resources/meta/reliquaries/calc.js b/resources/meta/reliquaries/calc.js index 5451fca5..1c7f9a0c 100644 --- a/resources/meta/reliquaries/calc.js +++ b/resources/meta/reliquaries/calc.js @@ -184,5 +184,11 @@ export const buffs = { data: { aPlus: ({ attr }) => (attr.atk.base + attr.atk.plus + attr.atk.pct * attr.atk.base / 100) * 0.7 } + }, + "被怜爱的少女4": { + title: "释放E或Q的10秒内,受治疗加成提高20%", + data: { + healInc: 20 + } } } \ No newline at end of file