isaacscript-common 1.2.173 → 1.2.176

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 (79) hide show
  1. package/dist/callbacks/postNewRoomEarly.lua +2 -2
  2. package/dist/classes/null.d.ts +6 -7
  3. package/dist/classes/null.lua +5 -5
  4. package/dist/constants.d.ts +10 -10
  5. package/dist/constants.lua +3 -3
  6. package/dist/features/collectiblesSeen.d.ts +6 -0
  7. package/dist/features/collectiblesSeen.lua +43 -0
  8. package/dist/features/deployJSONRoom.lua +2 -1
  9. package/dist/features/extraConsoleCommands/commands.d.ts +11 -11
  10. package/dist/features/extraConsoleCommands/commands.lua +23 -22
  11. package/dist/features/extraConsoleCommands/init.lua +6 -6
  12. package/dist/features/playerInventory.d.ts +10 -2
  13. package/dist/features/playerInventory.lua +60 -21
  14. package/dist/features/saveDataManager/constants.d.ts +1 -1
  15. package/dist/features/saveDataManager/constants.lua +1 -1
  16. package/dist/features/saveDataManager/exports.d.ts +6 -6
  17. package/dist/features/saveDataManager/exports.lua +4 -4
  18. package/dist/features/saveDataManager/merge.lua +5 -3
  19. package/dist/featuresInitialized.d.ts +1 -1
  20. package/dist/featuresInitialized.lua +3 -3
  21. package/dist/functions/array.d.ts +39 -39
  22. package/dist/functions/array.lua +79 -79
  23. package/dist/functions/cards.d.ts +3 -3
  24. package/dist/functions/cards.lua +7 -7
  25. package/dist/functions/charge.d.ts +11 -11
  26. package/dist/functions/charge.lua +13 -13
  27. package/dist/functions/collectibles.d.ts +53 -15
  28. package/dist/functions/collectibles.lua +44 -21
  29. package/dist/functions/color.d.ts +2 -2
  30. package/dist/functions/color.lua +6 -6
  31. package/dist/functions/deepCopy.d.ts +0 -3
  32. package/dist/functions/deepCopy.lua +5 -22
  33. package/dist/functions/doors.d.ts +8 -8
  34. package/dist/functions/doors.lua +16 -16
  35. package/dist/functions/entity.d.ts +13 -14
  36. package/dist/functions/entity.lua +27 -34
  37. package/dist/functions/gridEntity.d.ts +8 -1
  38. package/dist/functions/gridEntity.lua +7 -11
  39. package/dist/functions/jsonHelpers.d.ts +7 -7
  40. package/dist/functions/jsonHelpers.lua +10 -11
  41. package/dist/functions/log.d.ts +21 -21
  42. package/dist/functions/log.lua +75 -74
  43. package/dist/functions/math.d.ts +1 -1
  44. package/dist/functions/math.lua +3 -3
  45. package/dist/functions/player.d.ts +8 -10
  46. package/dist/functions/player.lua +22 -29
  47. package/dist/functions/playerHealth.d.ts +1 -1
  48. package/dist/functions/playerHealth.lua +20 -20
  49. package/dist/functions/positionVelocity.d.ts +3 -0
  50. package/dist/functions/positionVelocity.lua +19 -5
  51. package/dist/functions/random.d.ts +7 -7
  52. package/dist/functions/revive.d.ts +5 -5
  53. package/dist/functions/revive.lua +8 -8
  54. package/dist/functions/roomData.d.ts +96 -0
  55. package/dist/functions/roomData.lua +57 -0
  56. package/dist/functions/rooms.d.ts +1 -96
  57. package/dist/functions/rooms.lua +30 -75
  58. package/dist/functions/set.d.ts +2 -2
  59. package/dist/functions/set.lua +7 -7
  60. package/dist/functions/trinketCacheFlag.d.ts +4 -4
  61. package/dist/functions/trinketCacheFlag.lua +3 -2
  62. package/dist/functions/trinketGive.d.ts +7 -7
  63. package/dist/functions/trinketGive.lua +27 -27
  64. package/dist/functions/trinkets.d.ts +2 -2
  65. package/dist/functions/trinkets.lua +6 -6
  66. package/dist/functions/ui.d.ts +13 -13
  67. package/dist/functions/ui.lua +28 -28
  68. package/dist/functions/utils.d.ts +6 -0
  69. package/dist/functions/utils.lua +7 -0
  70. package/dist/functions/vector.d.ts +2 -0
  71. package/dist/functions/vector.lua +13 -0
  72. package/dist/index.d.ts +3 -0
  73. package/dist/index.lua +13 -0
  74. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +1 -1
  75. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +1 -1
  76. package/dist/types/CollectibleIndex.d.ts +15 -0
  77. package/dist/types/CollectibleIndex.lua +3 -0
  78. package/dist/upgradeMod.lua +3 -0
  79. package/package.json +2 -2
