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
18 changes: 18 additions & 0 deletions src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,24 @@ function ModStoreClass:Sum(modType, cfg, ...)
return self:SumInternal(self, modType, cfg, flags, keywordFlags, source, ...)
end


--- Returns the value of all positive modifiers to a mod added together, ignoring any negative modifiers.
--- Works by creating a table using Tabulate and then filtering for positive values.
---
--- @param modType string # the mod type for which we want to create the table, e.g. "INC" or "MORE"
--- @param cfg table | nil # passed configuration, may be nil
--- @param modName string # the name of the mod for which we want to create the table, e.g. "FlaskRecoveryRate", "ActionSpeed", ...
function ModStoreClass:SumPositiveValues(modType, cfg, modName, ...)
local total = 0
local modTable = self:Tabulate(modType, cfg, modName)
for i = 1, #modTable do
if modTable[i].value > 0 then
total = total + modTable[i].value
end
end
return total
end

function ModStoreClass:More(cfg, ...)
local flags, keywordFlags = 0, 0
local source
Expand Down
15 changes: 14 additions & 1 deletion src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,24 @@ local function doActorCharges(env, actor)
modDB.multipliers["SpiritCharge"] = output.SpiritCharges
end


function calcs.actionSpeedMod(actor)
local modDB = actor.modDB
local minimumActionSpeed = modDB:Max(nil, "MinimumActionSpeed") or 0
local maximumActionSpeedReduction = modDB:Max(nil, "MaximumActionSpeedReduction")
local actionSpeedMod = 1 + (m_max(-data.misc.TemporalChainsEffectCap, modDB:Sum("INC", nil, "TemporalChainsActionSpeed")) + modDB:Sum("INC", nil, "ActionSpeed")) / 100
local actionSpeedSum
local tempChainsSum

-- if we are unaffected by slows, only count the positive modifiers to action speed
if modDB:Flag(nil, "UnaffectedBySlows") then
actionSpeedSum = modDB:SumPositiveValues("INC", nil, "ActionSpeed")
tempChainsSum = modDB:SumPositiveValues("INC", nil, "TemporalChainsActionSpeed")
else
actionSpeedSum = modDB:Sum("INC", nil, "ActionSpeed")
tempChainsSum = modDB:Sum("INC", nil, "TemporalChainsActionSpeed")
end

local actionSpeedMod = 1 + (m_max(-data.misc.TemporalChainsEffectCap, tempChainsSum) + actionSpeedSum) / 100
actionSpeedMod = m_max(minimumActionSpeed / 100, actionSpeedMod)
if maximumActionSpeedReduction then
actionSpeedMod = m_min((100 - maximumActionSpeedReduction) / 100, actionSpeedMod)
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2777,6 +2777,7 @@ local specialModList = {
mod("PhysicalDamageGainAsChaos", "BASE", num, { type = "SkillType", skillType = SkillType.Triggered, neg = true }, { type = "SkillType", skillType = SkillType.Channel, neg = true }, { type = "Condition", var = "UsingAmethystFlask" })
} end,
["double the number of your poisons that targets can be affected by at the same time"] = function(num) return { flag("PoisonCanStack"), mod("PoisonStacks", "MORE", 100) } end,
["your speed is unaffected by slows"] = { flag("UnaffectedBySlows") },
-- Raider
["nearby enemies have (%d+)%% less accuracy rating while you have phasing"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("Accuracy", "MORE", -num) }, { type = "Condition", var = "Phasing" }) } end,
["immun[ei]t?y? to elemental ailments while phasing"] = { flag("ElementalAilmentImmune", { type = "Condition", var = "Phasing" }), },
Expand Down
Loading