isaacscript-common 6.19.0 → 6.20.2

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 (51) hide show
  1. package/dist/constants.d.ts +5 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.lua +4 -0
  4. package/dist/features/customStage/exports.d.ts +6 -1
  5. package/dist/features/customStage/exports.d.ts.map +1 -1
  6. package/dist/features/customStage/exports.lua +14 -11
  7. package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -1
  8. package/dist/features/customTrapdoor/blackSprite.lua +1 -0
  9. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  10. package/dist/features/customTrapdoor/init.lua +10 -2
  11. package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts.map +1 -1
  12. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +2 -1
  13. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  14. package/dist/features/extraConsoleCommands/listCommands.lua +2 -1
  15. package/dist/functions/curses.d.ts +3 -0
  16. package/dist/functions/curses.d.ts.map +1 -0
  17. package/dist/functions/curses.lua +11 -0
  18. package/dist/functions/dimensions.d.ts +12 -0
  19. package/dist/functions/dimensions.d.ts.map +1 -0
  20. package/dist/functions/dimensions.lua +35 -0
  21. package/dist/functions/level.d.ts.map +1 -1
  22. package/dist/functions/level.lua +8 -7
  23. package/dist/functions/levelGrid.d.ts +155 -0
  24. package/dist/functions/levelGrid.d.ts.map +1 -0
  25. package/dist/functions/levelGrid.lua +349 -0
  26. package/dist/functions/roomData.d.ts +6 -1
  27. package/dist/functions/roomData.d.ts.map +1 -1
  28. package/dist/functions/roomData.lua +6 -0
  29. package/dist/functions/roomGrid.d.ts +8 -0
  30. package/dist/functions/roomGrid.d.ts.map +1 -1
  31. package/dist/functions/rooms.d.ts +67 -68
  32. package/dist/functions/rooms.d.ts.map +1 -1
  33. package/dist/functions/rooms.lua +176 -203
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.lua +24 -0
  37. package/package.json +2 -2
  38. package/src/constants.ts +8 -0
  39. package/src/features/customStage/exports.ts +25 -14
  40. package/src/features/customTrapdoor/blackSprite.ts +1 -0
  41. package/src/features/customTrapdoor/init.ts +7 -3
  42. package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -1
  43. package/src/features/extraConsoleCommands/listCommands.ts +2 -1
  44. package/src/functions/curses.ts +9 -0
  45. package/src/functions/dimensions.ts +41 -0
  46. package/src/functions/level.ts +7 -10
  47. package/src/functions/levelGrid.ts +468 -0
  48. package/src/functions/roomData.ts +13 -1
  49. package/src/functions/roomGrid.ts +9 -0
  50. package/src/functions/rooms.ts +161 -219
  51. package/src/index.ts +3 -0
@@ -1,11 +1,14 @@
1
1
  local ____lualib = require("lualib_bundle")
2
- local __TS__ArrayMap = ____lualib.__TS__ArrayMap
3
- local Set = ____lualib.Set
2
+ local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
3
+ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
4
+ local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
5
+ local Map = ____lualib.Map
4
6
  local __TS__New = ____lualib.__TS__New
5
- local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
6
7
  local __TS__Spread = ____lualib.__TS__Spread
7
- local Map = ____lualib.Map
8
+ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
9
+ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
8
10
  local __TS__StringIncludes = ____lualib.__TS__StringIncludes
11
+ local Set = ____lualib.Set
9
12
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
10
13
  local ____exports = {}
11
14
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
@@ -16,6 +19,7 @@ local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
16
19
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
17
20
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
18
21
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
22
+ local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
19
23
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
20
24
  local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
21
25
  local RoomTransitionAnim = ____isaac_2Dtypescript_2Ddefinitions.RoomTransitionAnim
@@ -26,15 +30,16 @@ local ____cachedClasses = require("cachedClasses")
26
30
  local game = ____cachedClasses.game
27
31
  local sfxManager = ____cachedClasses.sfxManager
28
32
  local ____constants = require("constants")
29
- local LEVEL_GRID_ROW_WIDTH = ____constants.LEVEL_GRID_ROW_WIDTH
30
33
  local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
31
34
  local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
