Skip to content

Implement Slow Magnitude and Apex of Moment #606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
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
12 changes: 5 additions & 7 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2522,12 +2522,10 @@ c["Deal up to 30% more Damage to Enemies based on their missing Concentration"]=
c["Deals 25% of current Mana as Chaos Damage to you when Effect ends"]={nil,"Deals 25% of current Mana as Chaos Damage to you when Effect ends "}
c["Debuffs on you expire 10% faster"]={{[1]={flags=0,keywordFlags=0,name="SelfDebuffExpirationRate",type="BASE",value=10}},nil}
c["Debuffs on you expire 20% faster"]={{[1]={flags=0,keywordFlags=0,name="SelfDebuffExpirationRate",type="BASE",value=20}},nil}
c["Debuffs you inflict have 10% increased Slow Magnitude"]={nil,"Debuffs you inflict have 10% increased Slow Magnitude "}
c["Debuffs you inflict have 10% increased Slow Magnitude Debuffs on you expire 20% faster"]={nil,"Debuffs you inflict have 10% increased Slow Magnitude Debuffs on you expire 20% faster "}
c["Debuffs you inflict have 4% increased Slow Magnitude"]={nil,"Debuffs you inflict have 4% increased Slow Magnitude "}
c["Debuffs you inflict have 4% increased Slow Magnitude 20% increased Hinder Duration"]={nil,"Debuffs you inflict have 4% increased Slow Magnitude 20% increased Hinder Duration "}
c["Debuffs you inflict have 5% increased Slow Magnitude"]={nil,"Debuffs you inflict have 5% increased Slow Magnitude "}
c["Debuffs you inflict have 6% increased Slow Magnitude"]={nil,"Debuffs you inflict have 6% increased Slow Magnitude "}
c["Debuffs you inflict have 10% increased Slow Magnitude"]={{[1]={flags=0,keywordFlags=0,name="EnemySlowMagnitude",type="INC",value=10}},nil}
c["Debuffs you inflict have 4% increased Slow Magnitude"]={{[1]={flags=0,keywordFlags=0,name="EnemySlowMagnitude",type="INC",value=4}},nil}
c["Debuffs you inflict have 5% increased Slow Magnitude"]={{[1]={flags=0,keywordFlags=0,name="EnemySlowMagnitude",type="INC",value=5}},nil}
c["Debuffs you inflict have 6% increased Slow Magnitude"]={{[1]={flags=0,keywordFlags=0,name="EnemySlowMagnitude",type="INC",value=6}},nil}
c["Decimating Strike"]={nil,"Decimating Strike "}
c["Defend with 120% of Armour against Projectile Attacks"]={nil,"Defend with 120% of Armour against Projectile Attacks "}
c["Defend with 120% of Armour while not on Low Energy Shield"]={{[1]={[1]={neg=true,type="Condition",var="LowEnergyShield"},flags=0,keywordFlags=0,name="ArmourDefense",source="Armour and Energy Shield Mastery",type="MAX",value=20}},nil}
Expand Down Expand Up @@ -2580,7 +2578,7 @@ c["Enemies in your Presence are Blinded"]={nil,"Enemies in your Presence are Bli
c["Enemies in your Presence are Blinded Enemies in your Presence gain Critical Weakness every second"]={nil,"Enemies in your Presence are Blinded Enemies in your Presence gain Critical Weakness every second "}
c["Enemies in your Presence are Ignited as though dealt 100 Base Fire Damage"]={nil,"Enemies in your Presence are Ignited as though dealt 100 Base Fire Damage "}
c["Enemies in your Presence are Intimidated"]={nil,"Enemies in your Presence are Intimidated "}
c["Enemies in your Presence are Slowed by 20%"]={nil,"Enemies in your Presence are Slowed by 20% "}
c["Enemies in your Presence are Slowed by 20%"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="Condition:Slowed",type="FLAG",value=true}}},[2]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={effectType="AuraDebuff",type="GlobalEffect"},[2]={type="Condition",var="Slowed"},flags=0,keywordFlags=0,name="ApexOfMomentSlow",type="INC",value=-20}}}},nil}
c["Enemies in your Presence gain Critical Weakness every second"]={{[1]={flags=0,keywordFlags=0,name="ApplyCriticalWeakness",type="FLAG",value=true}},nil}
c["Enemies in your Presence have 10% reduced Cooldown Recovery Rate"]={nil,"Enemies in your Presence have 10% reduced Cooldown Recovery Rate "}
c["Enemies in your Presence have Fire Exposure"]={nil,"Enemies in your Presence have Fire Exposure "}
Expand Down
8 changes: 8 additions & 0 deletions src/Data/Skills/act_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16616,6 +16616,14 @@ skills["TemporalChainsPlayer"] = {
baseEffectiveness = 0,
incrementalEffectiveness = 0.092720001935959,
statDescriptionScope = "temporal_chains",
statMap = {
["temporal_chains_base_action_speed_+%_final_to_apply"] = {
mod("TemporalChainsActionSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" })
},
["buff_time_passed_+%_other_than_temporal_chains"] = {
mod("BuffExpireFaster", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }),
},
},
baseFlags = {
area = true,
duration = true,
Expand Down
10 changes: 9 additions & 1 deletion src/Export/Skills/act_int.txt
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,15 @@ statMap = {

#skill TemporalChainsPlayer
#set TemporalChainsPlayer
#flags area duration
#flags spell area duration curse
statMap = {
["temporal_chains_base_action_speed_+%_final_to_apply"] = {
mod("TemporalChainsActionSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" })
},
["buff_time_passed_+%_other_than_temporal_chains"] = {
mod("BuffExpireFaster", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Curse" }),
},
},
#mods
#skillEnd

Expand Down
39 changes: 34 additions & 5 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -748,24 +748,50 @@ local function doActorCharges(env, actor)
modDB.multipliers["SpiritCharge"] = output.SpiritCharges
end

-- Process slow effects/magnitude
local function applySlowMagnitude(env)
local modDB = env.modDB
local enemyDB = env.enemyDB
if enemyDB:HasMod("INC", nil, "TemporalChainsActionSpeed", nil) then
enemyDB:NewMod("Condition:Slowed", "FLAG", true, 'Skill:TemporalChainsPlayer')
end
Comment on lines +755 to +757
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is a better way to do this, I just couldn't find it.


function calcs.actionSpeedMod(actor)
if enemyDB:Flag(nil, "Condition:Slowed") then
local slowMagnitude = modDB:Sum("INC", nil, "EnemySlowMagnitude")
local lessSlow = enemyDB:More("MORE", nil, "Slow", "Less Slow")
slowMagnitude = slowMagnitude * lessSlow / 100
for _, value in ipairs(enemyDB:Tabulate("INC", nil, "TemporalChainsActionSpeed", "ApexOfMomentSlow")) do
local mod = value.mod
if lessSlow ~= 0 then
enemyDB:ReplaceMod(mod.name, mod.type, -round(mod.value * -lessSlow, nil), mod.source, mod.flags, mod.keywordFlags, unpack(mod))
end

enemyDB:ScaleAddMod(modLib.createMod(mod.name, mod.type, mod.value, "Slow Magnitude"), slowMagnitude)
end
end
end

function calcs.actionSpeedMod(actor)
local modDB = actor.modDB
local minimumActionSpeed = modDB:Max(nil, "MinimumActionSpeed") or 0
local maximumActionSpeedReduction = modDB:Max(nil, "MaximumActionSpeedReduction")
local actionSpeedSum
local tempChainsSum
local slowEffectsSum

-- 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")
slowEffectsSum = modDB:SumPositiveValues("INC", nil, "ApexOfMomentSlow", "TemporalChainsActionSpeed")
else
actionSpeedSum = modDB:Sum("INC", nil, "ActionSpeed")
tempChainsSum = modDB:Sum("INC", nil, "TemporalChainsActionSpeed")
slowEffectsSum = modDB:Sum("INC", nil, "ApexOfMomentSlow", "TemporalChainsActionSpeed")
end

local slowMultiplier = (1 + slowEffectsSum / 100) * (1 + modDB:Sum("INC", nil, "ActionSpeed", "Chill") / 100)
local slowEffect = (1 - slowMultiplier) * 100

local actionSpeedMod = 1 + (-slowEffect + actionSpeedSum) / 100

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 Expand Up @@ -2872,6 +2898,9 @@ function calcs.perform(env, skipEHP)
enemyDB:NewMod("DamageTaken", "INC", enemyDB:Sum("INC", nil, "DamageTakenConsecratedGround") * effect, "Consecrated Ground")
end

-- Handle Slow
applySlowMagnitude(env)

-- Defence/offence calculations
calcs.defence(env, env.player)
if not skipEHP then
Expand Down
5 changes: 3 additions & 2 deletions src/Modules/CalcSections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2196,8 +2196,9 @@ return {
{ label = "Hits before death", { format = "{2:output:TotalNumberOfHits}", { breakdown = "TotalNumberOfHits" }}, },
{ label = "Effective Hit Pool",{ format = "{0:output:TotalEHP}", { breakdown = "TotalEHP" }, },},
{ label = "Time before death",{ format = "{2:output:EHPSurvivalTime}s",
{ breakdown = "EHPSurvivalTime" },
{ label = "Enemy modifiers", modName = { "TemporalChainsActionSpeed", "ActionSpeed", "Speed", "MinimumActionSpeed" }, enemy = true },
{ breakdown = "EHPSurvivalTime" },
{ label = "Player modifiers", modName = { "EnemySlowMagnitude" } },
{ label = "Enemy modifiers", modName = { "TemporalChainsActionSpeed", "ApexOfMomentSlow", "EnemySlowMagnitude", "Slow", "ActionSpeed", "Speed", "MinimumActionSpeed" }, enemy = true },
},}
}, }, { defaultCollapsed = false, label = "Maximum Hit Taken", data = {
colWidth = 114,
Expand Down
19 changes: 18 additions & 1 deletion src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,9 @@ Huge sets the radius to 11.
{ var = "conditionEnemyMoving", type = "check", label = "Is the enemy Moving?", ifMod = "BleedChance", apply = function(val, modList, enemyModList)
enemyModList:NewMod("Condition:Moving", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end },
{ var = "conditionEnemySlowed", type = "check", label = "Is the enemy Slowed?", apply = function(val, modList, enemyModList)
enemyModList:NewMod("Condition:Slowed", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end },
{ var = "conditionEnemyFullLife", type = "check", label = "Is the enemy on Full ^xE05030Life?", ifEnemyCond = "FullLife", apply = function(val, modList, enemyModList)
enemyModList:NewMod("Condition:FullLife", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end },
Expand Down Expand Up @@ -1732,6 +1735,15 @@ Huge sets the radius to 11.
{ var = "conditionEnemyRareOrUnique", type = "check", label = "Is the enemy Rare or Unique?", ifEnemyCond = "EnemyRareOrUnique", tooltip = "The enemy will automatically be considered to be Unique if they are a Boss,\nbut you can use this option to force it if necessary.", apply = function(val, modList, enemyModList)
enemyModList:NewMod("Condition:RareOrUnique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end },
{ var = "enemyRarity", type = "list", label = "Enemy Rarity:", defaultIndex = 1, tooltip = "", list = {{val="White",label="White"},{val="Magic",label=s_format("%sMagic", colorCodes.MAGIC)},{val="Rare",label=s_format("%sRare", colorCodes.RARE)}}, apply = function(val, modList, enemyModList, build)
if val == "Magic" then
enemyModList:NewMod("Condition:Magic", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Slow", "MORE", -15, "Less Slow", { type = "Condition", var = "Effective" })
elseif val == "Rare" then
enemyModList:NewMod("Condition:Rare", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Slow", "MORE", -30, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
end
end },
{ 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)
-- These defaults are here so that the placeholders get reset correctly
build.configTab.varControls['enemySpeed']:SetPlaceholder(700, true)
Expand Down Expand Up @@ -1766,8 +1778,10 @@ Huge sets the radius to 11.

build.configTab.varControls['enemyArmour']:SetPlaceholder(data.monsterArmourTable[defaultLevel], true)
build.configTab.varControls['enemyEvasion']:SetPlaceholder(data.monsterEvasionTable[defaultLevel], true)
elseif val == "Boss" then
elseif val == "Boss" then
enemyModList:NewMod("Condition:Unique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Condition:RareOrUnique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Slow", "MORE", -50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
enemyModList:NewMod("AilmentThreshold", "MORE", 488, "Boss")
modList:NewMod("WarcryPower", "BASE", 20, "Boss")
modList:NewMod("Multiplier:EnemyPower", "BASE", 20, "Boss")
Expand Down Expand Up @@ -1801,8 +1815,10 @@ Huge sets the radius to 11.
build.configTab.varControls['enemyArmour']:SetPlaceholder(data.monsterArmourTable[defaultLevel], true)
build.configTab.varControls['enemyEvasion']:SetPlaceholder(data.monsterEvasionTable[defaultLevel], true)
elseif val == "Pinnacle" then
enemyModList:NewMod("Condition:Unique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Condition:RareOrUnique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Condition:PinnacleBoss", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Slow", "MORE", -50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
enemyModList:NewMod("AilmentThreshold", "MORE", 404, "Boss")
modList:NewMod("WarcryPower", "BASE", 20, "Boss")
modList:NewMod("Multiplier:EnemyPower", "BASE", 20, "Boss")
Expand Down Expand Up @@ -1836,6 +1852,7 @@ Huge sets the radius to 11.
elseif val == "Uber" then
enemyModList:NewMod("Condition:RareOrUnique", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Condition:PinnacleBoss", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Slow", "MORE", -50, "Less Slow", { type = "Condition", var = "Effective" }, { type = "Condition", var = "Slowed" })
enemyModList:NewMod("DamageTaken", "MORE", -70, "Boss")
enemyModList:NewMod("AilmentThreshold", "MORE", 404, "Boss")
modList:NewMod("WarcryPower", "BASE", 20, "Boss")
Expand Down
1 change: 0 additions & 1 deletion src/Modules/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ data.misc = { -- magic numbers
ServerTickRate = 1 / 0.033,
AccuracyPerDexBase = 5,
LowPoolThreshold = 0.35,
TemporalChainsEffectCap = 75,
BuffExpirationSlowCap = 0.25,
DamageReductionCap = 90,
ResistFloor = -200,
Expand Down
6 changes: 6 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ local modNameList = {
["to ignore enemy physical damage reduction"] = "ChanceToIgnoreEnemyPhysicalDamageReduction",
["weapon swap speed"] = "WeaponSwapSpeed",
["to chain an additional time from terrain"] = "TerrainChainChance",
["slow magnitude"] = "EnemySlowMagnitude",
-- Flask and Charm modifiers
["effect"] = "LocalEffect",
["effect of flasks"] = "FlaskEffect",
Expand Down Expand Up @@ -1216,6 +1217,7 @@ local preFlagList = {
["^hits against you "] = { applyToEnemy = true, flags = ModFlag.Hit },
["^hits against you [hd][ae][va][el] "] = { applyToEnemy = true, flags = ModFlag.Hit },
["^enemies near your totems deal "] = { applyToEnemy = true },
["^debuffs you inflict [hd][ae][va][el] "] = { },
-- Other
["^your flasks grant "] = { },
["^when hit, "] = { },
Expand Down Expand Up @@ -2890,6 +2892,10 @@ local specialModList = {
mod("Speed", "MORE", num, nil, ModFlag.Cast, { type = "GlobalEffect", effectType = "Buff", effectName = "Quicksand Hourglass" }, { type = "Condition", var = "QuicksandHourglass" }),
flag("Condition:CanGainQuicksandHourglass")
} end,
["enemies in your presence are slowed by (%d+)%%"] = function(num) return {
mod("EnemyModifier", "LIST", { mod = flag("Condition:Slowed") }),
mod("EnemyModifier", "LIST", { mod = mod("ApexOfMomentSlow", "INC", -num, { type = "GlobalEffect", effectType = "AuraDebuff" }, { type = "Condition", var = "Slowed" }) }),
} end,
-- Item local modifiers
["has no sockets"] = { flag("NoSockets") },
["reflects your other ring"] = {
Expand Down