Skip to content

Commit b64c8c0

Browse files
committed
add support for strugglescream
1 parent 95d4d82 commit b64c8c0

5 files changed

Lines changed: 64 additions & 8 deletions

File tree

spec/System/TestItemParse_spec.lua

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,21 @@ describe("TestItemParse", function()
156156
assert.truthy(item.unreleased)
157157
end)
158158

159-
--TODO: Add long flags applicable for POE2
160-
--it("long flags", function()
161-
--end)
159+
it("long flags", function()
160+
local item = new("Item", raw("This item can be anointed by Cassia"))
161+
assert.truthy(item.canBeAnointed)
162+
item = new("Item", raw("Can have 1 additional Instilled Modifier"))
163+
assert.truthy(item.canHaveTwoEnchants)
164+
item = new("Item", raw("Can have an additional Instilled Modifier"))
165+
assert.truthy(item.canHaveTwoEnchants)
166+
item = new("Item", raw("Can have 2 additional Instilled Modifiers"))
167+
assert.truthy(item.canHaveTwoEnchants)
168+
assert.truthy(item.canHaveThreeEnchants)
169+
item = new("Item", raw("Can have 3 additional Instilled Modifiers"))
170+
assert.truthy(item.canHaveTwoEnchants)
171+
assert.truthy(item.canHaveThreeEnchants)
172+
assert.truthy(item.canHaveFourEnchants)
173+
end)
162174

