isaacscript-common 20.12.2 → 20.13.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 (67) hide show
  1. package/dist/index.d.ts +79 -40
  2. package/dist/isaacscript-common.lua +315 -419
  3. package/dist/src/classes/ModFeature.lua +0 -4
  4. package/dist/src/classes/ModUpgradedBase.lua +3 -9
  5. package/dist/src/classes/callbacks/PostNewRoomEarly.lua +2 -2
  6. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +2 -5
  7. package/dist/src/classes/features/other/CustomStages.lua +4 -16
  8. package/dist/src/classes/features/other/CustomTrapdoors.lua +1 -4
  9. package/dist/src/classes/features/other/DeployJSONRoom.lua +8 -14
  10. package/dist/src/classes/features/other/Pause.lua +2 -2
  11. package/dist/src/classes/features/other/TaintedLazarusPlayers.lua +1 -1
  12. package/dist/src/classes/features/other/customStages/utils.lua +4 -16
  13. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +4 -4
  14. package/dist/src/classes/features/other/extraConsoleCommands/subroutines.lua +2 -2
  15. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.lua +4 -7
  16. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +2 -2
  17. package/dist/src/classes/features/other/saveDataManager/saveToDisk.lua +1 -1
  18. package/dist/src/enums/MysteriousPaperEffect.d.ts +13 -0
  19. package/dist/src/enums/MysteriousPaperEffect.d.ts.map +1 -0
  20. package/dist/src/enums/MysteriousPaperEffect.lua +15 -0
  21. package/dist/src/functions/benchmark.lua +2 -8
  22. package/dist/src/functions/debugFunctions.d.ts +2 -2
  23. package/dist/src/functions/debugFunctions.d.ts.map +1 -1
  24. package/dist/src/functions/debugFunctions.lua +4 -4
  25. package/dist/src/functions/deepCopy.lua +7 -7
  26. package/dist/src/functions/deepCopyTests.lua +1 -1
  27. package/dist/src/functions/globals.lua +3 -6
  28. package/dist/src/functions/hex.lua +4 -7
  29. package/dist/src/functions/jsonHelpers.lua +1 -1
  30. package/dist/src/functions/jsonRoom.lua +4 -16
  31. package/dist/src/functions/log.d.ts +8 -4
  32. package/dist/src/functions/log.d.ts.map +1 -1
  33. package/dist/src/functions/log.lua +18 -5
  34. package/dist/src/functions/logEntities.d.ts +8 -8
  35. package/dist/src/functions/logEntities.d.ts.map +1 -1
  36. package/dist/src/functions/logEntities.lua +24 -27
  37. package/dist/src/functions/logMisc.d.ts +26 -26
  38. package/dist/src/functions/logMisc.d.ts.map +1 -1
  39. package/dist/src/functions/logMisc.lua +114 -226
  40. package/dist/src/functions/merge.lua +6 -6
  41. package/dist/src/functions/revive.d.ts.map +1 -1
  42. package/dist/src/functions/revive.lua +10 -3
  43. package/dist/src/functions/run.lua +2 -5
  44. package/dist/src/functions/trinkets.d.ts +22 -0
  45. package/dist/src/functions/trinkets.d.ts.map +1 -1
  46. package/dist/src/functions/trinkets.lua +32 -0
  47. package/dist/src/functions/utils.d.ts.map +1 -1
  48. package/dist/src/functions/utils.lua +20 -1
  49. package/dist/src/index.d.ts +1 -0
  50. package/dist/src/index.d.ts.map +1 -1
  51. package/dist/src/index.lua +8 -0
  52. package/dist/src/lib/jsonLua.lua +16 -7
  53. package/dist/src/patchErrorFunctions.lua +1 -1
  54. package/package.json +1 -1
  55. package/src/classes/ModFeature.ts +0 -6
  56. package/src/classes/features/other/saveDataManager/saveToDisk.ts +3 -4
  57. package/src/enums/MysteriousPaperEffect.ts +12 -0
  58. package/src/functions/debugFunctions.ts +2 -2
  59. package/src/functions/deepCopy.ts +2 -0
  60. package/src/functions/log.ts +15 -4
  61. package/src/functions/logEntities.ts +14 -8
  62. package/src/functions/logMisc.ts +56 -39
  63. package/src/functions/revive.ts +12 -4
  64. package/src/functions/trinkets.ts +39 -0
  65. package/src/functions/utils.ts +30 -0
  66. package/src/index.ts +1 -0
  67. package/src/lib/jsonLua.lua +16 -7
