Skip to content

Commit 82d20ab

Browse files
author
LocalIdentity
committed
Celestial Mathematics + The Unbreaking Circle + unbroken ward mods
Adds support for Celestial Mathematics cold damage gain mod While you have Unbroken Ward, your next non-channelling Attack you Use yourself breaks your Ward to gain Added Cold Damage equal to 25% of Ward Applies automatically if you have the iron flask with enough flask charges gained on break or can override with a config option Added eHP calcs for the chance for Ward to not break mod Adds support for remaining timeless jewel mods +2 to Ward per 10 Armour on Equipped Helmet +4 to Ward per 10 Evasion Rating on Equipped Gloves +8 to Ward per 10 Energy Shield on Equipped Boots 12% increased effect of Non-Curse Auras from your skills while your Ward is Broken 30% increased Armour while you have Unbroken Ward 30% increased Damage while you have Unbroken Ward 30% increased Evasion Rating while you have Unbroken Ward 50% less Damage Taken from Damage over Time while you have Unbroken Ward Damage Penetrates 8% Elemental Resistances while your Ward is Broken
1 parent ecad556 commit 82d20ab

5 files changed

Lines changed: 74 additions & 26 deletions

File tree

spec/System/TestDefence_spec.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,28 @@ describe("TestDefence", function()
378378
assert.are.equals(15, build.calcsTab.calcsOutput.LightningResistOverCap)
379379
end)
380380

