Merge pull request #452 from kittenchilly/master
Fix Genesis interaction
This commit is contained in:
2 files changed
+20
-4
No files matched your search
+13
@@ -1229,6 +1229,19 @@ function EID:AreAchievementsAllowed()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function EID:IsDeathCertificateRoom()
|
||||||
|
local level = game:GetLevel()
|
||||||
|
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
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
-- Converts a given table into a string containing the crafting icons of the table
|
-- Converts a given table into a string containing the crafting icons of the table
|
||||||
-- Example input: {1,2,3,4,5,6,7,8}
|
-- Example input: {1,2,3,4,5,6,7,8}
|
||||||
-- Result: "{{Crafting1}}{{Crafting2}}{{Crafting3}}{{Crafting4}}{{Crafting5}}{{Crafting6}}{{Crafting7}}{{Crafting8}}"
|
-- Result: "{{Crafting1}}{{Crafting2}}{{Crafting3}}{{Crafting4}}{{Crafting5}}{{Crafting6}}{{Crafting7}}{{Crafting8}}"
|
||||||
|
|||||||
@@ -740,10 +740,7 @@ if REPENTANCE then
|
|||||||
end
|
end
|
||||||
function EID:onNewRoom()
|
function EID:onNewRoom()
|
||||||
isMirrorRoom = game:GetLevel():GetCurrentRoom():IsMirrorWorld()
|
isMirrorRoom = game:GetLevel():GetCurrentRoom():IsMirrorWorld()
|
||||||
|
isDeathCertRoom = EID:IsDeathCertificateRoom()
|
||||||
local level = game:GetLevel()
|
|
||||||
local id = level:GetCurrentRoomIndex()
|
|
||||||
isDeathCertRoom = (id >=0 and GetPtrHash(level:GetRoomByIdx(id)) == GetPtrHash(level:GetRoomByIdx(id, 2)))
|
|
||||||
|
|
||||||
-- Handle Flip Item
|
-- Handle Flip Item
|
||||||
initialItemNext = false
|
initialItemNext = false
|
||||||
@@ -1505,6 +1502,12 @@ local function OnUseD4(_, _, _, player)
|
|||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_USE_ITEM, OnUseD4, CollectibleType.COLLECTIBLE_D4)
|
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)
|
function EID:OnUsePill(pillEffectID, player)
|
||||||
local playerID = EID:getPlayerID(player)
|
local playerID = EID:getPlayerID(player)
|
||||||
-- Dead Tainted Lazarus exceptions
|
-- Dead Tainted Lazarus exceptions
|
||||||
|
|||||||
Reference in new issue
Block a user