Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blasphemy auras triggering mana cost warning #8324

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 1 addition & 12 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1735,19 +1735,8 @@ function buildMode:AddDisplayStatList(statList, actor)
end
elseif not (statData.hideStat) then
-- Change the color of the stat label to red if cost exceeds pool
local output = actor.output
local poolVal = output[statData.pool]
local colorOverride = nil
if statData.stat:match("Cost$") and not statData.stat:match("PerSecondCost$") and statVal and poolVal then
if statData.stat == "ManaCost" and output.EnergyShieldProtectsMana then
if statVal > output.ManaUnreserved + output.EnergyShield then
colorOverride = colorCodes.NEGATIVE
end
elseif statVal > poolVal then
colorOverride = colorCodes.NEGATIVE
end
end
if statData.warnFunc and statData.warnFunc(statVal, actor.output) and statData.warnColor then
if actor.output[statData.stat.."Warning"] or (statData.warnFunc and statData.warnFunc(statVal, actor.output) and statData.warnColor) then
colorOverride = colorCodes.NEGATIVE
end
t_insert(statBoxList, {
Expand Down
10 changes: 8 additions & 2 deletions src/Modules/Calcs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
local t_insert = table.insert
local s_format = string.format
local m_min = math.min
local m_ceil = math.ceil

local calcs = { }
calcs.breakdownModule = "Modules/CalcBreakdown"
Expand Down Expand Up @@ -441,8 +442,13 @@
if cachedCost then
local totalPool = (output.EnergyShieldProtectsMana and costResource == "ManaCost" and output["EnergyShield"] or 0) + (output[pool] or 0)
if totalPool < cachedCost then
output[costResource.."Warning"] = output[costResource.."Warning"] or {}
t_insert(output[costResource.."Warning"], skill.activeEffect.grantedEffect.name)
local rawPool = pool:gsub("Unreserved$", "")
local reservation = GlobalCache.cachedData[mode][uuid].Env.player.mainSkill and GlobalCache.cachedData[mode][uuid].Env.player.mainSkill.skillData[rawPool .. "ReservedPercent"]
-- Skill has both cost and reservation check if there's avilable pool for raw cost before reservation

Check warning on line 447 in src/Modules/Calcs.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (avilable)
if not reservation or (reservation and (totalPool + m_ceil((output[rawPool] or 0) * reservation / 100)) < cachedCost) then
output[costResource.."Warning"] = output[costResource.."Warning"] or {}
t_insert(output[costResource.."Warning"], skill.activeEffect.grantedEffect.name)
end
end
end
end
Expand Down
Loading