@@ -152,17 +152,11 @@ function ____exports.getRandomJSONEntity(self, jsonEntities, seedOrRNG, verbose)
152
152
  end
153
153
  local totalWeight = getTotalWeightOfJSONObject(nil, jsonEntities)
154
154
  if verbose then
155
- log(
156
- nil,
157
- "Total weight of the JSON entities provided: " .. tostring(totalWeight)
158
- )
155
+ log("Total weight of the JSON entities provided: " .. tostring(totalWeight))
159
156
  end
160
157
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
161
158
  if verbose then
162
- log(
163
- nil,
164
- "Randomly chose weight for JSON entity: " .. tostring(chosenWeight)
165
- )
159
+ log("Randomly chose weight for JSON entity: " .. tostring(chosenWeight))
166
160
  end
167
161
  local randomJSONEntity = getJSONObjectWithChosenWeight(nil, jsonEntities, chosenWeight)
168
162
  if randomJSONEntity == nil then
@@ -192,17 +186,11 @@ function ____exports.getRandomJSONRoom(self, jsonRooms, seedOrRNG, verbose)
192
186
  end
193
187
  local totalWeight = getTotalWeightOfJSONObject(nil, jsonRooms)
194
188
  if verbose then
195
- log(
196
- nil,
197
- "Total weight of the JSON rooms provided: " .. tostring(totalWeight)
198
- )
189
+ log("Total weight of the JSON rooms provided: " .. tostring(totalWeight))
199
190
  end
200
191
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
201
192
  if verbose then
202
- log(
203
- nil,
204
- "Randomly chose weight for JSON room: " .. tostring(chosenWeight)
205
- )
193
+ log("Randomly chose weight for JSON room: " .. tostring(chosenWeight))
206
194
  end
207
195
  local randomJSONRoom = getJSONObjectWithChosenWeight(nil, jsonRooms, chosenWeight)
208
196
  if randomJSONRoom == nil then
@@ -8,12 +8,12 @@
8
8
  * (because the first level is this function, the second level is the calling
9
9
  * function, and the third level is the parent of the calling function).
10
10
  */
11
- export declare function getParentFunctionDescription(levels?: number): string | undefined;
11
+ export declare function getParentFunctionDescription(this: void, levels?: number): string | undefined;
12
12
  /**
13
13
  * Helper function to avoid typing out `Isaac.DebugString()`.
14
14
  *
15
- * If you have the "--luadebug" launch flag turned on or the Racing+ sandbox enabled, then this
16
- * function will also prepend the function name and the line number before the string, like this:
15
+ * If you have the "--luadebug" launch flag turned on, then this function will also prepend the
16
+ * function name and the line number before the string, like this:
17
17
  *
18
18
  * ```text
19
19
  * [INFO] - Lua Debug: saveToDisk:42494 - The save data manager wrote data to the "save#.dat" file.
@@ -21,6 +21,10 @@ export declare function getParentFunctionDescription(levels?: number): string |
21
21
  *
22
22
  * Subsequently, it is recommended that you turn on the "--luadebug" launch flag when developing
23
23
  * your mod so that debugging becomes a little bit easier.
24
+ *
25
+ * @param msg The message to log.
26
+ * @param includeParentFunction Optional. Whether to prefix the message with the function name and
27
+ * line number, as shown in the above example. Default is true.
24
28
  */
