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
42 changes: 42 additions & 0 deletions spec/System/TestItemMods_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 7 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading