Skip to content

Commit c46d944

Browse files
committed
refactor handle slow magnitude and slow effect
1 parent f5e02fc commit c46d944

File tree

3 files changed

+32
-13
lines changed

3 files changed

+32
-13
lines changed

src/Modules/CalcPerform.lua

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,27 @@ local function applySlowMagnitude(env)
756756
end
757757

758758
if enemyDB:Flag(nil, "Condition:Slowed") then
759-
local slowMagnitude = modDB:Sum("INC", nil, "EnemySlowMagnitude") / 100
760-
if slowMagnitude > 0 then
761-
enemyDB:ScaleAddMod(modLib.createMod("TemporalChainsActionSpeed", "INC", enemyDB:Sum("INC", nil, "TemporalChainsActionSpeed"), "Slow Magnitude"), slowMagnitude)
762-
enemyDB:ScaleAddMod(modLib.createMod("ApexOfMomentSlow", "INC", enemyDB:Sum("INC", nil, "ApexOfMomentSlow"), "Slow Magnitude"), slowMagnitude)
759+
local slowMagnitude = modDB:Sum("INC", nil, "EnemySlowMagnitude")
760+
local lessSlow = enemyDB:More("MORE", nil, "Slow", "Less Slow")
761+
slowMagnitude = slowMagnitude * lessSlow / 100
762+
763+
-- magic 34% in my current build
764+
-- rare 28% in my current build
765+
-- unique 20% in my current build
766+
for _, value in ipairs(enemyDB:Tabulate("INC", nil, "TemporalChainsActionSpeed", "ApexOfMomentSlow")) do
767+
local mod = value.mod
768+
if lessSlow ~= 0 then
769+
enemyDB:ReplaceMod(mod.name, mod.type, mod.value * lessSlow, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
770+
end
771+
772+
enemyDB:ScaleAddMod(modLib.createMod(value.mod.name, value.mod.type, value.mod.value, "Slow Magnitude"), slowMagnitude)
773+
774+
ConPrintTable(value, false)
763775
end
764776
end
765777
end
766778

767-
function calcs.actionSpeedMod(actor)
779+
function calcs.actionSpeedMod(actor)
768780
local modDB = actor.modDB
769781
local minimumActionSpeed = modDB:Max(nil, "MinimumActionSpeed") or 0
770782
local maximumActionSpeedReduction = modDB:Max(nil, "MaximumActionSpeedReduction")
@@ -773,7 +785,7 @@ function calcs.actionSpeedMod(actor)
773785
local tempChains = modDB:Sum("INC", nil, "TemporalChainsActionSpeed")
774786
local chill = modDB:Sum("INC", nil, "ActionSpeed", "Chill")
775787

776-
local slowMultiplier = (1 + tempChains / 100) * (1 + apexOfMoment / 100) * (1 + chill / 100) * modDB:More(nil, "ActionSpeed", "Less Slow")
788+
local slowMultiplier = (1 + tempChains / 100) * (1 + apexOfMoment / 100) * (1 + chill / 100)
777789
local slowEffect = (1 - slowMultiplier) * 100
778790

779791
local actionSpeedMod = 1 + (-slowEffect + modDB:Sum("INC", nil, "ActionSpeed")) / 100

src/Modules/CalcSections.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,13 @@ return {
630630
{ breakdown = "QuantityMultiplier" },
631631
{ modName = { "QuantityMultiplier" }, cfg = "skill" },
632632
}, },
633-
{ label = "Skill Cooldown", haveOutput = "Cooldown", { format = "{3:output:EffectiveCooldown}s",
633+
{ label = "Skill Cooldown", haveOutput = "Cooldown", { format = "{3:output:Cooldown}s",
634634
{ breakdown = "Cooldown" },
635+
{ modName = {"CooldownRecovery"}, cfg = "skill" },
636+
}, },
637+
{ label = "Eff. Skill Cooldown", haveOutput = "EffectiveCooldown", { format = "{3:output:EffectiveCooldown}s",
635638
{ breakdown = "EffectiveCooldown" },
636-
{ modName = {"CooldownRecovery", "CooldownChanceNotConsume"}, cfg = "skill" },
639+
{ modName = {"CooldownChanceNotConsume"}, cfg = "skill" },
637640
}, },
638641
{ label = "Stored Uses", haveOutput = "StoredUses", { format = "{output:StoredUses}",
639642
{ breakdown = "StoredUses" },
@@ -691,6 +694,10 @@ return {
691694
{ breakdown = "SpiritReservedMod" },
692695
{ modName = { "SpiritReserved", "Reserved", "SupportManaMultiplier", "SpiritReservationEfficiency", "ReservationEfficiency", "ExtraSpirit" }, cfg = "skill"}
693696
}, },
697+
{ label = "Slow Mod", haveOutput = "SlowMagnitude", { format = "x {2:output:SlowMagnitude}",
698+
{ breakdown = "CurseEffectMod" },
699+
{ modName = "EnemySlowMagnitude", cfg = "skill" },
700+
}, },
694701
{ label = "Curse Effect Mod", haveOutput = "CurseEffectMod", { format = "x {2:output:CurseEffectMod}",
695702
{ breakdown = "CurseEffectMod" },
696703
{ modName = "CurseEffect", cfg = "skill" },

src/Modules/ConfigOptions.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,11 +1698,11 @@ Huge sets the radius to 11.
16981698
end },
16991699
{ var = "conditionEnemyMagic", type = "check", label = s_format("Is the enemy %sMagic?", colorCodes.MAGIC), tooltip = "", apply = function(val, modList, enemyModList)
17001700
enemyModList:NewMod("Condition:Magic", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1701-
enemyModList:NewMod("ActionSpeed", "MORE", 15, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
1701+
enemyModList:NewMod("Slow", "MORE", -15, "Less Slow", { type = "Condition", var = "Effective" })
17021702
end },
17031703
{ var = "conditionEnemyRare", type = "check", label = s_format("Is the enemy %sRare?", colorCodes.RARE), tooltip = "", apply = function(val, modList, enemyModList)
17041704
enemyModList:NewMod("Condition:Rare", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1705-
enemyModList:NewMod("ActionSpeed", "MORE", 30, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
1705+
enemyModList:NewMod("Slow", "MORE", -30, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
17061706
end },
17071707
{ var = "enemyIsBoss", type = "list", label = "Is the enemy a Boss?", defaultIndex = 3, tooltip = data.enemyIsBossTooltip, list = {{val="None",label="No"},{val="Boss",label="Standard Boss"},{val="Pinnacle",label="Guardian/Pinnacle Boss"},{val="Uber",label="Uber Pinnacle Boss"}}, apply = function(val, modList, enemyModList, build)
17081708
-- These defaults are here so that the placeholders get reset correctly
@@ -1741,7 +1741,7 @@ Huge sets the radius to 11.
17411741
elseif val == "Boss" then
17421742
enemyModList:NewMod("Condition:Unique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
17431743
enemyModList:NewMod("Condition:RareOrUnique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1744-
enemyModList:NewMod("ActionSpeed", "MORE", 50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
1744+
enemyModList:NewMod("Slow", "MORE", -50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
17451745
enemyModList:NewMod("AilmentThreshold", "MORE", 488, "Boss")
17461746
modList:NewMod("WarcryPower", "BASE", 20, "Boss")
17471747
modList:NewMod("Multiplier:EnemyPower", "BASE", 20, "Boss")
@@ -1778,7 +1778,7 @@ Huge sets the radius to 11.
17781778
enemyModList:NewMod("Condition:Unique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
17791779
enemyModList:NewMod("Condition:RareOrUnique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
17801780
enemyModList:NewMod("Condition:PinnacleBoss", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1781-
enemyModList:NewMod("ActionSpeed", "MORE", 50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
1781+
enemyModList:NewMod("Slow", "MORE", -50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
17821782
enemyModList:NewMod("AilmentThreshold", "MORE", 404, "Boss")
17831783
modList:NewMod("WarcryPower", "BASE", 20, "Boss")
17841784
modList:NewMod("Multiplier:EnemyPower", "BASE", 20, "Boss")
@@ -1812,7 +1812,7 @@ Huge sets the radius to 11.
18121812
elseif val == "Uber" then
18131813
enemyModList:NewMod("Condition:RareOrUnique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
18141814
enemyModList:NewMod("Condition:PinnacleBoss", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1815-
enemyModList:NewMod("ActionSpeed", "MORE", 50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
1815+
enemyModList:NewMod("Slow", "MORE", -50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
18161816
enemyModList:NewMod("DamageTaken", "MORE", -70, "Boss")
18171817
enemyModList:NewMod("AilmentThreshold", "MORE", 404, "Boss")
18181818
modList:NewMod("WarcryPower", "BASE", 20, "Boss")

0 commit comments

Comments
 (0)