isaacscript-common 6.8.0 → 6.10.1

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 (122) hide show
  1. package/dist/features/customStage/customStageGridEntities.lua +2 -2
  2. package/dist/features/customStage/exports.d.ts.map +1 -1
  3. package/dist/features/customStage/exports.lua +5 -4
  4. package/dist/features/customStage/init.d.ts.map +1 -1
  5. package/dist/features/customStage/init.lua +12 -3
  6. package/dist/features/customStage/streakText.d.ts +4 -2
  7. package/dist/features/customStage/streakText.d.ts.map +1 -1
  8. package/dist/features/customStage/streakText.lua +216 -15
  9. package/dist/features/customStage/v.d.ts +4 -2
  10. package/dist/features/customStage/v.d.ts.map +1 -1
  11. package/dist/features/customStage/v.lua +9 -1
  12. package/dist/features/customStage/versusScreen.d.ts +1 -1
  13. package/dist/features/customStage/versusScreen.d.ts.map +1 -1
  14. package/dist/features/customStage/versusScreen.lua +2 -5
  15. package/dist/features/extraConsoleCommands/init.lua +1 -0
  16. package/dist/features/extraConsoleCommands/listCommands.d.ts +8 -0
  17. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  18. package/dist/features/extraConsoleCommands/listCommands.lua +13 -0
  19. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  20. package/dist/features/saveDataManager/exports.lua +2 -4
  21. package/dist/features/saveDataManager/load.d.ts +1 -1
  22. package/dist/features/saveDataManager/load.d.ts.map +1 -1
  23. package/dist/features/saveDataManager/main.d.ts.map +1 -1
  24. package/dist/features/saveDataManager/main.lua +0 -1
  25. package/dist/features/saveDataManager/maps.d.ts +3 -3
  26. package/dist/features/saveDataManager/maps.d.ts.map +1 -1
  27. package/dist/features/saveDataManager/maps.lua +1 -4
  28. package/dist/features/saveDataManager/merge.d.ts +2 -2
  29. package/dist/features/saveDataManager/merge.d.ts.map +1 -1
  30. package/dist/features/saveDataManager/merge.lua +3 -3
  31. package/dist/features/saveDataManager/save.d.ts +1 -1
  32. package/dist/features/saveDataManager/save.d.ts.map +1 -1
  33. package/dist/features/saveDataManager/save.lua +1 -2
  34. package/dist/features/saveDataManager/{serializationBrand.d.ts → serializationBrands.d.ts} +1 -1
  35. package/dist/features/saveDataManager/serializationBrands.d.ts.map +1 -0
  36. package/dist/features/saveDataManager/{serializationBrand.lua → serializationBrands.lua} +0 -0
  37. package/dist/functions/array.d.ts.map +1 -1
  38. package/dist/functions/color.d.ts +1 -1
  39. package/dist/functions/color.d.ts.map +1 -1
  40. package/dist/functions/deepCopy.d.ts +1 -1
  41. package/dist/functions/deepCopy.lua +55 -36
  42. package/dist/functions/deepCopyTests.lua +20 -17
  43. package/dist/functions/entities.d.ts +1 -1
  44. package/dist/functions/entities.d.ts.map +1 -1
  45. package/dist/functions/input.d.ts.map +1 -1
  46. package/dist/functions/input.lua +8 -10
  47. package/dist/functions/jsonHelpers.d.ts +1 -1
  48. package/dist/functions/jsonHelpers.d.ts.map +1 -1
  49. package/dist/functions/kColor.d.ts +1 -1
  50. package/dist/functions/kColor.d.ts.map +1 -1
  51. package/dist/functions/log.d.ts +1 -1
  52. package/dist/functions/log.d.ts.map +1 -1
  53. package/dist/functions/log.lua +3 -1
  54. package/dist/functions/mergeTests.d.ts +2 -2
  55. package/dist/functions/mergeTests.lua +2 -2
  56. package/dist/functions/playerIndex.d.ts +1 -1
  57. package/dist/functions/playerIndex.lua +1 -1
  58. package/dist/functions/rng.d.ts +1 -1
  59. package/dist/functions/rng.d.ts.map +1 -1
  60. package/dist/functions/run.d.ts +8 -0
  61. package/dist/functions/run.d.ts.map +1 -1
  62. package/dist/functions/run.lua +15 -0
  63. package/dist/functions/table.d.ts +9 -9
  64. package/dist/functions/table.d.ts.map +1 -1
  65. package/dist/functions/table.lua +23 -21
  66. package/dist/functions/types.d.ts +1 -1
  67. package/dist/functions/types.d.ts.map +1 -1
  68. package/dist/functions/vector.d.ts +1 -1
  69. package/dist/functions/vector.d.ts.map +1 -1
  70. package/dist/interfaces/SaveData.d.ts +1 -1
  71. package/dist/interfaces/private/TSTLClassMetatable.d.ts +1 -1
  72. package/dist/interfaces/private/TSTLClassMetatable.d.ts.map +1 -1
  73. package/dist/lualib_bundle.lua +38 -7
  74. package/dist/types/PlayerIndex.d.ts +3 -2
  75. package/dist/types/PlayerIndex.d.ts.map +1 -1
  76. package/dist/types/private/IsaacAPIClass.d.ts +1 -1
  77. package/dist/types/private/IsaacAPIClass.d.ts.map +1 -1
  78. package/dist/types/private/SerializedIsaacAPIClass.d.ts +1 -1
  79. package/dist/types/private/SerializedIsaacAPIClass.d.ts.map +1 -1
  80. package/dist/types/private/TSTLClass.d.ts +1 -1
  81. package/dist/types/private/TSTLClass.d.ts.map +1 -1
  82. package/package.json +2 -2
  83. package/src/features/customStage/customStageGridEntities.ts +4 -4
  84. package/src/features/customStage/exports.ts +5 -3
  85. package/src/features/customStage/init.ts +19 -7
  86. package/src/features/customStage/streakText.ts +284 -19
  87. package/src/features/customStage/v.ts +6 -1
  88. package/src/features/customStage/versusScreen.ts +2 -5
  89. package/src/features/extraConsoleCommands/init.ts +1 -0
  90. package/src/features/extraConsoleCommands/listCommands.ts +14 -0
  91. package/src/features/saveDataManager/exports.ts +3 -8
  92. package/src/features/saveDataManager/load.ts +2 -3
  93. package/src/features/saveDataManager/main.ts +4 -5
  94. package/src/features/saveDataManager/maps.ts +3 -3
  95. package/src/features/saveDataManager/merge.ts +11 -11
  96. package/src/features/saveDataManager/save.ts +6 -6
  97. package/src/features/saveDataManager/{serializationBrand.ts → serializationBrands.ts} +0 -0
  98. package/src/functions/array.ts +2 -4
  99. package/src/functions/color.ts +3 -3
  100. package/src/functions/deepCopy.ts +77 -40
  101. package/src/functions/deepCopyTests.ts +45 -28
  102. package/src/functions/entities.ts +7 -7
  103. package/src/functions/input.ts +7 -8
  104. package/src/functions/isaacAPIClass.ts +3 -3
  105. package/src/functions/jsonHelpers.ts +3 -3
  106. package/src/functions/kColor.ts +3 -3
  107. package/src/functions/log.ts +7 -4
  108. package/src/functions/mergeTests.ts +24 -24
  109. package/src/functions/playerIndex.ts +1 -1
  110. package/src/functions/rng.ts +3 -3
  111. package/src/functions/run.ts +14 -0
  112. package/src/functions/table.ts +25 -23
  113. package/src/functions/tstlClass.ts +1 -1
  114. package/src/functions/types.ts +3 -1
  115. package/src/functions/vector.ts +3 -3
  116. package/src/interfaces/SaveData.ts +1 -1
  117. package/src/interfaces/private/TSTLClassMetatable.ts +1 -1
  118. package/src/types/PlayerIndex.ts +3 -2
  119. package/src/types/private/IsaacAPIClass.ts +1 -1
  120. package/src/types/private/SerializedIsaacAPIClass.ts +1 -1
  121. package/src/types/private/TSTLClass.ts +1 -1
  122. package/dist/features/saveDataManager/serializationBrand.d.ts.map +0 -1
