星铁支持持续伤害以及击破伤害计算;增加卡芙卡、银狼伤害计算 (#620)

This commit is contained in:
Aluxes 2023-08-14 02:39:27 +08:00 committed by GitHub
parent 779cbeb7d2
commit 3430309c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 258 additions and 19 deletions

View File

@ -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

View File

@ -81,7 +81,6 @@ const CharWiki = {
return CharMaterial.render({ e, char })
}
return await CharTalent.render(e, mode, char)
},
async render ({ e, char }) {

View File

@ -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) {

View File

@ -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)

View File

@ -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)
}

View File

@ -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
}

View File

@ -39,7 +39,7 @@
</div>
<ul class="char-attr">
{{set attrMap = game === 'sr' ? {
hp:'生命值',atk:'攻击力',def:'防御力',speed:'速度',cpct:'暴击率',cdmg:'暴击伤害',dmg:'伤害加成',stance:'击破特',effPct:'效果命中'
hp:'生命值',atk:'攻击力',def:'防御力',speed:'速度',cpct:'暴击率',cdmg:'暴击伤害',dmg:'伤害加成',stance:'击破特',effPct:'效果命中'
}:{
hp:'生命值',atk:'攻击力',def:'防御力',mastery:'元素精通',cpct:'暴击率',cdmg:'暴击伤害',recharge:'元素充能',dmg:'伤害加成'
} }}

View File

@ -3,7 +3,8 @@
* 如character/${name}/artis.js下有角色自定义规则优先使用自定义
*/
export const usefulAttr = {
:{ hp: 100, atk: 50, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 },
卡芙卡: { hp: 0, atk: 100, def: 0, speed: 100, cpct: 0, cdmg: 0, stance: 50, heal: 0, recharge: 50, effPct: 75, effDef: 0, dmg: 100 },
: { hp: 100, atk: 50, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 },
罗刹: { hp: 0, atk: 100, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 100, recharge: 100, effPct: 0, effDef: 50, dmg: 100 },
银狼: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 75, effPct: 100, effDef: 0, dmg: 100 },
景元: { hp: 0, atk: 75, def: 0, speed: 100, cpct: 100, cdmg: 100, stance: 0, heal: 0, recharge: 50, effPct: 0, effDef: 0, dmg: 100 },

View File

@ -0,0 +1,48 @@
export const details = [{
title: '战技伤害',
dmg: ({ talent }, dmg) => dmg(talent.e['单体伤害'], 'e')
}, {
title: '追加攻击伤害',
dmg: ({ talent }, dmg) => dmg(talent.t['追加伤害'], 't')
}, {
title: '战技+引爆dot伤害',
dmg: ({ talent, cons }, dmg) => {
let plusDot = cons >= 6 ? 1.56 : 0
let eDmg = dmg(talent.e['单体伤害'], 'e')
let dotDmg = dmg((talent.q['回合持续伤害'] + plusDot) * talent.e['额外持续伤害'], '', 'skillDot')
return {
dmg: eDmg.dmg + dotDmg.avg,
avg: eDmg.avg + dotDmg.avg
}
}
}, {
title: '终结技伤害',
dmg: ({ talent, cons }, dmg) => {
let plusDot = cons >= 6 ? 1.56 : 0
let qDmg = dmg(talent.q['技能伤害'], 'q')
let dotDmg = dmg((talent.q['回合持续伤害'] + plusDot) * talent.q['额外持续伤害'], '', 'skillDot')
return {
dmg: qDmg.dmg + dotDmg.avg,
avg: qDmg.avg + dotDmg.avg
}
}
}]
export const mainAttr = 'atk,cpct,cdmg,speed'
export const buffs = [{
title: '卡芙卡1命目标受到的持续伤害提高30%',
cons: 1,
data: {
dotEnemyDmg: 30
}
}, {
title: '卡芙卡2命我方全体造成的持续伤害提高25%',
cons: 2,
data: {
dotDmg: 25
}
}, {
title: '卡芙卡六命持续伤害倍率提高156%',
cons: 6
}]

View File

@ -167,7 +167,7 @@
]
},
"2": {
"name": "触电伤害",
"name": "额外持续伤害",
"isSame": false,
"values": [
0.8,

View File

@ -10,6 +10,13 @@ export const details = [{
let addDmg = (cons * 1 >= 4) ? 1 : 0
return dmg(talent.q['技能伤害'] + addDmg, 'q')
}
}, {
title: '对10韧性敌人量子击破纠缠伤害',
dmg: ({ calc, attr }, { reaction }) => {
return {
avg: reaction('entanglement').avg * 5 * (10 + 2) / 4
}
}
}]
export const mainAttr = 'atk,cpct,cdmg,effPct'

View File

@ -39,7 +39,7 @@ export default function (staticIdx, keyIdx) {
keyIdx('对大于3个负面效果的敌人提升暴击率[cpct]%', 'cpct', 2),
keyIdx('以太编码提升伤害[dmg]%', 'dmg', 3)
],
只需等待:[
只需等待: [
staticIdx(1, 'dmg'),
(tables) => {
return {
@ -51,4 +51,4 @@ export default function (staticIdx, keyIdx) {
}
]
}
}
}