From cd3d546b6399e610270e9488061ed996e650cabc Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sun, 19 Jan 2025 02:23:44 +0100 Subject: [PATCH] Add support for parsing Damage gain as (without as extra) The gain calcs arent exactly right in general still but this at least makes current approach work properly Signed-off-by: Tomas Slusny --- src/Modules/CalcOffence.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index 777e1daa..3c8df535 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -87,7 +87,7 @@ end local function calcGainedDamage(activeSkill, output, cfg, damageType) local gainTable = activeSkill.gainTable - + local gainedMin, gainedMax = 0, 0 for _, otherType in ipairs(dmgTypeList) do local baseMin = m_floor(output[otherType.."MinBase"]) @@ -100,7 +100,7 @@ local function calcGainedDamage(activeSkill, output, cfg, damageType) gainedMax = gainedMax + (baseMax + convertedMax) * gainMult end end - + return gainedMin, gainedMax end @@ -1895,7 +1895,7 @@ function calcs.offence(env, actor, activeSkill) activeSkill.conversionTable[damageType][fromType] = data.base end for toType, amount in pairs(data.conv) do - activeSkill.conversionTable[damageType][toType] = + activeSkill.conversionTable[damageType][toType] = (activeSkill.conversionTable[damageType][toType] or 0) + amount end end @@ -1904,9 +1904,13 @@ function calcs.offence(env, actor, activeSkill) activeSkill.gainTable[damageType] = {} for _, toType in ipairs(dmgTypeList) do local globalGain = m_max(skillModList:Sum("BASE", skillCfg, + "DamageAs"..toType, "DamageGainAs"..toType, + damageType.."DamageAs"..toType, damageType.."DamageGainAs"..toType, + isElemental[damageType] and "ElementalDamageAs"..toType or nil, isElemental[damageType] and "ElementalDamageGainAs"..toType or nil, + damageType ~= "Chaos" and "NonChaosDamageAs"..toType or nil, damageType ~= "Chaos" and "NonChaosDamageGainAs"..toType or nil), 0) local skillGain = m_max(skillModList:Sum("BASE", skillCfg, "SkillDamageGainAs"..toType,