Formatting

This commit is contained in:
kittenchilly committed 2021-10-19 09:41:51 -05:00
1 parent fd2cf94061
commit 1394de7c77
1 file changed
+36 -36
+36 -36
View File
@@ -760,50 +760,50 @@ function EID:getSpindownResult(collectibleID)
end end
function EID:isCollectibleUnlocked(collectibleID, itemPoolOfItem) function EID:isCollectibleUnlocked(collectibleID, itemPoolOfItem)
local itemPool = Game():GetItemPool() local itemPool = Game():GetItemPool()
local itemConfig = Isaac.GetItemConfig() local itemConfig = Isaac.GetItemConfig()
for i= 1, GetMaxCollectibleID() do for i= 1, GetMaxCollectibleID() do
if ItemConfig.Config.IsValidCollectible(i) and i ~= collectibleID then if ItemConfig.Config.IsValidCollectible(i) and i ~= collectibleID then
itemPool:AddRoomBlacklist(i) itemPool:AddRoomBlacklist(i)
end end
end end
local room = Game():GetRoom() local room = Game():GetRoom()
local isUnlocked = false local isUnlocked = false
for i = 0,1 do -- some samples to make sure for i = 0,1 do -- some samples to make sure
local collID = itemPool:GetCollectible(itemPoolOfItem, false) local collID = itemPool:GetCollectible(itemPoolOfItem, false)
if collID == collectibleID then if collID == collectibleID then
isUnlocked = true isUnlocked = true
break break
end end
end end
itemPool:ResetRoomBlacklist() itemPool:ResetRoomBlacklist()
return isUnlocked return isUnlocked
end end
function EID:isCollectibleUnlockedAnyPool(collectibleID) function EID:isCollectibleUnlockedAnyPool(collectibleID)
local itemConfig = Isaac.GetItemConfig() local itemConfig = Isaac.GetItemConfig()
if EID.itemUnlockStates[collectibleID] == nil then if EID.itemUnlockStates[collectibleID] == nil then
local itemPoolNum = 0 local itemPoolNum = 0
while EID:isCollectibleUnlocked(collectibleID, itemPoolNum) == false do while EID:isCollectibleUnlocked(collectibleID, itemPoolNum) == false do
if itemPoolNum == ItemPoolType.NUM_ITEMPOOLS - 1 then if itemPoolNum == ItemPoolType.NUM_ITEMPOOLS - 1 then
if itemConfig:GetCollectible(collectibleID).Tags & ItemConfig.TAG_QUEST == ItemConfig.TAG_QUEST then if itemConfig:GetCollectible(collectibleID).Tags & ItemConfig.TAG_QUEST == ItemConfig.TAG_QUEST then
--print("item " .. tostring(collectibleID) .. " is tagged as quest!") --print("item " .. tostring(collectibleID) .. " is tagged as quest!")
EID.itemUnlockStates[collectibleID] = true EID.itemUnlockStates[collectibleID] = true
return true return true
end end
--print("couldn't find item " .. tostring(collectibleID) .. " in any item pools") --print("couldn't find item " .. tostring(collectibleID) .. " in any item pools")
EID.itemUnlockStates[collectibleID] = false EID.itemUnlockStates[collectibleID] = false
return false return false
end end
itemPoolNum = itemPoolNum + 1 itemPoolNum = itemPoolNum + 1
end end
--print("found item " .. tostring(collectibleID) .. " unlocked in pool " .. tostring(itemPoolNum)) --print("found item " .. tostring(collectibleID) .. " unlocked in pool " .. tostring(itemPoolNum))
EID.itemUnlockStates[collectibleID] = true EID.itemUnlockStates[collectibleID] = true
return true return true
else else
--print("item " .. tostring(collectibleID) .. " was already cached: " .. tostring(EID.itemUnlockStates[collectibleID])) --print("item " .. tostring(collectibleID) .. " was already cached: " .. tostring(EID.itemUnlockStates[collectibleID]))
return EID.itemUnlockStates[collectibleID] return EID.itemUnlockStates[collectibleID]
end end
end end
-- Converts a given table into a string containing the crafting icons of the table -- Converts a given table into a string containing the crafting icons of the table