This commit is contained in:
Buurazu authored and GitHub committed 2022-09-30 02:16:41 -04:00
1 parent ca9fdb3e35
commit 0cb84ba7f6
1 file changed
+14 -16
+14 -16
View File
@@ -37,7 +37,6 @@ EID.CollectedItems = {}
EID.IgnoredEntities = {} EID.IgnoredEntities = {}
EID.CurrentRoomGridEntities = {} EID.CurrentRoomGridEntities = {}
EID.UnidentifyablePillEffects = {} -- List of pilleffects that are always unidentifyable EID.UnidentifyablePillEffects = {} -- List of pilleffects that are always unidentifyable
EID.UsedPillColors = {} -- Colors of pills that have been eaten during this game
local pathsChecked = {} local pathsChecked = {}
local altPathItemChecked = {} local altPathItemChecked = {}
local alwaysUseLocalMode = false -- set to true after drawing a non-local mode description this frame local alwaysUseLocalMode = false -- set to true after drawing a non-local mode description this frame
@@ -1475,7 +1474,7 @@ local function onRender(t)
local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"] 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 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 pillEffectID = EID:getAdjustedSubtype(closest.Type, closest.Variant, pillColor)
local wasUsed = EID:WasPillUsed(pillColor) local wasUsed = EID:WasPillUsed(pillEffectID, player)
if (identified or wasUsed or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then if (identified or wasUsed or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then
local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest) local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest)
@@ -1582,17 +1581,22 @@ if REPENTANCE then
end end
function EID:OnUsePill(pillEffectID, player, useFlags) 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! player = player or EID.player --AB+ doesn't receive player in callback arguments!
-- get the pill color by checking the player's pocket (not accurate for Temperance? and such, but useFlags will help us ignore those) local playerID = EID:getPlayerID(player)
local pillColor = player:GetPill(0) -- Dead Tainted Lazarus exceptions
if pillColor == 0 then return end -- ignore if no pill found in pocket local pillsTable = EID.PlayerItemInteractions[playerID].pills
EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags, pillColor) -- Echo Chamber tracking
-- for tracking used pills, ignore gold pills and noannouncer flag pills if player:GetPlayerType() == 38 then
-- (not using a bitmask, because Placebo is mimic+noannouncer, and we want to count those) pillsTable = EID.PlayerItemInteractions[playerID].altPills or pillsTable
if REPENTANCE and (pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD or useFlags == UseFlag.USE_NOANNOUNCER) then return end end
EID.UsedPillColors[tostring(pillColor)] = true local effectID = tostring(pillEffectID+1)
if not pillsTable[effectID] then
pillsTable[effectID] = 0
end
pillsTable[effectID] = pillsTable[effectID] + 1
EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags)
end end
EID:AddCallback(ModCallbacks.MC_USE_PILL, EID.OnUsePill) EID:AddCallback(ModCallbacks.MC_USE_PILL, EID.OnUsePill)
@@ -1613,7 +1617,6 @@ if EID.MCMLoaded or REPENTANCE then
["AbsorbedItems"] = true, ["AbsorbedItems"] = true,
["CollectedItems"] = true, ["CollectedItems"] = true,
["PlayerItemInteractions"] = true, ["PlayerItemInteractions"] = true,
["UsedPillColors"] = true,
} }
-------------------------------- --------------------------------
--------Handle Savadata--------- --------Handle Savadata---------
@@ -1645,10 +1648,6 @@ if EID.MCMLoaded or REPENTANCE then
-- check for the players' starting active items -- check for the players' starting active items
CheckAllActiveItemProgress() CheckAllActiveItemProgress()
end end
EID.UsedPillColors = {}
if isSave then
EID.UsedPillColors = savedEIDConfig["UsedPillColors"] or {}
end
if REPENTANCE then if REPENTANCE then
EID.BoC.BagItems = {} EID.BoC.BagItems = {}
@@ -1736,7 +1735,6 @@ if EID.MCMLoaded or REPENTANCE then
end end
EID.Config["CollectedItems"] = EID.CollectedItems EID.Config["CollectedItems"] = EID.CollectedItems
EID.Config["PlayerItemInteractions"] = EID.PlayerItemInteractions or {} EID.Config["PlayerItemInteractions"] = EID.PlayerItemInteractions or {}
EID.Config["UsedPillColors"] = EID.UsedPillColors
EID.SaveData(EID, json.encode(EID.Config)) EID.SaveData(EID, json.encode(EID.Config))
EID:hidePermanentText() EID:hidePermanentText()