From d0c2219c7676953dbd7354edf17266321c5e3e3e Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 10 Jan 2022 02:59:06 -0500 Subject: [PATCH] add function for checking if any player has a given collectible --- eid_api.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eid_api.lua b/eid_api.lua index 713e1084..3f99d5bb 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -765,6 +765,17 @@ function EID:updateDescriptionsViaTable(changeTable, tableToUpdate) end end +-- Checks if any player has a given collectible ID, for modifiers +function EID:PlayersHaveCollectible(collectibleID) + for i = 0, game:GetNumPlayers() - 1 do + local player = Isaac.GetPlayer(i) + if player:HasCollectible(collectibleID) then + return true + end + end + return false +end + -- Converts a given CollectibleID into the respective Spindown dice result function EID:getSpindownResult(collectibleID) if collectibleID <= 0 or collectibleID > 4294960000 then return 0 end