isaacscript-common 6.9.0 → 6.10.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 (118) 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 +27 -27
  42. package/dist/functions/deepCopyTests.lua +3 -3
  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/table.d.ts +9 -9
  61. package/dist/functions/table.d.ts.map +1 -1
  62. package/dist/functions/table.lua +23 -21
  63. package/dist/functions/types.d.ts +1 -1
  64. package/dist/functions/types.d.ts.map +1 -1
  65. package/dist/functions/vector.d.ts +1 -1
  66. package/dist/functions/vector.d.ts.map +1 -1
  67. package/dist/interfaces/SaveData.d.ts +1 -1
  68. package/dist/interfaces/private/TSTLClassMetatable.d.ts +1 -1
  69. package/dist/interfaces/private/TSTLClassMetatable.d.ts.map +1 -1
  70. package/dist/lualib_bundle.lua +38 -7
  71. package/dist/types/PlayerIndex.d.ts +3 -2
  72. package/dist/types/PlayerIndex.d.ts.map +1 -1
  73. package/dist/types/private/IsaacAPIClass.d.ts +1 -1
  74. package/dist/types/private/IsaacAPIClass.d.ts.map +1 -1
  75. package/dist/types/private/SerializedIsaacAPIClass.d.ts +1 -1
  76. package/dist/types/private/SerializedIsaacAPIClass.d.ts.map +1 -1
  77. package/dist/types/private/TSTLClass.d.ts +1 -1
  78. package/dist/types/private/TSTLClass.d.ts.map +1 -1
  79. package/package.json +2 -2
  80. package/src/features/customStage/customStageGridEntities.ts +4 -4
  81. package/src/features/customStage/exports.ts +5 -3
  82. package/src/features/customStage/init.ts +19 -7
  83. package/src/features/customStage/streakText.ts +284 -19
  84. package/src/features/customStage/v.ts +6 -1
  85. package/src/features/customStage/versusScreen.ts +2 -5
  86. package/src/features/extraConsoleCommands/init.ts +1 -0
  87. package/src/features/extraConsoleCommands/listCommands.ts +14 -0
  88. package/src/features/saveDataManager/exports.ts +3 -8
  89. package/src/features/saveDataManager/load.ts +2 -3
  90. package/src/features/saveDataManager/main.ts +4 -5
  91. package/src/features/saveDataManager/maps.ts +3 -3
  92. package/src/features/saveDataManager/merge.ts +11 -11
  93. package/src/features/saveDataManager/save.ts +6 -6
  94. package/src/features/saveDataManager/{serializationBrand.ts → serializationBrands.ts} +0 -0
  95. package/src/functions/array.ts +2 -4
  96. package/src/functions/color.ts +3 -3
  97. package/src/functions/deepCopy.ts +39 -36
  98. package/src/functions/deepCopyTests.ts +11 -11
  99. package/src/functions/entities.ts +7 -7
  100. package/src/functions/input.ts +7 -8
  101. package/src/functions/isaacAPIClass.ts +3 -3
  102. package/src/functions/jsonHelpers.ts +3 -3
  103. package/src/functions/kColor.ts +3 -3
  104. package/src/functions/log.ts +5 -4
  105. package/src/functions/mergeTests.ts +24 -24
  106. package/src/functions/playerIndex.ts +1 -1
  107. package/src/functions/rng.ts +3 -3
  108. package/src/functions/table.ts +25 -23
  109. package/src/functions/tstlClass.ts +1 -1
  110. package/src/functions/types.ts +3 -1
  111. package/src/functions/vector.ts +3 -3
  112. package/src/interfaces/SaveData.ts +1 -1
  113. package/src/interfaces/private/TSTLClassMetatable.ts +1 -1
  114. package/src/types/PlayerIndex.ts +3 -2
  115. package/src/types/private/IsaacAPIClass.ts +1 -1
  116. package/src/types/private/SerializedIsaacAPIClass.ts +1 -1
  117. package/src/types/private/TSTLClass.ts +1 -1
  118. package/dist/features/saveDataManager/serializationBrand.d.ts.map +0 -1
@@ -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,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"}
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,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAChD,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,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.9.0",
3
+ "version": "6.10.0",
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
  /**
@@ -24,7 +24,11 @@ import {
24
24
  } from "./customStageGridEntities";
25
25
  import * as metadataJSON from "./metadata.json"; // This will correspond to "metadata.lua" at run-time.
26
26
  import { setShadows } from "./shadows";
27
- import { streakTextGetShaderParams, streakTextPostRender } from "./streakText";
27
+ import {
28
+ streakTextGetShaderParams,
29
+ streakTextPostGameStarted,
30
+ streakTextPostRender,
31
+ } from "./streakText";
28
32
  import v, { customStagesMap } from "./v";
29
33
  import {
30
34
  playVersusScreenAnimation,
@@ -36,20 +40,17 @@ export function customStageInit(mod: ModUpgraded): void {
36
40
  initRoomTypeMaps();
37
41
 
38
42
  mod.AddCallback(ModCallback.POST_RENDER, postRender); // 2
39
-
43
+ mod.AddCallback(ModCallback.POST_GAME_STARTED, postGameStarted); // 15
40
44
  mod.AddCallback(ModCallback.GET_SHADER_PARAMS, getShaderParams); // 21
41
-
42
45
  mod.AddCallbackCustom(
43
46
  ModCallbackCustom.POST_GRID_ENTITY_BROKEN,
44
47
  postGridEntityBrokenRockAlt,
45
48
  GridEntityType.ROCK_ALT,
46
49
  );
47
-
48
50
  mod.AddCallbackCustom(
49
51
  ModCallbackCustom.POST_GRID_ENTITY_INIT,
50
52
  postGridEntityBrokenInit,
51
53
  );
52
-
53
54
  mod.AddCallbackCustom(
54
55
  ModCallbackCustom.POST_NEW_ROOM_REORDERED,
55
56
  postNewRoomReordered,
@@ -123,15 +124,26 @@ function postRender() {
123
124
  return;
124
125
  }
125
126
 
126
- streakTextPostRender(customStage);
127
+ streakTextPostRender();
127
128
  versusScreenPostRender();
128
129
  }
129
130
 
131
+ // ModCallback.POST_GAME_STARTED (15)
132
+ function postGameStarted() {
133
+ // We don't early return here because we need to unconditionally reset the sprites.
134
+ streakTextPostGameStarted();
135
+ }
136
+
130
137
  // ModCallback.GET_SHADER_PARAMS (22)
131
138
  function getShaderParams(
132
139
  shaderName: string,
133
140
  ): Record<string, unknown> | undefined {
134
- streakTextGetShaderParams(shaderName);
141
+ const customStage = v.run.currentCustomStage;
142
+ if (customStage === null) {
143
+ return;
144
+ }
145
+
146
+ streakTextGetShaderParams(customStage, shaderName);
135
147
  return undefined;
136
148
  }
137
149