isaacscript-common 76.2.0 → 77.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/classes/features/callbackLogic/CustomGridEntities.d.ts +8 -0
  2. package/dist/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
  3. package/dist/classes/features/callbackLogic/GameReorderedCallbacks.d.ts +6 -0
  4. package/dist/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  5. package/dist/classes/features/other/CharacterHealthConversion.d.ts +2 -0
  6. package/dist/classes/features/other/CharacterHealthConversion.d.ts.map +1 -1
  7. package/dist/classes/features/other/CharacterStats.d.ts +2 -0
  8. package/dist/classes/features/other/CharacterStats.d.ts.map +1 -1
  9. package/dist/classes/features/other/CollectibleItemPoolType.d.ts +2 -0
  10. package/dist/classes/features/other/CollectibleItemPoolType.d.ts.map +1 -1
  11. package/dist/classes/features/other/CustomHotkeys.d.ts +4 -0
  12. package/dist/classes/features/other/CustomHotkeys.d.ts.map +1 -1
  13. package/dist/classes/features/other/CustomItemPools.d.ts +2 -0
  14. package/dist/classes/features/other/CustomItemPools.d.ts.map +1 -1
  15. package/dist/classes/features/other/CustomPickups.d.ts +1 -0
  16. package/dist/classes/features/other/CustomPickups.d.ts.map +1 -1
  17. package/dist/classes/features/other/CustomStages.d.ts +3 -0
  18. package/dist/classes/features/other/CustomStages.d.ts.map +1 -1
  19. package/dist/classes/features/other/DebugDisplay.d.ts +54 -0
  20. package/dist/classes/features/other/DebugDisplay.d.ts.map +1 -1
  21. package/dist/classes/features/other/DeployJSONRoom.d.ts +1 -0
  22. package/dist/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
  23. package/dist/classes/features/other/DisableInputs.d.ts +9 -0
  24. package/dist/classes/features/other/DisableInputs.d.ts.map +1 -1
  25. package/dist/classes/features/other/EdenStartingStatsHealth.d.ts +6 -0
  26. package/dist/classes/features/other/EdenStartingStatsHealth.d.ts.map +1 -1
  27. package/dist/classes/features/other/ExtraConsoleCommands.d.ts +6 -0
  28. package/dist/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
  29. package/dist/classes/features/other/FadeInRemover.d.ts +4 -0
  30. package/dist/classes/features/other/FadeInRemover.d.ts.map +1 -1
  31. package/dist/classes/features/other/FastReset.d.ts +4 -0
  32. package/dist/classes/features/other/FastReset.d.ts.map +1 -1
  33. package/dist/classes/features/other/FlyingDetection.d.ts +2 -0
  34. package/dist/classes/features/other/FlyingDetection.d.ts.map +1 -1
  35. package/dist/classes/features/other/FlyingDetection.lua +2 -3
  36. package/dist/classes/features/other/ForgottenSwitch.d.ts +2 -0
  37. package/dist/classes/features/other/ForgottenSwitch.d.ts.map +1 -1
  38. package/dist/classes/features/other/ItemPoolDetection.d.ts +7 -1
  39. package/dist/classes/features/other/ItemPoolDetection.d.ts.map +1 -1
  40. package/dist/classes/features/other/ModdedElementDetection.d.ts +32 -0
  41. package/dist/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
  42. package/dist/classes/features/other/ModdedElementSets.d.ts +88 -20
  43. package/dist/classes/features/other/ModdedElementSets.d.ts.map +1 -1
  44. package/dist/classes/features/other/ModdedElementSets.lua +75 -86
  45. package/dist/classes/features/other/NoSirenSteal.d.ts +1 -0
  46. package/dist/classes/features/other/NoSirenSteal.d.ts.map +1 -1
  47. package/dist/classes/features/other/Pause.d.ts +10 -0
  48. package/dist/classes/features/other/Pause.d.ts.map +1 -1
  49. package/dist/classes/features/other/PersistentEntities.d.ts +2 -0
  50. package/dist/classes/features/other/PersistentEntities.d.ts.map +1 -1
  51. package/dist/classes/features/other/PlayerCollectibleTracking.d.ts +3 -0
  52. package/dist/classes/features/other/PlayerCollectibleTracking.d.ts.map +1 -1
  53. package/dist/classes/features/other/PonyDetection.d.ts +4 -0
  54. package/dist/classes/features/other/PonyDetection.d.ts.map +1 -1
  55. package/dist/classes/features/other/PreventChildEntities.d.ts +2 -0
  56. package/dist/classes/features/other/PreventChildEntities.d.ts.map +1 -1
  57. package/dist/classes/features/other/RoomClearFrame.d.ts +19 -0
  58. package/dist/classes/features/other/RoomClearFrame.d.ts.map +1 -1
  59. package/dist/classes/features/other/RoomClearFrame.lua +8 -2
  60. package/dist/classes/features/other/RoomHistory.d.ts +17 -1
  61. package/dist/classes/features/other/RoomHistory.d.ts.map +1 -1
  62. package/dist/classes/features/other/RunInNFrames.d.ts +9 -2
  63. package/dist/classes/features/other/RunInNFrames.d.ts.map +1 -1
  64. package/dist/classes/features/other/RunNextRun.d.ts +2 -0
  65. package/dist/classes/features/other/RunNextRun.d.ts.map +1 -1
  66. package/dist/classes/features/other/SaveDataManager.d.ts +21 -0
  67. package/dist/classes/features/other/SaveDataManager.d.ts.map +1 -1
  68. package/dist/classes/features/other/SpawnRockAltRewards.d.ts +1 -0
  69. package/dist/classes/features/other/SpawnRockAltRewards.d.ts.map +1 -1
  70. package/dist/classes/features/other/StageHistory.d.ts +3 -0
  71. package/dist/classes/features/other/StageHistory.d.ts.map +1 -1
  72. package/dist/classes/features/other/StartAmbush.d.ts +2 -0
  73. package/dist/classes/features/other/StartAmbush.d.ts.map +1 -1
  74. package/dist/classes/features/other/TaintedLazarusPlayers.d.ts +2 -0
  75. package/dist/classes/features/other/TaintedLazarusPlayers.d.ts.map +1 -1
  76. package/dist/classes/features/other/UnlockAchievementsDetection.d.ts +2 -0
  77. package/dist/classes/features/other/UnlockAchievementsDetection.d.ts.map +1 -1
  78. package/dist/classes/private/CustomCallback.d.ts +0 -1
  79. package/dist/classes/private/CustomCallback.d.ts.map +1 -1
  80. package/dist/classes/private/CustomCallback.lua +0 -19
  81. package/dist/functions/array.d.ts +3 -3
  82. package/dist/functions/array.d.ts.map +1 -1
  83. package/dist/functions/array.lua +34 -28
  84. package/dist/functions/cards.lua +3 -3
  85. package/dist/functions/collectibles.d.ts +2 -2
  86. package/dist/functions/collectibles.d.ts.map +1 -1
  87. package/dist/functions/collectibles.lua +4 -5
  88. package/dist/functions/pills.d.ts +3 -3
  89. package/dist/functions/pills.d.ts.map +1 -1
  90. package/dist/functions/playerTrinkets.d.ts +1 -1
  91. package/dist/functions/playerTrinkets.d.ts.map +1 -1
  92. package/dist/functions/players.d.ts.map +1 -1
  93. package/dist/functions/players.lua +7 -7
  94. package/dist/index.rollup.d.ts +354 -34
  95. package/dist/isaacscript-common.lua +490 -510
  96. package/dist/sets/{itemConfigCardTypesForCardsSet.d.ts → itemConfigCardTypesForCards.d.ts} +2 -2
  97. package/dist/sets/itemConfigCardTypesForCards.d.ts.map +1 -0
  98. package/dist/sets/{itemConfigCardTypesForCardsSet.lua → itemConfigCardTypesForCards.lua} +1 -1
  99. package/package.json +1 -1
  100. package/src/classes/features/callbackLogic/CustomGridEntities.ts +8 -0
  101. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +6 -0
  102. package/src/classes/features/other/CharacterHealthConversion.ts +2 -0
  103. package/src/classes/features/other/CharacterStats.ts +2 -0
  104. package/src/classes/features/other/CollectibleItemPoolType.ts +2 -0
  105. package/src/classes/features/other/CustomHotkeys.ts +4 -0
  106. package/src/classes/features/other/CustomItemPools.ts +2 -0
  107. package/src/classes/features/other/CustomPickups.ts +1 -0
  108. package/src/classes/features/other/CustomStages.ts +3 -0
  109. package/src/classes/features/other/DebugDisplay.ts +54 -0
  110. package/src/classes/features/other/DeployJSONRoom.ts +1 -0
  111. package/src/classes/features/other/DisableInputs.ts +9 -0
  112. package/src/classes/features/other/EdenStartingStatsHealth.ts +6 -0
  113. package/src/classes/features/other/ExtraConsoleCommands.ts +6 -0
  114. package/src/classes/features/other/FadeInRemover.ts +4 -0
  115. package/src/classes/features/other/FastReset.ts +4 -0
  116. package/src/classes/features/other/FlyingDetection.ts +2 -0
  117. package/src/classes/features/other/ForgottenSwitch.ts +2 -0
  118. package/src/classes/features/other/ItemPoolDetection.ts +7 -1
  119. package/src/classes/features/other/ModdedElementDetection.ts +32 -0
  120. package/src/classes/features/other/ModdedElementSets.ts +174 -121
  121. package/src/classes/features/other/NoSirenSteal.ts +1 -0
  122. package/src/classes/features/other/Pause.ts +10 -0
  123. package/src/classes/features/other/PersistentEntities.ts +2 -0
  124. package/src/classes/features/other/PlayerCollectibleTracking.ts +3 -0
  125. package/src/classes/features/other/PonyDetection.ts +4 -0
  126. package/src/classes/features/other/PreventChildEntities.ts +2 -0
  127. package/src/classes/features/other/RoomClearFrame.ts +27 -1
  128. package/src/classes/features/other/RoomHistory.ts +17 -1
  129. package/src/classes/features/other/RunInNFrames.ts +9 -2
  130. package/src/classes/features/other/RunNextRun.ts +2 -0
  131. package/src/classes/features/other/SaveDataManager.ts +21 -0
  132. package/src/classes/features/other/SpawnRockAltRewards.ts +1 -0
  133. package/src/classes/features/other/StageHistory.ts +3 -0
  134. package/src/classes/features/other/StartAmbush.ts +2 -0
  135. package/src/classes/features/other/TaintedLazarusPlayers.ts +2 -0
  136. package/src/classes/features/other/UnlockAchievementsDetection.ts +2 -0
  137. package/src/classes/private/CustomCallback.ts +0 -15
  138. package/src/functions/array.ts +12 -5
  139. package/src/functions/cards.ts +2 -2
  140. package/src/functions/collectibles.ts +7 -7
  141. package/src/functions/pills.ts +3 -3
  142. package/src/functions/playerTrinkets.ts +3 -1
  143. package/src/sets/{itemConfigCardTypesForCardsSet.ts → itemConfigCardTypesForCards.ts} +3 -1
  144. package/dist/sets/itemConfigCardTypesForCardsSet.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 76.1.0
3
+ isaacscript-common 76.3.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -16287,81 +16287,6 @@ end
16287
16287
  function ____exports.isUserdata(self, variable)