32
- local ____roomShapeToDoorSlotsToGridIndexDelta = require("objects.roomShapeToDoorSlotsToGridIndexDelta")
33
- local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToDoorSlotsToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
34
35
  local ____roomTypeNames = require("objects.roomTypeNames")
35
36
  local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
36
37
  local ____mineShaftRoomSubTypesSet = require("sets.mineShaftRoomSubTypesSet")
37
38
  local MINE_SHAFT_ROOM_SUB_TYPE_SET = ____mineShaftRoomSubTypesSet.MINE_SHAFT_ROOM_SUB_TYPE_SET
39
+ local ____curses = require("functions.curses")
40
+ local hasCurse = ____curses.hasCurse
41
+ local ____dimensions = require("functions.dimensions")
42
+ local inDimension = ____dimensions.inDimension
38
43
  local ____doors = require("functions.doors")
39
44
  local closeAllDoors = ____doors.closeAllDoors
40
45
  local getDoors = ____doors.getDoors
@@ -50,62 +55,123 @@ local getEntityVelocities = ____positionVelocity.getEntityVelocities
50
55
  local setEntityPositions = ____positionVelocity.setEntityPositions
51
56
  local setEntityVelocities = ____positionVelocity.setEntityVelocities
52
57
  local ____roomData = require("functions.roomData")
53
- local getRoomAllowedDoors = ____roomData.getRoomAllowedDoors
54
58
  local getRoomData = ____roomData.getRoomData
55
59
  local getRoomDescriptor = ____roomData.getRoomDescriptor
56
60
  local getRoomDescriptorReadOnly = ____roomData.getRoomDescriptorReadOnly
57
61
  local getRoomGridIndex = ____roomData.getRoomGridIndex
58
62
  local getRoomName = ____roomData.getRoomName
59
- local getRoomShape = ____roomData.getRoomShape
60
63
  local getRoomStageID = ____roomData.getRoomStageID
61
64
  local getRoomSubType = ____roomData.getRoomSubType
62
- local ____roomShape = require("functions.roomShape")
63
- local getGridIndexDelta = ____roomShape.getGridIndexDelta
65
+ local ____stage = require("functions.stage")
66
+ local getGotoCommand = ____stage.getGotoCommand
64
67
  local ____utils = require("functions.utils")
65
68
  local erange = ____utils.erange
66
69
  local irange = ____utils.irange
