isaacscript-common 79.0.0 → 79.1.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.
@@ -21,11 +21,10 @@ function PostPlayerInitFirst.prototype.____constructor(self)
21
21
  CustomCallback.prototype.____constructor(self)
22
22
  self.shouldFire = shouldFirePlayer
23
23
  self.postNewRoomReordered = function()
24
- if not inGenesisRoom(nil) then
25
- return
26
- end
27
- for ____, player in ipairs(getPlayers(nil)) do
28
- self:fire(player)
24
+ if inGenesisRoom(nil) then
25
+ for ____, player in ipairs(getPlayers(nil)) do
26
+ self:fire(player)
27
+ end
29
28
  end
30
29
  end
31
30
  self.postPlayerInitLate = function(____, player)
@@ -41,7 +41,12 @@ export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: in
41
41
  * @param roomGridIndex Optional. Default is the current room index.
42
42
  */
43
43
  export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): readonly int[];
44
- /** Helper function to get the room safe grid index for every room on the entire floor. */
44
+ /**
45
+ * Helper function to get the room safe grid index for every room on the entire floor. This includes
46
+ * off-grid rooms, such as the Devil Room.
47
+ *
48
+ * Rooms without any data are assumed to be non-existent and are not included.
49
+ */
45
50
  export declare function getAllRoomGridIndexes(): readonly int[];
46
51
  /**
47
52
  * Helper function to pick a random valid spot on the floor to insert a brand new room. Note that
@@ -1 +1 @@
1
- {"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAIL,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAoCtC;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,aAAa,CAAC,EAAE,GAAG,GAClB,SAAS,GAAG,EAAE,CAKhB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,aAAa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gB,0CAA0C,CACxD,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAa5B;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,IAAI,OAAO,CAGhC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAGtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAKtD;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAGT;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAqBT;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGxD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,OAAO,CACrB,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,aAAa,UAAO,EACpB,cAAc,CAAC,EAAE,UAAU,GAC1B,GAAG,GAAG,SAAS,CAuDjB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAE7D"}
@@ -280,7 +280,10 @@ function ____exports.getAdjacentNonExistingRoomGridIndexes(self, roomGridIndex)
280
280
  function(____, adjacentRoomGridIndex) return getRoomData(nil, adjacentRoomGridIndex) == nil end
281
281
  )
282
282
  end
283
- --- Helper function to get the room safe grid index for every room on the entire floor.
283
+ --- Helper function to get the room safe grid index for every room on the entire floor. This includes
284
+ -- off-grid rooms, such as the Devil Room.
285
+ --
286
+ -- Rooms without any data are assumed to be non-existent and are not included.
284
287
  function ____exports.getAllRoomGridIndexes(self)
285
288
  local rooms = getRooms(nil)
286
289
  return __TS__ArrayMap(
@@ -39,9 +39,10 @@ export declare function getRoomDescriptorReadOnly(): Readonly<RoomDescriptor>;
39
39
  * the room descriptor. (The safe grid index is defined as the top-left 1x1 section that the room
40
40
  * overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
41
41
  * - If the current room is outside of the grid, it will return the index from the
42
- * `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases, as
42
+ * `Level.GetCurrentRoomIndex` method, since `SafeGridIndex` is bugged for these cases, as
43
43
  * demonstrated by entering a Genesis room and entering `l
44
- * print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console).
44
+ * print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console. (It prints -1
45
+ * instead of -12.)
45
46
  *
46
47
  * Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
47
48
  * will return the specific 1x1 quadrant that the player entered the room at. For most situations,
@@ -1 +1 @@
1
- {"version":3,"file":"roomData.d.ts","sourceRoot":"","sources":["../../src/functions/roomData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAMtC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAgBtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,UAAU,GAAG,SAA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E1C;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,SAAS,GAAG,SAAS,CAAC;AAOzE;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC;AAE1C;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,SAAS,CAAC;AAOzE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI,GAAG,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;AAOrE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,QAAQ,GAAG,SAAS,CAAC;AAavE;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,IAAI,GAAG,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;AAOrE;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAG5D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI,CAG1E"}
@@ -47,9 +47,10 @@ end
47
47
  -- the room descriptor. (The safe grid index is defined as the top-left 1x1 section that the room
48
48
  -- overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
49
49
  -- - If the current room is outside of the grid, it will return the index from the
50
- -- `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases, as
50
+ -- `Level.GetCurrentRoomIndex` method, since `SafeGridIndex` is bugged for these cases, as
51
51
  -- demonstrated by entering a Genesis room and entering `l
52
- -- print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console).
52
+ -- print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console. (It prints -1
53
+ -- instead of -12.)
53
54
  --
54
55
  -- Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
55
56
  -- will return the specific 1x1 quadrant that the player entered the room at. For most situations,
@@ -58,12 +58,25 @@ export declare function getRoomShapeTopLeftPosition(roomShape: RoomShape): Reado
58
58
  */
59
59
  export declare function getRoomShapeVolume(roomShape: RoomShape): int;
60
60
  export declare function getRoomShapeWidth(roomShape: RoomShape): int;
61
+ /**
62
+ * Helper function to determine if the provided room is equal to `RoomShape.1x2` (4) or
63
+ * `RoomShape.2x1` (6).
64
+ */
65
+ export declare function is2x1RoomShape(roomShape: RoomShape): boolean;
61
66
  /**
62
67
  * Helper function to detect if the provided room shape is big. Specifically, this is all 1x2 rooms,
63
68
  * 2x2 rooms, and L rooms.
64
69
  */
65
70
  export declare function isBigRoomShape(roomShape: RoomShape): boolean;
71
+ /**
72
+ * Helper function to determine if the provided room is equal to `RoomShape.LTL` (9),
73
+ * `RoomShape.LTR` (10), `RoomShape.LBL` (11), or `RoomShape.LBR` (12).
74
+ */
66
75
  export declare function isLRoomShape(roomShape: RoomShape): boolean;
