From 64279145add6de184d7a7be8f6958f158117a118 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Mon, 25 Apr 2022 11:52:06 -0500 Subject: [PATCH] A lot of code cleanup --- eid_api.lua | 19 +++++++++++++ eid_bagofcrafting.lua | 63 +++++++++++++++++++++++++------------------ eid_xmldata.lua | 7 ++--- main.lua | 22 +++++---------- 4 files changed, 64 insertions(+), 47 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index cacd98b7..db891189 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -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}}" diff --git a/eid_bagofcrafting.lua b/eid_bagofcrafting.lua index be8a5cb2..628c263d 100644 --- a/eid_bagofcrafting.lua +++ b/eid_bagofcrafting.lua @@ -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 diff --git a/eid_xmldata.lua b/eid_xmldata.lua index 9b32d0fa..13ba21a7 100644 --- a/eid_xmldata.lua +++ b/eid_xmldata.lua @@ -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, [466] = 2, [467] = 1, [468] = 0, [469] = 1, [470] = 0, [471] = 2, [472] = 1, [473] = 1, [474] = 0, [475] = 0, [476] = 3, [477] = 4, [478] = 1, [479] = 3, [480] = 2, [481] = 0, [482] = 0, [483] = 3, [484] = 1, [485] = 1, [486] = 1, [487] = 2, [488] = 1, [489] = 4, [490] = 3, [491] = 2, [492] = 2, [493] = 1, [494] = 3, [495] = 3, [496] = 3, [497] = 2, [498] = 1, [499] = 3, [500] = 3, [501] = 1, [502] = 1, [503] = 3, [504] = 0, [505] = 1, [506] = 2, [507] = 2, [508] = 2, [509] = 1, [510] = 1, [511] = 1, [512] = 1, [513] = 2, [514] = 2, [515] = 3, [516] = 2, [517] = 1, [518] = 2, [519] = 2, [520] = 3, [521] = 2, [522] = 1, [523] = 1, [524] = 3, [525] = 1, [526] = 2, [527] = 3, [528] = 3, [529] = 2, [530] = 2, [531] = 3, [532] = 2, [533] = 2, [534] = 3, [535] = 2, [536] = 2, [537] = 1, [538] = 2, [539] = 1, [540] = 2, [541] = 1, [542] = 2, [543] = 1, [544] = 2, [545] = 3, [546] = 3, [547] = 3, [548] = 1, [549] = 3, [550] = 4, [551] = 4, [552] = 4, [553] = 3, [554] = 2, [555] = 1, [556] = 3, [557] = 2, [558] = 2, [559] = 2, [560] = 1, [561] = 1, [562] = 3, [563] = 1, [564] = 3, [565] = 1, [566] = 2, [567] = 3, [568] = 2, [569] = 2, [570] = 3, [571] = 2, [572] = 3, [573] = 3, [574] = 2, [575] = 3, [576] = 2, [577] = 2, [578] = 1, [579] = 3, [580] = 3, [581] = 4, [582] = 1, [583] = 2, [584] = 3, [585] = 2, [586] = 3, [588] = 2, [589] = 2, [590] = 3, [591] = 2, [592] = 3, [593] = 2, [594] = 2, [595] = 2, [596] = 3, [597] = 3, [598] = 3, [599] = 1, [600] = 3, [601] = 3, [602] = 2, [603] = 1, [604] = 2, [605] = 0, [606] = 3, [607] = 1, [608] = 2, [609] = 3, [610] = 1, [611] = 2, [612] = 2, [614] = 2, [615] = 2, [616] = 3, [617] = 3, [618] = 2, [619] = 3, [621] = 2, [622] = 2, [623] = 1, [624] = 1, [625] = 4, [626] = 0, [627] = 0, [628] = 4, [629] = 3, [631] = 1, [632] = 2, [633] = 0, [634] = 2, [635] = 1, [636] = 4, [637] = 3, [638] = 2, [639] = 2, [640] = 3, [641] = 2, [642] = 2, [643] = 4, [644] = 1, [645] = 1, [646] = 3, [647] = 2, [649] = 1, [650] = 2, [651] = 3, [652] = 1, [653] = 3, [654] = 2, [655] = 1, [656] = 2, [657] = 2, [658] = 1, [659] = 1, [660] = 3, [661] = 2, [663] = 2, [664] = 4, [665] = 2, [667] = 2, [668] = 0, [669] = 3, [670] = 2, [671] = 2, [672] = 1, [673] = 2, [674] = 2, [675] = 1, [676] = 2, [677] = 2, [678] = 4, [679] = 3, [680] = 3, [681] = 1, [682] = 3, [683] = 2, [684] = 3, [685] = 2, [686] = 2, [687] = 3, [688] = 2, [689] = 4, [690] = 3, [691] = 4, [692] = 1, [693] = 2, [694] = 3, [695] = 3, [696] = 3, [697] = 3, [698] = 4, [699] = 3, [700] = 2, [701] = 3, [702] = 2, [703] = 2, [704] = 3, [705] = 3, [706] = 4, [707] = 1, [708] = 3, [709] = 3, [710] = 4, [711] = 4, [712] = 3, [713] = 3, [714] = 0, [715] = 0, [716] = 3, [717] = 2, [719] = 2, [720] = 2, [721] = 2, [722] = 3, [723] = 4, [724] = 3, [725] = 2, [726] = 2, [727] = 2, [728] = 3, [729] = 2, [730] = 3, [731] = 2, [732] = 3, } - --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, 16}, [246] = {1, 10, 18}, [247] = {1, 18, 24}, [248] = {1, 18}, [249] = {1}, [250] = {1}, [251] = {1, 18, 23}, [252] = {1, 18}, [253] = {2, 17, 24}, [254] = {2, 16, 17, 24}, [255] = {2, 8, 17, 23}, [256] = {0, 16, 25}, [257] = {0, 16}, [258] = {5, 16, 22}, [259] = {3, 11, 20}, [260] = {1, 12, 18, 19}, [261] = {0, 16, 24}, [262] = {3, 5, 11, 22}, [263] = {5, 22, 23}, [264] = {0, 13, 16, 28}, [265] = {0, 16, 28}, [266] = {0, 16, 28}, [267] = {0, 16, 23, 28}, [268] = {0, 3, 16, 20, 28, 30}, [269] = {0, 3, 16, 20, 28}, [270] = {0, 20, 28}, [271] = {0, 5, 10, 16, 22}, [272] = {0, 13, 28}, [273] = {0, 16, 28, 30}, [274] = {0, 16, 28}, [275] = {0, 3, 28}, [276] = {0, 24}, [277] = {0, 16, 28}, [278] = {0, 3, 11, 28}, [279] = {0, 13, 16, 28}, [280] = {0, 16, 28}, [281] = {0, 16, 28}, [282] = {0, 6}, [283] = {0, 18, 23}, [284] = {0, 18, 23}, [285] = {0, 18, 23}, [286] = {1, 5, 18, 22}, [287] = {0, 5, 6}, [288] = {0, 16}, [289] = {1, 18, 24}, [290] = {1}, [291] = {0, 16}, [292] = {0, 3, 6, 20}, [293] = {}, [294] = {0, 10}, [295] = {0, 1}, [296] = {1}, [297] = {1, 9, 18}, [298] = {0}, [299] = {0, 16}, [300] = {0, 16}, [301] = {0, 16}, [302] = {0, 16}, [303] = {0, 16}, [304] = {0}, [305] = {0, 16}, [306] = {0, 16}, [307] = {0, 16}, [308] = {0, 16}, [309] = {0, 16}, [310] = {0, 16}, [311] = {3, 20}, [312] = {0, 16}, [313] = {0, 4, 21}, [314] = {0, 17}, [315] = {0, 16}, [316] = {0, 5, 9, 16, 22}, [317] = {0, 16}, [318] = {0, 16}, [319] = {0, 16}, [320] = {0, 13, 16, 28}, [321] = {0, 5, 16, 22}, [322] = {0, 16, 28}, [323] = {0}, [324] = {0}, [325] = {0, 16}, [326] = {4}, [327] = {}, [328] = {}, [329] = {0, 16}, [330] = {0, 16}, [331] = {4, 21}, [332] = {0, 4, 16}, [333] = {0, 4, 16, 21}, [334] = {0, 4, 16, 21, 24}, [335] = {0, 4, 16, 21}, [336] = {0, 16, 30}, [337] = {1, 23}, [338] = {1, 23}, [339] = {2, 17}, [340] = {2, 11, 17}, [341] = {2, 8, 17, 27}, [342] = {2, 17}, [343] = {2, 8, 13, 17}, [344] = {2, 8, 17}, [345] = {2, 11, 17}, [346] = {2, 17}, [347] = {1}, [348] = {1, 5, 18, 22}, [349] = {1, 16, 29}, [350] = {0}, [351] = {0, 16}, [352] = {0, 16, 23}, [353] = {0, 16, 25}, [354] = {2, 8, 17}, [355] = {2, 8, 15, 17, 27}, [356] = {1, 14, 18}, [357] = {1, 16, 23}, [358] = {0, 16}, [359] = {0, 16}, [360] = {3, 20, 28}, [361] = {0, 28}, [362] = {0, 10, 16, 23, 29}, [363] = {4, 21, 28}, [364] = {0, 13, 16, 28}, [365] = {0, 13, 16, 28}, [366] = {0, 16, 25}, [367] = {0, 16, 25}, [368] = {0, 16}, [369] = {0, 16}, [370] = {2, 8, 17, 23}, [371] = {0, 9, 12, 16, 19}, [372] = {1, 14, 18, 28}, [373] = {0, 16, 24}, [374] = {0, 4, 16}, [375] = {0, 16}, [376] = {1, 10}, [377] = {0, 16}, [378] = {0, 7, 16}, [379] = {0, 16}, [380] = {1, 16, 18}, [381] = {0}, [382] = {0, 16, 23}, [383] = {1, 16, 23}, [384] = {0, 16, 28}, [385] = {0, 10, 28}, [386] = {0, 18, 23}, [387] = {4, 21}, [388] = {0, 5, 13, 28}, [389] = {0, 5, 16, 22}, [390] = {0, 4, 21, 28}, [391] = {0, 3, 16, 20}, [392] = {0, 16}, [393] = {0, 16}, [394] = {0, 16, 24}, [395] = {0, 16, 23}, [396] = {1}, [397] = {0, 16, 23}, [398] = {0, 16}, [399] = {3, 20, 24}, [400] = {4, 21}, [401] = {0, 16}, [402] = {1, 5, 18, 22}, [403] = {1, 18, 23, 28}, [404] = {0, 28}, [405] = {0, 5, 18, 22}, [406] = {0, 18, 23}, [407] = {0, 16, 21}, [408] = {3, 12, 19, 20}, [409] = {3, 11, 20}, [410] = {0, 16}, [411] = {0, 3, 16, 20, 24}, [412] = {3, 20, 24}, [413] = {4, 21}, [414] = {1}, [415] = {4, 21}, [416] = {1, 16, 18}, [417] = {3, 28}, [418] = {0}, [419] = {0, 23}, [420] = {3, 11, 20}, [421] = {0, 16, 24}, [422] = {0, 1, 23}, [423] = {4, 21}, [424] = {1, 5, 22}, [425] = {1, 16, 23}, [426] = {0, 13, 16, 28}, [427] = {0, 23}, [428] = {2, 8, 17}, [429] = {}, [430] = {0, 13, 16, 28}, [431] = {0, 3, 16, 20}, [432] = {0, 16, 25}, [433] = {3, 20}, [434] = {1, 16, 18}, [435] = {0, 24, 28}, [436] = {0, 16}, [437] = {0, 23}, [438] = {2, 8, 17, 23}, [439] = {1, 15, 18, 23, 27, 29}, [440] = {0, 16}, [441] = {3, 20}, [442] = {3, 12, 19, 20}, [443] = {0, 16, 24}, [444] = {0, 8, 16, 23}, [445] = {0, 16}, [446] = {0, 16}, [447] = {0, 10, 16}, [448] = {0, 16}, [449] = {0, 16}, [450] = {5, 16, 22}, [451] = {1, 12, 18, 19, 20, 23}, [452] = {0, 16, 24}, [453] = {0, 16}, [454] = {0, 16}, [455] = {2, 8, 10, 17, 27}, [456] = {2, 8, 10, 17}, [457] = {0, 16}, [458] = {0, 16}, [459] = {0, 16}, [460] = {0, 16}, [461] = {0, 16}, [462] = {3, 20, 24}, [463] = {0, 16}, [464] = {4, 21}, [465] = {0, 16, 23}, [466] = {0, 16, 24}, [467] = {0, 16}, [468] = {3, 12, 19, 20, 28}, [469] = {0, 16}, [470] = {0, 16, 28}, [471] = {0, 16, 28}, [472] = {1, 18, 28}, [473] = {0, 16, 28}, [474] = {}, [475] = {1, 3, 9, 11, 12, 18, 19, 24}, [476] = {0, 18, 23}, [477] = {3, 4, 18}, [478] = {0, 18, 23}, [479] = {1}, [480] = {1, 30}, [481] = {0, 18, 24}, [482] = {0, 18}, [483] = {1, 18, 25}, [484] = {}, [485] = {0, 1, 10, 18}, [486] = {1, 18}, [487] = {1, 11, 18}, [488] = {0, 18, 23, 29}, [489] = {5, 18, 22}, [490] = {4, 21}, [491] = {0, 28}, [492] = {0, 13, 28}, [493] = {0, 11, 16}, [494] = {0, 14, 16, 23}, [495] = {0, 16}, [496] = {0, 11, 12, 16, 19}, [497] = {0, 16}, [498] = {3, 4}, [499] = {4, 21}, [500] = {5, 18, 22}, [501] = {5, 22}, [502] = {0, 16}, [503] = {3, 11, 12, 16, 19, 20}, [504] = {0, 7, 16}, [505] = {1, 18, 23}, [506] = {0, 16, 24}, [507] = {0, 16}, [508] = {0, 15, 16, 27}, [509] = {0, 16, 28}, [510] = {4}, [511] = {0, 16, 24, 28}, [512] = {0, 16, 18}, [513] = {0, 16}, [514] = {1, 16}, [515] = {1, 16, 18, 23}, [516] = {0, 16, 18, 23}, [517] = {0, 16, 25}, [518] = {1, 16, 18, 23, 28}, [519] = {3, 4, 20, 28}, [520] = {1, 14, 16}, [521] = {1}, [522] = {0, 16}, [523] = {1}, [524] = {0, 16, 23}, [525] = {0, 16}, [526] = {3, 4, 20, 21}, [527] = {1, 13, 18, 23, 29}, [528] = {4, 21}, [529] = {0, 16}, [530] = {3}, [531] = {0, 16, 24}, [532] = {0, 16}, [533] = {4, 21}, [534] = {1, 8, 18}, [535] = {1, 18}, [536] = {3, 12, 19, 20}, [537] = {0, 16, 28}, [538] = {2, 17, 23}, [539] = {0, 16}, [540] = {0, 16}, [541] = {2, 17, 24}, [542] = {0, 16}, [543] = {0, 4, 16, 21}, [544] = {0, 16}, [545] = {0, 3, 6, 16, 20}, [546] = {5, 22, 27}, [547] = {2, 17, 27}, [548] = {0, 16}, [549] = {0, 16}, [550] = {}, [551] = {}, [552] = {}, [553] = {0, 16}, [554] = {3, 20, 24}, [555] = {0, 16}, [556] = {3, 20, 24}, [557] = {0, 16}, [558] = {0, 16}, [559] = {0, 14, 16}, [560] = {0, 16}, [561] = {0, 16}, [562] = {5, 22}, [563] = {0, 16, 25}, [564] = {2, 17}, [565] = {0, 9, 12, 16, 19, 24}, [566] = {1, 18}, [567] = {4, 21}, [568] = {4, 21}, [569] = {3, 12, 19, 20}, [570] = {0, 16}, [571] = {5, 8, 22}, [572] = {3, 20, 24}, [573] = {4, 21, 24}, [574] = {4, 21}, [575] = {0, 16, 28}, [576] = {0, 7, 16}, [577] = {3, 20}, [578] = {0, 16}, [579] = {4, 21}, [580] = {5, 9, 12, 13, 15, 24}, [581] = {0, 13, 16, 28}, [582] = {5, 22}, [583] = {0, 16, 25}, [584] = {4, 6, 21}, [585] = {1, 18}, [586] = {4, 21}, [588] = {26}, [589] = {26}, [590] = {26}, [591] = {26}, [592] = {26}, [593] = {26}, [594] = {26}, [595] = {26}, [596] = {26}, [597] = {26}, [598] = {26}, [599] = {1, 23}, [600] = {2, 17}, [601] = {4, 21}, [602] = {1}, [603] = {1, 14, 18}, [604] = {1, 18, 23, 27}, [605] = {0, 16}, [606] = {3, 20, 24}, [607] = {0, 16, 24, 28}, [608] = {0, 16, 28}, [609] = {0, 5, 16, 22, 23}, [610] = {0, 16, 28}, [611] = {0, 16}, [612] = {0, 5, 16, 22, 28}, [614] = {0, 16, 24, 25}, [615] = {0, 16, 28}, [616] = {0, 16, 24}, [617] = {0, 16, 23}, [618] = {0, 16, 24, 30}, [619] = {1, 18}, [621] = {1, 18, 24}, [622] = {4, 21}, [623] = {1, 18}, [624] = {1, 2, 17, 18, 23}, [625] = {0, 5, 16, 22}, [626] = {}, [627] = {}, [628] = {5, 22}, [629] = {0, 13, 16, 23, 28}, [631] = {0, 16}, [632] = {5, 22}, [633] = {}, [634] = {3, 4, 20, 21}, [635] = {0, 16, 28}, [636] = {5, 18, 22}, [637] = {0, 16, 24}, [638] = {1, 18, 23}, [639] = {0, 16, 30}, [640] = {4, 21}, [641] = {0, 16}, [642] = {1, 9, 12, 19}, [643] = {4, 21}, [644] = {2, 8, 17, 23}, [645] = {0, 16, 28}, [646] = {3, 20, 25}, [647] = {1, 14, 18}, [649] = {0, 13, 16, 23, 28}, [650] = {0, 16, 24}, [651] = {4, 21}, [652] = {0, 16}, [653] = {4, 21}, [654] = {3, 9, 12, 19, 20, 24}, [655] = {0, 16, 23}, [656] = {}, [657] = {0, 16, 24}, [658] = {0, 16}, [659] = {2, 17}, [660] = {1}, [661] = {0, 16, 28}, [663] = {0, 16}, [664] = {5, 22}, [665] = {3, 9, 20}, [667] = {5, 18, 22}, [668] = {}, [669] = {5, 22}, [670] = {1}, [671] = {0, 16, 24}, [672] = {3, 11}, [673] = {}, [674] = {5, 18, 22}, [675] = {0, 5, 16}, [676] = {0, 11, 16}, [677] = {0, 5, 16, 22}, [678] = {0, 16}, [679] = {3, 20, 28}, [680] = {0, 16}, [681] = {0, 16}, [682] = {0, 16, 24, 28}, [683] = {0, 16}, [684] = {3, 20, 24}, [685] = {4, 21}, [686] = {4, 21}, [687] = {0, 16, 23}, [688] = {5, 18, 22}, [689] = {5, 18, 22}, [690] = {0, 16}, [691] = {4, 5, 18, 21, 22}, [692] = {3, 12, 18, 19, 20, 24}, [693] = {0, 13, 16}, [694] = {3, 12, 19, 20, 24}, [695] = {0, 3, 16, 20, 24}, [696] = {4, 21}, [697] = {5, 12}, [698] = {3, 20, 28}, [699] = {3, 20}, [700] = {5, 18, 22, 24}, [701] = {5, 18, 22}, [702] = {3, 12, 19, 20, 24}, [703] = {0, 5, 16, 18, 22, 24}, [704] = {3, 20, 24}, [705] = {3, 20, 24}, [706] = {3, 20, 24}, [707] = {2, 10, 17}, [708] = {2, 8, 17}, [709] = {0, 16, 23}, [710] = {0, 16}, [711] = {5, 12, 18, 19, 22, 24}, [712] = {3, 6, 20}, [713] = {0, 16}, [714] = {}, [715] = {}, [716] = {1, 5, 16, 22}, [717] = {0, 5, 16, 22}, [719] = {1, 5, 16, 22, 29}, [720] = {0, 16, 23}, [721] = {5, 16, 18, 22}, [722] = {0, 16, 18}, [723] = {0, 5, 16, 18, 22, 23}, [724] = {0, 16, 24}, [725] = {0, 16}, [726] = {0, 16, 24}, [727] = {0, 16, 25}, [728] = {0, 3, 16, 20, 24}, [729] = {0, 16}, [730] = {2, 8, 17, 23}, [731] = {2, 17}, [732] = {8, 15, 18}, } diff --git a/main.lua b/main.lua index ff5497e2..35a5ff03 100644 --- a/main.lua +++ b/main.lua @@ -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