From b0971fb4c84a99c7a12b3a19a7e22faff062dd2a Mon Sep 17 00:00:00 2001 From: Regisle Date: Fri, 23 Aug 2024 17:38:34 +0930 Subject: [PATCH] add support for Items Implicits Cannot Be Changed --- src/Classes/Item.lua | 4 +++- src/Classes/ItemsTab.lua | 23 +++++++++++++++++++++-- src/Data/ModCache.lua | 6 +----- src/Modules/ModParser.lua | 1 + 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/Classes/Item.lua b/src/Classes/Item.lua index ce71ab2486..f29a9e7eea 100644 --- a/src/Classes/Item.lua +++ b/src/Classes/Item.lua @@ -739,7 +739,9 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) end local lineLower = line:lower() - if lineLower:match(" prefix modifiers? allowed") then + if lineLower == "implicit modifiers cannot be changed" then + self.implicitsCannotBeChanged = true + elseif lineLower:match(" prefix modifiers? allowed") then self.prefixes.limit = (self.prefixes.limit or 0) + (tonumber(lineLower:match("%+(%d+) prefix modifiers? allowed")) or 0) - (tonumber(lineLower:match("%-(%d+) prefix modifiers? allowed")) or 0) elseif lineLower:match(" suffix modifiers? allowed") then 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) diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 2509dad878..742a269ccf 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -492,7 +492,10 @@ holding Shift will put it in the second.]]) self:AddImplicitToDisplayItem() end) self.controls.displayItemAddImplicit.shown = function() - return self.displayItem and self.displayItem.type ~= "Tincture" and (self.displayItem.corruptible or ((self.displayItem.type ~= "Flask" or self.displayItem.type ~= "Jewel") and (self.displayItem.rarity == "NORMAL" or self.displayItem.rarity == "MAGIC" or self.displayItem.rarity == "RARE"))) + return self.displayItem and + self.displayItem.type ~= "Tincture" and (self.displayItem.corruptible or ((self.displayItem.type ~= "Flask" and self.displayItem.type ~= "Jewel") and + (self.displayItem.rarity == "NORMAL" or self.displayItem.rarity == "MAGIC" or self.displayItem.rarity == "RARE"))) and + not self.displayItem.implicitsCannotBeChanged end -- Section: Influence dropdowns @@ -2423,8 +2426,13 @@ function ItemsTabClass:CorruptDisplayItem(modType) currentModType = "ScourgeUpside" buildImplicitList("ScourgeUpside") buildImplicitList("ScourgeDownside") - controls.implicit3Label.shown = true + controls.implicit.shown = true + controls.implicitLabel.shown = true + controls.implicit2.shown = true + controls.implicit2Label.shown = true controls.implicit3.shown = true + controls.implicit3Label.shown = true + controls.implicitCannotBeChangedLabel.shown = false main.popups[1].height = 147 controls.close.y = 117 controls.save.y = 117 @@ -2440,10 +2448,15 @@ function ItemsTabClass:CorruptDisplayItem(modType) buildList(controls.implicit4, controls.implicit3, "ScourgeDownside") else currentModType = value + controls.implicit.shown = not self.displayItem.implicitsCannotBeChanged + controls.implicitLabel.shown = not self.displayItem.implicitsCannotBeChanged + controls.implicit2.shown = not self.displayItem.implicitsCannotBeChanged + controls.implicit2Label.shown = not self.displayItem.implicitsCannotBeChanged controls.implicit3Label.shown = false controls.implicit3.shown = false controls.implicit4Label.shown = false controls.implicit4.shown = false + controls.implicitCannotBeChangedLabel.shown = self.displayItem.implicitsCannotBeChanged controls.implicit2.y = 65 main.popups[1].height = 129 controls.close.y = 99 @@ -2470,6 +2483,8 @@ function ItemsTabClass:CorruptDisplayItem(modType) self:AddModComparisonTooltip(tooltip, value.mod) end end + controls.implicit.shown = not self.displayItem.implicitsCannotBeChanged + controls.implicitLabel.shown = not self.displayItem.implicitsCannotBeChanged controls.implicit2Label = new("LabelControl", {"TOPRIGHT",nil,"TOPLEFT"}, 75, 65, 0, 16, "^7Implicit #2:") controls.implicit2 = new("DropDownControl", {"TOPLEFT",nil,"TOPLEFT"}, 80, 65, 440, 18, nil, function() buildList(controls.implicit, controls.implicit2, currentModType) @@ -2483,6 +2498,8 @@ function ItemsTabClass:CorruptDisplayItem(modType) self:AddModComparisonTooltip(tooltip, value.mod) end end + controls.implicit2.shown = not self.displayItem.implicitsCannotBeChanged + controls.implicit2Label.shown = not self.displayItem.implicitsCannotBeChanged controls.implicit3Label = new("LabelControl", {"TOPRIGHT",nil,"TOPLEFT"}, 75, 85, 0, 16, "^7Implicit #3:") controls.implicit3 = new("DropDownControl", {"TOPLEFT",nil,"TOPLEFT"}, 80, 65, 440, 18, nil, function() buildList(controls.implicit4, controls.implicit3, "ScourgeDownside") @@ -2513,6 +2530,8 @@ function ItemsTabClass:CorruptDisplayItem(modType) end controls.implicit4Label.shown = false controls.implicit4.shown = false + controls.implicitCannotBeChangedLabel = new("LabelControl", {"TOPLEFT",nil,"TOPLEFT"}, 20, 45, 0, 20, "^7This Items Implicits Cannot Be Changed") + controls.implicitCannotBeChangedLabel.shown = self.displayItem.implicitsCannotBeChanged buildList(controls.implicit, controls.implicit2, currentModType) buildList(controls.implicit2, controls.implicit, currentModType) controls.save = new("ButtonControl", nil, -45, 99, 80, 20, modType, function() diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index d0bb8a027c..003adf2660 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -8781,11 +8781,7 @@ c["Impales you inflict last 2 additional Hits while using Pride"]={{[1]={[1]={ty c["Implicit Modifier magnitudes are doubled"]={nil,"Implicit Modifier magnitudes are doubled "} c["Implicit Modifier magnitudes are tripled"]={nil,"Implicit Modifier magnitudes are tripled "} c["Implicit Modifier magnitudes are tripled Corrupted"]={nil,"Implicit Modifier magnitudes are tripled Corrupted "} -c["Implicit Modifiers Cannot Be Changed"]={nil,"Implicit Modifiers Cannot Be Changed "} -c["Implicit Modifiers Cannot Be Changed 100% increased Explicit Modifier magnitudes"]={nil,"Implicit Modifiers Cannot Be Changed 100% increased Explicit Modifier magnitudes "} -c["Implicit Modifiers Cannot Be Changed 25% increased Prefix Modifier magnitudes"]={nil,"Implicit Modifiers Cannot Be Changed 25% increased Prefix Modifier magnitudes "} -c["Implicit Modifiers Cannot Be Changed 25% increased Suffix Modifier magnitudes"]={nil,"Implicit Modifiers Cannot Be Changed 25% increased Suffix Modifier magnitudes "} -c["Implicit Modifiers Cannot Be Changed Has Elder, Shaper and all Conqueror Influences"]={nil,"Implicit Modifiers Cannot Be Changed Has Elder, Shaper and all Conqueror Influences "} +c["Implicit Modifiers Cannot Be Changed"]={{},nil} c["Increases and Reductions to Armour also apply to Energy"]={nil,"Increases and Reductions to Armour also apply to Energy "} c["Increases and Reductions to Armour also apply to Energy Shield Recharge Rate at 20% of their value"]={{[1]={flags=0,keywordFlags=0,name="ArmourAppliesToEnergyShieldRecharge",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="ImprovedArmourAppliesToEnergyShieldRecharge",type="MAX",value=20}},nil} c["Increases and Reductions to Cast Speed also Apply to Trap Throwing Speed"]={{[1]={flags=0,keywordFlags=0,name="CastSpeedAppliesToTrapThrowingSpeed",type="FLAG",value=true}},nil} diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 5992c77bff..182b8556a3 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -5093,6 +5093,7 @@ local specialModList = { ["can have a second enchantment modifier"] = { }, ["can have (%d+) additional enchantment modifiers"] = { }, ["this item can be anointed by cassia"] = { }, + ["implicit modifiers cannot be changed"] = { }, ["has a crucible passive skill tree"] = { }, ["has a two handed sword crucible passive skill tree"] = { }, ["has a crucible passive skill tree with only support passive skills"] = { },