Merge pull request #383 from Buurazu/master

fix modifiers stuff in two places
This commit is contained in:
wofsauge authored and GitHub committed 2022-02-13 20:32:58 +01:00
commit 47af53ba64
3 files changed
+5 -53

No files matched your search

+2 -45
View File
@@ -1358,49 +1358,6 @@ function EID:getLanguage()
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
table.insert(EID.collectiblesToCheck, itemID)
end
+3 -3
View File
@@ -191,7 +191,7 @@ if REPENTANCE then
-- Handle Spindown Dice description addition
local function SpindownDiceCallback(descObj)
-- get the ID of the player that owns the Spindown Dice
local playerID = (EID.collectiblesOwned[723] or (EID.absorbedItems[723] and EID.collectiblesOwned[477]))
local playerID = (EID.collectiblesOwned[723] or EID.collectiblesAbsorbed[723])
EID:appendToDescription(descObj, "#{{Collectible723}} :")
local refID = descObj.ObjSubType
local hasCarBattery = Isaac.GetPlayer(playerID):HasCollectible(CollectibleType.COLLECTIBLE_CAR_BATTERY)
@@ -444,10 +444,10 @@ if REPENTANCE then
if EID.collectiblesOwned[664] then table.insert(callbacks, BingeEaterCallback) end
if EID.collectiblesOwned[59] then table.insert(callbacks, BookOfBelialCallback) end
if EID.collectiblesOwned[584] then table.insert(callbacks, BookOfVirtuesCallback) end
if EID.collectiblesOwned[706] or (EID.absorbedItems[706] and EID.collectiblesOwned[477]) then table.insert(callbacks, AbyssCallback) end
if EID.collectiblesOwned[706] or EID.collectiblesAbsorbed[706] then table.insert(callbacks, AbyssCallback) end
if EID.collectiblesOwned[711] and EID:getEntityData(descObj.Entity, "EID_FlipItemID") then table.insert(callbacks, FlipCallback) end
if EID.Config["SpindownDiceResults"] > 0 and (EID.collectiblesOwned[723] or (EID.absorbedItems[723] and EID.collectiblesOwned[477])) and descObj.ObjSubType ~= 668 then table.insert(callbacks, SpindownDiceCallback) end
if EID.Config["SpindownDiceResults"] > 0 and (EID.collectiblesOwned[723] or EID.collectiblesAbsorbed[723]) and descObj.ObjSubType ~= 668 then table.insert(callbacks, SpindownDiceCallback) end
-- Card / Rune Callbacks
elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then
-5
View File
@@ -28,7 +28,6 @@ EID.sacrificeCounter = {}
EID.itemConfig = Isaac.GetItemConfig()
EID.itemUnlockStates = {}
EID.CraneItemType = {}
EID.collectiblesOwned = {}
EID.absorbedItems = {}
EID.CollectedItems = {}
local pathsChecked = {}
@@ -1257,7 +1256,6 @@ if EID.MCMLoaded or REPENTANCE then
["BagFloorContent"] = true,
["CraneItemType"] = true,
["FlipItemPositions"] = true,
["CollectiblesOwned"] = true,
["AbsorbedItems"] = true,
["CollectedItems"] = true,
}
@@ -1282,14 +1280,12 @@ if EID.MCMLoaded or REPENTANCE then
EID.BagItems = {}
EID.CraneItemType = {}
EID.flipItemPositions = {}
EID.collectiblesOwned = {}
EID.absorbedItems = {}
if isSave then
EID.BagItems = savedEIDConfig["BagContent"] or {}
EID.bagOfCraftingRoomQueries = savedEIDConfig["BagFloorContent"] or {}
EID.CraneItemType = savedEIDConfig["CraneItemType"] or {}
EID.collectiblesOwned = savedEIDConfig["AbsorbedItems"] or {}
EID.absorbedItems = savedEIDConfig["AbsorbedItems"] or {}
-- turn list back into dict because json cant save dict indices.
@@ -1351,7 +1347,6 @@ if EID.MCMLoaded or REPENTANCE then
EID.Config["BagContent"] = EID.BagItems or {}
EID.Config["BagFloorContent"] = EID.bagOfCraftingRoomQueries or {}
EID.Config["CraneItemType"] = EID.CraneItemType or {}
EID.Config["CollectiblesOwned"] = EID.collectiblesOwned or {}
EID.Config["AbsorbedItems"] = EID.absorbedItems or {}
-- turn dictionary into list because json cant save dict indices.