25
- export declare function log(msg: string): void;
29
+ export declare function log(this: void, msg: string, includeParentFunction?: boolean): void;
26
30
  //# sourceMappingURL=log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/functions/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAK1C,MAAM,SAAI,GACT,MAAM,GAAG,SAAS,CAiBpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAOrC"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/functions/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,EAKV,MAAM,SAAI,GACT,MAAM,GAAG,SAAS,CAiBpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,GAAG,CACjB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,qBAAqB,UAAO,GAC3B,IAAI,CASN"}
@@ -7,7 +7,7 @@ local ____exports = {}
7
7
  -- @param levels Optional. The amount of levels to look backwards in the call stack. Default is 3
8
8
  -- (because the first level is this function, the second level is the calling
9
9
  -- function, and the third level is the parent of the calling function).
10
- function ____exports.getParentFunctionDescription(self, levels)
10
+ function ____exports.getParentFunctionDescription(levels)
11
11
  if levels == nil then
12
12
  levels = 3
13
13
  end
@@ -24,8 +24,8 @@ function ____exports.getParentFunctionDescription(self, levels)
24
24
  end
25
25
  --- Helper function to avoid typing out `Isaac.DebugString()`.
26
26
  --
27
- -- If you have the "--luadebug" launch flag turned on or the Racing+ sandbox enabled, then this
28
- -- function will also prepend the function name and the line number before the string, like this:
27
+ -- If you have the "--luadebug" launch flag turned on, then this function will also prepend the
28
+ -- function name and the line number before the string, like this:
29
29
  --
