Skip to content

Commit 29ab826

Browse files
LocalIdentityLocalIdentity
andauthored
Add support for Darkness Enthroned and Atziri's Splendour augment mods (#2343)
* Add support for Darkness Enthrones and Atziri's Splendour augment mods Add support for the mod on Darkness Enthroned `This item gains bonuses from Socketed Items as though it was x` and `This item gains bonuses from Socketed Soul Cores as though it was also x` Moved some of the rune or socket checks into functions so they can be reused elsewhere Atziri's Spendour shows the added soul core stats in the dropdown tooltip Didn't use ModParser for the lines as it then needs to do extra loops through each item so opted for a simpler approach in Item.lua Item's tab update is required to the rune list is updated when you change variants on Atziri's Splendour * Fix logic --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent deb16ef commit 29ab826

9 files changed

Lines changed: 554 additions & 135 deletions

File tree

spec/System/TestImportReimport_spec.lua

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,49 @@ Fireball 20/0 1
281281
assert.are.equal(55, importedItem.requirements.level)
282282
end)
283283

284+
it("imports scaled Darkness Enthroned augments from account data without rescaling them", function()
285+
build.importTab.controls.charImportItemsClearItems.state = true
286+
build.importTab.controls.charImportItemsClearSkills.state = true
287+
288+
local belt = makeImportItem("Fine Belt", "Belt", "test-import-darkness-enthroned")
289+
belt.frameType = 3
290+
belt.name = "Darkness Enthroned"
291+
belt.sockets = {
292+
{ type = "rune" },
293+
{ type = "rune" },
294+
}
295+
belt.socketedItems = {
296+
{ baseType = "Rune of the Blossom" },
297+
{ baseType = "Fox Idol" },
298+
}
299+
belt.runeMods = {
300+
"+83 to Spirit",
301+
"Idols socketed in this item gain the benefits of their Bonded modifiers",
302+
"-1 to Spirit per 2 Levels",
303+
"Bonded: +8% to Quality of all Skills",
304+
}
305+
belt.explicitMods = {
306+
"This item gains bonuses from Socketed Items as though it was a Body Armour",
307+
"66% increased effect of Socketed Augment Items",
308+
}
309+
310+
build.importTab:ImportItemsAndSkills(buildImportPayload({ belt }, {}))
311+
runCallback("OnFrame")
312+
313+
local importedItem = build.itemsTab.items[build.itemsTab.slots.Belt.selItemId]
314+
assert.are.same({ "Rune of the Blossom", "Fox Idol" }, importedItem.runes)
315+
local rawItem = importedItem:BuildRaw()
316+
assert.is_not_nil(rawItem:match("%+83 to Spirit"))
317+
assert.is_not_nil(rawItem:match("%-1 to Spirit per 2 Levels"))
318+
assert.is_not_nil(rawItem:match("Bonded: %+8%% to Quality of all Skills"))
319+
320+
importedItem:BuildAndParseRaw()
321+
assert.are.same({ "Rune of the Blossom", "Fox Idol" }, importedItem.runes)
322+
rawItem = importedItem:BuildRaw()
323+
assert.is_not_nil(rawItem:match("%+83 to Spirit"))
324+
assert.is_not_nil(rawItem:match("Bonded: %+8%% to Quality of all Skills"))
325+
end)
326+
284327
it("preserves skill part selection when reimporting items and skills", function()
285328
assertReimportPreservesSkillSubstate("Twig Focus", "Offhand", "Dark Effigy", "skillPart", 2)
286329
end)

spec/System/TestItemParse_spec.lua

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,197 @@ describe("TestItemParse", function()
865865

866866
end)
867867

