Skip to content

Commit 9aad3c8

Browse files
majochemLocalIdentity
andauthored
Add support for "Tide Caller" and "Salt and Scale" from Velka Bloodline (#9986)
* Add support for Salt and Scale (Barnacles) * Add support for "Tide Caller" (Brine Ground) * Update ModCache * Move damage gain mods to ConfigOptions This avoids potential doubling of the mods, when there are additional sources of Brine Ground, such as the "Surging Torrent" skill * Fix ailment scaling Ailment effect was not being applied to the enemy so it wasn't showing a multiplier on the calcs tab It also wasn't scaling sources or guaranteed shocks like skitterbots --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent b05b2ae commit 9aad3c8

6 files changed

Lines changed: 104 additions & 12 deletions

File tree

spec/System/TestAilments_spec.lua

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ describe("TestAilments", function()
77
-- newBuild() takes care of resetting everything in setup()
88
end)
99

10+
local function rebuild()
11+
build.configTab:BuildModList()
12+
runCallback("OnFrame")
13+
end
14+
1015
it("maximum shock value", function()
1116
-- Shock Nova
1217
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nShock Nova 4/0 1\n")
@@ -27,16 +32,68 @@ describe("TestAilments", function()
2732
build.configTab.input.customMods = "\z
2833
attacks have 10% chance to cause bleeding\n\z
2934
"
30-
build.configTab:BuildModList()
31-
runCallback("OnFrame")
35+
rebuild()
3236
local badDps = build.calcsTab.mainOutput.BleedDPS
3337

3438
build.configTab.input.customMods = "\z
3539
attacks have 100% chance to cause bleeding\n\z
3640
"
37-
build.configTab:BuildModList()
38-
runCallback("OnFrame")
41+
rebuild()
3942
local goodDps = build.calcsTab.mainOutput.BleedDPS
4043
assert.True(goodDps > badDps)
4144
end)
42-
end)
45+
46+
it("scales hit ailments with target ailment effect", function()
47+
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nShock Nova 20/0 1\n")
48+
build.configTab.input.customMods = "Drop Brine Ground while moving, lasting 4 seconds"
49+
rebuild()
50+
51+
assert.are.equals(1, build.calcsTab.mainOutput.ShockEffectMod)
52+
53+
build.configTab.input.conditionEnemyOnBrineGround = true
54+
rebuild()
55+
56+
assert.are.near(1.3, build.calcsTab.mainOutput.ShockEffectMod, 10 ^ -9)
57+
end)
58+
59+
it("scales minion ailment duration with Barnacles", function()
60+
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nSummon Ice Golem 20/0 1\n")
61+
build.configTab.input.customMods = "Inflict Barnacles on nearby Enemies every second\nMinions gain 100% of Physical Damage as Extra Cold Damage"
62+
rebuild()
63+
local baseFreezeDurationMod = build.calcsTab.mainEnv.minion.output.FreezeDurationMod
64+
local baseChillDuration = build.calcsTab.mainEnv.minion.output.ChillDuration
65+
66+
build.configTab.input.multiplierBarnacleStacks = 10
67+
rebuild()
68+
69+
assert.are.near(baseChillDuration * 1.5, build.calcsTab.mainEnv.minion.output.ChillDuration, 10 ^ -9)
70+
assert.are.near(baseFreezeDurationMod * 1.5, build.calcsTab.mainEnv.minion.output.FreezeDurationMod, 10 ^ -9)
71+
assert.are.equals(50, build.calcsTab.mainEnv.enemyDB:Sum("BASE", nil, "PhysicalDamageConvertToCold"))
72+
end)
73+
74+
it("scales chilling area duration with Barnacles", function()
75+
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nCold Snap 20/0 1\n")
76+
build.configTab.input.customMods = "Inflict Barnacles on nearby Enemies every second"
77+
rebuild()
78+
79+
assert.are.equals(1, build.calcsTab.mainOutput.ChillDurationMod)
80+
81+
build.configTab.input.multiplierBarnacleStacks = 10
82+
rebuild()
83+
84+
assert.are.equals(1.5, build.calcsTab.mainOutput.ChillDurationMod)
85+
end)
86+
87+
it("scales guaranteed ailments with target ailment effect", function()
88+
build.skillsTab:PasteSocketGroup("Summon Skitterbots 1/0 1\n")
89+
build.configTab.input.customMods = "Drop Brine Ground while moving, lasting 4 seconds"
90+
rebuild()
91+
92+
assert.are.equals(15, build.calcsTab.mainOutput.CurrentShock)
93+
94+
build.configTab.input.conditionEnemyOnBrineGround = true
95+
rebuild()
96+
97+
assert.are.equals(19, build.calcsTab.mainOutput.CurrentShock)
98+
end)
99+
end)

