Added first wave of Repentogon features

This commit is contained in:
Wofsauge committed 2024-01-03 23:22:45 +01:00
1 parent df10be8fcf
commit 08b8b07b1a
5 files changed
+46 -4

No files matched your search

+10 -2
View File
@@ -608,7 +608,7 @@ function EID:getObjectName(Type, Variant, SubType)
elseif tableName == "dice" then
return EID:getDescriptionEntry("diceHeader").." ("..SubType..")"
elseif tableName == "custom" then
local xmlName = EID.XMLEntityNames[Type.."."..Variant] or EID.XMLEntityNames[Type.."."..Variant.."."..SubType]
local xmlName = EID:GetEntityXMLName(Type, Variant, SubType)
return name or xmlName or Type.."."..Variant.."."..SubType
end
return Type.."."..Variant.."."..SubType
@@ -1702,7 +1702,10 @@ function EID:evaluateTransformationProgress(transformation)
if not EID.TransformationLookup[transformation] then return end
if transformData and transformData.VanillaForm and player:HasPlayerForm(transformData.VanillaForm) then
if REPENTOGON and transformData and transformData.VanillaForm then
-- REPENTOGON lets us ignore everything else for vanilla transformation progress
EID.TransformationProgress[i][transformation] = player:GetPlayerFormCounter(transformData.VanillaForm)
elseif transformData and transformData.VanillaForm and player:HasPlayerForm(transformData.VanillaForm) then
EID.TransformationProgress[i][transformation] = transformData.NumNeeded or 3
else
local pickupHistory = EID.PlayerItemInteractions[i].pickupHistory
@@ -1958,3 +1961,8 @@ end
function EID:WasPillUsed(pillColor)
return EID.UsedPillColors[tostring(pillColor)] ~= nil
end
-- returns the name of the given entity
function EID:GetEntityXMLName(Type, Variant, SubType)
return EID.XMLEntityNames[Type.."."..Variant] or EID.XMLEntityNames[Type.."."..Variant.."."..SubType]
end
+1 -1
View File
@@ -324,5 +324,5 @@ function EID:D1Prediction(rng)
end
local pickupNames = EID:getDescriptionEntry("PickupNames") or {}
return pickupNames[fullID] or EID.XMLEntityNames[fullID] or fullID
return pickupNames[fullID] or EID:GetEntityXMLName(Type, Variant, SubType) or fullID
end
+30
View File
@@ -0,0 +1,30 @@
if not REPENTOGON then
return
end
---@diagnostic disable: duplicate-set-field
local game = Game()
-- REPENTOGON: Use PersistentGameData to determine item collection status
-- Returns true if an item needs to be collected for the collection page
function EID:requiredForCollectionPage(itemID)
if itemID >= CollectibleType.NUM_COLLECTIBLES or game:GetVictoryLap() > 0 or game:GetSeeds():IsCustomRun() then return false end
return not Isaac.GetPersistentGameData():IsItemInCollection(itemID)
end
-- REPENTOGON: Function is no longer used since we can directly read the collection state from the game
function EID:checkPlayersForMissingItems() end
-- REPENTOGON: Function is no longer used since repentogon always has progress enabled.
function EID:AreAchievementsAllowed() return true end
-- REPENTOGON: Entity names can now be directly read from XML
-- returns the name of the given entity
function EID:GetEntityXMLName(Type, Variant, SubType)
local xmlEntry = XMLData.GetEntityByTypeVarSub(Type, Variant, SubType)
return xmlEntry and xmlEntry.name or EID.XMLEntityNames[Type .. "." .. Variant] or
EID.XMLEntityNames[Type .. "." .. Variant .. "." .. SubType]
end
-- Render EID aboth hud, if REPENTOGON is installed
EID:RemoveCallback(ModCallbacks.MC_POST_RENDER, EID.OnRender)
EID:AddCallback(ModCallbacks.MC_HUD_RENDER, EID.OnRender)
+1 -1
View File
@@ -37,7 +37,7 @@ local function entityToName(e, plural)
-- -1 is often used as an "any of this type", even if there's only one of that type, so converting it to 0 can help find names
local eWithZero = string.gsub(e, "-1", "0")
plural = plural or false
local name = localizedNames[e] or EID.XMLEntityNames[e] or localizedNames[eWithZero] or EID.XMLEntityNames[eWithZero] or e
local name = localizedNames[e] or EID:GetEntityXMLName(Type, Variant, SubType) or localizedNames[eWithZero] or e
--print out entities with no name yet
if name == e then Isaac.DebugString("No name found for " .. e .. " (could be modded)")
+4
View File
@@ -1803,7 +1803,11 @@ if EID.enableDebug then
require("eid_debugging")
end
-- load repentogon stuff last to allow overrides of functions
require("eid_repentogon")
Isaac.DebugString("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
Isaac.DebugString("External Item Descriptions v"..EID.ModVersion.."_"..EID.ModVersionCommit.." loaded.")
Isaac.DebugString("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("External Item Descriptions v"..EID.ModVersion.."_"..EID.ModVersionCommit.." loaded.")