From 50e01a5c67853ccd90352f0a82a0bd702e2fe9cf Mon Sep 17 00:00:00 2001 From: Regisle <49933620+Regisle@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:02:46 +0930 Subject: [PATCH] Implement movement speed link mastery (#6672) * Implement movement speed link mastery * add max tag --- src/Classes/PartyTab.lua | 12 ++++++++++++ src/Data/ModCache.lua | 2 +- src/Modules/CalcDefence.lua | 2 +- src/Modules/CalcPerform.lua | 2 ++ src/Modules/CalcSections.lua | 2 +- src/Modules/ModParser.lua | 3 ++- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Classes/PartyTab.lua b/src/Classes/PartyTab.lua index 31c267bb..9867899c 100644 --- a/src/Classes/PartyTab.lua +++ b/src/Classes/PartyTab.lua @@ -7,6 +7,7 @@ local pairs = pairs local ipairs = ipairs local s_format = string.format local t_insert = table.insert +local m_max = math.max local PartyTabClass = newClass("PartyTab", "ControlHost", "Control", function(self, build) self.ControlHost() @@ -704,6 +705,17 @@ function PartyTabClass:ParseBuffs(list, buf, buffType, label) if line:match("%.") then local k1, k2, v = line:match("([%w ]-%w+)%.([%w ]-%w+)=(.+)") label[k1] = {[k2] = tonumber(v)} + elseif line:match("|") then + local k, tags, v = line:match("([%w ]-%w+)|(.+)=(.+)") + v = tonumber(v) + for tag in tags:gmatch("([^|]*)|?") do + if tag == "percent" then + v = v / 100 + elseif tag == "max" then + v = m_max(v, label[k] or 1) + end + end + label[k] = v else local k, v = line:match("([%w ]-%w+)=(.+)") label[k] = tonumber(v) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 05ca4d52..9ada312c 100644 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -11247,7 +11247,7 @@ c["Your Minions spread Burning Ground on Death, dealing 20% of their maximum Lif c["Your Minions spread Caustic Ground on Death, dealing 20% of their maximum Life as Chaos Damage per second"]={{[1]={flags=0,keywordFlags=0,name="ExtraMinionSkill",type="LIST",value={skillId="SiegebreakerCausticGround"}}},nil} c["Your Minions use your Flasks when summoned"]={{[1]={flags=0,keywordFlags=0,name="FlasksApplyToMinion",type="FLAG",value=true}},nil} c["Your Movement Speed is 150% of its base value"]={{[1]={flags=0,keywordFlags=0,name="MovementSpeed",type="OVERRIDE",value=1.5}},nil} -c["Your Movement Speed is equal to the highest Movement Speed among Linked Players"]={nil,"Your Movement Speed is equal to the highest Movement Speed among Linked Players "} +c["Your Movement Speed is equal to the highest Movement Speed among Linked Players"]={{[1]={[1]={threshold=1,type="MultiplierThreshold",var="LinkedTargets"},flags=0,keywordFlags=0,name="MovementSpeedEqualHighestLinkedPlayers",type="FLAG",value=true}},nil} c["Your Offering Skills also affect you"]={{[1]={[1]={skillNameList={[1]="Bone Offering",[2]="Flesh Offering",[3]="Spirit Offering",[4]="Blood Offering"},type="SkillName"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={flags=0,keywordFlags=0,name="SkillData",type="LIST",value={key="buffNotPlayer",value=false}}}}},nil} c["Your Offerings have 50% reduced Effect on you"]={{[1]={[1]={skillNameList={[1]="Bone Offering",[2]="Flesh Offering",[3]="Spirit Offering",[4]="Blood Offering"},type="SkillName"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={flags=0,keywordFlags=0,name="BuffEffectOnPlayer",type="INC",value=-50}}}},nil} c["Your Physical Damage can Chill"]={{[1]={flags=0,keywordFlags=0,name="PhysicalCanChill",type="FLAG",value=true}},nil} diff --git a/src/Modules/CalcDefence.lua b/src/Modules/CalcDefence.lua index f83827e8..41211951 100644 --- a/src/Modules/CalcDefence.lua +++ b/src/Modules/CalcDefence.lua @@ -1164,7 +1164,7 @@ function calcs.defence(env, actor) end -- Miscellaneous: move speed, avoidance - output.MovementSpeedMod = modDB:Override(nil, "MovementSpeed") or calcLib.mod(modDB, nil, "MovementSpeed") + output.MovementSpeedMod = modDB:Override(nil, "MovementSpeed") or (modDB:Flag(nil, "MovementSpeedEqualHighestLinkedPlayers") and actor.partyMembers.output.MovementSpeedMod or calcLib.mod(modDB, nil, "MovementSpeed")) if modDB:Flag(nil, "MovementSpeedCannotBeBelowBase") then output.MovementSpeedMod = m_max(output.MovementSpeedMod, 1) end diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index 7290eb86..a062d4e2 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -2848,6 +2848,8 @@ function calcs.perform(env, fullDPSSkipEHP) buffExports.PlayerMods["EnduranceChargesMax="..tostring(output["EnduranceChargesMax"])] = true end + buffExports.PlayerMods["MovementSpeedMod|percent|max="..tostring(output["MovementSpeedMod"] * 100)] = true + for linkName, link in pairs(buffExports["Link"]) do if linkName == "Flame Link" then buffExports.PlayerMods["Life="..tostring(output["Life"])] = true diff --git a/src/Modules/CalcSections.lua b/src/Modules/CalcSections.lua index 4aed6ccd..579ccf46 100644 --- a/src/Modules/CalcSections.lua +++ b/src/Modules/CalcSections.lua @@ -1637,7 +1637,7 @@ return { } }, -- misc defense { 1, "MiscDefences", 3, colorCodes.DEFENCE, {{ defaultCollapsed = false, label = "Other Defences", data = { - { label = "Movement Speed", { format = "x {2:output:EffectiveMovementSpeedMod}", { breakdown = "EffectiveMovementSpeedMod" }, { modName = "MovementSpeed" }, }, }, + { label = "Movement Speed", { format = "x {2:output:EffectiveMovementSpeedMod}", { breakdown = "EffectiveMovementSpeedMod" }, { modName = { "MovementSpeed", "MovementSpeedEqualHighestLinkedPlayers" } }, }, }, { label = "Effect of Elusive", haveOutput = "ElusiveEffectMod", { format = "{0:output:ElusiveEffectMod}%", { breakdown = "ElusiveEffectMod" }, { modName = { "ElusiveEffect", "BuffEffectOnSelf", "NightbladeSupportedElusiveEffect" }, }, } }, { label = "Light Radius Mod", { format = "x {2:output:LightRadiusMod}", { breakdown = "LightRadiusMod" }, { modName = "LightRadius" }, }, }, { label = "Curse Effect on You", { format = "{1:output:CurseEffectOnSelf}%", { modName = "CurseEffectOnSelf" }, }, }, diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 83a94b43..f8e92a02 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -3515,8 +3515,9 @@ local specialModList = { ["gain adrenaline for 1 second when you change stance"] = { flag("Condition:Adrenaline", { type = "Condition", var = "StanceChangeLastSecond" }) }, ["with a searching eye jewel socketed, maim enemies for (%d) seconds on hit with attacks"] = { mod("EnemyModifier", "LIST", { mod = flag("Condition:Maimed", nil, ModFlag.Attack) }, { type = "Condition", var = "HaveSearchingEyeJewelIn{SlotName}" }) }, ["with a searching eye jewel socketed, blind enemies for (%d) seconds on hit with attacks"] = { mod("EnemyModifier", "LIST", { mod = flag("Condition:Blinded", nil, ModFlag.Attack) }, { type = "Condition", var = "HaveSearchingEyeJewelIn{SlotName}" }) }, - ["enemies maimed by you take (%d+)%% increased damage over time"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("DamageTakenOverTime", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "Maimed" }) } end, + ["enemies maimed by you take (%d+)%% increased damage over time"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("DamageTakenOverTime", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "Maimed" }) } end, ["(%d+)%% increased defences while you have at least four linked targets"] = function(num) return { mod("Defences", "INC", num, { type = "MultiplierThreshold", var = "LinkedTargets", threshold = 4 }) } end, + ["your movement speed is equal to the highest movement speed among linked players"] = { flag("MovementSpeedEqualHighestLinkedPlayers", { type = "MultiplierThreshold", var = "LinkedTargets", threshold = 1 }), }, ["(%d+)%% increased movement speed while you have at least two linked targets"] = function(num) return { mod("MovementSpeed", "INC", num, { type = "MultiplierThreshold", var = "LinkedTargets", threshold = 2 }) } end, ["link skills have (%d+)%% increased buff effect if you have linked to a target recently"] = function(num) return { mod("BuffEffect", "INC", num, { type = "SkillType", skillType = SkillType.Link }, { type = "Condition", var = "LinkedRecently" }) } end, ["link skills can target damageable minions"] = { flag("Condition:CanLinkToMinions") },