Add support for collectible's item pool (#561)

* getlastpool test

* update icons and config

* Don't show pool for quest items

* Fix modded recipes breaking game's last pool

* fix icon misalign

* Added text for Last Item Pool indicator
This commit is contained in:
wakaba (aka. 미카) authored and GitHub committed 2023-05-07 16:58:43 +02:00
1 parent 51d0ef2e1b
commit da9338ef54
10 files changed
+161 -3

No files matched your search

+14
View File
@@ -229,6 +229,19 @@ end
if EID.isRepentance then
-- Handle Last Pool
local function LastPoolCallback(descObj)
local itemConfig = EID.itemConfig:GetCollectible(descObj.ObjSubType)
if itemConfig:IsCollectible() and not itemConfig:HasTags(ItemConfig.TAG_QUEST) then
local lastPool = game:GetItemPool():GetLastPool()
local poolName = ""
local poolDescPrepend = EID:getDescriptionEntry("itemPoolFor")
local poolDescTable = EID:getDescriptionEntry("itemPoolNames")
poolName = "{{"..EID.Config["ItemPoolTextColor"].."}}"..poolDescPrepend..""..(EID.ItemPoolTypeToMarkup[lastPool] or "{{ItemPoolTreasure}}")..poolDescTable[lastPool] .. "{{CR}}#"
descObj.Description = poolName .. descObj.Description
end
return descObj
end
-- Handle Birthright
local function BirthrightCallback(descObj)
descObj.Description = ""
@@ -676,6 +689,7 @@ if EID.isRepentance then
-- Using magic numbers here in case it's slightly faster, and because the callback names give context
-- Check Birthright first because it overwrites the description instead of appending to it
if descObj.ObjSubType == 619 then table.insert(callbacks, BirthrightCallback) end
if not EID.InsideItemReminder and EID.Config["ShowItemPoolText"] then table.insert(callbacks, LastPoolCallback) end
if descObj.ObjSubType == 644 then table.insert(callbacks, ConsolationPrizeCallback) end
if EID.collectiblesOwned[664] then table.insert(callbacks, BingeEaterCallback) end