6 files changed
+210
-151
No files matched your search
@@ -500,7 +500,7 @@ EID.descriptions[languageCode].collectibles={
|
||||
{"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"},
|
||||
{"481", "Dataminer", "When used, ↑/↓ small amount on random stat#Random tear effect for current room#Fucks up all sprites"},
|
||||
{"481", "Dataminer", "When used, ↑/↓ small amount on random stat#Random tear effect for current room#Corrupts all sprites and music for current room"},
|
||||
{"482", "Clicker", "Transforms you into a different character#Removes the last item you collected"},
|
||||
{"483", "Mama Mega!", "!!! SINGLE USE !!!#Affects whole floor#Explodes all objects#Deals 200 damage to all enemies#Opens the door to Boss Rush, Hush and all secret rooms#!!! If you have a Golden Bomb, consumes it on use instead of Mama Mega"},
|
||||
{"484", "Wait What?", "Upon use, pushes enemies away and spawn a wave of rocks#Can open rooms and break rocks"},
|
||||
|
||||
@@ -1012,8 +1012,8 @@ 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].VoidShopText = "If absorbed right after pickup, gain:"
|
||||
EID.descriptions[languageCode].VoidOptionText = " will be absorbed instead"
|
||||
|
||||
EID.descriptions[languageCode].spindownError = "Item disappears"
|
||||
|
||||
|
||||
+67
@@ -328,6 +328,8 @@ function EID:getDescriptionObj(Type, Variant, SubType, entity)
|
||||
if type(result) == "table" then
|
||||
for _,callback in ipairs(result) do
|
||||
description = callback(description)
|
||||
-- If the modifier loads a different description obj (which also goes through the modifier checks), we should stop our checks so text doesn't get printed twice
|
||||
if description.ObjSubType ~= SubType then break end
|
||||
end
|
||||
elseif result then
|
||||
description = modifier.callback(description)
|
||||
@@ -920,6 +922,71 @@ function EID:CheckGlitchedItemConfig(id)
|
||||
return attributes
|
||||
end
|
||||
|
||||
-- Void stat prediction helper functions (called from eid_modifiers when needed)
|
||||
-- Didn't seem right to put them in main or eid_modifiers
|
||||
local numVoidable = 0
|
||||
local numRunable = 0
|
||||
local function VoidRNGNext(num)
|
||||
num = num ~ ((num >> 5) & 4294967295)
|
||||
num = num ~ ((num << 9) & 4294967295)
|
||||
num = num ~ ((num >> 7) & 4294967295)
|
||||
return num >> 0;
|
||||
end
|
||||
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
|
||||
-- Count the number of absorbable pedestals in the room
|
||||
function EID:VoidRoomCheck()
|
||||
numVoidable = 0
|
||||
numRunable = 0
|
||||
EID.VoidOptionIndexes = {}
|
||||
for _, entity in ipairs(Isaac.FindByType(5, 100, -1, true, false)) do
|
||||
local pickup = entity:ToPickup()
|
||||
-- Count this pedestal if it's not an active (or this is Black Rune), not a shop item, and (in Repentance) the first of its option index
|
||||
-- TEST IF VOID ALWAYS ABSORBS THE FIRST OF ITS OPTION INDEX
|
||||
if entity.SubType > 0 and not pickup:IsShopItem() and
|
||||
(not REPENTANCE or pickup.OptionsPickupIndex == 0 or EID.VoidOptionIndexes[pickup.OptionsPickupIndex] == nil) then
|
||||
numRunable = numRunable + 1
|
||||
if REPENTANCE then EID.VoidOptionIndexes[pickup.OptionsPickupIndex] = entity.SubType end
|
||||
if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE) then numVoidable = numVoidable + 1 end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Determine what stats will be increased after 1 absorption, the whole room's absorption, and whole room + a purchased item above your head
|
||||
function EID:VoidRNGCheck(player, isRune)
|
||||
local increases = {0, 0, 0, 0, 0, 0}
|
||||
local shopItemIncreases = {}; local singleIncreases = {}
|
||||
|
||||
local startRNG = (isRune and player:GetCardRNG(Card.RUNE_BLACK):GetSeed()) or player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_VOID):GetSeed()
|
||||
local count = (isRune and numRunable) or numVoidable
|
||||
local eidTable = (isRune and EID.BlackRuneStatIncreases) or EID.VoidStatIncreases
|
||||
|
||||
-- in Repentance, an additional RNG call is done before the 5 for stat ups when using Void
|
||||
if REPENTANCE and not isRune then startRNG = VoidRNGNext(startRNG) end
|
||||
for i = 1, count do
|
||||
startRNG = GetTwoIncreases(startRNG, increases)
|
||||
if i == 1 then eidTable[3] = {table.unpack(increases)} end
|
||||
end
|
||||
eidTable[1] = {table.unpack(increases)}
|
||||
-- do an extra check for what you'd get if you Void with a shop item above your head
|
||||
GetTwoIncreases(startRNG, increases)
|
||||
eidTable[2] = {table.unpack(increases)}
|
||||
-- if there were no absorbable pedestals, the "single increase" stats are the same as the "one extra" stats
|
||||
if count == 0 then eidTable[3] = {table.unpack(increases)} end
|
||||
end
|
||||
|
||||
-- Converts a given CollectibleID into the respective Spindown dice result
|
||||
function EID:getSpindownResult(collectibleID)
|
||||
if collectibleID <= 0 or collectibleID > 4294960000 then return 0 end
|
||||
|
||||
+5
-10
@@ -830,21 +830,16 @@ function EID:handleBagOfCraftingRendering()
|
||||
--Display the result of the 8 items in our bag
|
||||
if (showCraftingResult or EID.Config["BagOfCraftingDisplayMode"] == "Preview Only") and #EID.BagItems >= 8 then
|
||||
local craftingResult, backupResult = EID:calculateBagOfCrafting(EID.BagItems)
|
||||
if Input.IsActionPressed(ButtonAction.ACTION_MAP, EID.player.ControllerIndex) then
|
||||
local descriptionObj = EID:getDescriptionObj(5, 100, backupResult)
|
||||
descriptionObj.Description = getHotkeyString() .. descriptionObj.Description
|
||||
EID:printDescription(descriptionObj)
|
||||
return true
|
||||
end
|
||||
if (backupResult ~= craftingResult) then EID.TabPreviewID = backupResult end
|
||||
local descriptionObj = EID:getDescriptionObj(5, 100, craftingResult)
|
||||
local infoText = EID:getDescriptionEntry("FlipItemToggleInfo")
|
||||
--prepend the Hide/Preview hotkeys to the description
|
||||
descriptionObj.Description = getHotkeyString() .. descriptionObj.Description
|
||||
local backupObjName = EID:getObjectName(5, 100, backupResult)
|
||||
if (backupResult ~= craftingResult) then
|
||||
if (backupResult ~= craftingResult and descriptionObj.ObjSubType == craftingResult) then
|
||||
local backupDesc = EID:getDescriptionEntry("CraftingPreviewBackup")
|
||||
local backupObjName = EID:getObjectName(5, 100, backupResult)
|
||||
local tabText = EID:getDescriptionEntry("FlipItemToggleInfo")
|
||||
EID:appendToDescription(descriptionObj,"#" .. backupDesc .. "#{{Collectible" .. backupResult .. "}} " ..
|
||||
backupObjName .. "#{{Blank}} " .. infoText)
|
||||
backupObjName .. "#{{Blank}} " .. tabText)
|
||||
end
|
||||
EID:printDescription(descriptionObj)
|
||||
return true
|
||||
|
||||
+121
-77
@@ -1,14 +1,23 @@
|
||||
local game = Game()
|
||||
|
||||
EID.TabPreviewID = 0
|
||||
-- Modifiers switching the previewed description can cause infinite loops or undesired text, use this to help prevent it
|
||||
local inPreview = false
|
||||
|
||||
-- Afterbirth+ modifiers
|
||||
local collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, }
|
||||
local maxSlot = 1
|
||||
-- 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
|
||||
if REPENTANCE then
|
||||
maxSlot = 3
|
||||
--include the AB+ collectiblesToCheck in this table!
|
||||
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, 59, --Birthright Belial
|
||||
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
|
||||
@@ -23,28 +32,16 @@ local function CheckPlayersCollectibles()
|
||||
collectiblesOwned[v] = false
|
||||
for i = 0, numPlayers - 1 do
|
||||
if players[i]:HasCollectible(v) then
|
||||
collectiblesOwned[v] = true
|
||||
collectiblesOwned[v] = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
blackRuneOwned = false
|
||||
for i = 0, numPlayers - 1 do
|
||||
for j = 0, 1 do
|
||||
for j = 0, maxSlot 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
|
||||
blackRuneOwned = i
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -52,53 +49,76 @@ local function CheckPlayersCollectibles()
|
||||
end
|
||||
end
|
||||
|
||||
local function TabCallback(descObj)
|
||||
if EID.TabPreviewID == 0 then return descObj end
|
||||
inPreview = true
|
||||
local descEntry = EID:getDescriptionObj(5, 100, EID.TabPreviewID)
|
||||
inPreview = false
|
||||
return descEntry
|
||||
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 lastVoidCheck = -30
|
||||
EID.VoidStatIncreases = {{},{},{}}
|
||||
EID.BlackRuneStatIncreases = {{},{},{}}
|
||||
EID.VoidOptionIndexes = {}
|
||||
|
||||
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
|
||||
local function VoidCallback(descObj, isRune)
|
||||
-- Recheck RNG periodically (picking up passive collectibles will change the Void results without any easy trigger to track)
|
||||
-- Do both Void and Rune here since they could both be requested in the same frame
|
||||
if EID.GameUpdateCount >= lastVoidCheck + 30 or EID.RecheckVoid then
|
||||
EID:VoidRoomCheck()
|
||||
if collectiblesOwned[477] then EID:VoidRNGCheck(Isaac.GetPlayer(collectiblesOwned[477]), false) end
|
||||
if blackRuneOwned then EID:VoidRNGCheck(Isaac.GetPlayer(blackRuneOwned), true) end
|
||||
lastVoidCheck = EID.GameUpdateCount
|
||||
EID.RecheckVoid = false
|
||||
end
|
||||
|
||||
local prefix = (isRune and "{{Card41}} ") or "{{Collectible477}} "
|
||||
local pickup = descObj.Entity and descObj.Entity:ToPickup()
|
||||
local isAltOption = false
|
||||
-- Test if this is an Option pedestal, Repentance only absorbs the lowest index one
|
||||
if REPENTANCE then
|
||||
local optionIndex = pickup and pickup.OptionsPickupIndex
|
||||
local firstOption = EID.VoidOptionIndexes[optionIndex]
|
||||
if (REPENTANCE and optionIndex and optionIndex ~= 0 and descObj.ObjSubType ~= firstOption) then
|
||||
EID:appendToDescription(descObj, "#" .. prefix .. "{{Collectible"..firstOption..
|
||||
"}}" .. EID:getObjectName(5, 100, firstOption) .. EID:getDescriptionEntry("VoidOptionText"))
|
||||
isAltOption = true
|
||||
end
|
||||
end
|
||||
-- Print Stat up info if Black Rune or non-active item
|
||||
if isRune or EID.itemConfig:GetCollectible(descObj.ObjSubType).Type ~= 3 then
|
||||
local shopItem = pickup and pickup:IsShopItem()
|
||||
-- Afterbirth+ really can't do anything with Void and a shop item, so just return
|
||||
if (not REPENTANCE and shopItem) then return descObj end
|
||||
|
||||
local voidIntro = ((shopItem or isAltOption) and EID:getDescriptionEntry("VoidShopText")) or EID:getDescriptionEntry("VoidText")
|
||||
local voidNames = EID:getDescriptionEntry("VoidNames")
|
||||
-- Replace "Tears" with "Fire Rate"
|
||||
if REPENTANCE then voidNames[2] = EID:getDescriptionEntry("GlitchedItemText", 1) end
|
||||
|
||||
local eidTable = (isRune and EID.BlackRuneStatIncreases) or EID.VoidStatIncreases
|
||||
local increases = ((inPreview or isAltOption) and eidTable[3]) or (shopItem and eidTable[2]) or eidTable[1]
|
||||
|
||||
EID:appendToDescription(descObj, "#" .. prefix .. voidIntro .. "#")
|
||||
for i,v in ipairs(increases) do
|
||||
if v > 0 then
|
||||
EID:appendToDescription(descObj, "{{Collectible477}} +" .. v*voidStatUps[i] .. " " .. voidNames[i] .. "#")
|
||||
EID:appendToDescription(descObj, prefix .. "+" .. string.format("%.4g",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
|
||||
-- Print unique synergies with Void and Active Items
|
||||
elseif not isRune then
|
||||
|
||||
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
|
||||
local function BlackRuneCallback(descObj)
|
||||
return VoidCallback(descObj, true)
|
||||
end
|
||||
EID:addDescriptionModifier("EID Afterbirth+", EIDConditionsAB, nil)
|
||||
|
||||
|
||||
if REPENTANCE then
|
||||
@@ -151,12 +171,14 @@ if REPENTANCE then
|
||||
return descObj
|
||||
end
|
||||
|
||||
local inSpindownPreview = false
|
||||
-- Handle Spindown Dice description addition
|
||||
local function SpindownDiceCallback(descObj)
|
||||
-- get the ID of the player that owns the Spindown Dice
|
||||
local playerID = (collectiblesOwned[723] or (EID.absorbedItems[723] and collectiblesOwned[477]))
|
||||
EID:appendToDescription(descObj, "#{{Collectible723}} :")
|
||||
local refID = descObj.ObjSubType
|
||||
local hasCarBattery = EID.player:HasCollectible(CollectibleType.COLLECTIBLE_CAR_BATTERY)
|
||||
local hasCarBattery = Isaac.GetPlayer(playerID):HasCollectible(CollectibleType.COLLECTIBLE_CAR_BATTERY)
|
||||
local firstID = 0
|
||||
for i = 1,EID.Config["SpindownDiceResults"] do
|
||||
local spinnedID = EID:getSpindownResult(refID)
|
||||
if hasCarBattery then
|
||||
@@ -165,12 +187,7 @@ 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
|
||||
if i == 1 then firstID = refID end
|
||||
EID:appendToDescription(descObj, "{{Collectible"..refID.."}}")
|
||||
if EID.itemUnlockStates[refID] == false then EID:appendToDescription(descObj, "?") end
|
||||
if i ~= EID.Config["SpindownDiceResults"] then
|
||||
@@ -185,7 +202,10 @@ if REPENTANCE then
|
||||
if hasCarBattery then
|
||||
EID:appendToDescription(descObj, " (Results with {{Collectible356}})")
|
||||
end
|
||||
EID:appendToDescription(descObj, "#{{Blank}} ".. EID:getDescriptionEntry("FlipItemToggleInfo"))
|
||||
if firstID ~= 0 and EID.TabPreviewID == 0 then
|
||||
EID.TabPreviewID = firstID
|
||||
EID:appendToDescription(descObj, "#{{Blank}} ".. EID:getDescriptionEntry("FlipItemToggleInfo"))
|
||||
end
|
||||
return descObj
|
||||
end
|
||||
|
||||
@@ -353,23 +373,24 @@ if REPENTANCE then
|
||||
-- Handle Flip description addition
|
||||
local function FlipCallback(descObj)
|
||||
local flipItemID = EID:getEntityData(descObj.Entity, "EID_FlipItemID")
|
||||
if flipItemID <= 0 then return descObj end
|
||||
if descObj.ObjSubType == 0 or Input.IsActionPressed(ButtonAction.ACTION_MAP, EID.player.ControllerIndex) then
|
||||
local descEntry = EID:getDescriptionObj(5, 100, flipItemID)
|
||||
return descEntry
|
||||
if not flipItemID or flipItemID <= 0 then return descObj end
|
||||
-- Empty pedestal
|
||||
if descObj.ObjSubType == 0 then
|
||||
return EID:getDescriptionObj(5, 100, flipItemID)
|
||||
end
|
||||
|
||||
|
||||
local infoText = EID:getDescriptionEntry("FlipItemToggleInfo")
|
||||
if flipItemID ~= nil or infoText ~= nil then
|
||||
local itemName = EID:getObjectName(5, 100, flipItemID)
|
||||
local appendText = "#{{Collectible711}} -> {{Collectible"..flipItemID.."}} "..itemName
|
||||
local itemName = EID:getObjectName(5, 100, flipItemID)
|
||||
local appendText = "#{{Collectible711}} -> {{Collectible"..flipItemID.."}} "..itemName
|
||||
if EID.TabPreviewID == 0 then
|
||||
EID.TabPreviewID = flipItemID
|
||||
appendText = appendText .. "#{{Blank}} "..infoText
|
||||
EID:appendToDescription(descObj, appendText)
|
||||
end
|
||||
EID:appendToDescription(descObj, appendText)
|
||||
|
||||
return descObj
|
||||
end
|
||||
|
||||
|
||||
--------------------------------
|
||||
-- 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
|
||||
@@ -393,10 +414,13 @@ if REPENTANCE then
|
||||
if collectiblesOwned[664] then table.insert(callbacks, BingeEaterCallback) end
|
||||
if collectiblesOwned[59] then table.insert(callbacks, BookOfBelialCallback) end
|
||||
if collectiblesOwned[584] then table.insert(callbacks, BookOfVirtuesCallback) end
|
||||
if collectiblesOwned[706] then table.insert(callbacks, AbyssCallback) end
|
||||
if collectiblesOwned[706] or (EID.absorbedItems[706] and collectiblesOwned[477]) then table.insert(callbacks, AbyssCallback) 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
|
||||
if collectiblesOwned[723] or (EID.absorbedItems[723] and collectiblesOwned[477]) then table.insert(callbacks, SpindownDiceCallback) end
|
||||
-- currently, only Repentance collectible modifiers have Tab previews so put it here
|
||||
if Input.IsActionPressed(ButtonAction.ACTION_MAP, EID.player.ControllerIndex) and not inPreview then table.insert(callbacks, TabCallback) end
|
||||
|
||||
-- Card / Rune Callbacks
|
||||
elseif descObj.ObjVariant == PickupVariant.PICKUP_TAROTCARD then
|
||||
if collectiblesOwned[451] then table.insert(callbacks, TarotClothCallback) end
|
||||
@@ -421,3 +445,23 @@ if REPENTANCE then
|
||||
EID:addDescriptionModifier("EID Repentance", EIDConditions, nil)
|
||||
|
||||
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)
|
||||
@@ -28,7 +28,7 @@ EID.sacrificeCounter = {}
|
||||
EID.itemConfig = Isaac.GetItemConfig()
|
||||
EID.itemUnlockStates = {}
|
||||
EID.CraneItemType = {}
|
||||
EID.absorbedSpindown = false
|
||||
EID.absorbedItems = {}
|
||||
local pathsChecked = {}
|
||||
local altPathItemChecked = {}
|
||||
|
||||
@@ -362,13 +362,13 @@ if REPENTANCE then
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, EID.CheckFlipGridIndexes, CollectibleType.COLLECTIBLE_FLIP)
|
||||
|
||||
-- Watch for a Void absorbing a Spindown Dice
|
||||
-- Watch for a Void absorbing active items
|
||||
-- (Note: Doesn't differentiate between different players if both players have Void...)
|
||||
function EID:CheckVoidAbsorbs(collectibleType)
|
||||
local pedestals = Isaac.FindByType(5, 100, -1, true, false)
|
||||
for _, pedestal in ipairs(pedestals) do
|
||||
if pedestal.SubType == CollectibleType.COLLECTIBLE_SPINDOWN_DICE then
|
||||
EID.absorbedSpindown = true
|
||||
return
|
||||
if pedestal.SubType > 0 and EID.itemConfig:GetCollectible(pedestal.SubType).Type == 3 then
|
||||
EID.absorbedItems[pedestal.SubType] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -818,46 +818,16 @@ 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
|
||||
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
|
||||
EID.RecheckVoid = false
|
||||
|
||||
function EID:onGameUpdate()
|
||||
EID.GameUpdateCount = EID.GameUpdateCount + 1
|
||||
|
||||
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
|
||||
@@ -869,25 +839,7 @@ function EID:onGameUpdate()
|
||||
table.insert(curPositions, {entity, entity.Position})
|
||||
end
|
||||
|
||||
-- Recalculate our total Void stat-ups if a collectible spawned this frame
|
||||
-- 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()
|
||||
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
|
||||
EID.VoidStatIncreases = increases
|
||||
EID.BlackRuneStatIncreases = runeIncreases
|
||||
end
|
||||
EID.RecheckVoid = true
|
||||
end
|
||||
|
||||
-- Remove Crane Game item data if it's giving the prize out
|
||||
@@ -903,7 +855,7 @@ function EID:onGameUpdate()
|
||||
end
|
||||
EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate)
|
||||
|
||||
-- Wait until all collectibles spawning this frame have spawned before checking if there's an overlap
|
||||
-- Wait until all collectibles spawning this frame have spawned before checking what we need to check about them
|
||||
function EID:CollectibleSpawnedThisFrame(entity)
|
||||
collSpawned = true
|
||||
end
|
||||
@@ -995,6 +947,7 @@ local function onRender(t)
|
||||
|
||||
EID.isDisplaying = false
|
||||
EID:setPlayer()
|
||||
EID.TabPreviewID = 0
|
||||
|
||||
if Input.IsButtonTriggered(EID.Config["HideKey"], 0) or Input.IsButtonTriggered(EID.Config["HideButton"], EID.player.ControllerIndex) then
|
||||
EID.isHidden = not EID.isHidden
|
||||
@@ -1260,7 +1213,7 @@ if EID.MCMLoaded or REPENTANCE then
|
||||
["BagFloorContent"] = true,
|
||||
["CraneItemType"] = true,
|
||||
["FlipItemPositions"] = true,
|
||||
["AbsorbedSpindownDice"] = true,
|
||||
["AbsorbedItems"] = true,
|
||||
}
|
||||
|
||||
if EID:HasData() then
|
||||
@@ -1269,13 +1222,13 @@ if EID.MCMLoaded or REPENTANCE then
|
||||
EID.BagItems = {}
|
||||
EID.CraneItemType = {}
|
||||
EID.flipItemPositions = {}
|
||||
EID.absorbedSpindown = false
|
||||
EID.absorbedItems = {}
|
||||
|
||||
if isSave then
|
||||
EID.BagItems = savedEIDConfig["BagContent"] or {}
|
||||
EID.bagOfCraftingRoomQueries = savedEIDConfig["BagFloorContent"] or {}
|
||||
EID.CraneItemType = savedEIDConfig["CraneItemType"] or {}
|
||||
EID.absorbedSpindown = savedEIDConfig["AbsorbedSpindownDice"] or false
|
||||
EID.absorbedItems = savedEIDConfig["AbsorbedItems"] or {}
|
||||
|
||||
-- turn list back into dict because json cant save dict indices.
|
||||
local flipItemTable = {}
|
||||
@@ -1337,7 +1290,7 @@ if EID.MCMLoaded or REPENTANCE then
|
||||
EID.Config["BagContent"] = EID.BagItems or {}
|
||||
EID.Config["BagFloorContent"] = EID.bagOfCraftingRoomQueries or {}
|
||||
EID.Config["CraneItemType"] = EID.CraneItemType or {}
|
||||
EID.Config["AbsorbedSpindownDice"] = EID.absorbedSpindown or false
|
||||
EID.Config["AbsorbedItems"] = EID.absorbedItems or {}
|
||||
|
||||
-- turn dictionary into list because json cant save dict indices.
|
||||
local flipItemTable = {}
|
||||
|
||||
Reference in new issue
Block a user