16288
16288
  return type(variable) == "userdata"
16289
16289
  end
16290
- return ____exports
16291
- end,
16292
- ["functions.log"] = function(...)
16293
- local ____exports = {}
16294
- local ____types = require("functions.types")
16295
- local isNumber = ____types.isNumber
16296
- --- Helper function to get the name and the line number of the current calling function.
16297
- --
16298
- -- For this function to work properly, the "--luadebug" flag must be enabled. Otherwise, it will
16299
- -- always return undefined.
16300
- --
16301
- -- @param levels Optional. The amount of levels to look backwards in the call stack. Default is 3
16302
- -- (because the first level is this function, the second level is the calling
16303
- -- function, and the third level is the parent of the calling function).
16304
- function ____exports.getParentFunctionDescription(levels)
16305
- if levels == nil then
16306
- levels = 3
16307
- end
16308
- if debug ~= nil then
16309
- local debugTable = debug.getinfo(levels)
16310
- if debugTable ~= nil then
16311
- return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
16312
- end
16313
- end
16314
- if SandboxGetParentFunctionDescription ~= nil then
16315
- return SandboxGetParentFunctionDescription(levels)
16316
- end
16317
- return nil
16318
- end
16319
- --- Helper function to avoid typing out `Isaac.DebugString()`.
16320
- --
16321
- -- If you have the "--luadebug" launch flag turned on, then this function will also prepend the
16322
- -- function name and the line number before the string, like this:
16323
- --
16324
- -- ```text
16325
- -- [INFO] - Lua Debug: saveToDisk:42494 - The save data manager wrote data to the "save#.dat" file.
16326
- -- ```
16327
- --
16328
- -- Subsequently, it is recommended that you turn on the "--luadebug" launch flag when developing
16329
- -- your mod so that debugging becomes a little bit easier.
16330
- --
16331
- -- @param msg The message to log.
16332
- -- @param includeParentFunction Optional. Whether to prefix the message with the function name and
16333
- -- line number, as shown in the above example. Default is true.
16334
- function ____exports.log(msg, includeParentFunction)
16335
- if includeParentFunction == nil then
16336
- includeParentFunction = true
16337
- end
16338
- if isNumber(nil, msg) then
16339
- msg = tostring(msg)
16340
- end
16341
- local ____includeParentFunction_0
16342
- if includeParentFunction then
16343
- ____includeParentFunction_0 = ____exports.getParentFunctionDescription()
16344
- else
16345
- ____includeParentFunction_0 = nil
16346
- end
16347
- local parentFunctionDescription = ____includeParentFunction_0
16348
- local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
16349
- Isaac.DebugString(debugMsg)
16350
- end
16351
- --- Helper function to log a message to the "log.txt" file and to print it to the screen at the same
16352
- -- time.
16353
- function ____exports.logAndPrint(self, msg)
16354
- ____exports.log(msg)
16355
- print(msg)
16356
- end
16357
- --- Helper function to log an error message and also print it to the console for better visibility.
16358
- --
16359
- -- This is useful in situations where using the `error` function would be dangerous (since it
16360
- -- prevents all of the subsequent code in the callback from running).
16361
- function ____exports.logError(msg)
16362
- local errorMsg = "Error: " .. msg
16363
- ____exports.logAndPrint(nil, errorMsg)
16364
- end
16365
16290
  return ____exports
16366
16291
  end,
16367
16292
  ["functions.sort"] = function(...)
@@ -16507,183 +16432,7 @@ function ____exports.stableSort(self, array, sortFunc)
16507
16432
  end
16508
16433
  return ____exports
16509
16434
  end,
16510
- ["classes.DefaultMap"] = function(...)
16511
- local ____lualib = require("lualib_bundle")
16512
- local __TS__Class = ____lualib.__TS__Class
16513
- local Map = ____lualib.Map
16514
- local __TS__ClassExtends = ____lualib.__TS__ClassExtends
16515
- local __TS__TypeOf = ____lualib.__TS__TypeOf
16516
- local __TS__New = ____lualib.__TS__New
16517
- local ____exports = {}
16518
- local ____types = require("functions.types")
16519
- local isFunction = ____types.isFunction
16520
- local isPrimitive = ____types.isPrimitive
16521
- --- `DefaultMap` is a data structure that makes working with default values easier. It extends a
16522
- -- `Map` and adds additional methods.
16523
- --
16524
- -- It is a common pattern to look up a value in a `Map`, and then, if the value does not exist, set
16525
- -- a default value for the key, and then return the default value. `DefaultMap` abstracts this
16526
- -- operation away by providing the `getAndSetDefault` method.
16527
- --
16528
- -- Using a `DefaultMap` is nice because it makes code more declarative, since you specify what the
16529
- -- default value is alongside the types of the keys/values.
16530
- --
16531
- -- When instantiating a new `DefaultMap`, you must specify default value as the first argument. (The
16532
- -- default value is the initial value that will be assigned to every new entry in the
16533
- -- `getAndSetDefault` method.) For example:
16534
- --
16535
- -- ```ts
16536
- -- // Initializes a new empty DefaultMap with a default value of "foo".
16537
- -- const defaultMapWithString = new DefaultMap<string, string>("foo");
16538
- --
16539
- -- const value = defaultMapWithString.getAndSetDefault("bar");
16540
- -- // value is now "foo" and an entry for "bar" is now set.
16541
- -- ```
16542
- --
16543
- -- Sometimes, instead of having a static initial value for every entry in the map, you will want a
16544
- -- dynamic initial value that is contingent upon the key or some other variable. In these cases, you
16545
- -- can instead specify that the `DefaultMap` should run a function that will return the initial
16546
- -- value. (This is referred to as a "factory function".) For example:
16547
- --
16548
- -- ```ts
16549
- -- // Initializes a new empty DefaultMap with a default value based on "someGlobalVariable".
16550
- -- const factoryFunction = () => someGlobalVariable ? 0 : 1;
16551
- -- const defaultMapWithFactoryFunction = new DefaultMap<string, string>(factoryFunction);
16552
- -- ```
16553
- --
16554
- -- Note that in TypeScript and Lua, booleans, numbers, and strings are "passed by value". This means
16555
- -- that when the `DefaultMap` creates a new entry, if the default value is one of these 3 types, the
16556
- -- values will be copied. On the other hand, arrays and maps and other complex data structures are
16557
- -- "passed by reference". This means that when the `DefaultMap` creates a new entry, if the default
16558
- -- value is an array, then it would not be copied. Instead, the same shared array would be assigned
16559
- -- to every entry. Thus, to solve this problem, any variable that is passed by reference must be
16560
- -- created using a factory function to ensure that each copy is unique. For example:
16561
- --
16562
- -- ```ts
16563
- -- // Initializes a new empty DefaultMap with a default value of a new empty array.
16564
- -- const factoryFunction = () => [];
16565
- -- const defaultMapWithArray = new DefaultMap<string, string[]>(factoryFunction);
16566
- -- ```
16567
- --
16568
- -- In the previous two examples, the factory functions did not have any arguments. But you can also
16569
- -- specify a factory function that takes one or more arguments:
16570
- --
16571
- -- ```ts
16572
- -- const factoryFunction = (arg: boolean) => arg ? 0 : 1;
16573
- -- const defaultMapWithArg = new DefaultMap<string, string, [arg: boolean]>(factoryFunction);
16574
- -- ```
16575
- --
16576
- -- Similar to a normal `Map`, you can also include an initializer list in the constructor as the
16577
- -- second argument:
16578
- --
16579
- -- ```ts
16580
- -- // Initializes a DefaultMap with a default value of "foo" and some initial values.
16581
- -- const defaultMapWithInitialValues = new DefaultMap<string, string>("foo", [
16582
- -- ["a1", "a2"],
16583
- -- ["b1", "b2"],
16584
- -- ], );
16585
- -- ```
16586
- --
16587
- -- Finally, note that `DefaultMap` has the following additional utility methods:
16588
- --
16589
- -- - `getAndSetDefault` - The method that is called inside the overridden `get` method. In most
16590
- -- cases, you can use the overridden `get` method instead of calling this function directly.
16591
- -- However, if a factory function was provided during instantiation, and the factory function has
16592
- -- one or more arguments, then you must call this method instead (and provide the corresponding
16593
- -- arguments).
16594
- -- - `getDefaultValue` - Returns the default value to be used for a new key. (If a factory function
16595
- -- was provided during instantiation, this will execute the factory function.)
16596
- -- - `getConstructorArg` - Helper method for cloning the map. Returns either the default value or
16597
- -- the reference to the factory function.
16598
- ____exports.DefaultMap = __TS__Class()
16599
- local DefaultMap = ____exports.DefaultMap
16600
- DefaultMap.name = "DefaultMap"
16601
- __TS__ClassExtends(DefaultMap, Map)
16602
- function DefaultMap.prototype.____constructor(self, defaultValueOrFactoryFunction, initializerArray)
16603
- local argIsPrimitive = isPrimitive(nil, defaultValueOrFactoryFunction)
16604
- local argIsFunction = isFunction(nil, defaultValueOrFactoryFunction)
16605
- if not argIsPrimitive and not argIsFunction then
16606
- error(("Failed to instantiate a DefaultMap since the provided default value was of type \"" .. __TS__TypeOf(defaultValueOrFactoryFunction)) .. "\". This error usually means that you are trying to use an array (or some other non-primitive data structure that is passed by reference) as the default value. Instead, return the data structure in a factory function, like \"() => []\". See the DefaultMap documentation for more details.")
16607
- end
16608
- Map.prototype.____constructor(self, initializerArray)
16609
- if argIsFunction then
16610
- self.defaultValue = nil
16611
- self.defaultValueFactory = defaultValueOrFactoryFunction
16612
- else
16613
- self.defaultValue = defaultValueOrFactoryFunction
16614
- self.defaultValueFactory = nil
16615
- end
16616
- end
16617
- function DefaultMap.prototype.getAndSetDefault(self, key, ...)
16618
- local value = Map.prototype.get(self, key)
16619
- if value ~= nil then
16620
- return value
16621
- end
16622
- local defaultValue = self:getDefaultValue(...)
16623
- self:set(key, defaultValue)
16624
- return defaultValue
16625
- end
16626
- function DefaultMap.prototype.getDefaultValue(self, ...)
16627
- if self.defaultValue ~= nil then
16628
- return self.defaultValue
16629
- end
16630
- if self.defaultValueFactory ~= nil then
16631
- return self:defaultValueFactory(...)
16632
- end
16633
- error("A DefaultMap was incorrectly instantiated.")
16634
- end
16635
- function DefaultMap.prototype.getConstructorArg(self)
16636
- if self.defaultValue ~= nil then
16637
- return self.defaultValue
16638
- end
16639
- if self.defaultValueFactory ~= nil then
16640
- return self.defaultValueFactory
16641
- end
16642
- error("A DefaultMap was incorrectly instantiated.")
16643
- end
16644
- local function test(self)
16645
- local myDefaultMapBoolean = __TS__New(____exports.DefaultMap, false)
16646
- local myDefaultMapBooleanFactory = __TS__New(
16647
- ____exports.DefaultMap,
16648
- function() return false end
16649
- )
16650
- local myDefaultMapBooleanWithoutParams = __TS__New(____exports.DefaultMap, false)
16651
- local myDefaultMapNumber = __TS__New(____exports.DefaultMap, 123)
16652
- local myDefaultMapNumberFactory = __TS__New(
16653
- ____exports.DefaultMap,
16654
- function() return 123 end
16655
- )
16656
- local myDefaultMapNumberWithoutParams = __TS__New(____exports.DefaultMap, 123)
16657
- local myDefaultMapString = __TS__New(____exports.DefaultMap, "foo")
16658
- local myDefaultMapStringFactory = __TS__New(
16659
- ____exports.DefaultMap,
16660
- function() return "foo" end
16661
- )
16662
- local myDefaultMapStringWithoutParams = __TS__New(____exports.DefaultMap, "foo")
16663
- local myDefaultMapArray = __TS__New(
16664
- ____exports.DefaultMap,
16665
- function() return {} end
16666
- )
16667
- local myDefaultMapArrayWithoutParams = __TS__New(
16668
- ____exports.DefaultMap,
16669
- function() return {} end
16670
- )
16671
- local myDefaultMapMap = __TS__New(
16672
- ____exports.DefaultMap,
16673
- function() return __TS__New(Map) end
16674
- )
16675
- local myDefaultMapMapWithoutParams = __TS__New(
16676
- ____exports.DefaultMap,
16677
- function() return __TS__New(Map) end
16678
- )
16679
- end
16680
- return ____exports
16681
- end,
16682
- ["interfaces.TSTLClassMetatable"] = function(...)
16683
- local ____exports = {}
16684
- return ____exports
16685
- end,
16686
- ["types.TSTLClass"] = function(...)
16435
+ ["types.WidenLiteral"] = function(...)
16687
16436
  local ____exports = {}
