diff --git a/spec/System/TestDefence_spec.lua b/spec/System/TestDefence_spec.lua index c9f733a970..e03890fd60 100644 --- a/spec/System/TestDefence_spec.lua +++ b/spec/System/TestDefence_spec.lua @@ -601,4 +601,45 @@ describe("TestDefence", function() assert.are.equals(0, round(poolsRemaining.Life)) assert.are.equals(1000, round(poolsRemaining.Mana)) end) + + it("energy shield bypass tests #pet", function() + -- Negative overrides positive + build.configTab.input.customMods = [[ + +40 to maximum life + +100 to energy shield + Chaos damage does not bypass energy shield + You have no intelligence + +60% to all resistances + ]] + build.configTab:BuildModList() + runCallback("OnFrame") + assert.are.equals(200, build.calcsTab.calcsOutput.FireMaximumHitTaken) + assert.are.equals(200, build.calcsTab.calcsOutput.ChaosMaximumHitTaken) + -- Chaos damage should still bypass + build.configTab.input.customMods = build.configTab.input.customMods .. "\nAll damage taken bypasses energy shield" + build.configTab:BuildModList() + runCallback("OnFrame") + assert.are.equals(100, build.calcsTab.calcsOutput.FireMaximumHitTaken) + assert.are.equals(100, build.calcsTab.calcsOutput.ChaosMaximumHitTaken) + + -- Make sure we can't reach over 100% bypass + build.configTab.input.customMods = [[ + +40 to maximum life + +100 to energy shield + Chaos damage does not bypass energy shield + 50% of chaos damage taken does not bypass energy shield + You have no intelligence + +60% to all resistances + ]] + build.configTab:BuildModList() + runCallback("OnFrame") + assert.are.equals(200, build.calcsTab.calcsOutput.FireMaximumHitTaken) + assert.are.equals(200, build.calcsTab.calcsOutput.ChaosMaximumHitTaken) + -- Chaos damage should still bypass + build.configTab.input.customMods = build.configTab.input.customMods .. "\nAll damage taken bypasses energy shield" + build.configTab:BuildModList() + runCallback("OnFrame") + assert.are.equals(100, build.calcsTab.calcsOutput.FireMaximumHitTaken) + assert.are.equals(100, build.calcsTab.calcsOutput.ChaosMaximumHitTaken) + end) end) \ No newline at end of file diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 2cbb3df174..bb06b8c1b8 100644 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -6467,7 +6467,7 @@ c["All Damage can Shock"]={{[1]={flags=0,keywordFlags=0,name="PhysicalCanShock", c["All Damage from Hits with This Weapon can Poison"]={{[1]={[1]={type="Condition",var="{Hand}Attack"},[2]={skillType=1,type="SkillType"},flags=0,keywordFlags=0,name="FireCanPoison",type="FLAG",value=true},[2]={[1]={type="Condition",var="{Hand}Attack"},[2]={skillType=1,type="SkillType"},flags=0,keywordFlags=0,name="ColdCanPoison",type="FLAG",value=true},[3]={[1]={type="Condition",var="{Hand}Attack"},[2]={skillType=1,type="SkillType"},flags=0,keywordFlags=0,name="LightningCanPoison",type="FLAG",value=true}},nil} c["All Damage inflicts Poison against Enemies affected by at least 3 Grasping Vines"]={{[1]={[1]={threshold=3,type="MultiplierThreshold",var="GraspingVinesAffectingEnemy"},flags=0,keywordFlags=0,name="PoisonChance",type="BASE",value=100},[2]={[1]={threshold=3,type="MultiplierThreshold",var="GraspingVinesAffectingEnemy"},flags=0,keywordFlags=0,name="FireCanPoison",type="FLAG",value=true},[3]={[1]={threshold=3,type="MultiplierThreshold",var="GraspingVinesAffectingEnemy"},flags=0,keywordFlags=0,name="ColdCanPoison",type="FLAG",value=true},[4]={[1]={threshold=3,type="MultiplierThreshold",var="GraspingVinesAffectingEnemy"},flags=0,keywordFlags=0,name="LightningCanPoison",type="FLAG",value=true}},nil} c["All Damage inflicts Poison while affected by Glorious Madness"]={{[1]={[1]={type="Condition",var="AffectedByGloriousMadness"},flags=0,keywordFlags=0,name="PoisonChance",type="BASE",value=100},[2]={[1]={type="Condition",var="AffectedByGloriousMadness"},flags=0,keywordFlags=0,name="FireCanPoison",type="FLAG",value=true},[3]={[1]={type="Condition",var="AffectedByGloriousMadness"},flags=0,keywordFlags=0,name="ColdCanPoison",type="FLAG",value=true},[4]={[1]={type="Condition",var="AffectedByGloriousMadness"},flags=0,keywordFlags=0,name="LightningCanPoison",type="FLAG",value=true}},nil} -c["All Damage taken bypasses Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="PhysicalEnergyShieldBypass",type="BASE",value=100},[2]={flags=0,keywordFlags=0,name="LightningEnergyShieldBypass",type="BASE",value=100},[3]={flags=0,keywordFlags=0,name="ColdEnergyShieldBypass",type="BASE",value=100},[4]={flags=0,keywordFlags=0,name="FireEnergyShieldBypass",type="BASE",value=100}},nil} +c["All Damage taken bypasses Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="PhysicalEnergyShieldBypass",type="OVERRIDE",value=100},[2]={flags=0,keywordFlags=0,name="LightningEnergyShieldBypass",type="OVERRIDE",value=100},[3]={flags=0,keywordFlags=0,name="ColdEnergyShieldBypass",type="OVERRIDE",value=100},[4]={flags=0,keywordFlags=0,name="FireEnergyShieldBypass",type="OVERRIDE",value=100},[5]={flags=0,keywordFlags=0,name="ChaosEnergyShieldBypass",type="OVERRIDE",value=100}},nil} c["All Damage with Hits can Chill"]={{[1]={flags=0,keywordFlags=0,name="PhysicalCanChill",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="FireCanChill",type="FLAG",value=true},[3]={flags=0,keywordFlags=0,name="LightningCanChill",type="FLAG",value=true},[4]={flags=0,keywordFlags=0,name="ChaosCanChill",type="FLAG",value=true}},nil} c["All Damage with Maces and Sceptres inflicts Chill"]={{[1]={[1]={type="Condition",var="UsingMace"},flags=0,keywordFlags=0,name="PhysicalCanChill",type="FLAG",value=true},[2]={[1]={type="Condition",var="UsingMace"},flags=0,keywordFlags=0,name="LightningCanChill",type="FLAG",value=true},[3]={[1]={type="Condition",var="UsingMace"},flags=0,keywordFlags=0,name="FireCanChill",type="FLAG",value=true},[4]={[1]={type="Condition",var="UsingMace"},flags=0,keywordFlags=0,name="ChaosCanChill",type="FLAG",value=true}},nil} c["All Elemental Damage Converted to Chaos Damage"]={{[1]={flags=0,keywordFlags=0,name="ColdDamageConvertToChaos",type="BASE",value=100},[2]={flags=0,keywordFlags=0,name="FireDamageConvertToChaos",type="BASE",value=100},[3]={flags=0,keywordFlags=0,name="LightningDamageConvertToChaos",type="BASE",value=100}},nil} @@ -7389,10 +7389,8 @@ c["Damage of Enemies Hitting you is Unlucky while you are on Full Life"]={nil,"D c["Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped"]={nil,"Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped "} c["Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped You are Hexproof if you have a Magic Ring in right slot"]={nil,"Damage of Enemies Hitting you is Unlucky while you have a Magic Ring Equipped You are Hexproof if you have a Magic Ring in right slot "} c["Damage of Hits against you is Lucky"]={nil,"Damage of Hits is Lucky "} -c["Damage taken from Blocked Hits cannot bypass Energy Shield"]={nil,"Damage taken from Blocked Hits cannot bypass Energy Shield "} -c["Damage taken from Blocked Hits cannot bypass Energy Shield Damage taken from Unblocked hits always bypasses Energy Shield"]={nil,"Damage taken from Blocked Hits cannot bypass Energy Shield Damage taken from Unblocked hits always bypasses Energy Shield "} -c["Damage taken from Unblocked hits always bypasses Energy Shield"]={nil,"Damage taken from Unblocked hits always bypasses Energy Shield "} -c["Damage taken from Unblocked hits always bypasses Energy Shield Glancing Blows"]={nil,"Damage taken from Unblocked hits always bypasses Energy Shield Glancing Blows "} +c["Damage taken from Blocked Hits cannot bypass Energy Shield"]={{[1]={[1]={neg=true,type="Condition",var="EVBypass"},flags=0,keywordFlags=0,name="BlockedDamageDoesntBypassES",type="FLAG",value=true}},nil} +c["Damage taken from Unblocked hits always bypasses Energy Shield"]={{[1]={[1]={neg=true,type="Condition",var="EVBypass"},flags=0,keywordFlags=0,name="UnblockedDamageDoesBypassES",type="FLAG",value=true}},nil} c["Damage to Surrounding Targets"]={nil,"Damage to Surrounding Targets "} c["Damage with Hits from Socketed Vaal Skills is Lucky"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},[2]={skillType=42,type="SkillType"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={flags=0,keywordFlags=0,name="LuckyHits",type="FLAG",value=true}}}},nil} c["Damage with Weapons Penetrates 2% Elemental Resistances"]={{[1]={flags=8192,keywordFlags=0,name="ElementalPenetration",type="BASE",value=2}},nil} diff --git a/src/Modules/CalcDefence.lua b/src/Modules/CalcDefence.lua index f80b8e1019..9602f367da 100644 --- a/src/Modules/CalcDefence.lua +++ b/src/Modules/CalcDefence.lua @@ -1886,7 +1886,7 @@ function calcs.buildDefenceEstimations(env, actor) output[damageType.."EnergyShieldBypass"] = 100 output.AnyBypass = true else - output[damageType.."EnergyShieldBypass"] = modDB:Sum("BASE", nil, damageType.."EnergyShieldBypass") or 0 + output[damageType.."EnergyShieldBypass"] = m_max(modDB:Sum("BASE", nil, damageType.."EnergyShieldBypass") or 0, modDB:Sum("OVERRIDE", nil, damageType.."EnergyShieldBypass") or 0) if output[damageType.."EnergyShieldBypass"] ~= 0 then output.AnyBypass = true end diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 9ea0595026..fb4772ab9c 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -2065,10 +2065,11 @@ local specialModList = { ["gain no inherent bonuses from dexterity"] = { flag("NoDexterityAttributeBonuses") }, ["gain no inherent bonuses from intelligence"] = { flag("NoIntelligenceAttributeBonuses") }, ["all damage taken bypasses energy shield"] = { - mod("PhysicalEnergyShieldBypass", "BASE", 100), - mod("LightningEnergyShieldBypass", "BASE", 100), - mod("ColdEnergyShieldBypass", "BASE", 100), - mod("FireEnergyShieldBypass", "BASE", 100), + mod("PhysicalEnergyShieldBypass", "OVERRIDE", 100), + mod("LightningEnergyShieldBypass", "OVERRIDE", 100), + mod("ColdEnergyShieldBypass", "OVERRIDE", 100), + mod("FireEnergyShieldBypass", "OVERRIDE", 100), + mod("ChaosEnergyShieldBypass", "OVERRIDE", 100), -- Allows override of "chaos damage does not bypass energy shield" and similar mods }, ["physical damage taken bypasses energy shield"] = { mod("PhysicalEnergyShieldBypass", "BASE", 100), @@ -3913,8 +3914,8 @@ local specialModList = { ["cannot block spells"] = { flag("CannotBlockSpells") }, ["cannot block spell damage"] = { flag("CannotBlockSpells") }, ["monsters cannot block your attacks"] = { mod("EnemyModifier", "LIST", { mod = flag("CannotBlockAttacks") }) }, - ["damage from blocked hits cannot bypass energy shield"] = { flag("BlockedDamageDoesntBypassES", { type = "Condition", var = "EVBypass", neg = true }) }, - ["damage from unblocked hits always bypasses energy shield"] = { flag("UnblockedDamageDoesBypassES", { type = "Condition", var = "EVBypass", neg = true }) }, + ["damage t?a?k?e?n? from blocked hits cannot bypass energy shield"] = { flag("BlockedDamageDoesntBypassES", { type = "Condition", var = "EVBypass", neg = true }) }, + ["damage t?a?k?e?n? from unblocked hits always bypasses energy shield"] = { flag("UnblockedDamageDoesBypassES", { type = "Condition", var = "EVBypass", neg = true }) }, ["recover (%d+) life when you block"] = function(num) return { mod("LifeOnBlock", "BASE", num) } end, ["recover (%d+) energy shield when you block spell damage"] = function(num) return { mod("EnergyShieldOnSpellBlock", "BASE", num) } end, ["recover (%d+) energy shield when you suppress spell damage"] = function(num) return { mod("EnergyShieldOnSuppress", "BASE", num) } end,