Skip to content

Commit 1eef33a

Browse files
authored
Fix Blasphemy not reserving Spirit (#736)
* FIX: blasphemy not causing curses to use spirit * FIX: hide cost warnings for skills supported by blasphemy * FEAT: add parsing for Skills reserve X% less Y * FIX: skill group tooltip for skill gems with secondary support effects * TEST: add test for blasphemy spirit reservation
1 parent 742d7a8 commit 1eef33a

File tree

8 files changed

+35
-5
lines changed

8 files changed

+35
-5
lines changed

spec/System/TestSkills_spec.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,18 @@ describe("TestSkills", function()
77
-- newBuild() takes care of resetting everything in setup()
88
end)
99

10+
it("Test blasphemy reserving Spirit", function()
11+
build.skillsTab:PasteSocketGroup("Blasphemy 20/0 1\nDespair 20/0 1\n")
12+
runCallback("OnFrame")
13+
14+
local oneCurseReservation = build.calcsTab.mainOutput.SpiritReservedPercent
15+
assert.True(oneCurseReservation > 0)
16+
17+
newBuild()
18+
19+
build.skillsTab:PasteSocketGroup("Blasphemy 20/0 1\nDespair 20/0 1\nFlammability 20/0 1\n")
20+
runCallback("OnFrame")
21+
22+
assert.True(build.calcsTab.mainOutput.SpiritReservedPercent > oneCurseReservation)
23+
end)
1024
end)