868+
it("loads Darkness Enthroned with two augment sockets", function()
869+
local item = new("Item", data.uniques.belt[6])
870+
871+
assert.are.equals("Darkness Enthroned, Fine Belt", item.name)
872+
assert.are.equals(2, item.itemSocketCount)
873+
assert.are.equals(2, #item.sockets)
874+
875+
item.variant = 1 -- Helmet
876+
item:BuildModList()
877+
local baseType, specificType = item:GetSocketedAugmentTypes()
878+
assert.are.equals("armour", baseType)
879+
assert.are.equals("helmet", specificType)
880+
end)
881+
882+
it("infers helmet augments from an advanced copy of Darkness Enthroned", function()
883+
local item = new("Item", [[
884+
Item Class: Belts
885+
Rarity: Unique
886+
Darkness Enthroned
887+
Fine Belt
888+
--------
889+
Requires: Level 62
890+
--------
891+
Sockets: S S
892+
--------
893+
Item Level: 83
894+
--------
895+
28% increased Armour, Evasion and Energy Shield (rune)
896+
12% increased Skill Effect Duration (rune)
897+
12% increased Cooldown Recovery Rate (rune)
898+
--------
899+
{ Implicit Modifier }
900+
Flasks gain 0.17 charges per Second
901+
{ Implicit Modifier — Charm }
902+
Has 1(1-3) Charm Slot
903+
--------
904+
{ Unique Modifier }
905+
This item gains bonuses from Socketed Items as though it was a Helmet — Unscalable Value
906+
{ Unique Modifier }
907+
61(50-100)% increased effect of Socketed Augment Items — Unscalable Value
908+
--------
909+
Kulemak sat triumphant, raising the crown.
910+
Darkness coiled the world in eternal night.
911+
Victory, a mere moment, came crashing down.
912+
No conqueror, no conquered, only searing Light.
913+
--------
914+
Corrupted
915+
--------
916+
Note: ~b/o 40 exalted
917+
]])
918+
919+
assert.are.same({ "Greater Iron Rune", "Quipolatl's Soul Core of Flow" }, item.runes)
920+
local rawItem = item:BuildRaw()
921+
assert.is_not_nil(rawItem:match("28%% increased Armour, Evasion and Energy Shield"))
922+
assert.is_not_nil(rawItem:match("12%% increased Skill Effect Duration"))
923+
assert.is_not_nil(rawItem:match("12%% increased Cooldown Recovery Rate"))
924+
925+
item:BuildAndParseRaw()
926+
assert.are.same({ "Greater Iron Rune", "Quipolatl's Soul Core of Flow" }, item.runes)
927+
rawItem = item:BuildRaw()
928+
assert.is_not_nil(rawItem:match("28%% increased Armour, Evasion and Energy Shield"))
929+
assert.is_not_nil(rawItem:match("12%% increased Skill Effect Duration"))
930+
assert.is_not_nil(rawItem:match("12%% increased Cooldown Recovery Rate"))
931+
end)
932+
933+
it("infers body armour augments from an advanced copy of Darkness Enthroned", function()
934+
local item = new("Item", [[
935+
Item Class: Belts
936+
Rarity: Unique
937+
Darkness Enthroned
938+
Fine Belt
939+
--------
940+
Requires: Level 62
941+
--------
942+
Sockets: S S
943+
--------
944+
Item Level: 86
945+
--------
946+
+83 to Spirit (rune)
947+
Idols socketed in this item gain the benefits of their Bonded modifiers (rune)
948+
-1 to Spirit per 2 Levels (rune)
949+
Bonded: +8% to Quality of all Skills (rune)
950+
--------
951+
{ Implicit Modifier }
952+
Flasks gain 0.17 charges per Second
953+
{ Implicit Modifier — Charm }
954+
Has 1(1-3) Charm Slot
955+
--------
956+
{ Unique Modifier }
957+
This item gains bonuses from Socketed Items as though it was a Body Armour — Unscalable Value
958+
{ Unique Modifier }
959+
66(50-100)% increased effect of Socketed Augment Items — Unscalable Value
960+
--------
961+
Kulemak sat triumphant, raising the crown.
962+
Darkness coiled the world in eternal night.
963+
Victory, a mere moment, came crashing down.
964+
No conqueror, no conquered, only searing Light.
965+
--------
966+
Corrupted
967+
--------
968+
Note: ~b/o 1 divine
969+
]])
970+
971+
assert.are.same({ "Rune of the Blossom", "Fox Idol" }, item.runes)
972+
local rawItem = item:BuildRaw()
973+
assert.is_not_nil(rawItem:match("%+83 to Spirit"))
974+
assert.is_not_nil(rawItem:match("%-1 to Spirit per 2 Levels"))
975+
assert.is_not_nil(rawItem:match("Bonded: %+8%% to Quality of all Skills"))
976+
977+
item:BuildAndParseRaw()
978+
assert.are.same({ "Rune of the Blossom", "Fox Idol" }, item.runes)
979+
rawItem = item:BuildRaw()
980+
assert.is_not_nil(rawItem:match("%+83 to Spirit"))
981+
assert.is_not_nil(rawItem:match("%-1 to Spirit per 2 Levels"))
982+
assert.is_not_nil(rawItem:match("Bonded: %+8%% to Quality of all Skills"))
983+
end)
984+
985+
it("parses Atziri's Splendour soul core socket types", function()
986+
local item = new("Item", data.uniques.body[1])
987+
item.variant = 1 -- Helmet
988+
item:BuildModList()
989+
990+
assert.is_true(item.socketedSoulCoreTypes["helmet"])
991+
assert.is_nil(item.socketedSoulCoreTypes["gloves"])
992+
end)
993+
994+
it("infers Soul Cores using Atziri's Splendour's variant type", function()
995+
local item = new("Item", [[
996+
Item Class: Body Armours
997+
Rarity: Unique
998+
Atziri's Splendour
999+
Sacrificial Regalia
1000+
--------
1001+
Sockets: S S S S S S
1002+
--------
1003+
Item Level: 86
1004+
--------
1005+
8% increased Skill Effect Duration (rune)
1006+
8% increased Cooldown Recovery Rate (rune)
1007+
--------
1008+
Only Soul Cores can be Socketed in this item
1009+
This item gains bonuses from Socketed Soul Cores as though it was also a Helmet
1010+
]])
1011+
1012+
assert.are.same({ "Quipolatl's Soul Core of Flow" }, item.runes)
1013+
item:BuildAndParseRaw()
1014+
assert.are.same({ "Quipolatl's Soul Core of Flow", "None", "None", "None", "None", "None" }, item.runes)
1015+
assert.are.equals(2, #item.runeModLines)
1016+
1017+
item = new("Item", [[
1018+
Item Class: Body Armours
1019+
Rarity: Unique
1020+
Atziri's Splendour
1021+
Sacrificial Regalia
1022+
--------
1023+
Sockets: S S S S S S
1024+
--------
1025+
Item Level: 86
1026+
--------
1027+
Hits against you have 40% reduced Critical Damage Bonus (rune)
1028+
--------
1029+
Only Soul Cores can be Socketed in this item
1030+
This item gains bonuses from Socketed Soul Cores as though it was also a Shield
1031+
]])
1032+
1033+
assert.are.same({ "Soul Core of Ticaba" }, item.runes)
1034+
item:BuildAndParseRaw()
1035+
assert.are.same({ "Soul Core of Ticaba", "None", "None", "None", "None", "None" }, item.runes)
1036+
assert.are.equals("Hits against you have 40% reduced Critical Damage Bonus", item.runeModLines[1].line)
1037+
end)
1038+
1039+
it("infers pasted Soul Core lines with socketed Soul Core effect", function()
1040+
local item = new("Item", [[
1041+
Item Class: Shields
1042+
Rarity: Unique
1043+
Mahuxotl's Machination
1044+
Omen Crest Shield
1045+
--------
1046+
Sockets: S
1047+
--------
1048+
Hits against you have 40% reduced Critical Damage Bonus (rune)
1049+
--------
1050+
100% increased effect of Socketed Soul Cores
1051+
]])
1052+
1053+
assert.are.same({ "Soul Core of Ticaba" }, item.runes)
1054+
item:BuildAndParseRaw()
1055+
assert.are.same({ "Soul Core of Ticaba" }, item.runes)
1056+
assert.is_not_nil(item:BuildRaw():match("Hits against you have 40%% reduced Critical Damage Bonus"))
1057+
end)
1058+
8681059
it("jewel sockets", function()
8691060
local item = new("Item", [[
8701061
Six Socket Body

spec/System/TestItemsTab_spec.lua

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,121 @@ describe("TestItemsTab", function()
607607
assert.is_true(build.itemsTab:IsSocketBoundRune(item, item.runes[1], validRunes))
608608
assert.is_false(build.itemsTab:IsSocketBoundRune(item, item.runes[2], validRunes))
609609
end)
610+
611+
it("uses variant socket types for valid augments", function ()
612+
for _, itemRaw in ipairs({ data.uniques.belt[6], data.uniques.body[1] }) do
613+
local item = new("Item", itemRaw)
614+
item.variant = 1 -- Helmet
615+
item:BuildModList()
616+
617+
local foundHelmetSoulCore = false
618+
for _, rune in ipairs(build.itemsTab:GetValidRunesForItem(item)) do
619+
if rune.name == "Quipolatl's Soul Core of Flow" then
620+
foundHelmetSoulCore = true
621+
break
622+
end
623+
end
624+
assert.is_true(foundHelmetSoulCore)
625+
626+
item.runes[1] = "Quipolatl's Soul Core of Flow"
627+
item:UpdateRunes()
628+
629+
assert.are.equals(2, #item.runeModLines)
630+
assert.are.equals("8% increased Skill Effect Duration", item.runeModLines[1].line)
631+
assert.are.equals("8% increased Cooldown Recovery Rate", item.runeModLines[2].line)
632+
end
633+
end)
634+
635+
it("refreshes valid augments when the item variant changes", function ()
636+
local item = new("Item", data.uniques.body[1])
637+
item.variant = 3 -- Boots
638+
item:BuildModList()
639+
build.itemsTab:SetDisplayItem(item)
640+
641+
build.itemsTab.controls.displayItemVariant:SetSel(1) -- Helmet
642+
643+
local foundMaximumRage = false
644+
for _, rune in ipairs(build.itemsTab.controls.displayItemRune1.list) do
645+
if rune.name == "Tzamoto's Soul Core of Ferocity" then
646+
foundMaximumRage = true
647+
break
648+
end
649+
end
650+
assert.is_true(foundMaximumRage)
651+
end)
652+
653+
it("keeps Darkness Enthroned's socket editor available at zero sockets", function ()
654+
build.itemsTab:CreateDisplayItemFromRaw([[
655+
Item Class: Belts
656+
Rarity: Unique
657+
Darkness Enthroned
658+
Fine Belt
659+
--------
660+
Sockets: S S
661+
--------
662+
This item gains bonuses from Socketed Items as though it was a Helmet
663+
81% increased effect of Socketed Augment Items
664+
]], true)
665+
666+
assert.are.equals(2, build.itemsTab.displayItem.itemSocketCount)
667+
build.itemsTab.controls.displayItemSocketRuneEdit:SetText(0, true)
668+
assert.is_true(build.itemsTab.controls.displayItemSocketRune:IsShown())
669+
build.itemsTab.controls.displayItemSocketRuneEdit:SetText(2, true)
670+
assert.are.equals(2, build.itemsTab.displayItem.itemSocketCount)
671+
end)
672+
673+
it("selects inferred augments from an advanced copy of Darkness Enthroned", function ()
674+
build.itemsTab:CreateDisplayItemFromRaw([[
675+
Item Class: Belts
676+
Rarity: Unique
677+
Darkness Enthroned
678+
Fine Belt
679+
--------
680+
Requires: Level 62
681+
--------
682+
Sockets: S S
683+
--------
684+
Item Level: 86
685+
--------
686+
+83 to Spirit (rune)
687+
Idols socketed in this item gain the benefits of their Bonded modifiers (rune)
688+
-1 to Spirit per 2 Levels (rune)
689+
Bonded: +8% to Quality of all Skills (rune)
690+
--------
691+
{ Implicit Modifier }
692+
Flasks gain 0.17 charges per Second
693+
{ Implicit Modifier — Charm }
694+
Has 1(1-3) Charm Slot
695+
--------
696+
{ Unique Modifier }
697+
This item gains bonuses from Socketed Items as though it was a Body Armour — Unscalable Value
698+
{ Unique Modifier }
699+
66(50-100)% increased effect of Socketed Augment Items — Unscalable Value
700+
]], true)
701+
702+
assert.are.same({ "Rune of the Blossom", "Fox Idol" }, build.itemsTab.displayItem.runes)
703+
assert.are.equals("Rune of the Blossom", build.itemsTab.controls.displayItemRune1.list[build.itemsTab.controls.displayItemRune1.selIndex].name)
704+
assert.are.equals("Fox Idol", build.itemsTab.controls.displayItemRune2.list[build.itemsTab.controls.displayItemRune2.selIndex].name)
705+
end)
706+
707+
it("deduplicates valid augments by socketed item name", function ()
708+
local item = new("Item", data.uniques.body[1])
709+
item.variant = 4 -- Shield
710+
item:BuildModList()
711+
712+
local ticabaCount = 0
713+
local ticabaRune
714+
for _, rune in ipairs(build.itemsTab:GetValidRunesForItem(item)) do
715+
if rune.name == "Soul Core of Ticaba" then
716+
ticabaCount = ticabaCount + 1
717+
ticabaRune = rune
718+
end
719+
end
720+
assert.are.equals(1, ticabaCount)
721+
assert.are.equals(2, #ticabaRune.lines)
722+
assert.are.equals("Hits against you have 20% reduced Critical Damage Bonus", ticabaRune.lines[1])
723+
assert.are.equals("Hits against you have 20% reduced Critical Damage Bonus", ticabaRune.lines[2])
724+
end)
610725
end)
611726

612727
it("does nothing when no matching item is equipped", function ()

0 commit comments

Comments
 (0)