Skip to content

Commit cdb93a6

Browse files
Add support for Armour Break (#731)
* Add support for "against enemies with fully broken armour" * start to implement "CanBreakArmour" as pre-requisite for fully broken armour * Make "ArmourBroken" affect physical damage reduction * Rename "ArmourBroken" to "ArmourFullyBroken" for clarity * Include Override check in enemyArmour calculation of CalcOffence * Add "Armour" to Calcs section breakdown for effective DPS * Update modCache * Add support for partially broken armour * Let more nodes / gems enable armour break * Make "CanBreakArmour" global effect * Rename "CanBreakArmour" condition to "CanArmourBreak" for consistency with existing naming on Devastate Support in sup:_str * Improve config tooltip for armour break options --------- Co-authored-by: majochem <majochem@users.noreply.github.com> Co-authored-by: LocalIdentity <31035929+LocalIdentity@users.noreply.github.com>
1 parent 20efcb4 commit cdb93a6

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

src/Data/ModCache.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ c["20% increased Critical Hit Chance if you have Killed Recently"]={{[1]={[1]={t
12491249
c["20% increased Critical Hit Chance if you haven't dealt a Critical Hit Recently"]={{[1]={[1]={neg=true,type="Condition",var="CritRecently"},flags=0,keywordFlags=0,name="CritChance",type="INC",value=20}},nil}
12501250
c["20% increased Curse Duration"]={{[1]={flags=0,keywordFlags=2,name="Duration",type="INC",value=20}},nil}
12511251
c["20% increased Damage against Dazed Enemies"]={{[1]={flags=0,keywordFlags=0,name="Damage",type="INC",value=20}}," against Dazed Enemies "}
1252-
c["20% increased Damage against Enemies with Fully Broken Armour"]={{[1]={flags=0,keywordFlags=0,name="Damage",type="INC",value=20}}," against Enemies with Fully Broken Armour "}
1252+
c["20% increased Damage against Enemies with Fully Broken Armour"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="ArmourFullyBroken"},flags=0,keywordFlags=0,name="Damage",type="INC",value=20}},nil}
12531253
c["20% increased Damage for each different Warcry you've used Recently"]={{[1]={flags=0,keywordFlags=4,name="Damage",type="INC",value=20}}," for each different you've used Recently "}
12541254
c["20% increased Damage if you've dealt a Critical Hit Recently"]={{[1]={[1]={type="Condition",var="CritRecently"},flags=0,keywordFlags=0,name="Damage",type="INC",value=20}},nil}
12551255
c["20% increased Damage with Hits against Enemies that are on Full Life"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="FullLife"},flags=0,keywordFlags=262144,name="Damage",type="INC",value=20}},nil}
@@ -2090,7 +2090,7 @@ c["60% increased Armour from Equipped Body Armour"]={{[1]={[1]={slotName="Body A
20902090
c["60% increased Armour, Evasion and Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="Defences",type="INC",value=60}},nil}
20912091
c["60% increased Block chance"]={{[1]={flags=0,keywordFlags=0,name="BlockChance",type="INC",value=60}},nil}
20922092
c["60% increased Critical Damage Bonus"]={{[1]={flags=0,keywordFlags=0,name="CritMultiplier",type="INC",value=60}},nil}
2093-
c["60% increased Damage against Enemies with Fully Broken Armour"]={{[1]={flags=0,keywordFlags=0,name="Damage",type="INC",value=60}}," against Enemies with Fully Broken Armour "}
2093+
c["60% increased Damage against Enemies with Fully Broken Armour"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="ArmourFullyBroken"},flags=0,keywordFlags=0,name="Damage",type="INC",value=60}},nil}
20942094
c["60% increased Damage with Hits against Enemies that are on Low Life"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="LowLife"},flags=0,keywordFlags=262144,name="Damage",type="INC",value=60}},nil}
20952095
c["60% increased Effect of Poison you inflict on targets that are not Poisoned"]={{[1]={flags=0,keywordFlags=0,name="LocalEffect",type="INC",value=60}}," of Poison you inflict on targets that are not Poisoned "}
20962096
c["60% increased Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=60}},nil}
@@ -2400,10 +2400,10 @@ c["Break 30% increased Armour on enemies affected by Ailments +10 to Strength"]=
24002400
c["Break 30% increased Armour on enemies affected by Ailments +10 to Strength 25% increased Physical Damage"]={nil,"Break 30% increased Armour on enemies affected by Ailments +10 to Strength 25% increased Physical Damage "}
24012401
c["Break 40% increased Armour"]={nil,"Break 40% increased Armour "}
24022402
c["Break 40% increased Armour 25% increased Physical Damage"]={nil,"Break 40% increased Armour 25% increased Physical Damage "}
2403-
c["Break 50% of Armour on Heavy Stunning an Enemy"]={nil,"Break 50% of Armour on Heavy Stunning an Enemy "}
2403+
c["Break 50% of Armour on Heavy Stunning an Enemy"]={{[1]={[1]={effectName="ArmourBreak",effectType="Buff",type="GlobalEffect"},flags=0,keywordFlags=0,name="Condition:CanArmourBreak",type="FLAG",value=true}},nil}
24042404
c["Break 60% increased Armour"]={nil,"Break 60% increased Armour "}
24052405
c["Break 60% increased Armour 10% chance to Defend with 200% of Armour"]={nil,"Break 60% increased Armour 10% chance to Defend with 200% of Armour "}
2406-
c["Break Armour equal to 10% of Hit Damage dealt"]={nil,"Break Armour equal to 10% of Hit Damage dealt "}
2406+
c["Break Armour equal to 10% of Hit Damage dealt"]={{[1]={[1]={effectName="ArmourBreak",effectType="Buff",type="GlobalEffect"},flags=0,keywordFlags=0,name="Condition:CanArmourBreak",type="FLAG",value=true}},nil}
24072407
c["Break Armour on Critical Hit with Spells equal to 10% of Physical Damage dealt"]={nil,"Break Armour on Critical Hit with Spells equal to 10% of Physical Damage dealt "}
24082408
c["Break Armour on Critical Hit with Spells equal to 10% of Physical Damage dealt 10% chance to inflict Bleeding on Hit"]={nil,"Break Armour on Critical Hit with Spells equal to 10% of Physical Damage dealt 10% chance to inflict Bleeding on Hit "}
24092409
c["Break Armour on Critical Hit with Spells equal to 10% of Physical Damage dealt 10% chance to inflict Bleeding on Hit 20% increased Physical Damage"]={nil,"Break Armour on Critical Hit with Spells equal to 10% of Physical Damage dealt 10% chance to inflict Bleeding on Hit 20% increased Physical Damage "}

src/Data/SkillStatMap.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,6 +2333,12 @@ return {
23332333
["chance_to_gain_1_more_charge_%"] = {
23342334
mod("AdditionalChargeChance", "BASE", nil)
23352335
},
2336+
["apply_X_armour_break_on_hit"] = {
2337+
flag("Condition:CanArmourBreak", { type = "GlobalEffect", effectType = "Buff", effectName = "ArmourBreak" }),
2338+
},
2339+
["armour_break_physical_damage_%_dealt_as_armour_break"] = {
2340+
flag("Condition:CanArmourBreak", { type = "GlobalEffect", effectType = "Buff", effectName = "ArmourBreak" }),
2341+
},
23362342
--
23372343
-- Spectre or Minion-specific stats
23382344
--

src/Modules/CalcOffence.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3194,7 +3194,7 @@ function calcs.offence(env, actor, activeSkill)
31943194
end
31953195

31963196
if damageType == "Physical" then
3197-
local enemyArmour = m_max(calcLib.val(enemyDB, "Armour"), 0)
3197+
local enemyArmour = enemyDB:Override(nil, "Armour") or m_max(calcLib.val(enemyDB, "Armour"), 0)
31983198
local ignoreEnemyArmour = calcLib.val(enemyDB, "IgnoreArmour") -- check for mods that ignore Armour
31993199
if ignoreEnemyArmour and (enemyArmour > 0) then enemyArmour = m_max(enemyArmour - ignoreEnemyArmour, 0) end -- subtract ignored value up to zero, if Armour is still positive (to allow future support of negative Armour)
32003200
local armourReduction = calcs.armourReductionF(enemyArmour, damageTypeHitAvg * skillModList:More(cfg, "CalcArmourAsThoughDealing"))

src/Modules/ConfigOptions.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,8 +1459,15 @@ Huge sets the radius to 11.
14591459
{ var = "conditionEnemyLowLife", type = "check", label = "Is the enemy on Low ^xE05030Life?", ifEnemyCond = "LowLife", apply = function(val, modList, enemyModList)
14601460
enemyModList:NewMod("Condition:LowLife", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
14611461
end },
1462-
{ var = "conditionEnemyArmourBroken", type = "check", label = "Is the enemies Armour Broken?", ifEnemyCond = "ArmourBroken", apply = function(val, modList, enemyModList)
1463-
enemyModList:NewMod("Condition:ArmourBroken", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1462+
{ var = "conditionEnemyArmourBroken", type = "check", label = "Is enemy Armour Broken?", ifFlag = "Condition:CanArmourBreak", tooltip = "Some Skills, Items, Support Gems and other effects can Break Armour, which lowers a target's Armour by a specified amount.\nIf this brings the target's Armour value to 0, their Armour is Fully Broken for 12 seconds.", apply = function(val, modList, enemyModList)
1463+
enemyModList:NewMod("Condition:ArmourFullyBroken", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
1464+
enemyModList:NewMod("Armour", "OVERRIDE", 0, "Config", { type = "Condition", var = "ArmourFullyBroken" }, { type = "GlobalEffect", effectType= "Debuff", effectName = "ArmourBreak" })
1465+
end },
1466+
{ var = "multiplierArmourBreak", type = "count", label = "# of Broken Armour (if not maximum):", ifOption = "conditionEnemyArmourBroken", tooltip = "Use this field to set a custom Armour Break value.\nIf left empty or set to 0, Fully Broken Armour will be assumed.\nArmour cannot be broken below zero by default.", apply = function(val, modList, enemyModList)
1467+
enemyModList:NewMod("Condition:ArmourBroken", "FLAG", val > 0, "Config", { type = "Condition", var = "Effective" }) -- only activate if value > 0 is entered
1468+
enemyModList:ReplaceMod("Condition:ArmourFullyBroken", "FLAG", val < 1, "Config", { type = "Condition", var = "Effective" }) -- disable FullyBrokenArmour if value >= 1 is entered
1469+
enemyModList:NewMod("Multiplier:ArmourBreakStack", "BASE", val, "Config", { type = "Condition", var = "ArmourBroken" })
1470+
enemyModList:NewMod("Armour", "BASE", -1, "Config", { type = "Multiplier", var = "ArmourBreakStack" }, { type = "GlobalEffect", effectType= "Debuff", effectName = "ArmourBreak" })
14641471
end },
14651472
{ var = "conditionEnemyCursed", type = "check", label = "Is the enemy Cursed?", ifEnemyCond = "Cursed", tooltip = "The enemy will automatically be considered to be Cursed if you have at least one curse enabled,\nbut you can use this option to force it if necessary.", apply = function(val, modList, enemyModList)
14661473
enemyModList:NewMod("Condition:Cursed", "FLAG", true, "Config", { type = "Condition", var = "Effective" })

src/Modules/ModParser.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,7 @@ local modTagList = {
18231823
["against cursed enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Cursed" } },
18241824
["against stunned enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Stunned" } },
18251825
["against heavy stunned enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "HeavyStunned" } },
1826+
["against enemies with fully broken armour"] = { tag = { type = "ActorCondition", actor = "enemy", var = "ArmourFullyBroken" } },
18261827
["against immobilised enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Immobilised" } },
18271828
["on cursed enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Cursed" } },
18281829
["of cursed enemies'"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Cursed" } },
@@ -2820,6 +2821,8 @@ local specialModList = {
28202821
["you are unaffected by bleeding while leeching"] = { mod("SelfBleedEffect", "MORE", -100, { type = "Condition", var = "Leeching" }) },
28212822
-- Warrior - Titan
28222823
["(%d+)%% increased effect of small passive skills"] = function(num) return { mod("SmallPassiveSkillEffect", "INC", num) } end,
2824+
-- Warrior - Warbringer
2825+
["break armour equal to (%d+)%% of hit damage dealt"] = { flag("Condition:CanArmourBreak", { type = "GlobalEffect", effectType = "Buff", effectName = "ArmourBreak" })}, -- 'Anvil's Weight'
28232826
-- Trickster
28242827
["(%d+)%% chance to gain (%d+)%% of non%-chaos damage with hits as extra chaos damage"] = function(num, _, perc) return { mod("NonChaosDamageGainAsChaos", "BASE", num / 100 * tonumber(perc)) } end,
28252828
["movement skills cost no mana"] = { mod("ManaCost", "MORE", -100, nil, 0, KeywordFlag.Movement) },
@@ -3625,6 +3628,7 @@ local specialModList = {
36253628
["your damage with hits is lucky"] = { flag("LuckyHits") },
36263629
["chaos damage with hits is lucky"] = { flag("ChaosLuckyHits") },
36273630
["elemental damage with hits is lucky while you are shocked"] = { flag("ElementalLuckHits", { type = "Condition", var = "Shocked" }) },
3631+
["break (%d+)%% of armour on heavy stunning an enemy"] = { flag("Condition:CanArmourBreak", { type = "GlobalEffect", effectType = "Buff", effectName = "ArmourBreak" }) },
36283632
["allies' aura buffs do not affect you"] = { flag("AlliesAurasCannotAffectSelf") },
36293633
["(%d+)%% increased effect of non%-curse auras from your skills on enemies"] = function(num) return {
36303634
mod("DebuffEffect", "INC", num, { type = "SkillType", skillType = SkillType.Aura }, { type = "SkillType", skillType = SkillType.AppliesCurse, neg = true }),

0 commit comments

Comments
 (0)