Compare commits

...
12 Commits
7 changed files with 174 additions and 56 deletions

No files matched your search

+1
View File
@@ -1299,6 +1299,7 @@ EID.descriptions[languageCode].spindownError = "Item disappears"
EID.descriptions[languageCode].BlankCardEffect = "Blank Card effect:" EID.descriptions[languageCode].BlankCardEffect = "Blank Card effect:"
EID.descriptions[languageCode].FlipItemToggleInfo = "(Hold {{CONFIG_BoC_Toggle}} to show description)" EID.descriptions[languageCode].FlipItemToggleInfo = "(Hold {{CONFIG_BoC_Toggle}} to show description)"
EID.descriptions[languageCode].GlitchedCrownToggleInfo = "(Press {{CONFIG_BoC_Toggle}} to show next description: {1})"
EID.descriptions[languageCode].GlowingHourglassTransformed = "Will change back to Glowing Hourglass next floor" EID.descriptions[languageCode].GlowingHourglassTransformed = "Will change back to Glowing Hourglass next floor"
+45 -8
View File
@@ -60,6 +60,13 @@ function EID:addTrinket(id, description, itemName, language)
EID.descriptions[language].custom["5.350." .. id] = {id, itemName, description, EID._currentMod} EID.descriptions[language].custom["5.350." .. id] = {id, itemName, description, EID._currentMod}
end end
-- Adds character specific information, which can be viewed in the Item Reminder
function EID:addCharacterInfo(characterId, description, playerName, language)
playerName = playerName or "Modded Character"
language = language or "en_us"
EID.descriptions[language].CharacterInfo[characterId] = {playerName, description}
end
-- Adds information about appending text and multiplying numbers in a modded trinket's Golden/Mom's Box description. All three variables are optional, set to ""/0 or nil to not include them -- Adds information about appending text and multiplying numbers in a modded trinket's Golden/Mom's Box description. All three variables are optional, set to ""/0 or nil to not include them
-- appendText: Text to be appended onto the description. Can be one string, or a table of two strings; one for doubling and one for tripling -- appendText: Text to be appended onto the description. Can be one string, or a table of two strings; one for doubling and one for tripling
-- numbersToMultiply: The number inside the text that should be multiplied. can be one number, or a table of numbers -- numbersToMultiply: The number inside the text that should be multiplied. can be one number, or a table of numbers
@@ -693,7 +700,7 @@ function EID:hasDescription(entity)
if EID.Config["EnableEntityDescriptions"] and EID:getTableName(entity.Type, entity.Variant, entity.SubType) == "custom" then if EID.Config["EnableEntityDescriptions"] and EID:getTableName(entity.Type, entity.Variant, entity.SubType) == "custom" then
isAllowed = __eidEntityDescriptions[entityString] ~= nil isAllowed = __eidEntityDescriptions[entityString] ~= nil
isAllowed = isAllowed or EID:getDescriptionData(entity.Type, entity.Variant, entity.SubType) ~= nil isAllowed = isAllowed or EID:getDescriptionData(entity.Type, entity.Variant, entity.SubType) ~= nil
isAllowed = isAllowed or entity:GetData() and type(entity:GetData()["EID_Description"]) ~= type(nil) isAllowed = isAllowed or EID:getEntityData(entity, "EID_Description") ~= nil
end end
if entity.Type == EntityType.ENTITY_PICKUP then if entity.Type == EntityType.ENTITY_PICKUP then
if entity.SubType == 0 and EID:getDescriptionData(entity.Type, entity.Variant, entity.SubType) ~= nil then if entity.SubType == 0 and EID:getDescriptionData(entity.Type, entity.Variant, entity.SubType) ~= nil then
@@ -1626,6 +1633,12 @@ function EID:getEntityData(entity, str)
return nil return nil
end end
function EID:setEntityData(entity, str, value)
if EID:EntitySanityCheck(entity) and not EID:IsGridEntity(entity) and entity:GetData() ~= nil then
entity:GetData()[str] = value
end
end
-- Function to fix font compatibility. Resets config font to a value compatible with your current language -- Function to fix font compatibility. Resets config font to a value compatible with your current language
function EID:fixDefinedFont(forceRefresh) function EID:fixDefinedFont(forceRefresh)
local curLang = EID:getLanguage() local curLang = EID:getLanguage()
@@ -1749,14 +1762,16 @@ function EID:getPlayerID(entityPlayer, lazarusAdjust)
if GetPtrHash(player) == GetPtrHash(entityPlayer) then if GetPtrHash(player) == GetPtrHash(entityPlayer) then
-- Dead Tainted Lazarus exceptions -- Dead Tainted Lazarus exceptions
if lazarusAdjust and EID.isRepentance then if lazarusAdjust and EID.isRepentance then
-- Check for Birthright to make the ghostly form use the same base ID as the main form if player:GetPlayerType() == 38 then
if player:GetMainTwin() then -- Check for Birthright to make the ghostly form use the same base ID as the main form
if GetPtrHash(player:GetMainTwin()) ~= GetPtrHash(player) then if player:GetMainTwin() then
i = EID:getPlayerID(player:GetMainTwin()) if GetPtrHash(player:GetMainTwin()) ~= GetPtrHash(player) then
i = EID:getPlayerID(player:GetMainTwin())
end
end end
-- Increase the ID by 666 if Dead Tainted Lazarus
i = i + 666
end end
-- Increase the ID by 666 if Dead Tainted Lazarus
if player:GetPlayerType() == 38 then i = i + 666 end
end end
return i return i
end end
@@ -1991,6 +2006,7 @@ function EID:evaluateQueuedItems()
-- A new active item was touched; initiate its touch count to 0 for all players -- A new active item was touched; initiate its touch count to 0 for all players
-- (Fixes co-op bugs, compared to only initiating it for the toucher) -- (Fixes co-op bugs, compared to only initiating it for the toucher)
for j = 0, game:GetNumPlayers() - 1 do for j = 0, game:GetNumPlayers() - 1 do
EID:InitItemInteractionIfAbsent(j)
EID.PlayerItemInteractions[j].actives[itemIDStr] = EID.PlayerItemInteractions[j].actives[itemIDStr] or 0 EID.PlayerItemInteractions[j].actives[itemIDStr] = EID.PlayerItemInteractions[j].actives[itemIDStr] or 0
EID.PlayerItemInteractions[j+666].actives[itemIDStr] = EID.PlayerItemInteractions[j+666].actives[itemIDStr] or 0 EID.PlayerItemInteractions[j+666].actives[itemIDStr] = EID.PlayerItemInteractions[j+666].actives[itemIDStr] or 0
end end
@@ -2020,12 +2036,14 @@ function EID:InitItemInteractionIfAbsent(playerID)
playerID = playerID % 666 -- dead tainted lazarus exception playerID = playerID % 666 -- dead tainted lazarus exception
if not EID.PlayerItemInteractions[playerID] then if not EID.PlayerItemInteractions[playerID] then
EID.PlayerItemInteractions[playerID] = { LastTouch = 0, actives = {}, pickupHistory = {}, rerollItems = {} } EID.PlayerItemInteractions[playerID] = { LastTouch = 0, actives = {}, pickupHistory = {}, rerollItems = {} }
EID.PlayerItemInteractions[playerID+666] = { LastTouch = 0, actives = {}, pickupHistory = {}, rerollItems = {} }
-- in AB+, initiate Halo of Flies as an active item (collectible ID 10 is used for ALL Pretty Flies) -- in AB+, initiate Halo of Flies as an active item (collectible ID 10 is used for ALL Pretty Flies)
if not EID.isRepentance then if not EID.isRepentance then
EID.PlayerItemInteractions[playerID].actives["10"] = 0 EID.PlayerItemInteractions[playerID].actives["10"] = 0
end end
end end
if not EID.PlayerItemInteractions[playerID+666] then
EID.PlayerItemInteractions[playerID+666] = { LastTouch = 0, actives = {}, pickupHistory = {}, rerollItems = {} }
end
EID.RecentlyTouchedItems[playerID] = EID.RecentlyTouchedItems[playerID] or {} EID.RecentlyTouchedItems[playerID] = EID.RecentlyTouchedItems[playerID] or {}
EID.RecentlyTouchedItems[playerID+666] = EID.RecentlyTouchedItems[playerID+666] or {} EID.RecentlyTouchedItems[playerID+666] = EID.RecentlyTouchedItems[playerID+666] or {}
end end
@@ -2307,7 +2325,26 @@ function EID:UpdateAllPlayerLemegetonWisps()
table.sort(wisps, function(a, b) return a.FrameCount < b.FrameCount end) table.sort(wisps, function(a, b) return a.FrameCount < b.FrameCount end)
for i,v in ipairs(wisps) do wisps[i] = v.SubType end for i,v in ipairs(wisps) do wisps[i] = v.SubType end
end end
end
-- This table holds, for each pedestal in the room, a table of item IDs that have been on that pedestal, and timestamps of when they were first and last seen
-- The Glitched Crown callback when describing the pedestal will sort by first timestamp, and delete entries with too old of a last timestamp (like after a reroll)
EID.GlitchedCrownCheck = {}
-- Watch pedestals for being a Glitched Crown style pedestal that flips between items too quickly to display descriptions for
function EID:WatchForGlitchedCrown()
if not EID.collectiblesOwned[689] then return end
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
EID.GlitchedCrownCheck[curRoomIndex] = EID.GlitchedCrownCheck[curRoomIndex] or {}
for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
-- Use InitSeed and Index to prevent any Diplopia weirdness
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index] or {}
-- Initialize the data about this pedestal showing its current item ID, if necessary
-- in order to sort the items displayed, while also trashing items that haven't shown up in a while, keep both "initial frame seen" and "last frame seen"
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType] = EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType] or {EID.GameUpdateCount, EID.GameUpdateCount}
-- update the last frame seen for the pedestal's current collectible ID
EID.GlitchedCrownCheck[curRoomIndex][entity.InitSeed..entity.Index][entity.SubType][2] = EID.GameUpdateCount
end
end end
-- Replaces Variable placeholders in string with a given value -- Replaces Variable placeholders in string with a given value
+1 -8
View File
@@ -37,7 +37,7 @@ if EID.isRepentance then
EID:AddItemConditional({"5.300.96", "5.350.142", "5.350.176", "5.350.182", "5.350.186"}, 247, EID.CheckForBFFS, {locTable = "BFFSSynergies", replaceColor = "BlinkPink", noFallback = false}) -- BFFS! Repentance soulstone/trinkets EID:AddItemConditional({"5.300.96", "5.350.142", "5.350.176", "5.350.182", "5.350.186"}, 247, EID.CheckForBFFS, {locTable = "BFFSSynergies", replaceColor = "BlinkPink", noFallback = false}) -- BFFS! Repentance soulstone/trinkets
EID:AddPlayerConditional(247, 32, "Tainted Lilith", {locTable = "BFFSSynergies", layer = 3}) -- Tainted Lilith's Gello EID:AddPlayerConditional(247, 32, "Tainted Lilith", {locTable = "BFFSSynergies", layer = 3}) -- Tainted Lilith's Gello
EID:AddItemConditional("5.100", 248, EID.CheckForHiveMind, {locTable = "BFFSSynergies", replaceColor = "BlinkBlue", noFallback = false, uniqueID = "BFFS"}) -- Hive Mind EID:AddItemConditional("5.100", 248, EID.CheckForHiveMind, {locTable = "BFFSSynergies", replaceColor = "BlinkBlue", noFallback = false, uniqueID = "BFFS"}) -- Hive Mind
EID:AddSynergyConditional(247, 248, "No Effect (Familiars)", {layer = 5}) -- Already having Hive Mind / BFFS! EID:AddSynergyConditional(247, 248, "No Effect (Familiars)", nil, {layer = 5}) -- Already having Hive Mind / BFFS!
EID:AddConditional(248, EID.CheckFamiliarsForHiveMind, nil, {locTable = "BFFSSynergies", useResult = true, layer = 2}) -- Effect text for Hive Mind pedestal EID:AddConditional(248, EID.CheckFamiliarsForHiveMind, nil, {locTable = "BFFSSynergies", useResult = true, layer = 2}) -- Effect text for Hive Mind pedestal
EID:AddSynergyConditional({584, 685, 702, 728}, "5.350.141", "No Effect From", "No Effect") -- Forgotten Lullaby no effect familiars (wisps, Gello) EID:AddSynergyConditional({584, 685, 702, 728}, "5.350.141", "No Effect From", "No Effect") -- Forgotten Lullaby no effect familiars (wisps, Gello)
@@ -341,17 +341,10 @@ TODOS I'VE DECIDED NOT TODO RIGHT NOW:
Incubus effects; a lot are AB+ only; annoying to test; plus Lilith has to be added for all of them too Incubus effects; a lot are AB+ only; annoying to test; plus Lilith has to be added for all of them too
TODOs unrelated to conditionals: TODOs unrelated to conditionals:
Luck modifier that prints out a percentage for the effect based on your current luck stat
What item is Liberty Cap, Broken Syringe, etc. currently giving?
RNG cheat for Crooked Penny
Implement the standardized colors for characters, items, map names, etc Implement the standardized colors for characters, items, map names, etc
Make Glitched Crown type pedestals work better in EID (pause on one item and press tab to switch to the next item)
Don't show Void stat ups depending on what Void has absorbed (abyss absorbed = no void stat ups etc, reroll item = might become actives) Don't show Void stat ups depending on what Void has absorbed (abyss absorbed = no void stat ups etc, reroll item = might become actives)
REPENTOGON TODOS: REPENTOGON TODOS:
Glyph of balance (test with bethany but repentogon's is probably always right)
Item reminder previews of immaculate/cambion progress (cambion's increases after two familiars; vardata like glowing hourglass?)
Purity's current stat boost
Attack formula simulator? (yeah right) Attack formula simulator? (yeah right)
MAYBE SOME DAYS: MAYBE SOME DAYS:
+20 -8
View File
@@ -18,12 +18,23 @@ EID.ItemReminderPlayerEntity = nil -- for description modifiers to reference
-- Data Tables -- -- Data Tables --
-- Format : Table of { id = "Category Name", entryGenerators = table of functions to generate descriptions, isScrollable = only shows one entry at a time but is scrollable } -- Format : Table of { id = "Category Name",
-- entryGenerators = table of functions to generate descriptions,
-- isScrollable = only shows one entry at a time but is scrollable,
-- hideInOverview = if true, dont show category content in overview. can be function or boolean
-- }
-- Execution order is handles by the order of the table entries. -- Execution order is handles by the order of the table entries.
-- Category name is interpreted as a lookup for the "EID.descriptions.ItemReminder.CategoryNames" table. If no translation is found, use english or the lookup value -- Category name is interpreted as a lookup for the "EID.descriptions.ItemReminder.CategoryNames" table. If no translation is found, use english or the lookup value
EID.ItemReminderCategories = { EID.ItemReminderCategories = {
{ id = "Overview", entryGenerators = { } }, -- special handling for Overview category { id = "Overview", entryGenerators = {} }, -- special handling for Overview category
{ id = "Character", entryGenerators = { function(player) EID:ItemReminderHandleCharacterInfo(player) end, } }, { id = "Character",
entryGenerators = {
function(player) EID:ItemReminderHandleCharacterInfo(player) end
},
hideInOverview = function(_) -- hide character description from overview, if player is not in the starting room
return game:GetLevel():GetStartingRoomIndex() ~= game:GetLevel():GetCurrentRoomIndex()
end
},
{ id = "Special", entryGenerators = { function(player) EID:ItemReminderHandlePoopSpells(player) end, } }, { id = "Special", entryGenerators = { function(player) EID:ItemReminderHandlePoopSpells(player) end, } },
{ id = "Wisps", { id = "Wisps",
isScrollable = true, isScrollable = true,
@@ -33,7 +44,7 @@ EID.ItemReminderCategories = {
return EID:ItemReminderHandleItemScrollbarFeature(EID.WispsPerPlayer[playerNum], 100, false) return EID:ItemReminderHandleItemScrollbarFeature(EID.WispsPerPlayer[playerNum], 100, false)
end end
}, },
{ id = "Actives", entryGenerators = { function(player) EID:ItemReminderHandleActiveItems(player) end, } }, { id = "Actives", entryGenerators = { function(player) EID:ItemReminderHandleActiveItems(player) end, } },
{ id = "Pockets", { id = "Pockets",
entryGenerators = { entryGenerators = {
function(player) EID:ItemReminderHandleDiceBag(player) end, function(player) EID:ItemReminderHandleDiceBag(player) end,
@@ -454,8 +465,8 @@ end
function EID:ItemReminderHandleCharacterInfo(player) function EID:ItemReminderHandleCharacterInfo(player)
local playerType = player:GetPlayerType() local playerType = player:GetPlayerType()
local playerDesc = EID:getDescriptionEntry("CharacterInfo")[playerType] local playerDesc = EID:getDescriptionEntry("CharacterInfo")[playerType]
if playerDesc[2] ~= "" then if playerDesc and playerDesc[2] ~= "" then
EID:ItemReminderAddTempDescriptionEntry("{{Player" .. playerType .. "}}", playerDesc[1], playerDesc[2]) EID:ItemReminderAddTempDescriptionEntry(EID:GetPlayerIcon(playerType), playerDesc[1], playerDesc[2])
end end
end end
@@ -767,8 +778,9 @@ function EID:ItemReminderGetDescription()
EID:ItemReminderAddSpecialDescriptions(player) EID:ItemReminderAddSpecialDescriptions(player)
-- execute all functions defined per category -- execute all functions defined per category
for _, category in ipairs(EID.ItemReminderCategories) do for _, category in ipairs(EID.ItemReminderCategories) do
-- don't display character info in the overview after a few rooms local hideInOverview = type(category.hideInOverview) == "function" and category.hideInOverview(player)
if category.id ~= "Character" or EID.roomCount < 5 then or type(category.hideInOverview) == "boolean" and category.hideInOverview
if not hideInOverview then
numAvailableDescriptionSlots = 1 -- limit to one description per category in overview mode numAvailableDescriptionSlots = 1 -- limit to one description per category in overview mode
for _, func in ipairs(category.entryGenerators) do for _, func in ipairs(category.entryGenerators) do
func(player) func(player)
+83 -9
View File
@@ -5,6 +5,11 @@ EID.TabPreviewID = 0
EID.inModifierPreview = false EID.inModifierPreview = false
-- The "Item Reminder" needs to know if it shouldn't display because we're in a Hold Tab desc -- The "Item Reminder" needs to know if it shouldn't display because we're in a Hold Tab desc
EID.TabDescThisFrame = false EID.TabDescThisFrame = false
-- Some modifiers (e.g. Glitched Crown) want to know if Tab was pressed/released, rather than held
EID.TabHeldThisFrame = false
EID.TabHeldLastFrame = false
function EID:TabPressed() return EID.TabHeldThisFrame and not EID.TabHeldLastFrame end
function EID:TabReleased() return EID.TabHeldLastFrame and not EID.TabHeldThisFrame end
-- List of collectible IDs for us to check if a player owns them; feel free to add to this in mods that add description modifiers! -- List of collectible IDs for us to check if a player owns them; feel free to add to this in mods that add description modifiers!
EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_VOID] = true EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_VOID] = true
@@ -22,6 +27,7 @@ if EID.isRepentance then
EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_FALSE_PHD] = true EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_FALSE_PHD] = true
EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_FLIP] = true EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_FLIP] = true
EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_GLOWING_HOUR_GLASS] = true EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_GLOWING_HOUR_GLASS] = true
EID.collectiblesToCheck[CollectibleType.COLLECTIBLE_GLITCHED_CROWN] = true
end end
EID.collectiblesOwned = {} EID.collectiblesOwned = {}
EID.collectiblesAbsorbed = {} EID.collectiblesAbsorbed = {}
@@ -413,7 +419,8 @@ if EID.isRepentance then
-- Handle Spindown Dice description addition -- Handle Spindown Dice description addition
local function SpindownDiceCallback(descObj) local function SpindownDiceCallback(descObj)
if EID.InsideItemReminder then return descObj end -- don't display in item reminder, or if we've already printed it earlier in the desc
if EID.InsideItemReminder or string.match(descObj.Description, "#{{Collectible723}} :") then return descObj end
-- get the ID of the player that owns the Spindown Dice -- get the ID of the player that owns the Spindown Dice
local playerID = (EID.collectiblesOwned[723] or EID.collectiblesAbsorbed[723]) local playerID = (EID.collectiblesOwned[723] or EID.collectiblesAbsorbed[723])
EID:appendToDescription(descObj, "#{{Collectible723}} :") EID:appendToDescription(descObj, "#{{Collectible723}} :")
@@ -572,11 +579,14 @@ if EID.isRepentance then
local playerID = EID:getPlayerID(player, true) local playerID = EID:getPlayerID(player, true)
local playerType = player:GetPlayerType() local playerType = player:GetPlayerType()
if EID.OldestItemIndex[playerID] and EID.RecentlyTouchedItems[playerID] then if EID.OldestItemIndex[playerID] and EID.RecentlyTouchedItems[playerID] then
local oldestItem = EID.RecentlyTouchedItems[playerID][EID.OldestItemIndex[playerID]] local repetitions = player:HasCollectible(451) and 2 or 1 -- Tarot Cloth removes 2 items
if oldestItem then for indexOffset = 0, repetitions - 1 do
EID:appendToDescription(descObj, "#") local oldestItem = EID.RecentlyTouchedItems[playerID][EID.OldestItemIndex[playerID] + indexOffset]
if #EID.coopAllPlayers > 1 then EID:appendToDescription(descObj, EID:GetPlayerIcon(playerType, "P" .. i .. ":") .. " ") end if oldestItem then
EID:appendToDescription(descObj, "{{NameC" .. oldestItem .. "}}") EID:appendToDescription(descObj, "#")
if #EID.coopAllPlayers > 1 then EID:appendToDescription(descObj, EID:GetPlayerIcon(playerType, "P" .. i .. ":") .. " ") end
EID:appendToDescription(descObj, "{{NameC" .. oldestItem .. "}}")
end
end end
end end
end end
@@ -727,6 +737,66 @@ if EID.isRepentance then
return descObj return descObj
end end
-- Handle Glitched Crown style pedestals
local currentSelection = {} -- keep track of which description we're looking at for a given pedestal
local goingToSpindown = false
local function GlitchedCrownCallback(descObj)
if not descObj.Entity then return descObj end
local entity = descObj.Entity
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
if EID.GlitchedCrownCheck[curRoomIndex] and EID.GlitchedCrownCheck[curRoomIndex][descObj.Entity.InitSeed .. descObj.Entity.Index] then
-- this table has collectible ID keys that define the first frame and most recent frame that that ID has been seen on this pedestal
-- we need to filter out items that haven't been seen in a while (due to a reroll perhaps), then sort by first frame
local pedestalID = descObj.Entity.InitSeed .. descObj.Entity.Index
local items = EID.GlitchedCrownCheck[curRoomIndex][pedestalID]
local sortedItems = {}
for id, frames in pairs(items) do
if EID.GameUpdateCount - frames[2] > 120 then
items[id] = nil
else
table.insert(sortedItems, { id, frames[1] })
end
end
if #sortedItems < 5 then return descObj end
table.sort(sortedItems, function(a, b) return a[2] < b[2] end)
currentSelection[pedestalID] = currentSelection[pedestalID] or 0
-- watch for Tab being pressed to advance our selection by 1
-- when spindown dice is involved, watch for tab being released instead of pressed, it makes more sense
if goingToSpindown and EID:TabReleased() or not goingToSpindown and EID:TabPressed() then
currentSelection[pedestalID] = currentSelection[pedestalID] + 1
if currentSelection[pedestalID] > #sortedItems then currentSelection[pedestalID] = 0 end
end
-- display the overview description
if currentSelection[pedestalID] == 0 then
descObj = EID:getDescriptionObj(5, 100, 689, nil, false)
descObj.Description = ""
for _, item in ipairs(sortedItems) do
descObj.Description = descObj.Description .. "#{{NameC" .. item[1] .. "}}"
end
-- display a specific description
-- don't replace the desc if the pedestal's already showing the correct item
else
descObj = EID:getDescriptionObj(5, 100, sortedItems[currentSelection[pedestalID]][1])
end
local nextIcon = "{{Collectible689}}"
if currentSelection[pedestalID] + 1 <= #sortedItems then nextIcon = "{{Collectible" ..
sortedItems[currentSelection[pedestalID] + 1][1] .. "}}" end
EID:appendToDescription(descObj,
"#{{Blank}} " .. EID:ReplaceVariableStr(EID:getDescriptionEntry("GlitchedCrownToggleInfo"), 1, nextIcon))
-- manually apply Flip; changing the description's item stops future callbacks to avoid infinite loops, but we want Flip still, it works fine
descObj.Entity = entity
if EID.collectiblesOwned[711] and descObj.ObjSubType ~= entity.SubType then descObj = FlipCallback(descObj) end
end
return descObj
end
-------------------------------- --------------------------------
-- Although individual conditions/callbacks work well for mods to be able to add through the API, -- Although individual conditions/callbacks work well for mods to be able to add through the API,
-- As we kept adding callbacks for vanilla items, a lot of code got repeated over and over -- As we kept adding callbacks for vanilla items, a lot of code got repeated over and over
@@ -747,14 +817,18 @@ if EID.isRepentance then
-- Using magic numbers here in case it's slightly faster, and because the callback names give context -- Using magic numbers here in case it's slightly faster, and because the callback names give context
-- Check Birthright first because it overwrites the description instead of appending to it -- Check Birthright first because it overwrites the description instead of appending to it
if descObj.ObjSubType == 619 then table.insert(callbacks, BirthrightCallback) end if descObj.ObjSubType == 619 then table.insert(callbacks, BirthrightCallback) end
-- Glowing Hourglass overwrites the description when used three times if EID.collectiblesOwned[689] then table.insert(callbacks, GlitchedCrownCallback) end
-- Glowing Hourglass overwrites the description when used three times
if REPENTOGON and descObj.ObjSubType == 422 then table.insert(callbacks, GlowingHourglassCallback) end if REPENTOGON and descObj.ObjSubType == 422 then table.insert(callbacks, GlowingHourglassCallback) end
if descObj.ObjSubType == 644 then table.insert(callbacks, ConsolationPrizeCallback) end if descObj.ObjSubType == 644 then table.insert(callbacks, ConsolationPrizeCallback) end
if EID.collectiblesOwned[584] or descObj.ObjSubType == 584 then table.insert(callbacks, BookOfVirtuesCallback) end if EID.collectiblesOwned[584] or descObj.ObjSubType == 584 then table.insert(callbacks, BookOfVirtuesCallback) end
if EID.collectiblesOwned[711] and EID:getEntityData(descObj.Entity, "EID_FlipItemID") then table.insert(callbacks, FlipCallback) end if EID.collectiblesOwned[711] and EID:getEntityData(descObj.Entity, "EID_FlipItemID") then table.insert(callbacks, FlipCallback) end
if EID.Config["SpindownDiceResults"] > 0 and (EID.collectiblesOwned[723] or EID.collectiblesAbsorbed[723]) and descObj.ObjSubType ~= 668 then table.insert(callbacks, SpindownDiceCallback) end if EID.Config["SpindownDiceResults"] > 0 and (EID.collectiblesOwned[723] or EID.collectiblesAbsorbed[723]) and descObj.ObjSubType ~= 668 then
goingToSpindown = true
table.insert(callbacks, SpindownDiceCallback)
else goingToSpindown = false end
-- Card / Rune Callbacks -- Card / Rune Callbacks
elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then
@@ -820,7 +894,7 @@ EID:addDescriptionModifier("EID Afterbirth+", EIDConditionsAB, nil)
-- should this be done differently so that mods can add tab previews? (tab conditions is done last, but would be done before callbacks mods add, maybe tab should be checked in EID:getDescriptionObj -- should this be done differently so that mods can add tab previews? (tab conditions is done last, but would be done before callbacks mods add, maybe tab should be checked in EID:getDescriptionObj
local function TabConditions(_) local function TabConditions(_)
if EID:PlayersActionPressed(EID.Config["BagOfCraftingToggleKey"]) and not EID.inModifierPreview then return true end if EID.TabHeldThisFrame and not EID.inModifierPreview then return true end
EID.TabPreviewID = 0 EID.TabPreviewID = 0
return false return false
end end
+23 -22
View File
@@ -10,8 +10,8 @@ EID.isRepentance = REPENTANCE -- REPENTANCE variable can be altered by any mod,
require("eid_config") require("eid_config")
EID.Config = EID.UserConfig EID.Config = EID.UserConfig
EID.Config.Version = "3.2" -- note: changing this will reset everyone's settings to default! EID.Config.Version = "3.2" -- note: changing this will reset everyone's settings to default!
EID.ModVersion = 4.78 EID.ModVersion = 4.79
EID.ModVersionCommit = "2b3c48d" EID.ModVersionCommit = "2d4b5ca"
EID.DefaultConfig.Version = EID.Config.Version EID.DefaultConfig.Version = EID.Config.Version
EID.isHidden = false EID.isHidden = false
EID.player = nil -- The primary Player Entity of Player 1 EID.player = nil -- The primary Player Entity of Player 1
@@ -51,7 +51,6 @@ EID.holdTabPlayer = 0
EID.holdTabCounter = 0 EID.holdTabCounter = 0
EID.DInfinityState = {} EID.DInfinityState = {}
local forgottenDropTimer = 0 local forgottenDropTimer = 0
EID.roomCount = 0
local preHourglassStatus = {} local preHourglassStatus = {}
EID.GameUpdateCount = 0 EID.GameUpdateCount = 0
@@ -281,9 +280,7 @@ if EID.isRepentance then
if curFrame == lastGetItemResult[2] then if curFrame == lastGetItemResult[2] then
if initialItemNext then lastGetItemResult[1] = selectedCollectible if initialItemNext then lastGetItemResult[1] = selectedCollectible
elseif flipItemNext and lastGetItemResult[1] then elseif flipItemNext and lastGetItemResult[1] then
if EID.flipItemPositions[curRoomIndex] == nil then EID.flipItemPositions[curRoomIndex] = EID.flipItemPositions[curRoomIndex] or {}
EID.flipItemPositions[curRoomIndex] = {}
end
EID.flipItemPositions[curRoomIndex][lastGetItemResult[4]] = {selectedCollectible, lastGetItemResult[3]} EID.flipItemPositions[curRoomIndex][lastGetItemResult[4]] = {selectedCollectible, lastGetItemResult[3]}
end end
end end
@@ -331,7 +328,7 @@ if EID.isRepentance then
-- Give this new entity its Flip Item data if possible -- Give this new entity its Flip Item data if possible
local flipEntry = EID.flipItemPositions[curRoomIndex] and EID.flipItemPositions[curRoomIndex][entity.InitSeed] local flipEntry = EID.flipItemPositions[curRoomIndex] and EID.flipItemPositions[curRoomIndex][entity.InitSeed]
if flipEntry then if flipEntry then
entity:GetData()["EID_FlipItemID"] = flipEntry[1] EID:setEntityData(entity, "EID_FlipItemID", flipEntry[1])
end end
end end
EID:AddCallback(ModCallbacks.MC_POST_PICKUP_INIT, EID.postPickupInitFlip, PickupVariant.PICKUP_COLLECTIBLE) EID:AddCallback(ModCallbacks.MC_POST_PICKUP_INIT, EID.postPickupInitFlip, PickupVariant.PICKUP_COLLECTIBLE)
@@ -339,13 +336,13 @@ if EID.isRepentance then
function EID:CheckPedestalIndex(entity) function EID:CheckPedestalIndex(entity)
-- Only pedestals with indexes that were present at room load can be flip pedestals -- Only pedestals with indexes that were present at room load can be flip pedestals
-- Fixes shop restock machines and Diplopia... mostly. At least while you're in the room. -- Fixes shop restock machines and Diplopia... mostly. At least while you're in the room.
if entity:GetData()["EID_FlipItemID"] and entity.Index > EID.flipMaxIndex then if EID:getEntityData(entity, "EID_FlipItemID") and entity.Index > EID.flipMaxIndex then
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
local gridPos = game:GetRoom():GetGridIndex(entity.Position) local gridPos = game:GetRoom():GetGridIndex(entity.Position)
local flipEntry = EID.flipItemPositions[curRoomIndex] and EID.flipItemPositions[curRoomIndex][entity.InitSeed] local flipEntry = EID.flipItemPositions[curRoomIndex] and EID.flipItemPositions[curRoomIndex][entity.InitSeed]
-- only wipe the data if the grid index matches (so Diplopia pedestals don't) -- only wipe the data if the grid index matches (so Diplopia pedestals don't)
if flipEntry and gridPos == flipEntry[2] then EID.flipItemPositions[curRoomIndex][entity.InitSeed] = nil end if flipEntry and gridPos == flipEntry[2] then EID.flipItemPositions[curRoomIndex][entity.InitSeed] = nil end
entity:GetData()["EID_FlipItemID"] = nil EID:setEntityData(entity, "EID_FlipItemID", nil)
end end
end end
EID:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, EID.CheckPedestalIndex, PickupVariant.PICKUP_COLLECTIBLE) EID:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, EID.CheckPedestalIndex, PickupVariant.PICKUP_COLLECTIBLE)
@@ -758,7 +755,7 @@ if EID.isRepentance then
local flipEntry = EID.flipItemPositions[curRoomIndex][pedestal.InitSeed] local flipEntry = EID.flipItemPositions[curRoomIndex][pedestal.InitSeed]
if flipEntry then if flipEntry then
if pedestal.Index > EID.flipMaxIndex then EID.flipMaxIndex = pedestal.Index end if pedestal.Index > EID.flipMaxIndex then EID.flipMaxIndex = pedestal.Index end
pedestal:GetData()["EID_FlipItemID"] = flipEntry[1] EID:setEntityData(pedestal, "EID_FlipItemID", flipEntry[1])
end end
end end
end end
@@ -779,7 +776,6 @@ end
function EID:onNewRoom() function EID:onNewRoom()
EID:CheckCurrentRoomGridEntities() EID:CheckCurrentRoomGridEntities()
EID.roomCount = EID.roomCount + 1
-- Store values here to be rewound after using Glowing Hour Glass -- Store values here to be rewound after using Glowing Hour Glass
preHourglassStatus = {} preHourglassStatus = {}
preHourglassStatus.absorbedItems = EID:CopyTable(EID.absorbedItems) preHourglassStatus.absorbedItems = EID:CopyTable(EID.absorbedItems)
@@ -867,9 +863,8 @@ function EID:renderIndicator(entity, playerNum)
ArrowOffset = Vector(0, -62) ArrowOffset = Vector(0, -62)
end end
local arrowPos = Isaac.WorldToScreen(entity.Position + ArrowOffset) local arrowPos = Isaac.WorldToScreen(entity.Position + ArrowOffset)
if not EID:IsGridEntity(entity) and entity:GetData() and entity:GetData()["EID_RenderOffset"] then entityPos = entityPos + (EID:getEntityData(entity, "EID_RenderOffset") or Vector(0,0))
entityPos = entityPos + entity:GetData()["EID_RenderOffset"]
end
-- Move highlights a bit to fit onto the alt Item layout of Flip / Tainted Laz -- Move highlights a bit to fit onto the alt Item layout of Flip / Tainted Laz
if EID.isRepentance and not EID:IsGridEntity(entity) then if EID.isRepentance and not EID:IsGridEntity(entity) then
if entity.Variant == 100 and EID:PlayersHaveCollectible(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
@@ -1059,18 +1054,23 @@ function EID:onGameUpdate()
EID:checkPlayersForMissingItems() EID:checkPlayersForMissingItems()
EID:evaluateQueuedItems() EID:evaluateQueuedItems()
EID:evaluateHeldPill() EID:evaluateHeldPill()
EID.TabHeldLastFrame = EID.TabHeldThisFrame
EID.TabHeldThisFrame = EID:PlayersActionPressed(EID.Config["BagOfCraftingToggleKey"])
if collSpawned then if collSpawned then
collSpawned = false collSpawned = false
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
-- Flag pedestals as being describable on frame 0 (for Tainted Isaac / Glitched Crown type pedestals to not be non-existent for a frame)
EID:setEntityData(entity, "EID_DescribeOnFirstFrame", true)
-- Fix Overlapping Pedestals if a collectible spawned this frame (needed for Mega Chest) -- Fix Overlapping Pedestals if a collectible spawned this frame (needed for Mega Chest)
local pos = entity.Position local pos = entity.Position
for _, otherPos in ipairs(curPositions) do for _, otherPos in ipairs(curPositions) do
if pos:Distance(otherPos[2]) == 0 then if pos:Distance(otherPos[2]) == 0 then
entity:GetData()["EID_RenderOffset"] = Vector(10,0) EID:setEntityData(entity, "EID_RenderOffset", Vector(10,0))
otherPos[1]:GetData()["EID_RenderOffset"] = Vector(-10,0) EID:setEntityData(otherPos[1], "EID_RenderOffset", Vector(-10,0))
end end
end end
table.insert(curPositions, {entity, entity.Position}) table.insert(curPositions, {entity, entity.Position})
@@ -1087,6 +1087,7 @@ function EID:onGameUpdate()
end end
if EID.isRepentance then if EID.isRepentance then
EID:WatchForGlitchedCrown()
EID:UpdateWildCardEffects() EID:UpdateWildCardEffects()
if EID.GameUpdateCount % 10 == 0 then if EID.GameUpdateCount % 10 == 0 then
-- Check wisp for adding reminder when using lemegeton -- Check wisp for adding reminder when using lemegeton
@@ -1131,7 +1132,7 @@ local function attemptPathfind(entity)
-- Spawn a Fireplace entity to attempt a pathfind to the target pickup, then remove it afterwards -- Spawn a Fireplace entity to attempt a pathfind to the target pickup, then remove it afterwards
pathCheckerEntity = game:Spawn(33, 0, EID.player.Position, nullVector, EID.player, 6969, 4354) pathCheckerEntity = game:Spawn(33, 0, EID.player.Position, nullVector, EID.player, 6969, 4354)
pathCheckerEntity:GetData()["EID_Pathfinder"] = true EID:setEntityData(pathCheckerEntity, "EID_Pathfinder", true)
pathCheckerEntity.Visible = false pathCheckerEntity.Visible = false
local successful = pathCheckerEntity:ToNPC().Pathfinder:HasPathToPos(entity.Position, false) local successful = pathCheckerEntity:ToNPC().Pathfinder:HasPathToPos(entity.Position, false)
pathsChecked[entity.InitSeed] = successful pathsChecked[entity.InitSeed] = successful
@@ -1400,12 +1401,13 @@ function EID:OnRender()
for _, entitySearch in ipairs(searchGroups) do for _, entitySearch in ipairs(searchGroups) do
for _, entity in ipairs(entitySearch) do for _, entity in ipairs(entitySearch) do
if EID:hasDescription(entity) and entity.FrameCount > 0 and not EID.entitiesToPrint[GetPtrHash(entity)] then if EID:hasDescription(entity) and (entity.FrameCount > 0 or EID:getEntityData(entity, "EID_DescribeOnFirstFrame")) and not EID.entitiesToPrint[GetPtrHash(entity)] then
table.insert(inRangeEntities, entity) table.insert(inRangeEntities, entity)
local diff = entity.Position:__sub(sourcePos) local diff = entity.Position:__sub(sourcePos)
-- break ties with the render offset (for Mega Chest double collectibles) -- break ties with the render offset (for Mega Chest double collectibles)
if diff:Length() == EID.lastDist and entity:GetData()["EID_RenderOffset"] then local entityDataRenderOffset = EID:getEntityData(entity, "EID_RenderOffset")
diff = diff + entity:GetData()["EID_RenderOffset"] if diff:Length() == EID.lastDist and entityDataRenderOffset then
diff = diff + entityDataRenderOffset
end end
if diff:Length() < EID.lastDist then if diff:Length() < EID.lastDist then
EID.lastDescriptionEntity = entity EID.lastDescriptionEntity = entity
@@ -1649,7 +1651,6 @@ local function OnGameStartGeneral(_,isSave)
end end
EID.ShouldCheckWisp = true EID.ShouldCheckWisp = true
EID.WildCardEffects = {} EID.WildCardEffects = {}
EID.roomCount = 0
end end
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStartGeneral) EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStartGeneral)
@@ -1722,7 +1723,7 @@ end
function EID:OnUsePill(pillEffectID, player, useFlags) function EID:OnUsePill(pillEffectID, player, useFlags)
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 -- get the pill color by checking the player's pocket
local pillColor = EID.PlayerHeldPill[EID:getPlayerID(player)] local pillColor = EID.PlayerHeldPill[EID:getPlayerID(player)] or 1
-- add the pill used to our history for Echo Chamber / Vurp! / transformation progress -- add the pill used to our history for Echo Chamber / Vurp! / transformation progress
EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags, pillColor) EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags, pillColor)
-- add the pill to Wild Card tracking, unless it's a Temperance? pill -- add the pill to Wild Card tracking, unless it's a Temperance? pill
+1 -1
View File
@@ -51,7 +51,7 @@ You are currently looking at the version for Afterbirth+ and Repentance.
[img]https://i.imgur.com/jrdGbna.png[/img] [img]https://i.imgur.com/jrdGbna.png[/img]
[url=https://github.com/wofsauge/External-Item-Descriptions/blob/master/CREDITS.md]Check out the credits here[/url] [url=https://github.com/wofsauge/External-Item-Descriptions/blob/master/CREDITS.md]Check out the credits here[/url]
</description> </description>
<version>4.78</version> <version>4.79</version>
<visibility>Public</visibility> <visibility>Public</visibility>
<tag id="Lua"/> <tag id="Lua"/>
<tag id="Items"/> <tag id="Items"/>