Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions spec/System/TestOffence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/CalcBreakdownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading