Skip to content

Commit 5b29a75

Browse files
committed
Darkness Enthroned rune support
1 parent 03e4638 commit 5b29a75

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

src/Classes/Item.lua

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
825825
end
826826
-- this will need more advanced logic for jewel sockets in items to work properly but could just be removed as items like this was only introduced during development.
827827
if self.base then
828-
if self.base.weapon or self.base.armour or self.base.tags.wand or self.base.tags.staff or self.base.tags.sceptre then
828+
if self.base.weapon or self.base.armour or self.base.tags.wand or self.base.tags.staff or self.base.tags.sceptre or self.title == "Darkness Enthroned" then
829829
local shouldFixRunesOnItem = #self.runes == 0
830830

831831
-- Form a key value table with the following format
@@ -1335,10 +1335,20 @@ function ItemClass:UpdateRunes()
13351335
for i = 1, self.itemSocketCount do
13361336
local name = self.runes[i]
13371337
if name and name ~= "None" then
1338-
local baseType = self.base.weapon and "weapon" or self.base.armour and "armour" or (self.base.tags.wand or self.base.tags.staff) and "caster"
1338+
local baseType = self.base.weapon and "weapon" or self.base.armour and "armour" or (self.base.tags.wand or self.base.tags.staff) and "caster" or self.title == "Darkness Enthroned" and "armour"
13391339
local specificType = self.base.type:lower()
1340-
if self.augmentsAsBodyArmour then
1341-
specificType = "body armour"
1340+
local augmentOverride = {
1341+
BodyArmour = "body armour",
1342+
Helmet = "helmet",
1343+
Shield = "shield",
1344+
Boots = "boots",
1345+
Gloves = "gloves",
1346+
}
1347+
for flag, slot in pairs(augmentOverride) do
1348+
if self["augmentsAs" .. flag] then
1349+
specificType = slot
1350+
break
1351+
end
13421352
end
13431353
local gatheredMods = getModRunesForTypes(name, baseType, specificType)
13441354
for _, mod in ipairs(gatheredMods) do
@@ -1870,9 +1880,21 @@ function ItemClass:BuildModList()
18701880
baseList:NewMod("ArmourData", "LIST", { key = "EnergyShield", value = 0 })
18711881
self.requirements.int = 0
18721882
end
1883+
if calcLocal(baseList, "AugmentsAsIfShield", "FLAG", 0) then
1884+
self.augmentsAsShield = true
1885+
end
18731886
if calcLocal(baseList, "AugmentsAsIfBodyArmour", "FLAG", 0) then
18741887
self.augmentsAsBodyArmour = true
18751888
end
1889+
if calcLocal(baseList, "AugmentsAsIfHelmet", "FLAG", 0) then
1890+
self.augmentsAsHelmet = true
1891+
end
1892+
if calcLocal(baseList, "AugmentsAsIfBoots", "FLAG", 0) then
1893+
self.augmentsAsBoots = true
1894+
end
1895+
if calcLocal(baseList, "AugmentsAsIfGloves", "FLAG", 0) then
1896+
self.augmentsAsGloves = true
1897+
end
18761898
if calcLocal(baseList, "NoAttributeRequirements", "FLAG", 0) then
18771899
self.requirements.strMod = 0
18781900
self.requirements.dexMod = 0

src/Classes/ItemsTab.lua

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,11 @@ holding Shift will put it in the second.]])
376376

377377
-- Section: Sockets and Links
378378
self.controls.displayItemSectionSockets = new("Control", {"TOPLEFT",self.controls.displayItemSectionVariant,"BOTTOMLEFT"}, {0, 0, 0, function()
379-
return self.displayItem and (self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre) and 28 or 0
379+
return self.displayItem and (self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre or self.displayItem.title == "Darkness Enthroned") and 28 or 0
380380
end})
381381
self.controls.displayItemSocketRune = new("LabelControl", {"TOPLEFT",self.controls.displayItemSectionSockets,"TOPLEFT"}, {0, 0, 36, 20}, "^x7F7F7FS")
382382
self.controls.displayItemSocketRune.shown = function()
383-
return self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre
383+
return self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre or self.displayItem.title == "Darkness Enthroned"
384384
end
385385
self.controls.displayItemSocketRuneEdit = new("EditControl", {"LEFT",self.controls.displayItemSocketRune,"RIGHT"}, {2, 0, 50, 20}, nil, nil, "%D", 1, function(buf)
386386
if tonumber(buf) > 6 then
@@ -511,7 +511,7 @@ holding Shift will put it in the second.]])
511511

512512
-- Section: Rune Selection
513513
self.controls.displayItemSectionRune = new("Control", {"TOPLEFT",self.controls.displayItemSectionClusterJewel,"BOTTOMLEFT"}, {0, 0, 0, function()
514-
if not self.displayItem or self.displayItem.itemSocketCount == 0 or not (self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre) then
514+
if not self.displayItem or self.displayItem.itemSocketCount == 0 or not (self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre or self.displayItem.title == "Darkness Enthroned") then
515515
return 0
516516
end
517517
local h = 6
@@ -550,7 +550,7 @@ holding Shift will put it in the second.]])
550550
end
551551
end
552552
drop.shown = function()
553-
return self.displayItem and i <= self.displayItem.itemSocketCount and (self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre)
553+
return self.displayItem and i <= self.displayItem.itemSocketCount and (self.displayItem.base.weapon or self.displayItem.base.armour or self.displayItem.base.tags.wand or self.displayItem.base.tags.staff or self.displayItem.base.tags.sceptre or self.displayItem.title == "Darkness Enthroned")
554554
end
555555

556556
self.controls["displayItemRune"..i] = drop
@@ -1649,11 +1649,16 @@ function ItemsTabClass:UpdateRuneControls()
16491649
-- Build rune selection for item
16501650
local runes = { }
16511651
for _, rune in pairs(runeModLines) do
1652-
if item.augmentsAsBodyArmour then
1653-
if rune.slot == "None" or rune.slot == "armour" or rune.slot == "body armour" then
1654-
table.insert(runes, rune)
1652+
local augmentFlags = { "BodyArmour", "Shield", "Helmet", "Boots", "Gloves" }
1653+
for _, flagName in ipairs(augmentFlags) do
1654+
if item["augmentsAs" .. flagName] then
1655+
-- Convert BodyArmour -> "body armour"
1656+
local runeSlot = flagName:gsub("([a-z])([A-Z])", "%1 %2"):lower()
1657+
if rune.slot == "None" or rune.slot == "armour" or rune.slot == runeSlot then
1658+
table.insert(runes, rune)
1659+
end
1660+
goto continue
16551661
end
1656-
goto continue
16571662
end
16581663
if rune.slot == "None" or -- Needed "None" for Items Tab
16591664
item.base.type:lower() == rune.slot or

src/Data/Uniques/belt.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Variant: Body Armour
5656
Variant: Gloves
5757
Variant: Boots
5858
Variant: Shield
59+
Sockets: S S
5960
Implicits: 2
6061
Has (1-3) Charm Slot
6162
Flasks gain 0.17 charges per Second

src/Export/Uniques/belt.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Variant: Body Armour
5656
Variant: Gloves
5757
Variant: Boots
5858
Variant: Shield
59+
Sockets: S S
5960
Implicits: 2
6061
BeltImplicitCharmSlots3
6162
BeltImplicitFlaskPassiveChargeGain1

src/Modules/ModParser.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3330,7 +3330,7 @@ local specialModList = {
33303330
["this item gains bonuses from socketed items as though it was ?a? (%a[%a ]*)"] =
33313331
function(_, type)
33323332
type = type
3333-
:gsub("%f[%a]%a", string.upper) -- uppercase first letter of each word
3333+
:gsub("%f[%a]%a", string.upper)
33343334
:gsub(" ", "")
33353335
return { flag("AugmentsAsIf" .. type) }
33363336
end,

0 commit comments

Comments
 (0)