@@ -87,25 +87,23 @@ local function calcDamage(activeSkill, output, cfg, breakdown, damageType, typeF
8787 addMax = addMax + max * convMult
8888 end
8989 end
90- if addMin ~= 0 and addMax ~= 0 then
91- addMin = round (addMin )
92- addMax = round (addMax )
93- end
94-
9590 local baseMin = output [damageType .. " MinBase" ]
9691 local baseMax = output [damageType .. " MaxBase" ]
9792 if baseMin == 0 and baseMax == 0 then
9893 -- No base damage for this type, don't need to calculate modifiers
9994 if breakdown and (addMin ~= 0 or addMax ~= 0 ) then
10095 t_insert (breakdown .damageTypes , {
10196 source = damageType ,
102- convSrc = (addMin ~= 0 or addMax ~= 0 ) and (addMin .. " to " .. addMax ),
103- total = addMin .. " to " .. addMax ,
97+ convSrc = (addMin ~= 0 or addMax ~= 0 ) and (round ( addMin ) .. " to " .. round ( addMax ) ),
98+ total = round ( addMin ) .. " to " .. round ( addMax ) ,
10499 convDst = convDst and s_format (" %d%% to %s" , conversionTable [damageType ].conversion [convDst ] * 100 , convDst ),
105100 gainDst = convDst and s_format (" %d%% gained as %s" , conversionTable [damageType ].gain [convDst ] * 100 , convDst ),
106101 })
107102 end
108- return addMin , addMax
103+ if convDst then
104+ return addMin , addMax
105+ end
106+ return round (addMin ), round (addMax )
109107 end
110108
111109 -- Combine modifiers
@@ -125,15 +123,20 @@ local function calcDamage(activeSkill, output, cfg, breakdown, damageType, typeF
125123 base = baseMin .. " to " .. baseMax ,
126124 inc = (inc ~= 1 and " x " .. inc ),
127125 more = (more ~= 1 and " x " .. more ),
128- convSrc = (addMin ~= 0 or addMax ~= 0 ) and (addMin .. " to " .. addMax ),
129- total = ( round (baseMin * inc * more ) + addMin ) .. " to " .. ( round (baseMax * inc * more ) + addMax ),
126+ convSrc = (addMin ~= 0 or addMax ~= 0 ) and (round ( addMin ) .. " to " .. round ( addMax ) ),
127+ total = round (baseMin * inc * more + addMin ) .. " to " .. round (baseMax * inc * more + addMax ),
130128 convDst = convDst and conversionTable [damageType ].conversion [convDst ] > 0 and s_format (" %d%% to %s" , conversionTable [damageType ].conversion [convDst ] * 100 , convDst ),
131129 gainDst = convDst and conversionTable [damageType ].gain [convDst ] > 0 and s_format (" %d%% gained as %s" , conversionTable [damageType ].gain [convDst ] * 100 , convDst ),
132130 })
133131 end
134132
135- return round (((baseMin * inc * more ) * genericMoreMinDamage + addMin ) * moreMinDamage * incMinDamage ),
136- round (((baseMax * inc * more ) * genericMoreMaxDamage + addMax ) * moreMaxDamage * incMaxDamage )
133+ local min = ((baseMin * inc * more ) * genericMoreMinDamage + addMin ) * moreMinDamage * incMinDamage
134+ local max = ((baseMax * inc * more ) * genericMoreMaxDamage + addMax ) * moreMaxDamage * incMaxDamage
135+ if convDst then
136+ -- Converted paths stay fractional until they reach their final damage type.
137+ return min , max
138+ end
139+ return round (min ), round (max )
137140end
138141
139142local function calcAilmentSourceDamage (activeSkill , output , cfg , breakdown , damageType , typeFlags )
@@ -1956,12 +1959,16 @@ function calcs.offence(env, actor, activeSkill)
19561959 globalTotal = globalTotal * factor
19571960 end
19581961 local dmgTable = { conversion = { }, gain = { } }
1962+ local convertedTotal = 0
19591963 for type in pairs (globalConv ) do
1960- dmgTable .conversion [type ] = (globalConv [type ] + skillConv [type ]) / 100
1964+ -- The game stores each scaled conversion destination as a whole percent.
1965+ local conversion = round (globalConv [type ] + skillConv [type ])
1966+ dmgTable .conversion [type ] = conversion / 100
19611967 dmgTable .gain [type ] = add [type ] / 100
1962- dmgTable [type ] = (globalConv [type ] + skillConv [type ] + add [type ]) / 100
1968+ dmgTable [type ] = (conversion + add [type ]) / 100
1969+ convertedTotal = convertedTotal + conversion
19631970 end
1964- dmgTable .mult = 1 - m_min (( globalTotal + skillTotal ) / 100 , 1 )
1971+ dmgTable .mult = 1 - m_min (convertedTotal / 100 , 1 )
19651972 conversionTable [damageType ] = dmgTable
19661973 end
19671974 conversionTable [" Chaos" ] = { mult = 1 }
0 commit comments