From 4866b3f1b6df4da0e3e2b5943163d0ccfe211665 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 26 Apr 2022 10:31:16 -0500 Subject: [PATCH 1/4] Fix Genesis --- main.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.lua b/main.lua index 35a5ff03..04ad2e72 100644 --- a/main.lua +++ b/main.lua @@ -1505,6 +1505,12 @@ local function OnUseD4(_, _, _, player) end EID:AddCallback(ModCallbacks.MC_USE_ITEM, OnUseD4, CollectibleType.COLLECTIBLE_D4) +-- Re-init transformation progress and item interactions after using Genesis +local function OnUseGenesis(_, _, _, player) + OnGameStartGeneral() +end +EID:AddCallback(ModCallbacks.MC_USE_ITEM, OnUseGenesis, CollectibleType.COLLECTIBLE_GENESIS) + function EID:OnUsePill(pillEffectID, player) local playerID = EID:getPlayerID(player) -- Dead Tainted Lazarus exceptions From aade574a4330f0551cc4615140b39de48c402132 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 26 Apr 2022 13:02:12 -0500 Subject: [PATCH 2/4] Better Death Certificate room detection --- eid_api.lua | 13 +++++++++++++ main.lua | 5 +---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index d03bf1da..0e759732 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1229,6 +1229,19 @@ function EID:AreAchievementsAllowed() return true end +function EID:IsDeathCertificateRoom() + local level = game:GetLevel() + local roomData = level:GetRoomByIdx(level:GetCurrentRoomIndex()).Data + if roomData then + if roomData.StageID == 35 then -- Home + if roomData.SubType == 33 or roomData.SubType == 34 then -- Death Certificate room subtypes + return true + end + end + end + return false +end + -- Converts a given table into a string containing the crafting icons of the table -- Example input: {1,2,3,4,5,6,7,8} -- Result: "{{Crafting1}}{{Crafting2}}{{Crafting3}}{{Crafting4}}{{Crafting5}}{{Crafting6}}{{Crafting7}}{{Crafting8}}" diff --git a/main.lua b/main.lua index 04ad2e72..0001d117 100644 --- a/main.lua +++ b/main.lua @@ -740,10 +740,7 @@ if REPENTANCE then end function EID:onNewRoom() isMirrorRoom = game:GetLevel():GetCurrentRoom():IsMirrorWorld() - - local level = game:GetLevel() - local id = level:GetCurrentRoomIndex() - isDeathCertRoom = (id >=0 and GetPtrHash(level:GetRoomByIdx(id)) == GetPtrHash(level:GetRoomByIdx(id, 2))) + isDeathCertRoom = EID:IsDeathCertificateRoom() -- Handle Flip Item initialItemNext = false From 7549699c686103f5bb7c820127b083957dc44eae Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 26 Apr 2022 13:18:25 -0500 Subject: [PATCH 3/4] Update eid_api.lua --- eid_api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eid_api.lua b/eid_api.lua index 0e759732..40e0bba8 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1233,7 +1233,7 @@ function EID:IsDeathCertificateRoom() local level = game:GetLevel() local roomData = level:GetRoomByIdx(level:GetCurrentRoomIndex()).Data if roomData then - if roomData.StageID == 35 then -- Home + if roomData.StageID == 35 then -- Home ID if roomData.SubType == 33 or roomData.SubType == 34 then -- Death Certificate room subtypes return true end From ad1989bcac489bb170ef023d8306313d3d11bf1c Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 26 Apr 2022 13:26:37 -0500 Subject: [PATCH 4/4] Update eid_api.lua --- eid_api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eid_api.lua b/eid_api.lua index 40e0bba8..83550370 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1231,7 +1231,7 @@ end function EID:IsDeathCertificateRoom() local level = game:GetLevel() - local roomData = level:GetRoomByIdx(level:GetCurrentRoomIndex()).Data + local roomData = level:GetCurrentRoomDesc().Data if roomData then if roomData.StageID == 35 then -- Home ID if roomData.SubType == 33 or roomData.SubType == 34 then -- Death Certificate room subtypes