16688
16437
  return ____exports
16689
16438
  end,
@@ -16737,6 +16486,24 @@ ____exports.fonts.teamMeatFont12:Load("font/teammeatfont12.fnt")
16737
16486
  ____exports.fonts.teamMeatFont16Bold:Load("font/teammeatfont16bold.fnt")
16738
16487
  ____exports.fonts.terminus:Load("font/terminus.fnt")
16739
16488
  ____exports.fonts.upheaval:Load("font/upheaval.fnt")
16489
+ return ____exports
16490
+ end,
16491
+ ["enums.private.SerializationBrand"] = function(...)
16492
+ local ____exports = {}
16493
+ --- During serialization, we write an arbitrary string key to the object with a value of an empty
16494
+ -- string. This is used during deserialization to instantiate the correct type of object.
16495
+ ____exports.SerializationBrand = {}
16496
+ ____exports.SerializationBrand.DEFAULT_MAP = "__TSTL_DEFAULT_MAP"
16497
+ ____exports.SerializationBrand.MAP = "__TSTL_MAP"
16498
+ ____exports.SerializationBrand.SET = "__TSTL_SET"
16499
+ ____exports.SerializationBrand.BIT_SET_128 = "__BIT_SET_128"
16500
+ ____exports.SerializationBrand.COLOR = "__COLOR"
16501
+ ____exports.SerializationBrand.K_COLOR = "__K_COLOR"
16502
+ ____exports.SerializationBrand.RNG = "__RNG"
16503
+ ____exports.SerializationBrand.VECTOR = "__VECTOR"
16504
+ ____exports.SerializationBrand.DEFAULT_MAP_VALUE = "__TSTL_DEFAULT_MAP_VALUE"
16505
+ ____exports.SerializationBrand.OBJECT_WITH_NUMBER_KEYS = "__TSTL_OBJECT_WITH_NUMBER_KEYS"
16506
+ ____exports.SerializationBrand.TSTL_CLASS = "__TSTL_CLASS"
16740
16507
  return ____exports
16741
16508
  end,
16742
16509
  ["types.PlayerIndex"] = function(...)
@@ -17129,108 +16896,6 @@ end
17129
16896
  -- @allowEmptyVariadic
17130
16897
  function ____exports.todo(self, ...)
17131
16898
  end
17132
- return ____exports
17133
- end,
17134
- ["functions.tstlClass"] = function(...)
17135
- local ____exports = {}
17136
- local ____types = require("functions.types")
17137
- local isTable = ____types.isTable
17138
- local ____utils = require("functions.utils")
17139
- local assertDefined = ____utils.assertDefined
17140
- --- Helper function to get the constructor from an instantiated TypeScriptToLua class, which is
17141
- -- located on the metatable.
17142
- --
17143
- -- Returns undefined if passed a non-table or if the provided table does not have a metatable.
17144
- function ____exports.getTSTLClassConstructor(self, object)
17145
- if not isTable(nil, object) then
17146
- return nil
17147
- end
17148
- local metatable = getmetatable(object)
17149
- if metatable == nil then
17150
- return nil
17151
- end
17152
- return metatable.constructor
17153
- end
17154
- --- Helper function to get the name of a TypeScriptToLua class from the instantiated class object.
17155
- --
17156
- -- TSTL classes are Lua tables created with the `__TS__Class` Lua function from the TSTL lualib.
17157
- -- Their name is contained within "constructor.name" metatable key.
17158
- --
17159
- -- For example, a `Map` class is has a name of "Map".
17160
- --
17161
- -- Returns undefined if passed a non-table or if the provided table does not have a metatable.
17162
- function ____exports.getTSTLClassName(self, object)
17163
- local constructor = ____exports.getTSTLClassConstructor(nil, object)
17164
- if constructor == nil then
17165
- return nil
17166
- end
17167
- return constructor.name
17168
- end
17169
- --- Helper function to determine if a given object is a TypeScriptToLua `Map`.
17170
- --
17171
- -- It is not reliable to use the `instanceof` operator to determine this because each Lua module has
17172
- -- their own copies of the entire lualib and thus their own instantiated version of a `Map`.
17173
- function ____exports.isDefaultMap(self, object)
17174
- local className = ____exports.getTSTLClassName(nil, object)
17175
- return className == "DefaultMap"
17176
- end
17177
- --- Helper function to check if a given table is a class table created by TypeScriptToLua.
17178
- function ____exports.isTSTLClass(self, object)
17179
- local tstlClassName = ____exports.getTSTLClassName(nil, object)
17180
- return tstlClassName ~= nil
17181
- end
17182
- --- Helper function to determine if a given object is a TypeScriptToLua `Map`.
17183
- --
17184
- -- It is not reliable to use the `instanceof` operator to determine this because each Lua module
17185
- -- might have their own copy of the entire lualib and thus their own instantiated version of a
17186
- -- `Map`.
17187
- function ____exports.isTSTLMap(self, object)
17188
- local className = ____exports.getTSTLClassName(nil, object)
17189
- return className == "Map"
17190
- end
17191
- --- Helper function to determine if a given object is a TypeScriptToLua `Set`.
17192
- --
17193
- -- It is not reliable to use the `instanceof` operator to determine this because each Lua module
17194
- -- might have their own copy of the entire lualib and thus their own instantiated version of a
17195
- -- `Set`.
17196
- function ____exports.isTSTLSet(self, object)
17197
- local className = ____exports.getTSTLClassName(nil, object)
17198
- return className == "Set"
17199
- end
17200
- --- Initializes a new TypeScriptToLua class in the situation where you do not know what kind of class
17201
- -- it is. This function requires that you provide an instantiated class of the same type, as it will
17202
- -- use the class constructor that is present on the other object's metatable to initialize the new
17203
- -- class.
17204
- function ____exports.newTSTLClass(self, oldClass)
17205
- local constructor = ____exports.getTSTLClassConstructor(nil, oldClass)
17206
- assertDefined(nil, constructor, "Failed to instantiate a new TypeScriptToLua class since the provided old class does not have a metatable/constructor.")
17207
- local newClass = {}
17208
- local newClassMetatable = setmetatable(newClass, constructor.prototype)
17209
- newClassMetatable:____constructor()
17210
- return newClass
17211
- end
17212
- return ____exports
17213
- end,
17214
- ["types.WidenLiteral"] = function(...)
17215
- local ____exports = {}
17216
- return ____exports
17217
- end,
17218
- ["enums.private.SerializationBrand"] = function(...)
17219
- local ____exports = {}
17220
- --- During serialization, we write an arbitrary string key to the object with a value of an empty
17221
- -- string. This is used during deserialization to instantiate the correct type of object.
17222
- ____exports.SerializationBrand = {}
17223
- ____exports.SerializationBrand.DEFAULT_MAP = "__TSTL_DEFAULT_MAP"
17224
- ____exports.SerializationBrand.MAP = "__TSTL_MAP"
17225
- ____exports.SerializationBrand.SET = "__TSTL_SET"
17226
- ____exports.SerializationBrand.BIT_SET_128 = "__BIT_SET_128"
17227
- ____exports.SerializationBrand.COLOR = "__COLOR"
17228
- ____exports.SerializationBrand.K_COLOR = "__K_COLOR"
17229
- ____exports.SerializationBrand.RNG = "__RNG"
17230
- ____exports.SerializationBrand.VECTOR = "__VECTOR"
17231
- ____exports.SerializationBrand.DEFAULT_MAP_VALUE = "__TSTL_DEFAULT_MAP_VALUE"
17232
- ____exports.SerializationBrand.OBJECT_WITH_NUMBER_KEYS = "__TSTL_OBJECT_WITH_NUMBER_KEYS"
17233
- ____exports.SerializationBrand.TSTL_CLASS = "__TSTL_CLASS"
17234
16899
  return ____exports
17235
16900
  end,
17236
16901
  ["functions.string"] = function(...)
@@ -17539,6 +17204,81 @@ function ____exports.isaacAPIClassEquals(self, object1, object2, keys)
17539
17204
  function(____, key) return table1[key] == table2[key] end
17540
17205
  )
17541
17206
  end
