Skip to content

Commit be9142c

Browse files
author
LocalIdentity
committed
Fix all global effects apply from all stat sets
1 parent b9d8bdd commit be9142c

4 files changed

Lines changed: 30 additions & 29 deletions

File tree

src/Data/Skills/act_int.lua

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6303,9 +6303,6 @@ skills["EssenceDrainPlayer"] = {
63036303
spell = true,
63046304
projectile = true,
63056305
},
6306-
baseMods = {
6307-
mod("Multiplier:ChaosDebuff", "BASE", 1, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Essence Drain" }),
6308-
},
63096306
constantStats = {
63106307
{ "movement_speed_+%_final_while_performing_action", -70 },
63116308
{ "movement_speed_acceleration_+%_per_second_while_performing_action", 160 },
@@ -7984,9 +7981,6 @@ skills["FlameWallPlayer"] = {
79847981
statDescriptionScope = "flame_wall",
79857982
baseFlags = {
79867983
},
7987-
baseMods = {
7988-
flag("applyBuffsFromAllStatSets"),
7989-
},
79907984
constantStats = {
79917985
{ "number_of_allowed_firewalls", 3 },
79927986
{ "firewall_attached_projectile_effect_mtx", 1 },
@@ -8070,10 +8064,10 @@ skills["FlameWallPlayer"] = {
80708064
mod("FireMax", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Flame Wall", effectCond = "FlameWallAddedDamage" }),
80718065
},
80728066
["flame_wall_minimum_added_lightning_damage_to_add_to_projectile"] = {
8073-
mod("LightningMin", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond ="FlameWallInfused" }),
8067+
mod("LightningMin", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond = "FlameWallInfused" }),
80748068
},
80758069
["flame_wall_maximum_added_lightning_damage_to_add_to_projectile"] = {
8076-
mod("LightningMax", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond ="FlameWallInfused" }),
8070+
mod("LightningMax", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond = "FlameWallInfused" }),
80778071
},
80788072
},
80798073
baseFlags = {
@@ -19340,9 +19334,6 @@ skills["SoulrendPlayer"] = {
1934019334
spell = true,
1934119335
projectile = true,
1934219336
},
19343-
baseMods = {
19344-
mod("Multiplier:ChaosDebuff", "BASE", 1, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Soulrend" }),
19345-
},
1934619337
constantStats = {
1934719338
{ "active_skill_projectile_speed_+%_variation_final", 25 },
1934819339
{ "movement_speed_+%_final_while_performing_action", -70 },

src/Export/Skills/act_int.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ statMap = {
445445
#skill EssenceDrainPlayer
446446
#set EssenceDrainPlayer
447447
#flags spell projectile
448-
#baseMod mod("Multiplier:ChaosDebuff", "BASE", 1, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Essence Drain" })
449448
#mods
450449
#set EssenceDrainDotPlayer
451450
#flags spell projectile duration
@@ -564,7 +563,6 @@ statMap = {
564563
#skill FlameWallPlayer
565564
#set FlameWallPlayer
566565
#flags
567-
#baseMod flag("applyBuffsFromAllStatSets")
568566
#mods
569567
#set FlameWallProjectileBuffPlayer
570568
#flags
@@ -576,10 +574,10 @@ statMap = {
576574
mod("FireMax", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Flame Wall", effectCond = "FlameWallAddedDamage" }),
577575
},
578576
["flame_wall_minimum_added_lightning_damage_to_add_to_projectile"] = {
579-
mod("LightningMin", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond ="FlameWallInfused" }),
577+
mod("LightningMin", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond = "FlameWallInfused" }),
580578
},
581579
["flame_wall_maximum_added_lightning_damage_to_add_to_projectile"] = {
582-
mod("LightningMax", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond ="FlameWallInfused" }),
580+
mod("LightningMax", "BASE", nil, ModFlag.Projectile, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Infused Flame Wall", effectCond = "FlameWallInfused" }),
583581
},
584582
},
585583
#mods
@@ -1330,7 +1328,6 @@ statMap = {
13301328
#skill SoulrendPlayer
13311329
#set SoulrendPlayer
13321330
#flags spell projectile
1333-
#baseMod mod("Multiplier:ChaosDebuff", "BASE", 1, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Soulrend" })
13341331
#mods
13351332
#set SoulrendDotPlayer
13361333
#flags spell duration

src/Modules/CalcActiveSkill.lua

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,28 @@ local function checkForScalarMultiplier(modOrGroup, modList)
6565
return 1 + scale / 100
6666
end
6767

68-
local function getFlagFromBaseMods(baseMods, flag)
69-
if baseMods then
70-
for _, baseMod in ipairs(baseMods) do
71-
if baseMod.type == "FLAG" and baseMod.name == flag then
68+
local function isGlobalEffect(modOrGroup)
69+
local modList = modOrGroup.name and { modOrGroup } or modOrGroup
70+
for _, mod in ipairs(modList) do
71+
for _, tag in ipairs(mod) do
72+
if tag.type == "GlobalEffect" then
7273
return true
7374
end
7475
end
7576
end
7677
return false
7778
end
79+
7880
-- Merge skill effect modifiers with given mod list
79-
-- If a stat set is provided, only merge modifiers from that statset
81+
-- If a stat set is provided, merge it and global effects from the other stat sets
8082
function calcs.mergeSkillInstanceMods(env, modList, skillEffect, statSet, extraStats)
8183
calcLib.validateGemLevel(skillEffect)
8284
-- Verify that statSet provided is from skillEffect
8385
if statSet and not isValueInArray(skillEffect.grantedEffect.statSets, statSet) then
8486
return
8587
end
8688
local grantedEffect = skillEffect.grantedEffect
87-
-- for some skills like Flame Wall, the Projectile Buff is on a separate statSet and we want to add it regardless of which statSet is active
88-
-- enabled by adding '#baseMod flag("applyBuffsFromAllStatSets)' to the main/first skill txt
89-
local applyBuffsFromAllStatSets = getFlagFromBaseMods(statSet and statSet.baseMods, "applyBuffsFromAllStatSets")
90-
for _, set in ipairs((applyBuffsFromAllStatSets and grantedEffect.statSets or (statSet and {statSet} or grantedEffect.statSets))) do
89+
local function mergeStatSet(set, onlyGlobals)
9190
local stats = calcLib.buildSkillInstanceStats(skillEffect, grantedEffect, set)
9291
if extraStats and extraStats[1] then
9392
for _, stat in pairs(extraStats) do
@@ -99,16 +98,15 @@ function calcs.mergeSkillInstanceMods(env, modList, skillEffect, statSet, extraS
9998
if map then
10099
-- Some mods need different scalars for different stats, but the same value. Putting them in a group allows this
101100
for _, modOrGroup in ipairs(map) do
102-
-- either we are adding the mods of the activeSkill like usual or we are adding only the Buffs from the other statSets
103-
if not applyBuffsFromAllStatSets or (applyBuffsFromAllStatSets and modOrGroup[1] and modOrGroup[1].effectType == "Buff") then
101+
if not onlyGlobals or isGlobalEffect(modOrGroup) then
104102
local scalar = checkForScalarMultiplier(modOrGroup, modList)
105103
-- Found a mod, since all mods have names
106104
if modOrGroup.name then
107105
modOrGroup.source = string.format("Skill:%s", grantedEffect.id)
108106
mergeLevelMod(modList, modOrGroup, map.value or statValue * (map.mult or 1) * scalar / (map.div or 1) + (map.base or 0))
109107
else
110108
for _, mod in ipairs(modOrGroup) do
111-
local scalar = checkForScalarMultiplier(mod)
109+
local scalar = checkForScalarMultiplier(mod, modList)
112110
mod.source = string.format("Skill:%s", grantedEffect.id)
113111
mergeLevelMod(modList, mod, modOrGroup.value or statValue * (modOrGroup.mult or 1) * scalar / (modOrGroup.div or 1) + (modOrGroup.base or 0))
114112
end
@@ -117,8 +115,23 @@ function calcs.mergeSkillInstanceMods(env, modList, skillEffect, statSet, extraS
117115
end
118116
end
119117
end
118+
end
119+
for _, set in ipairs(statSet and {statSet} or grantedEffect.statSets) do
120+
mergeStatSet(set)
120121
modList:AddList(set.baseMods)
121122
end
123+
if statSet then
124+
for _, set in ipairs(grantedEffect.statSets) do
125+
if set ~= statSet then
126+
mergeStatSet(set, true)
127+
for _, baseMod in ipairs(set.baseMods or { }) do
128+
if isGlobalEffect(baseMod) then
129+
modList:AddMod(baseMod)
130+
end
131+
end
132+
end
133+
end
134+
end
122135
end
123136

124137
-- Create an active skill using the given active gem and list of support gems

src/Modules/CalcPerform.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ function calcs.perform(env, skipEHP)
19041904
end
19051905
end
19061906
end
1907-
1907+
19081908
local appliedCombustion = false
19091909
local warcryList = { }
19101910
for _, activeSkill in ipairs(env.player.activeSkillList) do

0 commit comments

Comments
 (0)