From aae1cd9b35886f1d65ed149dc2b48cfd97545531 Mon Sep 17 00:00:00 2001 From: luther-rotmg Date: Fri, 19 Jun 2026 16:20:41 -0700 Subject: [PATCH] Support "+X% to Fire Spell Critical Hit Chance" affix The "of Xoph" suffix ("+X% to Fire Spell Critical Hit Chance", mod group FireSpellBaseCriticalChance) had no modNameList entry, so the "fire spell" qualifier was left unparsed and the affix did nothing. Add a modNameList mapping to CritChance (BASE) restricted to fire spells via ModFlag.Spell + KeywordFlag.Fire, matching the codebase's existing "fire spells" convention in preFlagList. Add a parse regression test. Closes #2226 --- spec/System/TestItemParse_spec.lua | 15 +++++++++++++++ src/Modules/ModParser.lua | 1 + 2 files changed, 16 insertions(+) diff --git a/spec/System/TestItemParse_spec.lua b/spec/System/TestItemParse_spec.lua index fe48536c59..2e1d08e12b 100644 --- a/spec/System/TestItemParse_spec.lua +++ b/spec/System/TestItemParse_spec.lua @@ -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) diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 3dd2c16b06..8481a51b6f 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -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 },