Merge pull request #273 from kittenchilly/master
Support items inside Crane Game
This commit is contained in:
4 files changed
+83
No files matched your search
@@ -491,6 +491,9 @@ 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
|
||||||
|
if entity.Type == 6 and entity.Variant == 16 and EID.Config["DisplayCraneInfo"] and REPENTANCE then
|
||||||
|
isAllowed = not entity:GetSprite():IsPlaying("Broken") and not entity:GetSprite():IsPlaying("Prize")
|
||||||
|
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"])
|
||||||
return isAllowed
|
return isAllowed
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -195,6 +195,13 @@ EID.UserConfig = {
|
|||||||
-- Default = true
|
-- Default = true
|
||||||
["DisplayDiceInfo"] = true,
|
["DisplayDiceInfo"] = true,
|
||||||
|
|
||||||
|
--------Crane Game---------
|
||||||
|
-- REPENTANCE ONLY!!!
|
||||||
|
|
||||||
|
-- Toggle Display for items inside of a Crane Game
|
||||||
|
-- Default = true
|
||||||
|
["DisplayCraneInfo"] = true,
|
||||||
|
|
||||||
---------Bag of Crafting-----------
|
---------Bag of Crafting-----------
|
||||||
-- REPENTANCE ONLY!!!
|
-- REPENTANCE ONLY!!!
|
||||||
|
|
||||||
@@ -355,6 +362,7 @@ EID.DefaultConfig = {
|
|||||||
["DisplaySacrificeInfo"] = true,
|
["DisplaySacrificeInfo"] = true,
|
||||||
["DisplayDiceInfo"] = true,
|
["DisplayDiceInfo"] = true,
|
||||||
["DisplayBagOfCrafting"] = "always",
|
["DisplayBagOfCrafting"] = "always",
|
||||||
|
["DisplayCraneInfo"] = true,
|
||||||
["BagOfCraftingResults"] = 7,
|
["BagOfCraftingResults"] = 7,
|
||||||
["BagOfCraftingCombinationMax"] = 12,
|
["BagOfCraftingCombinationMax"] = 12,
|
||||||
["BagOfCraftingRandomResults"] = 400,
|
["BagOfCraftingRandomResults"] = 400,
|
||||||
|
|||||||
@@ -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()
|
||||||
@@ -137,6 +138,7 @@ function EID:onNewFloor()
|
|||||||
if REPENTANCE then
|
if REPENTANCE then
|
||||||
EID.bagOfCraftingRoomQueries = {}
|
EID.bagOfCraftingRoomQueries = {}
|
||||||
EID.bagOfCraftingFloorQuery = {}
|
EID.bagOfCraftingFloorQuery = {}
|
||||||
|
EID.CraneItemType = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.onNewFloor)
|
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.onNewFloor)
|
||||||
@@ -213,6 +215,22 @@ function EID:IsAltChoice(pickup)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
-------------------------Handle Crane Game-----------------------------
|
||||||
|
|
||||||
|
function EID:postGetCollectible(selectedCollectible, itemPoolType, decrease, seed)
|
||||||
|
if itemPoolType == ItemPoolType.POOL_CRANE_GAME then
|
||||||
|
for _, crane in ipairs(Isaac.FindByType(6, 16, -1, true, false)) do
|
||||||
|
if not crane:GetSprite():IsPlaying("Broken") then
|
||||||
|
if not EID.CraneItemType[tostring(crane.InitSeed)] then
|
||||||
|
EID.CraneItemType[tostring(crane.InitSeed)] = selectedCollectible
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EID:AddCallback(ModCallbacks.MC_POST_GET_COLLECTIBLE, EID.postGetCollectible)
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
---------------------------Printing Functions------------------------------
|
---------------------------Printing Functions------------------------------
|
||||||
|
|
||||||
@@ -542,6 +560,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
|
||||||
@@ -556,6 +575,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
|
||||||
@@ -761,6 +788,24 @@ local function onRender(t)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if closest.Type == 6 and closest.Variant == 16 then
|
||||||
|
--Handle Crane Game
|
||||||
|
|
||||||
|
if EID.CraneItemType[tostring(closest.InitSeed)] 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 collectibleID = EID.CraneItemType[tostring(closest.InitSeed)]
|
||||||
|
local descriptionObj = EID:getDescriptionObj(5, 100, collectibleID)
|
||||||
|
|
||||||
|
EID:printDescription(descriptionObj)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if closest.Variant == PickupVariant.PICKUP_TRINKET then
|
if closest.Variant == PickupVariant.PICKUP_TRINKET then
|
||||||
--Handle Trinkets
|
--Handle Trinkets
|
||||||
local trinketID = closest.SubType
|
local trinketID = closest.SubType
|
||||||
@@ -851,8 +896,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
|
||||||
@@ -896,6 +943,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()
|
||||||
|
|||||||
@@ -619,9 +619,33 @@ if MCMLoaded then
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local diceSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
|
local diceSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
|
||||||
if REPENTANCE then
|
if REPENTANCE then
|
||||||
|
|
||||||
|
--------Crane Game---------
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"Display",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenu.OptionType.BOOLEAN,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return EID.Config["DisplayCraneInfo"]
|
||||||
|
end,
|
||||||
|
Display = function()
|
||||||
|
local onOff = "False"
|
||||||
|
if EID.Config["DisplayCraneInfo"] then
|
||||||
|
onOff = "True"
|
||||||
|
end
|
||||||
|
return "Crane Game Infos: " .. onOff
|
||||||
|
end,
|
||||||
|
OnChange = function(currentBool)
|
||||||
|
EID.Config["DisplayCraneInfo"] = currentBool
|
||||||
|
end
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
MCM.AddSpace("EID", "Display")
|
MCM.AddSpace("EID", "Display")
|
||||||
|
|
||||||
-- Spindown Dice results
|
-- Spindown Dice results
|
||||||
|
|||||||
Reference in new issue
Block a user