src/Data/ModCache.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8469,7 +8469,7 @@ c["Does not delay Inherent Loss of Rage Regenerate 1 Rage per second for every 3
84698469
c["Does not delay Inherent Loss of Rage Skills Cost +3 Rage"]={{[1]={flags=0,keywordFlags=0,name="RageCostNoMult",type="BASE",value=3}},"Does not delay Inherent Loss of Rage "}
84708470
c["Does not inflict Mana Burn over time"]={nil,"Does not inflict Mana Burn over time "}
84718471
c["Does not inflict Mana Burn over time Inflicts Mana Burn on you when you Hit an Enemy with a Melee Weapon"]={nil,"Does not inflict Mana Burn over time Inflicts Mana Burn on you when you Hit an Enemy with a Melee Weapon "}
8472-
c["Drop Brine Ground while moving, lasting 4 seconds"]={nil,"Drop Brine Ground while moving, lasting 4 seconds "}
8472+
c["Drop Brine Ground while moving, lasting 4 seconds"]={{[1]={flags=0,keywordFlags=0,name="CanCreateBrineGround",type="FLAG",value=true}},nil}
84738473
c["Drops Scorched Ground while moving, lasting 4 seconds"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="OnScorchedGround"},flags=0,keywordFlags=0,name="ScorchBase",type="BASE",value=10}},nil}
84748474
c["Drops Shocked Ground while moving, lasting 2 seconds"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="OnShockedGround"},flags=0,keywordFlags=0,name="ShockBase",type="BASE",value=15}},nil}
84758475
c["Dual Wielding does not inherently grant chance to Block Attack Damage"]={{[1]={flags=0,keywordFlags=0,name="Condition:NoInherentBlock",type="FLAG",value=true}},nil}
@@ -9641,7 +9641,7 @@ c["Inflict 3 additional Poisons on the same Target when you inflict Poison with
96419641
c["Inflict 5 additional Impales on Enemies you Impale"]={nil,"Inflict 5 additional Impales on Enemies you Impale "}
96429642
c["Inflict 5 additional Impales on Enemies you Impale For 5 seconds after you Impale Enemies, they cannot be Impaled again, and Impales cannot be Called from them"]={nil,"Inflict 5 additional Impales on Enemies you Impale For 5 seconds after you Impale Enemies, they cannot be Impaled again, and Impales cannot be Called from them "}
96439643
c["Inflict 5 additional Impales on Enemies you Impale For 5 seconds after you Impale Enemies, they cannot be Impaled again, and Impales cannot be Called from them Limited to 1 Keystone Tattoo"]={nil,"Inflict 5 additional Impales on Enemies you Impale For 5 seconds after you Impale Enemies, they cannot be Impaled again, and Impales cannot be Called from them Limited to 1 Keystone Tattoo "}
9644-
c["Inflict Barnacles on nearby Enemies every second"]={nil,"Inflict Barnacles on nearby Enemies every second "}
9644+
c["Inflict Barnacles on nearby Enemies every second"]={{[1]={flags=0,keywordFlags=0,name="CanInflictBarnacles",type="FLAG",value=true}},nil}
96459645
c["Inflict Brittle on Enemies when you Block their Damage"]={nil,"Inflict Brittle on Enemies when you Block their Damage "}
96469646
c["Inflict Brittle on Enemies when you Block their Damage 67% increased Chance to Block"]={nil,"Inflict Brittle on Enemies when you Block their Damage 67% increased Chance to Block "}
96479647
c["Inflict Decay on Enemies you Curse with Hex Skills, dealing 700 Chaos Damage per Second for 8 Seconds"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="Cursed"},flags=0,keywordFlags=0,name="SkillData",type="LIST",value={key="decay",merge="MAX",value=700}}},nil}

