Merge pull request #451 from kittenchilly/master

Change redundant XML checking + EID:AreAchievementsAllowed()
This commit is contained in:
Buurazu authored and GitHub committed 2022-04-25 22:22:10 -04:00
commit bebfd7ab86
4 files changed
+66 -49

No files matched your search

+21 -2
View File
@@ -22,8 +22,8 @@ end
-------------------------Handle API Functions -----------------------------
local nullVector = Vector(0,0)
local game = Game()
local maxCardID = REPENTANCE and 97 or 54
local maxPillID = REPENTANCE and 14 or 13
local maxCardID = Card.NUM_CARDS - 1
local maxPillID = PillColor.NUM_PILLS - 1
local dynamicSpriteCache = {} -- used to store sprite objects of collectible icons etc.
-- Adds a description for a collectible. Optional parameters: itemName, language
@@ -1210,6 +1210,25 @@ function EID:isCollectibleUnlockedAnyPool(collectibleID)
end
end
-- Achievements Locked Check (do we have Cube of Meat or Book of Revelations unlocked?)
function EID:AreAchievementsAllowed()
-- Tainted characters have definitely beaten Mom!
-- (Fixes Tainted Lost's item pools, and potentially modded character's mechanics, ruining this check)
if EID.player:GetPlayerType() < 21 then
-- Challenge runs and TMTrainer might break the pool, so ignore them.
if not game:GetSeeds():IsCustomRun() and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) then
local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS)
if not hasBookOfRevelationsUnlocked then
local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT)
if not hasCubeOfMeatUnlocked then
return false
end
end
end
end
return true
end
-- Converts a given table into a string containing the crafting icons of the table
-- Example input: {1,2,3,4,5,6,7,8}
-- Result: "{{Crafting1}}{{Crafting2}}{{Crafting3}}{{Crafting4}}{{Crafting5}}{{Crafting6}}{{Crafting7}}{{Crafting8}}"
+37 -26
View File
@@ -178,7 +178,8 @@ local poolToIcon = { [0]="{{TreasureRoom}}",[1]="{{Shop}}",[2]="{{BossRoom}}",[3
local CraftingMaxItemID = EID.XMLMaxItemID
local CraftingFixedRecipes = EID.XMLRecipes
local CraftingItemPools = EID.XMLItemPools
local CraftingItemQualities = EID.XMLItemQualities
local CraftingItemQualities = {}
--These are recipes that have already been calculated, plus the contents of recipes.xml
local calculatedRecipes = {}
@@ -515,34 +516,44 @@ local function qualitySort(a, b)
end
local moddedCrafting = false
-- Check for modded items past the known max item ID on game start (can also support game updates)
-- Only works if the new items are at Weight 1.0 in their item pools, but better than nothing
local function GameStartCrafting()
if EID.Config["BagOfCraftingModdedRecipes"] and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) and EID.itemConfig:GetCollectible(EID.XMLMaxItemID+1) ~= nil and not moddedCrafting then
-- Items past max ID detected
CraftingMaxItemID = EID.XMLMaxItemID -- XMLMaxItemID is never modified
-- Add new item qualities
local coll = EID.itemConfig:GetCollectible(CraftingMaxItemID+1)
while coll ~= nil do
CraftingMaxItemID = CraftingMaxItemID + 1
CraftingItemQualities[coll.ID] = coll.Quality
coll = EID.itemConfig:GetCollectible(CraftingMaxItemID+1)
end
local itemPool = game:GetItemPool()
-- Add new items to the crafting item pools, assuming Weight 1.0
for poolNum,_ in pairs(poolToIcon) do
for i=1,EID.XMLMaxItemID do itemPool:AddRoomBlacklist(i) end
local collID = itemPool:GetCollectible(poolNum, false, 1, 25)
while collID ~= 25 and collID > 0 do
table.insert(CraftingItemPools[poolNum+1], {collID, 1.0})
itemPool:AddRoomBlacklist(collID)
collID = itemPool:GetCollectible(poolNum, false, 1, 25)
if not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) then
for i=1, EID.XMLMaxItemID do
local item = EID.itemConfig:GetCollectible(i)
if item ~= nil then
CraftingItemQualities[item.ID] = item.Quality
end
itemPool:ResetRoomBlacklist()
end
moddedCrafting = true
-- Check for modded items past the known max item ID on game start (can also support game updates)
-- Only works if the new items are at Weight 1.0 in their item pools, but better than nothing
if EID.Config["BagOfCraftingModdedRecipes"] and EID.itemConfig:GetCollectible(EID.XMLMaxItemID+1) ~= nil and not moddedCrafting then
-- Items past max ID detected
CraftingMaxItemID = EID.XMLMaxItemID -- XMLMaxItemID is never modified
-- Add new item qualities
local coll = EID.itemConfig:GetCollectible(CraftingMaxItemID+1)
while coll ~= nil do
CraftingMaxItemID = CraftingMaxItemID + 1
CraftingItemQualities[coll.ID] = coll.Quality
coll = EID.itemConfig:GetCollectible(CraftingMaxItemID+1)
end
local itemPool = game:GetItemPool()
-- Add new items to the crafting item pools, assuming Weight 1.0
for poolNum,_ in pairs(poolToIcon) do
for i=1,EID.XMLMaxItemID do itemPool:AddRoomBlacklist(i) end
local collID = itemPool:GetCollectible(poolNum, false, 1, 25)
while collID ~= 25 and collID > 0 do
table.insert(CraftingItemPools[poolNum+1], {collID, 1.0})
itemPool:AddRoomBlacklist(collID)
collID = itemPool:GetCollectible(poolNum, false, 1, 25)
end
itemPool:ResetRoomBlacklist()
end
moddedCrafting = true
end
sortNeeded = true
end
end
+2 -5
View File
@@ -1,7 +1,7 @@
--This file was autogenerated using 'lookuptable_generator.py' found in the scripts folder
--It will have to be updated whenever the game's item XML files are updated
--The highest item ID found
EID.XMLMaxItemID = 732
--The highest item ID found (uses an enum, so doesn't need to be updated)
EID.XMLMaxItemID = CollectibleType.NUM_COLLECTIBLES - 1
--The fixed recipes, for use in Bag of Crafting
EID.XMLRecipes = {["29,29,29,29,29,29,29,29"] = 36, ["8,8,8,8,8,8,8,8"] = 177, ["1,1,1,1,1,1,1,1"] = 45, ["2,2,2,2,2,2,2,2"] = 686, ["3,3,3,3,3,3,3,3"] = 118, ["12,12,12,12,12,12,12,12"] = 343, ["15,15,15,15,15,15,15,15"] = 37, ["21,21,21,21,21,21,21,21"] = 85, ["1,2,4,4,4,4,4,5"] = 331, ["4,4,4,4,4,4,4,4"] = 182, ["22,22,22,22,22,22,22,22"] = 75, ["3,22,22,22,22,22,22,22"] = 654, ["1,1,1,1,1,1,7,7"] = 639, ["12,12,12,12,12,12,13,13"] = 175, ["17,17,17,17,17,17,17,17"] = 483, ["15,15,15,15,15,15,16,16"] = 483, ["6,6,6,6,6,6,6,6"] = 628, ["24,24,24,24,24,24,24,24"] = 489, ["25,25,25,25,25,25,25,25"] = 580, }
@@ -39,9 +39,6 @@ EID.XMLItemPools = {{{1, 1.0}, {2, 1.0}, {3, 1.0}, {4, 1.0}, {5, 1.0}, {6, 1.0},
{{26, 1.0}, {42, 1.0}, {140, 1.0}, {268, 1.0}, {273, 1.0}, {336, 0.5}, {480, 1.0}, {618, 0.5}, {639, 1.0}}, -- rottenBeggar
}
--The quality of each item, for use in Bag of Crafting
EID.XMLItemQualities = {[1] = 3, [2] = 2, [3] = 3, [4] = 4, [5] = 0, [6] = 2, [7] = 3, [8] = 1, [9] = 0, [10] = 2, [11] = 2, [12] = 4, [13] = 2, [14] = 2, [15] = 2, [16] = 2, [17] = 3, [18] = 3, [19] = 0, [20] = 3, [21] = 2, [22] = 1, [23] = 1, [24] = 1, [25] = 1, [26] = 1, [27] = 1, [28] = 1, [29] = 1, [30] = 1, [31] = 1, [32] = 3, [33] = 1, [34] = 2, [35] = 1, [36] = 0, [37] = 1, [38] = 2, [39] = 1, [40] = 0, [41] = 0, [42] = 1, [44] = 0, [45] = 1, [46] = 2, [47] = 1, [48] = 3, [49] = 2, [50] = 3, [51] = 3, [52] = 4, [53] = 1, [54] = 2, [55] = 1, [56] = 1, [57] = 2, [58] = 3, [59] = 0, [60] = 1, [62] = 1, [63] = 2, [64] = 2, [65] = 1, [66] = 1, [67] = 1, [68] = 3, [69] = 3, [70] = 3, [71] = 2, [72] = 2, [73] = 2, [74] = 1, [75] = 2, [76] = 2, [77] = 1, [78] = 3, [79] = 3, [80] = 3, [81] = 3, [82] = 3, [83] = 3, [84] = 2, [85] = 2, [86] = 1, [87] = 1, [88] = 1, [89] = 2, [90] = 3, [91] = 2, [92] = 2, [93] = 2, [94] = 1, [95] = 1, [96] = 2, [97] = 2, [98] = 3, [99] = 2, [100] = 1, [101] = 2, [102] = 1, [103] = 1, [104] = 3, [105] = 4, [106] = 2, [107] = 2, [108] = 4, [109] = 3, [110] = 3, [111] = 0, [112] = 2, [113] = 2, [114] = 4, [115] = 2, [116] = 2, [117] = 0, [118] = 4, [119] = 2, [120] = 2, [121] = 2, [122] = 2, [123] = 1, [124] = 1, [125] = 2, [126] = 0, [127] = 3, [128] = 1, [129] = 1, [130] = 2, [131] = 2, [132] = 3, [133] = 3, [134] = 2, [135] = 1, [136] = 1, [137] = 1, [138] = 2, [139] = 3, [140] = 1, [141] = 0, [142] = 2, [143] = 2, [144] = 0, [145] = 3, [146] = 3, [147] = 1, [148] = 0, [149] = 4, [150] = 3, [151] = 3, [152] = 2, [153] = 3, [154] = 2, [155] = 2, [156] = 2, [157] = 3, [158] = 3, [159] = 3, [160] = 2, [161] = 1, [162] = 1, [163] = 1, [164] = 2, [165] = 3, [166] = 2, [167] = 1, [168] = 4, [169] = 4, [170] = 3, [171] = 1, [172] = 2, [173] = 3, [174] = 1, [175] = 1, [176] = 1, [177] = 0, [178] = 3, [179] = 3, [180] = 0, [181] = 2, [182] = 4, [183] = 3, [184] = 3, [185] = 3, [186] = 0, [187] = 1, [188] = 0, [189] = 3, [190] = 3, [191] = 2, [192] = 1, [193] = 2, [194] = 1, [195] = 1, [196] = 3, [197] = 2, [198] = 1, [199] = 3, [200] = 1, [201] = 2, [202] = 2, [203] = 3, [204] = 1, [205] = 1, [206] = 2, [207] = 2, [208] = 3, [209] = 2, [210] = 1, [211] = 1, [212] = 2, [213] = 2, [214] = 1, [215] = 3, [216] = 3, [217] = 3, [218] = 2, [219] = 2, [220] = 2, [221] = 3, [222] = 2, [223] = 4, [224] = 3, [225] = 2, [226] = 2, [227] = 1, [228] = 2, [229] = 2, [230] = 3, [231] = 2, [232] = 4, [233] = 0, [234] = 4, [236] = 1, [237] = 3, [238] = 0, [239] = 0, [240] = 1, [241] = 3, [242] = 2, [243] = 3, [244] = 3, [245] = 4, [246] = 2, [247] = 2, [248] = 2, [249] = 3, [250] = 1, [251] = 2, [252] = 1, [253] = 2, [254] = 2, [255] = 3, [256] = 1, [257] = 2, [258] = 1, [259] = 3, [260] = 3, [261] = 4, [262] = 0, [263] = 2, [264] = 2, [265] = 3, [266] = 2, [267] = 1, [268] = 3, [269] = 1, [270] = 1, [271] = 2, [272] = 1, [273] = 1, [274] = 0, [275] = 3, [276] = 0, [277] = 1, [278] = 3, [279] = 2, [280] = 1, [281] = 1, [282] = 1, [283] = 3, [284] = 3, [285] = 0, [286] = 2, [287] = 0, [288] = 1, [289] = 2, [290] = 0, [291] = 1, [292] = 4, [293] = 2, [294] = 1, [295] = 1, [296] = 2, [297] = 2, [298] = 1, [299] = 1, [300] = 2, [301] = 3, [302] = 1, [303] = 2, [304] = 1, [305] = 3, [306] = 3, [307] = 3, [308] = 1, [309] = 2, [310] = 2, [311] = 3, [312] = 2, [313] = 4, [314] = 1, [315] = 0, [316] = 0, [317] = 3, [318] = 1, [319] = 0, [320] = 2, [321] = 1, [322] = 2, [323] = 0, [324] = 2, [325] = 1, [326] = 0, [327] = 2, [328] = 2, [329] = 2, [330] = 2, [331] = 4, [332] = 2, [333] = 3, [334] = 3, [335] = 3, [336] = 3, [337] = 1, [338] = 2, [339] = 1, [340] = 1, [341] = 3, [342] = 3, [343] = 2, [344] = 1, [345] = 3, [346] = 1, [347] = 3, [348] = 2, [349] = 1, [350] = 3, [351] = 1, [352] = 1, [353] = 2, [354] = 2, [355] = 2, [356] = 3, [357] = 1, [358] = 1, [359] = 3, [360] = 4, [361] = 2, [362] = 2, [363] = 3, [364] = 1, [365] = 1, [366] = 1, [367] = 1, [368] = 1, [369] = 2, [370] = 3, [371] = 1, [372] = 3, [373] = 3, [374] = 3, [375] = 3, [376] = 2, [377] = 1, [378] = 2, [379] = 2, [380] = 2, [381] = 3, [382] = 2, [383] = 1, [384] = 2, [385] = 1, [386] = 1, [387] = 3, [388] = 0, [389] = 3, [390] = 3, [391] = 0, [392] = 1, [393] = 2, [394] = 1, [395] = 4, [396] = 1, [397] = 3, [398] = 1, [399] = 4, [400] = 1, [401] = 2, [402] = 3, [403] = 1, [404] = 1, [405] = 1, [406] = 2, [407] = 3, [408] = 1, [409] = 2, [410] = 2, [411] = 3, [412] = 2, [413] = 1, [414] = 3, [415] = 4, [416] = 2, [417] = 3, [418] = 2, [419] = 3, [420] = 1, [421] = 1, [422] = 3, [423] = 2, [424] = 3, [425] = 2, [426] = 0, [427] = 1, [428] = 2, [429] = 2, [430] = 1, [431] = 2, [432] = 2, [433] = 0, [434] = 2, [435] = 1, [436] = 1, [437] = 1, [438] = 3, [439] = 3, [440] = 2, [441] = 4, [442] = 1, [443] = 3, [444] = 3, [445] = 1, [446] = 1, [447] = 0, [448] = 1, [449] = 1, [450] = 2, [451] = 2, [452] = 2, [453] = 3, [454] = 2, [455] = 2, [456] = 1, [457] = 2, [458] = 3, [459] = 3, [460] = 1, [461] = 3, [462] = 3, [463] = 2, [464] = 3, [465] = 2,Line truncated
--The pools that each item is in, for roughly checking if a given item is unlocked
EID.XMLItemIsInPools = {[1] = {0, 16, 23}, [2] = {0, 16}, [3] = {0, 16, 23}, [4] = {0, 16, 23}, [5] = {0, 16, 23}, [6] = {0, 16}, [7] = {0, 4, 16, 21, 29}, [8] = {0, 3, 16, 28}, [9] = {7}, [10] = {0, 13, 16, 28}, [11] = {5, 18, 22}, [12] = {0, 16, 17, 24}, [13] = {0, 11, 16, 24}, [14] = {0, 2, 11, 17}, [15] = {0, 17, 24}, [16] = {5, 17, 22}, [17] = {0, 5, 22}, [18] = {}, [19] = {0}, [20] = {5, 22}, [21] = {1, 10, 23}, [22] = {2, 10, 17}, [23] = {2, 10, 17}, [24] = {2, 10, 17}, [25] = {2, 10, 17}, [26] = {2, 10, 17, 30}, [27] = {2, 17, 29}, [28] = {2, 8, 17}, [29] = {2, 8, 15, 17, 27}, [30] = {2, 15, 17, 24, 27}, [31] = {2, 15, 17, 24, 27}, [32] = {2, 8, 17, 23}, [33] = {1, 4, 6}, [34] = {3, 6, 16, 20}, [35] = {3, 5, 6, 16, 20, 22}, [36] = {0, 7}, [37] = {0, 16, 25}, [38] = {0, 16, 23}, [39] = {0, 15, 27}, [40] = {0, 24}, [41] = {0, 15, 27}, [42] = {0, 16, 30}, [44] = {0, 23}, [45] = {0, 16, 24}, [46] = {0, 10, 18, 23}, [47] = {0, 16, 23}, [48] = {0, 16, 23}, [49] = {0, 23, 24}, [50] = {16}, [51] = {2, 3, 11, 12, 19, 20, 23, 24}, [52] = {0, 16}, [53] = {0, 24}, [54] = {1, 10}, [55] = {0, 15, 16, 27}, [56] = {0, 16}, [57] = {0, 13, 16, 28}, [58] = {0, 6}, [59] = {}, [60] = {1, 29}, [62] = {0, 16}, [63] = {1, 14, 18, 23}, [64] = {1, 16}, [65] = {0, 6, 16}, [66] = {0, 23}, [67] = {0, 3, 16, 20, 24, 28}, [68] = {0, 16, 20, 23}, [69] = {0, 16}, [70] = {2, 11, 17}, [71] = {0, 17}, [72] = {0, 4, 21, 24}, [73] = {17, 18, 19, 24, 28}, [74] = {3, 8, 20}, [75] = {0, 1, 18}, [76] = {0, 18}, [77] = {0, 16, 23}, [78] = {0, 6, 16, 21}, [79] = {3, 11, 12, 19, 20, 24}, [80] = {3, 11, 12, 19, 20, 24}, [81] = {3, 9, 12, 19, 20}, [82] = {3, 11, 20, 24}, [83] = {3, 11, 20}, [84] = {3, 5, 18, 22}, [85] = {0, 1, 16, 23}, [86] = {0}, [87] = {0, 11, 16}, [88] = {0, 16, 28}, [89] = {0, 16, 23}, [90] = {23}, [91] = {0, 18, 23}, [92] = {0, 2}, [93] = {0, 16, 23}, [94] = {0, 16}, [95] = {0, 16, 23, 28}, [96] = {0, 16, 24, 28}, [97] = {0, 3, 6, 16, 20}, [98] = {0, 4, 16}, [99] = {0, 16, 28}, [100] = {0, 16, 28}, [101] = {0, 4, 16, 17}, [102] = {0, 1, 10, 11, 15, 16, 23, 27}, [103] = {0, 16}, [104] = {0, 16}, [105] = {0, 18, 23, 24}, [106] = {0, 16, 25}, [107] = {0, 16}, [108] = {0, 4, 16}, [109] = {0, 3, 20, 24}, [110] = {0, 15, 16, 24, 27}, [111] = {0, 10, 16}, [112] = {4, 21, 28}, [113] = {0, 3, 20, 28}, [114] = {0, 3, 15, 16, 20, 27}, [115] = {0, 3, 16}, [116] = {1, 14, 18, 23}, [117] = {0, 16, 28}, [118] = {3, 20, 24}, [119] = {24}, [120] = {0, 5, 16, 17, 22}, [121] = {0, 5, 16, 17, 22}, [122] = {3, 11, 20, 24}, [123] = {0, 3, 6, 20}, [124] = {0, 4, 16}, [125] = {0, 16, 25}, [126] = {0, 11, 12, 16, 19}, [127] = {0, 3, 5, 11, 22}, [128] = {0, 13, 16, 28}, [129] = {0}, [130] = {}, [131] = {0, 16}, [132] = {16, 17, 20}, [133] = {3, 9, 12, 19, 20}, [134] = {3, 9, 12, 19, 20}, [135] = {24}, [136] = {0, 23}, [137] = {0, 1, 16, 23, 24, 25}, [138] = {0, 16, 21, 29}, [139] = {1, 15, 18, 27}, [140] = {0, 9, 16, 25, 30}, [141] = {2}, [142] = {0, 4, 16}, [143] = {0, 2, 11, 17}, [144] = {0, 10, 28}, [145] = {3, 9, 12, 19, 20}, [146] = {0, 4, 16}, [147] = {1, 23}, [148] = {0, 16}, [149] = {0, 16}, [150] = {0, 16}, [151] = {0, 16}, [152] = {0, 16, 23}, [153] = {0, 16, 23}, [154] = {0, 16}, [155] = {0, 16, 28}, [156] = {1, 4, 18}, [157] = {0, 3, 16, 20, 24}, [158] = {}, [159] = {3, 11, 20, 24}, [160] = {0}, [161] = {0, 16}, [162] = {0, 4, 16, 21}, [163] = {0, 3, 16, 28}, [164] = {1}, [165] = {2}, [166] = {0, 18, 23, 24}, [167] = {0, 16, 24, 28}, [168] = {5, 22}, [169] = {0, 16}, [170] = {0, 16, 28}, [171] = {0}, [172] = {0, 3, 16, 20, 28}, [173] = {0, 4}, [174] = {0, 16, 28}, [175] = {0, 13, 16, 27}, [176] = {0, 2, 17, 24}, [177] = {1, 10, 24}, [178] = {0, 4, 21}, [179] = {8}, [180] = {0, 10}, [181] = {}, [182] = {4, 21, 24}, [183] = {2, 17, 29}, [184] = {4, 21}, [185] = {4, 21}, [186] = {0, 3, 16}, [187] = {3, 20}, [188] = {0, 16, 28}, [189] = {0, 16, 23}, [190] = {0, 5, 22, 25}, [191] = {0, 16}, [192] = {0, 6, 16}, [193] = {2, 17, 24}, [194] = {2, 8, 17, 23}, [195] = {1, 2, 10, 11, 15, 17, 27}, [196] = {2, 8, 17, 23}, [197] = {2, 17, 21}, [198] = {2, 10, 17}, [199] = {1, 13, 15, 17, 27}, [200] = {0, 15, 16, 27}, [201] = {0, 16}, [202] = {0}, [203] = {1}, [204] = {1, 10, 18}, [205] = {1, 14}, [206] = {0, 16}, [207] = {17, 28}, [208] = {1, 18, 23, 24}, [209] = {0, 7, 16, 25}, [210] = {0, 16}, [211] = {0}, [212] = {3, 9, 12, 19, 20, 23}, [213] = {0, 5, 16, 22}, [214] = {0, 16, 24}, [215] = {3, 12}, [216] = {3, 11, 12, 19, 20}, [217] = {0, 15, 16, 27}, [218] = {2}, [219] = {2}, [220] = {0, 16, 25}, [221] = {0, 16}, [222] = {0, 16}, [223] = {0, 16}, [224] = {0, 16}, [225] = {0, 3, 11, 12, 19, 20}, [226] = {5, 16, 22}, [227] = {0, 1, 23}, [228] = {0, 15, 16, 27}, [229] = {0, 16}, [230] = {3, 11, 20, 24}, [231] = {0, 16}, [232] = {1, 23}, [233] = {0, 16}, [234] = {0, 16}, [236] = {0, 16}, [237] = {0, 3, 16, 20}, [238] = {}, [239] = {}, [240] = {0, 2, 11, 17}, [241] = {3, 11, 12}, [242] = {0, 5, 16, 22}, [243] = {4, 21}, [244] = {0, 16, 23}, [245] = {0, Line truncated
+6 -16
View File
@@ -1086,23 +1086,13 @@ local function checkStartOfRunWarnings()
demoDescObj.Description = EID:getDescriptionEntry("ModdedRecipesWarningText") or ""
EID:displayPermanentText(demoDescObj, "AchievementWarningTitle")
hasShownStartWarning = true
-- Achievements Locked Check (do we have Cube of Meat or Book of Revelations unlocked?)
else
local characterID = EID.player:GetPlayerType()
-- ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom!
-- (Fixes Tainted Lost's item pools, and potentially modded character's mechanics, ruining this check)
if characterID < 21 and game.Challenge == 0 and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) then
local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS)
if not hasBookOfRevelationsUnlocked then
local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT)
if not hasCubeOfMeatUnlocked then
local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or ""
demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or ""
EID:displayPermanentText(demoDescObj, "AchievementWarningTitle")
hasShownStartWarning = true
end
end
if not EID:AreAchievementsAllowed() then
local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or ""
demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or ""
EID:displayPermanentText(demoDescObj, "AchievementWarningTitle")
hasShownStartWarning = true
end
end
elseif hasShownStartWarning then