Skip to content

Commit bdfb378

Browse files
authored
Add support for parsing Damage gain as (without as extra) (#56)
The gain calcs arent exactly right in general still but this at least makes current approach work properly Signed-off-by: Tomas Slusny <[email protected]>
1 parent feead24 commit bdfb378

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Modules/CalcOffence.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ end
8787

8888
local function calcGainedDamage(activeSkill, output, cfg, damageType)
8989
local gainTable = activeSkill.gainTable
90-
90+
9191
local gainedMin, gainedMax = 0, 0
9292
for _, otherType in ipairs(dmgTypeList) do
9393
local baseMin = m_floor(output[otherType.."MinBase"])
@@ -100,7 +100,7 @@ local function calcGainedDamage(activeSkill, output, cfg, damageType)
100100
gainedMax = gainedMax + (baseMax + convertedMax) * gainMult
101101
end
102102
end
103-
103+
104104
return gainedMin, gainedMax
105105
end
106106

@@ -1898,7 +1898,7 @@ function calcs.offence(env, actor, activeSkill)
18981898
activeSkill.conversionTable[damageType][fromType] = data.base
18991899
end
19001900
for toType, amount in pairs(data.conv) do
1901-
activeSkill.conversionTable[damageType][toType] =
1901+
activeSkill.conversionTable[damageType][toType] =
19021902
(activeSkill.conversionTable[damageType][toType] or 0) + amount
19031903
end
19041904
end
@@ -1907,9 +1907,13 @@ function calcs.offence(env, actor, activeSkill)
19071907
activeSkill.gainTable[damageType] = {}
19081908
for _, toType in ipairs(dmgTypeList) do
19091909
local globalGain = m_max(skillModList:Sum("BASE", skillCfg,
1910+
"DamageAs"..toType,
19101911
"DamageGainAs"..toType,
1912+
damageType.."DamageAs"..toType,
19111913
damageType.."DamageGainAs"..toType,
1914+
isElemental[damageType] and "ElementalDamageAs"..toType or nil,
19121915
isElemental[damageType] and "ElementalDamageGainAs"..toType or nil,
1916+
damageType ~= "Chaos" and "NonChaosDamageAs"..toType or nil,
19131917
damageType ~= "Chaos" and "NonChaosDamageGainAs"..toType or nil), 0)
19141918
local skillGain = m_max(skillModList:Sum("BASE", skillCfg,
19151919
"SkillDamageGainAs"..toType,

0 commit comments

Comments
 (0)