Glitched Crown support additions (#736)

- always check cycle with RGON
-- this allows soul of isaac or everything jar. still 5+ entries are needed to show summary list
- add option to disable summary list
This commit is contained in:
리셰 authored and GitHub committed 2024-10-15 20:05:41 +02:00
1 parent 59a71e0cc3
commit 5e7b3d92c1
4 files changed
+41 -13

No files matched your search

+33 -12
View File
@@ -2396,18 +2396,39 @@ end
EID.GlitchedCrownCheck = {}
-- Watch pedestals for being a Glitched Crown style pedestal that flips between items too quickly to display descriptions for
function EID:WatchForGlitchedCrown()
if not EID.collectiblesOwned[689] then return end
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
EID.GlitchedCrownCheck[curRoomIndex] = EID.GlitchedCrownCheck[curRoomIndex] or {}
for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
-- Use InitSeed and Index to prevent any Diplopia weirdness
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] or {}
-- Initialize the data about this pedestal showing its current item ID, if necessary
-- in order to sort the items displayed, while also trashing items that haven't shown up in a while, keep both "initial frame seen" and "last frame seen"
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType] or {EID.GameUpdateCount, EID.GameUpdateCount}
-- update the last frame seen for the pedestal's current collectible ID
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType][2] = EID.GameUpdateCount
if REPENTOGON then
-- In REPENTOGON, always check even without Glitched Crown, allowing to check 5+ Soul of Isaac usage, or Everything Jar
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
EID.GlitchedCrownCheck[curRoomIndex] = EID.GlitchedCrownCheck[curRoomIndex] or {}
for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
-- Use InitSeed and Index to prevent any Diplopia weirdness
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] or {}
local pickup = entity:ToPickup()
local cycle = pickup:GetCollectibleCycle()
if #cycle > 1 then
for i, subType in ipairs(cycle) do
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][subType] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][subType] or {EID.GameUpdateCount + i, EID.GameUpdateCount + i}
-- update the last frame seen for the pedestal's current collectible ID
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][subType][2] = EID.GameUpdateCount + i
end
end
end
else
if not EID.collectiblesOwned[689] then return end
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
EID.GlitchedCrownCheck[curRoomIndex] = EID.GlitchedCrownCheck[curRoomIndex] or {}
for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
-- Use InitSeed and Index to prevent any Diplopia weirdness
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] or {}
-- Initialize the data about this pedestal showing its current item ID, if necessary
-- in order to sort the items displayed, while also trashing items that haven't shown up in a while, keep both "initial frame seen" and "last frame seen"
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType] or {EID.GameUpdateCount, EID.GameUpdateCount}
-- update the last frame seen for the pedestal's current collectible ID
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType][2] = EID.GameUpdateCount
end
end
end
+2
View File
@@ -477,6 +477,8 @@ if MCMLoaded then
{infoText = "Changes Health Ups and removes healing effect text when playing as a character that can't have red health"})
EID:AddBooleanSetting("Display", "DisplayTCainSalvageResults", "Show Tainted Cain Salvage Results",
{repOnly = true, infoText = "As Tainted Cain, replaces pedestal descriptions with what they will turn into on touch"})
EID:AddBooleanSetting("Display", "GlitchedCrownSummary", "Show Glitched Crown Summary",
{repOnly = true, infoText = "With Glitched Crown, show summary list for cycling pedestals"})
--------Obstruction---------
+1 -1
View File
@@ -989,7 +989,7 @@ if EID.isRepentance then
-- Using magic numbers here in case it's slightly faster, and because the callback names give context
-- Check Birthright first because it overwrites the description instead of appending to it
if descObj.ObjSubType == 619 then table.insert(callbacks, BirthrightCallback) end
if EID.collectiblesOwned[689] then table.insert(callbacks, GlitchedCrownCallback) end
if (REPENTOGON or EID.collectiblesOwned[689]) and EID.Config["GlitchedCrownSummary"] then table.insert(callbacks, GlitchedCrownCallback) end
-- Glowing Hourglass overwrites the description when used three times
if REPENTOGON and descObj.ObjSubType == 422 then table.insert(callbacks, GlowingHourglassCallback) end