381+
it("ward chance to not break increases effective hit pool", function()
382+
build.configTab.input.enemyIsBoss = "None"
383+
build.configTab.input.customMods = "\z
384+
+940 to maximum life\n\z
385+
+200 to Ward\n\z
386+
"
387+
build.configTab:BuildModList()
388+
runCallback("OnFrame")
389+
assert.are.equals(987, build.calcsTab.calcsOutput.TotalEHP)
390+
assert.are.equals(1200, build.calcsTab.calcsOutput.PhysicalMaximumHitTaken)
391+
392+
build.configTab.input.customMods = "\z
393+
+940 to maximum life\n\z
394+
+200 to Ward\n\z
395+
Ward has a 50% chance to not Break\n\z
396+
"
397+
build.configTab:BuildModList()
398+
runCallback("OnFrame")
399+
assert.are.equals(994, build.calcsTab.calcsOutput.TotalEHP)
400+
assert.are.equals(1200, build.calcsTab.calcsOutput.PhysicalMaximumHitTaken)
401+
end)
402+
381403
-- fun part
382404
it("armoured max hits", function()
383405
build.configTab.input.enemyIsBoss = "None"

src/Data/ModCache.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ c["+2 to Maximum Life per 10 Dexterity"]={{[1]={[1]={div=10,stat="Dex",type="Per
623623
c["+2 to Maximum Life per 10 Intelligence"]={{[1]={[1]={div=10,stat="Int",type="PerStat"},flags=0,keywordFlags=0,name="Life",type="BASE",value=2}},nil}
624624
c["+2 to Maximum Power Charges"]={{[1]={flags=0,keywordFlags=0,name="PowerChargesMax",type="BASE",value=2}},nil}
625625
c["+2 to Maximum Rage"]={{[1]={flags=0,keywordFlags=0,name="MaximumRage",type="BASE",value=2}},nil}
626-
c["+2 to Ward per 10 Armour on Equipped Helmet"]={{[1]={[1]={div=10,stat="Armour",type="PerStat"},flags=0,keywordFlags=0,name="Ward",type="BASE",value=2}}," on Equipped Helmet "}
626+
c["+2 to Ward per 10 Armour on Equipped Helmet"]={{[1]={[1]={div=10,stat="ArmourOnHelmet",type="PerStat"},flags=0,keywordFlags=0,name="Ward",type="BASE",value=2}},nil}
627627
c["+2 to Weapon Range"]={{[1]={flags=0,keywordFlags=0,name="WeaponRange",type="BASE",value=2}},nil}
628628
c["+2 to maximum Snipe Stages"]={{[1]={[1]={effectType="Buff",type="GlobalEffect",unscalable=true},flags=0,keywordFlags=0,name="Multiplier:SnipeStagesMax",type="BASE",value=2}},nil}
629629
c["+2 to maximum number of Raised Zombies"]={{[1]={flags=0,keywordFlags=0,name="ActiveZombieLimit",type="BASE",value=2}},nil}
@@ -1356,7 +1356,7 @@ c["+4 to Level of all Spell Skill Gems"]={{[1]={flags=0,keywordFlags=0,name="Gem
13561356
c["+4 to Maximum Fanatic Charges"]={{}," Maximum Fanatic Charges "}
13571357
c["+4 to Minimum Endurance Charges"]={{[1]={flags=0,keywordFlags=0,name="EnduranceChargesMin",type="BASE",value=4}},nil}
13581358
c["+4 to Minimum Power Charges"]={{[1]={flags=0,keywordFlags=0,name="PowerChargesMin",type="BASE",value=4}},nil}
1359-
c["+4 to Ward per 10 Evasion Rating on Equipped Gloves"]={{[1]={[1]={div=10,stat="Evasion",type="PerStat"},flags=0,keywordFlags=0,name="Ward",type="BASE",value=4}}," on Equipped Gloves "}
1359+
c["+4 to Ward per 10 Evasion Rating on Equipped Gloves"]={{[1]={[1]={div=10,stat="EvasionOnGloves",type="PerStat"},flags=0,keywordFlags=0,name="Ward",type="BASE",value=4}},nil}
13601360
c["+4 to all Attributes"]={{[1]={flags=0,keywordFlags=0,name="Str",type="BASE",value=4},[2]={flags=0,keywordFlags=0,name="Dex",type="BASE",value=4},[3]={flags=0,keywordFlags=0,name="Int",type="BASE",value=4},[4]={flags=0,keywordFlags=0,name="All",type="BASE",value=4}},nil}
13611361
c["+4 to maximum number of Summoned Totems"]={{[1]={flags=0,keywordFlags=0,name="ActiveTotemLimit",type="BASE",value=4}},nil}
13621362
c["+4% Chance to Block"]={{[1]={flags=0,keywordFlags=0,name="BlockChance",type="BASE",value=4}},nil}
@@ -1703,7 +1703,7 @@ c["+8 to Intelligence"]={{[1]={flags=0,keywordFlags=0,name="Int",type="BASE",val
17031703
c["+8 to Level of Socketed Gems"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="GemProperty",type="LIST",value={key="level",keyword="all",value=8}}},nil}
17041704
c["+8 to Minimum Rage"]={{[1]={flags=0,keywordFlags=0,name="MinimumRage",type="BASE",value=8}},nil}
17051705
c["+8 to Strength"]={{[1]={flags=0,keywordFlags=0,name="Str",type="BASE",value=8}},nil}
1706-
c["+8 to Ward per 10 Energy Shield on Equipped Boots"]={{[1]={flags=0,keywordFlags=0,name="Ward",type="BASE",value=8}}," per 10 Energy Shield on Equipped Boots "}
1706+
c["+8 to Ward per 10 Energy Shield on Equipped Boots"]={{[1]={[1]={div=10,stat="EnergyShieldOnBoots",type="PerStat"},flags=0,keywordFlags=0,name="Ward",type="BASE",value=8}},nil}
17071707
c["+8 to all Attributes"]={{[1]={flags=0,keywordFlags=0,name="Str",type="BASE",value=8},[2]={flags=0,keywordFlags=0,name="Dex",type="BASE",value=8},[3]={flags=0,keywordFlags=0,name="Int",type="BASE",value=8},[4]={flags=0,keywordFlags=0,name="All",type="BASE",value=8}},nil}
17081708
c["+8% Chance to Block"]={{[1]={flags=0,keywordFlags=0,name="BlockChance",type="BASE",value=8}},nil}
17091709
c["+8% Chance to Block Attack Damage"]={{[1]={flags=0,keywordFlags=0,name="BlockChance",type="BASE",value=8}},nil}
@@ -3015,7 +3015,7 @@ c["12% increased Warcry Cooldown Recovery Rate"]={{[1]={flags=0,keywordFlags=4,n
30153015
c["12% increased Warcry Duration"]={{[1]={flags=0,keywordFlags=4,name="Duration",type="INC",value=12}},nil}
30163016
c["12% increased Ward"]={{[1]={flags=0,keywordFlags=0,name="Ward",type="INC",value=12}},nil}
30173017
c["12% increased effect of Non-Curse Auras from your Skills"]={{[1]={[1]={skillType=43,type="SkillType"},[2]={neg=true,skillType=79,type="SkillType"},flags=0,keywordFlags=0,name="AuraEffect",type="INC",value=12}},nil}
3018-
c["12% increased effect of Non-Curse Auras from your skills while your Ward is Broken"]={{[1]={[1]={skillType=43,type="SkillType"},[2]={neg=true,skillType=79,type="SkillType"},flags=0,keywordFlags=0,name="AuraEffect",type="INC",value=12}}," while your Ward is Broken "}
3018+
c["12% increased effect of Non-Curse Auras from your skills while your Ward is Broken"]={{[1]={[1]={skillType=43,type="SkillType"},[2]={neg=true,skillType=79,type="SkillType"},[3]={neg=true,type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="AuraEffect",type="INC",value=12}},nil}
30193019
c["12% increased maximum Energy Shield"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=12}},nil}
30203020
c["12% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=12}},nil}
30213021
c["12% increased maximum Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="INC",value=12}},nil}
@@ -4767,7 +4767,7 @@ c["30% increased Armour"]={{[1]={flags=0,keywordFlags=0,name="Armour",type="INC"
47674767
c["30% increased Armour and Evasion Rating during Onslaught"]={{[1]={[1]={type="Condition",var="Onslaught"},flags=0,keywordFlags=0,name="ArmourAndEvasion",type="INC",value=30}},nil}
47684768
c["30% increased Armour and Evasion Rating while Fortified"]={{[1]={[1]={type="Condition",var="Fortified"},flags=0,keywordFlags=0,name="ArmourAndEvasion",type="INC",value=30}},nil}
47694769
c["30% increased Armour if you have been Hit Recently"]={{[1]={[1]={type="Condition",var="BeenHitRecently"},flags=0,keywordFlags=0,name="Armour",type="INC",value=30}},nil}
4770-
c["30% increased Armour while you have Unbroken Ward"]={{[1]={flags=0,keywordFlags=0,name="Armour",type="INC",value=30}}," while you have Unbroken Ward "}
4770+
c["30% increased Armour while you have Unbroken Ward"]={{[1]={[1]={type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="Armour",type="INC",value=30}},nil}
47714771
c["30% increased Attack Critical Strike Chance while Dual Wielding"]={{[1]={[1]={type="Condition",var="DualWielding"},flags=1,keywordFlags=0,name="CritChance",type="INC",value=30}},nil}
47724772
c["30% increased Attack Damage"]={{[1]={flags=1,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
47734773
c["30% increased Attack Damage if you've been Hit Recently"]={{[1]={[1]={type="Condition",var="BeenHitRecently"},flags=1,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
@@ -4813,7 +4813,7 @@ c["30% increased Damage while Ignited"]={{[1]={[1]={type="Condition",var="Ignite
48134813
c["30% increased Damage while Leeching"]={{[1]={[1]={type="Condition",var="Leeching"},flags=0,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
48144814
c["30% increased Damage while in Blood Stance"]={{[1]={[1]={type="Condition",var="BloodStance"},flags=0,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
48154815
c["30% increased Damage while wielding a Wand"]={{[1]={[1]={type="Condition",var="UsingWand"},flags=0,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
4816-
c["30% increased Damage while you have Unbroken Ward"]={{[1]={flags=0,keywordFlags=0,name="Damage",type="INC",value=30}}," while you have Unbroken Ward "}
4816+
c["30% increased Damage while you have Unbroken Ward"]={{[1]={[1]={type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
48174817
c["30% increased Damage while you have no Energy Shield"]={{[1]={[1]={neg=true,type="Condition",var="HaveEnergyShield"},flags=0,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
48184818
c["30% increased Damage with Ailments from Attack Skills"]={{[1]={flags=2048,keywordFlags=65536,name="Damage",type="INC",value=30}},nil}
48194819
c["30% increased Damage with Bleeding"]={{[1]={flags=0,keywordFlags=4194304,name="Damage",type="INC",value=30}},nil}
@@ -4862,7 +4862,7 @@ c["30% increased Evasion Rating and Armour"]={{[1]={flags=0,keywordFlags=0,name=
48624862
c["30% increased Evasion Rating if you haven't been Hit Recently"]={{[1]={[1]={neg=true,type="Condition",var="BeenHitRecently"},flags=0,keywordFlags=0,name="Evasion",type="INC",value=30}},nil}
48634863
c["30% increased Evasion Rating while Phasing"]={{[1]={[1]={type="Condition",var="Phasing"},flags=0,keywordFlags=0,name="Evasion",type="INC",value=30}},nil}
48644864
c["30% increased Evasion Rating while you have Energy Shield"]={{[1]={[1]={type="Condition",var="HaveEnergyShield"},flags=0,keywordFlags=0,name="Evasion",type="INC",value=30}},nil}
4865-
c["30% increased Evasion Rating while you have Unbroken Ward"]={{[1]={flags=0,keywordFlags=0,name="Evasion",type="INC",value=30}}," while you have Unbroken Ward "}
4865+
c["30% increased Evasion Rating while you have Unbroken Ward"]={{[1]={[1]={type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="Evasion",type="INC",value=30}},nil}
48664866
c["30% increased Evasion Rating while you have an active Tincture"]={{[1]={[1]={type="Condition",var="UsingTincture"},flags=0,keywordFlags=0,name="Evasion",type="INC",value=30}},nil}
48674867
c["30% increased Fire Damage"]={{[1]={flags=0,keywordFlags=0,name="FireDamage",type="INC",value=30}},nil}
48684868
c["30% increased Fire Damage if you have used a Cold Skill Recently"]={{[1]={[1]={type="Condition",var="UsedColdSkillRecently"},flags=0,keywordFlags=0,name="FireDamage",type="INC",value=30}},nil}
@@ -5816,7 +5816,7 @@ c["50% increased total Recovery per second from Life Leech"]={{[1]={flags=0,keyw
58165816
c["50% less Cold Resistance"]={{[1]={flags=0,keywordFlags=0,name="ColdResist",type="MORE",value=-50}},nil}
58175817
c["50% less Critical Strike Chance"]={{[1]={flags=0,keywordFlags=0,name="CritChance",type="MORE",value=-50}},nil}
58185818
c["50% less Damage"]={{[1]={flags=0,keywordFlags=0,name="Damage",type="MORE",value=-50}},nil}
5819-
c["50% less Damage Taken from Damage over Time while you have Unbroken Ward"]={{[1]={flags=0,keywordFlags=0,name="DamageTakenOverTime",type="MORE",value=-50}}," while you have Unbroken Ward "}
5819+
c["50% less Damage Taken from Damage over Time while you have Unbroken Ward"]={{[1]={[1]={type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="DamageTakenOverTime",type="MORE",value=-50}},nil}
58205820
c["50% less Damage with Bleeding"]={{[1]={flags=0,keywordFlags=4194304,name="Damage",type="MORE",value=-50}},nil}
58215821
c["50% less Duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="MORE",value=-50}},nil}
58225822
c["50% less Duration of Ignites you inflict"]={{[1]={flags=0,keywordFlags=0,name="EnemyIgniteDuration",type="MORE",value=-50}},nil}
@@ -8189,7 +8189,7 @@ c["Damage Penetrates 6% Lightning Resistance"]={{[1]={flags=0,keywordFlags=0,nam
81898189
c["Damage Penetrates 6% Lightning Resistance during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="LightningPenetration",type="BASE",value=6}},nil}
81908190
c["Damage Penetrates 6% of Enemy Elemental Resistances"]={{[1]={flags=0,keywordFlags=0,name="ElementalPenetration",type="BASE",value=6}},nil}
81918191
c["Damage Penetrates 7% Chaos Resistance"]={{[1]={flags=0,keywordFlags=0,name="ChaosPenetration",type="BASE",value=7}},nil}
8192-
c["Damage Penetrates 8% Elemental Resistances while your Ward is Broken"]={{[1]={flags=0,keywordFlags=0,name="ElementalPenetration",type="BASE",value=8}}," while your Ward is Broken "}
8192+
c["Damage Penetrates 8% Elemental Resistances while your Ward is Broken"]={{[1]={[1]={neg=true,type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="ElementalPenetration",type="BASE",value=8}},nil}
81938193
c["Damage Penetrates 8% Lightning Resistance"]={{[1]={flags=0,keywordFlags=0,name="LightningPenetration",type="BASE",value=8}},nil}
81948194
c["Damage Penetrates 8% of Enemy Elemental Resistances"]={{[1]={flags=0,keywordFlags=0,name="ElementalPenetration",type="BASE",value=8}},nil}
81958195
c["Damage Penetrates 9% Elemental Resistances while you are Chilled"]={{[1]={[1]={type="Condition",var="Chilled"},flags=0,keywordFlags=0,name="ElementalPenetration",type="BASE",value=9}},nil}
@@ -12339,8 +12339,8 @@ c["Warcry Skills have 30% increased Area of Effect"]={{[1]={[1]={skillType=73,ty
1233912339
c["Warcry Skills have 35% increased Area of Effect"]={{[1]={[1]={skillType=73,type="SkillType"},flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=35}},nil}
1234012340
c["Warcry Skills have 40% increased Area of Effect"]={{[1]={[1]={skillType=73,type="SkillType"},flags=0,keywordFlags=0,name="AreaOfEffect",type="INC",value=40}},nil}
1234112341
c["Warcry Skills' Cooldown Time is 4 seconds"]={{[1]={flags=0,keywordFlags=4,name="CooldownRecovery",type="OVERRIDE",value=4}},nil}
12342-
c["Ward does not Break during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="WardNotBreak",type="FLAG",value=true}},nil}
12343-
c["Ward has a 60% chance to not Break"]={nil,"Ward has a 60% chance to not Break "}
12342+
c["Ward does not Break during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="Condition:WardNotBreak",type="FLAG",value=true},[2]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="Condition:UnbrokenWard",type="FLAG",value=true}},nil}
12343+
c["Ward has a 60% chance to not Break"]={{[1]={flags=0,keywordFlags=0,name="WardAvoidBreakChance",type="BASE",value=60}},nil}
1234412344
c["Weapons you Animate create an additional copy"]={nil,"Weapons you Animate create an additional copy "}
1234512345
c["When 90% of your Hex's Duration Expires on an Enemy, Eat 1 Soul per Enemy Power"]={{[1]={flags=0,keywordFlags=0,name="Condition:CanHaveSoulEater",type="FLAG",value=true}},nil}
1234612346
c["When Hit during effect, 25% of Life loss from Damage taken occurs over 4 seconds instead"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="LifeLossPrevented",type="BASE",value=25}},nil}
@@ -12384,7 +12384,7 @@ c["While not on Full Life, Sacrifice 20% of Mana per Second to Recover that much
1238412384
c["While on Low Life, Life Flasks gain 5 Charges every 3 seconds"]={{[1]={[1]={type="Condition",var="LowLife"},flags=0,keywordFlags=0,name="LifeFlaskChargesGenerated",type="BASE",value=1.6666666666667}},nil}
1238512385
c["While on Low Life, Life Flasks gain 6 Charges every 3 seconds"]={{[1]={[1]={type="Condition",var="LowLife"},flags=0,keywordFlags=0,name="LifeFlaskChargesGenerated",type="BASE",value=2}},nil}
1238612386
c["While there are at least five nearby Allies, you and nearby Allies have Onslaught"]={{[1]={[1]={threshold=5,type="MultiplierThreshold",var="NearbyAlly"},flags=0,keywordFlags=0,name="ExtraAura",type="LIST",value={mod={flags=0,keywordFlags=0,name="Onslaught",type="FLAG",value=true}}}},nil}
12387-
c["While you have Unbroken Ward, your next non-channelling Attack you Use yourself breaks your Ward to gain Added Cold Damage equal to 25% of Ward"]={nil,"While you have Unbroken Ward, your next non-channelling Attack you Use yourself breaks your Ward to gain Added Cold Damage equal to 25% of Ward "}
12387+
c["While you have Unbroken Ward, your next non-channelling Attack you Use yourself breaks your Ward to gain Added Cold Damage equal to 25% of Ward"]={{[1]={[1]={percent=25,stat="Ward",type="PercentStat"},[2]={neg=true,skillType=57,type="SkillType"},[3]={skillType=1,type="SkillType"},[4]={neg=true,type="Condition",var="WardNotBreak"},[5]={type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="ColdMin",type="BASE",value=1},[2]={[1]={percent=25,stat="Ward",type="PercentStat"},[2]={neg=true,skillType=57,type="SkillType"},[3]={skillType=1,type="SkillType"},[4]={neg=true,type="Condition",var="WardNotBreak"},[5]={type="Condition",var="UnbrokenWard"},flags=0,keywordFlags=0,name="ColdMax",type="BASE",value=1}},nil}
1238812388
c["While your Passive Skill Tree connects to a class' starting location, you gain:"]={{},nil}
1238912389
c["Wicked Ward"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Wicked Ward"}},nil}
1239012390
c["Wind Dancer"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Wind Dancer"}},nil}

src/Modules/CalcDefence.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
215215
end
216216

217217
local ward = poolTbl.Ward or output.Ward or 0
218-
local restoreWard = modDB:Flag(nil, "WardNotBreak") and ward or 0
218+
local wardActiveChance = poolTbl.WardActiveChance or (ward > 0 and 1 or 0)
219+
local wardAvoidBreakChance = modDB:Flag(nil, "Condition:WardNotBreak") and 1 or m_min(modDB:Sum("BASE", nil, "WardAvoidBreakChance") / 100, 1)
219220

220221
local energyShield = poolTbl.EnergyShield or output.EnergyShieldRecoveryCap
221222
local mana = poolTbl.Mana or output.ManaUnreserved or 0
@@ -395,7 +396,8 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
395396
AlliesTakenBeforeYou = alliesTakenBeforeYou,
396397
Aegis = aegis,
397398
Guard = guard,
398-
Ward = m_floor(restoreWard),
399+
Ward = m_floor(ward < wardBeforeHit and (wardAvoidBreakChance > 0 and wardBeforeHit or 0) or ward),
400+
WardActiveChance = ward < wardBeforeHit and wardActiveChance * wardAvoidBreakChance or wardActiveChance,
399401
EnergyShield = m_floor(energyShield),
400402
Mana = m_floor(mana),
401403
Life = m_floor(life),
@@ -2538,15 +2540,18 @@ function calcs.buildDefenceEstimations(env, actor)
25382540
end
25392541
if numHits == 0 then
25402542
return m_huge
2541-
elseif modDB:Flag(nil, "WardNotBreak") and output.Ward > 0 and numHits < output.Ward then
2543+
end
2544+
2545+
local wardAvoidBreakChance = modDB:Flag(nil, "Condition:WardNotBreak") and 1 or m_min(modDB:Sum("BASE", nil, "WardAvoidBreakChance") / 100, 1)
2546+
if wardAvoidBreakChance == 1 and output.Ward > 0 and numHits < output.Ward then
25422547
return m_huge
25432548
else
25442549
numHits = 0
25452550
end
25462551

25472552
local ward = output.Ward or 0
25482553
-- don't apply non-perma ward for speed up calcs as it won't zero it correctly per hit
2549-
if (not modDB:Flag(nil, "WardNotBreak")) and DamageIn["cycles"] > 1 then
2554+
if wardAvoidBreakChance < 1 and DamageIn["cycles"] > 1 then
25502555
ward = 0
25512556
end
25522557
local aegis = { }
@@ -2658,7 +2663,8 @@ function calcs.buildDefenceEstimations(env, actor)
26582663
-- to speed it up, run recursively but accelerated
26592664
local speedUp = data.misc.ehpCalcSpeedUp
26602665
DamageIn["cyclesRan"] = DamageIn["cyclesRan"] or false
2661-
if not DamageIn["cyclesRan"] and poolTable.Life > 0 and DamageIn["iterations"] < maxIterations then
2666+
local wardAvoidBreakActive = wardAvoidBreakChance < 1 and (poolTable.WardActiveChance or 0) > 0.01
2667+
if not DamageIn["cyclesRan"] and not wardAvoidBreakActive and poolTable.Life > 0 and DamageIn["iterations"] < maxIterations then
26622668
Damage = { }
26632669
for _, damageType in ipairs(dmgTypeList) do
26642670
Damage[damageType] = DamageIn[damageType] * speedUp

0 commit comments

Comments
 (0)