From 82d5f4ec3e2352e117aa5ddbdd75205057886b35 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Sun, 23 Jan 2022 21:31:20 -0500 Subject: [PATCH 01/13] Update main.lua --- main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index ad75fd8e..59e5de4c 100644 --- a/main.lua +++ b/main.lua @@ -862,7 +862,8 @@ local function attemptPathfind(entity) pathsChecked[entity.InitSeed] = true return true end - if EID.GameUpdateCount - lastPathfindFrame < 10 then return false end + -- Don't reattempt pathfinding more than 3 times a second, unless this is a new entity + if pathsChecked[entity.InitSeed] == false and EID.GameUpdateCount - lastPathfindFrame < 10 then return false end -- Spawn a custom NPC entity to attempt a pathfind to the target pickup, then remove it afterwards pathCheckerEntity = game:Spawn(17, 3169, EID.player.Position, nullVector, EID.player, 0, 4354) From 7b075eb1d8400453f4f1788659d3cabbe57dcb21 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 24 Jan 2022 13:34:37 -0500 Subject: [PATCH 02/13] fix the glowing hour glass check --- eid_tmtrainer.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eid_tmtrainer.lua b/eid_tmtrainer.lua index 7ff5ee72..54155d65 100644 --- a/eid_tmtrainer.lua +++ b/eid_tmtrainer.lua @@ -127,10 +127,10 @@ local function CheckLogForItems(_) numEffects = numEffects - 1 eidDesc = eidDesc .. parseEffectLine(line) if numEffects == 0 then - -- Glowing Hour Glass type effects seem to cause the game to reload all items, check if our desc is equal to the first one + eidDesc = EID:CheckGlitchedItemConfig(maxNumber - spawnedItems) .. eidDesc + -- Glowing Hour Glass type effects cause the game to reload all items, check if our desc is equal to the first one if (descOne == eidDesc) then spawnedItems = 1 end - eidDesc = EID:CheckGlitchedItemConfig(maxNumber - spawnedItems) .. eidDesc EID:addCollectible(maxNumber - spawnedItems, eidDesc) if spawnedItems == 1 then descOne = eidDesc end end From fe3eaa13f014a94fd4a32e9e208f4b37fd998a79 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 24 Jan 2022 13:36:10 -0500 Subject: [PATCH 03/13] Void WIP --- main.lua | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 59e5de4c..8d8d6108 100644 --- a/main.lua +++ b/main.lua @@ -815,14 +815,32 @@ end -- Runs 30 times a second; doesn't update while paused local collSpawned = false +local function VoidRNGNext(num) + num = num ~ ((num >> 5) & 4294967295) + num = num ~ ((num << 9) & 4294967295) + num = num ~ ((num >> 7) & 4294967295) + return num >> 0; +end +-- Speed, Fire Rate, Damage, Range, Shot Speed, Luck +-- (Same order as it is on the Extra Hud) +local voidStatUps = { 0.2, 0.5, 1, 1.5, 0.2, 1 } function EID:onGameUpdate() EID.GameUpdateCount = EID.GameUpdateCount + 1 - -- Fix Overlapping Pedestals if a collectible spawned this frame (needed for Mega Chest) + if collSpawned then collSpawned = false + local numVoidable = 0 + local numBlackRunable = 0 + -- THIS INCLUDES UNPURCHASED SHOP ITEMS??? and both choice items also, which is OK for AB+ but not for Rep! local curPositions = {} for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do + if entity.SubType > 0 then + numBlackRunable = numBlackRunable + 1 + if EID.itemConfig:GetCollectible(entity.SubType).Type ~= 3 then numVoidable = numVoidable + 1 end + end + + -- Fix Overlapping Pedestals if a collectible spawned this frame (needed for Mega Chest) local pos = entity.Position for _, otherPos in ipairs(curPositions) do if pos:Distance(otherPos[2]) == 0 then @@ -832,6 +850,32 @@ function EID:onGameUpdate() end table.insert(curPositions, {entity, entity.Position}) end + + -- Recalculate our total Void stat-ups if a collectible spawned this frame + -- NOTE: NEED AB+ NUMBERS STILL + -- THIS COULD APPLY TO BLACK RUNE AS WELL, WHATS ITS RNG??? getplayer:getcardrng? + if EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_VOID) then + local curRoomIndex = game:GetLevel():GetCurrentRoomIndex() + local increases = {0, 0, 0, 0, 0, 0} + --CHANGE THIS TO THE PLAYER THAT HAS VOID + local startRNG = Isaac.GetPlayer(0):GetCollectibleRNG(CollectibleType.COLLECTIBLE_VOID):GetSeed() + startRNG = VoidRNGNext(startRNG) + for pedestals = 1, numVoidable do + local statTable = {1,2,3,4,5,6} + -- perform 5 random swaps of our stat table + for i = 6, 2, -1 do + startRNG = VoidRNGNext(startRNG) + local result = (startRNG % i) + 1 + local temp = statTable[i] + statTable[i] = statTable[result] + statTable[result] = temp + end + -- the first two entries in the stat table get increased + increases[statTable[1]] = increases[statTable[1]] + voidStatUps[statTable[1]] + increases[statTable[2]] = increases[statTable[2]] + voidStatUps[statTable[2]] + end + for i,v in ipairs(increases) do print(v) end + end end -- Remove Crane Game item data if it's giving the prize out From c43028f338c0eed426442f5d590318ee1d9797b2 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 00:36:52 -0500 Subject: [PATCH 04/13] Add a Tab preview to Spindown Dice --- eid_modifiers.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 7b92ebd6..2fff2c88 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -50,6 +50,7 @@ if REPENTANCE then return descObj end + local inSpindownPreview = false -- Handle Spindown Dice description addition local function SpindownDiceCallback(descObj) EID:appendToDescription(descObj, "#{{Collectible723}} :") @@ -63,6 +64,12 @@ if REPENTANCE then end refID = spinnedID if refID > 0 and refID < 4294960000 then + if i == 1 and Input.IsActionPressed(ButtonAction.ACTION_MAP, EID.player.ControllerIndex) then + inSpindownPreview = true + local descEntry = EID:getDescriptionObj(5, 100, refID) + inSpindownPreview = false + return descEntry + end EID:appendToDescription(descObj, "{{Collectible"..refID.."}}") if EID.itemUnlockStates[refID] == false then EID:appendToDescription(descObj, "?") end if i ~= EID.Config["SpindownDiceResults"] then @@ -77,6 +84,7 @@ if REPENTANCE then if hasCarBattery then EID:appendToDescription(descObj, " (Results with {{Collectible356}})") end + EID:appendToDescription(descObj, "#{{Blank}} ".. EID:getDescriptionEntry("FlipItemToggleInfo")) return descObj end @@ -317,7 +325,7 @@ if REPENTANCE then if collectiblesOwned[584] then table.insert(callbacks, BookOfVirtuesCallback) end if collectiblesOwned[706] then table.insert(callbacks, AbyssCallback) end - if collectiblesOwned[723] or (EID.absorbedSpindown and collectiblesOwned[477]) then table.insert(callbacks, SpindownDiceCallback) end + if (collectiblesOwned[723] or (EID.absorbedSpindown and collectiblesOwned[477])) and not inSpindownPreview then table.insert(callbacks, SpindownDiceCallback) end if collectiblesOwned[711] and EID:getEntityData(descObj.Entity, "EID_FlipItemID") then table.insert(callbacks, FlipCallback) end -- Card / Rune Callbacks elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then From eef4b549e1251caeb8f035ec43db920054e66a40 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 00:37:11 -0500 Subject: [PATCH 05/13] Add Void toggle, remove F5 default scale --- eid_config.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index c93bb898..b776121a 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -30,9 +30,9 @@ EID.UserConfig = { -- Change the size of the info boxes. Range: [0,...,1] -- Default = 1 ["Scale"] = 1, - -- Press or hold the key to change scale. - -- Default = Keyboard.KEY_F5 - ["ScaleKey"] = Keyboard.KEY_F5, + -- Press or hold the key to change scale. Keyboard.KEY_F5 is recommended + -- Default = none + ["ScaleKey"] = -1, -- Set the background transparency. Range: [0,...,1] -- Default = 0.75 ["Transparency"] = 0.75, @@ -226,6 +226,11 @@ EID.UserConfig = { -- REPENTANCE ONLY!!! -- Default = true ["DisplayCraneInfo"] = true, + + ---------- Void Stat Increases ---------- + -- Toggle display of what stats will increase on Void absorption + -- Default = false + ["DisplayVoidStatInfo"] = false, ---------- Bag of Crafting ------------ @@ -347,7 +352,7 @@ EID.DefaultConfig = { ["FontType"] = "default", ["TextboxWidth"] = 130, ["Scale"] = 1, - ["ScaleKey"] = Keyboard.KEY_F5, + ["ScaleKey"] = -1, ["Transparency"] = 0.75, ["HUDOffset"] = 10, ["XPosition"] = 60, @@ -396,6 +401,7 @@ EID.DefaultConfig = { ["DisplayDiceInfo"] = true, ["DisplayBagOfCrafting"] = "always", ["DisplayCraneInfo"] = true, + ["DisplayVoidStatInfo"] = false, ["BagOfCraftingResults"] = 7, ["BagOfCraftingCombinationMax"] = 12, ["BagOfCraftingRandomResults"] = 400, From 9771a77a7694558502459fe27b56867ea10bb83f Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 00:42:35 -0500 Subject: [PATCH 06/13] Add Void option, reduce some simple boolean option line counts --- mod_config_menu.lua | 248 ++++++-------------------------------------- 1 file changed, 29 insertions(+), 219 deletions(-) diff --git a/mod_config_menu.lua b/mod_config_menu.lua index be873c43..1df7a9ec 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -115,27 +115,27 @@ function EID:buildColorArray() table.sort(colorNameArray) end -function EID:AddBooleanSetting(category, optionName, displayText, onText, offText, infoText) - if (type(infoText) == "string") then infoText = {infoText} end +function EID:AddBooleanSetting(category, optionName, displayText, params) + if type(params) ~= "table" then params = {} end + if params.repOnly and not REPENTANCE then return end MCM.AddSetting( - "EID", - category, + "EID", category, { Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() + CurrentSetting = params.currentSettingFunc or function() return EID.Config[optionName] end, - Display = function() - local onOff = offText + Display = params.displayFunc or function() + local onOff = params.offText or "False" if EID.Config[optionName] then - onOff = onText + onOff = params.onText or "True" end return displayText .. ": " .. onOff end, - OnChange = function(currentBool) + OnChange = params.onChangeFunc or function(currentBool) EID.Config[optionName] = currentBool end, - Info = infoText + Info = params.infoText or {} } ) end @@ -579,190 +579,21 @@ if MCMLoaded then --------------------------------------------------------------------------- ---------------------------------Display----------------------------------- - - ------------Collectibles-------------- - - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayItemInfo"] - end, - Display = function() - EID.MCMCompat_isDisplayingEIDTab = ""; - local onOff = "False" - if EID.Config["DisplayItemInfo"] then - onOff = "True" - end - return "Collectible Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayItemInfo"] = currentBool - end - } - ) - ------------Trinkets-------------- - - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayTrinketInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayTrinketInfo"] then - onOff = "True" - end - return "Trinket Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayTrinketInfo"] = currentBool - end - } - ) - ------------CARDS-------------- - - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayCardInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayCardInfo"] then - onOff = "True" - end - return "Card Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayCardInfo"] = currentBool - end - } - ) - - ------------PILLS-------------- - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayPillInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayPillInfo"] then - onOff = "True" - end - return "Pill Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayPillInfo"] = currentBool - end - } - ) - if REPENTANCE then - ------------Glitched Items-------------- - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayGlitchedItemInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayGlitchedItemInfo"] then - onOff = "True" - end - return "Glitched Item Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayGlitchedItemInfo"] = currentBool - end, - Info = {"Note: The --luadebug launch option is required for more detailed glitched item descriptions"} - } - ) - end - --------Sacrifice Room--------- - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplaySacrificeInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplaySacrificeInfo"] then - onOff = "True" - end - return "Sacrifice Room Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplaySacrificeInfo"] = currentBool - end - } - ) - - --------Dice Room--------- - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayDiceInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayDiceInfo"] then - onOff = "True" - end - return "Dice Room Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayDiceInfo"] = currentBool - end - } - ) - + -- Simple toggles of what descriptions the user wants displayed + EID:AddBooleanSetting("Display", "DisplayItemInfo", "Collectible Infos") + EID:AddBooleanSetting("Display", "DisplayTrinketInfo", "Trinket Infos") + EID:AddBooleanSetting("Display", "DisplayCardInfo", "Card Infos") + EID:AddBooleanSetting("Display", "DisplayPillInfo", "Pill Infos") + EID:AddBooleanSetting("Display", "DisplayGlitchedItemInfo", "Glitched Item Infos", {repOnly = true, + infoText = "Note: The --luadebug launch option is required for more detailed glitched item descriptions; this can be dangerous!"}) + EID:AddBooleanSetting("Display", "DisplaySacrificeInfo", "Sacrifice Room Infos") + EID:AddBooleanSetting("Display", "DisplayDiceInfo", "Dice Room Infos") + EID:AddBooleanSetting("Display", "DisplayCraneInfo", "Crane Game Infos", {repOnly = true}) + EID:AddBooleanSetting("Display", "DisplayVoidStatInfo", "Void Stat Increase Infos") local diceSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} if REPENTANCE then - - --------Crane Game--------- - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["DisplayCraneInfo"] - end, - Display = function() - local onOff = "False" - if EID.Config["DisplayCraneInfo"] then - onOff = "True" - end - return "Crane Game Infos: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["DisplayCraneInfo"] = currentBool - end - } - ) MCM.AddSpace("EID", "Display") @@ -788,27 +619,8 @@ if MCMLoaded then -- -- Spindown Dice skip locked items - MCM.AddSetting( - "EID", - "Display", - { - Type = ModConfigMenu.OptionType.BOOLEAN, - CurrentSetting = function() - return EID.Config["SpindownDiceSkipLocked"] - end, - Display = function() - local onOff = "False" - if EID.Config["SpindownDiceSkipLocked"] then - onOff = "True" - end - return "Skip Locked Items: " .. onOff - end, - OnChange = function(currentBool) - EID.Config["SpindownDiceSkipLocked"] = currentBool - end, - Info = {"Skip locked items in the preview just as the dice will; the method to check for unlock status is not perfect, though"} - } - ) + EID:AddBooleanSetting("Display", "SpindownDiceSkipLocked", "Skip Locked Items", + {repOnly = true, infoText = "Skip locked items in the preview just as the dice will; the method to check for unlock status is not perfect, though"}) end --------Obstruction--------- @@ -1369,15 +1181,13 @@ if MCMLoaded then } ) -- Bag of Crafting Hide in Battle - EID:AddBooleanSetting("Crafting", - "BagOfCraftingHideInBattle", - "Hide in Battle", "Yes", "No", - "Hides the recipe list when in a fight") + EID:AddBooleanSetting("Crafting", "BagOfCraftingHideInBattle", "Hide in Battle", + {onText = "Yes", offText = "No", + infoText = "Hides the recipe list when in a fight"}) -- Bag of Crafting 8 icons toggle - EID:AddBooleanSetting("Crafting", - "BagOfCraftingDisplayIcons", - "Show Recipes/Best Bag as", "8 Icons", "Groups", - "Choose if you want recipes (and the Best Quality bag in No Recipes Mode) shown as 8 icons, or as grouped ingredients") + EID:AddBooleanSetting("Crafting", "BagOfCraftingDisplayIcons", "Show Recipes/Best Bag as", + {onText = "8 Icons", offText = "Groups", + infoText = "Choose if you want recipes (and the Best Quality bag in No Recipes Mode) shown as 8 icons, or as grouped ingredients"}) MCM.AddSpace("EID", "Crafting") MCM.AddText("EID", "Crafting", function() return "Recipe List Options" end) From 5c433ad0183c376cc2f853a58c9736291b10e1a0 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 00:42:56 -0500 Subject: [PATCH 07/13] use GameUpdateCount for the modifier collectible check --- eid_modifiers.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 2fff2c88..429215d4 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -282,13 +282,15 @@ if REPENTANCE then CollectibleType.COLLECTIBLE_FALSE_PHD, CollectibleType.COLLECTIBLE_ABYSS, CollectibleType.COLLECTIBLE_FLIP, } local collectiblesOwned = {} - + local lastCheck = 0 + local function EIDConditions(descObj) -- currently, only pickup descriptions have modifiers if descObj.ObjType ~= 5 then return false end -- recheck the players' owned collectibles periodically, not every frame - if game:GetFrameCount() % 10 == 0 then + if EID.GameUpdateCount >= lastCheck + 15 then + lastCheck = EID.GameUpdateCount local numPlayers = game:GetNumPlayers() local players = {}; for i = 0, numPlayers - 1 do players[i] = Isaac.GetPlayer(i) end for _,v in ipairs(collectiblesToCheck) do From bba23bcc5736417ac850a42d930baa28a485583b Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 01:14:35 -0500 Subject: [PATCH 08/13] Fix no Flip items after fresh game reload --- main.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/main.lua b/main.lua index 8d8d6108..d3fb188e 100644 --- a/main.lua +++ b/main.lua @@ -628,16 +628,7 @@ end local isMirrorRoom = false local isDeathCertRoom = false if REPENTANCE then - function EID:onNewRoom() - isMirrorRoom = game:GetLevel():GetCurrentRoom():IsMirrorWorld() - - local level = game:GetLevel() - local id = level:GetCurrentRoomIndex() - isDeathCertRoom = (id >=0 and GetPtrHash(level:GetRoomByIdx(id)) == GetPtrHash(level:GetRoomByIdx(id, 2))) - - -- Handle Flip Item - initialItemNext = false - flipItemNext = false + function EID:AssignFlipItems() EID.flipMaxIndex = -1 local curRoomIndex = game:GetLevel():GetCurrentRoomIndex() if EID.flipItemPositions[curRoomIndex] then @@ -651,6 +642,18 @@ if REPENTANCE then end end end + function EID:onNewRoom() + isMirrorRoom = game:GetLevel():GetCurrentRoom():IsMirrorWorld() + + local level = game:GetLevel() + local id = level:GetCurrentRoomIndex() + isDeathCertRoom = (id >=0 and GetPtrHash(level:GetRoomByIdx(id)) == GetPtrHash(level:GetRoomByIdx(id, 2))) + + -- Handle Flip Item + initialItemNext = false + flipItemNext = false + EID:AssignFlipItems() + end EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.onNewRoom) end --------------------------------------------------------------------------- @@ -1279,6 +1282,7 @@ if EID.MCMLoaded or REPENTANCE then for k, _ in pairs(configIgnoreList) do savedEIDConfig[k] = nil end + EID:AssignFlipItems() end end From f3afb1b92362294432716d2135c3686e0d88db5c Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 04:44:28 -0500 Subject: [PATCH 09/13] Void update --- descriptions/ab+/en_us.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/descriptions/ab+/en_us.lua b/descriptions/ab+/en_us.lua index f5f98c1e..f6798ff3 100644 --- a/descriptions/ab+/en_us.lua +++ b/descriptions/ab+/en_us.lua @@ -496,7 +496,7 @@ EID.descriptions[languageCode].collectibles={ {"474", "Tonsil", "Blocks enemy projectiles"}, {"475", "Plan C", "!!! SINGLE USE !!!#Deals 9,999,999 damage to all enemies and kills you 3 seconds later"}, {"476", "D1", "Duplicates 1 random pickup in the current room"}, - {"477", "Void", "!!! When used, consume any pedestal items in the room#Active item: Its effect will be added to Void's effect (Stacking the effects)#↑ Passive item: Small stat upgrade to a random stat"}, + {"477", "Void", "!!! When used, consumes all pedestal items in the room#Active item: Its effect activates, and will activate every future use of Void#↑ Passive item: Small stat upgrade to two random stats"}, {"478", "Pause", "Freezes all enemies in the room until you start shooting again#Touching a frozen enemy will hurt you#Enemies unfreeze after 30 seconds"}, {"479", "Smelter", "Consumes your trinket and gives you the effect permanently#More trinkets appear"}, {"480", "Compost", "Converts pickups into blue flies or spiders#Doubles your current blue flies/spiders#Spawns 1 blue fly or spider when you don't have any"}, @@ -870,6 +870,9 @@ EID.descriptions[languageCode].transformations={ ---------- MISC ---------- +EID.descriptions[languageCode].VoidText = "If absorbed, gain:" +EID.descriptions[languageCode].VoidNames = {"Speed", "Tears", "Damage", "Range", "Shot Speed", "Luck"} + EID.descriptions[languageCode].MCM = { DemoObjectName = "Demo Object Name", DemoObjectTransformation = "Demo Transformation", From 1eeaca4e9518faadeb58bce28a688e6bd9708a4e Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 04:44:54 -0500 Subject: [PATCH 10/13] Void update, specify Map hotkey --- descriptions/rep/en_us.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index 2b60fdc9..06a05636 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -188,6 +188,7 @@ local repCollectibles={ [472] = {"472", "King Baby", "Other familiars follow it and shoot automatically at enemies#Stops moving when you are shooting#Will teleport back to you when you stop shooting"}, -- King Baby [474] = {"474", "Broken Glass Cannon", "Turns into Glass Cannon when used"}, -- Broken Glass Cannon [476] = {"476", "D1", "Duplicates 1 random pickup in the current room#Duplicated pickups may not be identical to the original"}, -- D1 + [477] = {"477", "Void", "!!! When used, consumes all pedestal items in the room#Active item: Its effect will activate every future use of Void#↑ Passive item: Small stat upgrade to two random stats"}, [489] = {"489", "D Infinity", "Acts as any die item except for {{Collectible723}}Spindown Dice#Change the current die with the drop key#Charge time varies based on the current die and updates when used"}, -- D Infinity [491] = {"491", "Acid Baby", "Drops a random pill every 7 rooms#Using a pill poisons all enemies in the room"}, -- Acid Baby [493] = {"493", "Adrenaline", "↑ Damage up for every empty Red Heart container#Follows a formula, some examples are:#+0.3 at 1#+0.92 at 2#+1.76 at 3#+2.79 at 4#+3.98 at 5"}, -- Adrenaline @@ -1011,6 +1012,9 @@ EID.descriptions[languageCode].GlitchedItemText = { ---------- Misc. Text ---------- +-- Void stat names: Replace "Tears" with "Fire Rate" +EID.descriptions[languageCode].VoidNames[2] = EID.descriptions[languageCode].GlitchedItemText[1] + EID.descriptions[languageCode].spindownError = "Item disappears" EID.descriptions[languageCode].CraftingBagContent = "Bag:" @@ -1030,7 +1034,7 @@ EID.descriptions[languageCode].BlankCardCharge = "Blank Card charge:" EID.descriptions[languageCode].BlankCardQCard = "Teleport to I Am Error Room#Blank Card and ?-Card will be destroyed" EID.descriptions[languageCode].ClearRuneCharge = "Clear Rune charge:" EID.descriptions[languageCode].PlaceboCharge = "Placebo charge:" -EID.descriptions[languageCode].FlipItemToggleInfo = "(Hold {{ButtonSelect}} to show description)" +EID.descriptions[languageCode].FlipItemToggleInfo = "(Hold {{ButtonSelect}} (Map) to show description)" EID.descriptions[languageCode].FalsePHDHeart = "Spawns 1 Black Heart" From cb15cf56c432dc7f738cdf24368a7d0fd495858d Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 04:45:41 -0500 Subject: [PATCH 11/13] fix displaying tab --- mod_config_menu.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod_config_menu.lua b/mod_config_menu.lua index 1df7a9ec..1c182126 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -126,6 +126,7 @@ function EID:AddBooleanSetting(category, optionName, displayText, params) return EID.Config[optionName] end, Display = params.displayFunc or function() + if params.displayingTab then EID.MCMCompat_isDisplayingEIDTab = params.displayingTab end local onOff = params.offText or "False" if EID.Config[optionName] then onOff = params.onText or "True" @@ -581,7 +582,7 @@ if MCMLoaded then ---------------------------------Display----------------------------------- -- Simple toggles of what descriptions the user wants displayed - EID:AddBooleanSetting("Display", "DisplayItemInfo", "Collectible Infos") + EID:AddBooleanSetting("Display", "DisplayItemInfo", "Collectible Infos", {displayingTab = ""}) EID:AddBooleanSetting("Display", "DisplayTrinketInfo", "Trinket Infos") EID:AddBooleanSetting("Display", "DisplayCardInfo", "Card Infos") EID:AddBooleanSetting("Display", "DisplayPillInfo", "Pill Infos") From 281672fe0da5628b9d8c80f8f820edd1bbb618f8 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 04:46:12 -0500 Subject: [PATCH 12/13] Void 1.0 --- main.lua | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/main.lua b/main.lua index d3fb188e..c4f3a0e1 100644 --- a/main.lua +++ b/main.lua @@ -818,19 +818,34 @@ end -- Runs 30 times a second; doesn't update while paused local collSpawned = false + +EID.VoidStatIncreases = {} +EID.BlackRuneStatIncreases = {} local function VoidRNGNext(num) num = num ~ ((num >> 5) & 4294967295) num = num ~ ((num << 9) & 4294967295) num = num ~ ((num >> 7) & 4294967295) return num >> 0; end --- Speed, Fire Rate, Damage, Range, Shot Speed, Luck --- (Same order as it is on the Extra Hud) -local voidStatUps = { 0.2, 0.5, 1, 1.5, 0.2, 1 } +local function GetTwoIncreases(rng, tbl) + local statTable = {1,2,3,4,5,6} + -- perform 5 random swaps of our stat table + for i = 6, 2, -1 do + rng = VoidRNGNext(rng) + local result = (rng % i) + 1 + local temp = statTable[i] + statTable[i] = statTable[result] + statTable[result] = temp + end + -- the first two entries in the stat table get increased + tbl[statTable[1]] = tbl[statTable[1]] + 1 + tbl[statTable[2]] = tbl[statTable[2]] + 1 + return rng +end + function EID:onGameUpdate() EID.GameUpdateCount = EID.GameUpdateCount + 1 - if collSpawned then collSpawned = false local numVoidable = 0 @@ -855,29 +870,23 @@ function EID:onGameUpdate() end -- Recalculate our total Void stat-ups if a collectible spawned this frame - -- NOTE: NEED AB+ NUMBERS STILL - -- THIS COULD APPLY TO BLACK RUNE AS WELL, WHATS ITS RNG??? getplayer:getcardrng? + -- THIS COULD APPLY TO BLACK RUNE AS WELL if EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_VOID) then local curRoomIndex = game:GetLevel():GetCurrentRoomIndex() local increases = {0, 0, 0, 0, 0, 0} + local runeIncreases = {0, 0, 0, 0, 0, 0} --CHANGE THIS TO THE PLAYER THAT HAS VOID local startRNG = Isaac.GetPlayer(0):GetCollectibleRNG(CollectibleType.COLLECTIBLE_VOID):GetSeed() - startRNG = VoidRNGNext(startRNG) - for pedestals = 1, numVoidable do - local statTable = {1,2,3,4,5,6} - -- perform 5 random swaps of our stat table - for i = 6, 2, -1 do - startRNG = VoidRNGNext(startRNG) - local result = (startRNG % i) + 1 - local temp = statTable[i] - statTable[i] = statTable[result] - statTable[result] = temp - end - -- the first two entries in the stat table get increased - increases[statTable[1]] = increases[statTable[1]] + voidStatUps[statTable[1]] - increases[statTable[2]] = increases[statTable[2]] + voidStatUps[statTable[2]] + local runeRNG = Isaac.GetPlayer(0):GetCardRNG(Card.RUNE_BLACK):GetSeed() + -- in Repentance, an additional RNG call is done before the 5 for stat ups + if REPENTANCE then startRNG = VoidRNGNext(startRNG) end + for pedestals = 1, 1 do + startRNG = GetTwoIncreases(startRNG, increases) + runeRNG = GetTwoIncreases(runeRNG, runeIncreases) + break -- only doing 1 preview for now end - for i,v in ipairs(increases) do print(v) end + EID.VoidStatIncreases = increases + EID.BlackRuneStatIncreases = runeIncreases end end From f846c6d46bd6a196cf2e8e18400e2456a09df592 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 04:46:48 -0500 Subject: [PATCH 13/13] Void 1.0 --- eid_modifiers.lua | 140 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 104 insertions(+), 36 deletions(-) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 429215d4..20cbb65c 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -1,6 +1,107 @@ -if REPENTANCE then - local game = Game() +local game = Game() +-- Afterbirth+ modifiers +local collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, } +-- Repentance modifiers +if REPENTANCE then collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, + CollectibleType.COLLECTIBLE_BINGE_EATER, CollectibleType.COLLECTIBLE_BOOK_OF_VIRTUES, CollectibleType.COLLECTIBLE_SPINDOWN_DICE, + CollectibleType.COLLECTIBLE_TAROT_CLOTH, CollectibleType.COLLECTIBLE_MOMS_BOX, + CollectibleType.COLLECTIBLE_BLANK_CARD, CollectibleType.COLLECTIBLE_CLEAR_RUNE, CollectibleType.COLLECTIBLE_PLACEBO, + CollectibleType.COLLECTIBLE_FALSE_PHD, CollectibleType.COLLECTIBLE_ABYSS, CollectibleType.COLLECTIBLE_FLIP, +} end +local collectiblesOwned = {} +local blackRuneOwned = false +local lastCheck = 0 + +local function CheckPlayersCollectibles() + -- recheck the players' owned collectibles periodically, not every frame + if EID.GameUpdateCount >= lastCheck + 15 then + lastCheck = EID.GameUpdateCount + local numPlayers = game:GetNumPlayers() + local players = {}; for i = 0, numPlayers - 1 do players[i] = Isaac.GetPlayer(i) end + for _,v in ipairs(collectiblesToCheck) do + collectiblesOwned[v] = false + for i = 0, numPlayers - 1 do + if players[i]:HasCollectible(v) then + collectiblesOwned[v] = true + break + end + end + end + blackRuneOwned = false + for i = 0, numPlayers - 1 do + for j = 0, 1 do + if players[i]:GetCard(j) == Card.RUNE_BLACK then + blackRuneOwned = true + break + end + end + end + -- Birthright Book of Belial + -- Could this be changed to just checking for having Collectible 59? (Check interaction with Clicker etc) + if REPENTANCE then + collectiblesOwned[59] = false + for i = 0, numPlayers - 1 do + local playerType = players[i]:GetPlayerType() + if (playerType == PlayerType.PLAYER_JUDAS or playerType == PlayerType.PLAYER_BLACKJUDAS) and players[i]:HasCollectible(CollectibleType.COLLECTIBLE_BIRTHRIGHT) then + collectiblesOwned[59] = true + break + end + end + end + end +end + +-- Handle Void (the only modifier that is applied to AB+ at the moment) +-- Speed, Tears, Damage, Range, Shot Speed, Luck +local voidIntro = EID:getDescriptionEntry("VoidText") +local voidNames = EID:getDescriptionEntry("VoidNames") +local voidStatUps = { 0.2, 0.5, 1, 0.5, 0.2, 1 } +if REPENTANCE then voidStatUps[4] = 1.5 end + +local function VoidCallback(descObj) + if EID.itemConfig:GetCollectible(descObj.ObjSubType).Type ~= 3 then + EID:appendToDescription(descObj, "#{{Collectible477}} " .. voidIntro .. "#") + for i,v in ipairs(EID.VoidStatIncreases) do + if v > 0 then + EID:appendToDescription(descObj, "{{Collectible477}} +" .. v*voidStatUps[i] .. " " .. voidNames[i] .. "#") + end + end + end + return descObj +end +local function BlackRuneCallback(descObj) + EID:appendToDescription(descObj, "#{{Card41}} " .. voidIntro .. "#") + for i,v in ipairs(EID.BlackRuneStatIncreases) do + if v > 0 then + EID:appendToDescription(descObj, "{{Card41}} +" .. v*voidStatUps[i] .. " " .. voidNames[i] .. "#") + end + end + return descObj +end + +local function EIDConditionsAB(descObj) + -- currently, only pickup descriptions have modifiers + if descObj.ObjType ~= 5 then return false end + + CheckPlayersCollectibles() + + local callbacks = {} + + -- Collectible Pedestal Callbacks + if descObj.ObjVariant == PickupVariant.PICKUP_COLLECTIBLE then + if EID.Config["DisplayVoidStatInfo"] then + if collectiblesOwned[477] then table.insert(callbacks, VoidCallback) end + if blackRuneOwned then table.insert(callbacks, BlackRuneCallback) end + end + end + + return callbacks +end +EID:addDescriptionModifier("EID Afterbirth+", EIDConditionsAB, nil) + + +if REPENTANCE then -- Handle Birthright local function BirthrightCallback(descObj) descObj.Description = "" @@ -275,44 +376,11 @@ if REPENTANCE then -- This one-condition setup fixes that and can only help performance -- It also allows us to pick the order that modifiers are appended to descriptions (stats/effects first, then reroll/flip/recharge info) - local collectiblesToCheck = { CollectibleType.COLLECTIBLE_BINGE_EATER, CollectibleType.COLLECTIBLE_BOOK_OF_VIRTUES, - CollectibleType.COLLECTIBLE_SPINDOWN_DICE, CollectibleType.COLLECTIBLE_VOID, - CollectibleType.COLLECTIBLE_TAROT_CLOTH, CollectibleType.COLLECTIBLE_MOMS_BOX, - CollectibleType.COLLECTIBLE_BLANK_CARD, CollectibleType.COLLECTIBLE_CLEAR_RUNE, CollectibleType.COLLECTIBLE_PLACEBO, - CollectibleType.COLLECTIBLE_FALSE_PHD, CollectibleType.COLLECTIBLE_ABYSS, CollectibleType.COLLECTIBLE_FLIP, - } - local collectiblesOwned = {} - local lastCheck = 0 - local function EIDConditions(descObj) -- currently, only pickup descriptions have modifiers if descObj.ObjType ~= 5 then return false end - -- recheck the players' owned collectibles periodically, not every frame - if EID.GameUpdateCount >= lastCheck + 15 then - lastCheck = EID.GameUpdateCount - local numPlayers = game:GetNumPlayers() - local players = {}; for i = 0, numPlayers - 1 do players[i] = Isaac.GetPlayer(i) end - for _,v in ipairs(collectiblesToCheck) do - collectiblesOwned[v] = false - for i = 0, numPlayers - 1 do - if players[i]:HasCollectible(v) then - collectiblesOwned[v] = true - break - end - end - end - -- Birthright Book of Belial - collectiblesOwned[59] = false - for i = 0, numPlayers - 1 do - local playerType = players[i]:GetPlayerType() - if (playerType == PlayerType.PLAYER_JUDAS or playerType == PlayerType.PLAYER_BLACKJUDAS) and players[i]:HasCollectible(CollectibleType.COLLECTIBLE_BIRTHRIGHT) then - collectiblesOwned[59] = true - break - end - end - - end + CheckPlayersCollectibles() local callbacks = {}