Skip to content

Commit c148c31

Browse files
authored
Add support for Saffel's Frame "max block mods apply to max resist" (#837)
1 parent 5fbf93d commit c148c31

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/Data/ModCache.lua

+2-3
Original file line numberDiff line numberDiff line change
@@ -2986,7 +2986,7 @@ c["Minions have 8% increased Attack and Cast Speed"]={{[1]={flags=0,keywordFlags
29862986
c["Minions have 8% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="Life",type="INC",value=8}}}},nil}
29872987
c["Minions have 80% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="Life",type="INC",value=80}}}},nil}
29882988
c["Minions' Resistances are equal to yours"]={{[1]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={[1]={actor="parent",stat="FireResist",type="PerStat"},flags=0,keywordFlags=0,name="FireResist",type="OVERRIDE",value=1}}},[2]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={[1]={actor="parent",stat="ColdResist",type="PerStat"},flags=0,keywordFlags=0,name="ColdResist",type="OVERRIDE",value=1}}},[3]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={[1]={actor="parent",stat="LightningResist",type="PerStat"},flags=0,keywordFlags=0,name="LightningResist",type="OVERRIDE",value=1}}},[4]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={[1]={actor="parent",stat="ChaosResist",type="PerStat"},flags=0,keywordFlags=0,name="ChaosResist",type="OVERRIDE",value=1}}}},nil}
2989-
c["Modifiers to Maximum Block Chance instead apply to Maximum Resistances"]={nil,"Modifiers to Maximum Block Chance instead apply to Maximum Resistances "}
2989+
c["Modifiers to Maximum Block Chance instead apply to Maximum Resistances"]={{[1]={flags=0,keywordFlags=0,name="MaxBlockChanceModsApplyMaxResist",type="FLAG",value=true}},nil}
29902990
c["Moving while Bleeding doesn't cause you to take extra damage"]={nil,"Moving while Bleeding doesn't cause you to take extra damage "}
29912991
c["Nearby Allies and Enemies Share Charges with you"]={nil,"Nearby Allies and Enemies Share Charges with you "}
29922992
c["Nearby Allies and Enemies Share Charges with you Enemies Hitting you have 10% chance to gain an Endurance, "]={nil,"Nearby Allies and Enemies Share Charges with you Enemies Hitting you have 10% chance to gain an Endurance, "}
@@ -3235,8 +3235,7 @@ c["You can only Socket Ruby Jewels in this item You can only Socket Sapphire Jew
32353235
c["You can only Socket Sapphire Jewels in this item"]={nil,"You can only Socket Sapphire Jewels in this item "}
32363236
c["You can use two copies of the same Support Gem in different Skills"]={{[1]={flags=0,keywordFlags=0,name="MaxSupportGemCopies",type="OVERRIDE",value=2}},nil}
32373237
c["You can wield Two-Handed Axes, Maces and Swords in one hand"]={{[1]={flags=0,keywordFlags=0,name="GiantsBlood",type="FLAG",value=true}},nil}
3238-
c["You cannot Block"]={nil,"You cannot Block "}
3239-
c["You cannot Block Modifiers to Maximum Block Chance instead apply to Maximum Resistances"]={nil,"You cannot Block Modifiers to Maximum Block Chance instead apply to Maximum Resistances "}
3238+
c["You cannot Block"]={{[1]={flags=0,keywordFlags=0,name="CannotBlockAttacks",type="FLAG",value=true}},nil}
32403239
c["You cannot Recharge Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="NoEnergyShieldRecharge",type="FLAG",value=true}},nil}
32413240
c["You cannot be Chilled for 6 seconds after being Chilled"]={nil,"You cannot be Chilled for 6 seconds after being Chilled "}
32423241
c["You cannot be Chilled for 6 seconds after being Chilled You cannot be Frozen for 6 seconds after being Frozen"]={nil,"You cannot be Chilled for 6 seconds after being Chilled You cannot be Frozen for 6 seconds after being Frozen "}

src/Modules/CalcDefence.lua

+11-2
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,12 @@ function calcs.defence(env, actor)
755755
total = m_modf(total)
756756
-- Unnatural Resilience needs FireResistTotal before we calc FireResistMax
757757
output[elem.."ResistTotal"] = total
758-
max = modDB:Override(nil, elem.."ResistMax") or m_min(data.misc.MaxResistCap, modDB:Sum("BASE", nil, elem.."ResistMax", isElemental[elem] and "ElementalResistMax"))
758+
if modDB:Flag(nil, "MaxBlockChanceModsApplyMaxResist") then
759+
local blockMaxBonus = modDB:Sum("BASE", nil, "BlockChanceMax") - 75 -- Subtract base block cap
760+
max = (modDB:Override(nil, elem.."ResistMax") or m_min(data.misc.MaxResistCap, modDB:Sum("BASE", nil, elem.."ResistMax", isElemental[elem] and "ElementalResistMax"))) + blockMaxBonus
761+
else
762+
max = modDB:Override(nil, elem.."ResistMax") or m_min(data.misc.MaxResistCap, modDB:Sum("BASE", nil, elem.."ResistMax", isElemental[elem] and "ElementalResistMax"))
763+
end
759764

760765
dotTotal = dotTotal and m_modf(dotTotal) or total
761766
totemTotal = m_modf(totemTotal)
@@ -805,7 +810,11 @@ function calcs.defence(env, actor)
805810
end
806811

807812
-- Block
808-
output.BlockChanceMax = m_min(modDB:Sum("BASE", nil, "BlockChanceMax"), data.misc.BlockChanceCap)
813+
if modDB:Flag(nil, "MaxBlockChanceModsApplyMaxResist") then
814+
output.BlockChanceMax = 75
815+
else
816+
output.BlockChanceMax = m_min(modDB:Sum("BASE", nil, "BlockChanceMax"), data.misc.BlockChanceCap)
817+
end
809818
if modDB:Flag(nil, "MaximumBlockAttackChanceIsEqualToParent") then
810819
output.BlockChanceMax = actor.parent.output.BlockChanceMax
811820
elseif modDB:Flag(nil, "MaximumBlockAttackChanceIsEqualToPartyMember") then

src/Modules/ModParser.lua

+2
Original file line numberDiff line numberDiff line change
@@ -4280,6 +4280,8 @@ local specialModList = {
42804280
["cannot evade enemy attacks"] = { flag("CannotEvade") },
42814281
["attacks cannot hit you"] = { flag("AlwaysEvade") },
42824282
["attacks against you always hit"] = { flag("CannotEvade") },
4283+
["modifiers to maximum block chance instead apply to maximum resistances"] = { flag("MaxBlockChanceModsApplyMaxResist") },
4284+
["you cannot block"] = { flag("CannotBlockAttacks")},
42834285
["cannot block"] = { flag("CannotBlockAttacks"), flag("CannotBlockSpells") },
42844286
["cannot block while you have no energy shield"] = { flag("CannotBlockAttacks", { type = "Condition", var = "HaveEnergyShield", neg = true }), flag("CannotBlockSpells", { type = "Condition", var = "HaveEnergyShield", neg = true }) },
42854287
["cannot block attacks"] = { flag("CannotBlockAttacks") },

0 commit comments

Comments
 (0)