67
- function ____exports.getRoomShapeNeighborGridIndexDeltas(self, roomShape)
68
- return {__TS__Spread(ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]:values())}
70
+ --- Helper function to get a read-only copy of the room descriptor for every room on the level. This
71
+ -- includes off-grid rooms, such as the Devil Room, and extra-dimensional rooms, if they are
72
+ -- generated and exist.
73
+ --
74
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
75
+ --
76
+ -- Under the hood, this is performed by iterating over the `RoomList` from the `Level.GetRooms`
77
+ -- method. This is the best way to see if off-grid rooms have been initialized, since it is possible
78
+ -- for mods to insert room data at non-official negative room grid indexes.
79
+ function ____exports.getReadOnlyRooms(self)
80
+ local level = game:GetLevel()
81
+ local roomList = level:GetRooms()
82
+ local readOnlyRoomDescriptors = {}
83
+ do
84
+ local i = 0
85
+ while i < roomList.Size do
86
+ local readOnlyRoomDescriptor = roomList:Get(i)
87
+ if readOnlyRoomDescriptor ~= nil and readOnlyRoomDescriptor.Data ~= nil then
88
+ readOnlyRoomDescriptors[#readOnlyRoomDescriptors + 1] = readOnlyRoomDescriptor
89
+ end
90
+ i = i + 1
91
+ end
92
+ end
93
+ return readOnlyRoomDescriptors
69
94
  end
70
- --- Helper function to get the room descriptor for every room on the level, including off-grid rooms.
71
- -- Uses the `Level.GetRooms` method to accomplish this. Rooms without data are assumed to be
72
- -- non-existent and are not added to the list.
95
+ --- Helper function to get the room descriptor for every room on the level that is on the grid. (For
96
+ -- example, Devil Rooms are excluded.)
97
+ --
98
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
73
99
  --
74
100
  -- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
75
- -- extra-dimensional rooms are automatically generated and can be
76
- -- seen when you iterate over the `RoomList`. Default is false.
77
- function ____exports.getRooms(self, includeExtraDimensionalRooms)
101
+ -- extra-dimensional rooms are automatically be generated. Default
102
+ -- is false.
103
+ function ____exports.getRoomsInGrid(self, includeExtraDimensionalRooms)
78
104
  if includeExtraDimensionalRooms == nil then
79
105
  includeExtraDimensionalRooms = false
80
106
  end
81
107
  local level = game:GetLevel()
82
- local roomList = level:GetRooms()
83
- local roomsMap = __TS__New(Map)
84
- if includeExtraDimensionalRooms then
85
- do
86
- local i = 0
87
- while i < roomList.Size do
88
- local roomDescriptor = roomList:Get(i)
89
- if roomDescriptor ~= nil and roomDescriptor.Data ~= nil then
90
- roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
91
- end
92
- i = i + 1
93
- end
94
- end
95
- else
108
+ local dimensions = includeExtraDimensionalRooms and erange(nil, NUM_DIMENSIONS) or ({Dimension.CURRENT})
109
+ --- We use a map instead of an array because room shapes occupy more than one room grid index.
110
+ local roomDescriptorMap = __TS__New(Map)
111
+ for ____, dimension in ipairs(dimensions) do
96
112
  for ____, roomGridIndex in ipairs(irange(nil, MAX_LEVEL_GRID_INDEX)) do
97
- local roomDescriptor = level:GetRoomByIdx(roomGridIndex)
113
+ local roomDescriptor = level:GetRoomByIdx(roomGridIndex, dimension)
98
114
  if roomDescriptor.Data ~= nil then
99
- roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
115
+ local ptrHash = GetPtrHash(roomDescriptor)
116
+ roomDescriptorMap:set(ptrHash, roomDescriptor)
100
117
  end
101
118
  end
102
119
  end
103
- return {__TS__Spread(roomsMap:values())}
120
+ return {__TS__Spread(roomDescriptorMap:values())}
121
+ end
122
+ --- Helper function to get the room descriptor for every room on the level that is outside of the
123
+ -- grid (like a Devil Room).
124
+ --
125
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
126
+ function ____exports.getRoomsOutsideGrid(self)
127
+ local readOnlyRooms = ____exports.getReadOnlyRooms(nil)
128
+ local readOnlyRoomsOffGrid = __TS__ArrayFilter(
129
+ readOnlyRooms,
130
+ function(____, readOnlyRoomDescriptor) return readOnlyRoomDescriptor.SafeGridIndex < 0 end
131
+ )
132
+ return __TS__ArrayMap(
133
+ readOnlyRoomsOffGrid,
134
+ function(____, readOnlyRoomDescriptor) return getRoomDescriptor(nil, readOnlyRoomDescriptor.SafeGridIndex) end
135
+ )
104
136
  end
105
- --- Helper function to check if a room exists at the given room grid index.
106
- function ____exports.roomExists(self, roomGridIndex)
137
+ --- Helper function to change the current room. It can be used for both teleportation and "normal"
138
+ -- room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
139
+ -- arguments.
140
+ --
141
+ -- Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
142
+ -- - you do not forget to set `Level.LeaveDoor` property
143
+ -- - to prevent crashing on invalid room grid indexes
144
+ -- - to automatically handle Curse of the Maze
145
+ --
146
+ -- @param roomGridIndex The room grid index of the destination room.
147
+ -- @param direction Optional. Default is `Direction.NO_DIRECTION`.
148
+ -- @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
149
+ -- @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
150
+ -- to false, then this function may not go to the provided room grid index.
151
+ function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim, force)
152
+ if direction == nil then
153
+ direction = Direction.NO_DIRECTION
154
+ end
155
+ if roomTransitionAnim == nil then
156
+ roomTransitionAnim = RoomTransitionAnim.TELEPORT
157
+ end
158
+ if force == nil then
159
+ force = false
160
+ end
161
+ local level = game:GetLevel()
162
+ local shouldTempDisableCurse = force and hasCurse(nil, LevelCurse.MAZE)
163
+ if shouldTempDisableCurse then
164
+ level:RemoveCurses(LevelCurse.MAZE)
165
+ end
107
166
  local roomData = getRoomData(nil, roomGridIndex)
