Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions spec/System/TestAttacks_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,119 @@ describe("TestAttacks", function()
assert.are.equals(22, build.calcsTab.mainEnv.player.mainSkill.skillModList:Sum("INC", { flags = ModFlag.Attack }, "Damage"))

end)

-- Hide of the Vendigo: attacking as though using a Claw while the main hand is empty.
-- The attack stays unarmed, so it uses unarmed modifiers rather than claw modifiers.
describe("Hide of the Vendigo", function()
local function equipHide(extraLines)
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Test Subject
Exquisite Leather
Can Attack as though using a Claw while main hand is empty
]] .. (extraLines or ""))
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
end

-- Frost Blades requires a Claw, Dagger or One Handed Sword, so it can't be used unarmed on its own
local function useFrostBlades()
build.skillsTab:PasteSocketGroup("Frost Blades 20/0 1")
build.mainSocketGroup = 1
runCallback("OnFrame")
build.calcsTab:BuildOutput()
runCallback("OnFrame")
return build.calcsTab.mainEnv.player.mainSkill
end

it("lets you attack as though using a Claw while the main hand is empty", function()
equipHide()
local weaponData1 = build.calcsTab.mainEnv.player.weaponData1
assert.is_true(weaponData1.asThoughUsing ~= nil and weaponData1.asThoughUsing["Claw"] == true)
end)

it("does nothing while a main hand weapon is equipped", function()
equipHide()
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Corsair Sword
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.is_nil(build.calcsTab.mainEnv.player.weaponData1.asThoughUsing)
local mainSkill = useFrostBlades()
assert.is_falsy(mainSkill.skillFlags.disable)
assert.is_true(bit.band(mainSkill.weapon1Flags, ModFlag.Sword) > 0)
end)

it("makes Claw skills usable unarmed", function()
local mainSkill = useFrostBlades()
assert.is_true(mainSkill.skillFlags.disable)

newBuild()
equipHide()
mainSkill = useFrostBlades()
assert.is_falsy(mainSkill.skillFlags.disable)
assert.is_true(build.calcsTab.mainOutput.MainHand.AverageHit > 0)
-- The attack is still unarmed and does not count as using a Claw
assert.is_true(bit.band(mainSkill.weapon1Flags, ModFlag.Unarmed) > 0)
assert.are.equals(0, bit.band(mainSkill.weapon1Flags, ModFlag.Claw))
end)

it("does not bypass weapon restrictions of supports", function()
equipHide()
-- Close Combat only allows Axes and Swords
build.skillsTab:PasteSocketGroup("Frost Blades 20/0 1\nClose Combat 20/0 1")
build.mainSocketGroup = 1
runCallback("OnFrame")
build.calcsTab:BuildOutput()
runCallback("OnFrame")
assert.is_true(build.calcsTab.mainEnv.player.mainSkill.skillFlags.disable)
end)

it("applies unarmed modifiers but not claw modifiers to Claw skills", function()
equipHide()
useFrostBlades()
local baseHit = build.calcsTab.mainOutput.MainHand.AverageHit

build.configTab.input.customMods = "100% increased Claw Damage"
build.configTab:BuildModList()
runCallback("OnFrame")
build.calcsTab:BuildOutput()
runCallback("OnFrame")
assert.are.equals(baseHit, build.calcsTab.mainOutput.MainHand.AverageHit)

build.configTab.input.customMods = "185 to 285 Added Cold Damage with Unarmed Attacks"
build.configTab:BuildModList()
runCallback("OnFrame")
build.calcsTab:BuildOutput()
runCallback("OnFrame")
assert.is_true(build.calcsTab.mainOutput.MainHand.AverageHit > baseHit)
end)

it("only applies to the main hand with Hollow Palm Technique", function()
equipHide()
build.configTab.input.customMods = "Hollow Palm Technique"
build.configTab:BuildModList()
runCallback("OnFrame")
local player = build.calcsTab.mainEnv.player
-- Hollow Palm makes the off hand unarmed as well, but the Claw only applies to the main hand
assert.are.equals("None", player.weaponData2.type)
assert.is_true(player.weaponData1.asThoughUsing["Claw"])
assert.is_nil(player.weaponData2.asThoughUsing)
end)