@@ -517,6 +517,7 @@ function ____exports.logTable(luaTable, parentTables)
517
517
  end)(nil)
518
518
  return
519
519
  end
520
+ local numElements = 0
520
521
  iterateTableInOrder(
521
522
  nil,
522
523
  luaTable,
@@ -529,10 +530,11 @@ function ____exports.logTable(luaTable, parentTables)
529
530
  ____exports.logTable(value, parentTables + 1)
530
531
  end
531
532
  end
533
+ numElements = numElements + 1
532
534
  end
533
535
  );
534
536
  (function()
535
- ____exports.log((indentation .. "The size of the table was: ") .. tostring(#luaTable))
537
+ ____exports.log((indentation .. "The size of the table was: ") .. tostring(numElements))
536
538
  end)(nil)
537
539
  end
538
540
  --- Helper function to print out the differences between the entries of two tables. Note that this
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Run the suite of tests that prove that the "merge" helper function works properly. (This function
3
- * is not exported but is used internally in the save data manager.)
2
+ * Run the suite of tests that prove that the "merge" function works properly. (This function is not
3
+ * exported but is used internally in the save data manager.)
4
4
  *
5
5
  * This function is only useful if you are troubleshooting the save data manager.
6
6
  */
@@ -240,8 +240,8 @@ function oldTableHasRNGSerialized(self)
240
240
  error("The old table's seed not match: " .. tostring(seed))
241
241
  end
242
242
  end
243
- --- Run the suite of tests that prove that the "merge" helper function works properly. (This function
244
- -- is not exported but is used internally in the save data manager.)
243
+ --- Run the suite of tests that prove that the "merge" function works properly. (This function is not
244
+ -- exported but is used internally in the save data manager.)
245
245
  --
246
246
  -- This function is only useful if you are troubleshooting the save data manager.
247
247
  function ____exports.runMergeTests(self)
@@ -40,7 +40,7 @@ export declare function getPlayerFromIndex(playerIndex: PlayerIndex): EntityPlay
40
40
  * this is not desired, pass true for the `differentiateForgottenAndSoul` argument, and the RNG of
41
41
  * Spoon Bender (3) will be used for The Soul.
42
42
  *
43
- * Also note that this index doesn't work in the `POST_PLAYER_INIT` function for players 2 through
43
+ * Also note that this index does not work in the `POST_PLAYER_INIT` function for players 2 through
44
44
  * 4. With that said, in almost all cases, you should be lazy-initializing your data structures in
45
45
  * other callbacks, so this should not be an issue.
46
46
  */
@@ -56,7 +56,7 @@ end
56
56
  -- this is not desired, pass true for the `differentiateForgottenAndSoul` argument, and the RNG of
57
57
  -- Spoon Bender (3) will be used for The Soul.
58
58
  --
59
- -- Also note that this index doesn't work in the `POST_PLAYER_INIT` function for players 2 through
59
+ -- Also note that this index does not work in the `POST_PLAYER_INIT` function for players 2 through
60
60
  -- 4. With that said, in almost all cases, you should be lazy-initializing your data structures in
61
61
  -- other callbacks, so this should not be an issue.
62
62
  function ____exports.getPlayerIndex(self, player, differentiateForgottenAndSoul)
@@ -2,7 +2,7 @@
2
2
  /// <reference types="isaac-typescript-definitions" />
3
3
  /// <reference types="isaac-typescript-definitions" />
4
4
  import { SerializationType } from "../enums/SerializationType";
5
- declare type SerializedRNG = LuaTable<string, unknown> & {
5
+ declare type SerializedRNG = LuaMap<string, unknown> & {
6
6
  readonly __serializedRNGBrand: symbol;
7
7
  };
8
8
  interface CopyRNGReturn {
@@ -1 +1 @@
1
- {"version":3,"file":"rng.d.ts","sourceRoot":"","sources":["../../src/functions/rng.ts"],"names":[],"mappings":";;;AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D,aAAK,aAAa,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,G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AE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAoBjE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAK1D;AAED,4FAA4F;AAC5F,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CASlD"}
@@ -13,6 +13,14 @@ export declare function onSetSeed(): boolean;
13
13
  * You can optionally specify a `PlayerType` to restart the game as that character.
14
14
  */
15
15
  export declare function restart(character?: PlayerType): void;
16
+ /**
17
+ * Helper function to restart on the next render frame. Useful because it is impossible to restart
18
+ * the game inside of the `POST_NEW_ROOM`, `POST_NEW_LEVEL`, or `POST_GAME_STARTED` callbacks when a
19
+ * run is first starting.
20
+ *
21
+ * You can optionally specify a `PlayerType` to restart the game as that character.
22
+ */
23
+ export declare function restartNextRenderFrame(character?: PlayerType): void;
16
24
  /**
17
25
  * Helper function to change the run status to that of an unseeded run with a new random seed.
18
26
  *
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAKrE;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAiBpD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAMrE;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAiBpD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAInE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
@@ -6,6 +6,8 @@ local ____cachedClasses = require("cachedClasses")
6
6
  local game = ____cachedClasses.game
7
7
  local ____constantsFirstLast = require("constantsFirstLast")
8
8
  local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
9
+ local ____runInNFrames = require("features.runInNFrames")
10
+ local runNextRenderFrame = ____runInNFrames.runNextRenderFrame
9
11
  local ____log = require("functions.log")
10
12
  local log = ____log.log
11
13
  --- Whether or not the player is playing on a set seed (i.e. that they entered in a specific seed by
@@ -36,6 +38,19 @@ function ____exports.restart(self, character)
36
38
  log((((("Restarting the run as PlayerType." .. tostring(PlayerType[character])) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
37
39
  Isaac.ExecuteCommand(command)
38
40
  end
41
+ --- Helper function to restart on the next render frame. Useful because it is impossible to restart
42
+ -- the game inside of the `POST_NEW_ROOM`, `POST_NEW_LEVEL`, or `POST_GAME_STARTED` callbacks when a
43
+ -- run is first starting.
44
+ --
45
+ -- You can optionally specify a `PlayerType` to restart the game as that character.
46
+ function ____exports.restartNextRenderFrame(self, character)
47
+ runNextRenderFrame(
48
+ nil,
49
+ function()
50
+ ____exports.restart(nil, character)
51
+ end
52
+ )
53
+ end
39
54
  --- Helper function to change the run status to that of an unseeded run with a new random seed.
40
55
  --
41
56
  -- This is useful to revert the behavior where playing on a set and restarting the game will not
@@ -1,32 +1,32 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
2
  /**
3
- * In a Map, you can use the `clear` method to delete every element. However, in a LuaTable, the
3
+ * In a `Map`, you can use the `clear` method to delete every element. However, in a `LuaMap`, the
4
4
  * `clear` method does not exist. Use this helper function as a drop-in replacement for this.
5
5
  */
6
- export declare function clearTable(luaTable: LuaTable): void;
6
+ export declare function clearTable(luaMap: LuaMap): void;
7
7
  /** Helper function to copy specific values from a object to a table. */
8
- export declare function copyValuesToTable(object: unknown, keys: string[], luaTable: LuaTable<string, unknown>): void;
8
+ export declare function copyValuesToTable(object: unknown, keys: string[], luaMap: LuaMap<string, unknown>): void;
9
9
  /**
10
10
  * Helper function to safely get boolean values from a Lua table. Will throw an error if the
11
11
  * specific value does not exist on the table.
12
12
  *
13
13
  * This function is variadic, meaning that you can specify N arguments to get N values.
14
14
  */
15
- export declare function getBooleansFromTable(luaTable: LuaTable<string, unknown>, objectName: string, ...keys: string[]): boolean[];
15
+ export declare function getBooleansFromTable(luaMap: LuaMap<string, unknown>, objectName: string, ...keys: string[]): boolean[];
16
16
  /**
17
17
  * Helper function to safely get number values from a Lua table. Will throw an error if the specific
18
18
  * value does not exist on the table or if it cannot be converted to a number.
19
19
  *
20
20
  * This function is variadic, meaning that you can specify N arguments to get N values.
21
21
  */
22
- export declare function getNumbersFromTable(luaTable: LuaTable<string, unknown>, objectName: string, ...keys: string[]): number[];
22
+ export declare function getNumbersFromTable(luaMap: LuaMap<string, unknown>, objectName: string, ...keys: string[]): number[];
23
23
  /**
24
24
  * Helper function to safely get string values from a Lua table. Will throw an error if the specific
25
25
  * value does not exist on the table.
26
26
  *
27
27
  * This function is variadic, meaning that you can specify N arguments to get N values.
28
28
  */
29
- export declare function getStringsFromTable(luaTable: LuaTable<string, unknown>, objectName: string, ...keys: string[]): string[];
29
+ export declare function getStringsFromTable(luaMap: LuaMap<string, unknown>, objectName: string, ...keys: string[]): string[];
30
30
  /**
31
31
  * Helper function to iterate over a table deterministically. This is useful because by default, the
32
32
  * `pairs` function will return the keys of a Lua table in a random order.
@@ -36,18 +36,18 @@ export declare function getStringsFromTable(luaTable: LuaTable<string, unknown>,
36
36
  * This function will only work on tables that have number keys or string keys. It will throw a
37
37
  * run-time error if it encounters a key of another type.
38
38
  *
39
- * @param luaTable The table to iterate over.
39
+ * @param luaMap The table to iterate over.
40
40
  * @param func The function to run for each iteration.
41
41
  * @param inOrder Optional. Whether to iterate in order. True by default. You can dynamically set to
42
42
  * false in situations where iterating randomly would not matter and you need the
43
43
  * extra performance.
44
44
  */
45
- export declare function iterateTableInOrder<K, V>(luaTable: LuaTable<K, V>, func: (key: K, value: V) => void, inOrder?: boolean): void;
45
+ export declare function iterateTableInOrder<K, V>(luaMap: LuaMap<K, V>, func: (key: K, value: V) => void, inOrder?: boolean): void;
46
46
  /**
47
47
  * Helper function to check if a Lua table has all of the provided keys.
48
48
  *
49
49
  * This function is variadic, meaning that you can specify as many arguments as you want to check
50
50
  * for.
51
51
  */
52
- export declare function tableHasKeys(luaTable: LuaTable<AnyNotNil, unknown>, ...keys: string[]): boolean;
52
+ export declare function tableHasKeys(luaMap: LuaMap<AnyNotNil, unknown>, ...keys: string[]): boolean;
53
53
  //# sourceMappingURL=table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/functions/table.ts"],"names":[],"mappings":";AAEA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAInD;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,UAAU,EAAE,MAAM,EAClB,GAAG,IAAI,EAAE,MAAM,EAAE,GAChB,OAAO,EAAE,CAoBX;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,UAAU,EAAE,MAAM,EAClB,GAAG,IAAI,EAAE,MAAM,EAAE,GAChB,MAAM,EAAE,CA4BV;AAED;;;;;GAKG;AACH,wBAAgB,m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,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,UAAU,EAAE,MAAM,EAClB,GAAG,IAAI,EAAE,MAAM,EAAE,GAChB,MAAM,EAAE,CAmBV;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,EAChC,OAAO,UAAO,GACb,IAAI,CA6BN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EAClC,GAAG,IAAI,EAAE,MAAM,EAAE,GAChB,OAAO,CAET"}
@@ -8,30 +8,30 @@ local ____types = require("functions.types")
8
8
  local isBoolean = ____types.isBoolean
9
9
  local isNumber = ____types.isNumber
10
10
  local isString = ____types.isString
11
- --- In a Map, you can use the `clear` method to delete every element. However, in a LuaTable, the
11
+ --- In a `Map`, you can use the `clear` method to delete every element. However, in a `LuaMap`, the
12
12
  -- `clear` method does not exist. Use this helper function as a drop-in replacement for this.
13
- function ____exports.clearTable(self, luaTable)
14
- for key in pairs(luaTable) do
15
- luaTable[key] = nil
13
+ function ____exports.clearTable(self, luaMap)
14
+ for key in pairs(luaMap) do
15
+ luaMap[key] = nil
16
16
  end
17
17
  end
18
18
  --- Helper function to copy specific values from a object to a table.
19
- function ____exports.copyValuesToTable(self, object, keys, luaTable)
19
+ function ____exports.copyValuesToTable(self, object, keys, luaMap)
20
20
  local otherTable = object
21
21
  for ____, key in ipairs(keys) do
22
22
  local value = otherTable[key]
23
- luaTable[key] = value
23
+ luaMap[key] = value
24
24
  end
25
25
  end
26
26
  --- Helper function to safely get boolean values from a Lua table. Will throw an error if the
27
27
  -- specific value does not exist on the table.
28
28
  --
29
29
  -- This function is variadic, meaning that you can specify N arguments to get N values.
30
- function ____exports.getBooleansFromTable(self, luaTable, objectName, ...)
30
+ function ____exports.getBooleansFromTable(self, luaMap, objectName, ...)
31
31
  local keys = {...}
32
32
  local booleans = {}
33
33
  for ____, key in ipairs(keys) do
34
- local value = luaTable[key]
34
+ local value = luaMap[key]
35
35
  if value == nil then
36
36
  error(((("Failed to find a value for \"" .. key) .. "\" in a table representing a \"") .. objectName) .. "\" object.")
37
37
  end
@@ -47,11 +47,11 @@ end
47
47
  -- value does not exist on the table or if it cannot be converted to a number.
48
48
  --
49
49
  -- This function is variadic, meaning that you can specify N arguments to get N values.
50
- function ____exports.getNumbersFromTable(self, luaTable, objectName, ...)
50
+ function ____exports.getNumbersFromTable(self, luaMap, objectName, ...)
51
51
  local keys = {...}
52
52
  local numbers = {}
53
53
  for ____, key in ipairs(keys) do
54
- local value = luaTable[key]
54
+ local value = luaMap[key]
55
55
  if value == nil then
56
56
  error(((("Failed to find a value for \"" .. key) .. "\" in a table representing a \"") .. objectName) .. "\" object.")
57
57
  end
@@ -73,11 +73,11 @@ end
73
73
  -- value does not exist on the table.
74
74
  --
75
75
  -- This function is variadic, meaning that you can specify N arguments to get N values.
76
- function ____exports.getStringsFromTable(self, luaTable, objectName, ...)
76
+ function ____exports.getStringsFromTable(self, luaMap, objectName, ...)
77
77
  local keys = {...}
78
78
  local strings = {}
79
79
  for ____, key in ipairs(keys) do
80
- local value = luaTable[key]
80
+ local value = luaMap[key]
81
81
  if value == nil then
82
82
  error(((("Failed to find a value for \"" .. key) .. "\" in a table representing a \"") .. objectName) .. "\" object.")
83
83
  end
@@ -98,22 +98,22 @@ end
98
98
  -- This function will only work on tables that have number keys or string keys. It will throw a
99
99
  -- run-time error if it encounters a key of another type.
100
100
  --
101
- -- @param luaTable The table to iterate over.
101
+ -- @param luaMap The table to iterate over.
102
102
  -- @param func The function to run for each iteration.
103
103
  -- @param inOrder Optional. Whether to iterate in order. True by default. You can dynamically set to
104
104
  -- false in situations where iterating randomly would not matter and you need the
105
105
  -- extra performance.
106
- function ____exports.iterateTableInOrder(self, luaTable, func, inOrder)
106
+ function ____exports.iterateTableInOrder(self, luaMap, func, inOrder)
107
107
  if inOrder == nil then
108
108
  inOrder = true
109
109
  end
110
110
  if not inOrder then
111
- for key, value in pairs(luaTable) do
111
+ for key, value in pairs(luaMap) do
112
112
  func(nil, key, value)
113
113
  end
114
114
  return
115
115
  end
116
- local keys = __TS__ObjectKeys(luaTable)
116
+ local keys = __TS__ObjectKeys(luaMap)
117
117
  local hasAllNumberKeys = __TS__ArrayEvery(
118
118
  keys,
119
119
  function(____, key) return isNumber(nil, key) end
@@ -123,7 +123,7 @@ function ____exports.iterateTableInOrder(self, luaTable, func, inOrder)
123
123
  function(____, key) return isString(nil, key) end
124
124
  )
125
125
  if not hasAllNumberKeys and not hasAllStringKeys then
126
- for key, value in pairs(luaTable) do
126
+ for key, value in pairs(luaMap) do
127
127
  func(nil, key, value)
128
128
  end
129
129
  return
@@ -131,19 +131,21 @@ function ____exports.iterateTableInOrder(self, luaTable, func, inOrder)
131
131
  __TS__ArraySort(keys)
132
132
  for ____, key in ipairs(keys) do
133
133
  local keyIndex = key
134
- local value = luaTable[keyIndex]
135
- func(nil, keyIndex, value)
134
+ local value = luaMap[keyIndex]
135
+ if value ~= nil then
136
+ func(nil, keyIndex, value)
137
+ end
136
138
  end
137
139
  end
138
140
  --- Helper function to check if a Lua table has all of the provided keys.
139
141
  --
140
142
  -- This function is variadic, meaning that you can specify as many arguments as you want to check
141
143
  -- for.
142
- function ____exports.tableHasKeys(self, luaTable, ...)
144
+ function ____exports.tableHasKeys(self, luaMap, ...)
143
145
  local keys = {...}
144
146
  return __TS__ArrayEvery(
145
147
  keys,
146
- function(____, key) return luaTable[key] ~= nil end
148
+ function(____, key) return luaMap[key] ~= nil end
147
149
  )
148
150
  end
149
151
  return ____exports
@@ -6,6 +6,6 @@ export declare function isNumber(variable: unknown): variable is number;
6
6
  /** Helper function to detect if a variable is a boolean, number, or string. */
7
7
  export declare function isPrimitive(variable: unknown): variable is boolean | number | string;
8
8
  export declare function isString(variable: unknown): variable is string;
9
- export declare function isTable(variable: unknown): variable is LuaTable;
9
+ export declare function isTable(variable: unknown): variable is LuaMap<AnyNotNil, unknown>;
10
10
  export declare function isUserdata(variable: unknown): variable is LuaUserdata;
11
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/functions/types.ts"],"names":[],"mappings":";;AAAA,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,OAAO,CAEhE;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAElE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,OAAO,GAAG,MAAM,GAAG,MAAM,CAOvC;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAE/D;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAErE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/functions/types.ts"],"names":[],"mappings":";;AAAA,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,OAAO,CAEhE;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAElE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,OAAO,GAAG,MAAM,GAAG,MAAM,CAOvC;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAExC;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAErE"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
2
  import { Direction } from "isaac-typescript-definitions";
3
3
  import { SerializationType } from "../enums/SerializationType";
4
- declare type SerializedVector = LuaTable<string, unknown> & {
4
+ declare type SerializedVector = LuaMap<string, unknown> & {
5
5
  readonly __serializedVectorBrand: symbol;
6
6
  };
7
7
  interface CopyVectorReturn {
@@ -1 +1 @@
1
- {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../src/functions/vector.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAM/D,aAAK,gBAAgB,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAClD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C,CAAC;AAEF,UAAU,gBAAgB;IACxB,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACjC,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAChD,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CACzC;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,CAAC,SAAS,MAAM,GAAG,gBAAgB,EACnC,CAAC,SAAS,iBAAiB,EAC3B,MAA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EACnC,CAAC,SAAS,iBAAiB,EAC3B,MAAM,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACxD,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,gBAAgB,EAC5D,MAAM,EAAE,CAAC,GACR,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AA0D5C;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,gBAAgB,CAM5B;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,CAE1D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAG3D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,MAAM,CAIpE"}
@@ -15,7 +15,7 @@
15
15
  * - `Set`
16
16
  * - serializable Isaac API classes (such as `Color`)
17
17
  * - TSTL classes (i.e. classes that you made yourself)
18
- * - sub-objects or a `LuaTable` that contains the above values
18
+ * - sub-objects or a `LuaMap` that contains the above values
19
19
  *
20
20
  * (Unfortunately, it is not possible to create a recursive type definition that matches these
21
21
  * properties. This means that the TypeScript compiler will not be able to validate that you are
@@ -7,7 +7,7 @@ export interface TSTLClassMetatable {
7
7
  __index: unknown;
8
8
  constructor: {
9
9
  name: string;
10
- prototype: LuaMetatable<LuaTable<AnyNotNil, unknown>>;
10
+ prototype: LuaMetatable<LuaMap<AnyNotNil, unknown>>;
11
11
  };
12
12
  }
13
13
  //# sourceMappingURL=TSTLClassMetatable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TSTLClassMetatable.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/TSTLClassMetatable.ts"],"names":[],"mappings":";;;;AAAA,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;KACvD,CAAC;CACH"}
1
+ {"version":3,"file":"TSTLClassMetatable.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/TSTLClassMetatable.ts"],"names":[],"mappings":";;;;AAAA,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;KACrD,CAAC;CACH"}
@@ -345,7 +345,11 @@ end
345
345
 
346
346
  local function __TS__ArraySlice(self, first, last)
347
347
  local len = #self
348
- first = first or 0
348
+ local ____first_0 = first
349
+ if ____first_0 == nil then
350
+ ____first_0 = 0
351
+ end
352
+ first = ____first_0
349
353
  if first < 0 then
350
354
  first = len + first
351
355
  if first < 0 then
@@ -356,7 +360,11 @@ local function __TS__ArraySlice(self, first, last)
356
360
  first = len
357
361
  end
358
362
  end
359
- last = last or len
363
+ local ____last_1 = last
364
+ if ____last_1 == nil then
365
+ ____last_1 = len
366
+ end
367
+ last = ____last_1
360
368
  if last < 0 then
361
369
  last = len + last
362
370
  if last < 0 then
@@ -412,7 +420,11 @@ local function __TS__ArraySplice(self, ...)
412
420
  elseif actualArgumentCount == 1 then
413
421
  actualDeleteCount = len - start
414
422
  else
415
- actualDeleteCount = deleteCount or 0
423
+ local ____deleteCount_0 = deleteCount
424
+ if ____deleteCount_0 == nil then
425
+ ____deleteCount_0 = 0
426
+ end
427
+ actualDeleteCount = ____deleteCount_0
416
428
  if actualDeleteCount < 0 then
417
429
  actualDeleteCount = 0
418
430
  end
@@ -1175,7 +1187,14 @@ do
1175
1187
  local args = {...}
1176
1188
  local argsLength = select("#", ...)
1177
1189
  return {
1178
- ____coroutine = coroutine.create(function() return fn((unpack or table.unpack)(args, 1, argsLength)) end),
1190
+ ____coroutine = coroutine.create(function()
1191
+ local ____fn_1 = fn
1192
+ local ____unpack_0 = unpack
1193
+ if ____unpack_0 == nil then
1194
+ ____unpack_0 = table.unpack
1195
+ end
1196
+ return ____fn_1(____unpack_0(args, 1, argsLength))
1197
+ end),
1179
1198
  [Symbol.iterator] = generatorIterator,
1180
1199
  next = generatorNext
1181
1200
  }
@@ -1553,7 +1572,11 @@ local function __TS__ParseFloat(numberString)
1553
1572
  return ____temp_0
1554
1573
  end
1555
1574
  local number = tonumber(string.match(numberString, "^%s*(-?%d+%.?%d*)"))
1556
- return number or 0 / 0
1575
+ local ____number_1 = number
1576
+ if ____number_1 == nil then
1577
+ ____number_1 = 0 / 0
1578
+ end
1579
+ return ____number_1
1557
1580
  end
1558
1581
 
1559
1582
  local function __TS__StringSubstr(self, from, length)
@@ -1947,7 +1970,11 @@ local function __TS__SparseArrayPush(sparseArray, ...)
1947
1970
  end
1948
1971
 
1949
1972
  local function __TS__SparseArraySpread(sparseArray)
1950
- local _unpack = unpack or table.unpack
1973
+ local ____unpack_0 = unpack
1974
+ if ____unpack_0 == nil then
1975
+ ____unpack_0 = table.unpack
1976
+ end
1977
+ local _unpack = ____unpack_0
1951
1978
  return _unpack(sparseArray, 1, sparseArray.sparseLength)
1952
1979
  end
1953
1980
 
@@ -2127,7 +2154,11 @@ local function __TS__StringCharCodeAt(self, index)
2127
2154
  if index < 0 then
2128
2155
  return 0 / 0
2129
2156
  end
2130
- return string.byte(self, index + 1) or 0 / 0
2157
+ local ____string_byte_result_0 = string.byte(self, index + 1)
2158
+ if ____string_byte_result_0 == nil then
2159
+ ____string_byte_result_0 = 0 / 0
2160
+ end
2161
+ return ____string_byte_result_0
2131
2162
  end
2132
2163
 
2133
2164
  local function __TS__StringEndsWith(self, searchString, endPosition)
@@ -1,7 +1,8 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /**
3
- * PlayerIndex is a specific type of string; see the documentation for the `getPlayerIndex`
4
- * function. Mods can signify that data structures handle `EntityPlayer` by using this type.
3
+ * PlayerIndex is a specific type of number that represents a unique identifier for a player. Mods
4
+ * can signify that data structures handle `EntityPlayer` by using this type. For more information,
5
+ * see the documentation for the `getPlayerIndex` function.
5
6
  *
6
7
  * For example:
7
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PlayerIndex.d.ts","sourceRoot":"","sources":["../../src/types/PlayerIndex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,oBAAY,WAAW,GAAG,GAAG,GAAG;IAAE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"PlayerIndex.d.ts","sourceRoot":"","sources":["../../src/types/PlayerIndex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,WAAW,GAAG,GAAG,GAAG;IAAE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
- export declare type IsaacAPIClass = LuaTable<string, unknown> & {
2
+ export declare type IsaacAPIClass = LuaMap<string, unknown> & {
3
3
  readonly __isaacAPIClassBrand: symbol;
4
4
  };
5
5
  //# sourceMappingURL=IsaacAPIClass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IsaacAPIClass.d.ts","sourceRoot":"","sources":["../../../src/types/private/IsaacAPIClass.ts"],"names":[],"mappings":";AAAA,oBAAY,aAAa,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC,CAAC"}
1
+ {"version":3,"file":"IsaacAPIClass.d.ts","sourceRoot":"","sources":["../../../src/types/private/IsaacAPIClass.ts"],"names":[],"mappings":";AAAA,oBAAY,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACpD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
- export declare type SerializedIsaacAPIClass = LuaTable<string, unknown> & {
2
+ export declare type SerializedIsaacAPIClass = LuaMap<string, unknown> & {
3
3
  readonly __serializedIsaacAPIClassBrand: symbol;
4
4
  };
5
5
  //# sourceMappingURL=SerializedIsaacAPIClass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SerializedIsaacAPIClass.d.ts","sourceRoot":"","sources":["../../../src/types/private/SerializedIsaacAPIClass.ts"],"names":[],"mappings":";AAAA,oBAAY,uBAAuB,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAChE,QAAQ,CAAC,8BAA8B,EAAE,MAAM,CAAC;CACjD,CAAC"}
1
+ {"version":3,"file":"SerializedIsaacAPIClass.d.ts","sourceRoot":"","sources":["../../../src/types/private/SerializedIsaacAPIClass.ts"],"names":[],"mappings":";AAAA,oBAAY,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC9D,QAAQ,CAAC,8BAA8B,EAAE,MAAM,CAAC;CACjD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
- export declare type TSTLClass = LuaTable<AnyNotNil, unknown> & {
2
+ export declare type TSTLClass = LuaMap<AnyNotNil, unknown> & {
3
3
  readonly __tstlClassBrand: symbol;
4
4
  };
5
5
  //# sourceMappingURL=TSTLClass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TSTLClass.d.ts","sourceRoot":"","sources":["../../../src/types/private/TSTLClass.ts"],"names":[],"mappings":";AAAA,oBAAY,SAAS,GAAG,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG;IACrD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC,CAAC"}
1
+ {"version":3,"file":"TSTLClass.d.ts","sourceRoot":"","sources":["../../../src/types/private/TSTLClass.ts"],"names":[],"mappings":";AAAA,oBAAY,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG;IACnD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "6.8.0",
3
+ "version": "6.10.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "dist/index",
23
23
  "types": "dist/index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^3.0.30"
25
+ "isaac-typescript-definitions": "^3.0.31"
26
26
  }
27
27
  }
@@ -165,10 +165,6 @@ export function removeUrnRewards(
165
165
  return;
166
166
  }
167
167
 
168
- // Spiders
169
- const spiders = getNPCs(EntityType.SPIDER);
170
- removeEntitiesSpawnedFromGridEntity(spiders, gridEntity);
171
-
172
168
  // Coins
173
169
  const coins = getCoins();
174
170
  removeEntitiesSpawnedFromGridEntity(coins, gridEntity);
@@ -180,6 +176,10 @@ export function removeUrnRewards(
180
176
  // Swallowed Penny
181
177
  const swallowedPennies = getTrinkets(TrinketType.SWALLOWED_PENNY);
182
178
  removeEntitiesSpawnedFromGridEntity(swallowedPennies, gridEntity);
179
+
180
+ // Spiders
181
+ const spiders = getNPCs(EntityType.SPIDER);
182
+ removeEntitiesSpawnedFromGridEntity(spiders, gridEntity);
183
183
  }
184
184
 
185
185
  function removeEntitiesSpawnedFromGridEntity(
@@ -19,12 +19,12 @@ import { getRooms } from "../../functions/rooms";
19
19
  import { getGotoCommand, setStage } from "../../functions/stage";
20
20
  import { runNextRoom } from "../runNextRoom";
21
21
  import { getRandomCustomStageRoom } from "./customStageUtils";
22
+ import { topStreakTextStart } from "./streakText";
22
23
  import v, {
23
24
  customBossPNGPaths,
24
25
  customStageCachedRoomData,
25
26
  customStagesMap,
26
27
  } from "./v";
27
- import { playVersusScreenAnimation } from "./versusScreen";
28
28
 
29
29
  const DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2;
30
30
  const DEFAULT_BASE_STAGE_TYPE = StageType.ORIGINAL;
@@ -39,7 +39,7 @@ export function setCustomStage(name: string, verbose = false): void {
39
39
  const customStage = customStagesMap.get(name);
40
40
  if (customStage === undefined) {
41
41
  error(
42
- `Failed to set the custom stage of "${name}" because it was not found in the custom stages map. (This means that you probably forgot to define it in your "tsconfig.json" file.) See the website for more details on how to set up custom stages.`,
42
+ `Failed to set the custom stage of "${name}" because it was not found in the custom stages map. (Try restarting IsaacScript / recompiling the mod, and try again. If that does not work, you probably forgot to define it in your "tsconfig.json" file.) See the website for more details on how to set up custom stages.`,
43
43
  );
44
44
  }
45
45
 
@@ -152,6 +152,8 @@ function postRoomTransition() {
152
152
  // After the room transition, the players will be placed next to a door, but they should be in the
153
153
  // center of the room to emulate what happens on a vanilla stage.
154
154
  movePlayersToCenter();
155
+
156
+ topStreakTextStart();
155
157
  }
156
158
 
157
159
  export function setCustomStageDebug(): void {
@@ -161,7 +163,7 @@ export function setCustomStageDebug(): void {
161
163
  return;
162
164
  }
163
165
 
164
- playVersusScreenAnimation(customStage, true);
166
+ topStreakTextStart();
165
167
  }
166
168
 
167
169
  /**