Replaced usages of REPENTANCE variable with own repentance detector variable

This commit is contained in:
Wofsauge committed 2023-02-20 21:19:43 +01:00
1 parent bcc5d0e3f7
commit 26919faef7
7 files changed
+95 -103

No files matched your search

+12 -12
View File
@@ -165,7 +165,7 @@ end
-- Try to automatically assign vanilla transformations to the entity -- Try to automatically assign vanilla transformations to the entity
function EID:tryAutodetectTransformationsCollectible(collectibleID) function EID:tryAutodetectTransformationsCollectible(collectibleID)
if not REPENTANCE then return end if not EID.isRepentance then return end
local config = EID.itemConfig:GetCollectible(collectibleID) local config = EID.itemConfig:GetCollectible(collectibleID)
local transformations = {} local transformations = {}
transformations[EID.TRANSFORMATION.ANGEL] = config:HasTags(ItemConfig.TAG_ANGEL) or nil transformations[EID.TRANSFORMATION.ANGEL] = config:HasTags(ItemConfig.TAG_ANGEL) or nil
@@ -465,7 +465,7 @@ function EID:getObjectItemTypeAndCharge(descObj)
descObj.ChargeType = itemConfig.ChargeType or 0 descObj.ChargeType = itemConfig.ChargeType or 0
descObj.Charges = itemConfig.MaxCharges or 0 descObj.Charges = itemConfig.MaxCharges or 0
-- Special handling for dynamic charge items -- Special handling for dynamic charge items
if REPENTANCE and (descObj.ObjSubType == CollectibleType.COLLECTIBLE_BLANK_CARD or descObj.ObjSubType == CollectibleType.COLLECTIBLE_PLACEBO or if EID.isRepentance and (descObj.ObjSubType == CollectibleType.COLLECTIBLE_BLANK_CARD or descObj.ObjSubType == CollectibleType.COLLECTIBLE_PLACEBO or
descObj.ObjSubType == CollectibleType.COLLECTIBLE_CLEAR_RUNE or descObj.ObjSubType == CollectibleType.COLLECTIBLE_D_INFINITY) then descObj.ObjSubType == CollectibleType.COLLECTIBLE_CLEAR_RUNE or descObj.ObjSubType == CollectibleType.COLLECTIBLE_D_INFINITY) then
descObj.ChargeType = ItemConfig.CHARGE_SPECIAL descObj.ChargeType = ItemConfig.CHARGE_SPECIAL
end end
@@ -508,7 +508,7 @@ end
function EID:getAdjustedSubtype(Type, Variant, SubType) function EID:getAdjustedSubtype(Type, Variant, SubType)
local tableName = EID:getTableName(Type, Variant, SubType) local tableName = EID:getTableName(Type, Variant, SubType)
if tableName == "trinkets" then if tableName == "trinkets" then
if REPENTANCE then if EID.isRepentance then
return (SubType & TrinketType.TRINKET_ID_MASK) return (SubType & TrinketType.TRINKET_ID_MASK)
end end
elseif tableName == "sacrifice" then elseif tableName == "sacrifice" then
@@ -517,11 +517,11 @@ function EID:getAdjustedSubtype(Type, Variant, SubType)
-- The effect of a pill varies depending on what player is looking at it in co-op -- The effect of a pill varies depending on what player is looking at it in co-op
-- EID.pillPlayer is a way to recheck a pill for what different players will turn it into -- EID.pillPlayer is a way to recheck a pill for what different players will turn it into
local player = EID.pillPlayer or EID.player local player = EID.pillPlayer or EID.player
if REPENTANCE and SubType % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then if EID.isRepentance and SubType % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then
return 9999 return 9999
end end
local pool = game:GetItemPool() local pool = game:GetItemPool()
if REPENTANCE and player:GetPlayerType() == PlayerType.PLAYER_THESOUL_B then if EID.isRepentance and player:GetPlayerType() == PlayerType.PLAYER_THESOUL_B then
SubType = pool:GetPillEffect(SubType, player:GetOtherTwin() or player) + 1 SubType = pool:GetPillEffect(SubType, player:GetOtherTwin() or player) + 1
else SubType = pool:GetPillEffect(SubType, player) + 1 end else SubType = pool:GetPillEffect(SubType, player) + 1 end
end end
@@ -672,9 +672,9 @@ function EID:hasDescription(entity)
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EID.Config["DisplayPillInfo"]) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EID.Config["DisplayPillInfo"])
return isAllowed and (entity.SubType > 0 or return isAllowed and (entity.SubType > 0 or
-- For Flip descriptions, allow 5.100.0 pedestals to have descriptions under VERY specific criteria! -- For Flip descriptions, allow 5.100.0 pedestals to have descriptions under VERY specific criteria!
(REPENTANCE and EID:getEntityData(entity, "EID_FlipItemID") and EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_FLIP))) (EID.isRepentance and EID:getEntityData(entity, "EID_FlipItemID") and EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_FLIP)))
end end
if entity.Type == 6 and entity.Variant == 16 and EID.Config["DisplayCraneInfo"] and REPENTANCE then if entity.Type == 6 and entity.Variant == 16 and EID.Config["DisplayCraneInfo"] and EID.isRepentance then
isAllowed = not entity:GetSprite():IsPlaying("Broken") and not entity:GetSprite():IsPlaying("Prize") and not entity:GetSprite():IsPlaying("OutOfPrizes") and (EID.CraneItemType[entity.InitSeed.."Drop"..entity.DropSeed] or EID.CraneItemType[tostring(entity.InitSeed)]) isAllowed = not entity:GetSprite():IsPlaying("Broken") and not entity:GetSprite():IsPlaying("Prize") and not entity:GetSprite():IsPlaying("OutOfPrizes") and (EID.CraneItemType[entity.InitSeed.."Drop"..entity.DropSeed] or EID.CraneItemType[tostring(entity.InitSeed)])
end end
if entity.Type == 1000 then if entity.Type == 1000 then
@@ -1414,7 +1414,7 @@ function EID:handleHUDElement(hudElement)
end end
local screenSize = EID:getScreenSize() local screenSize = EID:getScreenSize()
local hudOffset = EID.Config["HUDOffset"] local hudOffset = EID.Config["HUDOffset"]
if REPENTANCE then if EID.isRepentance then
hudOffset = (Options.HUDOffset * 10) hudOffset = (Options.HUDOffset * 10)
end end
for _,v in ipairs(hudElement.anchors) do for _,v in ipairs(hudElement.anchors) do
@@ -1826,7 +1826,7 @@ end
-- Returns the quality of the described entity -- Returns the quality of the described entity
function EID:getObjectQuality(descObj) function EID:getObjectQuality(descObj)
if REPENTANCE and descObj.ObjType == 5 and descObj.ObjVariant == 100 and EID.itemConfig:GetCollectible(tonumber(descObj.ObjSubType)) then if EID.isRepentance and descObj.ObjType == 5 and descObj.ObjVariant == 100 and EID.itemConfig:GetCollectible(tonumber(descObj.ObjSubType)) then
return tonumber(EID.itemConfig:GetCollectible(tonumber(descObj.ObjSubType)).Quality) return tonumber(EID.itemConfig:GetCollectible(tonumber(descObj.ObjSubType)).Quality)
end end
end end
@@ -1868,7 +1868,7 @@ end
-- Add pickup usage to history of pickups used by the player -- Add pickup usage to history of pickups used by the player
function EID:AddPickupToHistory(pickupType, effectID, player, useFlags, pillColorID) function EID:AddPickupToHistory(pickupType, effectID, player, useFlags, pillColorID)
-- don't add mimiced or noannouncer cards/pills to history -- don't add mimiced or noannouncer cards/pills to history
if REPENTANCE and (useFlags & UseFlag.USE_MIMIC == UseFlag.USE_MIMIC or useFlags & UseFlag.USE_NOANNOUNCER == UseFlag.USE_NOANNOUNCER) then return end if EID.isRepentance and (useFlags & UseFlag.USE_MIMIC == UseFlag.USE_MIMIC or useFlags & UseFlag.USE_NOANNOUNCER == UseFlag.USE_NOANNOUNCER) then return end
local playerID = EID:getPlayerID(player) local playerID = EID:getPlayerID(player)
EID:InitItemInteractionIfAbsent(playerID) EID:InitItemInteractionIfAbsent(playerID)
@@ -1879,7 +1879,7 @@ function EID:AddPickupToHistory(pickupType, effectID, player, useFlags, pillColo
end end
-- pickupType = ["pill","card"], pillColorID, effectID, hadEchoChamberWhenUsed -- pickupType = ["pill","card"], pillColorID, effectID, hadEchoChamberWhenUsed
table.insert(historyTable, 1, {pickupType, pillColorID, effectID, REPENTANCE and player:HasCollectible(700)}) table.insert(historyTable, 1, {pickupType, pillColorID, effectID, EID.isRepentance and player:HasCollectible(700)})
end end
-- Render a sprite of an entity -- Render a sprite of an entity
@@ -1895,7 +1895,7 @@ end
-- Tries to get the Vanilla transformations of modded items based on Tags -- Tries to get the Vanilla transformations of modded items based on Tags
function EID:GetTransformationsOfModdedItems() function EID:GetTransformationsOfModdedItems()
if not REPENTANCE then return end if not EID.isRepentance then return end
local numCollectibles = EID:GetMaxCollectibleID() local numCollectibles = EID:GetMaxCollectibleID()
for i = 733, numCollectibles, 1 do for i = 733, numCollectibles, 1 do
EID:tryAutodetectTransformationsCollectible(i) EID:tryAutodetectTransformationsCollectible(i)
+11 -11
View File
@@ -30,7 +30,7 @@ EID.GridEntityWhitelist = {
EID.Config["DisplaySacrificeInfo"] EID.Config["DisplaySacrificeInfo"]
end, end,
function(gridEntity) function(gridEntity)
return REPENTANCE and EID.Config["DisplaySanguineInfo"] and return EID.isRepentance and EID.Config["DisplaySanguineInfo"] and
Game():GetRoom():GetType() == RoomType.ROOM_DEVIL and Game():GetRoom():GetType() == RoomType.ROOM_DEVIL and
EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_SANGUINE_BOND) EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_SANGUINE_BOND)
end, end,
@@ -591,15 +591,15 @@ EID.InlineIcons = {
} }
-- General Stats (Adjust automatically according to the current DLC) -- General Stats (Adjust automatically according to the current DLC)
EID.InlineIcons["Damage"] = REPENTANCE and EID.InlineIcons["DamageREP"] or EID.InlineIcons["DamageAB"] EID.InlineIcons["Damage"] = EID.isRepentance and EID.InlineIcons["DamageREP"] or EID.InlineIcons["DamageAB"]
EID.InlineIcons["Speed"] = REPENTANCE and EID.InlineIcons["SpeedREP"] or EID.InlineIcons["SpeedAB"] EID.InlineIcons["Speed"] = EID.isRepentance and EID.InlineIcons["SpeedREP"] or EID.InlineIcons["SpeedAB"]
EID.InlineIcons["Tears"] = REPENTANCE and EID.InlineIcons["TearsREP"] or EID.InlineIcons["TearsAB"] EID.InlineIcons["Tears"] = EID.isRepentance and EID.InlineIcons["TearsREP"] or EID.InlineIcons["TearsAB"]
EID.InlineIcons["Range"] = REPENTANCE and EID.InlineIcons["RangeREP"] or EID.InlineIcons["RangeAB"] EID.InlineIcons["Range"] = EID.isRepentance and EID.InlineIcons["RangeREP"] or EID.InlineIcons["RangeAB"]
EID.InlineIcons["Shotspeed"] = REPENTANCE and EID.InlineIcons["ShotspeedREP"] or EID.InlineIcons["ShotspeedAB"] EID.InlineIcons["Shotspeed"] = EID.isRepentance and EID.InlineIcons["ShotspeedREP"] or EID.InlineIcons["ShotspeedAB"]
EID.InlineIcons["Luck"] = REPENTANCE and EID.InlineIcons["LuckREP"] or EID.InlineIcons["LuckAB"] EID.InlineIcons["Luck"] = EID.isRepentance and EID.InlineIcons["LuckREP"] or EID.InlineIcons["LuckAB"]
EID.InlineIcons["AngelChance"] = REPENTANCE and EID.InlineIcons["AngelChanceREP"] or EID.InlineIcons["AngelChanceAB"] EID.InlineIcons["AngelChance"] = EID.isRepentance and EID.InlineIcons["AngelChanceREP"] or EID.InlineIcons["AngelChanceAB"]
EID.InlineIcons["DevilChance"] = REPENTANCE and EID.InlineIcons["DevilChanceREP"] or EID.InlineIcons["DevilChanceAB"] EID.InlineIcons["DevilChance"] = EID.isRepentance and EID.InlineIcons["DevilChanceREP"] or EID.InlineIcons["DevilChanceAB"]
EID.InlineIcons["Tearsize"] = REPENTANCE and EID.InlineIcons["TearsizeREP"] or EID.InlineIcons["TearsizeAB"] EID.InlineIcons["Tearsize"] = EID.isRepentance and EID.InlineIcons["TearsizeREP"] or EID.InlineIcons["TearsizeAB"]
@@ -841,7 +841,7 @@ EID.TransformationData = {
[tostring(EID.TRANSFORMATION.ADULT)] = {VanillaForm = PlayerForm.PLAYERFORM_ADULTHOOD}, [tostring(EID.TRANSFORMATION.ADULT)] = {VanillaForm = PlayerForm.PLAYERFORM_ADULTHOOD},
[tostring(EID.TRANSFORMATION.SPIDERBABY)] = {VanillaForm = PlayerForm.PLAYERFORM_SPIDERBABY}, [tostring(EID.TRANSFORMATION.SPIDERBABY)] = {VanillaForm = PlayerForm.PLAYERFORM_SPIDERBABY},
[tostring(EID.TRANSFORMATION.SUPERBUM)] = {}, [tostring(EID.TRANSFORMATION.SUPERBUM)] = {},
[tostring(EID.TRANSFORMATION.STOMPY)] = {VanillaForm = REPENTANCE and PlayerForm.PLAYERFORM_STOMPY} [tostring(EID.TRANSFORMATION.STOMPY)] = {VanillaForm = EID.isRepentance and PlayerForm.PLAYERFORM_STOMPY}
} }
+13 -13
View File
@@ -52,7 +52,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
-- pandora's box? it shows the whole desc which is kinda useful but too big -- pandora's box? it shows the whole desc which is kinda useful but too big
-- Tainted ??? Poop Descriptions -- Tainted ??? Poop Descriptions
if REPENTANCE and EID.Config["ItemReminderShowPoopDesc"] > 0 and player:GetPlayerType() == 25 then if EID.isRepentance and EID.Config["ItemReminderShowPoopDesc"] > 0 and player:GetPlayerType() == 25 then
for i = 0, EID.Config["ItemReminderShowPoopDesc"]-1 do for i = 0, EID.Config["ItemReminderShowPoopDesc"]-1 do
local poopInfo = EID:getDescriptionEntry("poopSpells") local poopInfo = EID:getDescriptionEntry("poopSpells")
local nextPoop = player:GetPoopSpell(i) local nextPoop = player:GetPoopSpell(i)
@@ -75,7 +75,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
end end
-- Echo Chamber Description -- Echo Chamber Description
if REPENTANCE and player:HasCollectible(700) then if EID.isRepentance and player:HasCollectible(700) then
local playerID = EID:getPlayerID(player) local playerID = EID:getPlayerID(player)
local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory
-- Dead Tainted Lazarus exception -- Dead Tainted Lazarus exception
@@ -102,7 +102,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
end end
-- Bag of Crafting -- Bag of Crafting
if REPENTANCE and player:HasCollectible(710) then if EID.isRepentance and player:HasCollectible(710) then
local floorQuery = EID.BoC.FloorOverride or EID.BoC.FloorQuery local floorQuery = EID.BoC.FloorOverride or EID.BoC.FloorQuery
local inventoryQuery= EID.BoC.InventoryOverride or EID.BoC.InventoryQuery local inventoryQuery= EID.BoC.InventoryOverride or EID.BoC.InventoryQuery
local bagItems = EID.BoC.BagItemsOverride or EID.BoC.BagItems local bagItems = EID.BoC.BagItemsOverride or EID.BoC.BagItems
@@ -127,7 +127,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
elseif heldActive == 44 and EID.Config["ItemReminderShowRNGCheats"] then elseif heldActive == 44 and EID.Config["ItemReminderShowRNGCheats"] then
blacklist["5.100.44"] = true blacklist["5.100.44"] = true
-- The result preview changes as soon as we activate Teleport, which looks awkward, so try to not display the result while mid-teleport. Doesn't work perfectly and only in Rep -- The result preview changes as soon as we activate Teleport, which looks awkward, so try to not display the result while mid-teleport. Doesn't work perfectly and only in Rep
if not REPENTANCE or player:GetSprite():GetAnimation() ~= "TeleportUp" then if not EID.isRepentance or player:GetSprite():GetAnimation() ~= "TeleportUp" then
append("{{Collectible44}}", EID:getObjectName(5,100,44) .. EID:getDescriptionEntry("HoldMapHeader"), EID:Teleport1Prediction(getSeed(44))) append("{{Collectible44}}", EID:getObjectName(5,100,44) .. EID:getDescriptionEntry("HoldMapHeader"), EID:Teleport1Prediction(getSeed(44)))
end end
-- Teleport 2.0 location -- Teleport 2.0 location
@@ -180,9 +180,9 @@ function EID:getHoldMapDescription(player, checkingTwin)
if EID.Config["ItemReminderShowPocketDesc"] > 0 then if EID.Config["ItemReminderShowPocketDesc"] > 0 then
-- I don't think we can actually know what slot the player is on, so, save these to display (if they exist) for when Card and Pill in a slot are both 0, to attempt to always show them in slot order -- I don't think we can actually know what slot the player is on, so, save these to display (if they exist) for when Card and Pill in a slot are both 0, to attempt to always show them in slot order
local dicePrinted = false local dicePrinted = false
local diceBag = REPENTANCE and player:GetActiveItem(3) or 0 local diceBag = EID.isRepentance and player:GetActiveItem(3) or 0
local pocketPrinted = false local pocketPrinted = false
local pocketActive = REPENTANCE and player:GetActiveItem(2) or 0 local pocketActive = EID.isRepentance and player:GetActiveItem(2) or 0
for i = 0, EID.Config["ItemReminderShowPocketDesc"]-1 do for i = 0, EID.Config["ItemReminderShowPocketDesc"]-1 do
local heldCard = player:GetCard(i) local heldCard = player:GetCard(i)
local heldPill = player:GetPill(i) local heldPill = player:GetPill(i)
@@ -192,7 +192,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
-- Check if our held pill is identified -- Check if our held pill is identified
EID.pillPlayer = player EID.pillPlayer = player
local identified = game:GetItemPool():IsPillIdentified(heldPill) local identified = game:GetItemPool():IsPillIdentified(heldPill)
if REPENTANCE and heldPill % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end if EID.isRepentance and heldPill % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end
if (identified or EID.Config["ShowUnidentifiedPillDescriptions"]) then if (identified or EID.Config["ShowUnidentifiedPillDescriptions"]) then
addObjectDesc(5, 70, heldPill) addObjectDesc(5, 70, heldPill)
end end
@@ -214,7 +214,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
-- account for Golden Trinket IDs -- account for Golden Trinket IDs
local heldTrinketTrue = player:GetTrinket(t) local heldTrinketTrue = player:GetTrinket(t)
local heldTrinket = heldTrinketTrue local heldTrinket = heldTrinketTrue
if REPENTANCE then heldTrinket = heldTrinketTrue & TrinketType.TRINKET_ID_MASK end if EID.isRepentance then heldTrinket = heldTrinketTrue & TrinketType.TRINKET_ID_MASK end
if heldTrinket > 0 and not blacklist["5.350." .. heldTrinket] then if heldTrinket > 0 and not blacklist["5.350." .. heldTrinket] then
if heldTrinket == 4 then if heldTrinket == 4 then
-- Broken Remote has two possible effects depending on if its doubled -- Broken Remote has two possible effects depending on if its doubled
@@ -225,19 +225,19 @@ function EID:getHoldMapDescription(player, checkingTwin)
elseif EID.Config["ItemReminderShowRNGCheats"] then elseif EID.Config["ItemReminderShowRNGCheats"] then
-- Teleport (requires cheating option on) -- Teleport (requires cheating option on)
blacklist["5.350.4"] = true blacklist["5.350.4"] = true
if not REPENTANCE or player:GetSprite():GetAnimation() ~= "TeleportUp" then if not EID.isRepentance or player:GetSprite():GetAnimation() ~= "TeleportUp" then
append("{{Trinket4}}", EID:getObjectName(5,350,4) .. EID:getDescriptionEntry("HoldMapHeader"), EID:Teleport1Prediction(getSeed(44))) append("{{Trinket4}}", EID:getObjectName(5,350,4) .. EID:getDescriptionEntry("HoldMapHeader"), EID:Teleport1Prediction(getSeed(44)))
end end
end end
-- Rainbow Worm -- Rainbow Worm
elseif EID.Config["ItemReminderShowHiddenInfo"] and heldTrinket == 64 then elseif EID.Config["ItemReminderShowHiddenInfo"] and heldTrinket == 64 then
blacklist["5.350.64"] = true blacklist["5.350.64"] = true
local rainbowWormEffect = rainbowWormEffects[math.floor(game.TimeCounter / 30 / 3) % (REPENTANCE and 10 or 8)] local rainbowWormEffect = rainbowWormEffects[math.floor(game.TimeCounter / 30 / 3) % (EID.isRepentance and 10 or 8)]
addObjectDesc(5, 350, rainbowWormEffect, "{{Trinket64}}") addObjectDesc(5, 350, rainbowWormEffect, "{{Trinket64}}")
-- 404 Error -- 404 Error
-- 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 -- 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
-- And unfortunately, HasTrinket can't differentiate between real and fake trinkets in AB+ -- And unfortunately, HasTrinket can't differentiate between real and fake trinkets in AB+
elseif EID.Config["ItemReminderShowHiddenInfo"] and REPENTANCE and heldTrinket == 75 then elseif EID.Config["ItemReminderShowHiddenInfo"] and EID.isRepentance and heldTrinket == 75 then
blacklist["5.350.75"] = true blacklist["5.350.75"] = true
-- Don't display Mysterious Paper's 1-frame temporary trinket granting -- Don't display Mysterious Paper's 1-frame temporary trinket granting
local hasPaper = player:HasTrinket(21) local hasPaper = player:HasTrinket(21)
@@ -264,7 +264,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
end end
-- Gulped/unslotted Modeling Clay -- Gulped/unslotted Modeling Clay
-- (Hidden information, because Modeling Clay does not visually show its item when gulped) -- (Hidden information, because Modeling Clay does not visually show its item when gulped)
if REPENTANCE and EID.Config["ItemReminderShowHiddenInfo"] and not blacklist["5.350.166"] and player:GetModelingClayEffect() > 0 then if EID.isRepentance and EID.Config["ItemReminderShowHiddenInfo"] and not blacklist["5.350.166"] and player:GetModelingClayEffect() > 0 then
local modelingClayItem = player:GetModelingClayEffect() local modelingClayItem = player:GetModelingClayEffect()
if modelingClayItem > 0 then if modelingClayItem > 0 then
addObjectDesc(5, 100, modelingClayItem, "{{Trinket166}}") addObjectDesc(5, 100, modelingClayItem, "{{Trinket166}}")
@@ -284,7 +284,7 @@ function EID:getHoldMapDescription(player, checkingTwin)
-- Finally, check the twin player of this controller -- Finally, check the twin player of this controller
-- If both twins have a desc, show their player icon / name to separate the two descs -- If both twins have a desc, show their player icon / name to separate the two descs
if REPENTANCE and not checkingTwin then if EID.isRepentance and not checkingTwin then
local twin = player:GetOtherTwin() local twin = player:GetOtherTwin()
local mainTwinDesc = holdMapDesc local mainTwinDesc = holdMapDesc
local otherTwinDesc = "" local otherTwinDesc = ""
+14 -14
View File
@@ -20,11 +20,11 @@ end
-- D Infinity -- -- D Infinity --
local dinfinityList = { [0] = 105, 166, 284, 283, 285, 406, 386 } local dinfinityList = { [0] = 105, 166, 284, 283, 285, 406, 386 }
-- Repentance's D Infinity order: D1, D4, D6, Eternal D6, D7, D8, D10, D12, D20, D100 -- Repentance's D Infinity order: D1, D4, D6, Eternal D6, D7, D8, D10, D12, D20, D100
if REPENTANCE then dinfinityList = { [0] = 476, 284, 105, 609, 437, 406, 285, 386, 166, 283 } end if EID.isRepentance then dinfinityList = { [0] = 476, 284, 105, 609, 437, 406, 285, 386, 166, 283 } end
-- Returns the item ID of D Infinity's current die -- Returns the item ID of D Infinity's current die
-- For Repentance, the Drop button is tracked, which is probably not 100% successful, and handled elsewhere -- For Repentance, the Drop button is tracked, which is probably not 100% successful, and handled elsewhere
function EID:CurrentDInfinity(rng, player) function EID:CurrentDInfinity(rng, player)
if not REPENTANCE then if not EID.isRepentance then
rng = EID:RNGNext(rng, 0x1, 0x9, 0x1D) -- magic disassembled numbers! rng = EID:RNGNext(rng, 0x1, 0x9, 0x1D) -- magic disassembled numbers!
return dinfinityList[rng % 7] return dinfinityList[rng % 7]
else else
@@ -33,7 +33,7 @@ function EID:CurrentDInfinity(rng, player)
end end
end end
local justDidD = false local justDidD = false
if REPENTANCE then if EID.isRepentance then
-- To help with Rep tracking, watch for D Infinity to get used and resync its current dice -- To help with Rep tracking, watch for D Infinity to get used and resync its current dice
function EID:WatchForDInfinity() function EID:WatchForDInfinity()
justDidD = true justDidD = true
@@ -55,13 +55,13 @@ end
-- Reduced chance: Death Certificate (15%), Genesis (25%) -- Reduced chance: Death Certificate (15%), Genesis (25%)
-- I saw something in the code about rerolling Forget Me Now but not sure what the criteria was -- I saw something in the code about rerolling Forget Me Now but not sure what the criteria was
local metronomeBlacklist = {[488] = 1, [475] = 1, [422] = 1} --AB+ can choose Clicker lol rip local metronomeBlacklist = {[488] = 1, [475] = 1, [422] = 1} --AB+ can choose Clicker lol rip
if REPENTANCE then metronomeBlacklist = {[488] = 1, [475] = 1, [422] = 1, [326] = 1, [482] = 1, [636] = 1, [628] = 0.85, [622] = 0.75 } end if EID.isRepentance then metronomeBlacklist = {[488] = 1, [475] = 1, [422] = 1, [326] = 1, [482] = 1, [636] = 1, [628] = 0.85, [622] = 0.75 } end
-- TODO: Account for Car Battery -- TODO: Account for Car Battery
-- (If we have it, display multiple results? Also, if the result is Car Battery, it's immediately triggered again) -- (If we have it, display multiple results? Also, if the result is Car Battery, it's immediately triggered again)
function EID:MetronomePrediction(rng) function EID:MetronomePrediction(rng)
local numCollectibles = EID:GetMaxCollectibleID() local numCollectibles = EID:GetMaxCollectibleID()
local rerollChance = 0 local rerollChance = 0
if REPENTANCE then --Rep advances the RNG an extra time to use for its Death Cert/Genesis reroll if EID.isRepentance then --Rep advances the RNG an extra time to use for its Death Cert/Genesis reroll
rng = EID:RNGNext(rng) rng = EID:RNGNext(rng)
rerollChance = rng rerollChance = rng
end end
@@ -135,7 +135,7 @@ function EID:Teleport1Prediction(rng)
-- Currently, that's any room on the grid besides the one we're in, and Red Rooms or Ultra Secret Rooms -- Currently, that's any room on the grid besides the one we're in, and Red Rooms or Ultra Secret Rooms
for i = 0, 168 do for i = 0, 168 do
local room = level:GetRoomByIdx(i) local room = level:GetRoomByIdx(i)
if room.GridIndex >= 0 and room.SafeGridIndex ~= currentRoomIndex and room.Data.Type ~= 29 and (not REPENTANCE or room.Flags & 1024 ~= 1024) then if room.GridIndex >= 0 and room.SafeGridIndex ~= currentRoomIndex and room.Data.Type ~= 29 and (not EID.isRepentance or room.Flags & 1024 ~= 1024) then
table.insert(possibleRooms, i) table.insert(possibleRooms, i)
end end
end end
@@ -187,14 +187,14 @@ function EID:Teleport2Prediction()
local roomDesc = level:GetRoomByIdx(gridIndex, curDimension) local roomDesc = level:GetRoomByIdx(gridIndex, curDimension)
if roomDesc.ListIndex == i and not room.Clear then if roomDesc.ListIndex == i and not room.Clear then
-- Check for Special Red Rooms, which get ordered differently than their non-red version -- Check for Special Red Rooms, which get ordered differently than their non-red version
if REPENTANCE and room.Data.Type ~= 1 and room.Flags & 1024 == 1024 then unclearedTypes[1025] = true if EID.isRepentance and room.Data.Type ~= 1 and room.Flags & 1024 == 1024 then unclearedTypes[1025] = true
else unclearedTypes[room.Data.Type] = true end else unclearedTypes[room.Data.Type] = true end
end end
end end
--Angel/Devil Room check (it lives off the map) --Angel/Devil Room check (it lives off the map)
if not level:GetRoomByIdx(-1).Clear then unclearedTypes[666] = true end if not level:GetRoomByIdx(-1).Clear then unclearedTypes[666] = true end
-- If in Pre-Ascent version (Dad's note) of Mausuleum/Gehenna, we dont teleport to I AM ERROR but Angel/Devil -- If in Pre-Ascent version (Dad's note) of Mausuleum/Gehenna, we dont teleport to I AM ERROR but Angel/Devil
if REPENTANCE and level:IsPreAscent() then unclearedTypes[666] = true; unclearedTypes[3] = false end if EID.isRepentance and level:IsPreAscent() then unclearedTypes[666] = true; unclearedTypes[3] = false end
local greed = game:IsGreedMode() local greed = game:IsGreedMode()
local roomOrder = (greed and teleport2GreedOrder) or teleport2Order local roomOrder = (greed and teleport2GreedOrder) or teleport2Order
@@ -241,9 +241,9 @@ function EID:VoidRoomCheck()
-- 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 -- 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 -- TEST IF VOID ALWAYS ABSORBS THE FIRST OF ITS OPTION INDEX
if entity.SubType > 0 and not pickup:IsShopItem() and if entity.SubType > 0 and not pickup:IsShopItem() and
(not REPENTANCE or pickup.OptionsPickupIndex == 0 or EID.VoidOptionIndexes[pickup.OptionsPickupIndex] == nil) then (not EID.isRepentance or pickup.OptionsPickupIndex == 0 or EID.VoidOptionIndexes[pickup.OptionsPickupIndex] == nil) then
numRunable = numRunable + 1 numRunable = numRunable + 1
if REPENTANCE then EID.VoidOptionIndexes[pickup.OptionsPickupIndex] = entity.SubType end if EID.isRepentance then EID.VoidOptionIndexes[pickup.OptionsPickupIndex] = entity.SubType end
if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE) then if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE) then
numVoidable = numVoidable + 1 numVoidable = numVoidable + 1
else else
@@ -262,7 +262,7 @@ function EID:VoidRNGCheck(player, isRune)
local eidTable = (isRune and EID.BlackRuneStatIncreases) or EID.VoidStatIncreases 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 -- in Repentance, an additional RNG call is done before the 5 for stat ups when using Void
if REPENTANCE and not isRune then startRNG = EID:RNGNext(startRNG, 5, 9, 7) end if EID.isRepentance and not isRune then startRNG = EID:RNGNext(startRNG, 5, 9, 7) end
for i = 1, count do for i = 1, count do
startRNG = GetTwoIncreases(startRNG, increases) startRNG = GetTwoIncreases(startRNG, increases)
if i == 1 then eidTable[3] = {table.unpack(increases)} end if i == 1 then eidTable[3] = {table.unpack(increases)} end
@@ -278,7 +278,7 @@ end
-- D1 -- -- D1 --
local D1blacklist = { [41] = true, [100] = true, [110] = true, [150] = true, [340] = true, [370] = true, [380] = true, [390] = true } local D1blacklist = { [41] = true, [100] = true, [110] = true, [150] = true, [340] = true, [370] = true, [380] = true, [390] = true }
if not REPENTANCE then D1blacklist[54] = true end -- Mimic Chest blacklist in AB+ if not EID.isRepentance then D1blacklist[54] = true end -- Mimic Chest blacklist in AB+
-- These Variants all duplicate into a Chest in Repentance (and should have their SubType ignored in AB+) -- These Variants all duplicate into a Chest in Repentance (and should have their SubType ignored in AB+)
local D1chests = { [50] = true, [51] = true, [52] = true, [53] = true, [54] = true, [55] = true, [56] = true, [57] = true, [58] = true, [60] = true, [360] = true } local D1chests = { [50] = true, [51] = true, [52] = true, [53] = true, [54] = true, [55] = true, [56] = true, [57] = true, [58] = true, [60] = true, [360] = true }
@@ -289,7 +289,7 @@ function EID:D1Prediction(rng)
local poss = {} local poss = {}
for _,v in ipairs(Isaac.FindByType(5,-1,-1)) do for _,v in ipairs(Isaac.FindByType(5,-1,-1)) do
-- Check the blacklist, as well as Rune of Jera in AB+, and empty chests in Rep -- Check the blacklist, as well as Rune of Jera in AB+, and empty chests in Rep
if not D1blacklist[v.Variant] and (REPENTANCE or v.Variant ~= 300 or v.SubType ~= 33) and (not REPENTANCE or v:ToPickup():CanReroll()) then if not D1blacklist[v.Variant] and (EID.isRepentance or v.Variant ~= 300 or v.SubType ~= 33) and (not EID.isRepentance or v:ToPickup():CanReroll()) then
table.insert(poss, v) table.insert(poss, v)
end end
end end
@@ -297,7 +297,7 @@ function EID:D1Prediction(rng)
rng = EID:RNGNext(rng) rng = EID:RNGNext(rng)
local sel = (rng % #poss) + 1 local sel = (rng % #poss) + 1
local fullID = "5." .. poss[sel].Variant .. "." .. poss[sel].SubType local fullID = "5." .. poss[sel].Variant .. "." .. poss[sel].SubType
if REPENTANCE then if EID.isRepentance then
-- in rep, we don't care about subtype... -- in rep, we don't care about subtype...
fullID = "5." .. poss[sel].Variant fullID = "5." .. poss[sel].Variant
if poss[sel].Variant == 300 then if poss[sel].Variant == 300 then
+6 -6
View File
@@ -138,7 +138,7 @@ end
function EID:AddBooleanSetting(category, optionName, displayText, params) function EID:AddBooleanSetting(category, optionName, displayText, params)
if type(params) ~= "table" then params = {} end if type(params) ~= "table" then params = {} end
if params.repOnly and not REPENTANCE then return end if params.repOnly and not EID.isRepentance then return end
MCM.AddSetting( MCM.AddSetting(
"EID", category, "EID", category,
{ {
@@ -165,7 +165,7 @@ end
function EID:AddNumberSetting(category, optionName, displayText, minimum, maximum, params) function EID:AddNumberSetting(category, optionName, displayText, minimum, maximum, params)
if type(params) ~= "table" then params = {} end if type(params) ~= "table" then params = {} end
if params.repOnly and not REPENTANCE then return end if params.repOnly and not EID.isRepentance then return end
MCM.AddSetting( MCM.AddSetting(
"EID", category, "EID", category,
{ {
@@ -191,7 +191,7 @@ end
function EID:AddScrollSetting(category, optionName, displayText, scrollTable, params) function EID:AddScrollSetting(category, optionName, displayText, scrollTable, params)
if type(params) ~= "table" then params = {} end if type(params) ~= "table" then params = {} end
if params.repOnly and not REPENTANCE then return end if params.repOnly and not EID.isRepentance then return end
MCM.AddSetting( MCM.AddSetting(
"EID", category, "EID", category,
{ {
@@ -436,7 +436,7 @@ if MCMLoaded then
local diceSteps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} local diceSteps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
-- Spindown Dice Settings -- Spindown Dice Settings
if REPENTANCE then MCM.AddSpace("EID", "Display") end if EID.isRepentance then MCM.AddSpace("EID", "Display") end
EID:AddScrollSetting("Display", "SpindownDiceResults", "Spindown Dice", diceSteps, {repOnly = true, label = " Items", EID:AddScrollSetting("Display", "SpindownDiceResults", "Spindown Dice", diceSteps, {repOnly = true, label = " Items",
infoText = "Number of item previews when holding Spindown Dice"}) infoText = "Number of item previews when holding Spindown Dice"})
@@ -469,7 +469,7 @@ if MCMLoaded then
EID:AddBooleanSetting("Display", "DisplaySoulstoneInfoShop", "Shop Soulstone Infos", {repOnly = true}) EID:AddBooleanSetting("Display", "DisplaySoulstoneInfoShop", "Shop Soulstone Infos", {repOnly = true})
----"Options?" Spoilers---- ----"Options?" Spoilers----
if REPENTANCE then if EID.isRepentance then
MCM.AddSpace("EID", "Display") MCM.AddSpace("EID", "Display")
MCM.AddText("EID", "Display", "Interaction with 'Options?'") MCM.AddText("EID", "Display", "Interaction with 'Options?'")
end end
@@ -596,7 +596,7 @@ if MCMLoaded then
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-----------------------------BAG OF CRAFTING------------------------------- -----------------------------BAG OF CRAFTING-------------------------------
if REPENTANCE then if EID.isRepentance then
-- Bag of Crafting Display -- Bag of Crafting Display
local bagDisplays = {"always","hold","never"} local bagDisplays = {"always","hold","never"}
EID:AddNumberSetting("Crafting", "DisplayBagOfCrafting", "Show Display", 1, #bagDisplays, { displayingTab = "Crafting", indexOf = bagDisplays, infoText = {"Always = Always show Results", "Hold = Show when holding up bag", "Never = Disable Bag of Crafting feature"}}) EID:AddNumberSetting("Crafting", "DisplayBagOfCrafting", "Show Display", 1, #bagDisplays, { displayingTab = "Crafting", indexOf = bagDisplays, infoText = {"Always = Always show Results", "Hold = Show when holding up bag", "Never = Disable Bag of Crafting feature"}})
+9 -9
View File
@@ -10,7 +10,7 @@ EID.TabDescThisFrame = false
EID.collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, } EID.collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, }
local maxSlot = 1 local maxSlot = 1
-- Repentance modifiers -- Repentance modifiers
if REPENTANCE then if EID.isRepentance then
maxSlot = 3 maxSlot = 3
--include the AB+ collectiblesToCheck in this table! (wish there was an easy way to merge two tables) --include the AB+ collectiblesToCheck in this table! (wish there was an easy way to merge two tables)
EID.collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, EID.collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID,
@@ -78,7 +78,7 @@ end
-- Handle Void -- Handle Void
local voidStatUps = { 0.2, 0.5, 1, 0.5, 0.2, 1 } local voidStatUps = { 0.2, 0.5, 1, 0.5, 0.2, 1 }
local voidStatIcons = {"{{Speed}}", "{{Tears}}", "{{Damage}}", "{{Range}}", "{{Shotspeed}}", "{{Luck}}"} local voidStatIcons = {"{{Speed}}", "{{Tears}}", "{{Damage}}", "{{Range}}", "{{Shotspeed}}", "{{Luck}}"}
if REPENTANCE then voidStatUps[4] = 2.5 end if EID.isRepentance then voidStatUps[4] = 2.5 end
local lastVoidCheck = -30 local lastVoidCheck = -30
EID.VoidStatIncreases = {{},{},{}} EID.VoidStatIncreases = {{},{},{}}
EID.BlackRuneStatIncreases = {{},{},{}} EID.BlackRuneStatIncreases = {{},{},{}}
@@ -100,10 +100,10 @@ local function VoidCallback(descObj, isRune)
local pickup = descObj.Entity and descObj.Entity:ToPickup() local pickup = descObj.Entity and descObj.Entity:ToPickup()
local isAltOption = false local isAltOption = false
-- Test if this is an Option pedestal, Repentance only absorbs the lowest index one -- Test if this is an Option pedestal, Repentance only absorbs the lowest index one
if REPENTANCE then if EID.isRepentance then
local optionIndex = pickup and pickup.OptionsPickupIndex local optionIndex = pickup and pickup.OptionsPickupIndex
local firstOption = EID.VoidOptionIndexes[optionIndex] local firstOption = EID.VoidOptionIndexes[optionIndex]
if (REPENTANCE and optionIndex and optionIndex ~= 0 and descObj.ObjSubType ~= firstOption) then if (EID.isRepentance and optionIndex and optionIndex ~= 0 and descObj.ObjSubType ~= firstOption) then
EID:appendToDescription(descObj, "#" .. prefix .. "{{Collectible"..firstOption.. EID:appendToDescription(descObj, "#" .. prefix .. "{{Collectible"..firstOption..
"}}" .. EID:getObjectName(5, 100, firstOption) .. EID:getDescriptionEntry("VoidOptionText")) "}}" .. EID:getObjectName(5, 100, firstOption) .. EID:getDescriptionEntry("VoidOptionText"))
isAltOption = true isAltOption = true
@@ -113,7 +113,7 @@ local function VoidCallback(descObj, isRune)
if isRune or EID.itemConfig:GetCollectible(descObj.ObjSubType).Type ~= 3 then if isRune or EID.itemConfig:GetCollectible(descObj.ObjSubType).Type ~= 3 then
local shopItem = pickup and pickup:IsShopItem() local shopItem = pickup and pickup:IsShopItem()
-- Afterbirth+ really can't do anything with Void and a shop item, so just return -- Afterbirth+ really can't do anything with Void and a shop item, so just return
if (not REPENTANCE and shopItem) then return descObj end if (not EID.isRepentance and shopItem) then return descObj end
local voidIntro = ((shopItem or isAltOption) and EID:getDescriptionEntry("VoidShopText")) or EID:getDescriptionEntry("VoidText") local voidIntro = ((shopItem or isAltOption) and EID:getDescriptionEntry("VoidShopText")) or EID:getDescriptionEntry("VoidText")
local voidNames = EID:getDescriptionEntry("VoidNames") local voidNames = EID:getDescriptionEntry("VoidNames")
@@ -153,7 +153,7 @@ local altStages = { [10] = false, [11] = true, [12] = false, [13] = true }
local greedStages = { -1, 1, -1, 3, -1, 5, 7, -1, -1, 10, -1, -1, 0, -1 } local greedStages = { -1, 1, -1, 3, -1, 5, 7, -1, -1, 10, -1, -1, 0, -1 }
local function PandorasBoxCallback(descObj) local function PandorasBoxCallback(descObj)
local strangeKeyOwned = REPENTANCE and EID:PlayersHaveTrinket(175) local strangeKeyOwned = EID.isRepentance and EID:PlayersHaveTrinket(175)
local pandoraCount = 0 local pandoraCount = 0
local level = game:GetLevel() local level = game:GetLevel()
local stageNum = level:GetAbsoluteStage() local stageNum = level:GetAbsoluteStage()
@@ -173,7 +173,7 @@ local function PandorasBoxCallback(descObj)
local skip9and12 = false local skip9and12 = false
-- many localizations do not have the ???/Void entry and the Dark Room entry -- many localizations do not have the ???/Void entry and the Dark Room entry
-- this seemed better than forcing them to have it -- this seemed better than forcing them to have it
if totalCount == (REPENTANCE and 12 or 11) then if totalCount == (EID.isRepentance and 12 or 11) then
skip9and12 = true skip9and12 = true
end end
@@ -196,7 +196,7 @@ local function PandorasBoxCallback(descObj)
descObj.Description = string.gsub(descObj.Description, w:gsub("([^%w])", "%%%1"), "{{ColorBagComplete}}" .. w .. "{{CR}}") descObj.Description = string.gsub(descObj.Description, w:gsub("([^%w])", "%%%1"), "{{ColorBagComplete}}" .. w .. "{{CR}}")
end end
-- don't check any lines of the description after Home -- don't check any lines of the description after Home
if pandoraCount == (REPENTANCE and 14 or 13) then break end if pandoraCount == (EID.isRepentance and 14 or 13) then break end
end end
end end
if strangeKeyOwned then if strangeKeyOwned then
@@ -228,7 +228,7 @@ local function SacrificeRoomCallback(descObj)
end end
if REPENTANCE then if EID.isRepentance then
-- Handle Birthright -- Handle Birthright
local function BirthrightCallback(descObj) local function BirthrightCallback(descObj)
descObj.Description = "" descObj.Description = ""
+30 -38
View File
@@ -5,6 +5,7 @@ EID.Languages = {"en_us", "en_us_detailed", "fr", "pt", "pt_br", "ru", "spa", "i
EID.descriptions = {} -- Table that holds all translation strings EID.descriptions = {} -- Table that holds all translation strings
EID.enableDebug = false EID.enableDebug = false
local game = Game() local game = Game()
EID.isRepentance = getmetatable(Sprite) ~= nil and getmetatable(Sprite).__class ~= nil and getmetatable(Sprite).__class.GetAnimation ~= nil or REPENTANCE -- REPENTANCE variable can be altered by any mod, so we try alternative method and save the result
require("eid_config") require("eid_config")
EID.Config = EID.UserConfig EID.Config = EID.UserConfig
@@ -115,7 +116,7 @@ require("eid_holdmapdesc")
require("eid_itemprediction") require("eid_itemprediction")
-- load Repentence descriptions -- load Repentence descriptions
if REPENTANCE then if EID.isRepentance then
EID.GameVersion = "rep" EID.GameVersion = "rep"
for _,lang in ipairs(EID.Languages) do for _,lang in ipairs(EID.Languages) do
local wasSuccessful, err = pcall(require,"descriptions."..EID.GameVersion.."."..lang) local wasSuccessful, err = pcall(require,"descriptions."..EID.GameVersion.."."..lang)
@@ -136,7 +137,7 @@ local modfolder ='external item descriptions_836319872' --release mod folder nam
local function GetCurrentModPath() local function GetCurrentModPath()
if debug then if debug then
if REPENTANCE then require("eid_tmtrainer") end if EID.isRepentance then require("eid_tmtrainer") end
return string.sub(debug.getinfo(GetCurrentModPath).source,2) .. "/../" return string.sub(debug.getinfo(GetCurrentModPath).source,2) .. "/../"
end end
--use some very hacky trickery to get the path to this mod --use some very hacky trickery to get the path to this mod
@@ -158,7 +159,7 @@ EID:fixDefinedFont()
local fontFile = EID.Config["FontType"] or "default" local fontFile = EID.Config["FontType"] or "default"
local success = EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt") local success = EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt")
if not success then if not success then
if REPENTANCE then if EID.isRepentance then
success = EID:loadFont("../mods/"..modfolder.."/resources/font/eid_"..fontFile..".fnt") success = EID:loadFont("../mods/"..modfolder.."/resources/font/eid_"..fontFile..".fnt")
if not success then if not success then
Isaac.ConsoleOutput("EID WAS NOT ABLE TO LOAD THE FONT!!!!!!!! Please contact the mod creator!\n") Isaac.ConsoleOutput("EID WAS NOT ABLE TO LOAD THE FONT!!!!!!!! Please contact the mod creator!\n")
@@ -179,7 +180,7 @@ end
-------------Handle Resetting Floor Trackers-------------- -------------Handle Resetting Floor Trackers--------------
function EID:onNewFloor() function EID:onNewFloor()
pathsChecked = {} pathsChecked = {}
if REPENTANCE then if EID.isRepentance then
EID.BoC.RoomQueries = {} EID.BoC.RoomQueries = {}
EID.BoC.FloorQuery = {} EID.BoC.FloorQuery = {}
EID.CraneItemType = {} EID.CraneItemType = {}
@@ -199,7 +200,7 @@ questionMarkSprite:LoadGraphics()
function EID:IsAltChoice(pickup) function EID:IsAltChoice(pickup)
-- do not run this while Curse of the Blind is active, since this function is really just a "is collectible pedestal a red question mark" check -- do not run this while Curse of the Blind is active, since this function is really just a "is collectible pedestal a red question mark" check
if not REPENTANCE or EID:hasCurseBlind() then if not EID.isRepentance or EID:hasCurseBlind() then
return false return false
end end
if altPathItemChecked[pickup.InitSeed] ~= nil then if altPathItemChecked[pickup.InitSeed] ~= nil then
@@ -245,7 +246,7 @@ end
local initialItemNext = false local initialItemNext = false
local flipItemNext = false local flipItemNext = false
if REPENTANCE then if EID.isRepentance then
EID.flipItemPositions = {} EID.flipItemPositions = {}
EID.flipMaxIndex = -1 EID.flipMaxIndex = -1
@@ -586,9 +587,9 @@ function EID:printDescription(desc, cachedID)
offsetX = offsetX + 1 offsetX = offsetX + 1
local anim = "numbers" local anim = "numbers"
local frameNum = desc.Charges or 0 local frameNum = desc.Charges or 0
if desc.ChargeType == (REPENTANCE and ItemConfig.CHARGE_TIMED or 1) then if desc.ChargeType == (EID.isRepentance and ItemConfig.CHARGE_TIMED or 1) then
anim = "Misc"; frameNum = 6 -- Timer Icon anim = "Misc"; frameNum = 6 -- Timer Icon
elseif desc.ChargeType == (REPENTANCE and ItemConfig.CHARGE_SPECIAL or 2) then elseif desc.ChargeType == (EID.isRepentance and ItemConfig.CHARGE_SPECIAL or 2) then
frameNum = 13 -- Question Mark Icon frameNum = 13 -- Question Mark Icon
end end
EID:renderIcon(EID.InlineIconSprite2, renderPos.X + offsetX * EID.Scale, renderPos.Y + offsetY * EID.Scale, nil, anim, frameNum) EID:renderIcon(EID.InlineIconSprite2, renderPos.X + offsetX * EID.Scale, renderPos.Y + offsetY * EID.Scale, nil, anim, frameNum)
@@ -718,7 +719,7 @@ end
----------------------------Handle New Room-------------------------------- ----------------------------Handle New Room--------------------------------
EID.isMirrorRoom = false EID.isMirrorRoom = false
EID.isDeathCertRoom = false EID.isDeathCertRoom = false
if REPENTANCE then if EID.isRepentance then
function EID:AssignFlipItems() function EID:AssignFlipItems()
EID.flipMaxIndex = -1 EID.flipMaxIndex = -1
local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex
@@ -812,7 +813,7 @@ function EID:renderIndicator(entity, playerNum)
entityPos = entityPos + entity:GetData()["EID_RenderOffset"] entityPos = entityPos + entity:GetData()["EID_RenderOffset"]
end end
-- Move highlights a bit to fit onto the alt Item layout of Flip / Tainted Laz -- Move highlights a bit to fit onto the alt Item layout of Flip / Tainted Laz
if REPENTANCE and not EID:IsGridEntity(entity) then if EID.isRepentance and not EID:IsGridEntity(entity) then
if entity.Variant == 100 and EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_FLIP) and EID:getEntityData(entity, "EID_FlipItemID") then if entity.Variant == 100 and EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_FLIP) and EID:getEntityData(entity, "EID_FlipItemID") then
entityPos = entityPos + Vector(2.5,2.5) entityPos = entityPos + Vector(2.5,2.5)
elseif entity.Type == 6 and entity.Variant == 16 then elseif entity.Type == 6 and entity.Variant == 16 then
@@ -821,7 +822,7 @@ function EID:renderIndicator(entity, playerNum)
end end
local sprite = nil local sprite = nil
if not EID:IsGridEntity(entity) then sprite = entity:GetSprite() end if not EID:IsGridEntity(entity) then sprite = entity:GetSprite() end
if REPENTANCE then if EID.isRepentance then
repDiv = 255 repDiv = 255
if EID.isMirrorRoom then if EID.isMirrorRoom then
local screenCenter = EID:getScreenSize()/2 local screenCenter = EID:getScreenSize()/2
@@ -931,13 +932,13 @@ function EID:setPlayer()
-- Old simple setPlayer, to reduce runtime in single player -- Old simple setPlayer, to reduce runtime in single player
if numPlayers == 1 or not EID.Config["CoopDescriptions"] then if numPlayers == 1 or not EID.Config["CoopDescriptions"] then
local p = Isaac.GetPlayer(0) local p = Isaac.GetPlayer(0)
if REPENTANCE and p:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN_B then if EID.isRepentance and p:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN_B then
EID.player = p:GetOtherTwin() or p EID.player = p:GetOtherTwin() or p
else else
EID.player = p EID.player = p
end end
EID.players = { EID.player } EID.players = { EID.player }
if REPENTANCE then EID.players = { EID.player, REPENTANCE and EID.player:GetOtherTwin() } end if EID.isRepentance then EID.players = { EID.player, EID.isRepentance and EID.player:GetOtherTwin() } end
EID.coopMainPlayers = { EID.player } EID.coopMainPlayers = { EID.player }
EID.coopAllPlayers = EID.players EID.coopAllPlayers = EID.players
EID.controllerIndexes[p.ControllerIndex] = 1 EID.controllerIndexes[p.ControllerIndex] = 1
@@ -956,7 +957,7 @@ function EID:setPlayer()
if player.Parent == nil then if player.Parent == nil then
local newIndex = not EID.controllerIndexes[player.ControllerIndex] local newIndex = not EID.controllerIndexes[player.ControllerIndex]
-- Tainted Soul is treated as the primary player for Tainted Forgotten, so swap them -- Tainted Soul is treated as the primary player for Tainted Forgotten, so swap them
if REPENTANCE and (player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN_B if EID.isRepentance and (player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN_B
or player:GetPlayerType() == PlayerType.PLAYER_THESOUL_B) then or player:GetPlayerType() == PlayerType.PLAYER_THESOUL_B) then
player = player:GetOtherTwin() or player player = player:GetOtherTwin() or player
end end
@@ -971,7 +972,7 @@ function EID:setPlayer()
end end
EID.player = EID.coopAllPlayers[1] EID.player = EID.coopAllPlayers[1]
-- second entry will be nil if no twin or AB+ (REPENTANCE = nil) -- second entry will be nil if no twin or AB+ (REPENTANCE = nil)
EID.players = { EID.player, REPENTANCE and EID.player:GetOtherTwin() } EID.players = { EID.player, EID.isRepentance and EID.player:GetOtherTwin() }
EID.isMultiplayer = #EID.coopMainPlayers > 1 EID.isMultiplayer = #EID.coopMainPlayers > 1
end end
@@ -987,15 +988,6 @@ function EID:onGameUpdate()
EID:checkPlayersForMissingItems() EID:checkPlayersForMissingItems()
EID:evaluateQueuedItems() EID:evaluateQueuedItems()
EID:evaluateHeldPill() EID:evaluateHeldPill()
-- Fix some poorly coded mods erroneously setting the REPENTANCE constant to false (the only valid values for it are nil or true)
if REPENTANCE == false then
if EID.GameVersion == "rep" then
REPENTANCE = true
else
REPENTANCE = nil
end
end
if collSpawned then if collSpawned then
collSpawned = false collSpawned = false
@@ -1017,7 +1009,7 @@ function EID:onGameUpdate()
end end
-- Remove Crane Game item data if it's giving the prize out -- Remove Crane Game item data if it's giving the prize out
if REPENTANCE and EID.GameUpdateCount % 10 == 0 then if EID.isRepentance and EID.GameUpdateCount % 10 == 0 then
for _, crane in ipairs(Isaac.FindByType(6, 16, -1, true, false)) do for _, crane in ipairs(Isaac.FindByType(6, 16, -1, true, false)) do
if EID.CraneItemType[tostring(crane.InitSeed)] then if EID.CraneItemType[tostring(crane.InitSeed)] then
if crane:GetSprite():IsPlaying("Prize") then if crane:GetSprite():IsPlaying("Prize") then
@@ -1065,7 +1057,7 @@ end
local hasShownStartWarning = false local hasShownStartWarning = false
local function checkStartOfRunWarnings() local function checkStartOfRunWarnings()
if REPENTANCE and not EID.Config["DisableStartOfRunWarnings"] and game:GetFrameCount() < 10*30 then if EID.isRepentance and not EID.Config["DisableStartOfRunWarnings"] and game:GetFrameCount() < 10*30 then
-- Old Repentance version check; update this to check for the existence of the newest mod API function EID uses -- Old Repentance version check; update this to check for the existence of the newest mod API function EID uses
-- 1.7.9b (Dec. 08, 2022): The IsAvailable function was added (checking for Isaac.RunCallback existing instead) -- 1.7.9b (Dec. 08, 2022): The IsAvailable function was added (checking for Isaac.RunCallback existing instead)
if Isaac.RunCallback == nil then if Isaac.RunCallback == nil then
@@ -1113,7 +1105,7 @@ local function checkPosModifiers()
else else
EID:removeTextPosModifier("Greed Mode Horizontal") EID:removeTextPosModifier("Greed Mode Horizontal")
end end
if not REPENTANCE then if not EID.isRepentance then
-- AB+ Schoolbag adjustment -- AB+ Schoolbag adjustment
if EID.player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then if EID.player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then
EID:addTextPosModifier("Schoolbag", Vector(0,30)) EID:addTextPosModifier("Schoolbag", Vector(0,30))
@@ -1192,7 +1184,7 @@ local function onRender()
if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting" then if ModConfigMenu and ModConfigMenu.IsVisible and ModConfigMenu.Config["Mod Config Menu"].HideHudInMenu and EID.MCMCompat_isDisplayingEIDTab ~= "Visuals" and EID.MCMCompat_isDisplayingEIDTab ~= "Crafting" then
return return
end end
if REPENTANCE then if EID.isRepentance then
local hasBag, bagPlayer = EID:PlayersHaveCollectible(710) local hasBag, bagPlayer = EID:PlayersHaveCollectible(710)
if hasBag then if hasBag then
EID.bagPlayer = bagPlayer EID.bagPlayer = bagPlayer
@@ -1229,7 +1221,7 @@ local function onRender()
EID.holdTabCounter = 0 EID.holdTabCounter = 0
end end
-- Check for Drop being pressed, for Repentance D Infinity tracking -- Check for Drop being pressed, for Repentance D Infinity tracking
if REPENTANCE then if EID.isRepentance then
local dropTriggered, playerNumPressingDrop = EID:PlayersActionPressed(ButtonAction.ACTION_DROP, Input.IsActionTriggered) local dropTriggered, playerNumPressingDrop = EID:PlayersActionPressed(ButtonAction.ACTION_DROP, Input.IsActionTriggered)
if dropTriggered then if dropTriggered then
local playerPressingDrop = EID.coopMainPlayers[playerNumPressingDrop] local playerPressingDrop = EID.coopMainPlayers[playerNumPressingDrop]
@@ -1287,7 +1279,7 @@ local function onRender()
local displayedDesc = {} local displayedDesc = {}
-- Check for Bag of Crafting per player -- Check for Bag of Crafting per player
-- (Do this first because it can't be Local Mode, and should take precedence over other descriptions, even as Player 2+) -- (Do this first because it can't be Local Mode, and should take precedence over other descriptions, even as Player 2+)
if REPENTANCE then if EID.isRepentance then
for playerNum,player in ipairs(playerSearch) do for playerNum,player in ipairs(playerSearch) do
if player:HasCollectible(710) then if player:HasCollectible(710) then
local craftingSuccess = EID:handleBagOfCraftingRendering() local craftingSuccess = EID:handleBagOfCraftingRendering()
@@ -1440,7 +1432,7 @@ local function onRender()
if EID:getEntityData(closest, "EID_DontHide") ~= true then if EID:getEntityData(closest, "EID_DontHide") ~= true then
local isSoulstone = closest.SubType >= 81 and closest.SubType <= 97 local isSoulstone = closest.SubType >= 81 and closest.SubType <= 97
local hideinShop = closest:ToPickup():IsShopItem() and ((not isSoulstone and not EID.Config["DisplayCardInfoShop"]) or (isSoulstone and not EID.Config["DisplaySoulstoneInfoShop"])) local hideinShop = closest:ToPickup():IsShopItem() and ((not isSoulstone and not EID.Config["DisplayCardInfoShop"]) or (isSoulstone and not EID.Config["DisplaySoulstoneInfoShop"]))
local isOptionsSpawn = REPENTANCE and not EID.Config["DisplayCardInfoOptions?"] and closest:ToPickup().OptionsPickupIndex > 0 local isOptionsSpawn = EID.isRepentance and not EID.Config["DisplayCardInfoOptions?"] and closest:ToPickup().OptionsPickupIndex > 0
local obstructed = ((not isSoulstone and not EID.Config["DisplayObstructedCardInfo"]) or local obstructed = ((not isSoulstone and not EID.Config["DisplayObstructedCardInfo"]) or
(not EID.Config["DisplayObstructedSoulstoneInfo"] and isSoulstone)) and (not EID.Config["DisplayObstructedSoulstoneInfo"] and isSoulstone)) and
(not pathsChecked[closest.InitSeed] and not attemptPathfind(closest)) (not pathsChecked[closest.InitSeed] and not attemptPathfind(closest))
@@ -1461,7 +1453,7 @@ local function onRender()
--Handle Pills --Handle Pills
if EID:getEntityData(closest, "EID_DontHide") ~= true then if EID:getEntityData(closest, "EID_DontHide") ~= true then
local hideinShop = closest:ToPickup():IsShopItem() and not EID.Config["DisplayPillInfoShop"] local hideinShop = closest:ToPickup():IsShopItem() and not EID.Config["DisplayPillInfoShop"]
local isOptionsSpawn = REPENTANCE and not EID.Config["DisplayPillInfoOptions?"] and closest:ToPickup().OptionsPickupIndex > 0 local isOptionsSpawn = EID.isRepentance and not EID.Config["DisplayPillInfoOptions?"] and closest:ToPickup().OptionsPickupIndex > 0
local obstructed = not EID.Config["DisplayObstructedPillInfo"] and local obstructed = not EID.Config["DisplayObstructedPillInfo"] and
(not pathsChecked[closest.InitSeed] and not attemptPathfind(closest)) (not pathsChecked[closest.InitSeed] and not attemptPathfind(closest))
if isOptionsSpawn or hideinShop or obstructed then if isOptionsSpawn or hideinShop or obstructed then
@@ -1472,7 +1464,7 @@ local function onRender()
local pillColor = closest.SubType local pillColor = closest.SubType
local pool = game:GetItemPool() local pool = game:GetItemPool()
local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"] local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"]
if REPENTANCE and pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end if EID.isRepentance and pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end
local pillEffectID = EID:getAdjustedSubtype(closest.Type, closest.Variant, pillColor) local pillEffectID = EID:getAdjustedSubtype(closest.Type, closest.Variant, pillColor)
local wasUsed = EID:WasPillUsed(pillColor) local wasUsed = EID:WasPillUsed(pillColor)
@@ -1495,7 +1487,7 @@ local function onRender()
if room:GetType() == RoomType.ROOM_SACRIFICE and EID.Config["DisplaySacrificeInfo"] then if room:GetType() == RoomType.ROOM_SACRIFICE and EID.Config["DisplaySacrificeInfo"] then
local desc = EID:getDescriptionObj(-999, -1, closest.VarData + 1, closest) local desc = EID:getDescriptionObj(-999, -1, closest.VarData + 1, closest)
EID:addDescriptionToPrint(desc) EID:addDescriptionToPrint(desc)
elseif REPENTANCE and EID.Config["DisplaySanguineInfo"] and room:GetType() == RoomType.ROOM_DEVIL and elseif EID.isRepentance and EID.Config["DisplaySanguineInfo"] and room:GetType() == RoomType.ROOM_DEVIL and
EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_SANGUINE_BOND) then EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_SANGUINE_BOND) then
local desc = EID:getDescriptionObj(5, 100, 692, closest, false) local desc = EID:getDescriptionObj(5, 100, 692, closest, false)
desc.Description = EID:trimSanguineDesc(desc) desc.Description = EID:trimSanguineDesc(desc)
@@ -1574,7 +1566,7 @@ end
EID:AddCallback(ModCallbacks.MC_USE_ITEM, OnUseD4, CollectibleType.COLLECTIBLE_D4) EID:AddCallback(ModCallbacks.MC_USE_ITEM, OnUseD4, CollectibleType.COLLECTIBLE_D4)
-- Re-init transformation progress and item interactions after using Genesis -- Re-init transformation progress and item interactions after using Genesis
if REPENTANCE then if EID.isRepentance then
local function OnUseGenesis(_, _, _, _) local function OnUseGenesis(_, _, _, _)
OnGameStartGeneral() OnGameStartGeneral()
CheckAllActiveItemProgress() CheckAllActiveItemProgress()
@@ -1590,7 +1582,7 @@ function EID:OnUsePill(pillEffectID, player, useFlags)
EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags, pillColor) -- Echo Chamber tracking EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags, pillColor) -- Echo Chamber tracking
-- for tracking used pills, ignore gold pills and noannouncer flag pills -- for tracking used pills, ignore gold pills and noannouncer flag pills
-- (not using a bitmask, because Placebo is mimic+noannouncer, and we want to count those) -- (not using a bitmask, because Placebo is mimic+noannouncer, and we want to count those)
if REPENTANCE and (pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD or useFlags == UseFlag.USE_NOANNOUNCER) then return end if EID.isRepentance and (pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD or useFlags == UseFlag.USE_NOANNOUNCER) then return end
EID.UsedPillColors[tostring(pillColor)] = true EID.UsedPillColors[tostring(pillColor)] = true
end end
@@ -1648,7 +1640,7 @@ function EID:OnGameStart(isSave)
EID.UsedPillColors = savedEIDConfig["UsedPillColors"] or {} EID.UsedPillColors = savedEIDConfig["UsedPillColors"] or {}
end end
if REPENTANCE then if EID.isRepentance then
EID.BoC.BagItems = {} EID.BoC.BagItems = {}
EID.CraneItemType = {} EID.CraneItemType = {}
EID.flipItemPositions = {} EID.flipItemPositions = {}
@@ -1711,7 +1703,7 @@ EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, EID.OnGameStart)
--Saving Moddata-- --Saving Moddata--
function EID:OnGameExit() function EID:OnGameExit()
if REPENTANCE then if EID.isRepentance then
EID.Config["BagContent"] = EID.BoC.BagItems or {} EID.Config["BagContent"] = EID.BoC.BagItems or {}
EID.Config["BagFloorContent"] = EID.BoC.RoomQueries or {} EID.Config["BagFloorContent"] = EID.BoC.RoomQueries or {}
EID.Config["CraneItemType"] = EID.CraneItemType or {} EID.Config["CraneItemType"] = EID.CraneItemType or {}