76
+ /**
77
+ * Helper function to determine if the provided room is equal to `RoomShape.IH` (2), `RoomShape.IV`
78
+ * (3), `RoomShape.IIV` (5), or `RoomShape.IIH` (7).
79
+ */
67
80
  export declare function isNarrowRoom(roomShape: RoomShape): boolean;
68
81
  /**
69
82
  * Helper function to see if a given room shape will grant a single charge or a double charge to the
@@ -1 +1 @@
1
- {"version":3,"file":"roomShape.d.ts","sourceRoot":"","sources":["../../src/functions/roomShape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KA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ED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAE5D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAE1D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAGrE"}
@@ -90,14 +90,23 @@ end
90
90
  function ____exports.getRoomShapeWidth(self, roomShape)
91
91
  return ROOM_SHAPE_TO_GRID_WIDTH[roomShape]
92
92
  end
93
+ --- Helper function to determine if the provided room is equal to `RoomShape.1x2` (4) or
94
+ -- `RoomShape.2x1` (6).
95
+ function ____exports.is2x1RoomShape(self, roomShape)
96
+ return roomShape == RoomShape.SHAPE_1x2 or roomShape == RoomShape.SHAPE_2x1
97
+ end
93
98
  --- Helper function to detect if the provided room shape is big. Specifically, this is all 1x2 rooms,
94
99
  -- 2x2 rooms, and L rooms.
95
100
  function ____exports.isBigRoomShape(self, roomShape)
96
101
  return BIG_ROOM_SHAPES_SET:has(roomShape)
97
102
  end
103
+ --- Helper function to determine if the provided room is equal to `RoomShape.LTL` (9),
104
+ -- `RoomShape.LTR` (10), `RoomShape.LBL` (11), or `RoomShape.LBR` (12).
98
105
  function ____exports.isLRoomShape(self, roomShape)
99
106
  return L_ROOM_SHAPES_SET:has(roomShape)
100
107
  end
108
+ --- Helper function to determine if the provided room is equal to `RoomShape.IH` (2), `RoomShape.IV`
109
+ -- (3), `RoomShape.IIV` (5), or `RoomShape.IIH` (7).
101
110
  function ____exports.isNarrowRoom(self, roomShape)
102
111
  return NARROW_ROOM_SHAPES_SET:has(roomShape)
103
112
  end
@@ -1,5 +1,5 @@
1
- import type { BackdropType, BossID, ItemPoolType, MinibossID } from "isaac-typescript-definitions";
2
- import { Dimension, RoomShape, RoomType } from "isaac-typescript-definitions";
1
+ import type { BackdropType, BossID, ItemPoolType, MinibossID, RoomShape } from "isaac-typescript-definitions";
2
+ import { Dimension, RoomType } from "isaac-typescript-definitions";
3
3
  /**
4
4
  * Helper function for quickly switching to a new room without playing a particular animation. Use
5
5
  * this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -63,7 +63,7 @@ export declare function getRoomTypeName(roomType: RoomType): string;
63
63
  * Helper function to get the room descriptor for every room on the level. This includes off-grid
64
64
  * rooms, such as the Devil Room.
65
65
  *
66
- * Room descriptors without any data are assumed to be non-existent and are not included.
66
+ * Room without any data are assumed to be non-existent and are not included.
67
67
  *
68
68
  * - If you want just the rooms inside of the grid, use the `getRoomsInsideGrid` helper function.
69
69
  * - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
@@ -334,7 +334,7 @@ export declare function isDoubleTrouble(roomData: RoomConfig): boolean;
334
334
  /**
335
335
  * Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
336
336
  */
337
- export declare function isGenesisRoom(roomDescriptor: RoomDescriptor): boolean;
337
+ export declare function isGenesisRoom(roomGridIndex: int): boolean;
338
338
  /**
339
339
  * Helper function to check if the provided room is either the left Home closet (behind the red
340
340
  * door) or the right Home closet (with one random pickup).
@@ -347,7 +347,7 @@ export declare function isLRoom(roomData: RoomConfig): boolean;
347
347
  /**
348
348
  * Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
349
349
  */
350
- export declare function isMegaSatanRoom(roomDescriptor: RoomDescriptor): boolean;
350
+ export declare function isMegaSatanRoom(roomGridIndex: int): boolean;
351
351
  /**
352
352
  * Helper function to determine if the provided room is part of the Repentance "escape sequence" in
353
353
  * the Mines/Ashpit.
@@ -387,7 +387,7 @@ export declare function isRoomType(roomData: RoomConfig, ...roomTypes: RoomType[
387
387
  * Helper function for checking if the provided room is a secret exit that leads to a Repentance
388
388
  * floor.
389
389
  */
390
- export declare function isSecretExit(roomDescriptor: RoomDescriptor): boolean;
390
+ export declare function isSecretExit(roomGridIndex: int): boolean;
391
391
  /**
392
392
  * Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
393
393
  * Secret Room.
@@ -401,7 +401,7 @@ export declare function isSecretRoomType(roomType: RoomType): boolean;
401
401
  * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
402
402
  * the only way to detect them is by using the grid index.
403
403
  */