src/Modules/CalcOffence.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5154,8 +5154,10 @@ function calcs.offence(env, actor, activeSkill)
51545154
skillFlags.chill = true
51555155
local incChill = skillModList:Sum("INC", cfg, "EnemyChillEffect")
51565156
local moreChill = skillModList:More(cfg, "EnemyChillEffect")
5157-
output.ChillEffectMod = (1 + incChill / 100) * moreChill
5158-
output.ChillDurationMod = 1 + skillModList:Sum("INC", cfg, "EnemyChillDuration", "EnemyAilmentDuration", "EnemyElementalAilmentDuration") / 100
5157+
output.ChillEffectMod = (1 + incChill / 100) * moreChill * calcLib.mod(enemyDB, nil, "SelfChillEffect")
5158+
local incChillDuration = skillModList:Sum("INC", cfg, "EnemyChillDuration", "EnemyAilmentDuration", "EnemyElementalAilmentDuration") + enemyDB:Sum("INC", nil, "SelfChillDuration", "SelfAilmentDuration", "SelfElementalAilmentDuration")
5159+
local moreChillDuration = skillModList:More(cfg, "EnemyChillDuration", "EnemyAilmentDuration", "EnemyElementalAilmentDuration") * enemyDB:More(nil, "SelfChillDuration", "SelfAilmentDuration", "SelfElementalAilmentDuration")
5160+
output.ChillDurationMod = (1 + incChillDuration / 100) * moreChillDuration
51595161
output.ChillSourceEffect = m_min(skillModList:Override(nil, "ChillMax") or ailmentData.Chill.max, m_floor(ailmentData.Chill.default * output.ChillEffectMod))
51605162
if breakdown then
51615163
breakdown.DotChill = { }
@@ -5208,7 +5210,7 @@ function calcs.offence(env, actor, activeSkill)
52085210
local moreDur = skillModList:More(cfg, "Enemy"..ailment.."Duration", "EnemyElementalAilmentDuration", "EnemyAilmentDuration") * enemyDB:More(nil, "Self"..ailment.."Duration", "SelfElementalAilmentDuration", "SelfAilmentDuration")
52095211
output[ailment.."Duration"] = ailmentData[ailment].duration * (1 + incDur / 100) * moreDur * debuffDurationMult
52105212
-- Line Controls Crit Conditional for Crit Mastery
5211-
output[ailment.."EffectMod"] = calcLib.mod(skillModList, cfg, "Enemy"..ailment.."Effect")
5213+
output[ailment.."EffectMod"] = calcLib.mod(skillModList, cfg, "Enemy"..ailment.."Effect") * calcLib.mod(enemyDB, nil, "Self"..ailment.."Effect")
52125214
if breakdown then
52135215
local maximum = globalOutput["Maximum"..ailment] or ailmentData[ailment].max
52145216
local current = m_max(m_min(globalOutput["Current"..ailment] or 0, maximum), 0)

