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
15 changes: 15 additions & 0 deletions spec/System/TestItemParse_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ describe("TestItemParse", function()
assert.are.equals(12, item.quality)
end)

it("parses '+X% to Fire Spell Critical Hit Chance' (issue #2226)", function()
local item = new("Item", [[
Rarity: Rare
Xoph's Test Band
Amethyst Ring
Implicits: 0
+5% to Fire Spell Critical Hit Chance
]])
-- grants base critical hit chance to fire spells specifically
assert.are.equals(5, item.baseModList:Sum("BASE", { flags = ModFlag.Spell, keywordFlags = KeywordFlag.Fire }, "CritChance"))
-- must NOT apply to attacks, nor to non-fire spells
assert.are.equals(0, item.baseModList:Sum("BASE", { flags = ModFlag.Attack, keywordFlags = KeywordFlag.Fire }, "CritChance"))
assert.are.equals(0, item.baseModList:Sum("BASE", { flags = ModFlag.Spell, keywordFlags = KeywordFlag.Cold }, "CritChance"))
end)

--TODO: impl sockets for POB2
--it("Sockets", function()
--end)
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ local modNameList = {
["critical hit chance"] = "CritChance",
["attack critical hit chance"] = { "CritChance", flags = ModFlag.Attack },
["thorns critical hit chance"] = { "CritChance", flags = ModFlag.Thorns },
["fire spell critical hit chance"] = { "CritChance", flags = ModFlag.Spell, keywordFlags = KeywordFlag.Fire },
["critical damage bonus"] = "CritMultiplier",
["attack critical damage bonus"] = { "CritMultiplier", flags = ModFlag.Attack },
["critical spell damage bonus"] = { "CritMultiplier", flags = ModFlag.Spell },
Expand Down