diff --git a/spec/System/TestSkills_spec.lua b/spec/System/TestSkills_spec.lua index af8896f64c3..17ddd47cae9 100644 --- a/spec/System/TestSkills_spec.lua +++ b/spec/System/TestSkills_spec.lua @@ -132,6 +132,29 @@ describe("TestSkills", function() assert.are.equals(cappedCombinedDPS, build.calcsTab.mainOutput.CombinedDPS) end) + it("uses enemy radius when calculating Ball Lightning hits", function() + build.skillsTab:PasteSocketGroup("Ball Lightning 20/0 1\n") + runCallback("OnFrame") + + local mainSocketGroup = build.skillsTab.socketGroupList[build.mainSocketGroup] + mainSocketGroup.displaySkillList[mainSocketGroup.mainActiveSkill].activeEffect.srcInstance.skillPart = 2 + build.configTab.input.projectileDistance = 40 + build.configTab.input.enemyRadius = 1 + build.configTab:BuildModList() + build.modFlag = true + build.buildFlag = true + runCallback("OnFrame") + local smallEnemyHits = build.calcsTab.mainOutput.SkillDPSMultiplier + + build.configTab.input.enemyRadius = 11 + build.configTab:BuildModList() + build.modFlag = true + build.buildFlag = true + runCallback("OnFrame") + + assert.is_true(build.calcsTab.mainOutput.SkillDPSMultiplier > smallEnemyHits) + end) + it("Test Adrenaline affecting blight max stage count", function() build.skillsTab:PasteSocketGroup("Blight 20/0 1\n") runCallback("OnFrame") diff --git a/src/Data/Skills/act_int.lua b/src/Data/Skills/act_int.lua index 0203e0aae9f..1357761081a 100644 --- a/src/Data/Skills/act_int.lua +++ b/src/Data/Skills/act_int.lua @@ -1116,9 +1116,10 @@ skills["BallLightning"] = { local ballDistPerStrike = ballDistPerSec * secsPerStrike -- How many times does the ball proc a bolt strike while it is in -- range of the enemy? - local enemyRadius = 0 -- for now, we will be conservative and assume no enemy radius + local enemyRadius = skillModList:Override(skillCfg, "EnemyRadius") or skillModList:Sum("BASE", skillCfg, "EnemyRadius") local baseStrikeRadius = output.AreaOfEffectRadius - local strikeRadius = baseStrikeRadius + -- A bolt can hit when its area overlaps any part of the enemy's collision circle. + local strikeRadius = baseStrikeRadius + enemyRadius local castDist = 0 if skillCfg.skillDist then -- Advanced users can specify exactly the standoff distance diff --git a/src/Export/Skills/act_int.txt b/src/Export/Skills/act_int.txt index d516a03a342..7c0ea12dc98 100644 --- a/src/Export/Skills/act_int.txt +++ b/src/Export/Skills/act_int.txt @@ -189,9 +189,10 @@ return function(skills, mod, flag, skill) local ballDistPerStrike = ballDistPerSec * secsPerStrike -- How many times does the ball proc a bolt strike while it is in -- range of the enemy? - local enemyRadius = 0 -- for now, we will be conservative and assume no enemy radius + local enemyRadius = skillModList:Override(skillCfg, "EnemyRadius") or skillModList:Sum("BASE", skillCfg, "EnemyRadius") local baseStrikeRadius = output.AreaOfEffectRadius - local strikeRadius = baseStrikeRadius + -- A bolt can hit when its area overlaps any part of the enemy's collision circle. + local strikeRadius = baseStrikeRadius + enemyRadius local castDist = 0 if skillCfg.skillDist then -- Advanced users can specify exactly the standoff distance diff --git a/src/Modules/ConfigOptions.lua b/src/Modules/ConfigOptions.lua index 98c98b6b9c8..243ae57ea11 100644 --- a/src/Modules/ConfigOptions.lua +++ b/src/Modules/ConfigOptions.lua @@ -762,8 +762,8 @@ return { { var = "VaalMoltenShellDamageMitigated", type = "count", label = "Damage mitigated:", tooltip = "Vaal Molten Shell reflects damage to the enemy,\nbased on the amount of damage it has mitigated in the last second.", ifSkill = "Vaal Molten Shell", apply = function(val, modList, enemyModList) modList:NewMod("SkillData", "LIST", { key = "VaalMoltenShellDamageMitigated", value = val }, "Config", { type = "SkillName", skillName = "Molten Shell" }) end }, - { label = "Multi-part area skills:", ifSkill = { "Seismic Trap", "Lightning Spire Trap", "Explosive Trap", "Molten Strike" }, includeTransfigured = true }, - { var = "enemySizePreset", type = "list", label = "Enemy size preset:", ifSkill = { "Seismic Trap", "Lightning Spire Trap", "Explosive Trap", "Molten Strike" }, includeTransfigured = true, defaultIndex = 2, tooltip = [[ + { label = "Multi-part area skills:", ifSkill = { "Seismic Trap", "Lightning Spire Trap", "Explosive Trap", "Molten Strike", "Ball Lightning" }, includeTransfigured = true }, + { var = "enemySizePreset", type = "list", label = "Enemy size preset:", ifSkill = { "Seismic Trap", "Lightning Spire Trap", "Explosive Trap", "Molten Strike", "Ball Lightning" }, includeTransfigured = true, defaultIndex = 2, tooltip = [[ Configure the radius of an enemy hitbox which is used in calculating some area multi-hitting (shotgunning) effects. Small sets the radius to 2. @@ -788,7 +788,7 @@ Huge sets the radius to 11. modList:NewMod("EnemyRadius", "BASE", 11, "Config") end end }, - { var = "enemyRadius", type = "integer", label = "Enemy radius:", ifSkill = { "Seismic Trap", "Lightning Spire Trap", "Explosive Trap", "Molten Strike" }, includeTransfigured = true, tooltip = "Configure the radius of an enemy hitbox to calculate some area overlapping (shotgunning) effects.", apply = function(val, modList, enemyModList) + { var = "enemyRadius", type = "integer", label = "Enemy radius:", ifSkill = { "Seismic Trap", "Lightning Spire Trap", "Explosive Trap", "Molten Strike", "Ball Lightning" }, includeTransfigured = true, tooltip = "Configure the radius of an enemy hitbox to calculate some area overlapping (shotgunning) effects.", apply = function(val, modList, enemyModList) modList:NewMod("EnemyRadius", "OVERRIDE", m_max(val, 1), "Config") end }, { var = "TotalMinionLife", type = "integer", label = "Minion Life override:", ifMod = "takenFromMinionBeforeYou", tooltip = "Overrides the automatically calculated Life of the minion supported by Companionship.", apply = function(val, modList, enemyModList)