@@ -1538,18 +1538,40 @@ function ItemsTabClass:DeleteItem(item, deferUndoState)
15381538 end
15391539end
15401540
1541- -- Attempt to create a new item from the given item raw text and sets it as the new display item
1542- function ItemsTabClass : CreateDisplayItemFromRaw ( itemRaw , normalise )
1543- local newItem = new ( " Item " , itemRaw )
1544- if newItem . base then
1541+ local function copyAnointsAndEldritchImplicits ( self , newItem )
1542+ local currentItem = self . items [ self . activeItemSet [ newItem . base . type ]. selItemId ]
1543+ -- if you don't have an equipped item that matches the type of the newItem, no need to do anything
1544+ if currentItem then
15451545 -- if the new item is an amulet and does not have an anoint and your current amulet does, apply that anoint to the new item
1546- if newItem .base .type == " Amulet" and # newItem .enchantModLines == 0 and self . activeItemSet [ " Amulet " ]. selItemId > 0 then
1547- local currentAnoint = self . items [ self . activeItemSet [ " Amulet " ]. selItemId ] .enchantModLines
1546+ if newItem .base .type == " Amulet" and # newItem .enchantModLines == 0 then
1547+ local currentAnoint = currentItem .enchantModLines
15481548 if currentAnoint and # currentAnoint == 1 then -- skip if amulet has more than one anoint e.g. Stranglegasp
15491549 newItem .enchantModLines = currentAnoint
1550- newItem :BuildAndParseRaw ()
15511550 end
15521551 end
1552+
1553+ local implicitBaseTypes = { " Helmet" , " Body Armour" , " Gloves" , " Boots" }
1554+ local implicitRarities = { " NORMAL" , " MAGIC" , " RARE" }
1555+ -- if the new item is a Normal, Magic, or Rare Helmet, Body Armour, Gloves, or Boots and does not have any eldritch implicits
1556+ -- and your current respective item does, apply those implicits and influence to the new item
1557+ if main .migrateEldritchImplicits and isValueInTable (implicitBaseTypes , newItem .base .type ) and isValueInTable (implicitRarities , newItem .rarity ) and
1558+ not (newItem .tangle and newItem .cleansing ) and (currentItem .cleansing or currentItem .tangle ) then
1559+ local currentImplicits = currentItem .implicitModLines
1560+ if currentImplicits then
1561+ newItem .implicitModLines = currentImplicits
1562+ newItem .tangle = currentItem .tangle
1563+ newItem .cleansing = currentItem .cleansing
1564+ end
1565+ end
1566+ newItem :BuildAndParseRaw ()
1567+ end
1568+ end
1569+
1570+ -- Attempt to create a new item from the given item raw text and sets it as the new display item
1571+ function ItemsTabClass :CreateDisplayItemFromRaw (itemRaw , normalise )
1572+ local newItem = new (" Item" , itemRaw )
1573+ if newItem .base then
1574+ copyAnointsAndEldritchImplicits (self , newItem )
15531575 if normalise then
15541576 newItem :NormaliseQuality ()
15551577 newItem :BuildModList ()
0 commit comments