5E ActionDamage.checkNumericalReductionType
If checkNumericalReductionType is called and aReduction filter is "all" AND the damage roll has multiple damage types (aDmgType) this function will over reduce because it calls the checkNumericalReductionTypeHelper function with "all" for the number of aDmgType on the damage roll.
I believe the following is what was intended.
Code:
function checkNumericalReductionType(aReduction, aDmgType, nLimit)
local nAdjust = 0;
local nSpecificAdjust;
for _,sDmgType in pairs(aDmgType) do
if nLimit then
nSpecificAdjust = ActionDamage.checkNumericalReductionTypeHelper(aReduction[sDmgType], aDmgType, nLimit);
nAdjust = nAdjust + nSpecificAdjust;
else
nAdjust = nAdjust + ActionDamage.checkNumericalReductionTypeHelper(aReduction[sDmgType], aDmgType);
end
end
if nLimit then
local nGlobalAdjust = ActionDamage.checkNumericalReductionTypeHelper(aReduction["all"], aDmgType, nLimit - nSpecificAdjust);
nAdjust = nAdjust + nGlobalAdjust;
else
nAdjust = nAdjust + ActionDamage.checkNumericalReductionTypeHelper(aReduction["all"], aDmgType);
end
return nAdjust;
end