Return absorbable actives, add getPlayerID

This commit is contained in:
Buurazu authored and GitHub committed 2022-02-13 05:10:41 -05:00
1 parent 5d73a07bbf
commit 3d24356f8e
1 file changed
+20 -1
+20 -1
View File
@@ -1003,10 +1003,12 @@ local function GetTwoIncreases(rng, tbl)
return rng
end
-- Count the number of absorbable pedestals in the room
-- Returns a table of active items that will be absorbed
function EID:VoidRoomCheck()
numVoidable = 0
numRunable = 0
EID.VoidOptionIndexes = {}
local activesAbsorbed = {}
for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
local pickup = entity:ToPickup()
-- Count this pedestal if it's not an active (or this is Black Rune), not a shop item, and (in Repentance) the first of its option index
@@ -1015,9 +1017,14 @@ function EID:VoidRoomCheck()
(not REPENTANCE or pickup.OptionsPickupIndex == 0 or EID.VoidOptionIndexes[pickup.OptionsPickupIndex] == nil) then
numRunable = numRunable + 1
if REPENTANCE then EID.VoidOptionIndexes[pickup.OptionsPickupIndex] = entity.SubType end
if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE) then numVoidable = numVoidable + 1 end
if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE) then
numVoidable = numVoidable + 1
else
table.insert(activesAbsorbed, entity.SubType)
end
end
end
return activesAbsorbed
end
-- Determine what stats will be increased after 1 absorption, the whole room's absorption, and whole room + a purchased item above your head
function EID:VoidRNGCheck(player, isRune)
@@ -1332,6 +1339,18 @@ function EID:checkPlayersForMissingItems()
end
end
function EID:getPlayerID(entityPlayer)
if not entityPlayer then return 0 end
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
if GetPtrHash(player) == GetPtrHash(entityPlayer) then
print(i)
return i
end
end
return 0
end
function EID:getLanguage()
local lang = EID.Config["Language"]
if lang == "auto" then