@@ -112,13 +112,9 @@ function ____exports.getCollidingEntitiesWithGridEntity(self, gridEntity)
112
112
  local gridEntityCollisionTopLeft = Vector(gridEntity.Position.X - DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y - DISTANCE_OF_GRID_TILE / 2)
113
113
  local gridEntityCollisionBottomRight = Vector(gridEntity.Position.X + DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y + DISTANCE_OF_GRID_TILE / 2)
114
114
  local closeEntities = Isaac.FindInRadius(gridEntity.Position, DISTANCE_OF_GRID_TILE * 2)
115
- local closeEntitiesThatCollideWithGrid = __TS__ArrayFilter(
116
- closeEntities,
117
- function(____, entity) return entity:CollidesWithGrid() end
118
- )
119
115
  return __TS__ArrayFilter(
120
- closeEntitiesThatCollideWithGrid,
121
- function(____, entity) return isCircleIntersectingRectangle(
116
+ closeEntities,
117
+ function(____, entity) return entity:CollidesWithGrid() and isCircleIntersectingRectangle(
122
118
  nil,
123
119
  entity.Position,
124
120
  entity.Size + 0.1,
@@ -151,11 +147,6 @@ function ____exports.getGridEntitiesMap(self, ...)
151
147
  end
152
148
  return gridEntityMap
153
149
  end
154
- function ____exports.getTopLeftWall(self)
155
- local room = game:GetRoom()
156
- local topLeftWallGridIndex = ____exports.getTopLeftWallGridIndex(nil)
157
- return room:GetGridEntity(topLeftWallGridIndex)
158
- end
159
150
  function ____exports.getSurroundingGridEntities(self, gridEntity)
160
151
  local room = game:GetRoom()
161
152
  local gridWidth = room:GetGridWidth()
@@ -179,6 +170,11 @@ function ____exports.getSurroundingGridEntities(self, gridEntity)
179
170
  end
180
171
  return surroundingGridEntities
181
172
  end
173
+ function ____exports.getTopLeftWall(self)
174
+ local room = game:GetRoom()
175
+ local topLeftWallGridIndex = ____exports.getTopLeftWallGridIndex(nil)
176
+ return room:GetGridEntity(topLeftWallGridIndex)
177
+ end
182
178
  function ____exports.isAllPressurePlatesPushed(self)
183
179
  local room = game:GetRoom()
184
180
  local hasPressurePlates = room:HasTriggerPressurePlates()
@@ -1,11 +1,4 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
- /**
3
- * Converts a Lua table to a JSON string.
4
- * In most cases, this function will be used for writing data to a "save#.dat" file.
5
- * If encoding fails, it will throw an error to prevent writing a blank string or corrupted data to
6
- * a user's "save#.dat" file.
7
- */
8
- export declare function jsonEncode(table: unknown): string;
9
2
  /**
10
3
  * Converts a JSON string to a Lua table.
11
4
  * In most cases, this function will be used for reading data from a "save#.dat" file.
@@ -14,3 +7,10 @@ export declare function jsonEncode(table: unknown): string;
14
7
  * manually removed their existing save data.)
15
8
  */
16
9
  export declare function jsonDecode(jsonString: string): LuaTable;
10
+ /**
11
+ * Converts a Lua table to a JSON string.
12
+ * In most cases, this function will be used for writing data to a "save#.dat" file.
13
+ * If encoding fails, it will throw an error to prevent writing a blank string or corrupted data to
14
+ * a user's "save#.dat" file.
15
+ */
16
+ export declare function jsonEncode(table: unknown): string;
@@ -1,21 +1,13 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local tryEncode, tryDecode
4
3
  local json = require("@NoResolution:json")
5
4
  local ____log = require("functions.log")
6
5
  local log = ____log.log
7
- function tryEncode(____table)
8
- return json.encode(____table)
9
- end
10
- function tryDecode(jsonString)
6
+ local function tryDecode(jsonString)
11
7
  return json.decode(jsonString)
12
8
  end
13
- function ____exports.jsonEncode(self, ____table)
14
- local ok, jsonStringOrErrMsg = pcall(tryEncode, ____table)
15
- if not ok then
16
- error("Failed to convert the Lua table to JSON: " .. jsonStringOrErrMsg)
17
- end
18
- return jsonStringOrErrMsg
9
+ local function tryEncode(____table)
10
+ return json.encode(____table)
19
11
  end
20
12
  function ____exports.jsonDecode(self, jsonString)
21
13
  local ok, luaTableOrErrMsg = pcall(tryDecode, jsonString)
@@ -25,4 +17,11 @@ function ____exports.jsonDecode(self, jsonString)
25
17
  end
26
18
  return luaTableOrErrMsg
27
19
  end
20
+ function ____exports.jsonEncode(self, ____table)
21
+ local ok, jsonStringOrErrMsg = pcall(tryEncode, ____table)
22
+ if not ok then
23
+ error("Failed to convert the Lua table to JSON: " .. jsonStringOrErrMsg)
24
+ end
25
+ return jsonStringOrErrMsg
26
+ end
28
27
  return ____exports
@@ -10,44 +10,44 @@ export declare function getDebugPrependString(msg: string, numParentFunctions?:
10
10
  * and the line number before the string.
11
11
  */
12
12
  export declare function log(this: void, msg: string): void;
13
+ export declare function logArray<T>(this: void, array: T[]): void;
14
+ export declare function logColor(this: void, color: Color): void;
13
15
  /** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
14
- export declare function logAllDamageFlags(this: void, flags: int): void;
16
+ export declare function logDamageFlags(this: void, flags: int): void;
17
+ export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType | int): void;
18
+ export declare function logEntity(this: void, entity: Entity): void;
15
19
  /** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
16
- export declare function logAllEntityFlags(this: void, flags: int): void;
20
+ export declare function logEntityFlags(this: void, flags: int): void;
17
21
  /** Helper function for printing out every flag that is turned on. Useful when debugging. */
18
- export declare function logAllFlags(this: void, flags: int, flagEnum?: LuaTable, description?: string): void;
22
+ export declare function logFlags(this: void, flags: int, flagEnum?: LuaTable, description?: string): void;
19
23
  /**
20
24
  * Helper function for printing out every game state flag that is turned on. Useful when debugging.
21
25
  */
22
- export declare function logAllGameStateFlags(this: void): void;
26
+ export declare function logGameStateFlags(this: void): void;
27
+ export declare function logGridEntities(this: void, includeWalls: boolean, gridEntityTypeFilter?: GridEntityType | int): void;
28
+ export declare function logKColor(this: void, kColor: KColor): void;
29
+ export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
30
+ export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
23
31
  /**
24
32
  * Helper function for printing out every projectile flag that is turned on. Useful when debugging.
25
33
  */
26
- export declare function logAllProjectileFlags(this: void, flags: int): void;
34
+ export declare function logProjectileFlags(this: void, flags: int): void;
35
+ /** Helper function for logging information about the current room. */
36
+ export declare function logRoom(this: void): void;
27
37
  /**
28
38
  * Helper function for printing out every seed effect (i.e. Easter Egg) that is turned on for the
29
39
  * particular run.
30
40
  */
31
- export declare function logAllSeedEffects(this: void): void;
32
- /** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
33
- export declare function logAllTearFlags(this: void, flags: int): void;
34
- /** Helper function for printing out every use flag that is turned on. Useful when debugging. */
35
- export declare function logAllUseFlags(this: void, _flags: int): void;
36
- export declare function logArray<T>(this: void, array: T[]): void;
37
- export declare function logColor(this: void, color: Color): void;
38
- export declare function logEntity(this: void, entity: Entity): void;
39
- export declare function logEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType | int): void;
40
- export declare function logGridEntities(this: void, includeWalls: boolean, gridEntityTypeFilter?: GridEntityType | int): void;
41
- export declare function logKColor(this: void, kColor: KColor): void;
42
- export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
43
- export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
44
- /** Helper function for logging information about the current room. */
45
- export declare function logRoom(this: void): void;
41
+ export declare function logSeedEffects(this: void): void;
42
+ export declare function logSet(this: void, set: Set<AnyNotNil>): void;
46
43
  /** Helper function for logging every sound effect that is currently playing. */
47
44
  export declare function logSounds(this: void): void;
48
45
  export declare function logTable(this: void, table: unknown, parentTables?: number): void;
46
+ /** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
47
+ export declare function logTearFlags(this: void, flags: int): void;
49
48
  export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
50
- export declare function logSet(this: void, set: Set<AnyNotNil>): void;
49
+ /** Helper function for printing out every use flag that is turned on. Useful when debugging. */
50
+ export declare function logUseFlags(this: void, _flags: int): void;
51
51
  export declare function logVector(this: void, vector: Vector): void;
52
52
  /**
53
53
  * Converts every `isaacscript-common` function that begins with "log" to a global function.
@@ -28,10 +28,10 @@ local getEffectsList = ____player.getEffectsList
28
28
  local getPlayerName = ____player.getPlayerName
29
29
  local ____playerHealth = require("functions.playerHealth")
30
30
  local getPlayerHealth = ____playerHealth.getPlayerHealth
31
- local ____rooms = require("functions.rooms")
32
- local getRoomData = ____rooms.getRoomData
33
- local getRoomGridIndex = ____rooms.getRoomGridIndex
34
- local getRoomListIndex = ____rooms.getRoomListIndex
31
+ local ____roomData = require("functions.roomData")
32
+ local getRoomData = ____roomData.getRoomData
33
+ local getRoomGridIndex = ____roomData.getRoomGridIndex
34
+ local getRoomListIndex = ____roomData.getRoomListIndex
35
35
  local ____set = require("functions.set")
36
36
  local getSortedSetValues = ____set.getSortedSetValues
37
37
  local ____trinkets = require("functions.trinkets")
@@ -55,7 +55,7 @@ function ____exports.log(msg)
55
55
  local debugMsg = ____exports.getDebugPrependString(nil, msg)
56
56
  Isaac.DebugString(debugMsg)
57
57
  end
58
- function ____exports.logAllFlags(flags, flagEnum, description)
58
+ function ____exports.logFlags(flags, flagEnum, description)
59
59
  if description == nil then
60
60
  description = ""
61
61
  end
@@ -72,19 +72,19 @@ function ____exports.logAllFlags(flags, flagEnum, description)
72
72
  end
73
73
  end
74
74
  end
75
- ____exports.log(((("Logging all " .. description) .. "flags for value ") .. tostring(flags)) .. ":")
75
+ ____exports.log(((("Logging " .. description) .. "flags for value ") .. tostring(flags)) .. ":")
76
76
  local hasNoFlags = true
77
77
  for key, value in pairs(flagEnum) do
78
78
  do
79
79
  if type(value) ~= "number" then
80
- goto __continue13
80
+ goto __continue34
81
81
  end
82
82
  if hasFlag(nil, flags, value) then
83
83
  ____exports.log((((" Has flag: " .. tostring(key)) .. " (") .. tostring(value)) .. ")")
84
84
  hasNoFlags = false
85
85
  end
86
86
  end
87
- ::__continue13::
87
+ ::__continue34::
88
88
  end
89
89
  if hasNoFlags then
90
90
  ____exports.log(" n/a (no flags)")
@@ -101,51 +101,6 @@ local IGNORE_EFFECT_VARIANTS = __TS__New(Set, {
101
101
  EffectVariant.LIGHT,
102
102
  EffectVariant.TADPOLE
103
103
  })
104
- function ____exports.logAllDamageFlags(flags)
105
- ____exports.logAllFlags(flags, DamageFlag, "damage")
106
- end
107
- function ____exports.logAllEntityFlags(flags)
108
- ____exports.logAllFlags(flags, EntityFlag, "entity")
109
- end
110
- function ____exports.logAllGameStateFlags()
111
- ____exports.log("Logging all game state flags:")
112
- local hasNoFlags = true
113
- for key, value in pairs(GameStateFlag) do
114
- local gameStateFlag = value
115
- local flagValue = game:GetStateFlag(gameStateFlag)
116
- if flagValue then
117
- ____exports.log((((" Has flag: " .. key) .. " (") .. tostring(value)) .. ")")
118
- hasNoFlags = false
119
- end
120
- end
121
- if hasNoFlags then
122
- ____exports.log(" n/a (no flags)")
123
- end
124
- end
125
- function ____exports.logAllProjectileFlags(flags)
126
- ____exports.logAllFlags(flags, ProjectileFlags, "projectile")
127
- end
128
- function ____exports.logAllSeedEffects()
129
- local seeds = game:GetSeeds()
130
- ____exports.log("Logging all seed effects:")
131
- local hasNoSeedEffects = true
132
- for key, value in pairs(SeedEffect) do
133
- local seedEffect = value
134
- if seeds:HasSeedEffect(seedEffect) then
135
- ____exports.log((((" " .. key) .. " (") .. tostring(value)) .. ")")
136
- hasNoSeedEffects = false
137
- end
138
- end
139
- if hasNoSeedEffects then
140
- ____exports.log(" n/a (no seed effects)")
141
- end
142
- end
143
- function ____exports.logAllTearFlags(flags)
144
- ____exports.logAllFlags(flags, TearFlags, "tear")
145
- end
146
- function ____exports.logAllUseFlags(_flags)
147
- ____exports.log("The \"logAllUseFlags\" helper function is temporarily disabled while the UseFlag enum remains unpatched in vanilla.")
148
- end
149
104
  function ____exports.logArray(array)
150
105
  local arrayString = arrayToString(nil, array)
151
106
  ____exports.log("Array: " .. arrayString)
@@ -153,8 +108,8 @@ end
153
108
  function ____exports.logColor(color)
154
109
  ____exports.log((((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
155
110
  end
156
- function ____exports.logEntity(entity)
157
- ____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
111
+ function ____exports.logDamageFlags(flags)
112
+ ____exports.logFlags(flags, DamageFlag, "damage")
158
113
  end
159
114
  function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
160
115
  local headerMsg = "Entities in the room"
@@ -234,6 +189,27 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
234
189
  ____exports.log(("(" .. tostring(numMatchedEntities)) .. " total entities)")
235
190
  end
236
191
  end
192
+ function ____exports.logEntity(entity)
193
+ ____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
194
+ end
195
+ function ____exports.logEntityFlags(flags)
196
+ ____exports.logFlags(flags, EntityFlag, "entity")
197
+ end
198
+ function ____exports.logGameStateFlags()
199
+ ____exports.log("Logging game state flags:")
200
+ local hasNoFlags = true
201
+ for key, value in pairs(GameStateFlag) do
202
+ local gameStateFlag = value
203
+ local flagValue = game:GetStateFlag(gameStateFlag)
204
+ if flagValue then
205
+ ____exports.log((((" Has flag: " .. key) .. " (") .. tostring(value)) .. ")")
206
+ hasNoFlags = false
207
+ end
208
+ end
209
+ if hasNoFlags then
210
+ ____exports.log(" n/a (no flags)")
211
+ end
212
+ end
237
213
  function ____exports.logGridEntities(includeWalls, gridEntityTypeFilter)
238
214
  local headerMsg = "Grid entities in the room"
239
215
  if gridEntityTypeFilter ~= nil then
@@ -329,6 +305,9 @@ function ____exports.logPlayerHealth(player)
329
305
  ____exports.log(" Blood charges: " .. tostring(playerHealth.bloodCharges))
330
306
  ____exports.log((" Soul heart types: [" .. table.concat(playerHealth.soulHeartTypes, "," or ",")) .. "]")
331
307
  end
308
+ function ____exports.logProjectileFlags(flags)
309
+ ____exports.logFlags(flags, ProjectileFlags, "projectile")
310
+ end
332
311
  function ____exports.logRoom()
333
312
  local roomGridIndex = getRoomGridIndex(nil)
334
313
  local roomListIndex = getRoomListIndex(nil)
@@ -343,6 +322,29 @@ function ____exports.logRoom()
343
322
  ____exports.log("Current room grid index: " .. tostring(roomGridIndex))
344
323
  ____exports.log("Current room list index: " .. tostring(roomListIndex))
345
324
  end
325
+ function ____exports.logSeedEffects()
326
+ local seeds = game:GetSeeds()
327
+ ____exports.log("Logging seed effects:")
328
+ local hasNoSeedEffects = true
329
+ for key, value in pairs(SeedEffect) do
330
+ local seedEffect = value
331
+ if seeds:HasSeedEffect(seedEffect) then
332
+ ____exports.log((((" " .. key) .. " (") .. tostring(value)) .. ")")
333
+ hasNoSeedEffects = false
334
+ end
335
+ end
336
+ if hasNoSeedEffects then
337
+ ____exports.log(" n/a (no seed effects)")
338
+ end
339
+ end
340
+ function ____exports.logSet(set)
341
+ ____exports.log("Printing out a TSTL Set:")
342
+ local setValues = getSortedSetValues(nil, set)
343
+ for ____, value in ipairs(setValues) do
344
+ ____exports.log(" Value: " .. tostring(value))
345
+ end
346
+ ____exports.log("The size of the set was: " .. tostring(set.size))
347
+ end
346
348
  function ____exports.logSounds()
347
349
  for ____, soundEffect in ipairs(range(nil, 0, SoundEffect.NUM_SOUND_EFFECTS - 1)) do
348
350
  if sfxManager:IsPlaying(soundEffect) then
@@ -377,9 +379,12 @@ function ____exports.logTable(____table, parentTables)
377
379
  end
378
380
  ____exports.log("The size of the table was: " .. tostring(numKeys))
379
381
  end
382
+ function ____exports.logTearFlags(flags)
383
+ ____exports.logFlags(flags, TearFlags, "tear")
384
+ end
380
385
  function ____exports.logTemporaryEffects(player)
381
386
  local effects = getEffectsList(nil, player)
382
- ____exports.log("Logging all player temporary effects:")
387
+ ____exports.log("Logging player temporary effects:")
383
388
  if #effects == 0 then
384
389
  ____exports.log(" n/a (no temporary effects)")
385
390
  return
@@ -401,13 +406,8 @@ function ____exports.logTemporaryEffects(player)
401
406
  end
402
407
  )
403
408
  end
404
- function ____exports.logSet(set)
405
- ____exports.log("Printing out a TSTL Set:")
406
- local setValues = getSortedSetValues(nil, set)
407
- for ____, value in ipairs(setValues) do
408
- ____exports.log(" Value: " .. tostring(value))
409
- end
410
- ____exports.log("The size of the set was: " .. tostring(set.size))
409
+ function ____exports.logUseFlags(_flags)
410
+ ____exports.log("The \"logUseFlags\" helper function is temporarily disabled while the UseFlag enum remains unpatched in vanilla.")
411
411
  end
412
412
  function ____exports.logVector(vector)
413
413
  ____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
@@ -415,26 +415,27 @@ end
415
415
  function ____exports.setLogFunctionsGlobal(self)
416
416
  local globals = _G
417
417
  globals.log = ____exports.log
418
- globals.logAllDamageFlags = ____exports.logAllDamageFlags
419
- globals.logAllEntityFlags = ____exports.logAllEntityFlags
420
- globals.logAllFlags = ____exports.logAllFlags
421
- globals.logAllGameStateFlags = ____exports.logAllGameStateFlags
422
- globals.logAllProjectileFlags = ____exports.logAllProjectileFlags
423
- globals.logAllSeedEffects = ____exports.logAllSeedEffects
424
- globals.logAllTearFlags = ____exports.logAllTearFlags
425
- globals.logAllUseFlags = ____exports.logAllUseFlags
426
418
  globals.logArray = ____exports.logArray
427
419
  globals.logColor = ____exports.logColor
428
- globals.logEntity = ____exports.logEntity
420
+ globals.logDamageFlags = ____exports.logDamageFlags
429
421
  globals.logEntities = ____exports.logEntities
422
+ globals.logEntity = ____exports.logEntity
423
+ globals.logEntityFlags = ____exports.logEntityFlags
424
+ globals.logFlags = ____exports.logFlags
425
+ globals.logGameStateFlags = ____exports.logGameStateFlags
430
426
  globals.logGridEntities = ____exports.logGridEntities
431
427
  globals.logKColor = ____exports.logKColor
432
428
  globals.logMap = ____exports.logMap
429
+ globals.logPlayerHealth = ____exports.logPlayerHealth
430
+ globals.logProjectileFlags = ____exports.logProjectileFlags
433
431
  globals.logRoom = ____exports.logRoom
434
- globals.logTable = ____exports.logTable
435
- globals.logTemporaryEffects = ____exports.logTemporaryEffects
432
+ globals.logSeedEffects = ____exports.logSeedEffects
436
433
  globals.logSet = ____exports.logSet
437
434
  globals.logSounds = ____exports.logSounds
435
+ globals.logTable = ____exports.logTable
436
+ globals.logTearFlags = ____exports.logTearFlags
437
+ globals.logTemporaryEffects = ____exports.logTemporaryEffects
438
+ globals.logUseFlags = ____exports.logUseFlags
438
439
  globals.logVector = ____exports.logVector
439
440
  end
440
441
  return ____exports
@@ -36,8 +36,8 @@ export declare function range(start: int, end: int): int[];
36
36
  * @param numDecimalPlaces Default is 0.
37
37
  */
38
38
  export declare function round(num: float, numDecimalPlaces?: number): float;
39
- export declare function tanh(x: number): number;
40
39
  /**
41
40
  * @returns 1 if n is positive, -1 if n is negative, or 0 if n is 0.
42
41
  */
43
42
  export declare function sign(n: number): int;
43
+ export declare function tanh(x: number): number;
@@ -83,9 +83,6 @@ function ____exports.round(self, num, numDecimalPlaces)
83
83
  ))
84
84
  return roundedNum == nil and 0 or roundedNum
85
85
  end
86
- function ____exports.tanh(self, x)
87
- return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
88
- end
89
86
  function ____exports.sign(self, n)
90
87
  if n > 0 then
91
88
  return 1
@@ -95,4 +92,7 @@ function ____exports.sign(self, n)
95
92
  end
96
93
  return 0
97
94
  end
95
+ function ____exports.tanh(self, x)
96
+ return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
97
+ end
98
98
  return ____exports
@@ -3,8 +3,6 @@ import { HealthType } from "../enums/HealthType";
3
3
  import { PlayerIndex } from "../types/PlayerIndex";
4
4
  export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
5
5
  export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
6
- /** Iterates over all players and checks if any player is close enough to the specified position. */
7
- export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
8
6
  export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
9
7
  export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
10
8
  /**
@@ -24,6 +22,11 @@ export declare function anyPlayerIs(...matchingCharacters: Array<PlayerType | in
24
22
  * - the player has Stompy (transformation 13)
25
23
  */
26
24
  export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
25
+ /**
26
+ * Helper function for detecting when a player is one of the characters that can take free Devil
27
+ * Deals. (e.g. The Lost, Tainted Lost, etc.)
28
+ */
29
+ export declare function canTakeFreeDevilDeals(player: EntityPlayer): boolean;
27
30
  /**
28
31
  * Helper function to determine if the provided character can have red heart containers. Returns
29
32
  * true for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper,
@@ -47,8 +50,8 @@ export declare function characterGetsBlackHeartFromEternalHeart(character: Playe
47
50
  * Helper function to get every player with no restrictions, by using `Game.GetNumPlayers` and
48
51
  * `Isaac.GetPlayer`.
49
52
  *
50
- * This function is almost never what you want to use. For most intents and purposes, use the
51
- * `getPlayers` helper function instead to get a filtered list of players.
53
+ * This function is almost never what you want to use. For most purposes, use the `getPlayers`
54
+ * helper function instead to get a filtered list of players.
52
55
  */
53
56
  export declare function getAllPlayers(): EntityPlayer[];
54
57
  /**
@@ -284,16 +287,11 @@ export declare function isJacobOrEsau(player: EntityPlayer): boolean;
284
287
  export declare function isKeeper(player: EntityPlayer): boolean;
285
288
  /** Helper function for detecting when a player is The Lost or Tainted Lost. */
286
289
  export declare function isLost(player: EntityPlayer): boolean;
287
- /**
288
- * Helper function for detecting when a player is one of the characters that can take free Devil
289
- * Deals. (e.g. The Lost, Tainted Lost, etc.)
290
- */
291
- export declare function canTakeFreeDevilDeals(player: EntityPlayer): boolean;
290
+ export declare function isModdedCharacter(player: EntityPlayer): boolean;
292
291
  /** Helper function for detecting if a player is one of the Tainted characters. */
293
292
  export declare function isTainted(player: EntityPlayer): boolean;
294
293
  /** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
295
294
  export declare function isTaintedLazarus(player: EntityPlayer): boolean;
296
- export declare function isModdedCharacter(player: EntityPlayer): boolean;
297
295
  export declare function isVanillaCharacter(player: EntityPlayer): boolean;
298
296
  /**
299
297
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
@@ -96,15 +96,15 @@ end
96
96
  function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
97
97
  local character = player:GetPlayerType()
98
98
  repeat
99
- local ____switch72 = character
100
- local ____cond72 = ____switch72 == PlayerType.PLAYER_THESOUL
101
- if ____cond72 then
99
+ local ____switch71 = character
100
+ local ____cond71 = ____switch71 == PlayerType.PLAYER_THESOUL
101
+ if ____cond71 then
102
102
  do
103
103
  return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
104
104
  end
105
105
  end
106
- ____cond72 = ____cond72 or ____switch72 == PlayerType.PLAYER_LAZARUS2_B
107
- if ____cond72 then
106
+ ____cond71 = ____cond71 or ____switch71 == PlayerType.PLAYER_LAZARUS2_B
107
+ if ____cond71 then
108
108
  do
109
109
  return CollectibleType.COLLECTIBLE_INNER_EYE
110
110
  end
@@ -172,16 +172,16 @@ function ____exports.isKeeper(self, player)
172
172
  local character = player:GetPlayerType()
173
173
  return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
174
174
  end
175
+ function ____exports.isModdedCharacter(self, player)
176
+ local character = player:GetPlayerType()
177
+ return character > MAX_VANILLA_CHARACTER
178
+ end
175
179
  function isTaintedModded(self, player)
176
180
  local character = player:GetPlayerType()
177
181
  local name = player:GetName()
178
182
  local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
179
183
  return character == taintedCharacter
180
184
  end
181
- function ____exports.isModdedCharacter(self, player)
182
- local character = player:GetPlayerType()
183
- return character > MAX_VANILLA_CHARACTER
184
- end
185
185
  function ____exports.isVanillaCharacter(self, player)
186
186
  return not ____exports.isModdedCharacter(nil, player)
187
187
  end
@@ -201,13 +201,6 @@ function ____exports.addTrinketCostume(self, player, trinketType)
201
201
  end
202
202
  player:AddCostume(itemConfigTrinket, false)
203
203
  end
204
- function ____exports.anyPlayerCloserThan(self, position, distance)
205
- local players = ____exports.getPlayers(nil)
206
- return __TS__ArraySome(
207
- players,
208
- function(____, player) return player.Position:Distance(position) <= distance end
209
- )
210
- end
211
204
  function ____exports.anyPlayerHasCollectible(self, collectibleType)
212
205
  local players = ____exports.getPlayers(nil)
213
206
  return __TS__ArraySome(
@@ -235,6 +228,10 @@ function ____exports.canPlayerCrushRocks(self, player)
235
228
  local effects = player:GetEffects()
236
229
  return player:HasCollectible(CollectibleType.COLLECTIBLE_LEO) or player:HasCollectible(CollectibleType.COLLECTIBLE_THUNDER_THIGHS) or effects:HasCollectibleEffect(CollectibleType.COLLECTIBLE_MEGA_MUSH) or player:HasPlayerForm(PlayerForm.PLAYERFORM_STOMPY)
237
230
  end
231
+ function ____exports.canTakeFreeDevilDeals(self, player)
232
+ local character = player:GetPlayerType()
233
+ return CHARACTERS_WITH_FREE_DEVIL_DEALS:has(character)
234
+ end
238
235
  function ____exports.characterCanHaveRedHearts(self, character)
239
236
  return not CHARACTERS_WITH_NO_RED_HEARTS:has(character)
240
237
  end
@@ -515,10 +512,6 @@ function ____exports.isLost(self, player)
515
512
  local character = player:GetPlayerType()
516
513
  return character == PlayerType.PLAYER_THELOST or character == PlayerType.PLAYER_THELOST_B
517
514
  end
518
- function ____exports.canTakeFreeDevilDeals(self, player)
519
- local character = player:GetPlayerType()
520
- return CHARACTERS_WITH_FREE_DEVIL_DEALS:has(character)
521
- end
522
515
  function ____exports.isTainted(self, player)
523
516
  local character = player:GetPlayerType()
524
517
  local ____isVanillaCharacter_result_0
@@ -571,9 +564,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
571
564
  itemPool:RemoveCollectible(collectibleType)
572
565
  end
573
566
  repeat
574
- local ____switch126 = activeSlot
575
- local ____cond126 = ____switch126 == ActiveSlot.SLOT_PRIMARY
576
- if ____cond126 then
567
+ local ____switch124 = activeSlot
568
+ local ____cond124 = ____switch124 == ActiveSlot.SLOT_PRIMARY
569
+ if ____cond124 then
577
570
  do
578
571
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
579
572
  player:RemoveCollectible(primaryCollectibleType)
@@ -582,8 +575,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
582
575
  break
583
576
  end
584
577
  end
585
- ____cond126 = ____cond126 or ____switch126 == ActiveSlot.SLOT_SECONDARY
586
- if ____cond126 then
578
+ ____cond124 = ____cond124 or ____switch124 == ActiveSlot.SLOT_SECONDARY
579
+ if ____cond124 then
587
580
  do
588
581
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
589
582
  player:RemoveCollectible(primaryCollectibleType)
@@ -598,16 +591,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
598
591
  break
599
592
  end
600
593
  end
601
- ____cond126 = ____cond126 or ____switch126 == ActiveSlot.SLOT_POCKET
602
- if ____cond126 then
594
+ ____cond124 = ____cond124 or ____switch124 == ActiveSlot.SLOT_POCKET
595
+ if ____cond124 then
603
596
  do
604
597
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
605
598
  player:SetActiveCharge(charge, activeSlot)
606
599
  break
607
600
  end
608
601
  end
609
- ____cond126 = ____cond126 or ____switch126 == ActiveSlot.SLOT_POCKET2
610
- if ____cond126 then
602
+ ____cond124 = ____cond124 or ____switch124 == ActiveSlot.SLOT_POCKET2
603
+ if ____cond124 then
611
604
  do
612
605
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
613
606
  break
@@ -11,6 +11,7 @@ export declare function addPlayerHealthType(player: EntityPlayer, healthType: He
11
11
  */
12
12
  export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth;
13
13
  export declare function getPlayerHealthType(player: EntityPlayer, healthType: HealthType): int;
14
+ export declare function removeAllPlayerHealth(player: EntityPlayer): void;
14
15
  /**
15
16
  * Helper function to set a player's health to a specific state. You can use this in combination
16
17
  * with the `getPlayerHealth` function to restore the player's health back to a certain
@@ -19,4 +20,3 @@ export declare function getPlayerHealthType(player: EntityPlayer, healthType: He
19
20
  * Based on the `REVEL.LoadHealth` function in the Revelations mod.
20
21
  */
21
22
  export declare function setPlayerHealth(player: EntityPlayer, playerHealth: PlayerHealth): void;
22
- export declare function removeAllPlayerHealth(player: EntityPlayer): void;