diff --git a/eid_api.lua b/eid_api.lua index 2ca4e392..bad1f28e 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -165,7 +165,7 @@ end -- Try to automatically assign vanilla transformations to the entity function EID:tryAutodetectTransformationsCollectible(collectibleID) - if not REPENTANCE then return end + if not EID.isRepentance then return end local config = EID.itemConfig:GetCollectible(collectibleID) local transformations = {} 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.Charges = itemConfig.MaxCharges or 0 -- 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.ChargeType = ItemConfig.CHARGE_SPECIAL end @@ -508,7 +508,7 @@ end function EID:getAdjustedSubtype(Type, Variant, SubType) local tableName = EID:getTableName(Type, Variant, SubType) if tableName == "trinkets" then - if REPENTANCE then + if EID.isRepentance then return (SubType & TrinketType.TRINKET_ID_MASK) end 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 -- EID.pillPlayer is a way to recheck a pill for what different players will turn it into 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 end 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 else SubType = pool:GetPillEffect(SubType, player) + 1 end end @@ -672,9 +672,9 @@ function EID:hasDescription(entity) isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_PILL and EID.Config["DisplayPillInfo"]) return isAllowed and (entity.SubType > 0 or -- 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 - 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)]) end if entity.Type == 1000 then @@ -1414,7 +1414,7 @@ function EID:handleHUDElement(hudElement) end local screenSize = EID:getScreenSize() local hudOffset = EID.Config["HUDOffset"] - if REPENTANCE then + if EID.isRepentance then hudOffset = (Options.HUDOffset * 10) end for _,v in ipairs(hudElement.anchors) do @@ -1826,7 +1826,7 @@ end -- Returns the quality of the described entity 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) end end @@ -1868,7 +1868,7 @@ end -- Add pickup usage to history of pickups used by the player function EID:AddPickupToHistory(pickupType, effectID, player, useFlags, pillColorID) -- 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) EID:InitItemInteractionIfAbsent(playerID) @@ -1879,7 +1879,7 @@ function EID:AddPickupToHistory(pickupType, effectID, player, useFlags, pillColo end -- 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 -- Render a sprite of an entity @@ -1895,7 +1895,7 @@ end -- Tries to get the Vanilla transformations of modded items based on Tags function EID:GetTransformationsOfModdedItems() - if not REPENTANCE then return end + if not EID.isRepentance then return end local numCollectibles = EID:GetMaxCollectibleID() for i = 733, numCollectibles, 1 do EID:tryAutodetectTransformationsCollectible(i) diff --git a/eid_data.lua b/eid_data.lua index 610c0610..4a77ff72 100644 --- a/eid_data.lua +++ b/eid_data.lua @@ -30,7 +30,7 @@ EID.GridEntityWhitelist = { EID.Config["DisplaySacrificeInfo"] end, function(gridEntity) - return REPENTANCE and EID.Config["DisplaySanguineInfo"] and + return EID.isRepentance and EID.Config["DisplaySanguineInfo"] and Game():GetRoom():GetType() == RoomType.ROOM_DEVIL and EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_SANGUINE_BOND) end, @@ -591,15 +591,15 @@ EID.InlineIcons = { } -- General Stats (Adjust automatically according to the current DLC) -EID.InlineIcons["Damage"] = REPENTANCE and EID.InlineIcons["DamageREP"] or EID.InlineIcons["DamageAB"] -EID.InlineIcons["Speed"] = REPENTANCE and EID.InlineIcons["SpeedREP"] or EID.InlineIcons["SpeedAB"] -EID.InlineIcons["Tears"] = REPENTANCE and EID.InlineIcons["TearsREP"] or EID.InlineIcons["TearsAB"] -EID.InlineIcons["Range"] = REPENTANCE and EID.InlineIcons["RangeREP"] or EID.InlineIcons["RangeAB"] -EID.InlineIcons["Shotspeed"] = REPENTANCE and EID.InlineIcons["ShotspeedREP"] or EID.InlineIcons["ShotspeedAB"] -EID.InlineIcons["Luck"] = REPENTANCE and EID.InlineIcons["LuckREP"] or EID.InlineIcons["LuckAB"] -EID.InlineIcons["AngelChance"] = REPENTANCE and EID.InlineIcons["AngelChanceREP"] or EID.InlineIcons["AngelChanceAB"] -EID.InlineIcons["DevilChance"] = REPENTANCE and EID.InlineIcons["DevilChanceREP"] or EID.InlineIcons["DevilChanceAB"] -EID.InlineIcons["Tearsize"] = REPENTANCE and EID.InlineIcons["TearsizeREP"] or EID.InlineIcons["TearsizeAB"] +EID.InlineIcons["Damage"] = EID.isRepentance and EID.InlineIcons["DamageREP"] or EID.InlineIcons["DamageAB"] +EID.InlineIcons["Speed"] = EID.isRepentance and EID.InlineIcons["SpeedREP"] or EID.InlineIcons["SpeedAB"] +EID.InlineIcons["Tears"] = EID.isRepentance and EID.InlineIcons["TearsREP"] or EID.InlineIcons["TearsAB"] +EID.InlineIcons["Range"] = EID.isRepentance and EID.InlineIcons["RangeREP"] or EID.InlineIcons["RangeAB"] +EID.InlineIcons["Shotspeed"] = EID.isRepentance and EID.InlineIcons["ShotspeedREP"] or EID.InlineIcons["ShotspeedAB"] +EID.InlineIcons["Luck"] = EID.isRepentance and EID.InlineIcons["LuckREP"] or EID.InlineIcons["LuckAB"] +EID.InlineIcons["AngelChance"] = EID.isRepentance and EID.InlineIcons["AngelChanceREP"] or EID.InlineIcons["AngelChanceAB"] +EID.InlineIcons["DevilChance"] = EID.isRepentance and EID.InlineIcons["DevilChanceREP"] or EID.InlineIcons["DevilChanceAB"] +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.SPIDERBABY)] = {VanillaForm = PlayerForm.PLAYERFORM_SPIDERBABY}, [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} } diff --git a/eid_holdmapdesc.lua b/eid_holdmapdesc.lua index be52ec0e..ee18400f 100644 --- a/eid_holdmapdesc.lua +++ b/eid_holdmapdesc.lua @@ -52,7 +52,7 @@ function EID:getHoldMapDescription(player, checkingTwin) -- pandora's box? it shows the whole desc which is kinda useful but too big -- 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 local poopInfo = EID:getDescriptionEntry("poopSpells") local nextPoop = player:GetPoopSpell(i) @@ -75,7 +75,7 @@ function EID:getHoldMapDescription(player, checkingTwin) end -- Echo Chamber Description - if REPENTANCE and player:HasCollectible(700) then + if EID.isRepentance and player:HasCollectible(700) then local playerID = EID:getPlayerID(player) local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory -- Dead Tainted Lazarus exception @@ -102,7 +102,7 @@ function EID:getHoldMapDescription(player, checkingTwin) end -- 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 inventoryQuery= EID.BoC.InventoryOverride or EID.BoC.InventoryQuery 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 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 - 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))) end -- Teleport 2.0 location @@ -180,9 +180,9 @@ function EID:getHoldMapDescription(player, checkingTwin) 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 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 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 local heldCard = player:GetCard(i) local heldPill = player:GetPill(i) @@ -192,7 +192,7 @@ function EID:getHoldMapDescription(player, checkingTwin) -- Check if our held pill is identified EID.pillPlayer = player 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 addObjectDesc(5, 70, heldPill) end @@ -214,7 +214,7 @@ function EID:getHoldMapDescription(player, checkingTwin) -- account for Golden Trinket IDs local heldTrinketTrue = player:GetTrinket(t) 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 == 4 then -- 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 -- Teleport (requires cheating option on) 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))) end end -- Rainbow Worm elseif EID.Config["ItemReminderShowHiddenInfo"] and heldTrinket == 64 then 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}}") -- 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 -- 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 -- Don't display Mysterious Paper's 1-frame temporary trinket granting local hasPaper = player:HasTrinket(21) @@ -264,7 +264,7 @@ function EID:getHoldMapDescription(player, checkingTwin) end -- Gulped/unslotted Modeling Clay -- (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() if modelingClayItem > 0 then addObjectDesc(5, 100, modelingClayItem, "{{Trinket166}}") @@ -284,7 +284,7 @@ function EID:getHoldMapDescription(player, checkingTwin) -- 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 REPENTANCE and not checkingTwin then + if EID.isRepentance and not checkingTwin then local twin = player:GetOtherTwin() local mainTwinDesc = holdMapDesc local otherTwinDesc = "" diff --git a/eid_itemprediction.lua b/eid_itemprediction.lua index f83c1400..a4f48454 100644 --- a/eid_itemprediction.lua +++ b/eid_itemprediction.lua @@ -20,11 +20,11 @@ end -- D Infinity -- 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 -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 -- For Repentance, the Drop button is tracked, which is probably not 100% successful, and handled elsewhere function EID:CurrentDInfinity(rng, player) - if not REPENTANCE then + if not EID.isRepentance then rng = EID:RNGNext(rng, 0x1, 0x9, 0x1D) -- magic disassembled numbers! return dinfinityList[rng % 7] else @@ -33,7 +33,7 @@ function EID:CurrentDInfinity(rng, player) end end 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 function EID:WatchForDInfinity() justDidD = true @@ -55,13 +55,13 @@ end -- 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 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 -- (If we have it, display multiple results? Also, if the result is Car Battery, it's immediately triggered again) function EID:MetronomePrediction(rng) local numCollectibles = EID:GetMaxCollectibleID() 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) rerollChance = rng 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 for i = 0, 168 do 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) end end @@ -187,14 +187,14 @@ function EID:Teleport2Prediction() local roomDesc = level:GetRoomByIdx(gridIndex, curDimension) if roomDesc.ListIndex == i and not room.Clear then -- 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 end end --Angel/Devil Room check (it lives off the map) 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 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 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 -- 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 + (not EID.isRepentance 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.isRepentance then EID.VoidOptionIndexes[pickup.OptionsPickupIndex] = entity.SubType end if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE) then numVoidable = numVoidable + 1 else @@ -262,7 +262,7 @@ function EID:VoidRNGCheck(player, isRune) 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 = 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 startRNG = GetTwoIncreases(startRNG, increases) if i == 1 then eidTable[3] = {table.unpack(increases)} end @@ -278,7 +278,7 @@ end -- D1 -- 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+) 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 = {} 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 - 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) end end @@ -297,7 +297,7 @@ function EID:D1Prediction(rng) rng = EID:RNGNext(rng) local sel = (rng % #poss) + 1 local fullID = "5." .. poss[sel].Variant .. "." .. poss[sel].SubType - if REPENTANCE then + if EID.isRepentance then -- in rep, we don't care about subtype... fullID = "5." .. poss[sel].Variant if poss[sel].Variant == 300 then diff --git a/eid_mcm.lua b/eid_mcm.lua index 1e593422..64e81592 100644 --- a/eid_mcm.lua +++ b/eid_mcm.lua @@ -138,7 +138,7 @@ end function EID:AddBooleanSetting(category, optionName, displayText, params) 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( "EID", category, { @@ -165,7 +165,7 @@ end function EID:AddNumberSetting(category, optionName, displayText, minimum, maximum, params) 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( "EID", category, { @@ -191,7 +191,7 @@ end function EID:AddScrollSetting(category, optionName, displayText, scrollTable, params) 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( "EID", category, { @@ -436,7 +436,7 @@ if MCMLoaded then local diceSteps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -- 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", 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}) ----"Options?" Spoilers---- - if REPENTANCE then + if EID.isRepentance then MCM.AddSpace("EID", "Display") MCM.AddText("EID", "Display", "Interaction with 'Options?'") end @@ -596,7 +596,7 @@ if MCMLoaded then --------------------------------------------------------------------------- -----------------------------BAG OF CRAFTING------------------------------- - if REPENTANCE then + if EID.isRepentance then -- Bag of Crafting Display 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"}}) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 7d9d6552..0d43a491 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -10,7 +10,7 @@ EID.TabDescThisFrame = false EID.collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, } local maxSlot = 1 -- Repentance modifiers -if REPENTANCE then +if EID.isRepentance then maxSlot = 3 --include the AB+ collectiblesToCheck in this table! (wish there was an easy way to merge two tables) EID.collectiblesToCheck = { CollectibleType.COLLECTIBLE_VOID, @@ -78,7 +78,7 @@ end -- Handle Void local voidStatUps = { 0.2, 0.5, 1, 0.5, 0.2, 1 } 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 EID.VoidStatIncreases = {{},{},{}} EID.BlackRuneStatIncreases = {{},{},{}} @@ -100,10 +100,10 @@ local function VoidCallback(descObj, isRune) 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 + if EID.isRepentance then local optionIndex = pickup and pickup.OptionsPickupIndex 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:getObjectName(5, 100, firstOption) .. EID:getDescriptionEntry("VoidOptionText")) isAltOption = true @@ -113,7 +113,7 @@ local function VoidCallback(descObj, isRune) 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 + if (not EID.isRepentance and shopItem) then return descObj end local voidIntro = ((shopItem or isAltOption) and EID:getDescriptionEntry("VoidShopText")) or EID:getDescriptionEntry("VoidText") 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 function PandorasBoxCallback(descObj) - local strangeKeyOwned = REPENTANCE and EID:PlayersHaveTrinket(175) + local strangeKeyOwned = EID.isRepentance and EID:PlayersHaveTrinket(175) local pandoraCount = 0 local level = game:GetLevel() local stageNum = level:GetAbsoluteStage() @@ -173,7 +173,7 @@ local function PandorasBoxCallback(descObj) local skip9and12 = false -- many localizations do not have the ???/Void entry and the Dark Room entry -- 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 end @@ -196,7 +196,7 @@ local function PandorasBoxCallback(descObj) descObj.Description = string.gsub(descObj.Description, w:gsub("([^%w])", "%%%1"), "{{ColorBagComplete}}" .. w .. "{{CR}}") end -- 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 if strangeKeyOwned then @@ -228,7 +228,7 @@ local function SacrificeRoomCallback(descObj) end -if REPENTANCE then +if EID.isRepentance then -- Handle Birthright local function BirthrightCallback(descObj) descObj.Description = "" diff --git a/main.lua b/main.lua index f80f9965..3a036867 100644 --- a/main.lua +++ b/main.lua @@ -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.enableDebug = false 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") EID.Config = EID.UserConfig @@ -115,7 +116,7 @@ require("eid_holdmapdesc") require("eid_itemprediction") -- load Repentence descriptions -if REPENTANCE then +if EID.isRepentance then EID.GameVersion = "rep" for _,lang in ipairs(EID.Languages) do 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() 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) .. "/../" end --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 success = EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt") if not success then - if REPENTANCE then + if EID.isRepentance then success = EID:loadFont("../mods/"..modfolder.."/resources/font/eid_"..fontFile..".fnt") if not success then 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-------------- function EID:onNewFloor() pathsChecked = {} - if REPENTANCE then + if EID.isRepentance then EID.BoC.RoomQueries = {} EID.BoC.FloorQuery = {} EID.CraneItemType = {} @@ -199,7 +200,7 @@ questionMarkSprite:LoadGraphics() 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 - if not REPENTANCE or EID:hasCurseBlind() then + if not EID.isRepentance or EID:hasCurseBlind() then return false end if altPathItemChecked[pickup.InitSeed] ~= nil then @@ -245,7 +246,7 @@ end local initialItemNext = false local flipItemNext = false -if REPENTANCE then +if EID.isRepentance then EID.flipItemPositions = {} EID.flipMaxIndex = -1 @@ -586,9 +587,9 @@ function EID:printDescription(desc, cachedID) offsetX = offsetX + 1 local anim = "numbers" 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 - 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 end 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-------------------------------- EID.isMirrorRoom = false EID.isDeathCertRoom = false -if REPENTANCE then +if EID.isRepentance then function EID:AssignFlipItems() EID.flipMaxIndex = -1 local curRoomIndex = game:GetLevel():GetCurrentRoomDesc().ListIndex @@ -812,7 +813,7 @@ function EID:renderIndicator(entity, playerNum) entityPos = entityPos + entity:GetData()["EID_RenderOffset"] end -- 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 entityPos = entityPos + Vector(2.5,2.5) elseif entity.Type == 6 and entity.Variant == 16 then @@ -821,7 +822,7 @@ function EID:renderIndicator(entity, playerNum) end local sprite = nil if not EID:IsGridEntity(entity) then sprite = entity:GetSprite() end - if REPENTANCE then + if EID.isRepentance then repDiv = 255 if EID.isMirrorRoom then local screenCenter = EID:getScreenSize()/2 @@ -931,13 +932,13 @@ function EID:setPlayer() -- Old simple setPlayer, to reduce runtime in single player if numPlayers == 1 or not EID.Config["CoopDescriptions"] then 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 else EID.player = p end 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.coopAllPlayers = EID.players EID.controllerIndexes[p.ControllerIndex] = 1 @@ -956,7 +957,7 @@ function EID:setPlayer() if player.Parent == nil then local newIndex = not EID.controllerIndexes[player.ControllerIndex] -- 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 player = player:GetOtherTwin() or player end @@ -971,7 +972,7 @@ function EID:setPlayer() end EID.player = EID.coopAllPlayers[1] -- 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 end @@ -987,15 +988,6 @@ function EID:onGameUpdate() EID:checkPlayersForMissingItems() EID:evaluateQueuedItems() 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 collSpawned = false @@ -1017,7 +1009,7 @@ function EID:onGameUpdate() end -- 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 if EID.CraneItemType[tostring(crane.InitSeed)] then if crane:GetSprite():IsPlaying("Prize") then @@ -1065,7 +1057,7 @@ end local hasShownStartWarning = false 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 -- 1.7.9b (Dec. 08, 2022): The IsAvailable function was added (checking for Isaac.RunCallback existing instead) if Isaac.RunCallback == nil then @@ -1113,7 +1105,7 @@ local function checkPosModifiers() else EID:removeTextPosModifier("Greed Mode Horizontal") end - if not REPENTANCE then + if not EID.isRepentance then -- AB+ Schoolbag adjustment if EID.player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then 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 return end - if REPENTANCE then + if EID.isRepentance then local hasBag, bagPlayer = EID:PlayersHaveCollectible(710) if hasBag then EID.bagPlayer = bagPlayer @@ -1229,7 +1221,7 @@ local function onRender() EID.holdTabCounter = 0 end -- 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) if dropTriggered then local playerPressingDrop = EID.coopMainPlayers[playerNumPressingDrop] @@ -1287,7 +1279,7 @@ local function onRender() local displayedDesc = {} -- 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+) - if REPENTANCE then + if EID.isRepentance then for playerNum,player in ipairs(playerSearch) do if player:HasCollectible(710) then local craftingSuccess = EID:handleBagOfCraftingRendering() @@ -1440,7 +1432,7 @@ local function onRender() if EID:getEntityData(closest, "EID_DontHide") ~= true then 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 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 (not EID.Config["DisplayObstructedSoulstoneInfo"] and isSoulstone)) and (not pathsChecked[closest.InitSeed] and not attemptPathfind(closest)) @@ -1461,7 +1453,7 @@ local function onRender() --Handle Pills if EID:getEntityData(closest, "EID_DontHide") ~= true then 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 (not pathsChecked[closest.InitSeed] and not attemptPathfind(closest)) if isOptionsSpawn or hideinShop or obstructed then @@ -1472,7 +1464,7 @@ local function onRender() local pillColor = closest.SubType local pool = game:GetItemPool() 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 wasUsed = EID:WasPillUsed(pillColor) @@ -1495,7 +1487,7 @@ local function onRender() if room:GetType() == RoomType.ROOM_SACRIFICE and EID.Config["DisplaySacrificeInfo"] then local desc = EID:getDescriptionObj(-999, -1, closest.VarData + 1, closest) 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 local desc = EID:getDescriptionObj(5, 100, 692, closest, false) desc.Description = EID:trimSanguineDesc(desc) @@ -1574,7 +1566,7 @@ end EID:AddCallback(ModCallbacks.MC_USE_ITEM, OnUseD4, CollectibleType.COLLECTIBLE_D4) -- Re-init transformation progress and item interactions after using Genesis -if REPENTANCE then +if EID.isRepentance then local function OnUseGenesis(_, _, _, _) OnGameStartGeneral() CheckAllActiveItemProgress() @@ -1590,7 +1582,7 @@ function EID:OnUsePill(pillEffectID, player, useFlags) EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags, pillColor) -- Echo Chamber tracking -- 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) - 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 end @@ -1648,7 +1640,7 @@ function EID:OnGameStart(isSave) EID.UsedPillColors = savedEIDConfig["UsedPillColors"] or {} end - if REPENTANCE then + if EID.isRepentance then EID.BoC.BagItems = {} EID.CraneItemType = {} EID.flipItemPositions = {} @@ -1711,7 +1703,7 @@ EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, EID.OnGameStart) --Saving Moddata-- function EID:OnGameExit() - if REPENTANCE then + if EID.isRepentance then EID.Config["BagContent"] = EID.BoC.BagItems or {} EID.Config["BagFloorContent"] = EID.BoC.RoomQueries or {} EID.Config["CraneItemType"] = EID.CraneItemType or {}