Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit afff087

Browse files
committed
Unify distance to enemy configuration for close combat
Bunch of these sources are not melee/projectile specific anymore so splitting the configuration doesnt rly work properly (and just 1 config is fine anyway always) Closes PathOfBuildingCommunity/PathOfBuilding-PoE2#206 Signed-off-by: Tomas Slusny <[email protected]>
1 parent b3d53b7 commit afff087

File tree

4 files changed

+4
-30
lines changed

4 files changed

+4
-30
lines changed

src/Classes/ModStore.lua

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -486,22 +486,6 @@ function ModStoreClass:EvalMod(mod, cfg)
486486
end
487487
end
488488
end
489-
-- Syntax: { type = "MeleeProximity", ramp = {MaxBonusPct,MinBonusPct} }
490-
-- Both MaxBonusPct and MinBonusPct are percent in decimal form (1.0 = 100%)
491-
-- Example: { type = "MeleeProximity", ramp = {1,0} } ## Duelist-Slayer: Impact
492-
elseif tag.type == "MeleeProximity" then
493-
if not cfg or not cfg.skillDist then
494-
return
495-
end
496-
-- Max potency is 0-15 units of distance
497-
if cfg.skillDist <= 15 then
498-
value = value * tag.ramp[1]
499-
-- Reduced potency (linear) until 40 units
500-
elseif cfg.skillDist >= 16 and cfg.skillDist <= 39 then
501-
value = value * (tag.ramp[1] - ((tag.ramp[1] / 25) * (cfg.skillDist - 15)))
502-
elseif cfg.skillDist >= 40 then
503-
value = 0
504-
end
505489
elseif tag.type == "Limit" then
506490
value = m_min(value, tag.limit or self:GetMultiplier(tag.limitVar, cfg))
507491
elseif tag.type == "Condition" then
@@ -809,4 +793,4 @@ function ModStoreClass:EvalMod(mod, cfg)
809793
end
810794
end
811795
return value
812-
end
796+
end

src/Modules/CalcActiveSkill.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,8 @@ function calcs.buildActiveSkillModList(env, activeSkill)
445445
end
446446
end
447447

448-
-- Calculate Distance for meleeDistance or projectileDistance (for melee proximity, e.g. Impact)
449-
if skillFlags.melee then
450-
effectiveRange = env.configInput.meleeDistance
451-
else
452-
effectiveRange = env.configInput.projectileDistance
453-
end
448+
-- Calculate distance from enemy
449+
effectiveRange = env.configInput.enemyDistance
454450

455451
-- Build config structure for modifier searches
456452
activeSkill.skillCfg = {

src/Modules/ConfigOptions.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,6 @@ local configSettings = {
273273
{ var = "stoneGolemEqualsCarrionGolem", type = "check", label = "# Stone Golem = # Carrion Golem:", ifCond = "StoneEqualCarrionGolem", ifSkill = "Summon Carrion Golem", includeTransfigured = true, apply = function(val, modList, enemyModList)
274274
modList:NewMod("Condition:StoneEqualCarrionGolem", "FLAG", true, "Config")
275275
end },
276-
{ label = "Close Combat:", ifSkill = "Close Combat" },
277-
{ var = "closeCombatCombatRush", type = "check", label = "Is Combat Rush active?", ifSkill = "Close Combat", tooltip = "Combat Rush grants 20% more Attack Speed to Travel Skills not Supported by Close Combat.",apply = function(val, modList, enemyModList)
278-
modList:NewMod("Condition:CombatRushActive", "FLAG", true, "Config")
279-
end },
280276
{ label = "Cold Snap:", ifSkill = "Cold Snap", includeTransfigured = true },
281277
{ var = "ColdSnapBypassCD", type = "check", label = "Bypass CD?", ifSkill = "Cold Snap", includeTransfigured = true, apply = function(val, modList, enemyModList)
282278
modList:NewMod("CooldownRecovery", "OVERRIDE", 0, "Config", { type = "SkillName", skillName = "Cold Snap", includeTransfigured = true })
@@ -1415,8 +1411,7 @@ Huge sets the radius to 11.
14151411
{ var = "skillPierceCount", type = "count", label = "# of times Skill has Pierced:", ifStat = "PiercedCount", ifFlag = "piercing", apply = function(val, modList, enemyModList)
14161412
modList:NewMod("PiercedCount", "BASE", val, "Config", { type = "Condition", var = "Effective" })
14171413
end },
1418-
{ var = "meleeDistance", type = "count", label = "Melee distance to enemy:", ifTagType = "MeleeProximity", ifFlag = "melee" },
1419-
{ var = "projectileDistance", type = "count", label = "Projectile travel distance:", ifTagType = "DistanceRamp", ifFlag = "projectile" },
1414+
{ var = "enemyDistance", type = "count", label = "Distance to enemy:", ifTagType = "DistanceRamp" },
14201415
{ var = "conditionAtCloseRange", type = "check", label = "Is the enemy at Close Range?", ifCond = "AtCloseRange", apply = function(val, modList, enemyModList)
14211416
modList:NewMod("Condition:AtCloseRange", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
14221417
end },

src/Modules/ModParser.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,6 @@ local specialModList = {
27392739
["you gain (%d+)%% increased area of effect for each mine"] = function(num) return { mod("AreaOfEffect", "INC", num, { type = "PerStat", stat = "ActiveMineLimit" }) } end,
27402740
["triggers level (%d+) summon triggerbots when allocated"] = { flag("HaveTriggerBots") },
27412741
-- Slayer
2742-
["deal up to (%d+)%% more melee damage to enemies, based on proximity"] = function(num) return { mod("Damage", "MORE", num, nil, bor(ModFlag.Attack, ModFlag.Melee), { type = "MeleeProximity", ramp = {1,0} }) } end,
27432742
["cannot be stunned while leeching"] = { flag("StunImmune", { type = "Condition", var = "Leeching" }), },
27442743
["you are immune to bleeding while leeching"] = { flag("BleedImmune", { type = "Condition", var = "Leeching" }), },
27452744
["life leech effects are not removed at full life"] = { flag("CanLeechLifeOnFullLife") },

0 commit comments

Comments
 (0)