Merge pull request #383 from Buurazu/master
fix modifiers stuff in two places
This commit is contained in:
3 files changed
+5
-53
No files matched your search
+2
-45
@@ -1358,49 +1358,6 @@ function EID:getLanguage()
|
|||||||
return lang
|
return lang
|
||||||
end
|
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)
|
function EID:AddToCollectiblesToCheckList(itemID)
|
||||||
table.insert(collectiblesToCheck, itemID)
|
table.insert(EID.collectiblesToCheck, itemID)
|
||||||
end
|
end
|
||||||
+3
-3
@@ -191,7 +191,7 @@ if REPENTANCE then
|
|||||||
-- Handle Spindown Dice description addition
|
-- Handle Spindown Dice description addition
|
||||||
local function SpindownDiceCallback(descObj)
|
local function SpindownDiceCallback(descObj)
|
||||||
-- get the ID of the player that owns the Spindown Dice
|
-- 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}} :")
|
EID:appendToDescription(descObj, "#{{Collectible723}} :")
|
||||||
local refID = descObj.ObjSubType
|
local refID = descObj.ObjSubType
|
||||||
local hasCarBattery = Isaac.GetPlayer(playerID):HasCollectible(CollectibleType.COLLECTIBLE_CAR_BATTERY)
|
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[664] then table.insert(callbacks, BingeEaterCallback) end
|
||||||
if EID.collectiblesOwned[59] then table.insert(callbacks, BookOfBelialCallback) end
|
if EID.collectiblesOwned[59] then table.insert(callbacks, BookOfBelialCallback) end
|
||||||
if EID.collectiblesOwned[584] then table.insert(callbacks, BookOfVirtuesCallback) 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.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
|
-- Card / Rune Callbacks
|
||||||
elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then
|
elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ EID.sacrificeCounter = {}
|
|||||||
EID.itemConfig = Isaac.GetItemConfig()
|
EID.itemConfig = Isaac.GetItemConfig()
|
||||||
EID.itemUnlockStates = {}
|
EID.itemUnlockStates = {}
|
||||||
EID.CraneItemType = {}
|
EID.CraneItemType = {}
|
||||||
EID.collectiblesOwned = {}
|
|
||||||
EID.absorbedItems = {}
|
EID.absorbedItems = {}
|
||||||
EID.CollectedItems = {}
|
EID.CollectedItems = {}
|
||||||
local pathsChecked = {}
|
local pathsChecked = {}
|
||||||
@@ -1257,7 +1256,6 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
["BagFloorContent"] = true,
|
["BagFloorContent"] = true,
|
||||||
["CraneItemType"] = true,
|
["CraneItemType"] = true,
|
||||||
["FlipItemPositions"] = true,
|
["FlipItemPositions"] = true,
|
||||||
["CollectiblesOwned"] = true,
|
|
||||||
["AbsorbedItems"] = true,
|
["AbsorbedItems"] = true,
|
||||||
["CollectedItems"] = true,
|
["CollectedItems"] = true,
|
||||||
}
|
}
|
||||||
@@ -1282,14 +1280,12 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
EID.BagItems = {}
|
EID.BagItems = {}
|
||||||
EID.CraneItemType = {}
|
EID.CraneItemType = {}
|
||||||
EID.flipItemPositions = {}
|
EID.flipItemPositions = {}
|
||||||
EID.collectiblesOwned = {}
|
|
||||||
EID.absorbedItems = {}
|
EID.absorbedItems = {}
|
||||||
|
|
||||||
if isSave then
|
if isSave then
|
||||||
EID.BagItems = savedEIDConfig["BagContent"] or {}
|
EID.BagItems = savedEIDConfig["BagContent"] or {}
|
||||||
EID.bagOfCraftingRoomQueries = savedEIDConfig["BagFloorContent"] or {}
|
EID.bagOfCraftingRoomQueries = savedEIDConfig["BagFloorContent"] or {}
|
||||||
EID.CraneItemType = savedEIDConfig["CraneItemType"] or {}
|
EID.CraneItemType = savedEIDConfig["CraneItemType"] or {}
|
||||||
EID.collectiblesOwned = savedEIDConfig["AbsorbedItems"] or {}
|
|
||||||
EID.absorbedItems = savedEIDConfig["AbsorbedItems"] or {}
|
EID.absorbedItems = savedEIDConfig["AbsorbedItems"] or {}
|
||||||
|
|
||||||
-- turn list back into dict because json cant save dict indices.
|
-- 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["BagContent"] = EID.BagItems or {}
|
||||||
EID.Config["BagFloorContent"] = EID.bagOfCraftingRoomQueries or {}
|
EID.Config["BagFloorContent"] = EID.bagOfCraftingRoomQueries or {}
|
||||||
EID.Config["CraneItemType"] = EID.CraneItemType or {}
|
EID.Config["CraneItemType"] = EID.CraneItemType or {}
|
||||||
EID.Config["CollectiblesOwned"] = EID.collectiblesOwned or {}
|
|
||||||
EID.Config["AbsorbedItems"] = EID.absorbedItems or {}
|
EID.Config["AbsorbedItems"] = EID.absorbedItems or {}
|
||||||
|
|
||||||
-- turn dictionary into list because json cant save dict indices.
|
-- turn dictionary into list because json cant save dict indices.
|
||||||
|
|||||||
Reference in new issue
Block a user