Bag of Crafting: Curse of Maze room switch is now properly handled in pickup tracker
This commit is contained in:
1 parent
0a378e5b1b
commit
27862c5e6a
2 files changed
+34
-7
No files matched your search
+33
-7
@@ -503,8 +503,8 @@ local function calcHeldItems()
|
|||||||
end
|
end
|
||||||
local function calcFloorItems()
|
local function calcFloorItems()
|
||||||
EID.BoC.FloorQuery = {}
|
EID.BoC.FloorQuery = {}
|
||||||
for _,v in pairs(EID.BoC.RoomQueries) do
|
for _,roomQuery in pairs(EID.BoC.RoomQueries) do
|
||||||
for _,v1 in ipairs(v) do
|
for _,v1 in ipairs(roomQuery[1]) do
|
||||||
table.insert(EID.BoC.FloorQuery, v1)
|
table.insert(EID.BoC.FloorQuery, v1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -696,9 +696,9 @@ local function combinations(arr, length, startPos, tempResult, randResults, newR
|
|||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
coTimer = Isaac.GetTime()
|
coTimer = Isaac.GetTime()
|
||||||
end
|
end
|
||||||
local length = length or 8
|
length = length or 8
|
||||||
local startPos = startPos or 1
|
startPos = startPos or 1
|
||||||
local tempResult = tempResult or {}
|
tempResult = tempResult or {}
|
||||||
if (length == 0) then
|
if (length == 0) then
|
||||||
local resultString = table.concat(tempResult,",")
|
local resultString = table.concat(tempResult,",")
|
||||||
if (randResults[resultString] == nil) then
|
if (randResults[resultString] == nil) then
|
||||||
@@ -880,6 +880,32 @@ local function RecipeCrunchCoroutine()
|
|||||||
EID.RefreshBagTextbox = true
|
EID.RefreshBagTextbox = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function EID:BOCHandleCurseOfMaze()
|
||||||
|
-- switches tracked room contents when rooms are switched by curse of maze
|
||||||
|
if game:GetLevel():GetCurses() & LevelCurse.CURSE_OF_MAZE ~= LevelCurse.CURSE_OF_MAZE then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local rooms = game:GetLevel():GetRooms()
|
||||||
|
local changedRooms = {}
|
||||||
|
for i = 0, rooms.Size - 1 do
|
||||||
|
local roomDesc = rooms:Get(i)
|
||||||
|
if roomDesc and roomDesc.Data then
|
||||||
|
local savedRoomContent = EID.BoC.RoomQueries[roomDesc.ListIndex .. ""]
|
||||||
|
if not savedRoomContent then
|
||||||
|
EID.BoC.RoomQueries[roomDesc.ListIndex .. ""] = { {}, roomDesc.Data.Variant }
|
||||||
|
end
|
||||||
|
if savedRoomContent and savedRoomContent[2] ~= roomDesc.Data.Variant then
|
||||||
|
table.insert(changedRooms, roomDesc.ListIndex)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #changedRooms >= 2 then
|
||||||
|
local temp = EID.BoC.RoomQueries[changedRooms[2] .. ""]
|
||||||
|
EID.BoC.RoomQueries[changedRooms[2] .. ""] = EID.BoC.RoomQueries[changedRooms[1] .. ""]
|
||||||
|
EID.BoC.RoomQueries[changedRooms[1] .. ""] = temp
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local prevOffset = 0
|
local prevOffset = 0
|
||||||
-- Called 60 times a second so we can read input properly
|
-- Called 60 times a second so we can read input properly
|
||||||
function EID:handleBagOfCraftingUpdating()
|
function EID:handleBagOfCraftingUpdating()
|
||||||
@@ -1015,13 +1041,13 @@ function EID:handleBagOfCraftingRendering(ignoreRefreshRate)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
EID.BoC.RoomQueries[curRoomIndex..""] = roomItems
|
EID.BoC.RoomQueries[curRoomIndex .. ""] = { roomItems, game:GetLevel():GetCurrentRoomDesc().Data.Variant }
|
||||||
EID.BoC.CurrentPickupCount = #pickups
|
EID.BoC.CurrentPickupCount = #pickups
|
||||||
calcHeldItems()
|
calcHeldItems()
|
||||||
calcFloorItems()
|
calcFloorItems()
|
||||||
EID.RefreshBagTextbox = true
|
EID.RefreshBagTextbox = true
|
||||||
else
|
else
|
||||||
roomItems = EID.BoC.RoomQueries[curRoomIndex..""] or {}
|
roomItems = EID.BoC.RoomQueries[curRoomIndex .. ""] and EID.BoC.RoomQueries[curRoomIndex .. ""][1] or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
itemQuery = {}
|
itemQuery = {}
|
||||||
|
|||||||
@@ -764,6 +764,7 @@ if EID.isRepentance then
|
|||||||
local level = game:GetLevel()
|
local level = game:GetLevel()
|
||||||
EID.isMirrorRoom = level:GetCurrentRoom():IsMirrorWorld()
|
EID.isMirrorRoom = level:GetCurrentRoom():IsMirrorWorld()
|
||||||
EID.isDeathCertRoom = EID:GetDimension(level) == 2
|
EID.isDeathCertRoom = EID:GetDimension(level) == 2
|
||||||
|
EID:BOCHandleCurseOfMaze()
|
||||||
|
|
||||||
-- Handle Flip Item
|
-- Handle Flip Item
|
||||||
initialItemNext = false
|
initialItemNext = false
|
||||||
|
|||||||
Reference in new issue
Block a user