From fe4d31eeccdfd3fdea27754e47388ed664997cee Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 5 Sep 2022 04:35:55 -0400 Subject: [PATCH 1/7] fix missing space --- descriptions/rep/en_us.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index 11de0cf2..44ba65d6 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -199,7 +199,7 @@ local repCollectibles={ [472] = {"472", "King Baby", "Other familiars follow it and automatically shoot at enemies#Stops moving when Isaac shoots#Teleports back to Isaac when he stops shooting"}, -- King Baby [474] = {"474", "Broken Glass Cannon", "Using the item turns it back into Glass Cannon"}, -- Broken Glass Cannon [476] = {"476", "D1", "Duplicates a random pickup in the room#Duplicated pickups may not be identical to the original"}, -- D1 - [477] = {"477", "Void", "Consumes all pedestal items in the room#Active items: Their effects activate with every future use of Void#↑ Passive items:Grant two random stats up"}, + [477] = {"477", "Void", "Consumes all pedestal items in the room#Active items: Their effects activate with every future use of Void#↑ Passive items: Grant two random stats up"}, [487] = {"487", "Potato Peeler", "Removes one Red Heart Container and grants: #↑ {{Damage}} +0.2 Damage up#{{Collectible73}} A Cube of Meat#↑ {{Range}} +1.5 Range and leaves a trail of blood creep for the current room"}, [489] = {"489", "D Infinity", "Can be made to act as any die item (except {{Collectible723}} Spindown Dice) with {{ButtonRT}}#Charge time varies based on the last die used and updates with every use"}, -- D Infinity [491] = {"491", "Acid Baby", "{{Pill}} Drops a random pill every 7 rooms#Using a pill poisons all enemies in the room"}, -- Acid Baby From b290b28437aada11fbbab4af7d69198c7ae21102 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 5 Sep 2022 04:37:22 -0400 Subject: [PATCH 2/7] add altPickupHistory, fix WasPillUsed in co-op --- eid_api.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index 65234b16..fc33dc87 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1654,7 +1654,7 @@ function EID:evaluateQueuedItems() --initialize the interactions table for all players if it isn't already for i = 0, game:GetNumPlayers() - 1 do if not EID.PlayerItemInteractions[i] then - EID.PlayerItemInteractions[i] = {LastTouch = 0, actives = {}, pills = {}, altActives = {}, altPills = {}, pickupHistory = {}} + EID.PlayerItemInteractions[i] = {LastTouch = 0, actives = {}, pills = {}, altActives = {}, altPills = {}, pickupHistory = {}, altPickupHistory = {}} end EID.RecentlyTouchedItems[i] = EID.RecentlyTouchedItems[i] or {} end @@ -1749,8 +1749,13 @@ function EID:AddPickupToHistory(pickupType, effectID, player, useFlags) local playerID = EID:getPlayerID(player) if not EID.PlayerItemInteractions[playerID].pickupHistory then EID.PlayerItemInteractions[playerID].pickupHistory = {} + EID.PlayerItemInteractions[playerID].altPickupHistory = {} end local historyTable = EID.PlayerItemInteractions[playerID].pickupHistory + -- Dead Tainted Lazarus exception + if player:GetPlayerType() == 38 then + historyTable = EID.PlayerItemInteractions[playerID].altPickupHistory or historyTable + end -- pickupType = ["pill","card"], playerTypeID, effectID, hadEchoChamberWhenUsed table.insert(historyTable, 1, {pickupType, player:GetPlayerType(), effectID, REPENTANCE and player:HasCollectible(700)}) @@ -1782,11 +1787,12 @@ function EID:IsGridEntity(entity) end -- returns true if the given pilleffect id was used at least once by the current player -function EID:WasPillUsed(pillEffectID) - local playerID = EID:getPlayerID(EID.player) +function EID:WasPillUsed(pillEffectID, player) + local playerID = EID:getPlayerID(player) local pillsTable = EID.PlayerItemInteractions[playerID].pills - if EID.player:GetPlayerType() == 38 then + -- Dead Tainted Lazarus exception + if player:GetPlayerType() == 38 then pillsTable = EID.PlayerItemInteractions[playerID].altPills or pillsTable end return pillsTable[tostring(pillEffectID)] ~= nil -end \ No newline at end of file +end From a9679e3d1a721368bceca433ec345306cc6228ac Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 5 Sep 2022 04:38:15 -0400 Subject: [PATCH 3/7] Fix Void and Echo Chamber issues --- eid_holdmapdesc.lua | 47 ++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/eid_holdmapdesc.lua b/eid_holdmapdesc.lua index 6d4bcb4a..072e7114 100644 --- a/eid_holdmapdesc.lua +++ b/eid_holdmapdesc.lua @@ -69,12 +69,16 @@ function EID:getHoldMapDescription(player, checkingTwin) -- Echo Chamber Description if REPENTANCE and player:HasCollectible(700) then - local playerID = player:GetPlayerType() + local playerID = EID:getPlayerID(player) local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory + -- Dead Tainted Lazarus exception + if player:GetPlayerType() == 38 then + pickupHistory = EID.PlayerItemInteractions[playerID].altPickupHistory or pickupHistory + end if pickupHistory then local pickupNames = "" for i = 1, math.min(3, #pickupHistory) do - if pickupHistory[i][2] == playerID and pickupHistory[i][4] then -- Echo chamber is owned + if pickupHistory[i][4] then -- Echo chamber was owned before this card/pill was used if pickupHistory[i][1] == "pill" then local name = EID:getPillName(pickupHistory[i][3], false) pickupNames = pickupNames .. "{{Pill}} " .. name .. "#" @@ -118,7 +122,7 @@ function EID:getHoldMapDescription(player, checkingTwin) elseif heldActive == 44 and EID.Config["ItemReminderShowRNGCheats"] then blacklist["5.100.44"] = true -- The result preview changes as soon as we activate Teleport, which looks awkward, so try to not display the result while mid-teleport. Doesn't work perfectly and only in Rep - if not REPENTANCE or currentPlayer:GetSprite():GetAnimation() ~= "TeleportUp" then + if not REPENTANCE or player:GetSprite():GetAnimation() ~= "TeleportUp" then append("{{Collectible44}}", EID:getObjectName(5,100,44) .. EID:getDescriptionEntry("HoldMapHeader"), EID:Teleport1Prediction(getSeed(44))) end -- Teleport 2.0 location @@ -128,30 +132,37 @@ function EID:getHoldMapDescription(player, checkingTwin) -- D Infinity elseif heldActive == 489 then blacklist["5.100.489"] = true - addObjectDesc(5, 100, EID:CurrentDInfinity(getSeed(489), currentPlayer), "{{Collectible489}}") + addObjectDesc(5, 100, EID:CurrentDInfinity(getSeed(489), player), "{{Collectible489}}") -- D1 elseif heldActive == 476 and EID.Config["ItemReminderShowRNGCheats"] then blacklist["5.100.476"] = true append("{{Collectible476}}", EID:getObjectName(5,100,476) .. EID:getDescriptionEntry("HoldMapHeader"), EID:D1Prediction(getSeed(476))) -- Void elseif heldActive == 477 then - blacklist["5.100.477"] = true local absorbedActives = "" + local printNormalDesc = true local absorbedItems = EID.absorbedItems[tostring(EID:getPlayerID(player))] - local countItems = 0 - for _, _ in pairs(absorbedItems) do - countItems = countItems + 1 - end - if countItems > 5 then - absorbedActives = "{{Blank}} " - end - for k, _ in pairs(absorbedItems) do - absorbedActives = absorbedActives .. "{{Collectible" .. k .. "}} " - if countItems <= 5 then - absorbedActives = absorbedActives .. " " .. EID:getObjectName(5, 100, tonumber(k)) .. "#" + if absorbedItems then + local countItems = 0 + for _, _ in pairs(absorbedItems) do + countItems = countItems + 1 + end + if countItems > 0 then + if countItems > 5 then + absorbedActives = "{{Blank}} " + end + for k, _ in pairs(absorbedItems) do + absorbedActives = absorbedActives .. "{{Collectible" .. k .. "}} " + if countItems <= 5 then + absorbedActives = absorbedActives .. EID:getObjectName(5, 100, tonumber(k)) .. "#" + end + end + blacklist["5.100.477"] = true + append("{{Collectible477}}", EID:getObjectName(5, 100, 477) .. EID:getDescriptionEntry("HoldMapHeader"), absorbedActives) + printNormalDesc = false end end - append("{{Collectible477}}", EID:getObjectName(5, 100, 477), absorbedActives) + if printNormalDesc then addObjectDesc(5, 100, heldActive) end else addObjectDesc(5, 100, heldActive) end @@ -211,7 +222,7 @@ function EID:getHoldMapDescription(player, checkingTwin) -- Don't display Mysterious Paper's 1-frame temporary trinket granting local hasPaper = player:HasTrinket(21) for i = 1, TrinketType.NUM_TRINKETS - 1 do - local tempTrinketFound = EID.player:HasTrinket(i, true) ~= EID.player:HasTrinket(i, false) + local tempTrinketFound = player:HasTrinket(i, true) ~= player:HasTrinket(i, false) if tempTrinketFound and (not mysteriousPaperBlacklist[i] or not hasPaper) then addObjectDesc(5, 350, i, "{{Trinket75}}") end From ad0ad90b9f532f8a48dff27fb5efd901530d9fe1 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 5 Sep 2022 04:45:03 -0400 Subject: [PATCH 4/7] fix Vurp --- eid_modifiers.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 269db8fc..86fe6c37 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -467,15 +467,19 @@ if REPENTANCE then local adjustedID = EID:getAdjustedSubtype(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType) if adjustedID - 1 ~= PillEffect.PILLEFFECT_VURP then return descObj end - local playerID = EID.player:GetPlayerType() + local playerID = EID:getPlayerID(EID.player) local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory + -- Dead Tainted Lazarus exception + if EID.player:GetPlayerType() == 38 then + pickupHistory = EID.PlayerItemInteractions[playerID].altPickupHistory or pickupHistory + end if pickupHistory then local lastUsedPill = nil local i = 1 while (i <= #pickupHistory) do local entry = pickupHistory[i] - if entry[1] == "pill" and entry[2] == playerID and entry[3] ~= PillEffect.PILLEFFECT_VURP + 1 then + if entry[1] == "pill" then lastUsedPill = entry[3] break end From 635df219cdb8059fb11699bd86bd314245649e87 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 5 Sep 2022 04:46:32 -0400 Subject: [PATCH 5/7] add altPickupHistory, fix gold pills tracking --- main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.lua b/main.lua index eca49426..cfc15f75 100644 --- a/main.lua +++ b/main.lua @@ -1468,7 +1468,7 @@ local function onRender(t) local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"] if REPENTANCE and pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end local pillEffectID = EID:getAdjustedSubtype(closest.Type, closest.Variant, pillColor) - local wasUsed = EID:WasPillUsed(pillEffectID) + local wasUsed = EID:WasPillUsed(pillEffectID, player) if (identified or wasUsed or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest) @@ -1522,7 +1522,7 @@ local function AddActiveItemProgress(player, isD4) EID.ForceRefreshCache = true local playerID = EID:getPlayerID(player) if not EID.PlayerItemInteractions[playerID] then - EID.PlayerItemInteractions[playerID] = {LastTouch = 0, actives = {}, pills = {}, altActives = {}, altPills = {}, pickupHistory = {}} + EID.PlayerItemInteractions[playerID] = {LastTouch = 0, actives = {}, pills = {}, altActives = {}, altPills = {}, pickupHistory = {}, altPickupHistory = {}} end -- Dead Tainted Lazarus exceptions local activesTable = EID.PlayerItemInteractions[playerID].actives @@ -1577,6 +1577,7 @@ if REPENTANCE then end function EID:OnUsePill(pillEffectID, player, useFlags) + if (REPENTANCE and player:GetPill(0) % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD) then return end player = player or EID.player --AB+ doesn't receive player in callback arguments! local playerID = EID:getPlayerID(player) -- Dead Tainted Lazarus exceptions @@ -1590,7 +1591,7 @@ function EID:OnUsePill(pillEffectID, player, useFlags) pillsTable[effectID] = 0 end pillsTable[effectID] = pillsTable[effectID] + 1 - + EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags) end EID:AddCallback(ModCallbacks.MC_USE_PILL, EID.OnUsePill) From 96f3dec56140bc5dc522817c2b41a2db76f37c66 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 5 Sep 2022 05:08:41 -0400 Subject: [PATCH 6/7] Vurp info for all players! --- eid_modifiers.lua | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 86fe6c37..254b3d80 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -466,30 +466,32 @@ if REPENTANCE then local function VurpCallback(descObj) local adjustedID = EID:getAdjustedSubtype(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType) if adjustedID - 1 ~= PillEffect.PILLEFFECT_VURP then return descObj end - - local playerID = EID:getPlayerID(EID.player) - local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory - -- Dead Tainted Lazarus exception - if EID.player:GetPlayerType() == 38 then - pickupHistory = EID.PlayerItemInteractions[playerID].altPickupHistory or pickupHistory - end - if pickupHistory then - - local lastUsedPill = nil - local i = 1 - while (i <= #pickupHistory) do - local entry = pickupHistory[i] - if entry[1] == "pill" then - lastUsedPill = entry[3] - break - end - i = i + 1 + + for i = 1,#EID.coopAllPlayers do + local player = EID.coopAllPlayers[i] + local playerID = EID:getPlayerID(player) + local playerType = player:GetPlayerType() + local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory + -- Dead Tainted Lazarus exception + if playerType == 38 then + pickupHistory = EID.PlayerItemInteractions[playerID].altPickupHistory or pickupHistory end - - if lastUsedPill then + if pickupHistory then + local lastUsedPill = PillEffect.PILLEFFECT_VURP + 1 + local i = 1 + while (i <= #pickupHistory) do + local entry = pickupHistory[i] + if entry[1] == "pill" then + lastUsedPill = entry[3] + break + end + i = i + 1 + end local tableName = EID:getTableName(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType) local name = EID:getPillName(lastUsedPill, tableName == "horsepills") - EID:appendToDescription(descObj, "#{{Pill}} {{ColorSilver}}" .. name) + if #EID.coopAllPlayers == 1 then EID:appendToDescription(descObj, "#{{Pill}}") + else EID:appendToDescription(descObj, "#" .. (EID:getIcon("Player"..playerType) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerType.."}}" or ("P" .. i .. ":"))) end + EID:appendToDescription(descObj, " {{ColorSilver}}" .. name) end end return descObj @@ -534,7 +536,7 @@ if REPENTANCE then if not printedDescs[pillObj.Name] then -- new pill effect to print printedDescs[pillObj.Name] = true - EID:appendToDescription(descObj, "#" .. (EID:getIcon("Player"..playerID) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerID.."}}" or "{{CustomTransformation}}").." {{ColorObjName}}"..pillObj.Name .."{{CR}}#"..pillObj.Description) + EID:appendToDescription(descObj, "#" .. (EID:getIcon("Player"..playerID) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerID.."}}" or ("P" .. i .. ":")).." {{ColorObjName}}"..pillObj.Name .."{{CR}}#"..pillObj.Description) end end EID.pillPlayer = nil From f285532e247e7036bbbe14404ab7b3c733f77706 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 5 Sep 2022 05:13:30 -0400 Subject: [PATCH 7/7] Fix Flip checking only EID.player --- main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.lua b/main.lua index cfc15f75..4bb9a2a9 100644 --- a/main.lua +++ b/main.lua @@ -826,7 +826,7 @@ function EID:renderIndicator(entity, playerNum) end -- Move highlights a bit to fit onto the alt Item layout of Flip / Tainted Laz if REPENTANCE and not EID:IsGridEntity(entity) then - if entity.Variant == 100 and EID.player:HasCollectible(CollectibleType.COLLECTIBLE_FLIP) and EID:getEntityData(entity, "EID_FlipItemID") then + if entity.Variant == 100 and EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_FLIP) and EID:getEntityData(entity, "EID_FlipItemID") then entityPos = entityPos + Vector(2.5,2.5) elseif entity.Type == 6 and entity.Variant == 16 then entityPos = entityPos + Vector(0,-5)