404
- export declare function isSecretShop(roomDescriptor: RoomDescriptor): boolean;
404
+ export declare function isSecretShop(roomGridIndex: int): boolean;
405
405
  /**
406
406
  * If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
407
407
  * slide around (such as the player). Since those entity velocities are already at zero, setting
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAST,SAAS,EACT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAuCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAcnD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,EAC3B,iCAAiC,UAAQ,GACxC,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAgBlC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;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GAAG,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -23,7 +23,6 @@ local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
23
23
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
24
24
  local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
25
25
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
26
- local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
27
26
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
28
27
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
29
28
  local StageID = ____isaac_2Dtypescript_2Ddefinitions.StageID
@@ -62,6 +61,7 @@ local getRoomDescriptor = ____roomData.getRoomDescriptor
62
61
  local getRoomDescriptorReadOnly = ____roomData.getRoomDescriptorReadOnly
63
62
  local getRoomGridIndex = ____roomData.getRoomGridIndex
64
63
  local ____roomShape = require("functions.roomShape")
64
+ local is2x1RoomShape = ____roomShape.is2x1RoomShape
65
65
  local isBigRoomShape = ____roomShape.isBigRoomShape
66
66
  local isLRoomShape = ____roomShape.isLRoomShape
67
67
  local ____roomTransition = require("functions.roomTransition")
@@ -142,7 +142,7 @@ function ____exports.getRoomsOutsideGrid(self)
142
142
  end
143
143
  --- Helper function to determine if the provided room is equal to `RoomShape.1x2` or `RoomShape.2x1`.
144
144
  function ____exports.is2x1Room(self, roomData)
145
- return roomData.Shape == RoomShape.SHAPE_1x2 or roomData.Shape == RoomShape.SHAPE_2x1
145
+ return is2x1RoomShape(nil, roomData.Shape)
146
146
  end
147
147
  --- Helper function to check to see if the current room is an angel shop.
148
148
  --
@@ -219,8 +219,8 @@ function ____exports.isDoubleTrouble(self, roomData)
219
219
  return roomData.Type == RoomType.BOSS and __TS__StringIncludes(roomData.Name, "Double Trouble")
220
220
  end
221
221
  --- Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
222
- function ____exports.isGenesisRoom(self, roomDescriptor)
223
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.GENESIS)
222
+ function ____exports.isGenesisRoom(self, roomGridIndex)
223
+ return roomGridIndex == asNumber(nil, GridRoom.GENESIS)
224
224
  end
225
225
  --- Helper function to check if the provided room is either the left Home closet (behind the red
226
226
  -- door) or the right Home closet (with one random pickup).
@@ -234,8 +234,8 @@ function ____exports.isLRoom(self, roomData)
234
234
  return isLRoomShape(nil, roomData.Shape)
235
235
  end
236
236
  --- Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
237
- function ____exports.isMegaSatanRoom(self, roomDescriptor)
238
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.MEGA_SATAN)
237
+ function ____exports.isMegaSatanRoom(self, roomGridIndex)
238
+ return roomGridIndex == asNumber(nil, GridRoom.MEGA_SATAN)
239
239
  end
240
240
  --- Helper function to determine if the provided room is part of the Repentance "escape sequence" in
241
241
  -- the Mines/Ashpit.
@@ -268,8 +268,8 @@ function ____exports.isRoomType(self, roomData, ...)
268
268
  end
269
269
  --- Helper function for checking if the provided room is a secret exit that leads to a Repentance
270
270
  -- floor.
271
- function ____exports.isSecretExit(self, roomDescriptor)
272
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.SECRET_EXIT)
271
+ function ____exports.isSecretExit(self, roomGridIndex)
272
+ return roomGridIndex == asNumber(nil, GridRoom.SECRET_EXIT)
273
273
  end
274
274
  --- Helper function for checking if the provided room is a secret shop (from the Member Card
275
275
  -- collectible).
@@ -277,8 +277,8 @@ end
277
277
  -- Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other
278
278
  -- words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
279
279
  -- the only way to detect them is by using the grid index.
280
- function ____exports.isSecretShop(self, roomDescriptor)
281
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.SECRET_SHOP)
280
+ function ____exports.isSecretShop(self, roomGridIndex)
281
+ return roomGridIndex == asNumber(nil, GridRoom.SECRET_SHOP)
282
282
  end
283
283
  local SECRET_ROOM_TYPES = __TS__New(ReadonlySet, {RoomType.SECRET, RoomType.SUPER_SECRET, RoomType.ULTRA_SECRET})
284
284
  --- Helper function for quickly switching to a new room without playing a particular animation. Use
@@ -356,7 +356,7 @@ end
356
356
  --- Helper function to get the room descriptor for every room on the level. This includes off-grid
357
357
  -- rooms, such as the Devil Room.
358
358
  --
359
- -- Room descriptors without any data are assumed to be non-existent and are not included.
359
+ -- Room without any data are assumed to be non-existent and are not included.
360
360
  --
361
361
  -- - If you want just the rooms inside of the grid, use the `getRoomsInsideGrid` helper function.
362
362
  -- - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
@@ -486,8 +486,8 @@ function ____exports.inDoubleTrouble(self)
486
486
  end
487
487
  --- Helper function to determine if the current room index is equal to `GridRoom.GENESIS`.
488
488
  function ____exports.inGenesisRoom(self)
489
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
490
- return ____exports.isGenesisRoom(nil, roomDescriptor)
489
+ local roomGridIndex = getRoomGridIndex(nil)
490
+ return ____exports.isGenesisRoom(nil, roomGridIndex)
491
491
  end
492
492
  --- Helper function to check if the current room is either the left Home closet (behind the red door)
493
493
  -- or the right Home closet (with one random pickup).
@@ -504,8 +504,8 @@ function ____exports.inLRoom(self)
504
504
  end
505
505
  --- Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`.
506
506
  function ____exports.inMegaSatanRoom(self)
507
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
508
- return ____exports.isMegaSatanRoom(nil, roomDescriptor)
507
+ local roomGridIndex = getRoomGridIndex(nil)
508
+ return ____exports.isMegaSatanRoom(nil, roomGridIndex)
509
509
  end
510
510
  --- Helper function to determine if the current room is part of the Repentance "escape sequence" in
511
511
  -- the Mines/Ashpit.
@@ -542,8 +542,8 @@ end
542
542
  --- Helper function for checking if the current room is a secret exit that leads to a Repentance
543
543
  -- floor.
544
544
  function ____exports.inSecretExit(self)
545
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
546
- return ____exports.isSecretExit(nil, roomDescriptor)
545
+ local roomGridIndex = getRoomGridIndex(nil)
546
+ return ____exports.isSecretExit(nil, roomGridIndex)
547
547
  end
548
548
  --- Helper function for checking if the current room is a secret shop (from the Member Card
549
549
  -- collectible).
@@ -552,8 +552,8 @@ end
552
552
  -- words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
553
553
  -- the only way to detect them is by using the grid index.
554
554
  function ____exports.inSecretShop(self)
555
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
556
- return ____exports.isSecretShop(nil, roomDescriptor)
555
+ local roomGridIndex = getRoomGridIndex(nil)
556
+ return ____exports.isSecretShop(nil, roomGridIndex)
557
557
  end
558
558
  --- Helper function to determine whether the current room is the starting room of a floor. It only
559
559
  -- returns true for the starting room of the primary dimension (meaning that being in the starting
@@ -4959,7 +4959,12 @@ export declare function getAllPillColors(): readonly PillColor[];
4959
4959
  */
