Skip to content

Commit

Permalink
Add config options for # of trap/mine trap throws (#7879)
Browse files Browse the repository at this point in the history
  • Loading branch information
NL908 authored Jul 24, 2024
1 parent 96d7021 commit cecda07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ function calcs.offence(env, actor, activeSkill)
if skillData.trapCooldown or skillData.cooldown then
trapThrowCount = 1
end
output.TrapThrowCount = trapThrowCount
output.TrapThrowCount = env.modDB:Override(nil, "TrapThrowCount") or trapThrowCount
output.TrapThrowingSpeed = m_min(output.TrapThrowingSpeed, data.misc.ServerTickRate)
output.TrapThrowingTime = 1 / output.TrapThrowingSpeed
skillData.timeOverride = output.TrapThrowingTime / output.TrapThrowCount
Expand Down Expand Up @@ -1219,10 +1219,10 @@ function calcs.offence(env, actor, activeSkill)
if skillData.trapCooldown or skillData.cooldown then
mineThrowCount = 1
end
output.MineThrowCount = mineThrowCount
if mineThrowCount >= 1 then
output.MineThrowCount = env.modDB:Override(nil, "MineThrowCount") or mineThrowCount
if output.MineThrowCount >= 1 then
-- Throwing Mines takes 10% more time for each *additional* Mine thrown
output.MineLayingSpeed = output.MineLayingSpeed / (1 + (mineThrowCount - 1) * 0.1)
output.MineLayingSpeed = output.MineLayingSpeed / (1 + (output.MineThrowCount - 1) * 0.1)
end

output.MineLayingSpeed = m_min(output.MineLayingSpeed, data.misc.ServerTickRate)
Expand Down
6 changes: 6 additions & 0 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,9 @@ Huge sets the radius to 11.
{ var = "multiplierMineDetonatedRecently", type = "count", label = "# of Mines Detonated Recently:", ifMult = "MineDetonatedRecently", implyCond = "DetonatedMinesRecently", apply = function(val, modList, enemyModList)
modList:NewMod("Multiplier:MineDetonatedRecently", "BASE", val, "Config", { type = "Condition", var = "Combat" })
end },
{ var = "minesPerThrow", type = "count", label = "# of Mines per throw:", ifFlag = "mine", tooltip = "This will override the number of Mines per throw", apply = function(val, modList, enemyModList)
modList:NewMod("MineThrowCount", "OVERRIDE", val, "Config", {type = "Condition", var = "Combat"})
end },
{ var = "TriggeredTrapsRecently", type = "check", label = "Have you Triggered a Trap Recently?", ifCond = "TriggeredTrapsRecently", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:TriggeredTrapsRecently", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
end },
Expand All @@ -1398,6 +1401,9 @@ Huge sets the radius to 11.
{ var = "conditionThrownTrapOrMineRecently", type = "check", label = "Have you thrown a Trap or Mine Recently?", ifCond = "TrapOrMineThrownRecently", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:TrapOrMineThrownRecently", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
end },
{ var = "trapsPerThrow", type = "count", label = "# of Traps per throw:", ifFlag = "trap", tooltip = "This will override the number of Traps per throw", apply = function(val, modList, enemyModList)
modList:NewMod("TrapThrowCount", "OVERRIDE", val, "Config", {type = "Condition", var = "Combat"})
end },
{ var = "conditionCursedEnemyRecently", type = "check", label = "Have you Cursed an enemy Recently?", ifCond="CursedEnemyRecently", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:CursedEnemyRecently", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end },
Expand Down

0 comments on commit cecda07

Please sign in to comment.