108
- return roomData ~= nil
167
+ if roomData == nil then
168
+ error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
169
+ end
170
+ level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
171
+ game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
172
+ if shouldTempDisableCurse then
173
+ level:AddCurse(LevelCurse.MAZE, false)
174
+ end
109
175
  end
110
176
  --- Helper function for quickly switching to a new room without playing a particular animation. Use
111
177
  -- this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -119,58 +185,49 @@ function ____exports.changeRoom(self, roomGridIndex)
119
185
  level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
120
186
  game:ChangeRoom(roomGridIndex)
121
187
  end
122
- --- Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
123
- function ____exports.getAllDimensions(self)
124
- return erange(nil, NUM_DIMENSIONS)
125
- end
126
- --- Helper function to get the grid index for every room on the entire floor.
127
- function ____exports.getAllRoomGridIndexes(self)
128
- local rooms = ____exports.getRooms(nil)
129
- return __TS__ArrayMap(
130
- rooms,
131
- function(____, roomDescriptor) return roomDescriptor.SafeGridIndex end
132
- )
133
- end
134
- --- Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
135
- -- but it can change if e.g. the player is in the mirror world of Downpour/Dross.
136
- function ____exports.getDimension(self)
137
- local level = game:GetLevel()
138
- local roomGridIndex = getRoomGridIndex(nil)
139
- local roomDescription = level:GetRoomByIdx(roomGridIndex, Dimension.CURRENT)
140
- local currentRoomHash = GetPtrHash(roomDescription)
141
- for ____, dimension in ipairs(____exports.getAllDimensions(nil)) do
142
- local dimensionRoomDescription = level:GetRoomByIdx(roomGridIndex, dimension)
143
- local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
144
- if dimensionRoomHash == currentRoomHash then
145
- return dimension
146
- end
147
- end
148
- error("Failed to get the current dimension.")
149
- end
150
188
  --- Helper function to get the number of rooms that are currently on the floor layout. This does not
151
189
  -- include off-grid rooms, like the Devil Room.
152
190
  function ____exports.getNumRooms(self)
153
- local rooms = ____exports.getRooms(nil)
191
+ local rooms = ____exports.getRoomsInGrid(nil)
154
192
  return #rooms
155
193
  end
156
- --- Helper function to get an array of all of the safe grid indexes for rooms that match the
157
- -- specified room type.
194
+ --- Helper function to get the room data for a specific room type and variant combination. This is
195
+ -- accomplished by using the "goto" console command to load the specified room into the
196
+ -- `GridRoom.DEBUG` slot.
158
197
  --
159
- -- This function only searches through rooms in the current dimension.
198
+ -- Returns undefined if the provided room type and variant combination were not found. (A warning
199
+ -- message will also appear on the console, since the "goto" command will fail.)
160
200
  --
161
- -- This function is variadic, meaning that you can specify N arguments to get the combined grid
162
- -- indexes for N room types.
163
- function ____exports.getRoomGridIndexesForType(self, ...)
164
- local roomTypesSet = __TS__New(Set, {...})
165
- local rooms = ____exports.getRooms(nil)
166
- local matchingRooms = __TS__ArrayFilter(
167
- rooms,
168
- function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypesSet:has(roomDescriptor.Data.Type) end
169
- )
170
- return __TS__ArrayMap(
171
- matchingRooms,
172
- function(____, roomDescriptor) return roomDescriptor.SafeGridIndex end
173
- )
201
+ -- Note that the side effect of using the "goto" console command is that it will trigger a room
202
+ -- transition after a short delay. By default, this function cancels the incoming room transition by
203
+ -- using the `Game.StartRoomTransition` method to travel to the same room.
204
+ --
205
+ -- @param roomType The type of room to retrieve.
206
+ -- @param roomVariant The room variant to retrieve. (The room variant is the "ID" of the room in
207
+ -- Basement Renovator.)
208
+ -- @param cancelRoomTransition Optional. Whether to cancel the room transition by using the
209
+ -- `Game.StartRoomTransition` method to travel to the same room. Default
210
+ -- is true. Set this to false if you are getting the data for many rooms
211
+ -- at the same time, and then use the `teleport` helper function when
212
+ -- you are finished.
213
+ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, cancelRoomTransition)
214
+ if cancelRoomTransition == nil then
215
+ cancelRoomTransition = true
216
+ end
217
+ local command = getGotoCommand(nil, roomType, roomVariant)
218
+ Isaac.ExecuteCommand(command)
219
+ local newRoomData = getRoomData(nil, GridRoom.DEBUG)
220
+ if cancelRoomTransition then
221
+ local roomGridIndex = getRoomGridIndex(nil)
222
+ ____exports.teleport(
223
+ nil,
224
+ roomGridIndex,
225
+ Direction.NO_DIRECTION,
226
+ RoomTransitionAnim.FADE,
227
+ true
228
+ )
229
+ end
230
+ return newRoomData
174
231
  end