4960
4960
  export declare function getAllPlayers(): EntityPlayer[];
4961
4961
 
4962
- /** Helper function to get the room safe grid index for every room on the entire floor. */
4962
+ /**
4963
+ * Helper function to get the room safe grid index for every room on the entire floor. This includes
4964
+ * off-grid rooms, such as the Devil Room.
4965
+ *
4966
+ * Rooms without any data are assumed to be non-existent and are not included.
4967
+ */
4963
4968
  export declare function getAllRoomGridIndexes(): readonly int[];
4964
4969
 
4965
4970
  /**
@@ -7394,9 +7399,10 @@ export declare function getRoomDisplayFlags(roomGridIndex?: int, minimapAPI?: bo
7394
7399
  * the room descriptor. (The safe grid index is defined as the top-left 1x1 section that the room
7395
7400
  * overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
7396
7401
  * - If the current room is outside of the grid, it will return the index from the
7397
- * `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases, as
7402
+ * `Level.GetCurrentRoomIndex` method, since `SafeGridIndex` is bugged for these cases, as
7398
7403
  * demonstrated by entering a Genesis room and entering `l
7399
- * print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console).
7404
+ * print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console. (It prints -1
7405
+ * instead of -12.)
7400
7406
  *
7401
7407
  * Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
7402
7408
  * will return the specific 1x1 quadrant that the player entered the room at. For most situations,
@@ -7463,7 +7469,7 @@ export declare function getRoomName(roomGridIndex?: int): string | undefined;
7463
7469
  * Helper function to get the room descriptor for every room on the level. This includes off-grid
7464
7470
  * rooms, such as the Devil Room.
7465
7471
  *
7466
- * Room descriptors without any data are assumed to be non-existent and are not included.
7472
+ * Room without any data are assumed to be non-existent and are not included.
7467
7473
  *
7468
7474
  * - If you want just the rooms inside of the grid, use the `getRoomsInsideGrid` helper function.
7469
7475
  * - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
@@ -8810,6 +8816,12 @@ export declare function iRange(start: int, end?: int, increment?: number): int[]
8810
8816
  */
8811
8817
  export declare function is2x1Room(roomData: RoomConfig): boolean;
8812
8818
 
8819
+ /**
8820
+ * Helper function to determine if the provided room is equal to `RoomShape.1x2` (4) or
8821
+ * `RoomShape.2x1` (6).
8822
+ */
8823
+ export declare function is2x1RoomShape(roomShape: RoomShape): boolean;
8824
+
8813
8825
  /**
8814
8826
  * Helper function to check if an instantiated Isaac API class is equal to another one of the same
8815
8827
  * type. You must provide the list of keys to check for.
@@ -9519,7 +9531,7 @@ export declare function isFunction(variable: unknown): variable is Function;
9519
9531
  /**
9520
9532
  * Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
9521
9533
  */
9522
- export declare function isGenesisRoom(roomDescriptor: RoomDescriptor): boolean;
9534
+ export declare function isGenesisRoom(roomGridIndex: int): boolean;
9523
9535
 
9524
9536
  /**
9525
9537
  * Returns whether the given collectible is a "glitched" item. All items are replaced by glitched
@@ -9639,6 +9651,10 @@ export declare function isLost(player: EntityPlayer): boolean;
9639
9651
  /** Helper function to determine if the provided room is one of the four L room shapes. */
9640
9652
  export declare function isLRoom(roomData: RoomConfig): boolean;
9641
9653
 
9654
+ /**
9655
+ * Helper function to determine if the provided room is equal to `RoomShape.LTL` (9),
9656
+ * `RoomShape.LTR` (10), `RoomShape.LBL` (11), or `RoomShape.LBR` (12).
9657
+ */
9642
9658
  export declare function isLRoomShape(roomShape: RoomShape): boolean;
9643
9659
 
9644
9660
  /**
@@ -9673,7 +9689,7 @@ export declare function isMegaSatanDoor(door: GridEntityDoor): boolean;
9673
9689
  /**
9674
9690
  * Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
9675
9691
  */
9676
- export declare function isMegaSatanRoom(roomDescriptor: RoomDescriptor): boolean;
9692
+ export declare function isMegaSatanRoom(roomGridIndex: int): boolean;
9677
9693
 
9678
9694
  /**
9679
9695
  * Helper function to determine if the provided room is part of the Repentance "escape sequence" in
@@ -9747,6 +9763,10 @@ export declare function isMoveActionTriggeredOnAnyInput(): boolean;
9747
9763
  */
9748
9764
  export declare function isMultiplayer(): boolean;
9749
9765
 
9766
+ /**
9767
+ * Helper function to determine if the provided room is equal to `RoomShape.IH` (2), `RoomShape.IV`
9768
+ * (3), `RoomShape.IIV` (5), or `RoomShape.IIH` (7).
9769
+ */
9750
9770
  export declare function isNarrowRoom(roomShape: RoomShape): boolean;
9751
9771
 
9752
9772
  /** Helper function to detect if a variable is of type `EntityNPC`. */
@@ -9964,7 +9984,7 @@ export declare function isSack(pickup: EntityPickup): pickup is EntityPickupSack
9964
9984
  * Helper function for checking if the provided room is a secret exit that leads to a Repentance