it("gains attack speed if you've used a movement skill recently", function()
equipHide("20% increased Attack Speed if you've used an Attack Movement Skill Recently")
useFrostBlades()
local baseSpeed = build.calcsTab.mainOutput.Speed

build.configTab.input.conditionUsedMovementSkillRecently = true
build.configTab:BuildModList()
runCallback("OnFrame")
build.calcsTab:BuildOutput()
runCallback("OnFrame")
assert.are.near(baseSpeed * 1.2, build.calcsTab.mainOutput.Speed, 1e-9)
end)
end)
end)
8 changes: 4 additions & 4 deletions src/Data/BeastCraft.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ return {
["GrantsBirdAspectCrafted30"] = { type = "Suffix", affix = "of Saqawal", "Grants Level 30 Aspect of the Avian", statOrder = { 368 }, level = 20, group = "GrantsBirdAspect", weightKey = { "default", }, weightVal = { 0 }, modTags = { "skill" }, tradeHashes = { [3914740665] = { "" }, } },
["GrantsSpiderAspectCrafted30"] = { type = "Suffix", affix = "of Fenumus", "Grants Level 30 Aspect of the Spider", statOrder = { 368 }, level = 20, group = "GrantsSpiderAspect", weightKey = { "default", }, weightVal = { 0 }, modTags = { "skill" }, tradeHashes = { [956546305] = { "" }, } },
["GrantsCrabAspectCrafted30"] = { type = "Suffix", affix = "of Craiceann", "Grants Level 30 Aspect of the Crab", statOrder = { 368 }, level = 20, group = "GrantsCrabAspect", weightKey = { "default", }, weightVal = { 0 }, modTags = { "blue_herring", "skill" }, tradeHashes = { [4102318278] = { "" }, } },
["GrantsBrineKingAspectCrafted"] = { type = "Suffix", affix = "of the Brine King", "Grants Aspect of the Brine King", statOrder = { 368 }, level = 20, group = "GrantsBrineKingAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [3054487153] = { "" }, } },
["GrantsLunarisAspectCrafted"] = { type = "Suffix", affix = "of Lunaris", "Grants Aspect of Lunaris", statOrder = { 368 }, level = 20, group = "GrantsLunarisAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [937577116] = { "" }, } },
["GrantsSolarisAspectCrafted"] = { type = "Suffix", affix = "of Solaris", "Grants Aspect of Solaris", statOrder = { 368 }, level = 20, group = "GrantsSolarisAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [4280547417] = { "" }, } },
["GrantsArakaaliAspectCrafted"] = { type = "Suffix", affix = "of Arakaali", "Grants Aspect of Arakaali", statOrder = { 368 }, level = 20, group = "GrantsArakaaliAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [1094971653] = { "" }, } },
["GrantsBrineKingAspectCrafted"] = { type = "Suffix", affix = "of the Brine King", "Grants Level 20 Aspect of the Brine King", statOrder = { 368 }, level = 20, group = "GrantsBrineKingAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [3054487153] = { "" }, } },
["GrantsLunarisAspectCrafted"] = { type = "Suffix", affix = "of Lunaris", "Grants Level 20 Aspect of Lunaris", statOrder = { 368 }, level = 20, group = "GrantsLunarisAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [937577116] = { "" }, } },
["GrantsSolarisAspectCrafted"] = { type = "Suffix", affix = "of Solaris", "Grants Level 20 Aspect of Solaris", statOrder = { 368 }, level = 20, group = "GrantsSolarisAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [4280547417] = { "" }, } },
["GrantsArakaaliAspectCrafted"] = { type = "Suffix", affix = "of Arakaali", "Grants Level 20 Aspect of Arakaali", statOrder = { 368 }, level = 20, group = "GrantsArakaaliAspect", weightKey = { "deepwater_pantheon_aspect", "default", }, weightVal = { 100, 0 }, modTags = { "skill" }, tradeHashes = { [1094971653] = { "" }, } },
}
Loading
Loading