diff --git a/Classes/ConfigTab.lua b/Classes/ConfigTab.lua index 1994472d..3380d583 100644 --- a/Classes/ConfigTab.lua +++ b/Classes/ConfigTab.lua @@ -137,6 +137,7 @@ local varList = { { var = "critChanceLucky", type = "check", label = "Is your Crit Chance Lucky?", apply = function(val, modList, enemyModList) modList:NewMod("CritChanceLucky", "FLAG", true, "Config", { type = "Condition", var = "Effective" }) end }, + { var = "projectileDistance", type = "number", label = "Projectile travel distance:", ifFlag = "projectile" }, { var = "conditionEnemyFullLife", type = "check", label = "Is the enemy on Full Life?", ifCond = "EnemyFullLife", apply = function(val, modList, enemyModList) modList:NewMod("Misc", "LIST", { type = "Condition", var = "EnemyFullLife" }, "Config", { type = "Condition", var = "Effective" }) end }, @@ -305,6 +306,11 @@ local ConfigTabClass = common.NewClass("ConfigTab", "UndoHandler", "ControlHost" return varData.tooltip end end + elseif varData.ifFlag then + control.shown = function() + return self.build.calcsTab.mainEnv.mainSkill.skillFlags[varData.ifFlag] + end + control.tooltip = varData.tooltip else control.tooltip = varData.tooltip end diff --git a/Classes/ModDB.lua b/Classes/ModDB.lua index 971b223e..f9202bec 100644 --- a/Classes/ModDB.lua +++ b/Classes/ModDB.lua @@ -82,7 +82,7 @@ end function ModDBClass:Sum(modType, cfg, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) local flags, keywordFlags = 0, 0 - local skillName, skillGem, skillPart, skillTypes, skillStats, skillCond, slotName, source, tabulate + local skillName, skillGem, skillPart, skillTypes, skillStats, skillCond, skillDist, slotName, source, tabulate if cfg then flags = cfg.flags or 0 keywordFlags = cfg.keywordFlags or 0 @@ -92,6 +92,7 @@ function ModDBClass:Sum(modType, cfg, arg1, arg2, arg3, arg4, arg5, arg6, arg7, skillTypes = cfg.skillTypes skillStats = cfg.skillStats skillCond = cfg.skillCond + skillDist = cfg.skillDist slotName = cfg.slotName source = cfg.source tabulate = cfg.tabulate @@ -168,6 +169,24 @@ function ModDBClass:Sum(modType, cfg, arg1, arg2, arg3, arg4, arg5, arg6, arg7, else value = value * mult + (tag.base or 0) end + elseif tag.type == "DistanceRamp" then + if not skillDist then + value = nullValue + break + end + if skillDist <= tag.ramp[1][1] then + value = value * tag.ramp[1][2] + elseif skillDist >= tag.ramp[#tag.ramp][1] then + value = value * tag.ramp[#tag.ramp][2] + else + for i, dat in ipairs(tag.ramp) do + local next = tag.ramp[i+1] + if skillDist <= next[1] then + value = m_floor(value * (dat[2] + (next[2] - dat[2]) * (skillDist - dat[1]) / (next[1] - dat[1]))) + break + end + end + end elseif tag.type == "Condition" then local match = false if tag.varList then diff --git a/Classes/ModList.lua b/Classes/ModList.lua index c08c7894..3ebcca96 100644 --- a/Classes/ModList.lua +++ b/Classes/ModList.lua @@ -54,7 +54,7 @@ end function ModListClass:Sum(modType, cfg, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) local flags, keywordFlags = 0, 0 - local skillName, skillGem, skillPart, skillTypes, skillStats, skillCond, slotName, source, tabulate + local skillName, skillGem, skillPart, skillTypes, skillStats, skillCond, skillDist, slotName, source, tabulate if cfg then flags = cfg.flags or 0 keywordFlags = cfg.keywordFlags or 0 @@ -64,6 +64,7 @@ function ModListClass:Sum(modType, cfg, arg1, arg2, arg3, arg4, arg5, arg6, arg7 skillTypes = cfg.skillTypes skillStats = cfg.skillStats skillCond = cfg.skillCond + skillDist = cfg.skillDist slotName = cfg.slotName source = cfg.source tabulate = cfg.tabulate @@ -138,6 +139,24 @@ function ModListClass:Sum(modType, cfg, arg1, arg2, arg3, arg4, arg5, arg6, arg7 else value = value * mult + (tag.base or 0) end + elseif tag.type == "DistanceRamp" then + if not skillDist then + value = nullValue + break + end + if skillDist <= tag.ramp[1][1] then + value = value * tag.ramp[1][2] + elseif skillDist >= tag.ramp[#tag.ramp][1] then + value = value * tag.ramp[#tag.ramp][2] + else + for i, dat in ipairs(tag.ramp) do + local next = tag.ramp[i+1] + if skillDist <= next[1] then + value = value * (dat[2] + (next[2] - dat[2]) * (skillDist - dat[1]) / (next[1] - dat[1])) + break + end + end + end elseif tag.type == "Condition" then local match = false if tag.varList then diff --git a/Data/Gems/act_int.lua b/Data/Gems/act_int.lua index d82804f1..c5aabafc 100644 --- a/Data/Gems/act_int.lua +++ b/Data/Gems/act_int.lua @@ -1893,6 +1893,10 @@ gems["Freezing Pulse"] = { active_skill = true, spell = true, cold = true, + setupFunc = function(env, output) + env.modDB:NewMod("Damage", "MORE", -100, "Skill:Freezing Pulse", ModFlag.Spell, { type = "DistanceRamp", ramp = {{0,0},{60*output.ProjectileSpeedMod,1}} }) + env.modDB:NewMod("EnemyFreezeChance", "BASE", 25, "Skill:Freezing Pulse", { type = "DistanceRamp", ramp = {{0,1},{15*output.ProjectileSpeedMod,0}} }) + end, color = 3, baseFlags = { spell = true, @@ -1906,7 +1910,6 @@ gems["Freezing Pulse"] = { skill("critChance", 6), --"base_is_projectile" = ? mod("PierceChance", "BASE", 100), --"always_pierce" = ? - mod("EnemyFreezeChance", "BASE", 25), }, qualityMods = { mod("ProjectileSpeed", "INC", 2), --"base_projectile_speed_+%" = 2 diff --git a/Data/Gems/sup_dex.lua b/Data/Gems/sup_dex.lua index aeef7393..2fd6dfa0 100644 --- a/Data/Gems/sup_dex.lua +++ b/Data/Gems/sup_dex.lua @@ -1128,7 +1128,7 @@ gems["Point Blank"] = { excludeSkillTypes = { }, baseMods = { mod("ManaCost", "MORE", 20), - --"keystone_point_blank" = 1 + flag("PointBlank"), --"keystone_point_blank" = 1 }, qualityMods = { mod("Damage", "INC", 0.5, ModFlag.Projectile), --"projectile_damage_+%" = 0.5 diff --git a/Modules/Calcs.lua b/Modules/Calcs.lua index 36be24fc..afdd0d8e 100644 --- a/Modules/Calcs.lua +++ b/Modules/Calcs.lua @@ -337,6 +337,7 @@ local function buildActiveSkillModList(env, activeSkill) skillPart = activeSkill.skillPart, skillTypes = activeSkill.skillTypes, skillCond = { }, + skillDist = env.buffMode == "EFFECTIVE" and env.configInput.projectileDistance, slotName = activeSkill.slotName, } if skillFlags.weapon1Attack then @@ -996,7 +997,7 @@ local function initEnv(build, mode, override) end -- Finalise environment and perform the calculations --- This function is 1800 lines long. Enjoy! +-- This function is 1900 lines long. Enjoy! local function performCalcs(env) local modDB = env.modDB local enemyDB = env.enemyDB @@ -1774,6 +1775,9 @@ local function performCalcs(env) -- Calculate skill type stats if skillFlags.projectile then + if modDB:Sum("FLAG", nil, "PointBlank") then + modDB:NewMod("Damage", "MORE", 50, "Point Blank", bor(ModFlag.Attack, ModFlag.Projectile), { type = "DistanceRamp", ramp = {{10,1},{35,0},{150,-1}} }) + end output.ProjectileCount = modDB:Sum("BASE", skillCfg, "ProjectileCount") output.PierceChance = m_min(100, modDB:Sum("BASE", skillCfg, "PierceChance")) output.ProjectileSpeedMod = calcMod(modDB, skillCfg, "ProjectileSpeed") diff --git a/Modules/ModParser.lua b/Modules/ModParser.lua index 1b78d0ef..2d2eeff1 100644 --- a/Modules/ModParser.lua +++ b/Modules/ModParser.lua @@ -493,9 +493,10 @@ local specialModList = { mod("Misc", "LIST", { type = "EnemyModifier", mod = mod("LightningResist", "BASE", minus, { type = "Condition", var = "HitByLightningDamage", neg = true }, { type = "Condition", varList={"HitByFireDamage","HitByColdDamage"} }) }), } end, + ["projectile attacks deal up to 50%% more damage to targets at the start of their movement, dealing less damage to targets as the projectile travels farther"] = { flag("PointBlank") }, -- Ascendancy notables ["movement skills cost no mana"] = { mod("ManaCost", "MORE", -100, nil, 0, KeywordFlag.Movement) }, - ["projectiles have 100%% additional chance to pierce targets at the start of their movement, losing this chance as the projectile travels farther"] = { mod("PierceChance", "BASE", 50, { type = "Condition", var = "Effective" }) }, + ["projectiles have (%d+)%% additional chance to pierce targets at the start of their movement, losing this chance as the projectile travels farther"] = function(num) return { mod("PierceChance", "BASE", num, { type = "DistanceRamp", ramp = {{10,1},{120,0}} }) } end, ["projectile critical strike chance increased by arrow pierce chance"] = { mod("CritChance", "INC", 1, nil, ModFlag.Projectile, 0, { type = "PerStat", stat = "PierceChance", div = 1 }) }, ["always poison on hit while using a flask"] = { mod("PoisonChance", "BASE", 100, { type = "Condition", var = "UsingFlask" }) }, ["armour received from body armour is doubled"] = { flag("Unbreakable") }, diff --git a/README.md b/README.md index a0b877e2..11eabef4 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,12 @@ Head over to the [Releases](https://github.com/Openarl/PathOfBuilding/releases) ![ss3](https://cloud.githubusercontent.com/assets/19189971/18089780/f0ff234a-6f04-11e6-8c88-6193fe59a5c4.png) ## Changelog +### 1.3.9 - 2017/02/23 + * Projectile skills now have an option in the Configuration tab for "Projectile travel distance" + * Point Blank, and the scaling Pierce chance from Powerful Precision, are now supported + * Far Shot is not supported yet, as the scaling is unknown + * Freezing Pulse's damage and freeze chance can now scale with distance (factoring in projectile speed) + ### 1.3.8 - 2017/02/22 * Flicker Strike now shows DPS instead of Average Damage * Added an extra option for Elemental Equilibrium to ignore the hit damage of your main skill diff --git a/changelog.txt b/changelog.txt index 86072c80..9514032d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +VERSION[1.3.9][2017/02/23] + * Projectile skills now have an option in the Configuration tab for "Projectile travel distance" + * Point Blank, and the scaling Pierce chance from Powerful Precision, are now supported + * Far Shot is not supported yet, as the scaling is unknown + * Freezing Pulse's damage and freeze chance can now scale with distance (factoring in projectile speed) VERSION[1.3.8][2017/02/22] * Flicker Strike now shows DPS instead of Average Damage * Added an extra option for Elemental Equilibrium to ignore the hit damage of your main skill diff --git a/manifest.xml b/manifest.xml index a69c6ab1..c7cd0161 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,20 +1,20 @@ - + - + - + @@ -26,8 +26,8 @@ - - + + @@ -44,13 +44,13 @@ - + - + @@ -59,10 +59,10 @@ - + - +