Crane Game support

This commit is contained in:
kittenchilly committed 2021-12-15 15:41:49 -06:00
1 parent 4dacbb6b54
commit 25aea6f7d8
2 files changed
+32 -2

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"])
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
+31 -1
View File
@@ -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