small code cleanup

This commit is contained in:
Wofsauge committed 2024-07-17 19:43:17 +02:00
1 parent 09c80f9d97
commit 7e7e572235
2 files changed
+12 -17

No files matched your search

-7
View File
@@ -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:
+12 -10
View File
@@ -742,17 +742,17 @@ if EID.isRepentance then
local entity = descObj.Entity local entity = descObj.Entity
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
if EID.GlitchedCrownCheck[curRoomIndex] and EID.GlitchedCrownCheck[curRoomIndex][descObj.Entity.InitSeed..descObj.Entity.Index] then 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 -- 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 -- 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 pedestalID = descObj.Entity.InitSeed .. descObj.Entity.Index
local items = EID.GlitchedCrownCheck[curRoomIndex][pedestalID] local items = EID.GlitchedCrownCheck[curRoomIndex][pedestalID]
local sortedItems = {} local sortedItems = {}
for id,frames in pairs(items) do for id, frames in pairs(items) do
if EID.GameUpdateCount - frames[2] > 120 then if EID.GameUpdateCount - frames[2] > 120 then
items[id] = nil items[id] = nil
else else
table.insert(sortedItems, {id, frames[1]}) table.insert(sortedItems, { id, frames[1] })
end end
end end
if #sortedItems < 5 then return descObj end if #sortedItems < 5 then return descObj end
@@ -771,18 +771,20 @@ if EID.isRepentance then
if currentSelection[pedestalID] == 0 then if currentSelection[pedestalID] == 0 then
descObj = EID:getDescriptionObj(5, 100, 689, nil, false) descObj = EID:getDescriptionObj(5, 100, 689, nil, false)
descObj.Description = "" descObj.Description = ""
for _,item in ipairs(sortedItems) do for _, item in ipairs(sortedItems) do
descObj.Description = descObj.Description .. "#{{NameC" .. item[1] .. "}}" descObj.Description = descObj.Description .. "#{{NameC" .. item[1] .. "}}"
end end
-- display a specific description -- display a specific description
-- don't replace the desc if the pedestal's already showing the correct item -- don't replace the desc if the pedestal's already showing the correct item
else else
descObj = EID:getDescriptionObj(5, 100, sortedItems[currentSelection[pedestalID]][1]) descObj = EID:getDescriptionObj(5, 100, sortedItems[currentSelection[pedestalID]][1])
end end
local nextIcon = "{{Collectible689}}" local nextIcon = "{{Collectible689}}"
if currentSelection[pedestalID]+1 <= #sortedItems then nextIcon = "{{Collectible" .. sortedItems[currentSelection[pedestalID]+1][1] .. "}}" end if currentSelection[pedestalID] + 1 <= #sortedItems then nextIcon = "{{Collectible" ..
EID:appendToDescription(descObj, "#{{Blank}} ".. EID:ReplaceVariableStr(EID:getDescriptionEntry("GlitchedCrownToggleInfo"),1,nextIcon)) 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 -- 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 descObj.Entity = entity