indent space -> tab (#8058)
This commit is contained in:
@@ -1,53 +1,53 @@
|
||||
local function fetchBuilds(path, buildList)
|
||||
buildList = buildList or {}
|
||||
for file in lfs.dir(path) do
|
||||
if file ~= "." and file ~= ".." then
|
||||
local f = path..'/'..file
|
||||
local attr = lfs.attributes (f)
|
||||
assert(type(attr) == "table")
|
||||
if attr.mode == "directory" then
|
||||
fetchBuilds(f, buildList)
|
||||
else
|
||||
if file:match("^.+(%..+)$") == ".xml" then
|
||||
local fileHnd, errMsg = io.open(f, "r")
|
||||
if not fileHnd then
|
||||
return nil, errMsg
|
||||
end
|
||||
local fileText = fileHnd:read("*a")
|
||||
fileHnd:close()
|
||||
buildList[f] = fileText
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return buildList
|
||||
buildList = buildList or {}
|
||||
for file in lfs.dir(path) do
|
||||
if file ~= "." and file ~= ".." then
|
||||
local f = path..'/'..file
|
||||
local attr = lfs.attributes (f)
|
||||
assert(type(attr) == "table")
|
||||
if attr.mode == "directory" then
|
||||
fetchBuilds(f, buildList)
|
||||
else
|
||||
if file:match("^.+(%..+)$") == ".xml" then
|
||||
local fileHnd, errMsg = io.open(f, "r")
|
||||
if not fileHnd then
|
||||
return nil, errMsg
|
||||
end
|
||||
local fileText = fileHnd:read("*a")
|
||||
fileHnd:close()
|
||||
buildList[f] = fileText
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return buildList
|
||||
end
|
||||
|
||||
function buildTable(tableName, values, string)
|
||||
string = string or ""
|
||||
string = string .. tableName .. " = {"
|
||||
for key, value in pairs(values) do
|
||||
if type(value) == "table" then
|
||||
buildTable(key, value, string)
|
||||
elseif type(value) == "boolean" then
|
||||
string = string .. "[\"" .. key .. "\"] = " .. (value and "true" or "false") .. ",\n"
|
||||
elseif type(value) == "string" then
|
||||
string = string .. "[\"" .. key .. "\"] = \"" .. value .. "\",\n"
|
||||
else
|
||||
string = string .. "[\"" .. key .. "\"] = " .. round(value, 4) .. ",\n"
|
||||
end
|
||||
end
|
||||
string = string .. "}\n"
|
||||
return string
|
||||
string = string or ""
|
||||
string = string .. tableName .. " = {"
|
||||
for key, value in pairs(values) do
|
||||
if type(value) == "table" then
|
||||
buildTable(key, value, string)
|
||||
elseif type(value) == "boolean" then
|
||||
string = string .. "[\"" .. key .. "\"] = " .. (value and "true" or "false") .. ",\n"
|
||||
elseif type(value) == "string" then
|
||||
string = string .. "[\"" .. key .. "\"] = \"" .. value .. "\",\n"
|
||||
else
|
||||
string = string .. "[\"" .. key .. "\"] = " .. round(value, 4) .. ",\n"
|
||||
end
|
||||
end
|
||||
string = string .. "}\n"
|
||||
return string
|
||||
end
|
||||
|
||||
local buildList = fetchBuilds("../spec/TestBuilds")
|
||||
for filename, testBuild in pairs(buildList) do
|
||||
loadBuildFromXML(testBuild)
|
||||
local fileHnd, errMsg = io.open(filename:gsub("^(.+)%..+$", "%1.lua"), "w+")
|
||||
fileHnd:write("return {\n xml = [[")
|
||||
fileHnd:write(testBuild)
|
||||
fileHnd:write("]],\n ")
|
||||
fileHnd:write(buildTable("output", build.calcsTab.mainOutput) .. "\n}")
|
||||
fileHnd:close()
|
||||
loadBuildFromXML(testBuild)
|
||||
local fileHnd, errMsg = io.open(filename:gsub("^(.+)%..+$", "%1.lua"), "w+")
|
||||
fileHnd:write("return {\n xml = [[")
|
||||
fileHnd:write(testBuild)
|
||||
fileHnd:write("]],\n ")
|
||||
fileHnd:write(buildTable("output", build.calcsTab.mainOutput) .. "\n}")
|
||||
fileHnd:close()
|
||||
end
|
||||
@@ -1,39 +1,39 @@
|
||||
describe("TestAilments", function()
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
|
||||
it("maximum shock value", function()
|
||||
-- Shock Nova
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nShock Nova 4/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(round(50 + 10), build.calcsTab.mainOutput.MaximumShock)
|
||||
it("maximum shock value", function()
|
||||
-- Shock Nova
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nShock Nova 4/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(round(50 + 10), build.calcsTab.mainOutput.MaximumShock)
|
||||
|
||||
-- Voltaxic Rift
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nAssassin Bow\n+40% to Maximum Effect of Shock")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(round(50 + 10 + 40), build.calcsTab.mainOutput.MaximumShock)
|
||||
end)
|
||||
-- Voltaxic Rift
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nAssassin Bow\n+40% to Maximum Effect of Shock")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(round(50 + 10 + 40), build.calcsTab.mainOutput.MaximumShock)
|
||||
end)
|
||||
|
||||
it("bleed is buffed by bleed chance", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nKarui Chopper")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nHeavy Strike 1/0 Default 1\n")
|
||||
build.configTab.input.customMods = "\z
|
||||
attacks have 10% chance to cause bleeding\n\z
|
||||
"
|
||||
attacks have 10% chance to cause bleeding\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
local badDps = build.calcsTab.mainOutput.BleedDPS
|
||||
|
||||
build.configTab.input.customMods = "\z
|
||||
attacks have 100% chance to cause bleeding\n\z
|
||||
"
|
||||
attacks have 100% chance to cause bleeding\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
local goodDps = build.calcsTab.mainOutput.BleedDPS
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
describe("TestAttacks", function()
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
|
||||
it("creates an item and has the correct crit chance", function()
|
||||
assert.are.equals(build.calcsTab.mainOutput.CritChance, 0)
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nMaraketh Bow\nCrafted: true\nPrefix: None\nPrefix: None\nPrefix: None\nSuffix: None\nSuffix: None\nSuffix: None\nQuality: 20\nSockets: G-G-G-G-G-G\nLevelReq: 71\nImplicits: 1\n{tags:speed}10% increased Movement Speed")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(build.calcsTab.mainOutput.CritChance, 5.5 * build.calcsTab.mainOutput.HitChance / 100)
|
||||
end)
|
||||
it("creates an item and has the correct crit chance", function()
|
||||
assert.are.equals(build.calcsTab.mainOutput.CritChance, 0)
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nMaraketh Bow\nCrafted: true\nPrefix: None\nPrefix: None\nPrefix: None\nSuffix: None\nSuffix: None\nSuffix: None\nQuality: 20\nSockets: G-G-G-G-G-G\nLevelReq: 71\nImplicits: 1\n{tags:speed}10% increased Movement Speed")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(build.calcsTab.mainOutput.CritChance, 5.5 * build.calcsTab.mainOutput.HitChance / 100)
|
||||
end)
|
||||
|
||||
it("creates an item and has the correct crit multi", function()
|
||||
assert.are.equals(1.5, build.calcsTab.mainOutput.CritMultiplier)
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nAssassin Bow\nCrafted: true\nPrefix: None\nPrefix: None\nPrefix: None\nSuffix: None\nSuffix: None\nSuffix: None\nQuality: 20\nSockets: G-G-G-G-G-G\nLevelReq: 62\nImplicits: 1\n{tags:damage,critical}{range:0.5}+(15-25)% to Global Critical Strike Multiplier")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(1.5 + 0.2, build.calcsTab.mainOutput.CritMultiplier)
|
||||
end)
|
||||
it("creates an item and has the correct crit multi", function()
|
||||
assert.are.equals(1.5, build.calcsTab.mainOutput.CritMultiplier)
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nAssassin Bow\nCrafted: true\nPrefix: None\nPrefix: None\nPrefix: None\nSuffix: None\nSuffix: None\nSuffix: None\nQuality: 20\nSockets: G-G-G-G-G-G\nLevelReq: 62\nImplicits: 1\n{tags:damage,critical}{range:0.5}+(15-25)% to Global Critical Strike Multiplier")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(1.5 + 0.2, build.calcsTab.mainOutput.CritMultiplier)
|
||||
end)
|
||||
|
||||
it("correctly converts spell damage per stat to attack damage", function()
|
||||
assert.are.equals(0, build.calcsTab.mainEnv.player.modDB:Sum("INC", { flags = ModFlag.Attack }, "Damage"))
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[
|
||||
New Item
|
||||
Coral Amulet
|
||||
10% increased attack damage
|
||||
10% increased spell damage
|
||||
1% increased spell damage per 10 intelligence
|
||||
]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(10, build.calcsTab.mainEnv.player.modDB:Sum("INC", { flags = ModFlag.Attack }, "Damage"))
|
||||
-- Scion starts with 20 Intelligence
|
||||
assert.are.equals(12, build.calcsTab.mainEnv.player.modDB:Sum("INC", { flags = ModFlag.Spell }, "Damage"))
|
||||
it("correctly converts spell damage per stat to attack damage", function()
|
||||
assert.are.equals(0, build.calcsTab.mainEnv.player.modDB:Sum("INC", { flags = ModFlag.Attack }, "Damage"))
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[
|
||||
New Item
|
||||
Coral Amulet
|
||||
10% increased attack damage
|
||||
10% increased spell damage
|
||||
1% increased spell damage per 10 intelligence
|
||||
]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(10, build.calcsTab.mainEnv.player.modDB:Sum("INC", { flags = ModFlag.Attack }, "Damage"))
|
||||
-- Scion starts with 20 Intelligence
|
||||
assert.are.equals(12, build.calcsTab.mainEnv.player.modDB:Sum("INC", { flags = ModFlag.Spell }, "Damage"))
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[
|
||||
New Item
|
||||
Coral Ring
|
||||
increases and reductions to spell damage also apply to attacks
|
||||
]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(22, build.calcsTab.mainEnv.player.mainSkill.skillModList:Sum("INC", { flags = ModFlag.Attack }, "Damage"))
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[
|
||||
New Item
|
||||
Coral Ring
|
||||
increases and reductions to spell damage also apply to attacks
|
||||
]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(22, build.calcsTab.mainEnv.player.mainSkill.skillModList:Sum("INC", { flags = ModFlag.Attack }, "Damage"))
|
||||
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
@@ -1,35 +1,35 @@
|
||||
local function fetchBuilds(path, buildList)
|
||||
buildList = buildList or {}
|
||||
for file in lfs.dir(path) do
|
||||
if file ~= "." and file ~= ".." then
|
||||
local f = path..'/'..file
|
||||
local attr = lfs.attributes (f)
|
||||
assert(type(attr) == "table")
|
||||
if attr.mode == "directory" then
|
||||
fetchBuilds(f, buildList)
|
||||
elseif file:match("^.+(%..+)$") == ".lua" then
|
||||
buildList[file] = LoadModule(f)
|
||||
end
|
||||
end
|
||||
end
|
||||
return buildList
|
||||
buildList = buildList or {}
|
||||
for file in lfs.dir(path) do
|
||||
if file ~= "." and file ~= ".." then
|
||||
local f = path..'/'..file
|
||||
local attr = lfs.attributes (f)
|
||||
assert(type(attr) == "table")
|
||||
if attr.mode == "directory" then
|
||||
fetchBuilds(f, buildList)
|
||||
elseif file:match("^.+(%..+)$") == ".lua" then
|
||||
buildList[file] = LoadModule(f)
|
||||
end
|
||||
end
|
||||
end
|
||||
return buildList
|
||||
end
|
||||
|
||||
expose("test all builds #builds", function()
|
||||
local buildList = fetchBuilds("../spec/TestBuilds")
|
||||
for buildName, testBuild in pairs(buildList) do
|
||||
loadBuildFromXML(testBuild.xml, buildName)
|
||||
testBuild.result = {}
|
||||
for key, value in pairs(testBuild.output) do
|
||||
-- Have to assign it to a temporary table here, as the tests will run later, when the 'build' isn't changing
|
||||
testBuild.result[key] = build.calcsTab.mainOutput[key]
|
||||
it("on build: " .. buildName .. ", key: " .. key, function()
|
||||
if type(value) == "number" and type(testBuild.result[key]) == "number" then
|
||||
assert.are.same(round(value, 4), round(testBuild.result[key] or 0, 4))
|
||||
else
|
||||
assert.are.same(value, testBuild.result[key])
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
local buildList = fetchBuilds("../spec/TestBuilds")
|
||||
for buildName, testBuild in pairs(buildList) do
|
||||
loadBuildFromXML(testBuild.xml, buildName)
|
||||
testBuild.result = {}
|
||||
for key, value in pairs(testBuild.output) do
|
||||
-- Have to assign it to a temporary table here, as the tests will run later, when the 'build' isn't changing
|
||||
testBuild.result[key] = build.calcsTab.mainOutput[key]
|
||||
it("on build: " .. buildName .. ", key: " .. key, function()
|
||||
if type(value) == "number" and type(testBuild.result[key]) == "number" then
|
||||
assert.are.same(round(value, 4), round(testBuild.result[key] or 0, 4))
|
||||
else
|
||||
assert.are.same(value, testBuild.result[key])
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,512 +1,512 @@
|
||||
describe("TetsItemMods", function()
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
|
||||
it("Dialla's socket mods", function()
|
||||
build.skillsTab:PasteSocketGroup("Slot: Body Armour\nArc 20/0 Default 1\nArc 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
it("Dialla's socket mods", function()
|
||||
build.skillsTab:PasteSocketGroup("Slot: Body Armour\nArc 20/0 Default 1\nArc 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Dialla's Malefaction
|
||||
Sage's Robe
|
||||
Energy Shield: 95
|
||||
EnergyShieldBasePercentile: 0
|
||||
Variant: Pre 3.19.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Sage's Robe
|
||||
Quality: 20
|
||||
Sockets: R-G-B-B-B-B
|
||||
LevelReq: 37
|
||||
Implicits: 0
|
||||
Gems can be Socketed in this Item ignoring Socket Colour
|
||||
{variant:1}Gems Socketed in Red Sockets have +1 to Level
|
||||
{variant:2}Gems Socketed in Red Sockets have +2 to Level
|
||||
{variant:1}Gems Socketed in Green Sockets have +10% to Quality
|
||||
{variant:2}Gems Socketed in Green Sockets have +30% to Quality
|
||||
{variant:1}Gems Socketed in Blue Sockets gain 25% increased Experience
|
||||
{variant:2}Gems Socketed in Blue Sockets gain 100% increased Experience
|
||||
Has no Attribute Requirements]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Dialla's Malefaction
|
||||
Sage's Robe
|
||||
Energy Shield: 95
|
||||
EnergyShieldBasePercentile: 0
|
||||
Variant: Pre 3.19.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Sage's Robe
|
||||
Quality: 20
|
||||
Sockets: R-G-B-B-B-B
|
||||
LevelReq: 37
|
||||
Implicits: 0
|
||||
Gems can be Socketed in this Item ignoring Socket Colour
|
||||
{variant:1}Gems Socketed in Red Sockets have +1 to Level
|
||||
{variant:2}Gems Socketed in Red Sockets have +2 to Level
|
||||
{variant:1}Gems Socketed in Green Sockets have +10% to Quality
|
||||
{variant:2}Gems Socketed in Green Sockets have +30% to Quality
|
||||
{variant:1}Gems Socketed in Blue Sockets gain 25% increased Experience
|
||||
{variant:2}Gems Socketed in Blue Sockets gain 100% increased Experience
|
||||
Has no Attribute Requirements]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(build.calcsTab.mainEnv.player.activeSkillList[1].activeEffect.level, 22)
|
||||
assert.are.equals(build.calcsTab.mainEnv.player.activeSkillList[2].activeEffect.quality, 30)
|
||||
end)
|
||||
assert.are.equals(build.calcsTab.mainEnv.player.activeSkillList[1].activeEffect.level, 22)
|
||||
assert.are.equals(build.calcsTab.mainEnv.player.activeSkillList[2].activeEffect.quality, 30)
|
||||
end)
|
||||
|
||||
it("Malachai's Artifice socket mods", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Malachai's Artifice
|
||||
Unset Ring
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Unset Ring
|
||||
Sockets: W
|
||||
LevelReq: 5
|
||||
Implicits: 1
|
||||
Has 1 Socket
|
||||
{tags:jewellery_resistance}{variant:1}-25% to all Elemental Resistances
|
||||
{tags:jewellery_resistance}{variant:2}-20% to all Elemental Resistances
|
||||
{tags:jewellery_resistance}{range:0.5}+(75-100)% to Fire Resistance when Socketed with a Red Gem
|
||||
{tags:jewellery_resistance}{range:0.5}+(75-100)% to Cold Resistance when Socketed with a Green Gem
|
||||
{tags:jewellery_resistance}{range:0.5}+(75-100)% to Lightning Resistance when Socketed with a Blue Gem
|
||||
All Sockets are White
|
||||
Socketed Gems have Elemental Equilibrium]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
it("Malachai's Artifice socket mods", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Malachai's Artifice
|
||||
Unset Ring
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Unset Ring
|
||||
Sockets: W
|
||||
LevelReq: 5
|
||||
Implicits: 1
|
||||
Has 1 Socket
|
||||
{tags:jewellery_resistance}{variant:1}-25% to all Elemental Resistances
|
||||
{tags:jewellery_resistance}{variant:2}-20% to all Elemental Resistances
|
||||
{tags:jewellery_resistance}{range:0.5}+(75-100)% to Fire Resistance when Socketed with a Red Gem
|
||||
{tags:jewellery_resistance}{range:0.5}+(75-100)% to Cold Resistance when Socketed with a Green Gem
|
||||
{tags:jewellery_resistance}{range:0.5}+(75-100)% to Lightning Resistance when Socketed with a Blue Gem
|
||||
All Sockets are White
|
||||
Socketed Gems have Elemental Equilibrium]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
local lightningResBefore = build.calcsTab.mainOutput.LightningResist
|
||||
local lightningResBefore = build.calcsTab.mainOutput.LightningResist
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Slot: Ring 1\nWrath 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
build.skillsTab:PasteSocketGroup("Slot: Ring 1\nWrath 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are_not.equals(lightningResBefore, build.calcsTab.mainOutput.LightningResist)
|
||||
end)
|
||||
assert.are_not.equals(lightningResBefore, build.calcsTab.mainOutput.LightningResist)
|
||||
end)
|
||||
|
||||
it("Doomsower vaal pact and extra phys as fire", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Doomsower
|
||||
Lion Sword
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Pre 3.0.0
|
||||
Variant: Pre 3.8.0
|
||||
Variant: Pre 3.11.0
|
||||
Variant: Current
|
||||
Selected Variant: 5
|
||||
Lion Sword
|
||||
Quality: 20
|
||||
Sockets: G-G-G-G-G-G
|
||||
LevelReq: 65
|
||||
Implicits: 3
|
||||
{variant:1}18% increased Global Accuracy Rating
|
||||
{variant:2,3,4}+470 to Accuracy Rating
|
||||
{variant:5}+50 to Strength and Dexterity
|
||||
Socketed Melee Gems have 15% increased Area of Effect
|
||||
{variant:1,2,3}Socketed Red Gems get 10% Physical Damage as Extra Fire Damage
|
||||
{variant:1,2,3,4}{range:0.5}(50-70)% increased Physical Damage
|
||||
{variant:5}{range:0.5}(30-50)% increased Physical Damage
|
||||
{variant:1,2}{range:0.5}Adds (50-75) to (85-110) Physical Damage
|
||||
{variant:3,4,5}{range:0.5}Adds (65-75) to (100-110) Physical Damage
|
||||
{range:0.5}(6-12)% increased Attack Speed
|
||||
{variant:5,4}Attack Skills gain 5% of Physical Damage as Extra Fire Damage per Socketed Red Gem
|
||||
{variant:5,4}You have Vaal Pact while all Socketed Gems are Red]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
it("Doomsower vaal pact and extra phys as fire", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Doomsower
|
||||
Lion Sword
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Pre 3.0.0
|
||||
Variant: Pre 3.8.0
|
||||
Variant: Pre 3.11.0
|
||||
Variant: Current
|
||||
Selected Variant: 5
|
||||
Lion Sword
|
||||
Quality: 20
|
||||
Sockets: G-G-G-G-G-G
|
||||
LevelReq: 65
|
||||
Implicits: 3
|
||||
{variant:1}18% increased Global Accuracy Rating
|
||||
{variant:2,3,4}+470 to Accuracy Rating
|
||||
{variant:5}+50 to Strength and Dexterity
|
||||
Socketed Melee Gems have 15% increased Area of Effect
|
||||
{variant:1,2,3}Socketed Red Gems get 10% Physical Damage as Extra Fire Damage
|
||||
{variant:1,2,3,4}{range:0.5}(50-70)% increased Physical Damage
|
||||
{variant:5}{range:0.5}(30-50)% increased Physical Damage
|
||||
{variant:1,2}{range:0.5}Adds (50-75) to (85-110) Physical Damage
|
||||
{variant:3,4,5}{range:0.5}Adds (65-75) to (100-110) Physical Damage
|
||||
{range:0.5}(6-12)% increased Attack Speed
|
||||
{variant:5,4}Attack Skills gain 5% of Physical Damage as Extra Fire Damage per Socketed Red Gem
|
||||
{variant:5,4}You have Vaal Pact while all Socketed Gems are Red]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nSmite 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nSmite 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.is_true(build.calcsTab.mainEnv.keystonesAdded["Vaal Pact"])
|
||||
assert.is_true(build.calcsTab.mainEnv.player.mainSkill.skillModList:Sum("BASE", build.calcsTab.mainEnv.player.mainSkill.skillCfg, "PhysicalDamageGainAsFire") > 0)
|
||||
end)
|
||||
assert.is_true(build.calcsTab.mainEnv.keystonesAdded["Vaal Pact"])
|
||||
assert.is_true(build.calcsTab.mainEnv.player.mainSkill.skillModList:Sum("BASE", build.calcsTab.mainEnv.player.mainSkill.skillCfg, "PhysicalDamageGainAsFire") > 0)
|
||||
end)
|
||||
|
||||
it("Varunastra works with nightblade", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Varunastra
|
||||
Vaal Blade
|
||||
League: Perandus
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Vaal Blade
|
||||
Quality: 20
|
||||
Sockets: G-G-G
|
||||
LevelReq: 64
|
||||
Implicits: 2
|
||||
{variant:1}18% increased Global Accuracy Rating
|
||||
{variant:2}+460 to Accuracy Rating
|
||||
{range:0.5}(40-60)% increased Physical Damage
|
||||
{range:0.5}Adds (30-45) to (80-100) Physical Damage
|
||||
{range:0.5}+(2-3) Mana gained for each Enemy hit by Attacks
|
||||
Counts as all One Handed Melee Weapon Types]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
it("Varunastra works with nightblade", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Varunastra
|
||||
Vaal Blade
|
||||
League: Perandus
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Vaal Blade
|
||||
Quality: 20
|
||||
Sockets: G-G-G
|
||||
LevelReq: 64
|
||||
Implicits: 2
|
||||
{variant:1}18% increased Global Accuracy Rating
|
||||
{variant:2}+460 to Accuracy Rating
|
||||
{range:0.5}(40-60)% increased Physical Damage
|
||||
{range:0.5}Adds (30-45) to (80-100) Physical Damage
|
||||
{range:0.5}+(2-3) Mana gained for each Enemy hit by Attacks
|
||||
Counts as all One Handed Melee Weapon Types]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Smite 20/0 Default 1\nNightblade 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
local nonElusiveCritMult = build.calcsTab.mainOutput.CritMultiplier
|
||||
build.skillsTab:PasteSocketGroup("Smite 20/0 Default 1\nNightblade 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
local nonElusiveCritMult = build.calcsTab.mainOutput.CritMultiplier
|
||||
|
||||
build.configTab.input["buffElusive"] = true
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input["buffElusive"] = true
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are_not.equals(nonElusiveCritMult, build.calcsTab.mainOutput.CritMultiplier)
|
||||
end)
|
||||
assert.are_not.equals(nonElusiveCritMult, build.calcsTab.mainOutput.CritMultiplier)
|
||||
end)
|
||||
|
||||
it("Varunastra works with close combat support", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Varunastra
|
||||
Vaal Blade
|
||||
League: Perandus
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Vaal Blade
|
||||
Quality: 20
|
||||
Sockets: G-G-G
|
||||
LevelReq: 64
|
||||
Implicits: 2
|
||||
{variant:1}18% increased Global Accuracy Rating
|
||||
{variant:2}+460 to Accuracy Rating
|
||||
{range:0.5}(40-60)% increased Physical Damage
|
||||
{range:0.5}Adds (30-45) to (80-100) Physical Damage
|
||||
{range:0.5}+(2-3) Mana gained for each Enemy hit by Attacks
|
||||
Counts as all One Handed Melee Weapon Types]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
it("Varunastra works with close combat support", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Varunastra
|
||||
Vaal Blade
|
||||
League: Perandus
|
||||
Variant: Pre 2.6.0
|
||||
Variant: Current
|
||||
Selected Variant: 2
|
||||
Vaal Blade
|
||||
Quality: 20
|
||||
Sockets: G-G-G
|
||||
LevelReq: 64
|
||||
Implicits: 2
|
||||
{variant:1}18% increased Global Accuracy Rating
|
||||
{variant:2}+460 to Accuracy Rating
|
||||
{range:0.5}(40-60)% increased Physical Damage
|
||||
{range:0.5}Adds (30-45) to (80-100) Physical Damage
|
||||
{range:0.5}+(2-3) Mana gained for each Enemy hit by Attacks
|
||||
Counts as all One Handed Melee Weapon Types]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.configTab.input["meleeDistance"] = 99
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input["meleeDistance"] = 99
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Cyclone 20/0 Default 1\nClose Combat 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
build.skillsTab:PasteSocketGroup("Cyclone 20/0 Default 1\nClose Combat 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
local farDPS = build.calcsTab.mainOutput.TotalDPS
|
||||
local farDPS = build.calcsTab.mainOutput.TotalDPS
|
||||
|
||||
build.configTab.input["meleeDistance"] = 1
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input["meleeDistance"] = 1
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are_not.equals(farDPS, build.calcsTab.mainOutput.TotalDPS)
|
||||
end)
|
||||
assert.are_not.equals(farDPS, build.calcsTab.mainOutput.TotalDPS)
|
||||
end)
|
||||
|
||||
it("Kalandra's Touch mod copy", function()
|
||||
local initialInt = build.calcsTab.mainOutput.Int
|
||||
it("Kalandra's Touch mod copy", function()
|
||||
local initialInt = build.calcsTab.mainOutput.Int
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[New Item
|
||||
Ring
|
||||
Quality: 0
|
||||
LevelReq: 35
|
||||
Implicits: 0
|
||||
+30 to Intelligence]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[New Item
|
||||
Ring
|
||||
Quality: 0
|
||||
LevelReq: 35
|
||||
Implicits: 0
|
||||
+30 to Intelligence]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
local genericRingInt = build.calcsTab.mainOutput.Int
|
||||
local genericRingInt = build.calcsTab.mainOutput.Int
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Kalandra's Touch
|
||||
Ring
|
||||
League: Kalandra
|
||||
Implicits: 0
|
||||
Reflects your other Ring
|
||||
Mirrored]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Kalandra's Touch
|
||||
Ring
|
||||
League: Kalandra
|
||||
Implicits: 0
|
||||
Reflects your other Ring
|
||||
Mirrored]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(genericRingInt - initialInt, build.calcsTab.mainOutput.Int - genericRingInt)
|
||||
end)
|
||||
assert.are.equals(genericRingInt - initialInt, build.calcsTab.mainOutput.Int - genericRingInt)
|
||||
end)
|
||||
|
||||
it("Kalandra's Touch influence copy", function()
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nSmite 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nSmite 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
local dmg = build.calcsTab.mainOutput.AverageDamage
|
||||
local dmg = build.calcsTab.mainOutput.AverageDamage
|
||||
|
||||
build.configTab.input.customMods = "\z
|
||||
Gain 5% of Elemental Damage as Extra Chaos Damage per Shaper Item Equipped\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input.customMods = "\z
|
||||
Gain 5% of Elemental Damage as Extra Chaos Damage per Shaper Item Equipped\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(build.calcsTab.mainOutput.AverageDamage, dmg)
|
||||
assert.are.equals(build.calcsTab.mainOutput.AverageDamage, dmg)
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[New Item
|
||||
Cerulean Ring
|
||||
Shaper Item
|
||||
Crafted: true
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 0
|
||||
LevelReq: 80
|
||||
Implicits: 0]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[New Item
|
||||
Cerulean Ring
|
||||
Shaper Item
|
||||
Crafted: true
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 0
|
||||
LevelReq: 80
|
||||
Implicits: 0]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.is_true(build.calcsTab.mainOutput.AverageDamage > dmg)
|
||||
assert.is_true(build.calcsTab.mainOutput.AverageDamage > dmg)
|
||||
|
||||
local dmgOneRing = build.calcsTab.mainOutput.AverageDamage
|
||||
local dmgOneRing = build.calcsTab.mainOutput.AverageDamage
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Kalandra's Touch
|
||||
Ring
|
||||
League: Kalandra
|
||||
Implicits: 0
|
||||
Reflects your other Ring
|
||||
Mirrored]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Kalandra's Touch
|
||||
Ring
|
||||
League: Kalandra
|
||||
Implicits: 0
|
||||
Reflects your other Ring
|
||||
Mirrored]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.is_true(build.calcsTab.mainOutput.AverageDamage > dmgOneRing)
|
||||
end)
|
||||
assert.is_true(build.calcsTab.mainOutput.AverageDamage > dmgOneRing)
|
||||
end)
|
||||
|
||||
it("Both slots mod (evasion and es mastery)", function()
|
||||
it("Both slots mod (evasion and es mastery)", function()
|
||||
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
+71 to Evasion Rating
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
+71 to Evasion Rating
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are_not.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
|
||||
-- Es changes after adding another ring with mod. Regardless of the evasion mod on the first ring being implicit.
|
||||
end)
|
||||
assert.are_not.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
|
||||
-- Es changes after adding another ring with mod. Regardless of the evasion mod on the first ring being implicit.
|
||||
end)
|
||||
|
||||
it("Both slots explicit mod with mixed mod rings (evasion and es mastery)", function()
|
||||
it("Both slots explicit mod with mixed mod rings (evasion and es mastery)", function()
|
||||
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
+71 to Evasion Rating
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
+71 to Evasion Rating
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
|
||||
-- Es does not change after adding another ring with mod due to the first ring having an implicit evasion mod.
|
||||
end)
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
|
||||
-- Es does not change after adding another ring with mod due to the first ring having an implicit evasion mod.
|
||||
end)
|
||||
|
||||
it("Both slots explicit mod (evasion and es mastery)", function()
|
||||
it("Both slots explicit mod (evasion and es mastery)", function()
|
||||
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Chaos Resistance Ring
|
||||
Amethyst Ring
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedEvasionRating4
|
||||
Prefix: None
|
||||
Prefix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
LevelReq: 33
|
||||
Implicits: 1
|
||||
{tags:chaos,resistance}{range:0.5}+(17-23)% to Chaos Resistance
|
||||
+71 to Evasion Rating]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are_not.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
|
||||
-- Es changes after adding two rings with explicit mods.
|
||||
end)
|
||||
assert.are_not.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
|
||||
-- Es changes after adding two rings with explicit mods.
|
||||
end)
|
||||
|
||||
it("Both slots explicit mod no rings (evasion and es mastery)", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
it("Both slots explicit mod no rings (evasion and es mastery)", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Energy Shield Boots
|
||||
Sorcerer Boots
|
||||
Energy Shield: 114
|
||||
EnergyShieldBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}IncreasedLife6
|
||||
Prefix: {range:0.5}LocalIncreasedEnergyShieldPercent5
|
||||
Prefix: {range:0.5}MovementVelocity5
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: B-B-B-B
|
||||
LevelReq: 67
|
||||
Implicits: 0
|
||||
74% increased Energy Shield
|
||||
+65 to maximum Life
|
||||
30% increased Movement Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
local baseEs = build.calcsTab.mainOutput.EnergyShield
|
||||
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input.customMods = "\z
|
||||
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with no rings.
|
||||
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with no rings.
|
||||
|
||||
end)
|
||||
end)
|
||||
|
||||
it("mod if no mod on x slot", function()
|
||||
local baseLife = build.calcsTab.mainOutput.Life
|
||||
it("mod if no mod on x slot", function()
|
||||
local baseLife = build.calcsTab.mainOutput.Life
|
||||
|
||||
build.configTab.input.customMods = "\z
|
||||
15% increased maximum Life if there are no Life Modifiers on Equipped Body Armour\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
build.configTab.input.customMods = "\z
|
||||
15% increased maximum Life if there are no Life Modifiers on Equipped Body Armour\n\z
|
||||
"
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are_not.equals(baseLife, build.calcsTab.mainOutput.Life)
|
||||
assert.are_not.equals(baseLife, build.calcsTab.mainOutput.Life)
|
||||
|
||||
baseLife = build.calcsTab.mainOutput.Life
|
||||
baseLife = build.calcsTab.mainOutput.Life
|
||||
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Armour Chest
|
||||
Astral Plate
|
||||
Armour: 1696
|
||||
ArmourBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}LocalIncreasedPhysicalDamageReductionRating5
|
||||
Prefix: {range:0.5}LocalIncreasedPhysicalDamageReductionRatingPercent5
|
||||
Prefix: {range:0.5}IncreasedLife9
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: R-R-R-R-R-R
|
||||
LevelReq: 62
|
||||
Implicits: 1
|
||||
{tags:elemental,resistance}{range:0.5}+(8-12)% to all Elemental Resistances
|
||||
+92 to Armour
|
||||
74% increased Armour
|
||||
+95 to maximum Life]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Armour Chest
|
||||
Astral Plate
|
||||
Armour: 1696
|
||||
ArmourBasePercentile: 1
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}LocalIncreasedPhysicalDamageReductionRating5
|
||||
Prefix: {range:0.5}LocalIncreasedPhysicalDamageReductionRatingPercent5
|
||||
Prefix: {range:0.5}IncreasedLife9
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: R-R-R-R-R-R
|
||||
LevelReq: 62
|
||||
Implicits: 1
|
||||
{tags:elemental,resistance}{range:0.5}+(8-12)% to all Elemental Resistances
|
||||
+92 to Armour
|
||||
74% increased Armour
|
||||
+95 to maximum Life]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.are_not.equals(baseLife, build.calcsTab.mainOutput.Life)
|
||||
end)
|
||||
assert.are_not.equals(baseLife, build.calcsTab.mainOutput.Life)
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -1,467 +1,467 @@
|
||||
describe("TestItemParse", function()
|
||||
local function raw(s, base)
|
||||
base = base or "Plate Vest"
|
||||
return "Rarity: Rare\nName\n"..base.."\n"..s
|
||||
end
|
||||
local function raw(s, base)
|
||||
base = base or "Plate Vest"
|
||||
return "Rarity: Rare\nName\n"..base.."\n"..s
|
||||
end
|
||||
|
||||
it("Rarity", function()
|
||||
local item = new("Item", "Rarity: Normal\nCoral Ring")
|
||||
assert.are.equals("NORMAL", item.rarity)
|
||||
item = new("Item", "Rarity: Magic\nCoral Ring")
|
||||
assert.are.equals("MAGIC", item.rarity)
|
||||
item = new("Item", "Rarity: Rare\nName\nCoral Ring")
|
||||
assert.are.equals("RARE", item.rarity)
|
||||
item = new("Item", "Rarity: Unique\nName\nCoral Ring")
|
||||
assert.are.equals("UNIQUE", item.rarity)
|
||||
item = new("Item", "Rarity: Unique\nName\nCoral Ring\nFoil Unique (Verdant)")
|
||||
assert.are.equals("RELIC", item.rarity)
|
||||
end)
|
||||
it("Rarity", function()
|
||||
local item = new("Item", "Rarity: Normal\nCoral Ring")
|
||||
assert.are.equals("NORMAL", item.rarity)
|
||||
item = new("Item", "Rarity: Magic\nCoral Ring")
|
||||
assert.are.equals("MAGIC", item.rarity)
|
||||
item = new("Item", "Rarity: Rare\nName\nCoral Ring")
|
||||
assert.are.equals("RARE", item.rarity)
|
||||
item = new("Item", "Rarity: Unique\nName\nCoral Ring")
|
||||
assert.are.equals("UNIQUE", item.rarity)
|
||||
item = new("Item", "Rarity: Unique\nName\nCoral Ring\nFoil Unique (Verdant)")
|
||||
assert.are.equals("RELIC", item.rarity)
|
||||
end)
|
||||
|
||||
it("Superior/Synthesised", function()
|
||||
local item = new("Item", raw("", "Superior Plate Vest"))
|
||||
assert.are.equals("Plate Vest", item.baseName)
|
||||
item = new("Item", raw("", "Synthesised Plate Vest"))
|
||||
assert.are.equals("Plate Vest", item.baseName)
|
||||
item = new("Item", raw("", "Superior Synthesised Plate Vest"))
|
||||
assert.are.equals("Plate Vest", item.baseName)
|
||||
end)
|
||||
it("Superior/Synthesised", function()
|
||||
local item = new("Item", raw("", "Superior Plate Vest"))
|
||||
assert.are.equals("Plate Vest", item.baseName)
|
||||
item = new("Item", raw("", "Synthesised Plate Vest"))
|
||||
assert.are.equals("Plate Vest", item.baseName)
|
||||
item = new("Item", raw("", "Superior Synthesised Plate Vest"))
|
||||
assert.are.equals("Plate Vest", item.baseName)
|
||||
end)
|
||||
|
||||
it("Two-Toned Boots", function()
|
||||
local item = new("Item", raw("", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Armour/Energy Shield)", item.baseName)
|
||||
item = new("Item", raw("Armour: 10\nEnergy Shield: 10", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Armour/Energy Shield)", item.baseName)
|
||||
item = new("Item", raw("Armour: 10\nEvasion Rating: 10", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Armour/Evasion)", item.baseName)
|
||||
item = new("Item", raw("Evasion Rating: 10\nEnergy Shield: 10", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Evasion/Energy Shield)", item.baseName)
|
||||
end)
|
||||
it("Two-Toned Boots", function()
|
||||
local item = new("Item", raw("", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Armour/Energy Shield)", item.baseName)
|
||||
item = new("Item", raw("Armour: 10\nEnergy Shield: 10", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Armour/Energy Shield)", item.baseName)
|
||||
item = new("Item", raw("Armour: 10\nEvasion Rating: 10", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Armour/Evasion)", item.baseName)
|
||||
item = new("Item", raw("Evasion Rating: 10\nEnergy Shield: 10", "Two-Toned Boots"))
|
||||
assert.are.equals("Two-Toned Boots (Evasion/Energy Shield)", item.baseName)
|
||||
end)
|
||||
|
||||
it("Magic Two-Toned Boots", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Stalwart Two-Toned Boots of Plunder
|
||||
Armour: 100
|
||||
Energy Shield: 100
|
||||
]])
|
||||
assert.are.equal("Two-Toned Boots (Armour/Energy Shield)", item.baseName)
|
||||
assert.are.equal("Stalwart ", item.namePrefix)
|
||||
assert.are.equal(" of Plunder", item.nameSuffix)
|
||||
item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Sanguine Two-Toned Boots of the Phoenix
|
||||
Armour: 100
|
||||
Evasion Rating: 100
|
||||
]])
|
||||
assert.are.equal("Two-Toned Boots (Armour/Evasion)", item.baseName)
|
||||
assert.are.equal("Sanguine ", item.namePrefix)
|
||||
assert.are.equal(" of the Phoenix", item.nameSuffix)
|
||||
item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Stout Two-Toned Boots of the Lightning
|
||||
Evasion Rating: 100
|
||||
Energy Shield: 100
|
||||
]])
|
||||
assert.are.equal("Two-Toned Boots (Evasion/Energy Shield)", item.baseName)
|
||||
assert.are.equal("Stout ", item.namePrefix)
|
||||
assert.are.equal(" of the Lightning", item.nameSuffix)
|
||||
end)
|
||||
it("Magic Two-Toned Boots", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Stalwart Two-Toned Boots of Plunder
|
||||
Armour: 100
|
||||
Energy Shield: 100
|
||||
]])
|
||||
assert.are.equal("Two-Toned Boots (Armour/Energy Shield)", item.baseName)
|
||||
assert.are.equal("Stalwart ", item.namePrefix)
|
||||
assert.are.equal(" of Plunder", item.nameSuffix)
|
||||
item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Sanguine Two-Toned Boots of the Phoenix
|
||||
Armour: 100
|
||||
Evasion Rating: 100
|
||||
]])
|
||||
assert.are.equal("Two-Toned Boots (Armour/Evasion)", item.baseName)
|
||||
assert.are.equal("Sanguine ", item.namePrefix)
|
||||
assert.are.equal(" of the Phoenix", item.nameSuffix)
|
||||
item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Stout Two-Toned Boots of the Lightning
|
||||
Evasion Rating: 100
|
||||
Energy Shield: 100
|
||||
]])
|
||||
assert.are.equal("Two-Toned Boots (Evasion/Energy Shield)", item.baseName)
|
||||
assert.are.equal("Stout ", item.namePrefix)
|
||||
assert.are.equal(" of the Lightning", item.nameSuffix)
|
||||
end)
|
||||
|
||||
it("Title", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: Rare
|
||||
Phoenix Paw
|
||||
Iron Gauntlets
|
||||
]])
|
||||
assert.are.equal("Phoenix Paw", item.title)
|
||||
assert.are.equal("Iron Gauntlets", item.baseName)
|
||||
assert.are.equal("Phoenix Paw, Iron Gauntlets", item.name)
|
||||
end)
|
||||
it("Title", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: Rare
|
||||
Phoenix Paw
|
||||
Iron Gauntlets
|
||||
]])
|
||||
assert.are.equal("Phoenix Paw", item.title)
|
||||
assert.are.equal("Iron Gauntlets", item.baseName)
|
||||
assert.are.equal("Phoenix Paw, Iron Gauntlets", item.name)
|
||||
end)
|
||||
|
||||
it("Unique ID", function()
|
||||
local item = new("Item", raw("Unique ID: 40f9711d5bd7ad2bcbddaf71c705607aef0eecd3dcadaafec6c0192f79b82863"))
|
||||
assert.are.equals("40f9711d5bd7ad2bcbddaf71c705607aef0eecd3dcadaafec6c0192f79b82863", item.uniqueID)
|
||||
end)
|
||||
it("Unique ID", function()
|
||||
local item = new("Item", raw("Unique ID: 40f9711d5bd7ad2bcbddaf71c705607aef0eecd3dcadaafec6c0192f79b82863"))
|
||||
assert.are.equals("40f9711d5bd7ad2bcbddaf71c705607aef0eecd3dcadaafec6c0192f79b82863", item.uniqueID)
|
||||
end)
|
||||
|
||||
it("Item Level", function()
|
||||
local item = new("Item", raw("Item Level: 10"))
|
||||
assert.are.equals(10, item.itemLevel)
|
||||
end)
|
||||
it("Item Level", function()
|
||||
local item = new("Item", raw("Item Level: 10"))
|
||||
assert.are.equals(10, item.itemLevel)
|
||||
end)
|
||||
|
||||
it("Quality", function()
|
||||
local item = new("Item", raw("Quality: 10"))
|
||||
assert.are.equals(10, item.quality)
|
||||
item = new("Item", raw("Quality: +12% (augmented)"))
|
||||
assert.are.equals(12, item.quality)
|
||||
end)
|
||||
it("Quality", function()
|
||||
local item = new("Item", raw("Quality: 10"))
|
||||
assert.are.equals(10, item.quality)
|
||||
item = new("Item", raw("Quality: +12% (augmented)"))
|
||||
assert.are.equals(12, item.quality)
|
||||
end)
|
||||
|
||||
it("Sockets", function()
|
||||
local item = new("Item", raw("Sockets: R-G R-B-W A"))
|
||||
assert.are.same({
|
||||
{ color = "R", group = 0 },
|
||||
{ color = "G", group = 0 },
|
||||
{ color = "R", group = 1 },
|
||||
{ color = "B", group = 1 },
|
||||
{ color = "W", group = 1 },
|
||||
{ color = "A", group = 2 },
|
||||
}, item.sockets)
|
||||
end)
|
||||
it("Sockets", function()
|
||||
local item = new("Item", raw("Sockets: R-G R-B-W A"))
|
||||
assert.are.same({
|
||||
{ color = "R", group = 0 },
|
||||
{ color = "G", group = 0 },
|
||||
{ color = "R", group = 1 },
|
||||
{ color = "B", group = 1 },
|
||||
{ color = "W", group = 1 },
|
||||
{ color = "A", group = 2 },
|
||||
}, item.sockets)
|
||||
end)
|
||||
|
||||
it("Jewel", function()
|
||||
local item = new("Item", raw("Radius: Large\nLimited to: 2", "Cobalt Jewel"))
|
||||
assert.are.equals("Large", item.jewelRadiusLabel)
|
||||
assert.are.equals(2, item.limit)
|
||||
end)
|
||||
it("Jewel", function()
|
||||
local item = new("Item", raw("Radius: Large\nLimited to: 2", "Cobalt Jewel"))
|
||||
assert.are.equals("Large", item.jewelRadiusLabel)
|
||||
assert.are.equals(2, item.limit)
|
||||
end)
|
||||
|
||||
it("Variant name", function()
|
||||
local item = new("Item", raw("Variant: Pre 3.19.0\nVariant: Current"))
|
||||
assert.are.same({ "Pre 3.19.0", "Current" }, item.variantList)
|
||||
end)
|
||||
it("Variant name", function()
|
||||
local item = new("Item", raw("Variant: Pre 3.19.0\nVariant: Current"))
|
||||
assert.are.same({ "Pre 3.19.0", "Current" }, item.variantList)
|
||||
end)
|
||||
|
||||
it("Talisman Tier", function()
|
||||
local item = new("Item", raw("Talisman Tier: 3", "Rotfeather Talisman"))
|
||||
assert.are.equals(3, item.talismanTier)
|
||||
end)
|
||||
it("Talisman Tier", function()
|
||||
local item = new("Item", raw("Talisman Tier: 3", "Rotfeather Talisman"))
|
||||
assert.are.equals(3, item.talismanTier)
|
||||
end)
|
||||
|
||||
it("Defence", function()
|
||||
local item = new("Item", raw("Armour: 25"))
|
||||
assert.are.equals(25, item.armourData.Armour)
|
||||
item = new("Item", raw("Armour: 25 (augmented)"))
|
||||
assert.are.equals(25, item.armourData.Armour)
|
||||
item = new("Item", raw("Evasion Rating: 35", "Shabby Jerkin"))
|
||||
assert.are.equals(35, item.armourData.Evasion)
|
||||
item = new("Item", raw("Energy Shield: 15", "Simple Robe"))
|
||||
assert.are.equals(15, item.armourData.EnergyShield)
|
||||
item = new("Item", raw("Ward: 180", "Runic Crown"))
|
||||
assert.are.equals(180, item.armourData.Ward)
|
||||
end)
|
||||
it("Defence", function()
|
||||
local item = new("Item", raw("Armour: 25"))
|
||||
assert.are.equals(25, item.armourData.Armour)
|
||||
item = new("Item", raw("Armour: 25 (augmented)"))
|
||||
assert.are.equals(25, item.armourData.Armour)
|
||||
item = new("Item", raw("Evasion Rating: 35", "Shabby Jerkin"))
|
||||
assert.are.equals(35, item.armourData.Evasion)
|
||||
item = new("Item", raw("Energy Shield: 15", "Simple Robe"))
|
||||
assert.are.equals(15, item.armourData.EnergyShield)
|
||||
item = new("Item", raw("Ward: 180", "Runic Crown"))
|
||||
assert.are.equals(180, item.armourData.Ward)
|
||||
end)
|
||||
|
||||
it("Defence BasePercentile", function()
|
||||
local item = new("Item", raw("ArmourBasePercentile: 0.5"))
|
||||
assert.are.equals(0.5, item.armourData.ArmourBasePercentile)
|
||||
item = new("Item", raw("EvasionBasePercentile: 0.6", "Shabby Jerkin"))
|
||||
assert.are.equals(0.6, item.armourData.EvasionBasePercentile)
|
||||
item = new("Item", raw("EnergyShieldBasePercentile: 0.7", "Simple Robe"))
|
||||
assert.are.equals(0.7, item.armourData.EnergyShieldBasePercentile)
|
||||
item = new("Item", raw("WardBasePercentile: 0.8", "Runic Crown"))
|
||||
assert.are.equals(0.8, item.armourData.WardBasePercentile)
|
||||
end)
|
||||
it("Defence BasePercentile", function()
|
||||
local item = new("Item", raw("ArmourBasePercentile: 0.5"))
|
||||
assert.are.equals(0.5, item.armourData.ArmourBasePercentile)
|
||||
item = new("Item", raw("EvasionBasePercentile: 0.6", "Shabby Jerkin"))
|
||||
assert.are.equals(0.6, item.armourData.EvasionBasePercentile)
|
||||
item = new("Item", raw("EnergyShieldBasePercentile: 0.7", "Simple Robe"))
|
||||
assert.are.equals(0.7, item.armourData.EnergyShieldBasePercentile)
|
||||
item = new("Item", raw("WardBasePercentile: 0.8", "Runic Crown"))
|
||||
assert.are.equals(0.8, item.armourData.WardBasePercentile)
|
||||
end)
|
||||
|
||||
it("Requires Level", function()
|
||||
local item = new("Item", raw("Requires Level 10"))
|
||||
assert.are.equals(10, item.requirements.level)
|
||||
item = new("Item", raw("Level: 10"))
|
||||
assert.are.equals(10, item.requirements.level)
|
||||
item = new("Item", raw("LevelReq: 10"))
|
||||
assert.are.equals(10, item.requirements.level)
|
||||
end)
|
||||
it("Requires Level", function()
|
||||
local item = new("Item", raw("Requires Level 10"))
|
||||
assert.are.equals(10, item.requirements.level)
|
||||
item = new("Item", raw("Level: 10"))
|
||||
assert.are.equals(10, item.requirements.level)
|
||||
item = new("Item", raw("LevelReq: 10"))
|
||||
assert.are.equals(10, item.requirements.level)
|
||||
end)
|
||||
|
||||
it("Alt Variant", function()
|
||||
local item = new("Item", raw([[
|
||||
Has Alt Variant: true
|
||||
Has Alt Variant Two: true
|
||||
Has Alt Variant Three: true
|
||||
Has Alt Variant Four: true
|
||||
Has Alt Variant Five: true
|
||||
Selected Variant: 10
|
||||
Selected Alt Variant: 11
|
||||
Selected Alt Variant Two: 12
|
||||
Selected Alt Variant Three: 13
|
||||
Selected Alt Variant Four: 14
|
||||
Selected Alt Variant Five: 15
|
||||
]]))
|
||||
assert.truthy(item.hasAltVariant)
|
||||
assert.truthy(item.hasAltVariant2)
|
||||
assert.truthy(item.hasAltVariant3)
|
||||
assert.truthy(item.hasAltVariant4)
|
||||
assert.truthy(item.hasAltVariant5)
|
||||
assert.are.equals(10, item.variant)
|
||||
assert.are.equals(11, item.variantAlt)
|
||||
assert.are.equals(12, item.variantAlt2)
|
||||
assert.are.equals(13, item.variantAlt3)
|
||||
assert.are.equals(14, item.variantAlt4)
|
||||
assert.are.equals(15, item.variantAlt5)
|
||||
end)
|
||||
it("Alt Variant", function()
|
||||
local item = new("Item", raw([[
|
||||
Has Alt Variant: true
|
||||
Has Alt Variant Two: true
|
||||
Has Alt Variant Three: true
|
||||
Has Alt Variant Four: true
|
||||
Has Alt Variant Five: true
|
||||
Selected Variant: 10
|
||||
Selected Alt Variant: 11
|
||||
Selected Alt Variant Two: 12
|
||||
Selected Alt Variant Three: 13
|
||||
Selected Alt Variant Four: 14
|
||||
Selected Alt Variant Five: 15
|
||||
]]))
|
||||
assert.truthy(item.hasAltVariant)
|
||||
assert.truthy(item.hasAltVariant2)
|
||||
assert.truthy(item.hasAltVariant3)
|
||||
assert.truthy(item.hasAltVariant4)
|
||||
assert.truthy(item.hasAltVariant5)
|
||||
assert.are.equals(10, item.variant)
|
||||
assert.are.equals(11, item.variantAlt)
|
||||
assert.are.equals(12, item.variantAlt2)
|
||||
assert.are.equals(13, item.variantAlt3)
|
||||
assert.are.equals(14, item.variantAlt4)
|
||||
assert.are.equals(15, item.variantAlt5)
|
||||
end)
|
||||
|
||||
it("Prefix/Suffix", function()
|
||||
local item = new("Item", raw([[
|
||||
Prefix: {range:0.1}IncreasedLife1
|
||||
Suffix: {range:0.2}ColdResist1
|
||||
]]))
|
||||
assert.are.equals("IncreasedLife1", item.prefixes[1].modId)
|
||||
assert.are.equals(0.1, item.prefixes[1].range)
|
||||
assert.are.equals("ColdResist1", item.suffixes[1].modId)
|
||||
assert.are.equals(0.2, item.suffixes[1].range)
|
||||
end)
|
||||
it("Prefix/Suffix", function()
|
||||
local item = new("Item", raw([[
|
||||
Prefix: {range:0.1}IncreasedLife1
|
||||
Suffix: {range:0.2}ColdResist1
|
||||
]]))
|
||||
assert.are.equals("IncreasedLife1", item.prefixes[1].modId)
|
||||
assert.are.equals(0.1, item.prefixes[1].range)
|
||||
assert.are.equals("ColdResist1", item.suffixes[1].modId)
|
||||
assert.are.equals(0.2, item.suffixes[1].range)
|
||||
end)
|
||||
|
||||
it("Implicits", function()
|
||||
local item = new("Item", raw([[
|
||||
Implicits: 2
|
||||
+8 to Strength
|
||||
+10 to Intelligence
|
||||
+12 to Dexterity
|
||||
]]))
|
||||
assert.are.equals(2, #item.implicitModLines)
|
||||
assert.are.equals("+8 to Strength", item.implicitModLines[1].line)
|
||||
assert.are.equals("+10 to Intelligence", item.implicitModLines[2].line)
|
||||
assert.are.equals(1, #item.explicitModLines)
|
||||
assert.are.equals("+12 to Dexterity", item.explicitModLines[1].line)
|
||||
end)
|
||||
it("Implicits", function()
|
||||
local item = new("Item", raw([[
|
||||
Implicits: 2
|
||||
+8 to Strength
|
||||
+10 to Intelligence
|
||||
+12 to Dexterity
|
||||
]]))
|
||||
assert.are.equals(2, #item.implicitModLines)
|
||||
assert.are.equals("+8 to Strength", item.implicitModLines[1].line)
|
||||
assert.are.equals("+10 to Intelligence", item.implicitModLines[2].line)
|
||||
assert.are.equals(1, #item.explicitModLines)
|
||||
assert.are.equals("+12 to Dexterity", item.explicitModLines[1].line)
|
||||
end)
|
||||
|
||||
it("League", function()
|
||||
local item = new("Item", raw("League: Heist"))
|
||||
assert.are.equals("Heist", item.league)
|
||||
end)
|
||||
it("League", function()
|
||||
local item = new("Item", raw("League: Heist"))
|
||||
assert.are.equals("Heist", item.league)
|
||||
end)
|
||||
|
||||
it("Source", function()
|
||||
local item = new("Item", raw("Source: No longer obtainable"))
|
||||
assert.are.equals("No longer obtainable", item.source)
|
||||
end)
|
||||
it("Source", function()
|
||||
local item = new("Item", raw("Source: No longer obtainable"))
|
||||
assert.are.equals("No longer obtainable", item.source)
|
||||
end)
|
||||
|
||||
it("Note", function()
|
||||
local item = new("Item", raw("Note: ~price 1 chaos"))
|
||||
assert.are.equals("~price 1 chaos", item.note)
|
||||
end)
|
||||
it("Note", function()
|
||||
local item = new("Item", raw("Note: ~price 1 chaos"))
|
||||
assert.are.equals("~price 1 chaos", item.note)
|
||||
end)
|
||||
|
||||
it("Attribute Requirements", function()
|
||||
local item = new("Item", raw("Dex: 100"))
|
||||
assert.are.equals(100, item.requirements.dex)
|
||||
item = new("Item", raw("Int: 101"))
|
||||
assert.are.equals(101, item.requirements.int)
|
||||
item = new("Item", raw("Str: 102"))
|
||||
assert.are.equals(102, item.requirements.str)
|
||||
end)
|
||||
it("Attribute Requirements", function()
|
||||
local item = new("Item", raw("Dex: 100"))
|
||||
assert.are.equals(100, item.requirements.dex)
|
||||
item = new("Item", raw("Int: 101"))
|
||||
assert.are.equals(101, item.requirements.int)
|
||||
item = new("Item", raw("Str: 102"))
|
||||
assert.are.equals(102, item.requirements.str)
|
||||
end)
|
||||
|
||||
it("Requires Class", function()
|
||||
local item = new("Item", raw("Requires Class Witch"))
|
||||
assert.are.equals("Witch", item.classRestriction)
|
||||
item = new("Item", raw("Class:: Witch"))
|
||||
assert.are.equals("Witch", item.classRestriction)
|
||||
end)
|
||||
it("Requires Class", function()
|
||||
local item = new("Item", raw("Requires Class Witch"))
|
||||
assert.are.equals("Witch", item.classRestriction)
|
||||
item = new("Item", raw("Class:: Witch"))
|
||||
assert.are.equals("Witch", item.classRestriction)
|
||||
end)
|
||||
|
||||
it("Requires Class variant", function()
|
||||
local item = new("Item", raw([[
|
||||
Selected Variant: 2
|
||||
+8 to Strength
|
||||
{variant:1}Requires Class Witch
|
||||
{variant:2}Requires Class Templar
|
||||
]]))
|
||||
assert.are.equals(2, item.variant)
|
||||
assert.are.equals("Templar", item.classRestriction)
|
||||
end)
|
||||
it("Requires Class variant", function()
|
||||
local item = new("Item", raw([[
|
||||
Selected Variant: 2
|
||||
+8 to Strength
|
||||
{variant:1}Requires Class Witch
|
||||
{variant:2}Requires Class Templar
|
||||
]]))
|
||||
assert.are.equals(2, item.variant)
|
||||
assert.are.equals("Templar", item.classRestriction)
|
||||
end)
|
||||
|
||||
it("Influence", function()
|
||||
local item = new("Item", raw("Shaper Item"))
|
||||
assert.truthy(item.shaper)
|
||||
item = new("Item", raw("Elder Item"))
|
||||
assert.truthy(item.elder)
|
||||
item = new("Item", raw("Warlord Item"))
|
||||
assert.truthy(item.adjudicator)
|
||||
item = new("Item", raw("Hunter Item"))
|
||||
assert.truthy(item.basilisk)
|
||||
item = new("Item", raw("Crusader Item"))
|
||||
assert.truthy(item.crusader)
|
||||
item = new("Item", raw("Redeemer Item"))
|
||||
assert.truthy(item.eyrie)
|
||||
item = new("Item", raw("Searing Exarch Item"))
|
||||
assert.truthy(item.cleansing)
|
||||
item = new("Item", raw("Eater of Worlds Item"))
|
||||
assert.truthy(item.tangle)
|
||||
end)
|
||||
it("Influence", function()
|
||||
local item = new("Item", raw("Shaper Item"))
|
||||
assert.truthy(item.shaper)
|
||||
item = new("Item", raw("Elder Item"))
|
||||
assert.truthy(item.elder)
|
||||
item = new("Item", raw("Warlord Item"))
|
||||
assert.truthy(item.adjudicator)
|
||||
item = new("Item", raw("Hunter Item"))
|
||||
assert.truthy(item.basilisk)
|
||||
item = new("Item", raw("Crusader Item"))
|
||||
assert.truthy(item.crusader)
|
||||
item = new("Item", raw("Redeemer Item"))
|
||||
assert.truthy(item.eyrie)
|
||||
item = new("Item", raw("Searing Exarch Item"))
|
||||
assert.truthy(item.cleansing)
|
||||
item = new("Item", raw("Eater of Worlds Item"))
|
||||
assert.truthy(item.tangle)
|
||||
end)
|
||||
|
||||
it("short flags", function()
|
||||
local item = new("Item", raw("Split"))
|
||||
assert.truthy(item.split)
|
||||
item = new("Item", raw("Mirrored"))
|
||||
assert.truthy(item.mirrored)
|
||||
item = new("Item", raw("Corrupted"))
|
||||
assert.truthy(item.corrupted)
|
||||
item = new("Item", raw("Fractured Item"))
|
||||
assert.truthy(item.fractured)
|
||||
item = new("Item", raw("Synthesised Item"))
|
||||
assert.truthy(item.synthesised)
|
||||
item = new("Item", raw("Crafted: true"))
|
||||
assert.truthy(item.crafted)
|
||||
item = new("Item", raw("Unreleased: true"))
|
||||
assert.truthy(item.unreleased)
|
||||
end)
|
||||
it("short flags", function()
|
||||
local item = new("Item", raw("Split"))
|
||||
assert.truthy(item.split)
|
||||
item = new("Item", raw("Mirrored"))
|
||||
assert.truthy(item.mirrored)
|
||||
item = new("Item", raw("Corrupted"))
|
||||
assert.truthy(item.corrupted)
|
||||
item = new("Item", raw("Fractured Item"))
|
||||
assert.truthy(item.fractured)
|
||||
item = new("Item", raw("Synthesised Item"))
|
||||
assert.truthy(item.synthesised)
|
||||
item = new("Item", raw("Crafted: true"))
|
||||
assert.truthy(item.crafted)
|
||||
item = new("Item", raw("Unreleased: true"))
|
||||
assert.truthy(item.unreleased)
|
||||
end)
|
||||
|
||||
it("long flags", function()
|
||||
local item = new("Item", raw("This item can be anointed by Cassia"))
|
||||
assert.truthy(item.canBeAnointed)
|
||||
item = new("Item", raw("Can have a second Enchantment Modifier"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
item = new("Item", raw("Can have 1 additional Enchantment Modifiers"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
item = new("Item", raw("Can have 2 additional Enchantment Modifiers"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
assert.truthy(item.canHaveThreeEnchants)
|
||||
item = new("Item", raw("Can have 3 additional Enchantment Modifiers"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
assert.truthy(item.canHaveThreeEnchants)
|
||||
assert.truthy(item.canHaveFourEnchants)
|
||||
item = new("Item", raw("Has a Crucible Passive Skill Tree with only Support Passive Skills"))
|
||||
assert.truthy(item.canHaveOnlySupportSkillsCrucibleTree)
|
||||
item = new("Item", raw("Has a Crucible Passive Skill Tree"))
|
||||
assert.truthy(item.canHaveShieldCrucibleTree)
|
||||
item = new("Item", raw("Has a Two Handed Sword Crucible Passive Skill Tree"))
|
||||
assert.truthy(item.canHaveTwoHandedSwordCrucibleTree)
|
||||
end)
|
||||
|
||||
it("tags", function()
|
||||
local item = new("Item", raw("{tags:life,physical_damage}+8 to Strength"))
|
||||
assert.are.same({ "life", "physical_damage" }, item.explicitModLines[1].modTags)
|
||||
end)
|
||||
it("long flags", function()
|
||||
local item = new("Item", raw("This item can be anointed by Cassia"))
|
||||
assert.truthy(item.canBeAnointed)
|
||||
item = new("Item", raw("Can have a second Enchantment Modifier"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
item = new("Item", raw("Can have 1 additional Enchantment Modifiers"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
item = new("Item", raw("Can have 2 additional Enchantment Modifiers"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
assert.truthy(item.canHaveThreeEnchants)
|
||||
item = new("Item", raw("Can have 3 additional Enchantment Modifiers"))
|
||||
assert.truthy(item.canHaveTwoEnchants)
|
||||
assert.truthy(item.canHaveThreeEnchants)
|
||||
assert.truthy(item.canHaveFourEnchants)
|
||||
item = new("Item", raw("Has a Crucible Passive Skill Tree with only Support Passive Skills"))
|
||||
assert.truthy(item.canHaveOnlySupportSkillsCrucibleTree)
|
||||
item = new("Item", raw("Has a Crucible Passive Skill Tree"))
|
||||
assert.truthy(item.canHaveShieldCrucibleTree)
|
||||
item = new("Item", raw("Has a Two Handed Sword Crucible Passive Skill Tree"))
|
||||
assert.truthy(item.canHaveTwoHandedSwordCrucibleTree)
|
||||
end)
|
||||
|
||||
it("tags", function()
|
||||
local item = new("Item", raw("{tags:life,physical_damage}+8 to Strength"))
|
||||
assert.are.same({ "life", "physical_damage" }, item.explicitModLines[1].modTags)
|
||||
end)
|
||||
|
||||
it("variant", function()
|
||||
local item = new("Item", raw([[
|
||||
Selected Variant: 2
|
||||
{variant:1}+8 to Strength
|
||||
{variant:2,3}+10 to Strength
|
||||
]]))
|
||||
assert.are.equals(2, item.variant)
|
||||
assert.are.same({ [1] = true }, item.explicitModLines[1].variantList)
|
||||
assert.are.same({ [2] = true, [3] = true }, item.explicitModLines[2].variantList)
|
||||
assert.are.equals(10, item.baseModList[1].value) -- variant 2 has +10 to Strength
|
||||
end)
|
||||
it("variant", function()
|
||||
local item = new("Item", raw([[
|
||||
Selected Variant: 2
|
||||
{variant:1}+8 to Strength
|
||||
{variant:2,3}+10 to Strength
|
||||
]]))
|
||||
assert.are.equals(2, item.variant)
|
||||
assert.are.same({ [1] = true }, item.explicitModLines[1].variantList)
|
||||
assert.are.same({ [2] = true, [3] = true }, item.explicitModLines[2].variantList)
|
||||
assert.are.equals(10, item.baseModList[1].value) -- variant 2 has +10 to Strength
|
||||
end)
|
||||
|
||||
it("range", function()
|
||||
local item = new("Item", raw("{range:0.8}+(8-12) to Strength"))
|
||||
assert.are.equals(0.8, item.explicitModLines[1].range)
|
||||
assert.are.equals(11, item.baseModList[1].value) -- range 0.8 of (8-12) = 11
|
||||
end)
|
||||
it("range", function()
|
||||
local item = new("Item", raw("{range:0.8}+(8-12) to Strength"))
|
||||
assert.are.equals(0.8, item.explicitModLines[1].range)
|
||||
assert.are.equals(11, item.baseModList[1].value) -- range 0.8 of (8-12) = 11
|
||||
end)
|
||||
|
||||
it("crafted", function()
|
||||
local item = new("Item", raw("{crafted}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].crafted)
|
||||
item = new("Item", raw("+8 to Strength (crafted)"))
|
||||
assert.truthy(item.explicitModLines[1].crafted)
|
||||
end)
|
||||
it("crafted", function()
|
||||
local item = new("Item", raw("{crafted}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].crafted)
|
||||
item = new("Item", raw("+8 to Strength (crafted)"))
|
||||
assert.truthy(item.explicitModLines[1].crafted)
|
||||
end)
|
||||
|
||||
it("crucible", function()
|
||||
local item = new("Item", raw("{crucible}+8 to Strength"))
|
||||
assert.truthy(item.crucibleModLines[1].crucible)
|
||||
item = new("Item", raw("+8 to Strength (crucible)"))
|
||||
assert.truthy(item.crucibleModLines[1].crucible)
|
||||
end)
|
||||
it("crucible", function()
|
||||
local item = new("Item", raw("{crucible}+8 to Strength"))
|
||||
assert.truthy(item.crucibleModLines[1].crucible)
|
||||
item = new("Item", raw("+8 to Strength (crucible)"))
|
||||
assert.truthy(item.crucibleModLines[1].crucible)
|
||||
end)
|
||||
|
||||
it("custom", function()
|
||||
local item = new("Item", raw("{custom}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].custom)
|
||||
end)
|
||||
it("custom", function()
|
||||
local item = new("Item", raw("{custom}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].custom)
|
||||
end)
|
||||
|
||||
it("eater", function()
|
||||
local item = new("Item", raw("{eater}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].eater)
|
||||
end)
|
||||
it("eater", function()
|
||||
local item = new("Item", raw("{eater}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].eater)
|
||||
end)
|
||||
|
||||
it("enchant", function()
|
||||
local item = new("Item", raw("+8 to Strength (enchant)"))
|
||||
assert.are.equals(1, #item.enchantModLines)
|
||||
-- enchant also sets crafted and implicit
|
||||
assert.truthy(item.enchantModLines[1].crafted)
|
||||
assert.truthy(item.enchantModLines[1].implicit)
|
||||
end)
|
||||
it("enchant", function()
|
||||
local item = new("Item", raw("+8 to Strength (enchant)"))
|
||||
assert.are.equals(1, #item.enchantModLines)
|
||||
-- enchant also sets crafted and implicit
|
||||
assert.truthy(item.enchantModLines[1].crafted)
|
||||
assert.truthy(item.enchantModLines[1].implicit)
|
||||
end)
|
||||
|
||||
it("exarch", function()
|
||||
local item = new("Item", raw("{exarch}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].exarch)
|
||||
end)
|
||||
it("exarch", function()
|
||||
local item = new("Item", raw("{exarch}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].exarch)
|
||||
end)
|
||||
|
||||
it("fractured", function()
|
||||
local item = new("Item", raw("{fractured}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].fractured)
|
||||
item = new("Item", raw("+8 to Strength (fractured)"))
|
||||
assert.truthy(item.explicitModLines[1].fractured)
|
||||
end)
|
||||
it("fractured", function()
|
||||
local item = new("Item", raw("{fractured}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].fractured)
|
||||
item = new("Item", raw("+8 to Strength (fractured)"))
|
||||
assert.truthy(item.explicitModLines[1].fractured)
|
||||
end)
|
||||
|
||||
it("implicit", function()
|
||||
local item = new("Item", raw("+8 to Strength (implicit)"))
|
||||
assert.truthy(item.implicitModLines[1].implicit)
|
||||
end)
|
||||
it("implicit", function()
|
||||
local item = new("Item", raw("+8 to Strength (implicit)"))
|
||||
assert.truthy(item.implicitModLines[1].implicit)
|
||||
end)
|
||||
|
||||
it("scourge", function()
|
||||
local item = new("Item", raw("{scourge}+8 to Strength"))
|
||||
assert.truthy(item.scourgeModLines[1].scourge)
|
||||
item = new("Item", raw("+8 to Strength (scourge)"))
|
||||
assert.truthy(item.scourgeModLines[1].scourge)
|
||||
end)
|
||||
it("scourge", function()
|
||||
local item = new("Item", raw("{scourge}+8 to Strength"))
|
||||
assert.truthy(item.scourgeModLines[1].scourge)
|
||||
item = new("Item", raw("+8 to Strength (scourge)"))
|
||||
assert.truthy(item.scourgeModLines[1].scourge)
|
||||
end)
|
||||
|
||||
it("synthesis", function()
|
||||
local item = new("Item", raw("{synthesis}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].synthesis)
|
||||
end)
|
||||
it("synthesis", function()
|
||||
local item = new("Item", raw("{synthesis}+8 to Strength"))
|
||||
assert.truthy(item.explicitModLines[1].synthesis)
|
||||
end)
|
||||
|
||||
it("multiple bases", function()
|
||||
local item = new("Item", [[
|
||||
Ashcaller
|
||||
Selected Variant: 3
|
||||
{variant:1,2,3}Quartz Wand
|
||||
{variant:4}Carved Wand
|
||||
]])
|
||||
assert.are.same({
|
||||
["Quartz Wand"] = { line = "Quartz Wand", variantList = { [1] = true, [2] = true, [3] = true } },
|
||||
["Carved Wand"] = { line = "Carved Wand", variantList = { [4] = true } }
|
||||
}, item.baseLines)
|
||||
assert.are.equals("Quartz Wand", item.baseName)
|
||||
it("multiple bases", function()
|
||||
local item = new("Item", [[
|
||||
Ashcaller
|
||||
Selected Variant: 3
|
||||
{variant:1,2,3}Quartz Wand
|
||||
{variant:4}Carved Wand
|
||||
]])
|
||||
assert.are.same({
|
||||
["Quartz Wand"] = { line = "Quartz Wand", variantList = { [1] = true, [2] = true, [3] = true } },
|
||||
["Carved Wand"] = { line = "Carved Wand", variantList = { [4] = true } }
|
||||
}, item.baseLines)
|
||||
assert.are.equals("Quartz Wand", item.baseName)
|
||||
|
||||
item = new("Item", [[
|
||||
Ashcaller
|
||||
Selected Variant: 4
|
||||
{variant:1,2,3}Quartz Wand
|
||||
{variant:4}Carved Wand
|
||||
]])
|
||||
assert.are.equals("Carved Wand", item.baseName)
|
||||
end)
|
||||
item = new("Item", [[
|
||||
Ashcaller
|
||||
Selected Variant: 4
|
||||
{variant:1,2,3}Quartz Wand
|
||||
{variant:4}Carved Wand
|
||||
]])
|
||||
assert.are.equals("Carved Wand", item.baseName)
|
||||
end)
|
||||
|
||||
it("parses text without armour value then changes quality and has correct final armour", function()
|
||||
local item = new("Item", [[
|
||||
Armour Gloves
|
||||
Iron Gauntlets
|
||||
Quality: 0
|
||||
]])
|
||||
it("parses text without armour value then changes quality and has correct final armour", function()
|
||||
local item = new("Item", [[
|
||||
Armour Gloves
|
||||
Iron Gauntlets
|
||||
Quality: 0
|
||||
]])
|
||||
|
||||
local original = item.armourData.Armour
|
||||
item.quality = 20
|
||||
item:BuildAndParseRaw()
|
||||
assert.are.equals(round(original * 1.2), item.armourData.Armour)
|
||||
end)
|
||||
local original = item.armourData.Armour
|
||||
item.quality = 20
|
||||
item:BuildAndParseRaw()
|
||||
assert.are.equals(round(original * 1.2), item.armourData.Armour)
|
||||
end)
|
||||
|
||||
it("magic item", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: MAGIC
|
||||
Name Prefix Iron Gauntlets -> +50 ignite chance
|
||||
+50% chance to Ignite
|
||||
]])
|
||||
it("magic item", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: MAGIC
|
||||
Name Prefix Iron Gauntlets -> +50 ignite chance
|
||||
+50% chance to Ignite
|
||||
]])
|
||||
|
||||
assert.are.equals("Name Prefix ", item.namePrefix)
|
||||
assert.are.equals(" -> +50 ignite chance", item.nameSuffix)
|
||||
assert.are.equals("Iron Gauntlets", item.baseName)
|
||||
assert.are.equals(1, #item.explicitModLines)
|
||||
assert.are.equals("+50% chance to Ignite", item.explicitModLines[1].line)
|
||||
end)
|
||||
assert.are.equals("Name Prefix ", item.namePrefix)
|
||||
assert.are.equals(" -> +50 ignite chance", item.nameSuffix)
|
||||
assert.are.equals("Iron Gauntlets", item.baseName)
|
||||
assert.are.equals(1, #item.explicitModLines)
|
||||
assert.are.equals("+50% chance to Ignite", item.explicitModLines[1].line)
|
||||
end)
|
||||
|
||||
it("Energy Blade", function()
|
||||
local item = new("Item", [[
|
||||
Item Class: One Hand Swords
|
||||
Rarity: Magic
|
||||
Superior Energy Blade
|
||||
]])
|
||||
assert.are.equal("Energy Blade One Handed", item.baseName)
|
||||
item = new("Item", [[
|
||||
Item Class: Two Hand Swords
|
||||
Rarity: Magic
|
||||
Superior Energy Blade
|
||||
]])
|
||||
assert.are.equal("Energy Blade Two Handed", item.baseName)
|
||||
end)
|
||||
it("Energy Blade", function()
|
||||
local item = new("Item", [[
|
||||
Item Class: One Hand Swords
|
||||
Rarity: Magic
|
||||
Superior Energy Blade
|
||||
]])
|
||||
assert.are.equal("Energy Blade One Handed", item.baseName)
|
||||
item = new("Item", [[
|
||||
Item Class: Two Hand Swords
|
||||
Rarity: Magic
|
||||
Superior Energy Blade
|
||||
]])
|
||||
assert.are.equal("Energy Blade Two Handed", item.baseName)
|
||||
end)
|
||||
|
||||
it("Flask buff", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Chemist's Granite Flask of the Opossum
|
||||
]])
|
||||
assert.are.equal(1, #item.buffModLines)
|
||||
assert.are.equal("+1500 to Armour", item.buffModLines[1].line)
|
||||
end)
|
||||
it("Flask buff", function()
|
||||
local item = new("Item", [[
|
||||
Rarity: Magic
|
||||
Chemist's Granite Flask of the Opossum
|
||||
]])
|
||||
assert.are.equal(1, #item.buffModLines)
|
||||
assert.are.equal("+1500 to Armour", item.buffModLines[1].line)
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
local applyRangeTests = {
|
||||
-- Number without range
|
||||
[{ "+10 to maximum Life", 1.0, 1.0 }] = "+10 to maximum Life",
|
||||
[{ "+10 to maximum Life", 1.0, 1.5 }] = "+15 to maximum Life",
|
||||
[{ "+10 to maximum Life", 0.5, 1.0 }] = "+10 to maximum Life",
|
||||
[{ "+10 to maximum Life", 0.5, 1.5 }] = "+15 to maximum Life",
|
||||
-- One range
|
||||
[{ "+(10-20) to maximum Life", 1.0, 1.0 }] = "+20 to maximum Life",
|
||||
[{ "+(10-20) to maximum Life", 1.0, 1.5 }] = "+30 to maximum Life",
|
||||
[{ "+(10-20) to maximum Life", 0.5, 1.0 }] = "+15 to maximum Life",
|
||||
[{ "+(10-20) to maximum Life", 0.5, 1.5 }] = "+22 to maximum Life",
|
||||
-- Two ranges
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 1.0, 1.0 }] = "Adds 80 to 300 Physical Damage",
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 1.0, 1.5 }] = "Adds 120 to 450 Physical Damage",
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 0.5, 1.0 }] = "Adds 70 to 285 Physical Damage",
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 0.5, 1.5 }] = "Adds 105 to 427 Physical Damage",
|
||||
-- Range with increased/reduced
|
||||
[{ "(10--10)% increased Charges per use", 1.0, 1.0 }] = "10% reduced Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 1.0, 1.5 }] = "15% reduced Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.5, 1.0 }] = "0% increased Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.5, 1.5 }] = "0% increased Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.0, 1.0 }] = "10% increased Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.0, 1.5 }] = "15% increased Charges per use",
|
||||
-- Range with constant numbers after
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 1.0, 1.0 }] = "20% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 1.0, 1.5 }] = "30% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 0.5, 1.0 }] = "18% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 0.5, 1.5 }] = "27% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
-- High precision range
|
||||
[{ "Regenerate (66.7-75) Life per second", 1.0, 1.0 }] = "Regenerate 75 Life per second",
|
||||
[{ "Regenerate (66.7-75) Life per second", 1.0, 1.5 }] = "Regenerate 112.5 Life per second",
|
||||
[{ "Regenerate (66.7-75) Life per second", 0.5, 1.0 }] = "Regenerate 70.9 Life per second",
|
||||
[{ "Regenerate (66.7-75) Life per second", 0.5, 1.5 }] = "Regenerate 106.3 Life per second",
|
||||
-- Range with plus sign that is removed when negative
|
||||
[{ "+(-25-50)% to Fire Resistance", 1.0, 1.0 }] = "+50% to Fire Resistance",
|
||||
[{ "+(-25-50)% to Fire Resistance", 1.0, 1.5 }] = "+75% to Fire Resistance",
|
||||
[{ "+(-25-50)% to Fire Resistance", 0.0, 1.0 }] = "-25% to Fire Resistance",
|
||||
[{ "+(-25-50)% to Fire Resistance", 0.0, 1.5 }] = "-37% to Fire Resistance",
|
||||
-- Number without range
|
||||
[{ "+10 to maximum Life", 1.0, 1.0 }] = "+10 to maximum Life",
|
||||
[{ "+10 to maximum Life", 1.0, 1.5 }] = "+15 to maximum Life",
|
||||
[{ "+10 to maximum Life", 0.5, 1.0 }] = "+10 to maximum Life",
|
||||
[{ "+10 to maximum Life", 0.5, 1.5 }] = "+15 to maximum Life",
|
||||
-- One range
|
||||
[{ "+(10-20) to maximum Life", 1.0, 1.0 }] = "+20 to maximum Life",
|
||||
[{ "+(10-20) to maximum Life", 1.0, 1.5 }] = "+30 to maximum Life",
|
||||
[{ "+(10-20) to maximum Life", 0.5, 1.0 }] = "+15 to maximum Life",
|
||||
[{ "+(10-20) to maximum Life", 0.5, 1.5 }] = "+22 to maximum Life",
|
||||
-- Two ranges
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 1.0, 1.0 }] = "Adds 80 to 300 Physical Damage",
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 1.0, 1.5 }] = "Adds 120 to 450 Physical Damage",
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 0.5, 1.0 }] = "Adds 70 to 285 Physical Damage",
|
||||
[{ "Adds (60-80) to (270-300) Physical Damage", 0.5, 1.5 }] = "Adds 105 to 427 Physical Damage",
|
||||
-- Range with increased/reduced
|
||||
[{ "(10--10)% increased Charges per use", 1.0, 1.0 }] = "10% reduced Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 1.0, 1.5 }] = "15% reduced Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.5, 1.0 }] = "0% increased Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.5, 1.5 }] = "0% increased Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.0, 1.0 }] = "10% increased Charges per use",
|
||||
[{ "(10--10)% increased Charges per use", 0.0, 1.5 }] = "15% increased Charges per use",
|
||||
-- Range with constant numbers after
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 1.0, 1.0 }] = "20% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 1.0, 1.5 }] = "30% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 0.5, 1.0 }] = "18% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
[{ "(15-20)% increased Cold Damage per 1% Cold Resistance above 75%", 0.5, 1.5 }] = "27% increased Cold Damage per 1% Cold Resistance above 75%",
|
||||
-- High precision range
|
||||
[{ "Regenerate (66.7-75) Life per second", 1.0, 1.0 }] = "Regenerate 75 Life per second",
|
||||
[{ "Regenerate (66.7-75) Life per second", 1.0, 1.5 }] = "Regenerate 112.5 Life per second",
|
||||
[{ "Regenerate (66.7-75) Life per second", 0.5, 1.0 }] = "Regenerate 70.9 Life per second",
|
||||
[{ "Regenerate (66.7-75) Life per second", 0.5, 1.5 }] = "Regenerate 106.3 Life per second",
|
||||
-- Range with plus sign that is removed when negative
|
||||
[{ "+(-25-50)% to Fire Resistance", 1.0, 1.0 }] = "+50% to Fire Resistance",
|
||||
[{ "+(-25-50)% to Fire Resistance", 1.0, 1.5 }] = "+75% to Fire Resistance",
|
||||
[{ "+(-25-50)% to Fire Resistance", 0.0, 1.0 }] = "-25% to Fire Resistance",
|
||||
[{ "+(-25-50)% to Fire Resistance", 0.0, 1.5 }] = "-37% to Fire Resistance",
|
||||
}
|
||||
|
||||
describe("TestItemTools", function()
|
||||
for args, expected in pairs(applyRangeTests) do
|
||||
it(string.format("tests applyRange('%s', %.2f, %.2f)", unpack(args)), function()
|
||||
local result = itemLib.applyRange(unpack(args))
|
||||
assert.are.equals(expected, result)
|
||||
end)
|
||||
end
|
||||
for args, expected in pairs(applyRangeTests) do
|
||||
it(string.format("tests applyRange('%s', %.2f, %.2f)", unpack(args)), function()
|
||||
local result = itemLib.applyRange(unpack(args))
|
||||
assert.are.equals(expected, result)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
@@ -1,61 +1,61 @@
|
||||
describe("TestAttacks", function()
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
before_each(function()
|
||||
newBuild()
|
||||
end)
|
||||
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
teardown(function()
|
||||
-- newBuild() takes care of resetting everything in setup()
|
||||
end)
|
||||
|
||||
it("adds envy, ensures +1 level keeps level 25 Envy", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nAssassin Bow\nGrants Level 1 Summon Raging Spirit\nGrants Level 25 Envy Skill")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(205, build.calcsTab.mainEnv.minion.modDB:Sum("BASE", build.calcsTab.mainEnv.minion.mainSkill.skillCfg, "ChaosMin"))
|
||||
it("adds envy, ensures +1 level keeps level 25 Envy", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw("New Item\nAssassin Bow\nGrants Level 1 Summon Raging Spirit\nGrants Level 25 Envy Skill")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(205, build.calcsTab.mainEnv.minion.modDB:Sum("BASE", build.calcsTab.mainEnv.minion.mainSkill.skillCfg, "ChaosMin"))
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nAwakened Generosity 4/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(round(205 * 1.43), build.calcsTab.mainEnv.minion.modDB:Sum("BASE", build.calcsTab.mainEnv.minion.mainSkill.skillCfg, "ChaosMin"))
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nAwakened Generosity 4/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
assert.are.equals(round(205 * 1.43), build.calcsTab.mainEnv.minion.modDB:Sum("BASE", build.calcsTab.mainEnv.minion.mainSkill.skillCfg, "ChaosMin"))
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nAwakened Generosity 5/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
-- No Envy level increase, so base should still be 205
|
||||
assert.are.equals(round(205 * 1.44), build.calcsTab.mainEnv.minion.modDB:Sum("BASE", build.calcsTab.mainEnv.minion.mainSkill.skillCfg, "ChaosMin"))
|
||||
end)
|
||||
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nAwakened Generosity 5/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
-- No Envy level increase, so base should still be 205
|
||||
assert.are.equals(round(205 * 1.44), build.calcsTab.mainEnv.minion.modDB:Sum("BASE", build.calcsTab.mainEnv.minion.mainSkill.skillCfg, "ChaosMin"))
|
||||
end)
|
||||
|
||||
it("Test Mirage Archer using triggered skill", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[+3 Bow
|
||||
Thicket Bow
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}LocalIncreaseSocketedGemLevel1
|
||||
Prefix: {range:0.5}LocalIncreaseSocketedBowGemLevel2
|
||||
Prefix: None
|
||||
Suffix: {range:0.5}LocalIncreasedAttackSpeed2
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: G-G-G-G-G-G
|
||||
LevelReq: 56
|
||||
Implicits: 0
|
||||
+1 to Level of Socketed Gems
|
||||
+2 to Level of Socketed Bow Gems
|
||||
9% increased Attack Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[+3 Bow
|
||||
Thicket Bow
|
||||
Crafted: true
|
||||
Prefix: {range:0.5}LocalIncreaseSocketedGemLevel1
|
||||
Prefix: {range:0.5}LocalIncreaseSocketedBowGemLevel2
|
||||
Prefix: None
|
||||
Suffix: {range:0.5}LocalIncreasedAttackSpeed2
|
||||
Suffix: None
|
||||
Suffix: None
|
||||
Quality: 20
|
||||
Sockets: G-G-G-G-G-G
|
||||
LevelReq: 56
|
||||
Implicits: 0
|
||||
+1 to Level of Socketed Gems
|
||||
+2 to Level of Socketed Bow Gems
|
||||
9% increased Attack Speed]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Mirage Archer 20/0 Default 1\nRain of Arrows 20/0 Default 1\nManaforged Arrows 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
build.skillsTab:PasteSocketGroup("Mirage Archer 20/0 Default 1\nRain of Arrows 20/0 Default 1\nManaforged Arrows 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Toxic Rain 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
build.skillsTab:PasteSocketGroup("Toxic Rain 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.True(build.calcsTab.mainOutput.MirageDPS ~= nil)
|
||||
assert.True(build.calcsTab.mainOutput.MirageDPS ~= nil)
|
||||
|
||||
assert.True(build.calcsTab.mainOutput.SkillTriggerRate == build.calcsTab.mainOutput.Speed)
|
||||
end)
|
||||
assert.True(build.calcsTab.mainOutput.SkillTriggerRate == build.calcsTab.mainOutput.Speed)
|
||||
end)
|
||||
|
||||
it("Test Sacred wisps using current skill", function()
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Elemental Wand
|
||||
build.itemsTab:CreateDisplayItemFromRaw([[Elemental Wand
|
||||
Imbued Wand
|
||||
Crafted: true
|
||||
Prefix: None
|
||||
@@ -68,45 +68,45 @@ describe("TestAttacks", function()
|
||||
Sockets: B-B-B
|
||||
LevelReq: 59
|
||||
Implicits: 0]])
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
build.itemsTab:AddDisplayItem()
|
||||
runCallback("OnFrame")
|
||||
|
||||
build.skillsTab:PasteSocketGroup("Power Siphon 20/0 Default 1\nSacred Wisps 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
build.skillsTab:PasteSocketGroup("Power Siphon 20/0 Default 1\nSacred Wisps 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.True(build.calcsTab.mainOutput.MirageDPS ~= nil)
|
||||
end)
|
||||
assert.True(build.calcsTab.mainOutput.MirageDPS ~= nil)
|
||||
end)
|
||||
|
||||
it("Test Scorching ray applying exposure at max stages", function()
|
||||
build.skillsTab:PasteSocketGroup("Scorching Ray 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
local mainSocketGroup = build.skillsTab.socketGroupList[build.mainSocketGroup]
|
||||
local srcInstance = mainSocketGroup.displaySkillList[mainSocketGroup.mainActiveSkill].activeEffect.srcInstance
|
||||
srcInstance.skillStageCount = 8
|
||||
build.modFlag = true
|
||||
build.buildFlag = true
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.True(build.calcsTab.mainEnv.enemyDB:Sum("BASE", nil, "FireResist") < 0)
|
||||
end)
|
||||
build.skillsTab:PasteSocketGroup("Scorching Ray 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
local mainSocketGroup = build.skillsTab.socketGroupList[build.mainSocketGroup]
|
||||
local srcInstance = mainSocketGroup.displaySkillList[mainSocketGroup.mainActiveSkill].activeEffect.srcInstance
|
||||
srcInstance.skillStageCount = 8
|
||||
build.modFlag = true
|
||||
build.buildFlag = true
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.True(build.calcsTab.mainEnv.enemyDB:Sum("BASE", nil, "FireResist") < 0)
|
||||
end)
|
||||
|
||||
it("Test Adrenaline affecting blight max stage count", function()
|
||||
build.skillsTab:PasteSocketGroup("Blight 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
local mainSocketGroup = build.skillsTab.socketGroupList[build.mainSocketGroup]
|
||||
local srcInstance = mainSocketGroup.displaySkillList[mainSocketGroup.mainActiveSkill].activeEffect.srcInstance
|
||||
srcInstance.skillPart = 2
|
||||
build.modFlag = true
|
||||
build.buildFlag = true
|
||||
runCallback("OnFrame")
|
||||
|
||||
local preAdrenalineMaxStages = build.calcsTab.mainEnv.player.activeSkillList[1].skillModList:Sum("BASE", nil, "Multiplier:BlightMaxStages")
|
||||
build.configTab.input.buffAdrenaline = true
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
it("Test Adrenaline affecting blight max stage count", function()
|
||||
build.skillsTab:PasteSocketGroup("Blight 20/0 Default 1\n")
|
||||
runCallback("OnFrame")
|
||||
|
||||
local mainSocketGroup = build.skillsTab.socketGroupList[build.mainSocketGroup]
|
||||
local srcInstance = mainSocketGroup.displaySkillList[mainSocketGroup.mainActiveSkill].activeEffect.srcInstance
|
||||
srcInstance.skillPart = 2
|
||||
build.modFlag = true
|
||||
build.buildFlag = true
|
||||
runCallback("OnFrame")
|
||||
|
||||
local preAdrenalineMaxStages = build.calcsTab.mainEnv.player.activeSkillList[1].skillModList:Sum("BASE", nil, "Multiplier:BlightMaxStages")
|
||||
build.configTab.input.buffAdrenaline = true
|
||||
build.configTab:BuildModList()
|
||||
runCallback("OnFrame")
|
||||
|
||||
assert.True(preAdrenalineMaxStages < build.calcsTab.mainEnv.player.activeSkillList[1].skillModList:Sum("BASE", nil, "Multiplier:BlightMaxStages"))
|
||||
end)
|
||||
assert.True(preAdrenalineMaxStages < build.calcsTab.mainEnv.player.activeSkillList[1].skillModList:Sum("BASE", nil, "Multiplier:BlightMaxStages"))
|
||||
end)
|
||||
end)
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user