diff --git a/spec/System/TestItemMods_spec.lua b/spec/System/TestItemMods_spec.lua index 3cd048c22..d51d0e57b 100644 --- a/spec/System/TestItemMods_spec.lua +++ b/spec/System/TestItemMods_spec.lua @@ -220,4 +220,46 @@ describe("TetsItemMods", function() assert.are_not.equals(120, build.calcsTab.mainOutput.Armour) runCallback("OnFrame") end) + + it("twisted empyrean", function() + build.itemsTab:CreateDisplayItemFromRaw([[ + Rarity: UNIQUE + Twisted Empyrean Test + Greatmace + Quality: 0 + Sockets: S S S S + Rune: None + Rune: None + Rune: None + Rune: None + LevelReq: 52 + Implicits: 0 + Attacks with this Weapon have Added Cold Damage equal to 6% to 10% of Maximum Mana + Convert 100% of Fire Damage of Mace Skills to Cold Damage + ]]) + build.itemsTab:AddDisplayItem() + runCallback("OnFrame") + + build.skillsTab:PasteSocketGroup("Leap Slam 20/0 1") + runCallback("OnFrame") + + local baseColdAvg = round(build.calcsTab.mainOutput.ColdStoredCombinedAvg) + + build.configTab.input.customMods = [[ + +904 maximum mana + ]] + build.configTab:BuildModList() + runCallback("OnFrame") + -- more mana increases average cold hit + assert.are_not.equals(baseColdAvg, round(build.calcsTab.mainOutput.ColdStoredCombinedAvg)) + + build.configTab.input.customMods = [[ + 100 to 200 added fire damage + ]] + build.configTab:BuildModList() + runCallback("OnFrame") + -- added fire damage increases cold damage + assert.are_not.equals(baseColdAvg, round(build.calcsTab.mainOutput.ColdStoredCombinedAvg)) + assert.equals(0, round(build.calcsTab.mainOutput.FireStoredCombinedAvg)) + end) end) diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index a13144ac8..42589af4e 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -3588,6 +3588,13 @@ local specialModList = { mod("DamageGainAsCold", "BASE", num), mod("DamageGainAsFire", "BASE", num), } end, + ["attacks with this weapon have added (%a+) damage equal to (%d+)%% to (%d+)%% of maximum (%a+)"] = function(_, damageType, min, max) return { + mod(firstToUpper(damageType).."Min", "BASE", 1, { type = "PercentStat", stat = "Mana", percent = min }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }), + mod(firstToUpper(damageType).."Max", "BASE", 1, { type = "PercentStat", stat = "Mana", percent = max }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }), + } end, + ["convert (%d+)%% of (%a+) damage of (%a+) skills to (%a+) damage"] = function (num, _, fromDmg, skillType, toDmg) return { + mod(firstToUpper(fromDmg) .. "DamageConvertTo" .. firstToUpper(toDmg), "BASE", num, nil, ModFlag[firstToUpper(skillType)]) + } end, -- Twisted Empyrean ["gain (%d+)%% of weapon physical damage as extra damage of an? r?a?n?d?o?m? ?element"] = function(num) return { mod("PhysicalDamageGainAsRandom", "BASE", num, nil, ModFlag.Weapon) } end, ["gain (%d+)%% of physical damage as extra damage of a random element"] = function(num) return { mod("PhysicalDamageGainAsRandom", "BASE", num ) } end, ["(%d+)%% chance for hits to deal (%d+)%% of physical damage as extra damage of a random element"] = function(num, _, physPercent) return { mod("PhysicalDamageGainAsRandom", "BASE", (num*physPercent/100) ) } end,