diff --git a/eid_api.lua b/eid_api.lua index 87926dc2..d7612ec5 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -491,7 +491,7 @@ function EID:hasDescription(entity) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EID.Config["DisplayPillInfo"]) return isAllowed and entity.SubType > 0 end - isAllowed = isAllowed or (entity.Type == 1000 and entity.Variant == EffectVariant.DICE_FLOOR and EID.Config["DisplayDiceInfo"]) + isAllowed = isAllowed or (entity.Type == 1000 and entity.Variant == EffectVariant.DICE_FLOOR and EID.Config["DisplayDiceInfo"]) or (entity.Type == 6 and entity.Variant == 16) return isAllowed end diff --git a/main.lua b/main.lua index e5ad0a69..804162fe 100644 --- a/main.lua +++ b/main.lua @@ -213,6 +213,21 @@ function EID:IsAltChoice(pickup) return true end +--------------------------------------------------------------------------- +-------------------------Handle Crane Game----------------------------- + +function EID:postGetCollectible(selectedCollectible, itemPoolType, decrease, seed) + if itemPoolType == ItemPoolType.POOL_CRANE_GAME then + local cranes = Isaac.FindByType(6, 16) + for _, crane in pairs(cranes) do + if not EID:getEntityData(crane, "EID_CraneItemType") then + crane:GetData()["EID_CraneItemType"] = selectedCollectible + end + end + end +end +EID:AddCallback(ModCallbacks.MC_POST_GET_COLLECTIBLE, EID.postGetCollectible) + --------------------------------------------------------------------------- ---------------------------Printing Functions------------------------------ @@ -755,12 +770,27 @@ local function onRender(t) EID:printDescription(origDesc) return end - + if closest.Type == 1000 and closest.Variant == 76 then EID:printDescription(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType+1)) return end + if closest.Type == 6 and closest.Variant == 16 then + --Handle Crane Game + if EID:getEntityData(closest, "EID_CraneItemType") 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 + EID:renderQuestionMark() + return + end + end + local descriptionObj = EID:getDescriptionObj(5, 100, EID:getEntityData(closest, "EID_CraneItemType")) + + EID:printDescription(descriptionObj) + end + end + if closest.Variant == PickupVariant.PICKUP_TRINKET then --Handle Trinkets local trinketID = closest.SubType