diff --git a/features/eid_api.lua b/features/eid_api.lua index e389036a..a404ea00 100644 --- a/features/eid_api.lua +++ b/features/eid_api.lua @@ -654,6 +654,7 @@ function EID:getDescriptionObj(Type, Variant, SubType, entity, checkModifiers) description.ModName = tableEntry and tableEntry[4] description.Quality = EID:getObjectQuality(description) description.Icon = EID:getObjectIcon(description) + description.ItemPoolType = EID:getObjectItemPool(description) EID:getObjectItemTypeAndCharge(description) EID.DifferentEffectPlayers = {} @@ -2618,6 +2619,23 @@ function EID:getObjectQuality(descObj) end end +---Returns the item pool of the described entity +---@param descObj EID_DescObj +---@return integer? +function EID:getObjectItemPool(descObj) + local subType = tonumber(descObj.ObjSubType) ---@cast subType number + if EID.isRepentance and descObj.ObjType == 5 and descObj.ObjVariant == 100 then + if EID.isRepentancePlus then + -- TODO (maybe will require REPENTOGON?) + -- Since D4 exploit is completely fixed in 1.9.7.11, this is no longer viable for full-reroll effect + -- (still useful for initial item pool from rooms though) + return game:GetItemPool():GetLastPool() -- remove this if item pool function should not appear on 1.9.7.11 patch + else + return game:GetItemPool():GetLastPool() + end + end +end + EID.ObjectIcon = {} ---Returns the Inline Icon definition object for a given object. ---@param descObj EID_DescObj diff --git a/main.lua b/main.lua index c11f61d6..9998f894 100644 --- a/main.lua +++ b/main.lua @@ -651,13 +651,13 @@ function EID:printDescription(desc, cachedID) curName = curName.." - {{Quality"..desc.Quality.."}}" end -- Display Last Pool for Collectible for full reroll effects (icon) - if EID.isRepentance and EID.Config["ShowItemPoolIcon"] and (desc.ObjType == 5 and desc.ObjVariant == 100) then + if desc.ItemPoolType and EID.Config["ShowItemPoolIcon"] then local itemConfig = EID.itemConfig:GetCollectible(desc.ObjSubType) if itemConfig:IsCollectible() and not itemConfig:HasTags(ItemConfig.TAG_QUEST) then if not EID.Config["ShowQuality"] then curName = curName.." - " end - curName = curName..""..(EID.ItemPoolTypeToMarkup[game:GetItemPool():GetLastPool()] or "{{ItemPoolTreasure}}") + curName = curName..""..(EID.ItemPoolTypeToMarkup[desc.ItemPoolType] or "{{ItemPoolTreasure}}") end end -- Display the mod this item is from @@ -720,10 +720,10 @@ function EID:printDescription(desc, cachedID) end end -- Display Last Pool for Collectible for full reroll effects (name) - if EID.isRepentance and not EID.InsideItemReminder and EID.Config["ShowItemPoolText"] and (desc.ObjType and desc.ObjType == 5 and desc.ObjVariant and desc.ObjVariant == 100) then + if desc.ItemPoolType and not EID.InsideItemReminder and EID.Config["ShowItemPoolText"] then local itemConfig = EID.itemConfig:GetCollectible(desc.ObjSubType) if itemConfig:IsCollectible() and not itemConfig:HasTags(ItemConfig.TAG_QUEST) then - local lastPool = game:GetItemPool():GetLastPool() + local lastPool = desc.ItemPoolType local poolName = "" local poolDescPrepend = EID:getDescriptionEntry("itemPoolFor")