Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/Classes/ModDB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ end

function ModDBClass:MoreInternal(context, cfg, flags, keywordFlags, source, ...)
local result = 1
local modPrecision = nil
for i = 1, select('#', ...) do
local modList = self.mods[select(i, ...)]
local modResult = 1 --The more multipliers for each mod are computed to the nearest percent then applied.
Expand All @@ -134,10 +135,20 @@ function ModDBClass:MoreInternal(context, cfg, flags, keywordFlags, source, ...)
else
modResult = modResult * (1 + mod.value / 100)
end
if modPrecision then
modPrecision = m_max(modPrecision, (data.highPrecisionMods[mod.name] and data.highPrecisionMods[mod.name][mod.type]) or modPrecision)
else
modPrecision = (data.highPrecisionMods[mod.name] and data.highPrecisionMods[mod.name][mod.type]) or nil
end
end
end
end
result = result * round(modResult,2)
if modPrecision then
local power = 10 ^ modPrecision
result = math.floor(result * modResult * power) / power
else
result = result * round(modResult, 2)
end
end
if self.parent then
result = result * self.parent:MoreInternal(context, cfg, flags, keywordFlags, source, ...)
Expand Down
13 changes: 12 additions & 1 deletion src/Classes/ModList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ end

function ModListClass:MoreInternal(context, cfg, flags, keywordFlags, source, ...)
local result = 1
local modPrecision = nil
for i = 1, select('#', ...) do
local modResult = 1 --The more multipliers for each mod are computed to the nearest percent then applied.
local modName = select(i, ...)
Expand All @@ -105,9 +106,19 @@ function ModListClass:MoreInternal(context, cfg, flags, keywordFlags, source, ..
else
modResult = modResult * (1 + mod.value / 100)
end
if modPrecision then
modPrecision = m_max(modPrecision, (data.highPrecisionMods[mod.name] and data.highPrecisionMods[mod.name][mod.type]) or modPrecision)
else
modPrecision = (data.highPrecisionMods[mod.name] and data.highPrecisionMods[mod.name][mod.type]) or nil
end
end
end
result = result * round(modResult,2)
if modPrecision then
local power = 10 ^ modPrecision
result = math.floor(result * modResult * power) / power
else
result = result * round(modResult, 2)
end
end
if self.parent then
result = result * self.parent:MoreInternal(context, cfg, flags, keywordFlags, source, ...)
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ data.highPrecisionMods = {
["ChaosDamageEnergyShieldLeech"] = {
["BASE"] = 2,
},
["SupportManaMultiplier"] = {
["MORE"] = 4,
}
}

data.misc = { -- magic numbers
Expand Down