163175
it("tags", function()
164176
local item = new("Item", raw("{tags:life,physical_damage}+8 to Strength"))

src/Classes/Item.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,15 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
771771
self.suffixes.limit = (self.suffixes.limit or 0) + (tonumber(lineLower:match("%+(%d+) suffix modifiers? allowed")) or 0) - (tonumber(lineLower:match("%-(%d+) suffix modifiers? allowed")) or 0)
772772
elseif lineLower == "this item can be anointed by cassia" then
773773
self.canBeAnointed = true
774+
elseif (lineLower == "can have 1 additional instilled modifier" or lineLower == "can have an additional instilled modifier") then
775+
self.canHaveTwoEnchants = true
776+
elseif lineLower == "can have 2 additional instilled modifiers" then
777+
self.canHaveTwoEnchants = true
778+
self.canHaveThreeEnchants = true
779+
elseif lineLower == "can have 3 additional instilled modifiers" then
780+
self.canHaveTwoEnchants = true
781+
self.canHaveThreeEnchants = true
782+
self.canHaveFourEnchants = true
774783
end
775784

776785
local modLines

src/Classes/ItemsTab.lua

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ for _, entry in pairs(data.flavourText) do
5353
end
5454
end
5555

56+
local function isAnointable(item)
57+
return (item.canBeAnointed or item.base.type == "Amulet")
58+
end
5659

5760
local ItemsTabClass = newClass("ItemsTab", "UndoHandler", "ControlHost", "Control", function(self, build)
5861
self.UndoHandler()
@@ -403,9 +406,36 @@ holding Shift will put it in the second.]])
403406
self:AnointDisplayItem(1)
404407
end)
405408
self.controls.displayItemAnoint.shown = function()
406-
return self.displayItem and ((self.displayItem.base.type == "Amulet" or self.displayItem.canBeAnointed) and not self.displayItem.sanctified)
409+
return self.displayItem and isAnointable(self.displayItem) and not self.displayItem.sanctified
410+
end
411+
self.controls.displayItemAnoint2 = new("ButtonControl", {"TOPLEFT",self.controls.displayItemAnoint,"TOPRIGHT",true}, {8, 0, 100, 20}, "Anoint 2...", function()
412+
self:AnointDisplayItem(2)
413+
end)
414+
self.controls.displayItemAnoint2.shown = function()
415+
return self.displayItem and
416+
isAnointable(self.displayItem) and
417+
self.displayItem.canHaveTwoEnchants and
418+
#self.displayItem.enchantModLines > 0
419+
end
420+
self.controls.displayItemAnoint3 = new("ButtonControl", {"TOPLEFT",self.controls.displayItemAnoint2,"TOPRIGHT",true}, {8, 0, 100, 20}, "Anoint 3...", function()
421+
self:AnointDisplayItem(3)
422+
end)
423+
self.controls.displayItemAnoint3.shown = function()
424+
return self.displayItem and
425+
isAnointable(self.displayItem) and
426+
self.displayItem.canHaveThreeEnchants and
427+
#self.displayItem.enchantModLines > 1
428+
end
429+
self.controls.displayItemAnoint4 = new("ButtonControl", {"TOPLEFT",self.controls.displayItemAnoint3,"TOPRIGHT",true}, {8, 0, 100, 20}, "Anoint 4...", function()
430+
self:AnointDisplayItem(4)
431+
end)
432+
self.controls.displayItemAnoint4.shown = function()
433+
return self.displayItem and
434+
isAnointable(self.displayItem) and
435+
self.displayItem.canHaveFourEnchants and
436+
#self.displayItem.enchantModLines > 2
407437
end
408-
self.controls.displayItemCorrupt = new("ButtonControl", {"TOPLEFT",self.controls.displayItemAnoint,"TOPRIGHT",true}, {8, 0, 100, 20}, "Corrupt...", function()
438+
self.controls.displayItemCorrupt = new("ButtonControl", {"TOPLEFT",self.controls.displayItemAnoint4,"TOPRIGHT",true}, {8, 0, 100, 20}, "Corrupt...", function()
409439
self:CorruptDisplayItem()
410440
end)
411441
self.controls.displayItemCorrupt.shown = function()

src/Data/ModCache.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4509,9 +4509,8 @@ c["Can Attack as though using a Quarterstaff while both of your hand slots are e
45094509
c["Can Socket a non-Unique Basic Jewel into the Phylactery"]={{},nil}
45104510
c["Can be modified while Corrupted"]={nil,"Can be modified while Corrupted "}
45114511
c["Can be modified while Corrupted +150 to maximum Life"]={nil,"Can be modified while Corrupted +150 to maximum Life "}
4512-
c["Can have 2 additional Instilled Modifiers"]={nil,"Can have 2 additional Instilled Modifiers "}
4513-
c["Can have 2 additional Instilled Modifiers Can have 3 additional Instilled Modifiers"]={nil,"Can have 2 additional Instilled Modifiers Can have 3 additional Instilled Modifiers "}
4514-
c["Can have 3 additional Instilled Modifiers"]={nil,"Can have 3 additional Instilled Modifiers "}
4512+
c["Can have 2 additional Instilled Modifiers"]={{},nil}
4513+
c["Can have 3 additional Instilled Modifiers"]={{},nil}
45154514
c["Can instead consume 25% of maximum Mana to trigger Charms with insufficient charges"]={nil,"Can instead consume 25% of maximum Mana to trigger Charms with insufficient charges "}
45164515
c["Can only use a Normal Body Armour"]={nil,"Can only use a Normal Body Armour "}
45174516
c["Can only use a Normal Body Armour +200 to Armour for each Connected Notable Passive Skill Allocated"]={nil,"Can only use a Normal Body Armour +200 to Armour for each Connected Notable Passive Skill Allocated "}

src/Modules/ModParser.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,6 +3328,12 @@ local specialModList = {
33283328
["maximum quality is 50%%"] = {
33293329
-- Display only. For Breach Rings.
33303330
},
3331+
["can have (%d+) additional instilled modifiers?"] = function(num) return {
3332+
-- Display only. For Strugglescream.
3333+
} end,
3334+
["can have an additional instilled modifier"] = function(num) return {
3335+
-- Display only.
3336+
} end,
33313337
["has (%d+) sockets?"] = function(num) return { mod("SocketCount", "BASE", num) } end,
33323338
["no physical damage"] = { mod("WeaponData", "LIST", { key = "PhysicalMin" }), mod("WeaponData", "LIST", { key = "PhysicalMax" }), mod("WeaponData", "LIST", { key = "PhysicalDPS" }) },
33333339
["has (%d+)%% increased elemental damage"] = function(num) return { mod("LocalElementalDamage", "INC", num) } end,

0 commit comments

Comments
 (0)