From 5e7b3d92c1498b586f7fe26618cd5e4489d19b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A6=AC=EC=85=B0?= <37092106+kohashiwakaba@users.noreply.github.com> Date: Wed, 16 Oct 2024 03:05:41 +0900 Subject: [PATCH] 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 --- eid_config.lua | 5 +++++ features/eid_api.lua | 45 ++++++++++++++++++++++++++++---------- features/eid_mcm.lua | 2 ++ features/eid_modifiers.lua | 2 +- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index 1166afc1..a60c4be4 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -509,6 +509,10 @@ EID.UserConfig = { -- REPENTANCE ONLY!!! -- Default = false ["SpindownDiceSkipLocked"] = false, + -- Show summary list for Glitched Crown, 5 item names are shown first, and press tap to cycle descriptions + -- REPENTANCE ONLY!!! + -- Default = true + ["GlitchedCrownSummary"] = true, -- Error message displayed when an error occurs -- Default = [Effect not defined] @@ -651,6 +655,7 @@ EID.DefaultConfig = { ["SpindownDiceDisplayID"] = false, ["SpindownDiceDisplayName"] = false, ["SpindownDiceSkipLocked"] = false, + ["GlitchedCrownSummary"] = true, ["SaveGameNumber"] = 0, ["HideUncollectedItemDescriptions"] = false, ["ItemCollectionIndicator"] = true, diff --git a/features/eid_api.lua b/features/eid_api.lua index 09971c4a..c2fa9bc2 100644 --- a/features/eid_api.lua +++ b/features/eid_api.lua @@ -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 diff --git a/features/eid_mcm.lua b/features/eid_mcm.lua index 00e3ea25..9a687ef3 100644 --- a/features/eid_mcm.lua +++ b/features/eid_mcm.lua @@ -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--------- diff --git a/features/eid_modifiers.lua b/features/eid_modifiers.lua index 836fa2b2..6f12b965 100644 --- a/features/eid_modifiers.lua +++ b/features/eid_modifiers.lua @@ -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