Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,19 @@ local function determineCursePriority(curseName, activeSkill)
return basePriority + socketPriority + slotPriority + sourcePriority
end

local function applyEnemyModifiers(actor)
-- Process enemy modifiers
local function applyEnemyModifiers(actor, clearCache)
if clearCache or not actor.appliedEnemyModifiers then
actor.appliedEnemyModifiers = { }
end
local cache = actor.appliedEnemyModifiers
local enemyDB = actor.enemy.modDB
for _, value in ipairs(actor.modDB:Tabulate(nil, nil, "EnemyModifier")) do
actor.enemy.modDB:AddMod(modLib.setSource(value.value.mod, value.value.mod.source or value.mod.source))
local mod = value.value and value.value.mod
if mod and not cache[mod] then
local source = mod.source or value.mod.source
enemyDB:AddMod(modLib.setSource(mod, source))
cache[mod] = true
end
end
end

Expand All @@ -579,6 +588,9 @@ local function doActorMisc(env, actor)
local output = actor.output
local condList = modDB.conditions

-- Process enemy modifiers
applyEnemyModifiers(actor)

-- Add misc buffs/debuffs
if env.mode_combat then
if env.player.mainSkill.baseSkillModList:Flag(nil, "Cruelty") then
Expand Down Expand Up @@ -1170,11 +1182,11 @@ function calcs.perform(env, skipEHP)
output.WarcryPower = modDB:Override(nil, "WarcryPower") or modDB:Sum("BASE", nil, "WarcryPower") or 0
modDB.multipliers["WarcryPower"] = output.WarcryPower

applyEnemyModifiers(env.player)
applyEnemyModifiers(env.player, true)
if env.minion then
applyEnemyModifiers(env.minion)
applyEnemyModifiers(env.minion, true)
end
applyEnemyModifiers(env.enemy)
applyEnemyModifiers(env.enemy, true)

for _, activeSkill in ipairs(env.player.activeSkillList) do
if activeSkill.skillTypes[SkillType.Brand] then
Expand Down