Added sacrifice room counter
This commit is contained in:
1 parent
b2b869d9a9
commit
14542ecbea
1 file changed
+9
-7
@@ -139,10 +139,10 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-------------------------Handle Sacrifice Room-----------------------------
|
-------------------------Handle Sacrifice Room-----------------------------
|
||||||
function EID:onNewFloor()
|
function EID:onNewFloor()
|
||||||
EID.sacrificeCounter = {}
|
EID.sacrificeCounter = {}
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.onNewFloor)
|
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.onNewFloor)
|
||||||
|
|
||||||
if EID.Config["DisplaySacrificeInfo"] then
|
if EID.Config["DisplaySacrificeInfo"] then
|
||||||
function EID:onSacrificeDamage(_, _, flags, source)
|
function EID:onSacrificeDamage(_, _, flags, source)
|
||||||
@@ -602,7 +602,10 @@ local function onRender(t)
|
|||||||
if EID.lastDist / 40 > tonumber(EID.Config["MaxDistance"]) then
|
if EID.lastDist / 40 > tonumber(EID.Config["MaxDistance"]) then
|
||||||
if game:GetRoom():GetType() == RoomType.ROOM_SACRIFICE and EID.Config["DisplaySacrificeInfo"] then
|
if game:GetRoom():GetType() == RoomType.ROOM_SACRIFICE and EID.Config["DisplaySacrificeInfo"] then
|
||||||
local curRoomIndex = game:GetLevel():GetCurrentRoomIndex()
|
local curRoomIndex = game:GetLevel():GetCurrentRoomIndex()
|
||||||
EID:printDescription(EID:getDescriptionObj(-999, -1, EID.sacrificeCounter[curRoomIndex] or 1))
|
local curCounter = EID.sacrificeCounter[curRoomIndex] or 1
|
||||||
|
local sacrificeDesc = EID:getDescriptionObj(-999, -1, curCounter)
|
||||||
|
sacrificeDesc.Name = sacrificeDesc.Name.." ("..curCounter.."/12)"
|
||||||
|
EID:printDescription(sacrificeDesc)
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -757,7 +760,6 @@ if EID.MCMLoaded or REPENTANCE then
|
|||||||
if REPENTANCE then
|
if REPENTANCE then
|
||||||
EID.Config["BagContent"] = EID.BagItems or {}
|
EID.Config["BagContent"] = EID.BagItems or {}
|
||||||
end
|
end
|
||||||
EID.Config["Hidden"] = EID.isHidden
|
|
||||||
EID.SaveData(EID, json.encode(EID.Config))
|
EID.SaveData(EID, json.encode(EID.Config))
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame)
|
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame)
|
||||||
@@ -765,4 +767,4 @@ end
|
|||||||
|
|
||||||
if enableDebug then
|
if enableDebug then
|
||||||
require("eid_debugging")
|
require("eid_debugging")
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user