17207
+ return ____exports
17208
+ end,
17209
+ ["functions.log"] = function(...)
17210
+ local ____exports = {}
17211
+ local ____types = require("functions.types")
17212
+ local isNumber = ____types.isNumber
17213
+ --- Helper function to get the name and the line number of the current calling function.
17214
+ --
17215
+ -- For this function to work properly, the "--luadebug" flag must be enabled. Otherwise, it will
17216
+ -- always return undefined.
17217
+ --
17218
+ -- @param levels Optional. The amount of levels to look backwards in the call stack. Default is 3
17219
+ -- (because the first level is this function, the second level is the calling
17220
+ -- function, and the third level is the parent of the calling function).
17221
+ function ____exports.getParentFunctionDescription(levels)
17222
+ if levels == nil then
17223
+ levels = 3
17224
+ end
17225
+ if debug ~= nil then
17226
+ local debugTable = debug.getinfo(levels)
17227
+ if debugTable ~= nil then
17228
+ return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
17229
+ end
17230
+ end
17231
+ if SandboxGetParentFunctionDescription ~= nil then
17232
+ return SandboxGetParentFunctionDescription(levels)
17233
+ end
17234
+ return nil
17235
+ end
17236
+ --- Helper function to avoid typing out `Isaac.DebugString()`.
17237
+ --
17238
+ -- If you have the "--luadebug" launch flag turned on, then this function will also prepend the
17239
+ -- function name and the line number before the string, like this:
17240
+ --
17241
+ -- ```text
17242
+ -- [INFO] - Lua Debug: saveToDisk:42494 - The save data manager wrote data to the "save#.dat" file.
17243
+ -- ```
17244
+ --
17245
+ -- Subsequently, it is recommended that you turn on the "--luadebug" launch flag when developing
17246
+ -- your mod so that debugging becomes a little bit easier.
17247
+ --
17248
+ -- @param msg The message to log.
17249
+ -- @param includeParentFunction Optional. Whether to prefix the message with the function name and
17250
+ -- line number, as shown in the above example. Default is true.
17251
+ function ____exports.log(msg, includeParentFunction)
17252
+ if includeParentFunction == nil then
17253
+ includeParentFunction = true
17254
+ end
17255
+ if isNumber(nil, msg) then
17256
+ msg = tostring(msg)
17257
+ end
17258
+ local ____includeParentFunction_0
17259
+ if includeParentFunction then
17260
+ ____includeParentFunction_0 = ____exports.getParentFunctionDescription()
17261
+ else
17262
+ ____includeParentFunction_0 = nil
17263
+ end
17264
+ local parentFunctionDescription = ____includeParentFunction_0
17265
+ local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
17266
+ Isaac.DebugString(debugMsg)
17267
+ end
17268
+ --- Helper function to log a message to the "log.txt" file and to print it to the screen at the same
17269
+ -- time.
17270
+ function ____exports.logAndPrint(self, msg)
17271
+ ____exports.log(msg)
17272
+ print(msg)
17273
+ end
17274
+ --- Helper function to log an error message and also print it to the console for better visibility.
17275
+ --
17276
+ -- This is useful in situations where using the `error` function would be dangerous (since it
17277
+ -- prevents all of the subsequent code in the callback from running).
17278
+ function ____exports.logError(msg)
17279
+ local errorMsg = "Error: " .. msg
17280
+ ____exports.logAndPrint(nil, errorMsg)
17281
+ end
17542
17282
  return ____exports
17543
17283
  end,
17544
17284
  ["functions.table"] = function(...)
@@ -17924,10 +17664,10 @@ return ____exports
17924
17664
  ["functions.array"] = function(...)
17925
17665
  local ____lualib = require("lualib_bundle")
17926
17666
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
17667
+ local __TS__New = ____lualib.__TS__New
17927
17668
  local __TS__ArrayIndexOf = ____lualib.__TS__ArrayIndexOf
17928
17669
  local __TS__ArraySplice = ____lualib.__TS__ArraySplice
17929
17670
  local __TS__ArrayPushArray = ____lualib.__TS__ArrayPushArray
17930
- local __TS__New = ____lualib.__TS__New
17931
17671
  local __TS__ArrayEntries = ____lualib.__TS__ArrayEntries
17932
17672
  local __TS__Iterator = ____lualib.__TS__Iterator
17933
17673
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
@@ -17983,28 +17723,6 @@ function ____exports.arrayRemoveAllInPlace(self, array, ...)
17983
17723
  end
17984
17724
  return removedOneOrMoreElements
17985
17725
  end
17986
- --- Removes the specified element(s) from the array. If the specified element(s) are not found in the
17987
- -- array, this function will do nothing.
17988
- --
17989
- -- This function is variadic, meaning that you can specify N arguments to remove N elements.
17990
- --
17991
- -- If there is more than one matching element in the array, this function will only remove the first
17992
- -- matching element. If you want to remove all of the elements, use the `arrayRemoveAllInPlace`
17993
- -- function instead.
17994
- --
17995
- -- @returns The removed elements. This will be an empty array if no elements were removed.
17996
- function ____exports.arrayRemoveInPlace(self, array, ...)
17997
- local elementsToRemove = {...}
17998
- local removedElements = {}
17999
- for ____, element in ipairs(elementsToRemove) do
18000
- local index = __TS__ArrayIndexOf(array, element)
18001
- if index > -1 then
18002
- local removedElement = __TS__ArraySplice(array, index, 1)
18003
- __TS__ArrayPushArray(removedElements, removedElement)
18004
- end
18005
- end
18006
- return removedElements
18007
- end
18008
17726
  --- Helper function to perform a shallow copy.
18009
17727
  --
18010
17728
  -- @param oldArray The array to copy.
@@ -18115,9 +17833,9 @@ function ____exports.arrayEquals(self, array1, array2)
18115
17833
  end
18116
17834
  )
18117
17835
  end
18118
- --- Shallow copies and removes the specified element(s) from the array. Returns the copied array. If
18119
- -- the specified element(s) are not found in the array, it will simply return a shallow copy of the
18120
- -- array.
17836
+ --- Builds a new array based on the original array without the specified element(s). Returns the new
17837
+ -- array. If the specified element(s) are not found in the array, it will simply return a shallow
17838
+ -- copy of the array.
18121
17839
  --
18122
17840
  -- This function is variadic, meaning that you can specify N arguments to remove N elements.
18123
17841
  --
@@ -18125,8 +17843,14 @@ end
18125
17843
  -- matching element. If you want to remove all of the elements, use the `arrayRemoveAll` function
18126
17844
  -- instead.
18127
17845
  function ____exports.arrayRemove(self, originalArray, ...)
