Merge pull request #507 from Buurazu/master
Fix bugs with the new stuff
This commit is contained in:
5 files changed
+70
-46
No files matched your search
@@ -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
|
||||
|
||||
+11
-5
@@ -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
|
||||
end
|
||||
+29
-18
@@ -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
|
||||
|
||||
+24
-18
@@ -466,26 +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.player:GetPlayerType()
|
||||
local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory
|
||||
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
|
||||
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
|
||||
@@ -530,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
|
||||
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user