Properly predict 404 Error

This commit is contained in:
Buurazu authored and GitHub committed 2024-06-21 21:46:08 -04:00
1 parent 8360538114
commit ec4c4a0894
1 file changed
+3 -12
+3 -12
View File
@@ -241,24 +241,15 @@ EID.ItemReminderDescriptionModifier = {
}, },
["5.350.75"] = { -- 404 Error ["5.350.75"] = { -- 404 Error
isHiddenInfo = true, isHiddenInfo = true,
isRepentance = true, -- HasTrinket can't differentiate between real and fake trinkets in AB+
modifierFunction = function(descObj, player) modifierFunction = function(descObj, player)
-- Unfortunately, includes other temporary trinket givers, such as Glitched Items. We'd need to predict 404's result using RNG to actually know which it specifically is granting local seed = game:GetLevel():GetCurrentRoom():GetSpawnSeed()
local result = EID:RNGNext(seed, 2, 7, 25) % (EID.isRepentance and 189 or 128) + 1
-- Don't display Mysterious Paper's 1-frame temporary trinket granting local demoDescObj = EID:getDescriptionObj(5, 350, result)
local hasPaper = player:HasTrinket(21)
-- Mysterious Paper does not play well with displaying Error 404's effect
local mysteriousPaperBlacklist = { [23] = true, [48] = true }
for i = 1, TrinketType.NUM_TRINKETS - 1 do
local tempTrinketFound = player:HasTrinket(i, true) ~= player:HasTrinket(i, false)
if tempTrinketFound and (not mysteriousPaperBlacklist[i] or not hasPaper) then
local demoDescObj = EID:getDescriptionObj(5, 350, i)
EID:ItemReminderAddResultHeaderSuffix(descObj, demoDescObj.Name) EID:ItemReminderAddResultHeaderSuffix(descObj, demoDescObj.Name)
descObj.Icon = demoDescObj.Icon descObj.Icon = demoDescObj.Icon
descObj.Description = demoDescObj.Description descObj.Description = demoDescObj.Description
end end
end
end
}, },
["5.350.166"] = { -- Modeling Clay ["5.350.166"] = { -- Modeling Clay
isRepentance = true, isRepentance = true,