src/Modules/CalcPerform.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3497,10 +3497,11 @@ function calcs.perform(env, skipEHP)
34973497
for _, value in ipairs(modDB:Tabulate("BASE", nil, ailment.."Base", ailment.."Override", ailment.."Minimum")) do
34983498
local mod = value.mod
34993499
local effect = mod.value
3500+
local scalesWithSource = mod.name == ailment.."Base" or mod.name == ailment.."Minimum"
35003501
if mod.name == ailment.."Override" then
35013502
enemyDB:NewMod("Condition:"..val.condition, "FLAG", true, mod.source)
35023503
end
3503-
if mod.name == ailment.."Base" or mod.name == ailment.."Minimum" then
3504+
if scalesWithSource then
35043505
-- If the main skill can inflict the ailment, the ailment is inflicted with a hit, and we have a node allocated that checks what our highest damage is, then
35053506
-- use the skill's ailment modifiers
35063507
-- if not, use the generic modifiers
@@ -3510,6 +3511,9 @@ function calcs.perform(env, skipEHP)
35103511
else
35113512
effect = effect * calcLib.mod(modDB, nil, "Enemy"..ailment.."Effect")
35123513
end
3514+
end
3515+
effect = effect * calcLib.mod(enemyDB, nil, "Self"..ailment.."Effect")
3516+
if scalesWithSource then
35133517
modDB:NewMod(ailment.."Override", "BASE", effect, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
35143518
if mod.name == ailment.."Minimum" then
35153519
minimum = minimum + effect

src/Modules/ConfigOptions.lua

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,16 @@ Huge sets the radius to 11.
11361136
{ var = "minionConditionOnProfaneGround", type = "check", label = "Minion on Profane Ground?", ifMinionCond = "OnProfaneGround", apply = function(val, modList, enemyModList)
11371137
modList:NewMod("MinionModifier", "LIST", { mod = modLib.createMod("Condition:OnProfaneGround", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) })
11381138
end },
1139+
{ var = "conditionOnBrineGround", type = "check", label = "Are you on Brine Ground?", ifFlag = "CanCreateBrineGround", tooltip = "Allies on your Brine Ground gain 10% of Physical Damage as extra Cold Damage and as extra Lightning Damage", apply = function(val, modList, enemyModList)
1140+
modList:NewMod("Condition:OnBrineGround", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
1141+
modList:NewMod("PhysicalDamageGainAsCold", "BASE", 10, "Config", { type = "Condition", var = "OnBrineGround" })
1142+
modList:NewMod("PhysicalDamageGainAsLightning", "BASE", 10, "Config", { type = "Condition", var = "OnBrineGround" })
1143+
end },
1144+
{ var = "minionConditionOnBrineGround", type = "check", label = "Minion on Brine Ground?", ifFlag = "CanCreateBrineGround", tooltip = "Allies on your Brine Ground gain 10% of Physical Damage as extra Cold Damage and as extra Lightning Damage", apply = function(val, modList, enemyModList)
1145+
modList:NewMod("MinionModifier", "LIST", { mod = modLib.createMod("Condition:OnBrineGround", "FLAG", true, "Config", { type = "Condition", var = "Combat" }) })
1146+
modList:NewMod("MinionModifier", "LIST", { mod = modLib.createMod("PhysicalDamageGainAsCold", "BASE", 10, "Config", { type = "Condition", var = "OnBrineGround" }) })
1147+
modList:NewMod("MinionModifier", "LIST", { mod = modLib.createMod("PhysicalDamageGainAsLightning", "BASE", 10, "Config", { type = "Condition", var = "OnBrineGround" }) })
1148+
end },
11391149
{ var = "conditionOnCausticGround", type = "check", label = "Are you on Caustic Ground?", ifCond = "OnCausticGround", apply = function(val, modList, enemyModList)
11401150
modList:NewMod("Condition:OnCausticGround", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
11411151
end },
@@ -1871,6 +1881,12 @@ Huge sets the radius to 11.
18711881
{ var = "HoarfrostStacks", type = "count", label = "^x3F6DB3Hoarfrost ^7Stacks", ifFlag = "HitsCanInflictHoarfrost", tooltip = "Amount of stacks of ^x3F6DB3Hoarfrost ^7applied to the enemy.", apply = function(val, modList, enemyModList)
18721882
enemyModList:NewMod("HoarfrostFreezeDuration", "INC", val * 20, "Config", { type = "Condition", var = "Effective" })
18731883
end },
1884+
{ var = "multiplierBarnacleStacks", type = "count", label = "^x3F6DB3Barnacle ^7Stacks", ifFlag = "CanInflictBarnacles", tooltip = "Amount of stacks of ^x3F6DB3Barnacle ^7applied to the enemy.\n\n^8(Enemies affected by Barnacles Convert 5% of Physical Damage to Cold and have 5% increased duration of Chill and Freeze on them.\nEach instance of Barnacles lasts 30 seconds and can be inflicted up to 10 times)", apply = function(val, modList, enemyModList)
1885+
enemyModList:NewMod("Multiplier:BarnacleStack", "BASE", m_min(val, 10), "Config", { type = "Condition", var = "Effective" })
1886+
enemyModList:NewMod("SelfFreezeDuration", "INC", 5, "Config", { type = "Multiplier", var = "BarnacleStack" }, { type = "Condition", var = "Effective" } )
1887+
enemyModList:NewMod("SelfChillDuration", "INC", 5, "Config", { type = "Multiplier", var = "BarnacleStack" }, { type = "Condition", var = "Effective" } )
1888+
enemyModList:NewMod("PhysicalDamageConvertToCold", "BASE", 5, "Config", { type = "Multiplier", var = "BarnacleStack" }, { type = "Condition", var = "Effective" } )
1889+
end },
18741890
{ var = "conditionEnemyFrozen", type = "check", label = "Is the enemy ^x3F6DB3Frozen?", ifEnemyCond = "Frozen", apply = function(val, modList, enemyModList)
18751891
enemyModList:NewMod("Condition:Frozen", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
18761892
end },
@@ -1973,9 +1989,19 @@ Huge sets the radius to 11.
19731989
{ var = "multiplierEnemyAffectedByGraspingVines", type = "count", label = "# of Grasping Vines affecting enemy:", ifMult = "GraspingVinesAffectingEnemy", apply = function(val, modList, enemyModList)
19741990
modList:NewMod("Multiplier:GraspingVinesAffectingEnemy", "BASE", val, "Config", { type = "Condition", var = "Effective" })
19751991
end },
1976-
{ var = "conditionEnemyOnFungalGround", type = "check", label = "Is the enemy on Fungal Ground?", ifCond = { "OnFungalGround", "CreateFungalGround" }, tooltip = "Enemies on your Fungal Ground have -10% to all Resistances.", apply = function(val, modList, enemyModList)
1992+
{ var = "conditionEnemyOnFungalGround", type = "check", label = "Is the enemy on Fungal Ground?", ifCond = { "OnFungalGround", "CreateFungalGround" }, tooltip = "Enemies on your Fungal Ground have -10% to all Resistances", apply = function(val, modList, enemyModList)
19771993
enemyModList:NewMod("Condition:OnFungalGround", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
19781994
end },
1995+
{ var = "conditionEnemyOnBrineGround", type = "check", label = "Is the enemy on Brine Ground?", ifFlag = "CanCreateBrineGround", tooltip = "Enemies on your Brine Ground have \n30% increased effect of Lightning and Cold Ailments on them and \nhave 25% reduced Armour and Evasion Rating.", apply = function(val, modList, enemyModList)
1996+
enemyModList:NewMod("Condition:OnBrineGround", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1997+
enemyModList:NewMod("SelfChillEffect", "INC", 30, "Config", { type = "Condition", var = "OnBrineGround" })
1998+
enemyModList:NewMod("SelfBrittleEffect", "INC", 30, "Config", { type = "Condition", var = "OnBrineGround" })
1999+
enemyModList:NewMod("SelfShockEffect", "INC", 30, "Config", { type = "Condition", var = "OnBrineGround" })
2000+
enemyModList:NewMod("SelfSapEffect", "INC", 30, "Config", { type = "Condition", var = "OnBrineGround" })
2001+
enemyModList:NewMod("Armour", "INC", -25, "Config", { type = "Condition", var = "OnBrineGround" })
2002+
enemyModList:NewMod("Evasion", "INC", -25, "Config", { type = "Condition", var = "OnBrineGround" })
2003+
2004+
end },
19792005
{ var = "conditionEnemyInChillingArea", type = "check", label = "Is the enemy in a ^x3F6DB3Chilling ^7area?", ifEnemyCond = "InChillingArea", apply = function(val, modList, enemyModList)
19802006
enemyModList:NewMod("Condition:InChillingArea", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
19812007
end },

src/Modules/ModParser.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,6 +3031,9 @@ local specialModList = {
30313031
mod("ChaosMax", "BASE", 1, { type = "PercentStat", stat = "LifeCost", percent = num }, { type = "StatThreshold", stat = "LifeUnreserved", thresholdStat = "LifeCost", thresholdPercent = num }),
30323032
} end,
30333033
["lose all rage on reaching maximum rage and gain wild savagery for 1 second per 10 rage lost this way"] = { flag("WildSavagery") },
3034+
-- Velka Bloodline
3035+
["inflict barnacles on nearby enemies every second"] = { flag("CanInflictBarnacles") },
3036+
["drop brine ground while moving, lasting 4 seconds"] = { flag("CanCreateBrineGround"), },
30343037
-- Item local modifiers
30353038
["has no sockets"] = { flag("NoSockets") },
30363039
["reflects your o[tp][hp][eo][rs]i?t?e? ring"] = {

0 commit comments

Comments
 (0)