From 3430309c0287036e154df09e633ff5473261caa5 Mon Sep 17 00:00:00 2001 From: Aluxes <39981645+AshenAshes@users.noreply.github.com> Date: Mon, 14 Aug 2023 02:39:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=9F=E9=93=81=E6=94=AF=E6=8C=81=E6=8C=81?= =?UTF-8?q?=E7=BB=AD=E4=BC=A4=E5=AE=B3=E4=BB=A5=E5=8F=8A=E5=87=BB=E7=A0=B4?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97=EF=BC=9B=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8D=A1=E8=8A=99=E5=8D=A1=E3=80=81=E9=93=B6=E7=8B=BC=E4=BC=A4?= =?UTF-8?q?=E5=AE=B3=E8=AE=A1=E7=AE=97=20(#620)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wiki/CharTalent.js | 2 +- apps/wiki/CharWiki.js | 1 - models/ProfileDmg.js | 2 +- models/profile/DmgAttr.js | 17 ++- models/profile/DmgCalc.js | 86 +++++++++++++-- models/profile/DmgCalcMeta.js | 103 +++++++++++++++++- resources/character/profile-detail.html | 2 +- resources/meta-sr/artifact/artis-mark.js | 3 +- resources/meta-sr/character/卡芙卡/calc.js | 48 ++++++++ .../meta-sr/character/卡芙卡/data.json | 2 +- resources/meta-sr/character/银狼/calc.js | 7 ++ resources/meta-sr/weapon/虚无/calc.js | 4 +- 12 files changed, 258 insertions(+), 19 deletions(-) create mode 100644 resources/meta-sr/character/卡芙卡/calc.js diff --git a/apps/wiki/CharTalent.js b/apps/wiki/CharTalent.js index 25527130..b285c3e7 100644 --- a/apps/wiki/CharTalent.js +++ b/apps/wiki/CharTalent.js @@ -12,7 +12,7 @@ const CharTalent = { lodash.forEach(['cons', 'talent', 'treeData'], (key) => { lodash.forEach(detail[key], (ds, idx) => { if (ds.desc) { - if (key === 'talent') { + if (key === 'talent' && ds.desc.split) { let desc = CharTalent.getDesc(ds.desc, ds.tables, idx === 'a' ? 5 : 8) ds.desc = desc.desc ds.tables = desc.tables diff --git a/apps/wiki/CharWiki.js b/apps/wiki/CharWiki.js index 11b37e12..c17fb2f1 100644 --- a/apps/wiki/CharWiki.js +++ b/apps/wiki/CharWiki.js @@ -81,7 +81,6 @@ const CharWiki = { return CharMaterial.render({ e, char }) } return await CharTalent.render(e, mode, char) - }, async render ({ e, char }) { diff --git a/models/ProfileDmg.js b/models/ProfileDmg.js index a6443fb2..e471851b 100644 --- a/models/ProfileDmg.js +++ b/models/ProfileDmg.js @@ -46,7 +46,7 @@ export default class ProfileDmg extends Base { let talentData = profile.talent || {} let detail = char.detail let { isSr, isGs } = this - lodash.forEach((isSr ? 'a,a2,e,q,t' : 'a,e,q').split(','), (key) => { + lodash.forEach((isSr ? 'a,a2,e,e2,q,t' : 'a,e,q').split(','), (key) => { let level = lodash.isNumber(talentData[key]) ? talentData[key] : (talentData[key]?.level || 1) let map = {} if (isGs && detail.talentData) { diff --git a/models/profile/DmgAttr.js b/models/profile/DmgAttr.js index 8429b57b..b49dd711 100644 --- a/models/profile/DmgAttr.js +++ b/models/profile/DmgAttr.js @@ -26,7 +26,7 @@ let DmgAttr = { } }) - lodash.forEach((game === 'gs' ? 'mastery,recharge,cpct,cdmg,heal,dmg,phy' : 'speed,recharge,cpct,cdmg,heal,dmg,effPct,effDef,stance').split(','), (key) => { + lodash.forEach((game === 'gs' ? 'mastery,recharge,cpct,cdmg,heal,dmg,phy' : 'speed,recharge,cpct,cdmg,heal,dmg,enemyDmg,effPct,effDef,stance').split(','), (key) => { ret[key] = { base: attr[key] * 1 || 0, // 基础值 plus: 0, // 加成值 @@ -36,13 +36,14 @@ let DmgAttr = { }) // 技能属性记录 - lodash.forEach((game === 'gs' ? 'a,a2,a3,e,q' : 'a,a2,a3,e,q,t').split(','), (key) => { + lodash.forEach((game === 'gs' ? 'a,a2,a3,e,q' : 'a,a2,a3,e,e2,q,t').split(','), (key) => { ret[key] = { pct: 0, // 倍率加成 multi: 0, // 独立倍率乘区加成,宵宫E等 plus: 0, // 伤害值提高 dmg: 0, // 伤害提高 + enemydmg: 0, // 承受伤害提高 cpct: 0, // 暴击提高 cdmg: 0, // 爆伤提高 @@ -84,6 +85,12 @@ let DmgAttr = { ret.aggravate = 0 // 超激化 ret.spread = 0 // 蔓激化 ret.fykx = 0 // 敌人反应抗性降低 + } else if (game === 'sr') { + // 技能持续伤害与弱点击破持续伤害 + ret.dot = { + dmg: 0, // 伤害提高 + enemydmg: 0 // 承受伤害提高 + } } return ret }, @@ -199,6 +206,12 @@ let DmgAttr = { if (['vaporize', 'melt', 'burning', 'superConduct', 'swirl', 'electroCharged', 'shatter', 'overloaded', 'bloom', 'burgeon', 'hyperBloom', 'aggravate', 'spread', 'kx', 'fykx'].includes(key)) { attr[key] += val * 1 || 0 + return + } + + let dRet = /^(dot)(Dmg|EnemyDmg)$/.exec(key) + if (dRet) { + attr[dRet[1]][dRet[2].toLowerCase()] += val * 1 || 0 } }) msg.push(title) diff --git a/models/profile/DmgCalc.js b/models/profile/DmgCalc.js index c26e7d6f..acaa4e5f 100644 --- a/models/profile/DmgCalc.js +++ b/models/profile/DmgCalc.js @@ -1,7 +1,7 @@ /* * 伤害计算 - 计算伤害 * */ -import { eleBaseDmg, erTitle } from './DmgCalcMeta.js' +import { eleBaseDmg, erTitle, breakBaseDmg } from './DmgCalcMeta.js' import DmgMastery from './DmgMastery.js' let DmgCalc = { @@ -23,7 +23,7 @@ let DmgCalc = { } = data let calc = ds.calc - let { atk, dmg, phy, cdmg, cpct } = attr + let { atk, dmg, phy, cdmg, cpct, enemyDmg } = attr // 攻击区 let atkNum = calc(atk) @@ -38,6 +38,12 @@ let DmgCalc = { dmgNum = (1 + phy.base / 100 + phy.plus / 100) } + // 易伤区 + let enemyDmgNum = 1 + if (game === 'sr') { + enemyDmgNum = 1 + enemyDmg.base / 100 + enemyDmg.plus / 100 + } + let cpctNum = cpct.base / 100 + cpct.plus / 100 // 爆伤区 @@ -55,6 +61,7 @@ let DmgCalc = { pctNum += ds.pct / 100 dmgNum += ds.dmg / 100 + enemyDmgNum += game === 'gs' ? 0 : ds.enemydmg / 100 cpctNum += ds.cpct / 100 cdmgNum += ds.cdmg / 100 enemyDef += ds.def / 100 @@ -66,7 +73,8 @@ let DmgCalc = { // 防御区 let defNum = (level + 100) / ((level + 100) + (enemyLv + 100) * (1 - enemyDef) * (1 - enemyIgnore)) if (game === 'sr') { - defNum = (200 + level * 10) / ((200 + level * 10) + (200 + enemyLv * 10) * (1 - enemyDef) * (1 - enemyIgnore)) + let enemyDefdown = enemyDef + enemyIgnore <= 1 ? enemyDef + enemyIgnore : 1 + defNum = (200 + level * 10) / ((200 + level * 10) + (200 + enemyLv * 10) * (1 - enemyDefdown)) } // 抗性区 @@ -95,8 +103,44 @@ let DmgCalc = { const isEle = ele !== false && ele !== 'phy' // 反应区 - let eleNum = isEle ? DmgMastery.getBasePct(ele, attr.element) : 1 - let eleBase = isEle ? 1 + attr[ele] / 100 + DmgMastery.getMultiple(ele, calc(attr.mastery)) : 1 + let eleNum = 1 + let eleBase = 1 + if (game === 'gs') { + eleNum = isEle ? DmgMastery.getBasePct(ele, attr.element) : 1 + eleBase = isEle ? 1 + attr[ele] / 100 + DmgMastery.getMultiple(ele, calc(attr.mastery)) : 1 + } + + let breakDotBase = 1 + let stanceNum = 1 + if (game === 'sr') { + switch (ele) { + case 'skillDot': { + pctNum = pctNum / 100 + dmgNum += attr.dot.dmg / 100 + enemyDmgNum += attr.dot.enemydmg / 100 + break + } + case 'shock': + case 'burn': + case 'windShear': + case 'bleed': + case 'entanglement': + case 'lightningBreak': + case 'fireBreak': + case 'windBreak': + case 'physicalBreak': + case 'quantumBreak': + case 'imaginaryBreak': { + eleNum = DmgMastery.getBasePct(ele, attr.element) + stanceNum = 1 + calc(attr.stance) / 100 + enemyDmgNum += attr.dot.enemydmg / 100 + break + } + default: + break + } + } + let dmgBase = (mode === 'basic') ? basicNum + plusNum : atkNum * pctNum * (1 + multiNum) + plusNum let ret = {} @@ -135,17 +179,43 @@ let DmgCalc = { break } + case 'skillDot': { + ret = { + avg: dmgBase * dmgNum * enemyDmgNum * defNum * kNum + } + break + } + + // 未计算层数(风化、纠缠)和韧性条系数(击破、纠缠) + case 'shock': + case 'burn': + case 'windShear': + case 'bleed': + case 'entanglement': + case 'lightningBreak': + case 'fireBreak': + case 'windBreak': + case 'physicalBreak': + case 'quantumBreak' : + case 'imaginaryBreak':{ + breakDotBase *= breakBaseDmg[level] + ret = { + avg: breakDotBase * eleNum * stanceNum * enemyDmgNum * defNum * kNum + } + break + } + default: { ret = { - dmg: dmgBase * dmgNum * (1 + cdmgNum) * defNum * kNum, - avg: dmgBase * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum + dmg: dmgBase * dmgNum * enemyDmgNum * (1 + cdmgNum) * defNum * kNum, + avg: dmgBase * dmgNum * enemyDmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum } } } if (showDetail) { console.log('Attr', attr) - console.log({ mode, dmgBase, atkNum, pctNum, multiNum, plusNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum, kNum }) + console.log({ mode, dmgBase, atkNum, pctNum, multiNum, plusNum, dmgNum, enemyDmgNum, stanceNum, cpctNum, cdmgNum, defNum, eleNum, kNum }) console.log('Ret', ret) } diff --git a/models/profile/DmgCalcMeta.js b/models/profile/DmgCalcMeta.js index f78a551d..ddc02881 100644 --- a/models/profile/DmgCalcMeta.js +++ b/models/profile/DmgCalcMeta.js @@ -2,8 +2,10 @@ import lodash from 'lodash' // 元素反应类型及基数 export const erType = { + // 增幅反应 vaporize: { type: 'pct', num: ({ element }) => element === '水' ? 2 : 1.5, title: '蒸发' }, melt: { type: 'pct', num: ({ element }) => element === '火' ? 2 : 1.5, title: '融化' }, + // 剧变反应 burning: { type: 'fusion', num: () => 1, title: '燃烧' }, superConduct: { type: 'fusion', num: () => 2, title: '超导' }, swirl: { type: 'fusion', num: () => 2.4, title: '扩散' }, @@ -13,8 +15,23 @@ export const erType = { bloom: { type: 'fusion', num: () => 8, title: '绽放' }, burgeon: { type: 'fusion', num: () => 12, title: '烈绽放' }, hyperBloom: { type: 'fusion', num: () => 12, title: '超绽放' }, + // 激化反应 aggravate: { type: 'bonus', num: () => 4.6, title: '超激化' }, - spread: { type: 'bonus', num: () => 5.0, title: '蔓激化' } + spread: { type: 'bonus', num: () => 5.0, title: '蔓激化' }, + // 击破持续伤害 + shock: { type: 'breakDot', num: () => 2.0, title: '触电' }, + burn: { type: 'breakDot', num: () => 1.0, title: '灼烧' }, + windShear: { type: 'breakDot', num: () => 1.0, title: '风化' }, + bleed: { type: 'breakDot', num: () => 1.0, title: '裂伤' }, + // 击破附加伤害 + entanglement: { type: 'breakPlus', num: () => 0.6, title: '纠缠' }, + // 击破伤害 + ligntningBreak: { type: 'break', num: () => 1.0, title: '雷击破' }, + fireBreak: { type: 'break', num: () => 2.0, title: '火击破' }, + windBreak: { type: 'break', num: () => 1.5, title: '风击破' }, + physicalBreak: { type: 'break', num: () => 2.0, title: '物理击破' }, + quantumBreak: { type: 'break', num: () => 0.5, title: '量子击破' }, + imaginaryBreak: { type: 'break', num: () => 0.5, title: '虚数击破' } } let erTmp = {} lodash.forEach(erType, (er, key) => { @@ -115,3 +132,87 @@ export const eleBaseDmg = { 89: 351.274, 90: 361.713 } + +// 各等级击破基础伤害 +export const breakBaseDmg = { + 1: 54.00, + 2: 58.00, + 3: 62.00, + 4: 67.53, + 5: 70.51, + 6: 73.52, + 7: 76.57, + 8: 79.64, + 9: 82.74, + 10: 85.87, + 11: 91.49, + 12: 97.07, + 13: 102.59, + 14: 108.06, + 15: 113.47, + 16: 118.84, + 17: 124.15, + 18: 129.41, + 19: 134.62, + 20: 139.77, + 21: 149.33, + 22: 158.80, + 23: 168.18, + 24: 177.46, + 25: 186.65, + 26: 195.75, + 27: 204.75, + 28: 213.66, + 29: 222.48, + 30: 231.20, + 31: 246.43, + 32: 261.18, + 33: 275.47, + 34: 289.32, + 35: 302.73, + 36: 315.71, + 37: 328.29, + 38: 340.47, + 39: 352.26, + 40: 363.67, + 41: 408.12, + 42: 451.79, + 43: 494.68, + 44: 536.82, + 45: 578.22, + 46: 618.92, + 47: 658.91, + 48: 698.23, + 49: 736.89, + 50: 774.90, + 51: 871.06, + 52: 964.87, + 53: 1056.42, + 54: 1145.79, + 55: 1233.06, + 56: 1318.30, + 57: 1401.58, + 58: 1482.96, + 59: 1562.52, + 60: 1640.31, + 61: 1752.32, + 62: 1861.90, + 63: 1969.12, + 64: 2074.07, + 65: 2176.80, + 66: 2277.39, + 67: 2375.91, + 68: 2472.42, + 69: 2566.97, + 70: 2659.64, + 71: 2780.30, + 72: 2898.60, + 73: 3014.60, + 74: 3128.37, + 75: 3239.98, + 76: 3349.47, + 77: 3456.92, + 78: 3562.38, + 79: 3665.91, + 80: 3767.55 +} diff --git a/resources/character/profile-detail.html b/resources/character/profile-detail.html index de0bb3a5..aba96d97 100644 --- a/resources/character/profile-detail.html +++ b/resources/character/profile-detail.html @@ -39,7 +39,7 @@