Save data and other tweaks

This commit is contained in:
kittenchilly committed 2021-12-15 17:23:04 -06:00
1 parent 9c84886155
commit 88b3ea26f1
2 files changed
+23 -7

No files matched your search

+1 -1
View File
@@ -491,7 +491,7 @@ function EID:hasDescription(entity)
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EID.Config["DisplayPillInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EID.Config["DisplayPillInfo"])
return isAllowed and entity.SubType > 0 return isAllowed and entity.SubType > 0
end end
isAllowed = isAllowed or (entity.Type == 1000 and entity.Variant == EffectVariant.DICE_FLOOR and EID.Config["DisplayDiceInfo"]) or (entity.Type == 6 and entity.Variant == 16) isAllowed = isAllowed or (entity.Type == 1000 and entity.Variant == EffectVariant.DICE_FLOOR and EID.Config["DisplayDiceInfo"]) or (entity.Type == 6 and entity.Variant == 16 and (not entity:GetSprite():IsPlaying("Broken") and not entity:GetSprite():IsPlaying("Prize")))
return isAllowed return isAllowed
end end
+22 -6
View File
@@ -28,6 +28,7 @@ EID.sacrificeCounter = {}
EID.itemConfig = Isaac.GetItemConfig() EID.itemConfig = Isaac.GetItemConfig()
EID.effectList = {["76"] = true} EID.effectList = {["76"] = true}
EID.itemUnlockStates = {} EID.itemUnlockStates = {}
EID.CraneItemType = {}
-- Sprite inits -- Sprite inits
EID.IconSprite = Sprite() EID.IconSprite = Sprite()
@@ -218,10 +219,11 @@ end
function EID:postGetCollectible(selectedCollectible, itemPoolType, decrease, seed) function EID:postGetCollectible(selectedCollectible, itemPoolType, decrease, seed)
if itemPoolType == ItemPoolType.POOL_CRANE_GAME then if itemPoolType == ItemPoolType.POOL_CRANE_GAME then
local cranes = Isaac.FindByType(6, 16) for _, crane in ipairs(Isaac.FindByType(6, 16, -1, true, false)) do
for _, crane in pairs(cranes) do if not crane:GetSprite():IsPlaying("Broken") then
if not EID:getEntityData(crane, "EID_CraneItemType") then if not EID.CraneItemType[tostring(crane.InitSeed)] then
crane:GetData()["EID_CraneItemType"] = selectedCollectible EID.CraneItemType[tostring(crane.InitSeed)] = selectedCollectible
end
end end
end end
end end
@@ -557,6 +559,7 @@ EID.hasValidWalkingpath = true
function EID:onGameUpdate() function EID:onGameUpdate()
EID:setPlayer() EID:setPlayer()
--Fix Overlapping Pedestals --Fix Overlapping Pedestals
local curPositions = {} local curPositions = {}
for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
@@ -571,6 +574,14 @@ function EID:onGameUpdate()
table.insert(curPositions, {entity, entity.Position}) table.insert(curPositions, {entity, entity.Position})
end end
for _, crane in ipairs(Isaac.FindByType(6, 16, -1, true, false)) do
if EID.CraneItemType[tostring(crane.InitSeed)] then
if crane:GetSprite():IsPlaying("Prize") then
EID.CraneItemType[tostring(crane.InitSeed)] = nil
end
end
end
if not EID.Config["DisplayObstructedCardInfo"] or not EID.Config["DisplayObstructedPillInfo"] or not EID.Config["DisplayObstructedSoulstoneInfo"] then if not EID.Config["DisplayObstructedCardInfo"] or not EID.Config["DisplayObstructedPillInfo"] or not EID.Config["DisplayObstructedSoulstoneInfo"] then
if EID.lastDescriptionEntity == nil or (EID.Config["DisableObstructionOnFlight"] and EID.player.CanFly) then if EID.lastDescriptionEntity == nil or (EID.Config["DisableObstructionOnFlight"] and EID.player.CanFly) then
if EID.pathCheckerEntity ~= nil then if EID.pathCheckerEntity ~= nil then
@@ -778,14 +789,16 @@ local function onRender(t)
if closest.Type == 6 and closest.Variant == 16 then if closest.Type == 6 and closest.Variant == 16 then
--Handle Crane Game --Handle Crane Game
if EID:getEntityData(closest, "EID_CraneItemType") then
if EID.CraneItemType[tostring(closest.InitSeed)] then
if EID:getEntityData(closest, "EID_DontHide") ~= true then if EID:getEntityData(closest, "EID_DontHide") ~= true then
if (EID:hasCurseBlind() and EID.Config["DisableOnCurse"]) or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then if (EID:hasCurseBlind() and EID.Config["DisableOnCurse"]) or (game.Challenge == Challenge.CHALLENGE_APRILS_FOOL and EID.Config["DisableOnAprilFoolsChallenge"]) then
EID:renderQuestionMark() EID:renderQuestionMark()
return return
end end
end end
local descriptionObj = EID:getDescriptionObj(5, 100, EID:getEntityData(closest, "EID_CraneItemType")) local collectibleID = EID.CraneItemType[tostring(closest.InitSeed)]
local descriptionObj = EID:getDescriptionObj(5, 100, collectibleID)
EID:printDescription(descriptionObj) EID:printDescription(descriptionObj)
return return
@@ -882,8 +895,10 @@ if EID.MCMLoaded or REPENTANCE then
if REPENTANCE and isSave then if REPENTANCE and isSave then
EID.BagItems = savedEIDConfig["BagContent"] EID.BagItems = savedEIDConfig["BagContent"]
EID.bagOfCraftingRoomQueries = savedEIDConfig["BagFloorContent"] EID.bagOfCraftingRoomQueries = savedEIDConfig["BagFloorContent"]
EID.CraneItemType = savedEIDConfig["CraneItemType"]
savedEIDConfig["BagContent"] = nil savedEIDConfig["BagContent"] = nil
savedEIDConfig["BagFloorContent"] = nil savedEIDConfig["BagFloorContent"] = nil
savedEIDConfig["CraneItemType"] = nil
else else
EID.BagItems = {} EID.BagItems = {}
end end
@@ -927,6 +942,7 @@ if EID.MCMLoaded or REPENTANCE then
if REPENTANCE then if REPENTANCE then
EID.Config["BagContent"] = EID.BagItems or {} EID.Config["BagContent"] = EID.BagItems or {}
EID.Config["BagFloorContent"] = EID.bagOfCraftingRoomQueries or {} EID.Config["BagFloorContent"] = EID.bagOfCraftingRoomQueries or {}
EID.Config["CraneItemType"] = EID.CraneItemType or {}
end end
EID.SaveData(EID, json.encode(EID.Config)) EID.SaveData(EID, json.encode(EID.Config))
EID:hidePermanentText() EID:hidePermanentText()