Skip to content

Commit 9fb0618

Browse files
LocalIdentityLocalIdentity
andauthored
Fix Burden of Shadows Life cost calculation (#851)
* Fix Burden of Shadows Life cost calculation The mod from Burden of Shadows internally uses a value of 100 for the stat `base_skill_cost_life_instead_of_mana_%` which also comes from Blood Magic, Lifetap and tree mods. Talked to GGG and confirmed that all these mods should cap at a total summed value of 100 as you cannot over convert your skill cost The game will probably fix this issue in the 0.2 patch later this week * Fix extra nil --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 543f88f commit 9fb0618

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3123,7 +3123,7 @@ c["Share Charges with Allies in your Presence"]={nil,"Share Charges with "}
31233123
c["Shocking Hits have a 50% chance to also Shock enemies in a 1.5 metre radius"]={nil,"Shocking Hits have a 50% chance to also Shock enemies in a 1.5 metre radius "}
31243124
c["Shocks you when you reach maximum Power Charges"]={nil,"Shocks you when you reach maximum Power Charges "}
31253125
c["Skill Gems have 30% more Attribute Requirements"]={{[1]={flags=0,keywordFlags=0,name="GlobalGemAttributeRequirements",type="MORE",value=30}},nil}
3126-
c["Skill Mana Costs Converted to Life Costs"]={{[1]={flags=0,keywordFlags=0,name="CostLifeInsteadOfMana",type="FLAG",value=true}},nil}
3126+
c["Skill Mana Costs Converted to Life Costs"]={{[1]={flags=0,keywordFlags=0,name="HybridManaAndLifeCost_Life",type="BASE",value=100}},nil}
31273127
c["Skills Cost +3 Rage"]={{[1]={flags=0,keywordFlags=0,name="RageCostBase",type="BASE",value=3}},nil}
31283128
c["Skills Supported by Unleash have 10% increased Seal gain frequency"]={{[1]={flags=0,keywordFlags=0,name="SealGainFrequency",type="INC",value=10}},nil}
31293129
c["Skills Supported by Unleash have 25% increased Seal gain frequency"]={{[1]={flags=0,keywordFlags=0,name="SealGainFrequency",type="INC",value=25}},nil}

src/Modules/CalcOffence.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@ function calcs.offence(env, actor, activeSkill)
16661666
-- First pass to calculate base costs. Used for cost conversion (e.g. Petrified Blood)
16671667
local additionalLifeCost = skillModList:Sum("BASE", skillCfg, "ManaCostAsLifeCost") / 100 -- Extra cost (e.g. Petrified Blood) calculations
16681668
local additionalESCost = skillModList:Sum("BASE", skillCfg, "ManaCostAsEnergyShieldCost") / 100 -- Extra cost (e.g. Replica Covenant) calculations
1669-
local hybridLifeCost = skillModList:Sum("BASE", skillCfg, "HybridManaAndLifeCost_Life") / 100 -- Life/Mana mastery
1669+
local hybridLifeCost = m_min(skillModList:Sum("BASE", skillCfg, "HybridManaAndLifeCost_Life"), 100) / 100 -- Blood Magic, Lifetap and tree mods capped at 100
16701670
for resource, val in pairs(costs) do
16711671
local skillCost = skillModList:Override(skillCfg, "Base"..resource.."CostOverride") or activeSkill.activeEffect.grantedEffectLevel.cost and activeSkill.activeEffect.grantedEffectLevel.cost[resource] or nil
16721672
local baseCost = round(skillCost and skillCost / data.costs[resource].Divisor or 0, 2)
@@ -1690,7 +1690,7 @@ function calcs.offence(env, actor, activeSkill)
16901690
val.baseCostRaw = val.baseCostRaw and (val.baseCost * mult + val.baseCostNoMult + divineBlessingCorrection)
16911691
if val.type == "Life" then
16921692
local manaType = resource:gsub("Life", "Mana")
1693-
if skillModList:Flag(skillCfg, "CostLifeInsteadOfMana") then -- Blood Magic / Lifetap
1693+
if skillModList:Flag(skillCfg, "CostLifeInsteadOfMana") then -- Blood Magic / Lifetap in PoE 1, not used in PoE 2 yet
16941694
val.baseCost = val.baseCost + costs[manaType].baseCost
16951695
val.baseCostNoMult = val.baseCostNoMult + costs[manaType].baseCostNoMult
16961696
val.finalBaseCost = val.finalBaseCost + costs[manaType].finalBaseCost

src/Modules/ModParser.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,6 @@ local specialModList = {
21232123
["removes all energy shield"] = { mod("EnergyShield", "MORE", -100) },
21242124
["converts all energy shield to mana"] = { mod("EnergyShieldConvertToMana", "BASE", 100) },
21252125
["skills cost life instead of mana"] = { flag("CostLifeInsteadOfMana") },
2126-
["skill mana costs converted to life costs"] = { flag("CostLifeInsteadOfMana") },
21272126
["skills reserve life instead of mana"] = { flag("BloodMagicReserved") },
21282127
["non%-aura skills cost no mana or life while focus?sed"] = {
21292128
mod("ManaCost", "MORE", -100, { type = "Condition", var = "Focused" }, { type = "SkillType", skillType = SkillType.Aura, neg = true }),
@@ -4828,11 +4827,6 @@ local specialModList = {
48284827
flag("DealNoChaos",{ type = "Condition", var = "LowLife", neg = true }),
48294828
flag("DealNoPhysical", { type = "Condition", var = "LowLife", neg = true }),
48304829
},
4831-
["attacks have blood magic"] = { flag("CostLifeInsteadOfMana", nil, ModFlag.Attack) },
4832-
["attacks cost life instead of mana"] = { flag("CostLifeInsteadOfMana", nil, ModFlag.Attack) },
4833-
["attack skills cost life instead of (%d+)%% of mana cost"] = function(num) return {
4834-
mod("HybridManaAndLifeCost_Life", "BASE", num, nil, ModFlag.Attack)
4835-
} end,
48364830
["trigger a socketed elemental spell on block, with a ([%d%.]+) second cooldown"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerElementalSpellOnBlock", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) },
48374831
["(%d+)%% chance to cast a? ?socketed lightning spells? on hit"] = { mod("ExtraSupport", "LIST", { skillId = "SupportUniqueMjolnerLightningSpellsCastOnHit", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) },
48384832
["cast a socketed lightning spell on hit"] = { mod("ExtraSupport", "LIST", { skillId = "SupportUniqueMjolnerLightningSpellsCastOnHit", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) },
@@ -5142,6 +5136,9 @@ local specialModList = {
51425136
["gain sacrificial zeal when you use a skill, dealing you %d+%% of the skill's mana cost as physical damage per second"] = {
51435137
flag("Condition:SacrificialZeal"),
51445138
},
5139+
["attacks have blood magic"] = { flag("CostLifeInsteadOfMana", nil, ModFlag.Attack) },
5140+
["attacks cost life instead of mana"] = { flag("CostLifeInsteadOfMana", nil, ModFlag.Attack) },
5141+
51455142
["skills gain a base life cost equal to (%d+)%% of base mana cost"] = function(num) return {
51465143
mod("ManaCostAsLifeCost", "BASE", num),
51475144
} end,
@@ -5154,9 +5151,13 @@ local specialModList = {
51545151
["(%d+)%% of skill mana costs converted to life costs"] = function(num) return {
51555152
mod("HybridManaAndLifeCost_Life", "BASE", num),
51565153
} end,
5154+
["skill mana costs converted to life costs"] = { mod("HybridManaAndLifeCost_Life", "BASE", 100) },
51575155
["(%d+)%% of spell mana cost converted to life cost"] = function(num) return {
51585156
mod("HybridManaAndLifeCost_Life", "BASE", num,{ type = "SkillType", skillType = SkillType.Spell }),
51595157
} end,
5158+
["attack skills cost life instead of (%d+)%% of mana cost"] = function(num) return {
5159+
mod("HybridManaAndLifeCost_Life", "BASE", num, nil, ModFlag.Attack)
5160+
} end,
51605161
["(%d+)%% increased cost of arc and crackling lance"] = function(num) return {
51615162
mod("Cost", "INC", num, { type = "SkillName", skillNameList = { "Arc", "Crackling Lance" }, includeTransfigured = true }),
51625163
} end,

0 commit comments

Comments
 (0)