Revert "When using Flip, the Flip-item is now updated correctly"

This reverts commit 7ae9823614.
This commit is contained in:
Wofsauge committed 2022-01-16 01:20:10 +01:00
1 parent 7ae9823614
commit 0336a8fce9
2 files changed
+4 -20

No files matched your search

+3 -3
View File
@@ -409,14 +409,14 @@ local game = Game()
local function FlipCallback(descObj)
local flipItemID = EID:getEntityData(descObj.Entity, "EID_FlipItemID")
if Input.IsActionPressed(ButtonAction.ACTION_MAP, EID.player.ControllerIndex) then
local descEntry = EID:getDescriptionObj(5, 100, flipItemID[2])
local descEntry = EID:getDescriptionObj(5, 100, flipItemID)
return descEntry
end
local infoText = EID:getDescriptionEntry("FlipItemToggleInfo")
if flipItemID ~= nil or infoText ~= nil then
local itemName = EID:getObjectName(5, 100, flipItemID[2])
local appendText = "#{{Collectible711}} -> {{Collectible"..flipItemID[2].."}} "..itemName
local itemName = EID:getObjectName(5, 100, flipItemID)
local appendText = "#{{Collectible711}} -> {{Collectible"..flipItemID.."}} "..itemName
appendText = appendText .. "#{{Blank}} "..infoText
EID:appendToDescription(descObj, appendText)
end
+1 -17
View File
@@ -249,7 +249,7 @@ if REPENTANCE then
local curFrame = Isaac.GetFrameCount()
if not decrease and curFrame == lastGetItemResult[2] and lastGetItemResult[1] ~= nil then
local curRoomIndex = game:GetLevel():GetCurrentRoomIndex()
EID.flipItemPositions[curRoomIndex][lastGetItemResult[3]] = {lastGetItemResult[1], selectedCollectible}
EID.flipItemPositions[curRoomIndex][lastGetItemResult[3]] = selectedCollectible
end
-- Handle crane game
@@ -288,22 +288,6 @@ if REPENTANCE then
end
end
EID:AddCallback(ModCallbacks.MC_POST_PICKUP_INIT, EID.postPickupInit)
-- Handle Flip Item usage
function EID:onFlipUse(_)
local curRoomIndex = game:GetLevel():GetCurrentRoomIndex()
if EID.flipItemPositions[curRoomIndex] ~= nil then
for _,collectible in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
local gridPos = game:GetRoom():GetGridIndex(collectible.Position)
local entry = EID.flipItemPositions[curRoomIndex][gridPos]
if entry then
EID.flipItemPositions[curRoomIndex][gridPos] = {entry[2], entry[1]}
collectible:GetData()["EID_FlipItemID"] = {entry[2], entry[1]}
end
end
end
end
EID:AddCallback(ModCallbacks.MC_USE_ITEM, EID.onFlipUse, CollectibleType.COLLECTIBLE_FLIP)
end
---------------------------------------------------------------------------