Skip to content

Commit 3dbc13b

Browse files
LocalIdentityLocalIdentity
andauthored
Fix Damage Gain as when using Conversion mods on gear or tree (#1390)
We weren't taking into account damage conversion from gear or the tree if a skill was affected by a global "Damage gain as x" mod so each time the damage was converted, it would apply the gain again I believe this now works correctly Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 66215db commit 3dbc13b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/Modules/CalcOffence.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ local function calcGainedDamage(activeSkill, output, cfg, damageType)
8888

8989
local gainedMin, gainedMax = 0, 0
9090
for _, otherType in ipairs(dmgTypeList) do
91-
local baseMin = m_floor(output[otherType.."MinBase"] * activeSkill.skillConversionTable[otherType].mult)
92-
local baseMax = m_floor(output[otherType.."MaxBase"] * activeSkill.skillConversionTable[otherType].mult)
91+
local baseMin = m_floor(output[otherType.."MinBase"] * activeSkill.conversionTable[otherType].mult)
92+
local baseMax = m_floor(output[otherType.."MaxBase"] * activeSkill.conversionTable[otherType].mult)
9393
local gainMult = gainTable[otherType][damageType]
9494
if gainMult and gainMult > 0 then
9595
-- Damage is being converted/gained from the other damage type
@@ -2045,18 +2045,15 @@ function calcs.offence(env, actor, activeSkill)
20452045
end
20462046

20472047
-- Calculate damage conversion percentages
2048-
activeSkill.skillConversionTable = wipeTable(activeSkill.skillConversionTable)
20492048
activeSkill.conversionTable = wipeTable(activeSkill.conversionTable)
20502049
activeSkill.gainTable = wipeTable(activeSkill.gainTable)
20512050

20522051
-- Initialize conversion tables
20532052
for _, type in ipairs(dmgTypeList) do
2054-
activeSkill.skillConversionTable[type] = {}
20552053
activeSkill.conversionTable[type] = {}
20562054
activeSkill.gainTable[type] = {}
20572055
for _, otherType in ipairs(dmgTypeList) do
20582056
activeSkill.conversionTable[type][otherType] = 0
2059-
activeSkill.skillConversionTable[type][otherType] = 0
20602057
end
20612058
end
20622059

@@ -2103,7 +2100,6 @@ function calcs.offence(env, actor, activeSkill)
21032100
activeSkill.conversionTable[damageType][toType] = amount
21042101
end
21052102
activeSkill.conversionTable[damageType].mult = 1 - m_min(skillTotal / 100, 1)
2106-
activeSkill.skillConversionTable[damageType].mult = 1 - m_min(skillTotal / 100, 1)
21072103
end
21082104

21092105
-- Second step: Process global conversion and gains

0 commit comments

Comments
 (0)