Skip to content

Commit 3a43915

Browse files
LocalIdentityLocalIdentity
andauthored
Adds support for many foulborn mods (#9295)
* Adds support for many foulborn mods Chaos Damage taken does not bypass Energy Shield while not on Low Mana (8-12)% of Armour applies to Fire, Cold and Lightning Damage taken from Hits if you've Blocked Recently Increases and Reductions to Spell Damage also apply to Attack Damage with Retaliation Skills at 200% of their value 50% increased Elemental and Chaos Resistances Lone Messenger Transcendence You have Immortal Ambition while all Socketed Gems are Red Action Speed cannot be modified to below Base Value while Ignited Ignore Attribute Requirements of Gems Socketed in Blue Sockets Ignore Attribute Requirements of Socketed Gems Ignited Enemies you Kill Explode, dealing 5% of their Life as Fire Damage which cannot Ignite Your Damage with Hits is Lucky while on Low Life (10-15)% chance to Avoid All Damage from Hits 50% reduced Effect of Non-Damaging Ailments on you (-30-30)% reduced Duration of Curses on you Debuffs on you expire (-20-20)% slower Lose 0.5% Life and Energy Shield per Second per Minion +(3-5) to maximum number of Summoned Searing Bond Totems You are Immune to Curses Maximum Energy Shield is increased by Chaos Resistance Attacks fire 3 additional Projectiles (15-20)% chance to inflict Withered for 2 seconds on Hit against Cursed Enemies Skills which Throw Traps have +2 Cooldown Uses Minions Leech 5% of Elemental Damage as Energy Shield Gain (15-30)% of Missing Unreserved Mana before being Hit by an Enemy Recover Energy Shield equal to 1% of Evasion Rating when you Block Rightmost (2-4) Magic Utility Flasks constantly apply their Flask Effects to you Increases and Reductions to Evasion Rating in Radius are Transformed to apply to Armour Grants all bonuses of Unallocated Notable Passive Skills in Radius Allocated Notable Passive Skills in Radius grant nothing Keystone Passive Skills in Radius can be Allocated without being connected to your tree * Fix Crash with MissingManaBeforeEnemyHit code When using Blood Magic the ManaUnreserved variable is nil so was causing a crash when used in the calculation * Move cluster keystone to own loop * Fix logic for kitavas thirst * Life Regeneration also applies to Energy Shield * Recoup Energy Shield instead of life --------- Co-authored-by: LocalIdentity <[email protected]>
1 parent 1bbc55f commit 3a43915

File tree

14 files changed

+228
-80
lines changed

14 files changed

+228
-80
lines changed

src/Classes/PassiveSpec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
946946
local radiusIndex = item.jewelRadiusIndex
947947
if self.nodes[nodeId].nodesInRadius and self.nodes[nodeId].nodesInRadius[radiusIndex][node.id] then
948948
if itemId ~= 0 then
949-
if item.jewelData.intuitiveLeapLike then
949+
if item.jewelData.intuitiveLeapLike and not (item.jewelData.intuitiveLeapKeystoneOnly and node.type ~= "Keystone") then
950950
-- This node depends on Intuitive Leap-like behaviour
951951
-- This flag:
952952
-- 1. Prevents generation of paths from this node unless it's also connected to the start

src/Data/ModCache.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5421,7 +5421,7 @@ c["40% reduced Cost of Retaliation Skills"]={{[1]={[1]={skillType=132,type="Skil
54215421
c["40% reduced Critical Strike Chance per Power Charge"]={{[1]={[1]={type="Multiplier",var="PowerCharge"},flags=0,keywordFlags=0,name="CritChance",type="INC",value=-40}},nil}
54225422
c["40% reduced Effect of Curses on you"]={{[1]={flags=0,keywordFlags=0,name="CurseEffectOnSelf",type="INC",value=-40}},nil}
54235423
c["40% reduced Effect of Curses on you during Effect of any Mana Flask"]={{[1]={[1]={type="Condition",var="UsingManaFlask"},flags=0,keywordFlags=0,name="CurseEffectOnSelf",type="INC",value=-40}},nil}
5424-
c["40% reduced Effect of Non-Damaging Ailments on you during Effect of any Life Flask"]={{[1]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="EnemyShockEffect",type="INC",value=-40},[2]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="EnemyChillEffect",type="INC",value=-40},[3]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="EnemyFreezeEffect",type="INC",value=-40},[4]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="EnemyScorchEffect",type="INC",value=-40},[5]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="EnemyBrittleEffect",type="INC",value=-40},[6]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="EnemySapEffect",type="INC",value=-40}}," on you "}
5424+
c["40% reduced Effect of Non-Damaging Ailments on you during Effect of any Life Flask"]={{[1]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="SelfShockEffect",type="INC",value=-40},[2]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="SelfChillEffect",type="INC",value=-40},[3]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="SelfFreezeEffect",type="INC",value=-40},[4]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="SelfScorchEffect",type="INC",value=-40},[5]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="SelfBrittleEffect",type="INC",value=-40},[6]={[1]={type="Condition",var="UsingLifeFlask"},flags=0,keywordFlags=0,name="SelfSapEffect",type="INC",value=-40}},nil}
54255425
c["40% reduced Enemy Stun Threshold with Melee Weapons"]={{[1]={flags=67108864,keywordFlags=0,name="EnemyStunThreshold",type="INC",value=-40}},nil}
54265426
c["40% reduced Energy Shield Recharge Rate"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldRecharge",type="INC",value=-40}},nil}
54275427
c["40% reduced Frenzy Charge Duration"]={{[1]={flags=0,keywordFlags=0,name="FrenzyChargesDuration",type="INC",value=-40}},nil}
@@ -9495,8 +9495,8 @@ c["Left ring slot: Projectiles from Spells Fork"]={{[1]={[1]={num=1,type="SlotNu
94959495
c["Left ring slot: Projectiles from Spells cannot Chain"]={{[1]={[1]={num=1,type="SlotNumber"},flags=1026,keywordFlags=0,name="CannotChain",type="FLAG",value=true}},nil}
94969496
c["Left ring slot: Regenerate 40 Mana per Second"]={{[1]={[1]={num=1,type="SlotNumber"},flags=0,keywordFlags=0,name="ManaRegen",type="BASE",value=40}},nil}
94979497
c["Left ring slot: You cannot Recharge or Regenerate Energy Shield"]={{[1]={[1]={num=1,type="SlotNumber"},flags=0,keywordFlags=0,name="NoEnergyShieldRecharge",type="FLAG",value=true},[2]={[1]={num=1,type="SlotNumber"},flags=0,keywordFlags=0,name="NoEnergyShieldRegen",type="FLAG",value=true}},nil}
9498-
c["Leftmost 3 Magic Utility Flasks constantly apply their Flask Effects to you"]={{[1]={flags=0,keywordFlags=0,name="ActiveMagicUtilityFlasks",type="BASE",value=3}},nil}
9499-
c["Leftmost 4 Magic Utility Flasks constantly apply their Flask Effects to you"]={{[1]={flags=0,keywordFlags=0,name="ActiveMagicUtilityFlasks",type="BASE",value=4}},nil}
9498+
c["Leftmost 3 Magic Utility Flasks constantly apply their Flask Effects to you"]={{[1]={flags=0,keywordFlags=0,name="LeftActiveMagicUtilityFlasks",type="BASE",value=3}},nil}
9499+
c["Leftmost 4 Magic Utility Flasks constantly apply their Flask Effects to you"]={{[1]={flags=0,keywordFlags=0,name="LeftActiveMagicUtilityFlasks",type="BASE",value=4}},nil}
95009500
c["Lethe Shade"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Lethe Shade"}},nil}
95019501
c["LevelReq: 10"]={nil,"LevelReq: 10 "}
95029502
c["LevelReq: 10 Implicits: 2"]={nil,"LevelReq: 10 Implicits: 2 "}
@@ -11227,7 +11227,7 @@ c["Skills used by Traps have 15% increased Area of Effect"]={{[1]={flags=0,keywo
1122711227
c["Skills used by Traps have 20% increased Area of Effect"]={{[1]={flags=0,keywordFlags=4096,name="AreaOfEffect",type="INC",value=20}},nil}
1122811228
c["Skills used by Traps have 50% increased Area of Effect"]={{[1]={flags=0,keywordFlags=4096,name="AreaOfEffect",type="INC",value=50}},nil}
1122911229
c["Skills which Exert an Attack have 40% chance to not count that Attack"]={nil,"Skills which Exert an Attack have 40% chance to not count that Attack "}
11230-
c["Skills which Throw Traps have +1 Cooldown Use"]={nil,"Skills which Throw Traps have +1 Cooldown Use "}
11230+
c["Skills which Throw Traps have +1 Cooldown Use"]={{[1]={flags=0,keywordFlags=4096,name="AdditionalCooldownUses",type="BASE",value=1}},nil}
1123111231
c["Skills which Throw Traps throw up to 2 additional Traps"]={{[1]={flags=0,keywordFlags=0,name="TrapThrowCount",type="BASE",value=2}},nil}
1123211232
c["Skills which create Brands have 35% chance to create an additional Brand"]={nil,"Skills which create Brands have 35% chance to create an additional Brand "}
1123311233
c["Skills which throw Mines throw up to 1 additional Mine if you have at least 800 Dexterity"]={nil,"Skills which throw Mines throw up to 1 additional Mine if you have at least 800 Dexterity "}

src/Data/SkillStatMap.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ return {
207207
["support_cast_on_mana_spent"] = {
208208
skill("triggeredByKitavaThirst", true, { type = "SkillType", skillType = SkillType.Triggerable }, { type = "SkillType", skillType = SkillType.Spell }),
209209
},
210+
["support_cast_on_life_spent"] = {
211+
skill("triggeredByFoulbornKitavaThirst", true, { type = "SkillType", skillType = SkillType.Triggerable }, { type = "SkillType", skillType = SkillType.Spell }),
212+
},
210213
["cast_when_cast_curse_%"] = {
211214
skill("chanceToTriggerCurseOnCurse", nil, { type = "SkillType", skillType = SkillType.Triggerable }, { type = "SkillType", skillType = SkillType.Hex }),
212215
},

src/Data/Skills/other.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,24 @@ skills["SupportCastOnManaSpent"] = {
21672167
[1] = { PvPDamageMultiplier = -80, cooldown = 0.1, levelRequirement = 1, storedUses = 1, },
21682168
},
21692169
}
2170+
skills["SupportCastOnLifeSpent"] = {
2171+
name = "Foulborn Kitava's Thirst",
2172+
hidden = true,
2173+
color = 3,
2174+
support = true,
2175+
requireSkillTypes = { SkillType.Spell, SkillType.Triggerable, SkillType.AND, },
2176+
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
2177+
excludeSkillTypes = { SkillType.Trapped, SkillType.RemoteMined, SkillType.SummonsTotem, SkillType.Aura, SkillType.InbuiltTrigger, },
2178+
isTrigger = true,
2179+
statDescriptionScope = "gem_stat_descriptions",
2180+
fromItem = true,
2181+
stats = {
2182+
"support_cast_on_life_spent",
2183+
},
2184+
levels = {
2185+
[1] = { PvPDamageMultiplier = -80, cooldown = 0.1, levelRequirement = 1, storedUses = 1, },
2186+
},
2187+
}
21702188
skills["LightningAegis"] = {
21712189
name = "Lightning Aegis",
21722190
hidden = true,

src/Export/Skills/other.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,10 @@ local skills, mod, flag, skill = ...
593593
fromItem = true,
594594
#mods
595595

596+
#skill SupportCastOnLifeSpent Foulborn Kitava's Thirst
597+
fromItem = true,
598+
#mods
599+
596600
#skill LightningAegis
597601
#flags spell
598602
fromItem = true,

src/Modules/CalcDefence.lua

Lines changed: 64 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,13 @@ function calcs.defence(env, actor)
793793
break
794794
end
795795
end
796+
if modDB:Flag(nil, "EnergyShieldIncreasedByChaosResistance") then
797+
for i, value in ipairs(modDB:Tabulate("FLAG", nil, "EnergyShieldIncreasedByChaosResistance")) do
798+
local mod = value.mod
799+
modDB:NewMod("EnergyShield", "INC", output.ChaosResist, mod.source)
800+
break
801+
end
802+
end
796803
-- Primary defences: Energy shield, evasion and armour
797804
do
798805
local ironReflexes = modDB:Flag(nil, "IronReflexes")
@@ -1224,6 +1231,13 @@ function calcs.defence(env, actor)
12241231
end
12251232
end
12261233
end
1234+
if resource == "Life" and modDB:Sum("BASE", nil, "LifeRegenAppliesToEnergyShield") > 0 then
1235+
local conversion = m_min(modDB:Sum("BASE", nil, "LifeRegenAppliesToEnergyShield"), 100) / 100
1236+
local lifeBase = modDB:Sum("BASE", nil, "LifeRegen")
1237+
local lifePercent = modDB:Sum("BASE", nil, "LifeRegenPercent")
1238+
modDB:NewMod("EnergyShieldRegen", "BASE", floor(lifeBase * conversion, 2), "Life Regen to ES Regen")
1239+
modDB:NewMod("EnergyShieldRegenPercent", "BASE", floor(lifePercent * conversion, 2), "Life Regen to ES Regen")
1240+
end
12271241
baseRegen = modDB:Sum("BASE", nil, resource.."Regen") + pool * modDB:Sum("BASE", nil, resource.."RegenPercent") / 100
12281242
regen = baseRegen * (1 + inc/100) * more
12291243
if regen ~= 0 then -- Pious Path
@@ -1338,53 +1352,55 @@ function calcs.defence(env, actor)
13381352
local recoupTypeList = {"Life", "Mana", "EnergyShield"}
13391353
for _, recoupType in ipairs(recoupTypeList) do
13401354
local baseRecoup = modDB:Sum("BASE", nil, recoupType.."Recoup")
1341-
output[recoupType.."Recoup"] = baseRecoup * output[recoupType.."RecoveryRateMod"]
1342-
output["anyRecoup"] = output["anyRecoup"] + output[recoupType.."Recoup"]
1343-
if breakdown then
1344-
if output[recoupType.."RecoveryRateMod"] ~= 1 then
1345-
breakdown[recoupType.."Recoup"] = {
1346-
s_format("%d%% ^8(base)", baseRecoup),
1347-
s_format("* %.2f ^8(recovery rate modifier)", output[recoupType.."RecoveryRateMod"]),
1348-
s_format("= %.1f%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1349-
}
1350-
else
1351-
breakdown[recoupType.."Recoup"] = { s_format("%d%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1355+
if recoupType == "Life" and modDB:Flag(nil, "EnergyShieldRecoupInsteadOfLife") then
1356+
output.LifeRecoup = 0
1357+
local lifeRecoup = modDB:Sum("BASE", nil, "LifeRecoup")
1358+
modDB:NewMod("EnergyShieldRecoup", "BASE", lifeRecoup, "Life Recoup Conversion")
1359+
else
1360+
output[recoupType.."Recoup"] = baseRecoup * output[recoupType.."RecoveryRateMod"]
1361+
output["anyRecoup"] = output["anyRecoup"] + output[recoupType.."Recoup"]
1362+
if breakdown then
1363+
if output[recoupType.."RecoveryRateMod"] ~= 1 then
1364+
breakdown[recoupType.."Recoup"] = {
1365+
s_format("%d%% ^8(base)", baseRecoup),
1366+
s_format("* %.2f ^8(recovery rate modifier)", output[recoupType.."RecoveryRateMod"]),
1367+
s_format("= %.1f%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1368+
}
1369+
else
1370+
breakdown[recoupType.."Recoup"] = { s_format("%d%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1371+
end
13521372
end
13531373
end
13541374
end
13551375

13561376
if modDB:Flag(nil, "UsePowerCharges") and modDB:Flag(nil, "PowerChargesConvertToAbsorptionCharges") then
13571377
local ElementalEnergyShieldRecoupPerAbsorptionCharges = modDB:Sum("BASE", nil, "PerAbsorptionElementalEnergyShieldRecoup")
1358-
modDB:NewMod("ElementalEnergyShieldRecoup", "BASE", ElementalEnergyShieldRecoupPerAbsorptionCharges, "Absorption Charges", { type = "Multiplier", var = "AbsorptionCharge" } )
1359-
end
1360-
local ElementalEnergyShieldRecoup = modDB:Sum("BASE", nil, "ElementalEnergyShieldRecoup")
1361-
output.ElementalEnergyShieldRecoup = ElementalEnergyShieldRecoup * output.EnergyShieldRecoveryRateMod
1362-
output["anyRecoup"] = output["anyRecoup"] + output.ElementalEnergyShieldRecoup
1363-
if breakdown then
1364-
if output.EnergyShieldRecoveryRateMod ~= 1 then
1365-
breakdown.ElementalEnergyShieldRecoup = {
1366-
s_format("%d%% ^8(base)", ElementalEnergyShieldRecoup),
1367-
s_format("* %.2f ^8(recovery rate modifier)", output.EnergyShieldRecoveryRateMod),
1368-
s_format("= %.1f%% over %d seconds", output.ElementalEnergyShieldRecoup, (modDB:Flag(nil, "3SecondEnergyShieldRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1369-
}
1370-
else
1371-
breakdown.ElementalEnergyShieldRecoup = { s_format("%d%% over %d seconds", output.ElementalEnergyShieldRecoup, (modDB:Flag(nil, "3SecondEnergyShieldRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1372-
end
1378+
modDB:NewMod("ColdEnergyShieldRecoup", "BASE", ElementalEnergyShieldRecoupPerAbsorptionCharges, "Absorption Charges", { type = "Multiplier", var = "AbsorptionCharge" } )
1379+
modDB:NewMod("FireEnergyShieldRecoup", "BASE", ElementalEnergyShieldRecoupPerAbsorptionCharges, "Absorption Charges", { type = "Multiplier", var = "AbsorptionCharge" } )
1380+
modDB:NewMod("LightningEnergyShieldRecoup", "BASE", ElementalEnergyShieldRecoupPerAbsorptionCharges, "Absorption Charges", { type = "Multiplier", var = "AbsorptionCharge" } )
13731381
end
1374-
1375-
for _, damageType in ipairs(dmgTypeList) do
1376-
local LifeRecoup = modDB:Sum("BASE", nil, damageType.."LifeRecoup")
1377-
output[damageType.."LifeRecoup"] = LifeRecoup * output.LifeRecoveryRateMod
1378-
output["anyRecoup"] = output["anyRecoup"] + output[damageType.."LifeRecoup"]
1379-
if breakdown then
1380-
if output.LifeRecoveryRateMod ~= 1 then
1381-
breakdown[damageType.."LifeRecoup"] = {
1382-
s_format("%d%% ^8(base)", LifeRecoup),
1383-
s_format("* %.2f ^8(recovery rate modifier)", output.LifeRecoveryRateMod),
1384-
s_format("= %.1f%% over %d seconds", output[damageType.."LifeRecoup"], (modDB:Flag(nil, "3SecondLifeRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1385-
}
1382+
1383+
for _, recoupType in ipairs(recoupTypeList) do
1384+
for _, damageType in ipairs(dmgTypeList) do
1385+
if recoupType == "Life" and modDB:Flag(nil, "EnergyShieldRecoupInsteadOfLife") then
1386+
output[damageType.."LifeRecoup"] = 0
1387+
local lifeRecoup = modDB:Sum("BASE", nil, damageType.."LifeRecoup")
1388+
modDB:NewMod(damageType.."EnergyShieldRecoup", "BASE", lifeRecoup, "Life Recoup Conversion")
13861389
else
1387-
breakdown[damageType.."LifeRecoup"] = { s_format("%d%% over %d seconds", output[damageType.."LifeRecoup"], (modDB:Flag(nil, "3SecondLifeRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1390+
local recoup = modDB:Sum("BASE", nil, damageType..recoupType.."Recoup")
1391+
output[damageType..recoupType.."Recoup"] = recoup * output[recoupType.."RecoveryRateMod"]
1392+
output["anyRecoup"] = output["anyRecoup"] + output[damageType..recoupType.."Recoup"]
1393+
if breakdown then
1394+
if output[recoupType.."RecoveryRateMod"] ~= 1 then
1395+
breakdown[damageType..recoupType.."Recoup"] = {
1396+
s_format("%d%% ^8(base)", recoup),
1397+
s_format("* %.2f ^8(recovery rate modifier)", output[recoupType.."RecoveryRateMod"]),
1398+
s_format("= %.1f%% over %d seconds", output[damageType..recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1399+
}
1400+
else
1401+
breakdown[damageType..recoupType.."Recoup"] = { s_format("%d%% over %d seconds", output[damageType..recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1402+
end
1403+
end
13881404
end
13891405
end
13901406
end
@@ -2562,11 +2578,14 @@ function calcs.buildDefenceEstimations(env, actor)
25622578
Damage[damageType] = damage > 0 and damage * iterationMultiplier * VaalArcticArmourMultiplier or nil
25632579
damageTotal = damageTotal + damage
25642580
end
2565-
if (DamageIn.GainWhenHit or DamageIn.MissingLifeBeforeEnemyHit) and (iterationMultiplier > 1 or DamageIn["cycles"] > 1) then
2581+
if (DamageIn.GainWhenHit or DamageIn.MissingLifeBeforeEnemyHit or DamageIn.MissingManaBeforeEnemyHit) and (iterationMultiplier > 1 or DamageIn["cycles"] > 1) then
25662582
local gainMult = iterationMultiplier * DamageIn["cycles"]
25672583
if DamageIn.MissingLifeBeforeEnemyHit then
25682584
poolTable.Life = m_min(poolTable.Life + DamageIn.MissingLifeBeforeEnemyHit * ((output.LifeUnreserved or 0) - poolTable.Life) * (gainMult - 1) / 100, gainMult * output.LifeRecoverable or 0)
25692585
end
2586+
if DamageIn.MissingManaBeforeEnemyHit then
2587+
poolTable.Mana = m_min(poolTable.Mana + DamageIn.MissingManaBeforeEnemyHit * ((output.ManaUnreserved or 0) - poolTable.Mana) * (gainMult - 1) / 100, gainMult * (output.ManaUnreserved or 0))
2588+
end
25702589
if DamageIn.GainWhenHit then
25712590
poolTable.Life = m_min(poolTable.Life + DamageIn.LifeWhenHit * (gainMult - 1), gainMult * (output.LifeRecoverable or 0))
25722591
poolTable.Mana = m_min(poolTable.Mana + DamageIn.ManaWhenHit * (gainMult - 1), gainMult * (output.ManaUnreserved or 0))
@@ -2576,6 +2595,9 @@ function calcs.buildDefenceEstimations(env, actor)
25762595
if DamageIn.MissingLifeBeforeEnemyHit and poolTable.Life > 0 then
25772596
poolTable.Life = m_min(poolTable.Life + DamageIn.MissingLifeBeforeEnemyHit * ((output.LifeUnreserved or 0) - poolTable.Life) / 100, output.LifeRecoverable or 0)
25782597
end
2598+
if DamageIn.MissingManaBeforeEnemyHit and poolTable.Mana > 0 then
2599+
poolTable.Mana = m_min(poolTable.Mana + DamageIn.MissingManaBeforeEnemyHit * ((output.ManaUnreserved or 0) - poolTable.Mana) / 100, output.ManaUnreserved or 0)
2600+
end
25792601
poolTable = calcs.reducePoolsByDamage(poolTable, Damage, actor)
25802602

25812603
-- If still living and the amount of damage exceeds maximum threshold we survived infinite number of hits.
@@ -2696,7 +2718,8 @@ function calcs.buildDefenceEstimations(env, actor)
26962718
-- gain when hit (currently just gain on block/suppress, and Defiance of Destiny)
26972719
if not env.configInput.DisableEHPGainOnBlock and (output["NumberOfDamagingHits"] > 1) then
26982720
DamageIn.MissingLifeBeforeEnemyHit = modDB:Sum("BASE", nil, "MissingLifeBeforeEnemyHit")
2699-
if (DamageIn.LifeWhenHit or 0) ~= 0 or (DamageIn.ManaWhenHit or 0) ~= 0 or DamageIn.EnergyShieldWhenHit ~= 0 or DamageIn.MissingLifeBeforeEnemyHit ~= 0 then
2721+
DamageIn.MissingManaBeforeEnemyHit = modDB:Sum("BASE", nil, "MissingManaBeforeEnemyHit")
2722+
if (DamageIn.LifeWhenHit or 0) ~= 0 or (DamageIn.ManaWhenHit or 0) ~= 0 or DamageIn.EnergyShieldWhenHit ~= 0 or DamageIn.MissingLifeBeforeEnemyHit ~= 0 or DamageIn.MissingManaBeforeEnemyHit ~= 0 then
27002723
DamageIn.GainWhenHit = true
27012724
end
27022725
else

src/Modules/CalcOffence.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ function calcs.offence(env, actor, activeSkill)
603603
end
604604
end
605605
end
606-
if skillModList:Flag(nil, "SpellDamageAppliesToAttacks") then
606+
if skillModList:Flag(nil, "SpellDamageAppliesToAttacks") or skillModList:Flag(skillCfg, "SpellDamageAppliesToAttacks") then
607607
-- Spell Damage conversion from Crown of Eyes, Kinetic Bolt, and the Wandslinger notable
608608
local multiplier = (skillModList:Max(skillCfg, "ImprovedSpellDamageAppliesToAttacks") or 100) / 100
609609
for i, value in ipairs(skillModList:Tabulate("INC", { flags = ModFlag.Spell }, "Damage")) do

0 commit comments

Comments
 (0)