9965
9985
  * floor.
9966
9986
  */
9967
- export declare function isSecretExit(roomDescriptor: RoomDescriptor): boolean;
9987
+ export declare function isSecretExit(roomGridIndex: int): boolean;
9968
9988
 
9969
9989
  /**
9970
9990
  * This refers to the hole in the wall that appears after bombing the entrance to a secret room.
@@ -9990,7 +10010,7 @@ export declare function isSecretRoomType(roomType: RoomType): boolean;
9990
10010
  * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
9991
10011
  * the only way to detect them is by using the grid index.
9992
10012
  */
9993
- export declare function isSecretShop(roomDescriptor: RoomDescriptor): boolean;
10013
+ export declare function isSecretShop(roomGridIndex: int): boolean;
9994
10014
 
9995
10015
  /**
9996
10016
  * Helper function to determine whether damage to a player in the `ENTITY_TAKE_DMG` callback was
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 78.0.0
3
+ isaacscript-common 79.0.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -28888,14 +28888,23 @@ end
28888
28888
  function ____exports.getRoomShapeWidth(self, roomShape)
28889
28889
  return ROOM_SHAPE_TO_GRID_WIDTH[roomShape]
28890
28890
  end
28891
+ --- Helper function to determine if the provided room is equal to `RoomShape.1x2` (4) or
28892
+ -- `RoomShape.2x1` (6).
28893
+ function ____exports.is2x1RoomShape(self, roomShape)
28894
+ return roomShape == RoomShape.SHAPE_1x2 or roomShape == RoomShape.SHAPE_2x1
28895
+ end
28891
28896
  --- Helper function to detect if the provided room shape is big. Specifically, this is all 1x2 rooms,
28892
28897
  -- 2x2 rooms, and L rooms.
28893
28898
  function ____exports.isBigRoomShape(self, roomShape)
28894
28899
  return BIG_ROOM_SHAPES_SET:has(roomShape)
28895
28900
  end
28901
+ --- Helper function to determine if the provided room is equal to `RoomShape.LTL` (9),
28902
+ -- `RoomShape.LTR` (10), `RoomShape.LBL` (11), or `RoomShape.LBR` (12).
28896
28903
  function ____exports.isLRoomShape(self, roomShape)
28897
28904
  return L_ROOM_SHAPES_SET:has(roomShape)
28898
28905
  end
28906
+ --- Helper function to determine if the provided room is equal to `RoomShape.IH` (2), `RoomShape.IV`
28907
+ -- (3), `RoomShape.IIV` (5), or `RoomShape.IIH` (7).
28899
28908
  function ____exports.isNarrowRoom(self, roomShape)
28900
28909
  return NARROW_ROOM_SHAPES_SET:has(roomShape)
28901
28910
  end
@@ -31199,9 +31208,10 @@ end
31199
31208
  -- the room descriptor. (The safe grid index is defined as the top-left 1x1 section that the room
31200
31209
  -- overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
31201
31210
  -- - If the current room is outside of the grid, it will return the index from the
31202
- -- `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases, as
31211
+ -- `Level.GetCurrentRoomIndex` method, since `SafeGridIndex` is bugged for these cases, as
31203
31212
  -- demonstrated by entering a Genesis room and entering `l
31204
- -- print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console).
31213
+ -- print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console. (It prints -1
31214
+ -- instead of -12.)
31205
31215
  --
31206
31216
  -- Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
31207
31217
  -- will return the specific 1x1 quadrant that the player entered the room at. For most situations,
@@ -32347,7 +32357,6 @@ local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
32347
32357
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
32348
32358
  local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
32349
32359
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
32350
- local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
32351
32360
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
32352
32361
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
32353
32362
  local StageID = ____isaac_2Dtypescript_2Ddefinitions.StageID
@@ -32386,6 +32395,7 @@ local getRoomDescriptor = ____roomData.getRoomDescriptor
32386
32395
  local getRoomDescriptorReadOnly = ____roomData.getRoomDescriptorReadOnly
32387
32396
  local getRoomGridIndex = ____roomData.getRoomGridIndex
32388
32397
  local ____roomShape = require("functions.roomShape")
32398
+ local is2x1RoomShape = ____roomShape.is2x1RoomShape
32389
32399
  local isBigRoomShape = ____roomShape.isBigRoomShape
32390
32400
  local isLRoomShape = ____roomShape.isLRoomShape
32391
32401
  local ____roomTransition = require("functions.roomTransition")
@@ -32466,7 +32476,7 @@ function ____exports.getRoomsOutsideGrid(self)
32466
32476
  end
32467
32477
  --- Helper function to determine if the provided room is equal to `RoomShape.1x2` or `RoomShape.2x1`.
32468
32478
  function ____exports.is2x1Room(self, roomData)
32469
- return roomData.Shape == RoomShape.SHAPE_1x2 or roomData.Shape == RoomShape.SHAPE_2x1
32479
+ return is2x1RoomShape(nil, roomData.Shape)
32470
32480
  end
32471
32481
  --- Helper function to check to see if the current room is an angel shop.
32472
32482
  --
@@ -32543,8 +32553,8 @@ function ____exports.isDoubleTrouble(self, roomData)
32543
32553
  return roomData.Type == RoomType.BOSS and __TS__StringIncludes(roomData.Name, "Double Trouble")
32544
32554
  end
32545
32555
  --- Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
32546
- function ____exports.isGenesisRoom(self, roomDescriptor)
32547
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.GENESIS)
32556
+ function ____exports.isGenesisRoom(self, roomGridIndex)
32557
+ return roomGridIndex == asNumber(nil, GridRoom.GENESIS)
32548
32558
  end
32549
32559
  --- Helper function to check if the provided room is either the left Home closet (behind the red
32550
32560
  -- door) or the right Home closet (with one random pickup).
@@ -32558,8 +32568,8 @@ function ____exports.isLRoom(self, roomData)
32558
32568
  return isLRoomShape(nil, roomData.Shape)
32559
32569
  end
32560
32570
  --- Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
32561
- function ____exports.isMegaSatanRoom(self, roomDescriptor)
32562
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.MEGA_SATAN)
32571
+ function ____exports.isMegaSatanRoom(self, roomGridIndex)
32572
+ return roomGridIndex == asNumber(nil, GridRoom.MEGA_SATAN)
32563
32573
  end
32564
32574
  --- Helper function to determine if the provided room is part of the Repentance "escape sequence" in
32565
32575
  -- the Mines/Ashpit.
@@ -32592,8 +32602,8 @@ function ____exports.isRoomType(self, roomData, ...)
32592
32602
  end
32593
32603
  --- Helper function for checking if the provided room is a secret exit that leads to a Repentance
32594
32604
  -- floor.
32595
- function ____exports.isSecretExit(self, roomDescriptor)
32596
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.SECRET_EXIT)
32605
+ function ____exports.isSecretExit(self, roomGridIndex)
32606
+ return roomGridIndex == asNumber(nil, GridRoom.SECRET_EXIT)
32597
32607
  end
32598
32608
  --- Helper function for checking if the provided room is a secret shop (from the Member Card
32599
32609
  -- collectible).
@@ -32601,8 +32611,8 @@ end
32601
32611
  -- Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other
32602
32612
  -- words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
32603
32613
  -- the only way to detect them is by using the grid index.
32604
- function ____exports.isSecretShop(self, roomDescriptor)
32605
- return roomDescriptor.GridIndex == asNumber(nil, GridRoom.SECRET_SHOP)
32614
+ function ____exports.isSecretShop(self, roomGridIndex)
32615
+ return roomGridIndex == asNumber(nil, GridRoom.SECRET_SHOP)
32606
32616
  end
32607
32617
  local SECRET_ROOM_TYPES = __TS__New(ReadonlySet, {RoomType.SECRET, RoomType.SUPER_SECRET, RoomType.ULTRA_SECRET})
32608
32618
  --- Helper function for quickly switching to a new room without playing a particular animation. Use
@@ -32680,7 +32690,7 @@ end
32680
32690
  --- Helper function to get the room descriptor for every room on the level. This includes off-grid
32681
32691
  -- rooms, such as the Devil Room.
32682
32692
  --
32683
- -- Room descriptors without any data are assumed to be non-existent and are not included.
32693
+ -- Room without any data are assumed to be non-existent and are not included.
32684
32694
  --
32685
32695
  -- - If you want just the rooms inside of the grid, use the `getRoomsInsideGrid` helper function.
32686
32696
  -- - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
@@ -32810,8 +32820,8 @@ function ____exports.inDoubleTrouble(self)
32810
32820
  end
32811
32821
  --- Helper function to determine if the current room index is equal to `GridRoom.GENESIS`.
32812
32822
  function ____exports.inGenesisRoom(self)
32813
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
32814
- return ____exports.isGenesisRoom(nil, roomDescriptor)
32823
+ local roomGridIndex = getRoomGridIndex(nil)
32824
+ return ____exports.isGenesisRoom(nil, roomGridIndex)
32815
32825
  end
32816
32826
  --- Helper function to check if the current room is either the left Home closet (behind the red door)
32817
32827
  -- or the right Home closet (with one random pickup).
@@ -32828,8 +32838,8 @@ function ____exports.inLRoom(self)
32828
32838
  end
32829
32839
  --- Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`.
32830
32840
  function ____exports.inMegaSatanRoom(self)
32831
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
32832
- return ____exports.isMegaSatanRoom(nil, roomDescriptor)
32841
+ local roomGridIndex = getRoomGridIndex(nil)
32842
+ return ____exports.isMegaSatanRoom(nil, roomGridIndex)
32833
32843
  end
32834
32844
  --- Helper function to determine if the current room is part of the Repentance "escape sequence" in
32835
32845
  -- the Mines/Ashpit.
@@ -32866,8 +32876,8 @@ end
32866
32876
  --- Helper function for checking if the current room is a secret exit that leads to a Repentance
32867
32877
  -- floor.
32868
32878
  function ____exports.inSecretExit(self)
32869
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
32870
- return ____exports.isSecretExit(nil, roomDescriptor)
32879
+ local roomGridIndex = getRoomGridIndex(nil)
32880
+ return ____exports.isSecretExit(nil, roomGridIndex)
32871
32881
  end
32872
32882
  --- Helper function for checking if the current room is a secret shop (from the Member Card
32873
32883
  -- collectible).
@@ -32876,8 +32886,8 @@ end
32876
32886
  -- words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
32877
32887
  -- the only way to detect them is by using the grid index.
32878
32888
  function ____exports.inSecretShop(self)
32879
- local roomDescriptor = getRoomDescriptorReadOnly(nil)
32880
- return ____exports.isSecretShop(nil, roomDescriptor)
32889
+ local roomGridIndex = getRoomGridIndex(nil)
32890
+ return ____exports.isSecretShop(nil, roomGridIndex)
32881
32891
  end
32882
32892
  --- Helper function to determine whether the current room is the starting room of a floor. It only
32883
32893
  -- returns true for the starting room of the primary dimension (meaning that being in the starting
@@ -37001,11 +37011,10 @@ function PostPlayerInitFirst.prototype.____constructor(self)
37001
37011
  CustomCallback.prototype.____constructor(self)
37002
37012
  self.shouldFire = shouldFirePlayer
37003
37013
  self.postNewRoomReordered = function()
37004
- if not inGenesisRoom(nil) then
37005
- return
37006
- end
37007
- for ____, player in ipairs(getPlayers(nil)) do
37008
- self:fire(player)
37014
+ if inGenesisRoom(nil) then
37015
+ for ____, player in ipairs(getPlayers(nil)) do
37016
+ self:fire(player)
37017
+ end
37009
37018
  end
37010
37019
  end
37011
37020
  self.postPlayerInitLate = function(____, player)
@@ -55456,7 +55465,10 @@ function ____exports.getAdjacentNonExistingRoomGridIndexes(self, roomGridIndex)
55456
55465
  function(____, adjacentRoomGridIndex) return getRoomData(nil, adjacentRoomGridIndex) == nil end
55457
55466
  )
55458
55467
  end
55459
- --- Helper function to get the room safe grid index for every room on the entire floor.
55468
+ --- Helper function to get the room safe grid index for every room on the entire floor. This includes
55469
+ -- off-grid rooms, such as the Devil Room.
55470
+ --
55471
+ -- Rooms without any data are assumed to be non-existent and are not included.
55460
55472
  function ____exports.getAllRoomGridIndexes(self)
55461
55473
  local rooms = getRooms(nil)
55462
55474
  return __TS__ArrayMap(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "79.0.0",
3
+ "version": "79.1.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -37,6 +37,6 @@
37
37
  "lint": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/lint.mts"
38
38
  },
39
39
  "dependencies": {
40
- "isaac-typescript-definitions": "^39.0.0"
40
+ "isaac-typescript-definitions": "^39.0.1"
41
41
  }
42
42
  }
@@ -22,12 +22,12 @@ export class PostPlayerInitFirst extends CustomCallback<ModCallbackCustom.POST_P
22
22
  // trinkets, pocket items, and stats, so they will need to be re-initialized like they would be
23
23
  // at the beginning of a run. However, in this case, the `POST_PLAYER_INIT_FIRST` callback will
24
24
  // not fire, because that only fires once per run. Thus, we explicitly handle this special case.
25
- if (!inGenesisRoom()) {
26
- return;
27
- }
28
-
29
- for (const player of getPlayers()) {
30
- this.fire(player);
25
+ // Note that whichever player uses Genesis, items will be removed from all players (at least in
26
+ // the case of Jacob & Esau).
27
+ if (inGenesisRoom()) {
28
+ for (const player of getPlayers()) {
29
+ this.fire(player);
30
+ }
31
31
  }
32
32
  };
33
33
 
@@ -115,7 +115,12 @@ export function getAdjacentRoomGridIndexes(
115
115
  );
116
116
  }
117
117
 
118
- /** Helper function to get the room safe grid index for every room on the entire floor. */
118
+ /**
119
+ * Helper function to get the room safe grid index for every room on the entire floor. This includes
120
+ * off-grid rooms, such as the Devil Room.
121
+ *
122
+ * Rooms without any data are assumed to be non-existent and are not included.
123
+ */
119
124
  export function getAllRoomGridIndexes(): readonly int[] {
120
125
  const rooms = getRooms();
121
126
  return rooms.map((roomDescriptor) => roomDescriptor.SafeGridIndex);
@@ -86,9 +86,10 @@ export function getRoomDescriptorReadOnly(): Readonly<RoomDescriptor> {
86
86
  * the room descriptor. (The safe grid index is defined as the top-left 1x1 section that the room
87
87
  * overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
88
88
  * - If the current room is outside of the grid, it will return the index from the
89
- * `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases, as
89
+ * `Level.GetCurrentRoomIndex` method, since `SafeGridIndex` is bugged for these cases, as
90
90
  * demonstrated by entering a Genesis room and entering `l
91
- * print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console).
91
+ * print(Game():GetLevel():GetCurrentRoomDesc().SafeGridIndex)` into the console. (It prints -1
92
+ * instead of -12.)
92
93
  *
93
94
  * Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
94
95
  * will return the specific 1x1 quadrant that the player entered the room at. For most situations,
@@ -110,6 +110,14 @@ export function getRoomShapeWidth(roomShape: RoomShape): int {
110
110
  return ROOM_SHAPE_TO_GRID_WIDTH[roomShape];
111
111
  }
112
112
 
113
+ /**
114
+ * Helper function to determine if the provided room is equal to `RoomShape.1x2` (4) or
115
+ * `RoomShape.2x1` (6).
116
+ */
117
+ export function is2x1RoomShape(roomShape: RoomShape): boolean {
118
+ return roomShape === RoomShape.SHAPE_1x2 || roomShape === RoomShape.SHAPE_2x1;
119
+ }
120
+
113
121
  /**
114
122
  * Helper function to detect if the provided room shape is big. Specifically, this is all 1x2 rooms,
115
123
  * 2x2 rooms, and L rooms.
@@ -118,10 +126,18 @@ export function isBigRoomShape(roomShape: RoomShape): boolean {
118
126
  return BIG_ROOM_SHAPES_SET.has(roomShape);
119
127
  }
120
128
 
129
+ /**
130
+ * Helper function to determine if the provided room is equal to `RoomShape.LTL` (9),
131
+ * `RoomShape.LTR` (10), `RoomShape.LBL` (11), or `RoomShape.LBR` (12).
132
+ */
121
133
  export function isLRoomShape(roomShape: RoomShape): boolean {
122
134
  return L_ROOM_SHAPES_SET.has(roomShape);
123
135
  }
124
136
 
137
+ /**
138
+ * Helper function to determine if the provided room is equal to `RoomShape.IH` (2), `RoomShape.IV`
139
+ * (3), `RoomShape.IIV` (5), or `RoomShape.IIH` (7).
140
+ */
125
141
  export function isNarrowRoom(roomShape: RoomShape): boolean {
126
142
  return NARROW_ROOM_SHAPES_SET.has(roomShape);
127
143
  }
@@ -3,6 +3,7 @@ import type {
3
3
  BossID,
4
4
  ItemPoolType,
5
5
  MinibossID,
6
+ RoomShape,
6
7
  } from "isaac-typescript-definitions";
7
8
  import {
8
9
  AngelRoomSubType,
@@ -15,7 +16,6 @@ import {
15
16
  HomeRoomSubType,
16
17
  ProjectileFlag,
17
18
  RoomDescriptorFlag,
18
- RoomShape,
19
19
  RoomType,
20
20
  SoundEffect,
21
21
  StageID,
@@ -46,7 +46,7 @@ import {
46
46
  getRoomDescriptorReadOnly,
47
47
  getRoomGridIndex,
48
48
  } from "./roomData";
49
- import { isBigRoomShape, isLRoomShape } from "./roomShape";
49
+ import { is2x1RoomShape, isBigRoomShape, isLRoomShape } from "./roomShape";
50
50
  import { reloadRoom } from "./roomTransition";
51
51
  import { getGotoCommand } from "./stage";
52
52
  import { asNumber } from "./types";
@@ -191,7 +191,7 @@ export function getRoomTypeName(roomType: RoomType): string {
191
191
  * Helper function to get the room descriptor for every room on the level. This includes off-grid
192
192
  * rooms, such as the Devil Room.
193
193
  *
194
- * Room descriptors without any data are assumed to be non-existent and are not included.
194
+ * Room without any data are assumed to be non-existent and are not included.
195
195
  *
196
196
  * - If you want just the rooms inside of the grid, use the `getRoomsInsideGrid` helper function.
197
197
  * - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
@@ -413,8 +413,8 @@ export function inDoubleTrouble(): boolean {
413
413
 
414
414
  /** Helper function to determine if the current room index is equal to `GridRoom.GENESIS`. */
415
415
  export function inGenesisRoom(): boolean {
416
- const roomDescriptor = getRoomDescriptorReadOnly();
417
- return isGenesisRoom(roomDescriptor);
416
+ const roomGridIndex = getRoomGridIndex();
417
+ return isGenesisRoom(roomGridIndex);
418
418
  }
419
419
 
420
420
  /**
@@ -436,8 +436,8 @@ export function inLRoom(): boolean {
436
436
 
437
437
  /** Helper function to determine if the current room index is equal to `GridRoom.MEGA_SATAN`. */
438
438
  export function inMegaSatanRoom(): boolean {
439
- const roomDescriptor = getRoomDescriptorReadOnly();
440
- return isMegaSatanRoom(roomDescriptor);
439
+ const roomGridIndex = getRoomGridIndex();
440
+ return isMegaSatanRoom(roomGridIndex);
441
441
  }
442
442
 
443
443
  /**
@@ -492,8 +492,8 @@ export function inRoomType(...roomTypes: RoomType[]): boolean {
492
492
  * floor.
493
493
  */
494
494
  export function inSecretExit(): boolean {
495
- const roomDescriptor = getRoomDescriptorReadOnly();
496
- return isSecretExit(roomDescriptor);
495
+ const roomGridIndex = getRoomGridIndex();
496
+ return isSecretExit(roomGridIndex);
497
497
  }
498
498
 
499
499
  /**
@@ -505,8 +505,8 @@ export function inSecretExit(): boolean {
505
505
  * the only way to detect them is by using the grid index.
506
506
  */
507
507
  export function inSecretShop(): boolean {
508
- const roomDescriptor = getRoomDescriptorReadOnly();
509
- return isSecretShop(roomDescriptor);
508
+ const roomGridIndex = getRoomGridIndex();
509
+ return isSecretShop(roomGridIndex);
510
510
  }
511
511
 
512
512
  /**
@@ -526,10 +526,7 @@ export function inStartingRoom(): boolean {
526
526
  * Helper function to determine if the provided room is equal to `RoomShape.1x2` or `RoomShape.2x1`.
527
527
  */
528
528
  export function is2x1Room(roomData: RoomConfig): boolean {
529
- return (
530
- roomData.Shape === RoomShape.SHAPE_1x2 ||
531
- roomData.Shape === RoomShape.SHAPE_2x1
532
- );
529
+ return is2x1RoomShape(roomData.Shape);
533
530
  }
534
531
 
535
532
  /**
@@ -732,8 +729,8 @@ export function isDoubleTrouble(roomData: RoomConfig): boolean {
732
729
  /**
733
730
  * Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
734
731
  */
735
- export function isGenesisRoom(roomDescriptor: RoomDescriptor): boolean {
736
- return roomDescriptor.GridIndex === asNumber(GridRoom.GENESIS);
732
+ export function isGenesisRoom(roomGridIndex: int): boolean {
733
+ return roomGridIndex === asNumber(GridRoom.GENESIS);
737
734
  }
738
735
 
739
736
  /**
@@ -758,8 +755,8 @@ export function isLRoom(roomData: RoomConfig): boolean {
758
755
  /**
759
756
  * Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
760
757
  */
761
- export function isMegaSatanRoom(roomDescriptor: RoomDescriptor): boolean {
762
- return roomDescriptor.GridIndex === asNumber(GridRoom.MEGA_SATAN);
758
+ export function isMegaSatanRoom(roomGridIndex: int): boolean {
759
+ return roomGridIndex === asNumber(GridRoom.MEGA_SATAN);
763
760
  }
764
761
 
765
762
  /**
@@ -868,8 +865,8 @@ export function isRoomType(
868
865
  * Helper function for checking if the provided room is a secret exit that leads to a Repentance
869
866
  * floor.
870
867
  */
871
- export function isSecretExit(roomDescriptor: RoomDescriptor): boolean {
872
- return roomDescriptor.GridIndex === asNumber(GridRoom.SECRET_EXIT);
868
+ export function isSecretExit(roomGridIndex: int): boolean {
869
+ return roomGridIndex === asNumber(GridRoom.SECRET_EXIT);
873
870
  }
874
871
 
875
872
  /**
@@ -888,8 +885,8 @@ export function isSecretRoomType(roomType: RoomType): boolean {
888
885
  * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
889
886
  * the only way to detect them is by using the grid index.
890
887
  */
891
- export function isSecretShop(roomDescriptor: RoomDescriptor): boolean {
892
- return roomDescriptor.GridIndex === asNumber(GridRoom.SECRET_SHOP);
888
+ export function isSecretShop(roomGridIndex: int): boolean {
889
+ return roomGridIndex === asNumber(GridRoom.SECRET_SHOP);
893
890
  }
894
891
 
895
892
  /**