18128
- local array = ____exports.copyArray(nil, originalArray)
18129
- ____exports.arrayRemoveInPlace(nil, array, ...)
17846
+ local elementsToRemove = {...}
17847
+ local elementsToRemoveSet = __TS__New(ReadonlySet, elementsToRemove)
17848
+ local array = {}
17849
+ for ____, element in ipairs(originalArray) do
17850
+ if not elementsToRemoveSet:has(element) then
17851
+ array[#array + 1] = element
17852
+ end
17853
+ end
18130
17854
  return array
18131
17855
  end
18132
17856
  --- Shallow copies and removes the specified element(s) from the array. Returns the copied array. If
@@ -18143,6 +17867,28 @@ function ____exports.arrayRemoveAll(self, originalArray, ...)
18143
17867
  ____exports.arrayRemoveAllInPlace(nil, array, ...)
18144
17868
  return array
18145
17869
  end
17870
+ --- Removes the specified element(s) from the array. If the specified element(s) are not found in the
17871
+ -- array, this function will do nothing.
17872
+ --
17873
+ -- This function is variadic, meaning that you can specify N arguments to remove N elements.
17874
+ --
17875
+ -- If there is more than one matching element in the array, this function will only remove the first
17876
+ -- matching element. If you want to remove all of the elements, use the `arrayRemoveAllInPlace`
17877
+ -- function instead.
17878
+ --
17879
+ -- @returns The removed elements. This will be an empty array if no elements were removed.
17880
+ function ____exports.arrayRemoveInPlace(self, array, ...)
17881
+ local elementsToRemove = {...}
17882
+ local removedElements = {}
17883
+ for ____, element in ipairs(elementsToRemove) do
17884
+ local index = __TS__ArrayIndexOf(array, element)
17885
+ if index > -1 then
17886
+ local removedElement = __TS__ArraySplice(array, index, 1)
17887
+ __TS__ArrayPushArray(removedElements, removedElement)
17888
+ end
17889
+ end
17890
+ return removedElements
17891
+ end
18146
17892
  --- Shallow copies and removes the elements at the specified indexes from the array. Returns the
18147
17893
  -- copied array. If the specified indexes are not found in the array, it will simply return a
18148
17894
  -- shallow copy of the array.
@@ -20126,16 +19872,10 @@ local __TS__Class = ____lualib.__TS__Class
20126
19872
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
20127
19873
  local __TS__ArrayFindIndex = ____lualib.__TS__ArrayFindIndex
20128
19874
  local __TS__ArraySplice = ____lualib.__TS__ArraySplice
20129
- local __TS__ArrayEntries = ____lualib.__TS__ArrayEntries
20130
- local __TS__Iterator = ____lualib.__TS__Iterator
20131
19875
  local ____exports = {}
20132
- local ____log = require("functions.log")
20133
- local log = ____log.log
20134
19876
  local ____sort = require("functions.sort")
20135
19877
  local sortObjectArrayByKey = ____sort.sortObjectArrayByKey
20136
19878
  local stableSort = ____sort.stableSort
20137
- local ____tstlClass = require("functions.tstlClass")
20138
- local getTSTLClassName = ____tstlClass.getTSTLClassName
20139
19879
  local ____Feature = require("classes.private.Feature")
20140
19880
  local Feature = ____Feature.Feature
20141
19881
  --- The base class for a custom callback. Individual custom callbacks (and validation callbacks) will
@@ -20195,19 +19935,6 @@ function CustomCallback.prototype.removeSubscriber(self, callback)
20195
19935
  __TS__ArraySplice(self.subscriptions, subscriptionIndexMatchingCallback, 1)
20196
19936
  end
20197
19937
  end
20198
- function CustomCallback.prototype.logSubscriptions(self)
20199
- local tstlClassName = getTSTLClassName(nil, self)
20200
- log("Logging subscriptions for custom callback: " .. tostring(tstlClassName))
20201
- if #self.subscriptions == 0 then
20202
- log("- n/a (no subscriptions)")
20203
- else
20204
- for ____, ____value in __TS__Iterator(__TS__ArrayEntries(self.subscriptions)) do
20205
- local i = ____value[1]
20206
- local subscription = ____value[2]
20207
- log((("- " .. tostring(i + 1)) .. " - priority: ") .. tostring(subscription.priority))
20208
- end
20209
- end
20210
- end
20211
19938
  return ____exports
20212
19939
  end,
20213
19940
  ["classes.callbacks.EntityTakeDmgFilter"] = function(...)
@@ -20806,6 +20533,178 @@ function ____exports.onRoomFrame(self, roomFrameCount)
20806
20533
  local thisGameFrameCount = room:GetFrameCount()
20807
20534
  return thisGameFrameCount == roomFrameCount
20808
20535
  end
20536
+ return ____exports
20537
+ end,
20538
+ ["classes.DefaultMap"] = function(...)
20539
+ local ____lualib = require("lualib_bundle")
20540
+ local __TS__Class = ____lualib.__TS__Class
20541
+ local Map = ____lualib.Map
20542
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
20543
+ local __TS__TypeOf = ____lualib.__TS__TypeOf
20544
+ local __TS__New = ____lualib.__TS__New
20545
+ local ____exports = {}
20546
+ local ____types = require("functions.types")
20547
+ local isFunction = ____types.isFunction
20548
+ local isPrimitive = ____types.isPrimitive
20549
+ --- `DefaultMap` is a data structure that makes working with default values easier. It extends a
20550
+ -- `Map` and adds additional methods.
20551
+ --
20552
+ -- It is a common pattern to look up a value in a `Map`, and then, if the value does not exist, set
20553
+ -- a default value for the key, and then return the default value. `DefaultMap` abstracts this
20554
+ -- operation away by providing the `getAndSetDefault` method.
20555
+ --
20556
+ -- Using a `DefaultMap` is nice because it makes code more declarative, since you specify what the
20557
+ -- default value is alongside the types of the keys/values.
20558
+ --
20559
+ -- When instantiating a new `DefaultMap`, you must specify default value as the first argument. (The
20560
+ -- default value is the initial value that will be assigned to every new entry in the
20561
+ -- `getAndSetDefault` method.) For example:
20562
+ --
20563
+ -- ```ts
20564
+ -- // Initializes a new empty DefaultMap with a default value of "foo".
20565
+ -- const defaultMapWithString = new DefaultMap<string, string>("foo");
20566
+ --
20567
+ -- const value = defaultMapWithString.getAndSetDefault("bar");
20568
+ -- // value is now "foo" and an entry for "bar" is now set.
20569
+ -- ```
20570
+ --
20571
+ -- Sometimes, instead of having a static initial value for every entry in the map, you will want a
20572
+ -- dynamic initial value that is contingent upon the key or some other variable. In these cases, you
20573
+ -- can instead specify that the `DefaultMap` should run a function that will return the initial
20574
+ -- value. (This is referred to as a "factory function".) For example:
20575
+ --
20576
+ -- ```ts
20577
+ -- // Initializes a new empty DefaultMap with a default value based on "someGlobalVariable".
20578
+ -- const factoryFunction = () => someGlobalVariable ? 0 : 1;
20579
+ -- const defaultMapWithFactoryFunction = new DefaultMap<string, string>(factoryFunction);
20580
+ -- ```
20581
+ --
20582
+ -- Note that in TypeScript and Lua, booleans, numbers, and strings are "passed by value". This means
20583
+ -- that when the `DefaultMap` creates a new entry, if the default value is one of these 3 types, the
20584
+ -- values will be copied. On the other hand, arrays and maps and other complex data structures are
20585
+ -- "passed by reference". This means that when the `DefaultMap` creates a new entry, if the default
20586
+ -- value is an array, then it would not be copied. Instead, the same shared array would be assigned
20587
+ -- to every entry. Thus, to solve this problem, any variable that is passed by reference must be
20588
+ -- created using a factory function to ensure that each copy is unique. For example:
20589
+ --
20590
+ -- ```ts
20591
+ -- // Initializes a new empty DefaultMap with a default value of a new empty array.
20592
+ -- const factoryFunction = () => [];
20593
+ -- const defaultMapWithArray = new DefaultMap<string, string[]>(factoryFunction);
20594
+ -- ```
20595
+ --
20596
+ -- In the previous two examples, the factory functions did not have any arguments. But you can also
20597
+ -- specify a factory function that takes one or more arguments:
20598
+ --
20599
+ -- ```ts
20600
+ -- const factoryFunction = (arg: boolean) => arg ? 0 : 1;
20601
+ -- const defaultMapWithArg = new DefaultMap<string, string, [arg: boolean]>(factoryFunction);
20602
+ -- ```
20603
+ --
20604
+ -- Similar to a normal `Map`, you can also include an initializer list in the constructor as the
20605
+ -- second argument:
20606
+ --
20607
+ -- ```ts
20608
+ -- // Initializes a DefaultMap with a default value of "foo" and some initial values.
20609
+ -- const defaultMapWithInitialValues = new DefaultMap<string, string>("foo", [
20610
+ -- ["a1", "a2"],
20611
+ -- ["b1", "b2"],
20612
+ -- ], );
20613
+ -- ```
20614
+ --
20615
+ -- Finally, note that `DefaultMap` has the following additional utility methods:
20616
+ --
20617
+ -- - `getAndSetDefault` - The method that is called inside the overridden `get` method. In most
20618
+ -- cases, you can use the overridden `get` method instead of calling this function directly.
20619
+ -- However, if a factory function was provided during instantiation, and the factory function has
20620
+ -- one or more arguments, then you must call this method instead (and provide the corresponding
20621
+ -- arguments).
20622
+ -- - `getDefaultValue` - Returns the default value to be used for a new key. (If a factory function
20623
+ -- was provided during instantiation, this will execute the factory function.)
20624
+ -- - `getConstructorArg` - Helper method for cloning the map. Returns either the default value or
20625
+ -- the reference to the factory function.
20626
+ ____exports.DefaultMap = __TS__Class()
20627
+ local DefaultMap = ____exports.DefaultMap
20628
+ DefaultMap.name = "DefaultMap"
20629
+ __TS__ClassExtends(DefaultMap, Map)
20630
+ function DefaultMap.prototype.____constructor(self, defaultValueOrFactoryFunction, initializerArray)
20631
+ local argIsPrimitive = isPrimitive(nil, defaultValueOrFactoryFunction)
20632
+ local argIsFunction = isFunction(nil, defaultValueOrFactoryFunction)
20633
+ if not argIsPrimitive and not argIsFunction then
20634
+ error(("Failed to instantiate a DefaultMap since the provided default value was of type \"" .. __TS__TypeOf(defaultValueOrFactoryFunction)) .. "\". This error usually means that you are trying to use an array (or some other non-primitive data structure that is passed by reference) as the default value. Instead, return the data structure in a factory function, like \"() => []\". See the DefaultMap documentation for more details.")
20635
+ end
20636
+ Map.prototype.____constructor(self, initializerArray)
20637
+ if argIsFunction then
20638
+ self.defaultValue = nil
20639
+ self.defaultValueFactory = defaultValueOrFactoryFunction
20640
+ else
20641
+ self.defaultValue = defaultValueOrFactoryFunction
20642
+ self.defaultValueFactory = nil
20643
+ end
20644
+ end
20645
+ function DefaultMap.prototype.getAndSetDefault(self, key, ...)
20646
+ local value = Map.prototype.get(self, key)
20647
+ if value ~= nil then
20648
+ return value
20649
+ end
20650
+ local defaultValue = self:getDefaultValue(...)
20651
+ self:set(key, defaultValue)
20652
+ return defaultValue
20653
+ end
20654
+ function DefaultMap.prototype.getDefaultValue(self, ...)
20655
+ if self.defaultValue ~= nil then
20656
+ return self.defaultValue
20657
+ end
20658
+ if self.defaultValueFactory ~= nil then
20659
+ return self:defaultValueFactory(...)
20660
+ end
20661
+ error("A DefaultMap was incorrectly instantiated.")
20662
+ end
20663
+ function DefaultMap.prototype.getConstructorArg(self)
20664
+ if self.defaultValue ~= nil then
20665
+ return self.defaultValue
20666
+ end
20667
+ if self.defaultValueFactory ~= nil then
20668
+ return self.defaultValueFactory
20669
+ end
20670
+ error("A DefaultMap was incorrectly instantiated.")
20671
+ end
20672
+ local function test(self)
20673
+ local myDefaultMapBoolean = __TS__New(____exports.DefaultMap, false)
20674
+ local myDefaultMapBooleanFactory = __TS__New(
20675
+ ____exports.DefaultMap,
20676
+ function() return false end
20677
+ )
20678
+ local myDefaultMapBooleanWithoutParams = __TS__New(____exports.DefaultMap, false)
20679
+ local myDefaultMapNumber = __TS__New(____exports.DefaultMap, 123)
20680
+ local myDefaultMapNumberFactory = __TS__New(
20681
+ ____exports.DefaultMap,
20682
+ function() return 123 end
20683
+ )
20684
+ local myDefaultMapNumberWithoutParams = __TS__New(____exports.DefaultMap, 123)
20685
+ local myDefaultMapString = __TS__New(____exports.DefaultMap, "foo")
20686
+ local myDefaultMapStringFactory = __TS__New(
20687
+ ____exports.DefaultMap,
20688
+ function() return "foo" end
20689
+ )
20690
+ local myDefaultMapStringWithoutParams = __TS__New(____exports.DefaultMap, "foo")
20691
+ local myDefaultMapArray = __TS__New(
20692
+ ____exports.DefaultMap,
20693
+ function() return {} end
20694
+ )
20695
+ local myDefaultMapArrayWithoutParams = __TS__New(
20696
+ ____exports.DefaultMap,
20697
+ function() return {} end
20698
+ )
20699
+ local myDefaultMapMap = __TS__New(
20700
+ ____exports.DefaultMap,
20701
+ function() return __TS__New(Map) end
20702
+ )
20703
+ local myDefaultMapMapWithoutParams = __TS__New(
20704
+ ____exports.DefaultMap,
20705
+ function() return __TS__New(Map) end
20706
+ )
20707
+ end
20809
20708
  return ____exports
20810
20709
  end,
20811
20710
  ["functions.playerDataStructures"] = function(...)
@@ -21448,6 +21347,7 @@ local __TS__ArrayAt = ____lualib.__TS__ArrayAt
21448
21347
  local __TS__ArrayFind = ____lualib.__TS__ArrayFind
21449
21348
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
21450
21349
  local ____exports = {}
21350
+ local isTaintedModded
21451
21351
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
21452
21352
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
21453
21353
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
@@ -21489,6 +21389,12 @@ function ____exports.isVanillaPlayer(self, player)
21489
21389
  local character = player:GetPlayerType()
21490
21390
  return isVanillaCharacter(nil, character)
21491
21391
  end
21392
+ function isTaintedModded(self, player)
21393
+ local character = player:GetPlayerType()
21394
+ local name = player:GetName()
21395
+ local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
21396
+ return character == taintedCharacter
21397
+ end
21492
21398
  --- Helper function to check to see if any player is holding up an item (from e.g. an active item
21493
21399
  -- activation, a poop from IBS, etc.).
21494
21400
  function ____exports.anyPlayerHoldingItem(self)
@@ -21761,13 +21667,6 @@ function ____exports.isDamageFromPlayer(self, damageSource)
21761
21667
  local indirectPlayer = ____exports.getPlayerFromEntity(nil, damageSource)
21762
21668
  return indirectPlayer ~= nil
21763
21669
  end
21764
- --- Not exported since end-users should use the `isTainted` helper function directly.
21765
- local function isTaintedModded(self, player)
21766
- local character = player:GetPlayerType()
21767
- local name = player:GetName()
21768
- local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
21769
- return character == taintedCharacter
21770
- end
21771
21670
  --- Helper function for detecting when a player is Eden or Tainted Eden. Useful for situations where
21772
21671
  -- you want to know if the starting stats were randomized, for example.
21773
21672
  function ____exports.isEden(self, player)
@@ -22559,6 +22458,94 @@ function ____exports.setToBitFlags(self, set)
22559
22458
  end
22560
22459
  return flags
22561
22460
  end
22461
+ return ____exports
22462
+ end,
22463
+ ["interfaces.TSTLClassMetatable"] = function(...)
22464
+ local ____exports = {}
22465
+ return ____exports
22466
+ end,
22467
+ ["types.TSTLClass"] = function(...)
22468
+ local ____exports = {}
22469
+ return ____exports
22470
+ end,
22471
+ ["functions.tstlClass"] = function(...)
22472
+ local ____exports = {}
22473
+ local ____types = require("functions.types")
22474
+ local isTable = ____types.isTable
22475
+ local ____utils = require("functions.utils")
22476
+ local assertDefined = ____utils.assertDefined
22477
+ --- Helper function to get the constructor from an instantiated TypeScriptToLua class, which is
22478
+ -- located on the metatable.
22479
+ --
22480
+ -- Returns undefined if passed a non-table or if the provided table does not have a metatable.
22481
+ function ____exports.getTSTLClassConstructor(self, object)
22482
+ if not isTable(nil, object) then
22483
+ return nil
22484
+ end
22485
+ local metatable = getmetatable(object)
22486
+ if metatable == nil then
22487
+ return nil
22488
+ end
22489
+ return metatable.constructor
22490
+ end
22491
+ --- Helper function to get the name of a TypeScriptToLua class from the instantiated class object.
22492
+ --
22493
+ -- TSTL classes are Lua tables created with the `__TS__Class` Lua function from the TSTL lualib.
22494
+ -- Their name is contained within "constructor.name" metatable key.
22495
+ --
22496
+ -- For example, a `Map` class is has a name of "Map".
22497
+ --
22498
+ -- Returns undefined if passed a non-table or if the provided table does not have a metatable.
22499
+ function ____exports.getTSTLClassName(self, object)
22500
+ local constructor = ____exports.getTSTLClassConstructor(nil, object)
22501
+ if constructor == nil then
22502
+ return nil
22503
+ end
22504
+ return constructor.name
22505
+ end
22506
+ --- Helper function to determine if a given object is a TypeScriptToLua `Map`.
22507
+ --
22508
+ -- It is not reliable to use the `instanceof` operator to determine this because each Lua module has
22509
+ -- their own copies of the entire lualib and thus their own instantiated version of a `Map`.
22510
+ function ____exports.isDefaultMap(self, object)
22511
+ local className = ____exports.getTSTLClassName(nil, object)
22512
+ return className == "DefaultMap"
22513
+ end
22514
+ --- Helper function to check if a given table is a class table created by TypeScriptToLua.
22515
+ function ____exports.isTSTLClass(self, object)
22516
+ local tstlClassName = ____exports.getTSTLClassName(nil, object)
22517
+ return tstlClassName ~= nil
22518
+ end
22519
+ --- Helper function to determine if a given object is a TypeScriptToLua `Map`.
22520
+ --
22521
+ -- It is not reliable to use the `instanceof` operator to determine this because each Lua module
22522
+ -- might have their own copy of the entire lualib and thus their own instantiated version of a
22523
+ -- `Map`.
22524
+ function ____exports.isTSTLMap(self, object)
22525
+ local className = ____exports.getTSTLClassName(nil, object)
22526
+ return className == "Map"
22527
+ end
22528
+ --- Helper function to determine if a given object is a TypeScriptToLua `Set`.
22529
+ --
22530
+ -- It is not reliable to use the `instanceof` operator to determine this because each Lua module
22531
+ -- might have their own copy of the entire lualib and thus their own instantiated version of a
22532
+ -- `Set`.
22533
+ function ____exports.isTSTLSet(self, object)
22534
+ local className = ____exports.getTSTLClassName(nil, object)
22535
+ return className == "Set"
22536
+ end
22537
+ --- Initializes a new TypeScriptToLua class in the situation where you do not know what kind of class
22538
+ -- it is. This function requires that you provide an instantiated class of the same type, as it will
22539
+ -- use the class constructor that is present on the other object's metatable to initialize the new
22540
+ -- class.
22541
+ function ____exports.newTSTLClass(self, oldClass)
22542
+ local constructor = ____exports.getTSTLClassConstructor(nil, oldClass)
22543
+ assertDefined(nil, constructor, "Failed to instantiate a new TypeScriptToLua class since the provided old class does not have a metatable/constructor.")
22544
+ local newClass = {}
22545
+ local newClassMetatable = setmetatable(newClass, constructor.prototype)
22546
+ newClassMetatable:____constructor()
22547
+ return newClass
22548
+ end
22562
22549
  return ____exports
22563
22550
  end,
22564
22551
  ["functions.doors"] = function(...)
@@ -26474,7 +26461,6 @@ return ____exports
26474
26461
  local ____lualib = require("lualib_bundle")
26475
26462
  local Map = ____lualib.Map
26476
26463
  local __TS__New = ____lualib.__TS__New
26477
- local Set = ____lualib.Set
26478
26464
  local ____exports = {}
26479
26465
  local getCollectibleTypeFromArg
26480
26466
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
@@ -26614,14 +26600,14 @@ local GLITCHED_ITEM_THRESHOLD = 4000000000
26614
26600
  local QUALITY_TO_VANILLA_COLLECTIBLE_TYPES_MAP = (function()
26615
26601
  local qualityToCollectibleTypesMap = __TS__New(Map)
26616
26602
  for ____, quality in ipairs(QUALITIES) do
26617
- local collectibleTypesSet = __TS__New(Set)
26603
+ local collectibleTypes = {}
26618
26604
  for ____, collectibleType in ipairs(VANILLA_COLLECTIBLE_TYPES) do
26619
26605
  local collectibleTypeQuality = ____exports.getCollectibleQuality(nil, collectibleType)
26620
26606
  if collectibleTypeQuality == quality then
26621
- collectibleTypesSet:add(collectibleType)
26607
+ collectibleTypes[#collectibleTypes + 1] = collectibleType
26622
26608
  end
26623
26609
  end
26624
- qualityToCollectibleTypesMap:set(quality, collectibleTypesSet)
26610
+ qualityToCollectibleTypesMap:set(quality, collectibleTypes)
26625
26611
  end
26626
26612
  return qualityToCollectibleTypesMap
26627
26613
  end)(nil)
@@ -26812,7 +26798,7 @@ function ____exports.getCollectibleTags(self, collectibleOrCollectibleType)
26812
26798
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
26813
26799
  return itemConfigItem == nil and ItemConfigTagZero or itemConfigItem.Tags
26814
26800
  end
26815
- --- Returns a set containing every vanilla collectible type with the given quality.
26801
+ --- Returns an array containing every vanilla collectible type with the given quality.
26816
26802
  --
26817
26803
  -- Note that this function will only return vanilla collectible types. To handle modded collectible
26818
26804
  -- types, use the `getCollectibleTypesOfQuality` helper function instead.
@@ -43158,7 +43144,7 @@ ____exports.CARD_NAMES = {
43158
43144
  }
43159
43145
  return ____exports
43160
43146
  end,
43161
- ["sets.itemConfigCardTypesForCardsSet"] = function(...)
43147
+ ["sets.itemConfigCardTypesForCards"] = function(...)
43162
43148
  local ____lualib = require("lualib_bundle")
43163
43149
  local __TS__New = ____lualib.__TS__New
43164
43150
  local ____exports = {}
@@ -43167,7 +43153,7 @@ local ItemConfigCardType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigCardTy
43167
43153
  local ____ReadonlySet = require("types.ReadonlySet")
43168
43154
  local ReadonlySet = ____ReadonlySet.ReadonlySet
43169
43155
  --- The set of all `ItemConfigCardType` values that are not a rune or special object.
43170
- ____exports.ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET = __TS__New(ReadonlySet, {ItemConfigCardType.TAROT, ItemConfigCardType.SUIT, ItemConfigCardType.SPECIAL, ItemConfigCardType.TAROT_REVERSE})
43156
+ ____exports.ITEM_CONFIG_CARD_TYPES_FOR_CARDS = __TS__New(ReadonlySet, {ItemConfigCardType.TAROT, ItemConfigCardType.SUIT, ItemConfigCardType.SPECIAL, ItemConfigCardType.TAROT_REVERSE})
43171
43157
  return ____exports
43172
43158
  end,
43173
43159
  ["functions.cards"] = function(...)
@@ -43191,8 +43177,8 @@ local DEFAULT_CARD_DESCRIPTION = ____cardDescriptions.DEFAULT_CARD_DESCRIPTION
43191
43177
  local ____cardNames = require("objects.cardNames")
43192
43178
  local CARD_NAMES = ____cardNames.CARD_NAMES
43193
43179
  local DEFAULT_CARD_NAME = ____cardNames.DEFAULT_CARD_NAME
43194
- local ____itemConfigCardTypesForCardsSet = require("sets.itemConfigCardTypesForCardsSet")
43195
- local ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET = ____itemConfigCardTypesForCardsSet.ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET
43180
+ local ____itemConfigCardTypesForCards = require("sets.itemConfigCardTypesForCards")
43181
+ local ITEM_CONFIG_CARD_TYPES_FOR_CARDS = ____itemConfigCardTypesForCards.ITEM_CONFIG_CARD_TYPES_FOR_CARDS
43196
43182
  local ____flag = require("functions.flag")
43197
43183
  local addFlag = ____flag.addFlag
43198
43184
  function ____exports.isVanillaCardType(self, cardType)
@@ -43270,7 +43256,7 @@ function ____exports.isCard(self, cardType)
43270
43256
  if itemConfigCardType == nil then
43271
43257
  return false
43272
43258
  end
43273
- return ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET:has(itemConfigCardType)
43259
+ return ITEM_CONFIG_CARD_TYPES_FOR_CARDS:has(itemConfigCardType)
43274
43260
  end
43275
43261
  --- Returns whether the given card type matches the specified item config card type.
43276
43262
  function ____exports.isCardType(self, cardType, itemConfigCardType)
@@ -43680,7 +43666,6 @@ local __TS__Class = ____lualib.__TS__Class
43680
43666
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
43681
43667
  local Set = ____lualib.Set
43682
43668
  local Map = ____lualib.Map
43683
- local __TS__Iterator = ____lualib.__TS__Iterator
43684
43669
  local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
43685
43670
  local ____exports = {}
43686
43671
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
@@ -43709,6 +43694,9 @@ local ____decorators = require("decorators")
43709
43694
  local Exported = ____decorators.Exported
43710
43695
  local ____ISCFeature = require("enums.ISCFeature")
43711
43696
  local ISCFeature = ____ISCFeature.ISCFeature
43697
+ local ____array = require("functions.array")
43698
+ local arrayRemove = ____array.arrayRemove
43699
+ local getRandomArrayElement = ____array.getRandomArrayElement
43712
43700
  local ____cards = require("functions.cards")
43713
43701
  local getItemConfigCardType = ____cards.getItemConfigCardType
43714
43702
  local ____collectibleTag = require("functions.collectibleTag")
@@ -43722,10 +43710,7 @@ local isPassiveOrFamiliarCollectible = ____collectibles.isPassiveOrFamiliarColle
43722
43710
  local ____flag = require("functions.flag")
43723
43711
  local getFlagName = ____flag.getFlagName
43724
43712
  local ____set = require("functions.set")
43725
- local copySet = ____set.copySet
43726
- local deleteSetsFromSet = ____set.deleteSetsFromSet
43727
43713
  local getRandomSetElement = ____set.getRandomSetElement
43728
- local getSortedSetValues = ____set.getSortedSetValues
43729
43714
  local ____trinkets = require("functions.trinkets")
43730
43715
  local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
43731
43716
  local ____types = require("functions.types")
@@ -43737,12 +43722,10 @@ local ____utils = require("functions.utils")
43737
43722
  local assertDefined = ____utils.assertDefined
43738
43723
  local iRange = ____utils.iRange
43739
43724
  local ____repeat = ____utils["repeat"]
43740
- local ____itemConfigCardTypesForCardsSet = require("sets.itemConfigCardTypesForCardsSet")
43741
- local ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET = ____itemConfigCardTypesForCardsSet.ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET
43725
+ local ____itemConfigCardTypesForCards = require("sets.itemConfigCardTypesForCards")
43726
+ local ITEM_CONFIG_CARD_TYPES_FOR_CARDS = ____itemConfigCardTypesForCards.ITEM_CONFIG_CARD_TYPES_FOR_CARDS
43742
43727
  local ____ReadonlyMap = require("types.ReadonlyMap")
43743
43728
  local ReadonlyMap = ____ReadonlyMap.ReadonlyMap
43744
- local ____ReadonlySet = require("types.ReadonlySet")
43745
- local ReadonlySet = ____ReadonlySet.ReadonlySet
43746
43729
  local ____Feature = require("classes.private.Feature")
43747
43730
  local Feature = ____Feature.Feature
43748
43731
  local CONDITIONAL_FLYING_COLLECTIBLE_TYPES = {CollectibleType.BIBLE, CollectibleType.EMPTY_VESSEL, CollectibleType.ASTRAL_PROJECTION, CollectibleType.RECALL}
@@ -43791,15 +43774,15 @@ function ModdedElementSets.prototype.____constructor(self, moddedElementDetectio
43791
43774
  self.moddedPillEffectsSet = __TS__New(Set)
43792
43775
  self.cacheFlagToCollectibleTypesMap = __TS__New(Map)
43793
43776
  self.cacheFlagToTrinketTypesMap = __TS__New(Map)
43794
- self.flyingCollectibleTypesSet = __TS__New(Set)
43795
- self.permanentFlyingCollectibleTypesSet = __TS__New(Set)
43796
- self.flyingTrinketTypesSet = __TS__New(Set)
43777
+ self.flyingCollectibleTypes = {}
43778
+ self.permanentFlyingCollectibleTypes = {}
43779
+ self.flyingTrinketTypes = {}
43797
43780
  self.tagToCollectibleTypesMap = __TS__New(Map)
43798
43781
  self.edenActiveCollectibleTypesSet = __TS__New(Set)
43799
43782
  self.edenPassiveCollectibleTypesSet = __TS__New(Set)
43800
43783
  self.qualityToCollectibleTypesMap = __TS__New(Map)
43801
43784
  self.itemConfigCardTypeToCardTypeMap = __TS__New(Map)
43802
- self.cardSet = __TS__New(Set)
43785
+ self.cardTypeCardArray = {}
43803
43786
  self.featuresUsed = {ISCFeature.MODDED_ELEMENT_DETECTION}
43804
43787
  self.moddedElementDetection = moddedElementDetection
43805
43788
  end
@@ -43923,10 +43906,7 @@ function ModdedElementSets.prototype.lazyInitModdedPillEffects(self)
43923
43906
  end
43924
43907
  function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
43925
43908
  for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
43926
- self.tagToCollectibleTypesMap:set(
43927
- itemConfigTag,
43928
- __TS__New(Set)
43929
- )
43909
+ self.tagToCollectibleTypesMap:set(itemConfigTag, {})
43930
43910
  end
43931
43911
  for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
43932
43912
  for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
@@ -43934,12 +43914,12 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
43934
43914
  if not collectibleHasTag(nil, collectibleType, itemConfigTag) then
43935
43915
  goto __continue37
43936
43916
  end
43937
- local collectibleTypesSet = self.tagToCollectibleTypesMap:get(itemConfigTag)
43938
- if collectibleTypesSet == nil then
43917
+ local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
43918
+ if collectibleTypes == nil then
43939
43919
  local flagName = getFlagName(nil, itemConfigTag, ItemConfigTag)
43940
43920
  error("Failed to get the collectible types for item tag: " .. tostring(flagName))
43941
43921
  end
43942
- collectibleTypesSet:add(collectibleType)
43922
+ collectibleTypes[#collectibleTypes + 1] = collectibleType
43943
43923
  end
43944
43924
  ::__continue37::
43945
43925
  end
@@ -43947,58 +43927,55 @@ function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
43947
43927
  end
43948
43928
  function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
43949
43929
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
43950
- local collectibleTypeSet = __TS__New(Set)
43930
+ local collectibleTypes = {}
43951
43931
  for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
43952
43932
  if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
43953
- collectibleTypeSet:add(collectibleType)
43933
+ collectibleTypes[#collectibleTypes + 1] = collectibleType
43954
43934
  end
43955
43935
  end
43956
- self.cacheFlagToCollectibleTypesMap:set(cacheFlag, collectibleTypeSet)
43936
+ self.cacheFlagToCollectibleTypesMap:set(cacheFlag, collectibleTypes)
43957
43937
  end
43958
43938
  end
43959
43939
  function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
43960
43940
  for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
43961
- local trinketTypesSet = __TS__New(Set)
43941
+ local trinketTypes = {}
43962
43942
  for ____, trinketType in ipairs(self:getTrinketTypes()) do
43963
43943
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
43964
- trinketTypesSet:add(trinketType)
43944
+ trinketTypes[#trinketTypes + 1] = trinketType
43965
43945
  end
43966
43946
  end
43967
- self.cacheFlagToTrinketTypesMap:set(cacheFlag, trinketTypesSet)
43947
+ self.cacheFlagToTrinketTypesMap:set(cacheFlag, trinketTypes)
43968
43948
  end
43969
43949
  end
43970
43950
  function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
43971
- self.flyingCollectibleTypesSet = copySet(
43951
+ local collectibleTypesWithFlyingCacheFlag = self:getCollectibleTypesWithCacheFlag(CacheFlag.FLYING)
43952
+ local collectibleTypesWithAllCacheFlag = self:getCollectibleTypesWithCacheFlag(CacheFlag.ALL)
43953
+ self.flyingCollectibleTypes = arrayRemove(
43972
43954
  nil,
43973
- self:getCollectibleTypesWithCacheFlag(CacheFlag.FLYING)
43955
+ collectibleTypesWithFlyingCacheFlag,
43956
+ table.unpack(collectibleTypesWithAllCacheFlag)
43974
43957
  )
43975
- local collectiblesWithAllCacheFlag = self:getCollectibleTypesWithCacheFlag(CacheFlag.ALL)
43976
- deleteSetsFromSet(nil, self.flyingCollectibleTypesSet, collectiblesWithAllCacheFlag)
43977
- local permanentFlyingCollectibleTypes = copySet(nil, self.flyingCollectibleTypesSet)
43978
- for ____, collectibleType in ipairs(CONDITIONAL_FLYING_COLLECTIBLE_TYPES) do
43979
- permanentFlyingCollectibleTypes:delete(collectibleType)
43980
- end
43981
- for ____, collectibleType in __TS__Iterator(permanentFlyingCollectibleTypes) do
43982
- self.permanentFlyingCollectibleTypesSet:add(collectibleType)
43983
- end
43984
- end
43985
- function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
43986
- self.flyingTrinketTypesSet = copySet(
43958
+ self.permanentFlyingCollectibleTypes = arrayRemove(
43987
43959
  nil,
43988
- self:getTrinketsTypesWithCacheFlag(CacheFlag.FLYING)
43960
+ self.flyingCollectibleTypes,
43961
+ table.unpack(CONDITIONAL_FLYING_COLLECTIBLE_TYPES)
43989
43962
  )
43990
- local trinketsWithAllCacheFlag = copySet(
43963
+ end
43964
+ function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
43965
+ local trinketTypesWithFlyingCacheFlag = self:getTrinketsTypesWithCacheFlag(CacheFlag.FLYING)
43966
+ local trinketTypesWithAllCacheFlag = self:getTrinketsTypesWithCacheFlag(CacheFlag.ALL)
43967
+ local trinketTypesWithAllCacheFlagThatDontGrantFlying = arrayRemove(nil, trinketTypesWithAllCacheFlag, TrinketType.AZAZELS_STUMP)
43968
+ self.flyingTrinketTypes = arrayRemove(
43991
43969
  nil,
43992
- self:getTrinketsTypesWithCacheFlag(CacheFlag.ALL)
43970
+ trinketTypesWithFlyingCacheFlag,
43971
+ table.unpack(trinketTypesWithAllCacheFlagThatDontGrantFlying)
43993
43972
  )
43994
- trinketsWithAllCacheFlag:delete(TrinketType.AZAZELS_STUMP)
43995
- deleteSetsFromSet(nil, self.flyingTrinketTypesSet, trinketsWithAllCacheFlag)
43996
43973
  end
43997
43974
  function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
43998
43975
  for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
43999
43976
  do
44000
43977
  if isHiddenCollectible(nil, collectibleType) or collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
44001
- goto __continue61
43978
+ goto __continue57
44002
43979
  end
44003
43980
  if isActiveCollectible(nil, collectibleType) then
44004
43981
  self.edenActiveCollectibleTypesSet:add(collectibleType)
@@ -44007,40 +43984,38 @@ function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
44007
43984
  self.edenPassiveCollectibleTypesSet:add(collectibleType)
44008
43985
  end
44009
43986
  end
44010
- ::__continue61::
43987
+ ::__continue57::
44011
43988
  end
44012
43989
  end
44013
43990
  function ModdedElementSets.prototype.lazyInitQualityToCollectibleTypesMap(self)
44014
43991
  for ____, quality in ipairs(QUALITIES) do
44015
- local collectibleTypesSet = __TS__New(Set)
43992
+ local collectibleTypes = {}
44016
43993
  for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
44017
43994
  local collectibleTypeQuality = getCollectibleQuality(nil, collectibleType)
44018
43995
  if collectibleTypeQuality == quality then
44019
- collectibleTypesSet:add(collectibleType)
43996
+ collectibleTypes[#collectibleTypes + 1] = collectibleType
44020
43997
  end
44021
43998
  end
44022
- self.qualityToCollectibleTypesMap:set(quality, collectibleTypesSet)
43999
+ self.qualityToCollectibleTypesMap:set(quality, collectibleTypes)
44023
44000
  end
44024
44001
  end
44025
44002
  function ModdedElementSets.prototype.lazyInitCardTypes(self)
44026
44003
  for ____, itemConfigCardType in ipairs(ITEM_CONFIG_CARD_TYPE_VALUES) do
44027
- self.itemConfigCardTypeToCardTypeMap:set(
44028
- itemConfigCardType,
44029
- __TS__New(Set)
44030
- )
44004
+ self.itemConfigCardTypeToCardTypeMap:set(itemConfigCardType, {})
44031
44005
  end
44032
44006
  for ____, cardType in ipairs(self:getCardTypes()) do
44033
44007
  local itemConfigCardType = getItemConfigCardType(nil, cardType)
44034
44008
  if itemConfigCardType ~= nil then
44035
- local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
44009
+ local cardTypes = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
44036
44010
  assertDefined(
44037
44011
  nil,
44038
- cardTypeSet,
44039
- "Failed to get the card set for item config card type: " .. tostring(itemConfigCardType)
44012
+ cardTypes,
44013
+ "Failed to get the card types for item config card type: " .. tostring(itemConfigCardType)
44040
44014
  )
44041
- cardTypeSet:add(cardType)
44042
- if ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET:has(itemConfigCardType) then
44043
- self.cardSet:add(cardType)
44015
+ cardTypes[#cardTypes + 1] = cardType
44016
+ if ITEM_CONFIG_CARD_TYPES_FOR_CARDS:has(itemConfigCardType) then
44017
+ local ____self_cardTypeCardArray_12 = self.cardTypeCardArray
44018
+ ____self_cardTypeCardArray_12[#____self_cardTypeCardArray_12 + 1] = cardType
44044
44019
  end
44045
44020
  end
44046
44021
  end
@@ -44157,24 +44132,24 @@ function ModdedElementSets.prototype.getCollectibleTypesWithCacheFlag(self, cach
44157
44132
  self:lazyInit()
44158
44133
  local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
44159
44134
  if collectiblesSet == nil then
44160
- return __TS__New(ReadonlySet)
44135
+ return {}
44161
44136
  end
44162
44137
  return collectiblesSet
44163
44138
  end
44164
44139
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesWithCacheFlag", true)
44165
44140
  function ModdedElementSets.prototype.getTrinketsTypesWithCacheFlag(self, cacheFlag)
44166
44141
  self:lazyInit()
44167
- local trinketsSet = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
44168
- if trinketsSet == nil then
44169
- return __TS__New(ReadonlySet)
44142
+ local trinketTypes = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
44143
+ if trinketTypes == nil then
44144
+ return {}
44170
44145
  end
44171
- return trinketsSet
44146
+ return trinketTypes
44172
44147
  end
44173
44148
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketsTypesWithCacheFlag", true)
44174
44149
  function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, player, cacheFlag)
44175
44150
  local collectiblesWithCacheFlag = self:getCollectibleTypesWithCacheFlag(cacheFlag)
44176
44151
  local playerCollectibles = {}
44177
- for ____, collectibleType in ipairs(getSortedSetValues(nil, collectiblesWithCacheFlag)) do
44152
+ for ____, collectibleType in ipairs(collectiblesWithCacheFlag) do
44178
44153
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
44179
44154
  ____repeat(
44180
44155
  nil,
@@ -44190,7 +44165,7 @@ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollecti
44190
44165
  function ModdedElementSets.prototype.getPlayerTrinketsWithCacheFlag(self, player, cacheFlag)
44191
44166
  local trinketTypesWithCacheFlag = self:getTrinketsTypesWithCacheFlag(cacheFlag)
44192
44167
  local playerTrinkets = __TS__New(Map)
44193
- for ____, trinketType in __TS__Iterator(trinketTypesWithCacheFlag) do
44168
+ for ____, trinketType in ipairs(trinketTypesWithCacheFlag) do
44194
44169
  local trinketMultiplier = player:GetTrinketMultiplier(trinketType)
44195
44170
  if trinketMultiplier > 0 then
44196
44171
  playerTrinkets:set(trinketType, trinketMultiplier)
@@ -44201,12 +44176,12 @@ end
44201
44176
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerTrinketsWithCacheFlag", true)
44202
44177
  function ModdedElementSets.prototype.getFlyingCollectibleTypes(self, includeConditionalItems)
44203
44178
  self:lazyInit()
44204
- return includeConditionalItems and self.flyingCollectibleTypesSet or self.permanentFlyingCollectibleTypesSet
44179
+ return includeConditionalItems and self.flyingCollectibleTypes or self.permanentFlyingCollectibleTypes
44205
44180
  end
44206
44181
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibleTypes", true)
44207
44182
  function ModdedElementSets.prototype.getFlyingTrinketTypes(self)
44208
44183
  self:lazyInit()
44209
- return self.flyingTrinketTypesSet
44184
+ return self.flyingTrinketTypes
44210
44185
  end
44211
44186
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinketTypes", true)
44212
44187
  function ModdedElementSets.prototype.getCollectibleTypesWithTag(self, itemConfigTag)
@@ -44223,7 +44198,7 @@ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTyp
44223
44198
  function ModdedElementSets.prototype.getPlayerCollectiblesWithTag(self, player, itemConfigTag)
44224
44199
  local collectibleTypesWithTag = self:getCollectibleTypesWithTag(itemConfigTag)
44225
44200
  local playerCollectibles = {}
44226
- for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleTypesWithTag)) do
44201
+ for ____, collectibleType in ipairs(collectibleTypesWithTag) do
44227
44202
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
44228
44203
  ____repeat(
44229
44204
  nil,
@@ -44249,7 +44224,7 @@ __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTyp
44249
44224
  function ModdedElementSets.prototype.getPlayerCollectiblesForTransformation(self, player, playerForm)
44250
44225
  local collectibleForTransformation = self:getCollectibleTypesForTransformation(playerForm)
44251
44226
  local playerCollectibles = {}
44252
- for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleForTransformation)) do
44227
+ for ____, collectibleType in ipairs(collectibleForTransformation) do
44253
44228
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
44254
44229
  ____repeat(
44255
44230
  nil,
@@ -44301,33 +44276,33 @@ end
44301
44276
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesOfQuality", true)
44302
44277
  function ModdedElementSets.prototype.getPlayerCollectiblesOfQuality(self, player, quality)
44303
44278
  local collectibleTypesOfQuality = self:getCollectibleTypesOfQuality(quality)
44304
- local playerCollectibles = {}
44305
- for ____, collectibleType in ipairs(getSortedSetValues(nil, collectibleTypesOfQuality)) do
44279
+ local playerCollectibleTypes = {}
44280
+ for ____, collectibleType in ipairs(collectibleTypesOfQuality) do
44306
44281
  local numCollectibles = player:GetCollectibleNum(collectibleType, true)
44307
44282
  ____repeat(
44308
44283
  nil,
44309
44284
  numCollectibles,
44310
44285
  function()
44311
- playerCollectibles[#playerCollectibles + 1] = collectibleType
44286
+ playerCollectibleTypes[#playerCollectibleTypes + 1] = collectibleType
44312
44287
  end
44313
44288
  )
44314
44289
  end
44315
- return playerCollectibles
44290
+ return playerCollectibleTypes
44316
44291
  end
44317
44292
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesOfQuality", true)
44318
44293
  function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
44319
44294
  local itemConfigCardTypes = {...}
44320
44295
  self:lazyInit()
44321
- local matchingCardTypes = __TS__New(Set)
44296
+ local matchingCardTypes = {}
44322
44297
  for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
44323
- local cardTypeSet = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
44298
+ local cardTypes = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
44324
44299
  assertDefined(
44325
44300
  nil,
44326
- cardTypeSet,
44327
- "Failed to get the card type set for item config type: " .. tostring(itemConfigCardType)
44301
+ cardTypes,
44302
+ "Failed to get the card types for item config type: " .. tostring(itemConfigCardType)
44328
44303
  )
44329
- for ____, cardType in __TS__Iterator(cardTypeSet) do
44330
- matchingCardTypes:add(cardType)
44304
+ for ____, cardType in ipairs(cardTypes) do
44305
+ matchingCardTypes[#matchingCardTypes + 1] = cardType
44331
44306
  end
44332
44307
  end
44333
44308
  return matchingCardTypes
@@ -44337,8 +44312,8 @@ function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCar
44337
44312
  if exceptions == nil then
44338
44313
  exceptions = {}
44339
44314
  end
44340
- local cardTypeSet = self:getCardTypesOfType(itemConfigCardType)
44341
- return getRandomSetElement(nil, cardTypeSet, seedOrRNG, exceptions)
44315
+ local cardTypes = self:getCardTypesOfType(itemConfigCardType)
44316
+ return getRandomArrayElement(nil, cardTypes, seedOrRNG, exceptions)
44342
44317
  end
44343
44318
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCardTypeOfType", true)
44344
44319
  function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
@@ -44346,16 +44321,16 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
44346
44321
  exceptions = {}
44347
44322
  end
44348
44323
  self:lazyInit()
44349
- return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
44324
+ return getRandomArrayElement(nil, self.cardTypeCardArray, seedOrRNG, exceptions)
44350
44325
  end
44351
44326
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
44352
44327
  function ModdedElementSets.prototype.getRandomRune(self, seedOrRNG, exceptions)
44353
44328
  if exceptions == nil then
44354
44329
  exceptions = {}
44355
44330
  end
44356
- local runesSet = self:getCardTypesOfType(ItemConfigCardType.RUNE)
44357
- runesSet:delete(CardType.RUNE_SHARD)
44358
- return getRandomSetElement(nil, runesSet, seedOrRNG, exceptions)
44331
+ local runeCardTypes = self:getCardTypesOfType(ItemConfigCardType.RUNE)
44332
+ exceptions[#exceptions + 1] = CardType.RUNE_SHARD
44333
+ return getRandomArrayElement(nil, runeCardTypes, seedOrRNG, exceptions)
44359
44334
  end
44360
44335
  __TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomRune", true)
44361
44336
  return ____exports
@@ -47196,7 +47171,7 @@ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
47196
47171
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
47197
47172
  local ____Feature = require("classes.private.Feature")
47198
47173
  local Feature = ____Feature.Feature
47199
- local v = {room = {roomClearGameFrame = nil, roomClearRoomFrame = nil}}
47174
+ local v = {room = {roomClearGameFrame = nil, roomClearRenderFrame = nil, roomClearRoomFrame = nil}}
47200
47175
  ____exports.RoomClearFrame = __TS__Class()
47201
47176
  local RoomClearFrame = ____exports.RoomClearFrame
47202
47177
  RoomClearFrame.name = "RoomClearFrame"
@@ -47208,7 +47183,9 @@ function RoomClearFrame.prototype.____constructor(self)
47208
47183
  local gameFrameCount = game:GetFrameCount()
47209
47184
  local room = game:GetRoom()
47210
47185
  local roomFrameCount = room:GetFrameCount()
47186
+ local renderFrameCount = Isaac.GetFrameCount()
47211
47187
  v.room.roomClearGameFrame = gameFrameCount
47188
+ v.room.roomClearRenderFrame = renderFrameCount
47212
47189
  v.room.roomClearRoomFrame = roomFrameCount
47213
47190
  end
47214
47191
  self.customCallbacksUsed = {{ModCallbackCustom.POST_ROOM_CLEAR_CHANGED, self.postRoomClearChangedTrue}}
@@ -47217,8 +47194,12 @@ function RoomClearFrame.prototype.getRoomClearGameFrame(self)
47217
47194
  return v.room.roomClearGameFrame
47218
47195
  end
47219
47196
  __TS__DecorateLegacy({Exported}, RoomClearFrame.prototype, "getRoomClearGameFrame", true)
47197
+ function RoomClearFrame.prototype.getRoomClearRenderFrame(self)
47198
+ return v.room.roomClearRenderFrame
47199
+ end
47200
+ __TS__DecorateLegacy({Exported}, RoomClearFrame.prototype, "getRoomClearRenderFrame", true)
47220
47201
  function RoomClearFrame.prototype.getRoomClearRoomFrame(self)
47221
- return v.room.roomClearGameFrame
47202
+ return v.room.roomClearRoomFrame
47222
47203
  end
47223
47204
  __TS__DecorateLegacy({Exported}, RoomClearFrame.prototype, "getRoomClearRoomFrame", true)
47224
47205
  return ____exports
@@ -60754,7 +60735,6 @@ return ____exports
60754
60735
  local ____lualib = require("lualib_bundle")
60755
60736
  local __TS__Class = ____lualib.__TS__Class
60756
60737
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
60757
- local __TS__Iterator = ____lualib.__TS__Iterator
60758
60738
  local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
60759
60739
  local ____exports = {}
60760
60740
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
@@ -60778,13 +60758,13 @@ end
60778
60758
  function FlyingDetection.prototype.hasFlyingTemporaryEffect(self, player)
60779
60759
  local effects = player:GetEffects()
60780
60760
  local flyingCollectibles = self.moddedElementSets:getFlyingCollectibleTypes(true)
60781
- for ____, collectibleType in __TS__Iterator(flyingCollectibles) do
60761
+ for ____, collectibleType in ipairs(flyingCollectibles) do
60782
60762
  if effects:HasCollectibleEffect(collectibleType) then
60783
60763
  return true
60784
60764
  end
60785
60765
  end
60786
60766
  local flyingTrinkets = self.moddedElementSets:getFlyingTrinketTypes()
60787
- for ____, trinketType in __TS__Iterator(flyingTrinkets) do
60767
+ for ____, trinketType in ipairs(flyingTrinkets) do
60788
60768
  if effects:HasTrinketEffect(trinketType) then
60789
60769
  return true
60790
60770
  end