175
232
  --- Helper function to get the item pool type for the current room. For example, this returns
176
233
  -- `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
@@ -181,64 +238,49 @@ function ____exports.getRoomItemPoolType(self)
181
238
  local roomSeed = room:GetSpawnSeed()
182
239
  return itemPool:GetPoolForRoom(roomType, roomSeed)
183
240
  end
184
- --- Helper function to get the grid indexes of all the rooms connected to the given room index.
185
- --
186
- -- @param roomGridIndex Optional. Default is the current room index.
187
- function ____exports.getRoomNeighbors(self, roomGridIndex)
188
- local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
189
- if roomDescriptor.SafeGridIndex < 0 or roomDescriptor.SafeGridIndex > MAX_LEVEL_GRID_INDEX then
190
- return {}
191
- end
192
- local roomData = roomDescriptor.Data
193
- if roomData == nil then
194
- return {}
195
- end
196
- local roomShape = roomData.Shape
197
- local gridIndexDeltas = ____exports.getRoomShapeNeighborGridIndexDeltas(nil, roomShape)
198
- local gridIndexes = __TS__ArrayMap(
199
- gridIndexDeltas,
200
- function(____, gridIndexDelta) return roomDescriptor.SafeGridIndex + gridIndexDelta end
201
- )
202
- return __TS__ArrayFilter(
203
- gridIndexes,
204
- function(____, gridIndex) return ____exports.roomExists(nil, gridIndex) end
205
- )
206
- end
207
241
  --- Helper function to get the proper name of a room type.
208
242
  --
209
243
  -- For example, `RoomType.TREASURE` will return "Treasure Room".
210
244
  function ____exports.getRoomTypeName(self, roomType)
211
245
  return ROOM_TYPE_NAMES[roomType]
212
246
  end
213
- --- Helper function to get the room descriptor for every room on the level except for rooms that are
214
- -- not on the grid. Uses the `Level.GetRooms` method to accomplish this. Rooms without data are
215
- -- assumed to be non-existent and are not added to the list.
247
+ --- Helper function to get the room descriptor for every room on the level. This includes off-grid
248
+ -- rooms, such as the Devil Room.
249
+ --
250
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
251
+ --
252
+ -- - If you want just the rooms inside of the grid, use the `getRoomsInGrid` helper function.
253
+ -- - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
216
254
  --
217
255
  -- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
218
- -- extra-dimensional rooms are automatically be generated and can be
219
- -- seen when you iterate over the `RoomList`. Default is false.
220
- function ____exports.getRoomsInGrid(self, includeExtraDimensionalRooms)
256
+ -- extra-dimensional rooms are automatically generated. Default is
257
+ -- false.
258
+ function ____exports.getRooms(self, includeExtraDimensionalRooms)
221
259
  if includeExtraDimensionalRooms == nil then
222
260
  includeExtraDimensionalRooms = false
223
261
  end
224
- local rooms = ____exports.getRooms(nil, includeExtraDimensionalRooms)
225
- return __TS__ArrayFilter(
226
- rooms,
227
- function(____, roomDescriptor) return roomDescriptor.SafeGridIndex >= 0 end
262
+ local roomsInGrid = ____exports.getRoomsInGrid(nil, includeExtraDimensionalRooms)
263
+ local roomsOutsideGrid = ____exports.getRoomsOutsideGrid(nil)
264
+ local ____array_0 = __TS__SparseArrayNew(table.unpack(roomsInGrid))
265
+ __TS__SparseArrayPush(
266
+ ____array_0,
267
+ table.unpack(roomsOutsideGrid)
228
268
  )
269
+ return {__TS__SparseArraySpread(____array_0)}
229
270
  end
230
271
  --- Helper function to get the room descriptor for every room on the level in a specific dimension.
231
- -- Uses the `Level.GetRooms` method to accomplish this. Rooms without data are assumed to be
232
- -- non-existent and are not added to the list.
272
+ -- This will not include any off-grid rooms, such as the Devil Room.
233
273
  --
234
- -- @returns A map of room ListIndex to RoomDescriptor.
274
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
235
275
  function ____exports.getRoomsOfDimension(self, dimension)
236
276
  local level = game:GetLevel()
277
+ --- We use a map instead of an array because room shapes occupy more than one room grid index.
237
278
  local roomsMap = __TS__New(Map)
238
279
  for ____, roomGridIndex in ipairs(irange(nil, MAX_LEVEL_GRID_INDEX)) do
239
280
  local roomDescriptor = level:GetRoomByIdx(roomGridIndex, dimension)
240
281
  if roomDescriptor.Data ~= nil then
241
- roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
282
+ local ptrHash = GetPtrHash(roomDescriptor)
283
+ roomsMap:set(ptrHash, roomDescriptor)
242
284
  end
243
285
  end
244
286
  return {__TS__Spread(roomsMap:values())}
@@ -294,9 +336,6 @@ function ____exports.inDevilsCrownTreasureRoom(self)
294
336
  local roomDescriptor = getRoomDescriptorReadOnly(nil)
295
337
  return hasFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.DEVIL_TREASURE)
296
338
  end
297
- function ____exports.inDimension(self, dimension)
298
- return dimension == ____exports.getDimension(nil)
299
- end
300
339
  function ____exports.inDoubleTrouble(self)
301
340
  local room = game:GetRoom()
302
341
  local roomType = room:GetType()
@@ -349,24 +388,24 @@ function ____exports.inStartingRoom(self)
349
388
  local level = game:GetLevel()
350
389
  local startingRoomGridIndex = level:GetStartingRoomIndex()
351
390
  local roomGridIndex = getRoomGridIndex(nil)
352
- return roomGridIndex == startingRoomGridIndex and ____exports.inDimension(nil, Dimension.MAIN)
391
+ return roomGridIndex == startingRoomGridIndex and inDimension(nil, Dimension.MAIN)
353
392
  end
354
393
  --- Helper function to loop through every room on the floor and see if it has been cleared.
355
394
  --
356
- -- This function will only check rooms in the current dimension.
395
+ -- This function will only check rooms inside the gird and inside the current dimension.
357
396
  --
358
397
  -- @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
359
398
  -- the array will be ignored. If not specified, then all rooms will be
360
399
  -- checked. Undefined by default.
361
400
  function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
362
- local ____temp_0
401
+ local ____temp_1
363
402
  if onlyCheckRoomTypes == nil then
364
- ____temp_0 = nil
403
+ ____temp_1 = nil
365
404
  else
366
- ____temp_0 = __TS__New(Set, onlyCheckRoomTypes)
405
+ ____temp_1 = __TS__New(Set, onlyCheckRoomTypes)
367
406
  end
368
- local roomTypeWhitelist = ____temp_0
369
- local rooms = ____exports.getRooms(nil)
407
+ local roomTypeWhitelist = ____temp_1
408
+ local rooms = ____exports.getRoomsInGrid(nil)
370
409
  local matchingRooms = roomTypeWhitelist == nil and rooms or __TS__ArrayFilter(
371
410
  rooms,
372
411
  function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypeWhitelist:has(roomDescriptor.Data.Type) end
@@ -376,52 +415,6 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
376
415
  function(____, roomDescriptor) return roomDescriptor.Clear end
377
416
  )
378
417
  end
379
- function ____exports.isDoorSlotValidAtGridIndex(self, doorSlot, roomGridIndex)
380
- local allowedDoors = getRoomAllowedDoors(nil, roomGridIndex)
381
- return allowedDoors:has(doorSlot)
382
- end
383
- function ____exports.isDoorSlotValidAtGridIndexForRedRoom(self, doorSlot, roomGridIndex)
384
- local doorSlotValidAtGridIndex = ____exports.isDoorSlotValidAtGridIndex(nil, doorSlot, roomGridIndex)
385
- if not doorSlotValidAtGridIndex then
386
- return false
387
- end
388
- local roomShape = getRoomShape(nil, roomGridIndex)
389
- if roomShape == nil then
390
- return false
391
- end
392
- local delta = getGridIndexDelta(nil, roomShape, doorSlot)
393
- if delta == nil then
394
- return false
395
- end
396
- local redRoomGridIndex = roomGridIndex + delta
397
- return not ____exports.roomExists(nil, redRoomGridIndex) and redRoomGridIndex >= 0 and redRoomGridIndex <= MAX_LEVEL_GRID_INDEX
398
- end
399
- --- Helper function to detect if the provided room was created by the Red Key item. Under the hood,
400
- -- this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
401
- --
402
- -- @param roomGridIndex Optional. Default is the current room index.
403
- function ____exports.isRedKeyRoom(self, roomGridIndex)
404
- local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
405
- return hasFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.RED_ROOM)
406
- end
407
- --- Helper function to determine if the provided room is part of the floor layout. For example, Devil
408
- -- Rooms and the Mega Satan room are not considered to be inside the map.
409
- --
410
- -- @param roomGridIndex Optional. Default is the current room index.
411
- function ____exports.isRoomInsideMap(self, roomGridIndex)
412
- if roomGridIndex == nil then
413
- roomGridIndex = getRoomGridIndex(nil)
414
- end
415
- return roomGridIndex >= 0
416
- end
417
- --- Helper function to get the coordinates of a given grid index. The floor is represented by a 13x13
418
- -- grid. For example, since the starting room is in the center, the starting room grid index of 84
419
- -- be equal to coordinates of (?, ?).
420
- function ____exports.roomGridIndexToXY(self, roomGridIndex)
421
- local x = roomGridIndex % LEVEL_GRID_ROW_WIDTH
422
- local y = math.floor(roomGridIndex / LEVEL_GRID_ROW_WIDTH)
423
- return {x, y}
424
- end
425
418
  --- If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
426
419
  -- slide around (such as the player). Since those entity velocities are already at zero, setting
427
420
  -- them to zero will have no effect. Thus, a generic solution is to record all of the entity
@@ -435,6 +428,10 @@ function ____exports.roomUpdateSafe(self)
435
428
  setEntityPositions(nil, entityPositions, entities)
436
429
  setEntityVelocities(nil, entityVelocities, entities)
437
430
  end
431
+ --- Helper function to set the backdrop of the current room.
432
+ function ____exports.setBackdrop(self, backdropType)
433
+ game:ShowHallucination(0, backdropType)
434
+ end
438
435
  --- Helper function to convert an uncleared room to a cleared room in the `POST_NEW_ROOM` callback.
439
436
  -- This is useful because if enemies are removed in this callback, a room drop will be awarded and
440
437
  -- the doors will start closed and then open.
@@ -448,12 +445,12 @@ function ____exports.setRoomCleared(self)
448
445
  for ____, door in ipairs(getDoors(nil)) do
449
446
  do
450
447
  if isHiddenSecretRoomDoor(nil, door) then
451
- goto __continue69
448
+ goto __continue48
452
449
  end
453
450
  openDoorFast(nil, door)
454
451
  door.ExtraVisible = false
455
452
  end
456
- ::__continue69::
453
+ ::__continue48::
457
454
  end
458
455
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
459
456
  game:ShakeScreen(0)
@@ -465,28 +462,4 @@ function ____exports.setRoomUncleared(self)
465
462
  room:SetClear(false)
466
463
  closeAllDoors(nil)
467
464
  end
468
- --- Helper function to change the current room. It can be used for both teleportation and "normal"
469
- -- room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
470
- -- arguments. Use this function instead of invoking the `Game.StartRoomTransition` method directly
471
- -- so that you do not forget to set `Level.LeaveDoor` property and to prevent crashing on invalid
472
- -- room grid indexes.
473
- --
474
- -- @param roomGridIndex The room grid index of the destination room.
475
- -- @param direction Optional. Default is `Direction.NO_DIRECTION`.
476
- -- @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
477
- function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim)
478
- if direction == nil then
479
- direction = Direction.NO_DIRECTION
480
- end
481
- if roomTransitionAnim == nil then
482
- roomTransitionAnim = RoomTransitionAnim.TELEPORT
483
- end
484
- local level = game:GetLevel()
485
- local roomData = getRoomData(nil, roomGridIndex)
486
- if roomData == nil then
487
- error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
488
- end
489
- level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
490
- game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
491
- end
492
465
  return ____exports
package/dist/index.d.ts CHANGED
@@ -54,9 +54,11 @@ export * from "./functions/collectibles";
54
54
  export * from "./functions/collectibleSet";
55
55
  export * from "./functions/collectibleTag";
56
56
  export * from "./functions/color";
57
+ export * from "./functions/curses";
57
58
  export * from "./functions/debug";
58
59
  export * from "./functions/deepCopy";
59
60
  export * from "./functions/deepCopyTests";
61
+ export * from "./functions/dimensions";
60
62
  export * from "./functions/direction";
61
63
  export * from "./functions/doors";
62
64
  export * from "./functions/easing";
@@ -80,6 +82,7 @@ export * from "./functions/jsonRoom";
80
82
  export * from "./functions/kColor";
81
83
  export * from "./functions/language";
82
84
  export * from "./functions/level";
85
+ export * from "./functions/levelGrid";
83
86
  export * from "./functions/log";
84
87
  export * from "./functions/map";
85
88
  export * from "./functions/math";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACL,sBAAsB,IAAI,gBAAgB,EAC1C,qBAAqB,IAA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nC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
package/dist/index.lua CHANGED
@@ -430,6 +430,14 @@ do
430
430
  end
431
431
  end
432
432
  end
433
+ do
434
+ local ____export = require("functions.curses")
435
+ for ____exportKey, ____exportValue in pairs(____export) do
436
+ if ____exportKey ~= "default" then
437
+ ____exports[____exportKey] = ____exportValue
438
+ end
439
+ end
440
+ end
433
441
  do
434
442
  local ____export = require("functions.debug")
435
443
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -454,6 +462,14 @@ do
454
462
  end
455
463
  end
456
464
  end
465
+ do
466
+ local ____export = require("functions.dimensions")
467
+ for ____exportKey, ____exportValue in pairs(____export) do
468
+ if ____exportKey ~= "default" then
469
+ ____exports[____exportKey] = ____exportValue
470
+ end
471
+ end
472
+ end
457
473
  do
458
474
  local ____export = require("functions.direction")
459
475
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -638,6 +654,14 @@ do
638
654
  end
639
655
  end
640
656
  end
657
+ do
658
+ local ____export = require("functions.levelGrid")
659
+ for ____exportKey, ____exportValue in pairs(____export) do
660
+ if ____exportKey ~= "default" then
661
+ ____exports[____exportKey] = ____exportValue
662
+ end
663
+ end
664
+ end
641
665
  do
642
666
  local ____export = require("functions.log")
643
667
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "6.19.0",
3
+ "version": "6.20.2",
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.1.0"
25
+ "isaac-typescript-definitions": "^3.1.3"
26
26
  }
27
27
  }
package/src/constants.ts CHANGED
@@ -1,11 +1,19 @@
1
1
  import {
2
2
  CollectibleType,
3
3
  Dimension,
4
+ DisplayFlag,
4
5
  ItemPoolType,
5
6
  TrinketSlot,
6
7
  } from "isaac-typescript-definitions";
7
8
  import { NUM_NORMAL_PILL_COLORS } from "./constantsFirstLast";
8
9
  import { getEnumLength } from "./functions/enums";
10
+ import { addFlag } from "./functions/flag";
11
+
12
+ export const ALL_DISPLAY_FLAGS = addFlag(
13
+ DisplayFlag.VISIBLE,
14
+ DisplayFlag.SHADOW,
15
+ DisplayFlag.SHOW_ICON,
16
+ );
9
17
 
10
18
  /**
11
19
  * The distance of the laser when Azazel does not have any range up items yet. For more info, see