把扩散反应的伤害计算归到整体的计算中 (#239)

This commit is contained in:
1-4134-5386-4941 2022-11-06 15:22:28 +08:00 committed by GitHub
parent c6a70b3a6d
commit c79ac0d2a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 16 deletions

View File

@ -67,12 +67,14 @@ let DmgCalc = {
// 抗性区 // 抗性区
let kx = attr.kx let kx = attr.kx
if (talent === 'fy') { if (ele === 'swirl'/* || (ele === 'phy' && (attr.element === '雷' || attr.element === '冰'))*/) {
kx = attr.fykx kx = attr.fykx
} }
kx = 10 - (kx || 0) kx = 10 - (kx || 0)
let kNum = 0.9 let kNum = 0.9
if (kx >= 0) { if (kx >= 75) {
kNum = 1 / (1 + 3 * kx / 100)
} else if (kx >= 0) {
kNum = (100 - kx) / 100 kNum = (100 - kx) / 100
} else { } else {
kNum = 1 - kx / 200 kNum = 1 - kx / 200
@ -86,8 +88,8 @@ let DmgCalc = {
const isEle = ele !== false && ele !== 'phy' const isEle = ele !== false && ele !== 'phy'
// 反应区 // 反应区
let eleNum = isEle ? DmgMastery.getBasePct(ele, attr.element) : 1 let eleNum = isEle ? DmgMastery.getBasePct(ele, attr.element) : 1
let eleBase = isEle ? 1 + attr[ele] / 100 + DmgMastery.getMultiple(ele, attr.mastery.base + attr.mastery.plus) : 1 let eleBase = isEle ? 1 + attr[ele] / 100 + DmgMastery.getMultiple(ele, calc(attr.mastery)) : 1
let dmgBase = (mode === 'basic') ? basicNum : atkNum * pctNum * (1 + multiNum) let dmgBase = (mode === 'basic') ? basicNum : atkNum * pctNum * (1 + multiNum) + plusNum
let ret = {} let ret = {}
switch (ele) { switch (ele) {
@ -153,6 +155,10 @@ let DmgCalc = {
return dmgFn(0, talent, ele, basicNum, 'basic') return dmgFn(0, talent, ele, basicNum, 'basic')
} }
dmgFn.reaction = function(ele = false){
return dmgFn(0, 'fy', ele, 0, 'basic')
}
// 计算治疗 // 计算治疗
dmgFn.heal = function (num) { dmgFn.heal = function (num) {
if (showDetail) { if (showDetail) {

View File

@ -9,7 +9,7 @@ export const details = [{
} }
}, { }, {
title: '扩散反应伤害', title: '扩散反应伤害',
dmg: ({}, { swirl }) => swirl() dmg: ({}, { reaction }) => reaction('swirl')
}] }]
export const mainAttr = 'atk,cpct,cdmg,mastery' export const mainAttr = 'atk,cpct,cdmg,mastery'
@ -21,4 +21,4 @@ export const buffs = [{
qPct: ({ attr, calc }) => Math.min(calc(attr.mastery) * 0.002, 400), qPct: ({ attr, calc }) => Math.min(calc(attr.mastery) * 0.002, 400),
_heal: ({ attr, calc }) => Math.min(calc(attr.mastery) * 3, 6000) _heal: ({ attr, calc }) => Math.min(calc(attr.mastery) * 3, 6000)
} }
}, 'swirl'] }]

View File

@ -9,7 +9,7 @@ export const details = [{
dmg: ({ talent }, dmg) => dmg(talent.q['持续伤害'], 'q') dmg: ({ talent }, dmg) => dmg(talent.q['持续伤害'], 'q')
}, { }, {
title: '扩散反应伤害', title: '扩散反应伤害',
dmg: ({}, { swirl }) => swirl() dmg: ({}, { reaction }) => reaction('swirl')
}] }]
export const mainAttr = 'atk,cpct,cdmg,mastery' export const mainAttr = 'atk,cpct,cdmg,mastery'
@ -21,7 +21,9 @@ export const buffs = [{
mastery: 200 mastery: 200
} }
}, { }, {
title: '元素精通:扩散伤害提高[swirl]%', title: '元素精通:扩散伤害提高[swirlPlus]%',
sort: 2, sort: 2,
mastery: 'swirl' data:{
swirlPlus: ({calc, attr}) => 1600 * calc(attr.mastery) / (calc(attr.mastery) + 2000)
}
}] }]

View File

@ -19,10 +19,10 @@ export const details = [{
} }
}, { }, {
title: '扩散反应伤害', title: '扩散反应伤害',
dmg: ({}, { swirl }) => swirl() dmg: ({}, { reaction }) => reaction('swirl')
}] }]
export const mainAttr = 'atk,cpct,cdmg' export const mainAttr = 'atk,cpct,cdmg,mastery'
export const buffs = [{ export const buffs = [{
title: '温迪2命E降低12%风抗与物抗', title: '温迪2命E降低12%风抗与物抗',
@ -42,4 +42,4 @@ export const buffs = [{
data: { data: {
kx: ({ params }) => params.q ? 20 : 0 kx: ({ params }) => params.q ? 20 : 0
} }
}, 'swirl'] }]

View File

@ -13,7 +13,7 @@ export const details = [{
} }
}, { }, {
title: '扩散反应伤害', title: '扩散反应伤害',
dmg: ({}, { swirl }) => swirl() dmg: ({}, { reaction }) => reaction('swirl')
}] }]
export const mainAttr = 'atk,cpct,cdmg,mastery' export const mainAttr = 'atk,cpct,cdmg,mastery'
@ -21,8 +21,8 @@ export const mainAttr = 'atk,cpct,cdmg,mastery'
export const buffs = [{ export const buffs = [{
title: '砂糖被动触发扩散反应时队伍提升50精通' title: '砂糖被动触发扩散反应时队伍提升50精通'
}, { }, {
title: '砂糖被动释放QE命中敌人时基于自身精通提升队伍[_mastery]精通', title: '砂糖被动释放QE命中敌人时基于自身精通提升队伍[mastery]精通',
data: { data: {
_mastery: ({ attr, calc }) => calc(attr.mastery) * 0.2 mastery: ({ attr, calc }) => calc(attr.mastery) * 0.2
} }
}, 'swirl'] }]