src/Classes/SkillsTab.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ function SkillsTabClass:AddSocketGroupTooltip(tooltip, socketGroup)
11381138
tooltip:AddLine(16, "^7Active Skill #"..index..":")
11391139
for _, skillEffect in ipairs(activeSkill.effectList) do
11401140
tooltip:AddLine(20, string.format("%s%s ^7%d%s/%d%s",
1141-
data.skillColorMap[skillEffect.grantedEffect.color],
1141+
data.skillColorMap[skillEffect.grantedEffect.color or skillEffect.gemData and skillEffect.gemData.grantedEffect.color],
11421142
skillEffect.grantedEffect.name,
11431143
skillEffect.srcInstance and skillEffect.srcInstance.level or skillEffect.level,
11441144
(skillEffect.srcInstance and skillEffect.level > skillEffect.srcInstance.level) and colorCodes.MAGIC.."+"..(skillEffect.level - skillEffect.srcInstance.level).."^7" or "",

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3149,7 +3149,7 @@ c["Skills have -2 seconds to Cooldown"]={{}," seconds to Cooldown "}
31493149
c["Skills have 33% chance to not consume a Cooldown when used"]={{[1]={[1]={skillType=101,type="SkillType"},flags=0,keywordFlags=0,name="CooldownChanceNotConsume",type="BASE",value=0.33}},nil}
31503150
c["Skills have a 125% longer Perfect Timing window"]={{[1]={flags=0,keywordFlags=0,name="PerfectTiming",type="INC",value=125}},nil}
31513151
c["Skills have a 150% longer Perfect Timing window"]={{[1]={flags=0,keywordFlags=0,name="PerfectTiming",type="INC",value=150}},nil}
3152-
c["Skills reserve 50% less Spirit"]={nil,"Skills reserve 50% less Spirit "}
3152+
c["Skills reserve 50% less Spirit"]={{[1]={flags=0,keywordFlags=0,name="SpiritReserved",type="MORE",value=-50}},nil}
31533153
c["Skills that would Summon a Totem have 20% chance to Summon two Totems instead"]={nil,"Skills that would Summon a Totem have 20% chance to Summon two Totems instead "}
31543154
c["Slam Skills have 12% increased Area of Effect"]={{[1]={[1]={skillType=103,type="SkillType"},flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=12}},nil}
31553155
c["Slam Skills you use yourself cause Aftershocks"]={nil,"Slam Skills you use yourself cause Aftershocks "}

src/Data/Skills/act_int.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,11 @@ skills["BlasphemyPlayer"] = {
769769
label = "Buff",
770770
incrementalEffectiveness = 0.054999999701977,
771771
statDescriptionScope = "skill_stat_descriptions",
772+
statMap = {
773+
["blasphemy_base_spirit_reservation_per_socketed_curse"] = {
774+
mod("SkillData", "LIST", { key = "spiritReservationFlat", value = nil })
775+
},
776+
},
772777
baseFlags = {
773778
area = true,
774779
},

src/Modules/CalcActiveSkill.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ function calcs.createActiveSkill(activeEffect, supportList, env, actor, socketGr
153153
end
154154
end
155155
until (notAddedNewSupport)
156-
156+
157157
for _, supportEffect in ipairs(supportList) do
158158
-- Pass 2: Add all compatible supports
159159
if calcLib.canGrantedEffectSupportActiveSkill(supportEffect.grantedEffect, activeSkill) then
160160
t_insert(activeSkill.effectList, supportEffect)
161+
-- Track how many active skills are supported by this support effect
161162
if supportEffect.isSupporting and activeEffect.srcInstance then
162163
supportEffect.isSupporting[activeEffect.srcInstance] = true
163164
end

src/Modules/CalcDefence.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,16 @@ function calcs.doActorLifeManaSpiritReservation(actor)
183183
values.reservedFlat = values.reservedFlat * activeSkill.activeMineCount
184184
values.reservedPercent = values.reservedPercent * activeSkill.activeMineCount
185185
end
186-
-- Blood Sacrament increases reservation per stage channelled
186+
if activeSkill.skillTypes[SkillType.CanHaveMultipleOngoingSkillInstances] and activeSkill.activeEffect.srcInstance.supportEffect and activeSkill.activeEffect.srcInstance.supportEffect.isSupporting then
187+
-- Sadly no better way to get key/val table element count in lua.
188+
local instances = 0
189+
for _ in pairs(activeSkill.activeEffect.srcInstance.supportEffect.isSupporting) do
190+
instances = instances + 1
191+
end
192+
values.reservedFlat = values.reservedFlat * instances
193+
values.reservedPercent = values.reservedPercent * instances
194+
end
195+
-- Blood Sacrament increases reservation per stage channelled
187196
if activeSkill.skillCfg.skillName == "Blood Sacrament" and activeSkill.activeStageCount then
188197
values.reservedFlat = values.reservedFlat * (activeSkill.activeStageCount + 1)
189198
values.reservedPercent = values.reservedPercent * (activeSkill.activeStageCount + 1)

src/Modules/Calcs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ function calcs.buildOutput(build, mode)
440440
if not GlobalCache.cachedData[mode][uuid] then
441441
calcs.buildActiveSkill(env, mode, skill, uuid)
442442
end
443-
if GlobalCache.cachedData[mode][uuid] then
443+
if GlobalCache.cachedData[mode][uuid] and (not skill.triggeredBy or skill.triggeredBy.grantedEffect.id ~= "SupportBlasphemyPlayer") then
444444
output.EnergyShieldProtectsMana = env.modDB:Flag(nil, "EnergyShieldProtectsMana")
445445
for pool, costResource in pairs({["LifeUnreserved"] = "LifeCost", ["ManaUnreserved"] = "ManaCost", ["Rage"] = "RageCost", ["EnergyShield"] = "ESCost"}) do
446446
local cachedCost = GlobalCache.cachedData[mode][uuid].Env.player.output[costResource]

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4887,6 +4887,7 @@ local specialModList = {
48874887
mod("SkillData", "LIST", { key = "manaReservationPercent", value = 0 }, { type = "SkillType", skillType = SkillType.Banner }, { type = "SkillType", skillType = SkillType.Blessing, neg = true }),
48884888
mod("SkillData", "LIST", { key = "lifeReservationPercent", value = 0 }, { type = "SkillType", skillType = SkillType.Banner }, { type = "SkillType", skillType = SkillType.Blessing, neg = true }),
48894889
},
4890+
["skills reserve (%d+)%% less (.+)"] = function(num, _, resource) return { mod(string.gsub(" "..resource, "%W%l", string.upper):sub(2) .. "Reserved", "MORE", -num) } end,
48904891
["placed banners also grant (%d+)%% increased attack damage to you and allies"] = function(num) return { mod("ExtraAuraEffect", "LIST", { mod = mod("Damage", "INC", num, nil, ModFlag.Attack) }, { type = "Condition", var = "BannerPlanted" }, { type = "SkillType", skillType = SkillType.Banner }) } end,
48914892
["banners also cause enemies to take (%d+)%% increased damage"] = function(num) return { mod("ExtraAuraDebuffEffect", "LIST", { mod = mod("DamageTaken", "INC", num, { type = "GlobalEffect", effectType = "AuraDebuff", unscalable = true }) }, { type = "Condition", var = "BannerPlanted" }, { type = "SkillType", skillType = SkillType.Banner }) } end,
48924893
["dread banner grants an additional %+(%d+) to maximum fortification when placing the banner"] = function(num) return { mod("ExtraSkillMod", "LIST", { mod = mod("MaximumFortification", "BASE", num, { type = "GlobalEffect", effectType = "Buff" }) }, { type = "Condition", var = "BannerPlanted" }, { type = "SkillName", skillName = "Dread Banner" }) } end,

0 commit comments

Comments
 (0)