Make some modifier stuff global and add saving
This commit is contained in:
1 parent
38c7826480
commit
392644be1e
3 files changed
+69
-62
No files matched your search
+47
@@ -1335,3 +1335,50 @@ function EID:getLanguage()
|
||||
end
|
||||
return lang
|
||||
end
|
||||
|
||||
-- Afterbirth+ modifiers
|
||||
local collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, }
|
||||
local maxSlot = 1
|
||||
-- Repentance modifiers
|
||||
if REPENTANCE then
|
||||
maxSlot = 3
|
||||
--include the AB+ collectiblesToCheck in this table!
|
||||
collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID,
|
||||
CollectibleType.COLLECTIBLE_BINGE_EATER, CollectibleType.COLLECTIBLE_BOOK_OF_VIRTUES, CollectibleType.COLLECTIBLE_SPINDOWN_DICE,
|
||||
CollectibleType.COLLECTIBLE_TAROT_CLOTH, CollectibleType.COLLECTIBLE_MOMS_BOX, 59, --Birthright Belial
|
||||
CollectibleType.COLLECTIBLE_BLANK_CARD, CollectibleType.COLLECTIBLE_CLEAR_RUNE, CollectibleType.COLLECTIBLE_PLACEBO,
|
||||
CollectibleType.COLLECTIBLE_FALSE_PHD, CollectibleType.COLLECTIBLE_ABYSS, CollectibleType.COLLECTIBLE_FLIP,
|
||||
}
|
||||
end
|
||||
local blackRuneOwned = false
|
||||
local lastCheck = 0
|
||||
function EID:CheckPlayersCollectibles()
|
||||
-- recheck the players' owned collectibles periodically, not every frame
|
||||
if EID.GameUpdateCount >= lastCheck + 15 then
|
||||
lastCheck = EID.GameUpdateCount
|
||||
local numPlayers = game:GetNumPlayers()
|
||||
local players = {}; for i = 0, numPlayers - 1 do players[i] = Isaac.GetPlayer(i) end
|
||||
for _,v in ipairs(collectiblesToCheck) do
|
||||
EID.collectiblesOwned[v] = false
|
||||
for i = 0, numPlayers - 1 do
|
||||
if players[i]:HasCollectible(v) then
|
||||
EID.collectiblesOwned[v] = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
blackRuneOwned = false
|
||||
for i = 0, numPlayers - 1 do
|
||||
for j = 0, maxSlot do
|
||||
if players[i]:GetCard(j) == Card.RUNE_BLACK then
|
||||
blackRuneOwned = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function EID:AddToCollectiblesToCheckList(itemID)
|
||||
table.insert(collectiblesToCheck, itemID)
|
||||
end
|
||||
Reference in new issue
Block a user