diff --git a/spec/System/TestOffence_spec.lua b/spec/System/TestOffence_spec.lua index da782f9f67..41872d4eae 100644 --- a/spec/System/TestOffence_spec.lua +++ b/spec/System/TestOffence_spec.lua @@ -257,6 +257,11 @@ describe("TestOffence", function() -- Arc is pure lightning, so the player can no longer deal damage with it assert.are.equals(0, build.calcsTab.calcsOutput.LightningMax) + local lightningBreakdown = build.calcsTab.calcsEnv.player.breakdown.Lightning + assert.are.equals("You can't deal Lightning damage", lightningBreakdown[1]) + assert.are.equals(1, #lightningBreakdown.modList) + assert.are.equals("DealNoLightning", lightningBreakdown.modList[1].mod.name) + assert.matches("^Item:%d+:New Item", lightningBreakdown.modList[1].mod.source) end) it("keeps deal no non-elemental damage as its own literal", function() diff --git a/src/Classes/CalcBreakdownControl.lua b/src/Classes/CalcBreakdownControl.lua index 6db2299acc..a51f978987 100644 --- a/src/Classes/CalcBreakdownControl.lua +++ b/src/Classes/CalcBreakdownControl.lua @@ -410,7 +410,7 @@ function CalcBreakdownClass:AddModSection(sectionData, modList) -- Multiple stat names specified, add this modifier's stat to the table row.name = self:FormatModName(row.mod.name) end - local sourceType = row.mod.source:match("[^:]+") or "" + local sourceType = row.mod.source and row.mod.source:match("[^:]+") or "" row.source = sourceType if not modList and not sectionData.modSource then -- No modifier source specified, add the source type to the table diff --git a/src/Modules/CalcOffence.lua b/src/Modules/CalcOffence.lua index 8458c4e468..03ec2a01ad 100644 --- a/src/Modules/CalcOffence.lua +++ b/src/Modules/CalcOffence.lua @@ -1930,8 +1930,13 @@ function calcs.offence(env, actor, activeSkill) -- Cache global damage disabling flags local canDeal = { } + local damageDisableMods = breakdown and { } for _, damageType in ipairs(dmgTypeList) do - canDeal[damageType] = not skillModList:Flag(skillCfg, "DealNo"..damageType, "DealNoDamage") + local damageDisabled = skillModList:Flag(skillCfg, "DealNo"..damageType, "DealNoDamage") + canDeal[damageType] = not damageDisabled + if damageDisableMods and damageDisabled then + damageDisableMods[damageType] = skillModList:Tabulate("FLAG", skillCfg, "DealNo"..damageType, "DealNoDamage") + end end -- Calculate damage conversion percentages @@ -3640,7 +3645,8 @@ function calcs.offence(env, actor, activeSkill) else if breakdown then breakdown[damageType] = { - "You can't deal "..damageType.." damage" + "You can't deal "..damageType.." damage", + modList = damageDisableMods[damageType], } end end