30
30
  -- ```text
31
31
  -- [INFO] - Lua Debug: saveToDisk:42494 - The save data manager wrote data to the "save#.dat" file.
@@ -33,8 +33,21 @@ end
33
33
  --
34
34
  -- Subsequently, it is recommended that you turn on the "--luadebug" launch flag when developing
35
35
  -- your mod so that debugging becomes a little bit easier.
36
- function ____exports.log(self, msg)
37
- local parentFunctionDescription = ____exports.getParentFunctionDescription(nil)
36
+ --
37
+ -- @param msg The message to log.
38
+ -- @param includeParentFunction Optional. Whether to prefix the message with the function name and
39
+ -- line number, as shown in the above example. Default is true.
40
+ function ____exports.log(msg, includeParentFunction)
41
+ if includeParentFunction == nil then
42
+ includeParentFunction = true
43
+ end
44
+ local ____includeParentFunction_0
45
+ if includeParentFunction then
46
+ ____includeParentFunction_0 = ____exports.getParentFunctionDescription()
47
+ else
48
+ ____includeParentFunction_0 = nil
49
+ end
50
+ local parentFunctionDescription = ____includeParentFunction_0
38
51
  local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
39
52
  Isaac.DebugString(debugMsg)
40
53
  end
@@ -1,6 +1,6 @@
1
1
  import { EntityType, GridEntityType } from "isaac-typescript-definitions";
2
2
  /** Helper function for printing out every entity (or filtered entity) in the current room. */
3
- export declare function logAllEntities(includeBackgroundEffects: boolean, entityTypeFilter?: EntityType): void;
3
+ export declare function logAllEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType): void;
4
4
  /**
5
5
  * Helper function for printing out every grid entity (or filtered grid entity) in the current room.
6
6
  *
@@ -8,23 +8,23 @@ export declare function logAllEntities(includeBackgroundEffects: boolean, entity
8
8
  * @param gridEntityTypeFilter Optional. If specified, will only log the given `GridEntityType`.
9
9
  * Default is undefined.
10
10
  */
11
- export declare function logAllGridEntities(includeWalls?: boolean, gridEntityTypeFilter?: GridEntityType): void;
11
+ export declare function logAllGridEntities(this: void, includeWalls?: boolean, gridEntityTypeFilter?: GridEntityType): void;
12
12
  /** Helper function for logging an array of specific entities. */
13
- export declare function logEntities(entities: Entity[]): void;
13
+ export declare function logEntities(this: void, entities: Entity[]): void;
14
14
  /** Helper function to log information about a specific entity. */
15
- export declare function logEntity(entity: Entity): void;
15
+ export declare function logEntity(this: void, entity: Entity): void;
16
16
  /** Helper function for logging an array of specific grid entities. */
17
- export declare function logGridEntities(gridEntities: GridEntity[]): void;
17
+ export declare function logGridEntities(this: void, gridEntities: GridEntity[]): void;
18
18
  /** Helper function for log information about a specific grid entity. */
19
- export declare function logGridEntity(gridEntity: GridEntity): void;
19
+ export declare function logGridEntity(this: void, gridEntity: GridEntity): void;
20
20
  /**
21
21
  * Helper function to log information about the entity that corresponding to a pointer hash. (Only
22
22
  * use this when debugging, since retrieving the corresponding entity is expensive.)
23
23
  */
24
- export declare function logPtrHash(ptrHash: PtrHash): void;
24
+ export declare function logPtrHash(this: void, ptrHash: PtrHash): void;
25
25
  /**
26
26
  * Helper function to log information about the entity that corresponding to one or more pointer
27
27
  * hashes. (Only use this when debugging, since retrieving the corresponding entity is expensive.)
28
28
  */
29
- export declare function logPtrHashes(ptrHashes: PtrHash[]): void;
29
+ export declare function logPtrHashes(this: void, ptrHashes: PtrHash[]): void;
30
30
  //# sourceMappingURL=logEntities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/logEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,cAAc,EAOf,MAAM,8BAA8B,CAAC;AAiBtC,8FAA8F;AA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AAClE,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAG1D;AAmFD,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI,CAI5E;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAGtE;AA+DD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAQ7D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAInE"}
@@ -27,11 +27,11 @@ local getGridEntityID = ____gridEntities.getGridEntityID
27
27
  local ____log = require("src.functions.log")
28
28
  local log = ____log.log
29
29
  --- Helper function to log information about a specific entity.
30
- function ____exports.logEntity(self, entity)
31
- local msg = getEntityLogLine(nil, entity)
32
- log(nil, msg)
30
+ function ____exports.logEntity(entity)
31
+ local msg = getEntityLogLine(entity)
32
+ log(msg)
33
33
  end
34
- function getEntityLogLine(self, entity, num)
34
+ function getEntityLogLine(entity, num)
35
35
  local msg = num == nil and "" or tostring(num) .. ") "
36
36
  msg = msg .. getEntityID(nil, entity)
37
37
  local bomb = entity:ToBomb()
@@ -91,11 +91,11 @@ function getEntityLogLine(self, entity, num)
91
91
  return msg
92
92
  end
93
93
  --- Helper function for log information about a specific grid entity.
94
- function ____exports.logGridEntity(self, gridEntity)
95
- local msg = getGridEntityLogLine(nil, gridEntity)
96
- log(nil, msg)
94
+ function ____exports.logGridEntity(gridEntity)
95
+ local msg = getGridEntityLogLine(gridEntity)
96
+ log(msg)
97
97
  end
98
- function getGridEntityLogLine(self, gridEntity, num)
98
+ function getGridEntityLogLine(gridEntity, num)
99
99
  local gridEntityDesc = gridEntity:GetSaveState()
100
100
  local msg = num == nil and "" or tostring(num) .. ") "
101
101
  msg = msg .. getGridEntityID(nil, gridEntity)
@@ -152,7 +152,7 @@ local IGNORE_EFFECT_VARIANTS = __TS__New(Set, {
152
152
  EffectVariant.TADPOLE
153
153
  })
154
154
  --- Helper function for printing out every entity (or filtered entity) in the current room.
155
- function ____exports.logAllEntities(self, includeBackgroundEffects, entityTypeFilter)
155
+ function ____exports.logAllEntities(includeBackgroundEffects, entityTypeFilter)
156
156
  local msg = "Entities in the room"
157
157
  if entityTypeFilter ~= nil then
158
158
  msg = msg .. (" (filtered to entity type " .. tostring(entityTypeFilter)) .. ")"
@@ -172,7 +172,7 @@ function ____exports.logAllEntities(self, includeBackgroundEffects, entityTypeFi
172
172
  if not includeBackgroundEffects and effect ~= nil and IGNORE_EFFECT_VARIANTS:has(effect.Variant) then
173
173
  return
174
174
  end
175
- msg = msg .. getEntityLogLine(nil, entity, i + 1)
175
+ msg = msg .. getEntityLogLine(entity, i + 1)
176
176
  numMatchedEntities = numMatchedEntities + 1
177
177
  end
178
178
  )
@@ -185,7 +185,7 @@ function ____exports.logAllEntities(self, includeBackgroundEffects, entityTypeFi
185
185
  __TS__StringTrim(msg),
186
186
  "\n"
187
187
  )) do
188
- log(nil, line)
188
+ log(line)
189
189
  end
190
190
  end
191
191
  --- Helper function for printing out every grid entity (or filtered grid entity) in the current room.
@@ -193,7 +193,7 @@ end
193
193
  -- @param includeWalls Optional. Whether or not to log the walls. Default is false.
194
194
  -- @param gridEntityTypeFilter Optional. If specified, will only log the given `GridEntityType`.
195
195
  -- Default is undefined.
196
- function ____exports.logAllGridEntities(self, includeWalls, gridEntityTypeFilter)
196
+ function ____exports.logAllGridEntities(includeWalls, gridEntityTypeFilter)
197
197
  if includeWalls == nil then
198
198
  includeWalls = false
199
199
  end
@@ -217,7 +217,7 @@ function ____exports.logAllGridEntities(self, includeWalls, gridEntityTypeFilter
217
217
  if not includeWalls and gridEntityType == GridEntityType.WALL and gridEntityTypeFilter ~= GridEntityType.WALL then
218
218
  return
219
219
  end
220
- msg = msg .. getGridEntityLogLine(nil, gridEntity, gridEntityIndex)
220
+ msg = msg .. getGridEntityLogLine(gridEntity, gridEntityIndex)
221
221
  numMatchedEntities = numMatchedEntities + 1
222
222
  end
223
223
  )
@@ -230,40 +230,37 @@ function ____exports.logAllGridEntities(self, includeWalls, gridEntityTypeFilter
230
230
  __TS__StringTrim(msg),
231
231
  "\n"
232
232
  )) do
233
- log(nil, line)
233
+ log(line)
234
234
  end
235
235
  end
236
236
  --- Helper function for logging an array of specific entities.
237
- function ____exports.logEntities(self, entities)
237
+ function ____exports.logEntities(entities)
238
238
  for ____, entity in ipairs(entities) do
239
- ____exports.logEntity(nil, entity)
239
+ ____exports.logEntity(entity)
240
240
  end
241
241
  end
242
242
  --- Helper function for logging an array of specific grid entities.
243
- function ____exports.logGridEntities(self, gridEntities)
243
+ function ____exports.logGridEntities(gridEntities)
244
244
  for ____, gridEntity in ipairs(gridEntities) do
245
- ____exports.logGridEntity(nil, gridEntity)
245
+ ____exports.logGridEntity(gridEntity)
246
246
  end
247
247
  end
248
248
  --- Helper function to log information about the entity that corresponding to a pointer hash. (Only
249
249
  -- use this when debugging, since retrieving the corresponding entity is expensive.)
250
- function ____exports.logPtrHash(self, ptrHash)
251
- log(
252
- nil,
253
- "PtrHash: " .. tostring(ptrHash)
254
- )
250
+ function ____exports.logPtrHash(ptrHash)
251
+ log("PtrHash: " .. tostring(ptrHash))
255
252
  local entity = getEntityFromPtrHash(nil, ptrHash)
256
253
  if entity == nil then
257
- log(nil, "No corresponding entity found.")
254
+ log("No corresponding entity found.")
258
255
  else
259
- ____exports.logEntity(nil, entity)
256
+ ____exports.logEntity(entity)
260
257
  end
261
258
  end
262
259
  --- Helper function to log information about the entity that corresponding to one or more pointer
263
260
  -- hashes. (Only use this when debugging, since retrieving the corresponding entity is expensive.)
264
- function ____exports.logPtrHashes(self, ptrHashes)
261
+ function ____exports.logPtrHashes(ptrHashes)
265
262
  for ____, ptrHash in ipairs(ptrHashes) do
266
- ____exports.logPtrHash(nil, ptrHash)
263
+ ____exports.logPtrHash(ptrHash)
267
264
  end
268
265
  end
269
266
  return ____exports
@@ -1,49 +1,49 @@
1
1
  /// <reference types="@typescript-to-lua/language-extensions" />
2
2
  import { CollectibleType, DamageFlag, EntityFlag, ProjectileFlag, TearFlag, UseFlag } from "isaac-typescript-definitions";
3
3
  /** Helper function to enumerate all of the values in an array. */
4
- export declare function logArray<T>(array: T[] | readonly T[]): void;
5
- export declare function logCollectibleTypes(collectibleTypes: CollectibleType[]): void;
6
- export declare function logColor(color: Color): void;
4
+ export declare function logArray<T>(this: void, array: T[] | readonly T[]): void;
5
+ export declare function logCollectibleTypes(this: void, collectibleTypes: CollectibleType[]): void;
6
+ export declare function logColor(this: void, color: Color): void;
7
7
  /** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
8
- export declare function logDamageFlags(flags: DamageFlag | BitFlags<DamageFlag>): void;
8
+ export declare function logDamageFlags(this: void, flags: DamageFlag | BitFlags<DamageFlag>): void;
9
9
  /** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
10
- export declare function logEntityFlags(flags: EntityFlag | BitFlags<EntityFlag>): void;
11
- export declare function logEntityID(entity: Entity): void;
10
+ export declare function logEntityFlags(this: void, flags: EntityFlag | BitFlags<EntityFlag>): void;
11
+ export declare function logEntityID(this: void, entity: Entity): void;
12
12
  /**
13
13
  * Helper function to log an error message and also print it to the console for better visibility.
14
14
  *
15
15
  * This is useful in situations where using the `error` function would be dangerous (since it
16
16
  * prevents all of the subsequent code in the callback from running).
17
17
  */
18
- export declare function logError(msg: string): void;
18
+ export declare function logError(this: void, msg: string): void;
19
19
  /** Helper function for printing out every flag that is turned on. Useful when debugging. */
20
- export declare function logFlags<T extends BitFlag | BitFlag128>(flags: T | BitFlags<T>, flagEnum: Record<string, T>, description?: string): void;
20
+ export declare function logFlags<T extends BitFlag | BitFlag128>(this: void, flags: T | BitFlags<T>, flagEnum: Record<string, T>, description?: string): void;
21
21
  /**
22
22
  * Helper function for printing out every game state flag that is turned on. Useful when debugging.
23
23
  */
24
- export declare function logGameStateFlags(): void;
25
- export declare function logKColor(kColor: KColor): void;
24
+ export declare function logGameStateFlags(this: void): void;
25
+ export declare function logKColor(this: void, kColor: KColor): void;
26
26
  /**
27
27
  * Helper function for printing out every level state flag that is turned on. Useful when debugging.
28
28
  */
29
- export declare function logLevelStateFlags(): void;
30
- export declare function logMap(map: Map<AnyNotNil, unknown>): void;
31
- export declare function logPlayerEffects(player: EntityPlayer): void;
32
- export declare function logPlayerHealth(player: EntityPlayer): void;
29
+ export declare function logLevelStateFlags(this: void): void;
30
+ export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
31
+ export declare function logPlayerEffects(this: void, player: EntityPlayer): void;
32
+ export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
33
33
  /**
34
34
  * Helper function for printing out every projectile flag that is turned on. Useful when debugging.
35
35
  */
36
- export declare function logProjectileFlags(flags: ProjectileFlag | BitFlags<ProjectileFlag>): void;
36
+ export declare function logProjectileFlags(this: void, flags: ProjectileFlag | BitFlags<ProjectileFlag>): void;
37
37
  /** Helper function for logging information about the current room. */
38
- export declare function logRoom(): void;
38
+ export declare function logRoom(this: void): void;
39
39
  /**
40
40
  * Helper function for printing out every seed effect (i.e. Easter Egg) that is turned on for the
41
41
  * particular run.
42
42
  */
43
- export declare function logSeedEffects(): void;
44
- export declare function logSet(set: Set<AnyNotNil> | ReadonlySet<AnyNotNil>): void;
43
+ export declare function logSeedEffects(this: void): void;
44
+ export declare function logSet(this: void, set: Set<AnyNotNil> | ReadonlySet<AnyNotNil>): void;
45
45
  /** Helper function for logging every sound effect that is currently playing. */
46
- export declare function logSounds(): void;
46
+ export declare function logSounds(this: void): void;
47
47
  /**
48
48
  * Helper function for logging every key and value of a Lua table. This is a deep log; the function
49
49
  * will recursively call itself if it encounters a table within a table.
@@ -54,27 +54,27 @@ export declare function logSounds(): void;
54
54
  * In order to prevent infinite recursion, this function will not log a sub-table when there are 10
55
55
  * or more parent tables.
56
56
  */
57
- export declare function logTable(luaTable: unknown, parentTables?: number): void;
57
+ export declare function logTable(this: void, luaTable: unknown, parentTables?: number): void;
58
58
  /**
59
59
  * Helper function to print out the differences between the entries of two tables. Note that this
60
60
  * will only do a shallow comparison.
61
61
  */
62
- export declare function logTableDifferences<K extends AnyNotNil, V>(table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
62
+ export declare function logTableDifferences<K extends AnyNotNil, V>(this: void, table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
63
63
  /**
64
64
  * Helper function to log the keys of a Lua table. This is not a deep log; only the keys of the
65
65
  * top-most table will be logged.
66
66
  *
67
67
  * This function is useful for tables that have recursive references.
68
68
  */
69
- export declare function logTableKeys(luaTable: unknown): void;
69
+ export declare function logTableKeys(this: void, luaTable: unknown): void;
70
70
  /** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
71
- export declare function logTearFlags(flags: TearFlag | BitFlags<TearFlag>): void;
71
+ export declare function logTearFlags(this: void, flags: TearFlag | BitFlags<TearFlag>): void;
72
72
  /** Helper function for printing out every use flag that is turned on. Useful when debugging. */
73
- export declare function logUseFlags(flags: UseFlag | BitFlags<UseFlag>): void;
73
+ export declare function logUseFlags(this: void, flags: UseFlag | BitFlags<UseFlag>): void;
74
74
  /**
75
75
  * Helper function to enumerate all of the properties of a "userdata" object (i.e. an object from
76
76
  * the Isaac API).
77
77
  */
78
- export declare function logUserdata(userdata: unknown): void;
79
- export declare function logVector(vector: Vector, round?: boolean): void;
78
+ export declare function logUserdata(this: void, userdata: unknown): void;
79
+ export declare function logVector(this: void, vector: Vector, round?: boolean): void;
80
80
  //# sourceMappingURL=logMisc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,EAKV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