Rooms
Functions
Section titled “Functions”changeRoom()
Section titled “changeRoom()”changeRoom(
roomGridIndex):void
Defined in: packages/isaacscript-common/src/functions/rooms.ts:64
Helper function for quickly switching to a new room without playing a particular animation. Use
this helper function over invoking the Game.ChangeRoom method directly to ensure that you do
not forget to set the LeaveDoor field and to prevent crashing on invalid room grid indexes.
Parameters
Section titled “Parameters”roomGridIndex
Section titled “roomGridIndex”int
Returns
Section titled “Returns”void
getNumRooms()
Section titled “getNumRooms()”getNumRooms():
int
Defined in: packages/isaacscript-common/src/functions/rooms.ts:84
Helper function to get the number of rooms that are currently on the floor layout. This does not include off-grid rooms, like the Devil Room.
Returns
Section titled “Returns”int
getReadOnlyRooms()
Section titled “getReadOnlyRooms()”getReadOnlyRooms(): readonly
Readonly<RoomDescriptor>[]
Defined in: packages/isaacscript-common/src/functions/rooms.ts:100
Helper function to get a read-only copy of the room descriptor for every room on the level. This includes off-grid rooms, such as the Devil Room, and extra-dimensional rooms, if they are generated and exist.
Room descriptors without any data are assumed to be non-existent and are not included.
Under the hood, this is performed by iterating over the RoomList from the Level.GetRooms
method. This is the best way to see if off-grid rooms have been initialized, since it is possible
for mods to insert room data at non-official negative room grid indexes.
Returns
Section titled “Returns”readonly Readonly<RoomDescriptor>[]
getRoomDataForTypeVariant()
Section titled “getRoomDataForTypeVariant()”getRoomDataForTypeVariant(
roomType,roomVariant,cancelRoomTransition?,useSpecialRoomsForRoomTypeDefault?):Readonly<RoomConfig> |undefined
Defined in: packages/isaacscript-common/src/functions/rooms.ts:143
Helper function to get the room data for a specific room type and variant combination. This is
accomplished by using the “goto” console command to load the specified room into the
GridRoom.DEBUG slot.
Returns undefined if the provided room type and variant combination were not found. (A warning message will also appear on the console, since the “goto” command will fail.)
Note that the side effect of using the “goto” console command is that it will trigger a room
transition after a short delay. By default, this function cancels the incoming room transition by
using the Game.StartRoomTransition method to travel to the same room.
Parameters
Section titled “Parameters”roomType
Section titled “roomType”RoomType
The type of room to retrieve.
roomVariant
Section titled “roomVariant”int
The room variant to retrieve. (The room variant is the “ID” of the room in Basement Renovator.)
cancelRoomTransition?
Section titled “cancelRoomTransition?”boolean = true
Optional. Whether to cancel the room transition by using the
Game.StartRoomTransition method to travel to the same room. Default
is true. Set this to false if you are getting the data for many rooms
at the same time, and then use the teleport helper function when
you are finished.
useSpecialRoomsForRoomTypeDefault?
Section titled “useSpecialRoomsForRoomTypeDefault?”boolean = false
Optional. Whether to use s.default as the prefix for
the goto command (instead of d) if the room type is
RoomType.DEFAULT (1). False by default.
Returns
Section titled “Returns”Readonly<RoomConfig> | undefined
getRoomItemPoolType()
Section titled “getRoomItemPoolType()”getRoomItemPoolType():
ItemPoolType
Defined in: packages/isaacscript-common/src/functions/rooms.ts:178
Helper function to get the item pool type for the current room. For example, this returns
ItemPoolType.ItemPoolType.POOL_ANGEL if you are in an Angel Room.
This function is a wrapper around the ItemPool.GetPoolForRoom method.
Note that ItemPool.GetPoolForRoom will return -1 in RoomType.DEFAULT (1) rooms, but this
function will convert -1 to ItemPoolType.TREASURE (0) for convenience purposes (since the game
is “supposed” to use the Treasure Room pool for collectibles spawned in normal rooms). If you
need to distinguish between real Treasure Rooms and default rooms, then use the
ItemPool.GetPoolForRoom method directly.
Returns
Section titled “Returns”ItemPoolType
getRooms()
Section titled “getRooms()”getRooms(
includeExtraDimensionalRooms?): readonlyRoomDescriptor[]
Defined in: packages/isaacscript-common/src/functions/rooms.ts:203
Helper function to get the room descriptor for every room on the level. This includes off-grid rooms, such as the Devil Room.
Room without any data are assumed to be non-existent and are not included.
- If you want just the rooms inside of the grid, use the
getRoomsInsideGridhelper function. - If you want just the rooms outside of the grid, use the
getRoomsOutsideGridhelper function.
Parameters
Section titled “Parameters”includeExtraDimensionalRooms?
Section titled “includeExtraDimensionalRooms?”boolean = false
Optional. On some floors (e.g. Downpour 2, Mines 2), extra-dimensional rooms are automatically generated. Default is false.
Returns
Section titled “Returns”readonly RoomDescriptor[]
getRoomsInsideGrid()
Section titled “getRoomsInsideGrid()”getRoomsInsideGrid(
includeExtraDimensionalRooms?): readonlyRoomDescriptor[]
Defined in: packages/isaacscript-common/src/functions/rooms.ts:223
Helper function to get the room descriptor for every room on the level that is on the grid. (For example, Devil Rooms are excluded.)
Room descriptors without any data are assumed to be non-existent and are not included.
Parameters
Section titled “Parameters”includeExtraDimensionalRooms?
Section titled “includeExtraDimensionalRooms?”boolean = false
Optional. On some floors (e.g. Downpour 2, Mines 2), extra-dimensional rooms will be generated. Default is false.
Returns
Section titled “Returns”readonly RoomDescriptor[]
getRoomsOfDimension()
Section titled “getRoomsOfDimension()”getRoomsOfDimension(
dimension): readonlyRoomDescriptor[]
Defined in: packages/isaacscript-common/src/functions/rooms.ts:254
Helper function to get the room descriptor for every room on the level in a specific dimension. This will not include any off-grid rooms, such as the Devil Room.
Room descriptors without any data are assumed to be non-existent and are not included.
Parameters
Section titled “Parameters”dimension
Section titled “dimension”Dimension
Returns
Section titled “Returns”readonly RoomDescriptor[]
getRoomsOutsideGrid()
Section titled “getRoomsOutsideGrid()”getRoomsOutsideGrid(): readonly
RoomDescriptor[]
Defined in: packages/isaacscript-common/src/functions/rooms.ts:279
Helper function to get the room descriptor for every room on the level that is outside of the grid (like a Devil Room).
Room descriptors without any data are assumed to be non-existent and are not included.
Returns
Section titled “Returns”readonly RoomDescriptor[]
getRoomTypeName()
Section titled “getRoomTypeName()”getRoomTypeName(
roomType):string
Defined in: packages/isaacscript-common/src/functions/rooms.ts:297
Helper function to get the proper name of a room type.
For example, RoomType.TREASURE will return “Treasure Room”.
Parameters
Section titled “Parameters”roomType
Section titled “roomType”RoomType
Returns
Section titled “Returns”string
in2x1Room()
Section titled “in2x1Room()”in2x1Room():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:305
Helper function to determine if the current room shape is equal to RoomShape.1x2 or
RoomShape.2x1.
Returns
Section titled “Returns”boolean
inAngelShop()
Section titled “inAngelShop()”inAngelShop():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:316
Helper function to check to see if the current room is an angel shop.
Under the hood, this checks the room type being equal to RoomType.ANGEL (15) and the sub-type
being equal to AngelRoomSubType.SHOP (1).
Returns
Section titled “Returns”boolean
inBeastRoom()
Section titled “inBeastRoom()”inBeastRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:329
Helper function to check to see if the current room is the Boss Room for The Beast.
This function is useful because the Room.GetBossID method returns 0 for The Beast room.
Under the hood, this checks the room type being equal to RoomType.DUNGEON (16) and the sub-type
being equal to DungeonSubType.BEAST_ROOM (4).
Returns
Section titled “Returns”boolean
inBigRoom()
Section titled “inBigRoom()”inBigRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:338
Helper function to detect if the current room is big. Specifically, this is all 1x2 rooms, 2x2 rooms, and L rooms.
Returns
Section titled “Returns”boolean
inBossRoomOf()
Section titled “inBossRoomOf()”inBossRoomOf(
bossID):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:347
Helper function to check if the current room is the Boss Room for a particular boss. This will only work for bosses that have dedicated boss rooms in the “00.special rooms.stb” file.
Parameters
Section titled “Parameters”bossID
Section titled “bossID”BossID
Returns
Section titled “Returns”boolean
inCrawlSpace()
Section titled “inCrawlSpace()”inCrawlSpace():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:357
Helper function for determining whether the current room is a crawl space. Use this function over
comparing to RoomType.DUNGEON or GridRoom.DUNGEON_IDX since there is a special case of the
player being in a boss fight that takes place in a dungeon.
Returns
Section titled “Returns”boolean
inCrawlSpaceWithBlackMarketEntrance()
Section titled “inCrawlSpaceWithBlackMarketEntrance()”inCrawlSpaceWithBlackMarketEntrance():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:366
Helper function for checking whether the current room is a crawl space with a door corresponding
to DoorSlotFlag.RIGHT_0 (1 << 2).
Returns
Section titled “Returns”boolean
inDeathCertificateArea()
Section titled “inDeathCertificateArea()”inDeathCertificateArea():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:374
Helper function to detect if the current room is one of the rooms in the Death Certificate area.
Returns
Section titled “Returns”boolean
inDevilsCrownTreasureRoom()
Section titled “inDevilsCrownTreasureRoom()”inDevilsCrownTreasureRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:385
Helper function to detect if the current room is a Treasure Room created when entering with a Devil’s Crown trinket.
Under the hood, this checks for RoomDescriptorFlag.DEVIL_TREASURE.
Returns
Section titled “Returns”boolean
inDogmaRoom()
Section titled “inDogmaRoom()”inDogmaRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:403
Helper function to check to see if the current room is the Boss Room for Dogma.
This function is useful because the Room.GetBossID method returns 0 for the Dogma room.
Note that the “living room” on the Home floor with the TV at the top of the room is not the Dogma Boss Room, as the player is teleported to a different room after watching the TV cutscene.
Under the hood, this checks the stage ID being equal to StageID.HOME (35) and the room type
being equal to RoomType.DEFAULT (1) and the variant being equal to 1000 (which is the only
Dogma Boss Room that exists in vanilla) and the sub-type being equal to
HomeRoomSubType.LIVING_ROOM (3).
Returns
Section titled “Returns”boolean
inDoubleTrouble()
Section titled “inDoubleTrouble()”inDoubleTrouble():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:419
Helper function to detect if the current room is a Double Trouble Boss Room.
This is performed by checking for the string “Double Trouble” inside of the room name. The vanilla game uses this convention for every Double Trouble Boss Room. Note that this method might fail for mods that add extra Double Trouble rooms but do not follow the convention.
Internally, the game is coded to detect Double Trouble Boss Rooms by checking for the variant range of 3700 through 3850. We intentionally do not use this method since it may not work as well with modded rooms.
Returns
Section titled “Returns”boolean
inGenesisRoom()
Section titled “inGenesisRoom()”inGenesisRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:425
Helper function to determine if the current room index is equal to GridRoom.GENESIS.
Returns
Section titled “Returns”boolean
inHomeCloset()
Section titled “inHomeCloset()”inHomeCloset():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:436
Helper function to check if the current room is either the left Home closet (behind the red door) or the right Home closet (with one random pickup).
Home closets have a unique shape that is different from any other room in the game.
Returns
Section titled “Returns”boolean
inLRoom()
Section titled “inLRoom()”inLRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:442
Helper function to determine if the current room shape is one of the four L room shapes.
Returns
Section titled “Returns”boolean
inMegaSatanRoom()
Section titled “inMegaSatanRoom()”inMegaSatanRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:448
Helper function to determine if the current room index is equal to GridRoom.MEGA_SATAN.
Returns
Section titled “Returns”boolean
inMineShaft()
Section titled “inMineShaft()”inMineShaft():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:457
Helper function to determine if the current room is part of the Repentance “escape sequence” in the Mines/Ashpit.
Returns
Section titled “Returns”boolean
inMinibossRoomOf()
Section titled “inMinibossRoomOf()”inMinibossRoomOf(
minibossID):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:466
Helper function to check if the current room is a miniboss room for a particular miniboss. This will only work for mini-bosses that have dedicated boss rooms in the “00.special rooms.stb” file.
Parameters
Section titled “Parameters”minibossID
Section titled “minibossID”MinibossID
Returns
Section titled “Returns”boolean
inMirrorRoom()
Section titled “inMirrorRoom()”inMirrorRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:475
Helper function to check if the current room is a “mirror room” in Downpour or Dross. (These rooms are marked with a specific sub-type.)
Returns
Section titled “Returns”boolean
inRoomShape()
Section titled “inRoomShape()”inRoomShape(…
roomShapes):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:485
Helper function to check if the current room shape matches one of the given room shapes.
This function is variadic, which means you can pass as many room shapes as you want to match for.
Parameters
Section titled “Parameters”roomShapes
Section titled “roomShapes”…readonly RoomShape[]
Returns
Section titled “Returns”boolean
inRoomType()
Section titled “inRoomType()”inRoomType(…
roomTypes):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:495
Helper function to check if the current room matches one of the given room types.
This function is variadic, which means you can pass as many room types as you want to match for.
Parameters
Section titled “Parameters”roomTypes
Section titled “roomTypes”…readonly RoomType[]
Returns
Section titled “Returns”boolean
inSecretExit()
Section titled “inSecretExit()”inSecretExit():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:504
Helper function for checking if the current room is a secret exit that leads to a Repentance floor.
Returns
Section titled “Returns”boolean
inSecretShop()
Section titled “inSecretShop()”inSecretShop():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:517
Helper function for checking if the current room is a secret shop (from the Member Card collectible).
Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus, the only way to detect them is by using the grid index.
Returns
Section titled “Returns”boolean
inStartingRoom()
Section titled “inStartingRoom()”inStartingRoom():
boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:527
Helper function to determine whether the current room is the starting room of a floor. It only returns true for the starting room of the primary dimension (meaning that being in the starting room of the mirror world does not count).
Returns
Section titled “Returns”boolean
is2x1Room()
Section titled “is2x1Room()”is2x1Room(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:538
Helper function to determine if the provided room is equal to RoomShape.1x2 or RoomShape.2x1.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isAllRoomsClear()
Section titled “isAllRoomsClear()”isAllRoomsClear(
onlyCheckRoomTypes?,includeSecretRoom?,includeSuperSecretRoom?,includeUltraSecretRoom?):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:557
Helper function to loop through every room on the floor and see if it has been cleared.
This function will only check rooms inside the grid and inside the current dimension.
Parameters
Section titled “Parameters”onlyCheckRoomTypes?
Section titled “onlyCheckRoomTypes?”readonly RoomType[]
Optional. A whitelist of room types. If specified, room types not in the array will be ignored. If not specified, then all rooms will be checked. Undefined by default.
includeSecretRoom?
Section titled “includeSecretRoom?”boolean = false
Optional. Whether to include the Secret Room. Default is false.
includeSuperSecretRoom?
Section titled “includeSuperSecretRoom?”boolean = false
Optional. Whether to include the Super Secret Room. Default is false.
includeUltraSecretRoom?
Section titled “includeUltraSecretRoom?”boolean = false
Optional. Whether to include the Ultra Secret Room. Default is false.
Returns
Section titled “Returns”boolean
Allow Empty Variadic
Section titled “Allow Empty Variadic”isAngelShop()
Section titled “isAngelShop()”isAngelShop(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:610
Helper function to check to see if the current room is an angel shop.
Under the hood, this checks the room type being equal to RoomType.ANGEL (15) and the sub-type
being equal to AngelRoomSubType.SHOP (1).
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isBeastRoom()
Section titled “isBeastRoom()”isBeastRoom(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:626
Helper function to check to see if the provided room is the Boss Room for The Beast.
This function is useful because the Room.GetBossID method returns 0 for The Beast room.
Under the hood, this checks the room type being equal to RoomType.DUNGEON (16) and the sub-type
being equal to DungeonSubType.BEAST_ROOM (4).
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isBigRoom()
Section titled “isBigRoom()”isBigRoom(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:638
Helper function to detect if the provided room is big. Specifically, this is all 1x2 rooms, 2x2 rooms, and L rooms.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isBossRoomOf()
Section titled “isBossRoomOf()”isBossRoomOf(
roomData,bossID):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:646
Helper function to check if the provided room is the Boss Room for a particular boss. This will only work for bosses that have dedicated boss rooms in the “00.special rooms.stb” file.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
bossID
Section titled “bossID”BossID
Returns
Section titled “Returns”boolean
isCrawlSpace()
Section titled “isCrawlSpace()”isCrawlSpace(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:660
Helper function for determining whether the provided room is a crawl space. Use this function
over comparing to RoomType.DUNGEON or GridRoom.DUNGEON_IDX since there is a special case of
the player being in a boss fight that takes place in a dungeon.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isCrawlSpaceWithBlackMarketEntrance()
Section titled “isCrawlSpaceWithBlackMarketEntrance()”isCrawlSpaceWithBlackMarketEntrance(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:672
Helper function for checking whether the provided room is a crawl space with a door corresponding
to DoorSlotFlag.RIGHT_0 (1 << 2).
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isDeathCertificateArea()
Section titled “isDeathCertificateArea()”isDeathCertificateArea(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:683
Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isDevilsCrownTreasureRoom()
Section titled “isDevilsCrownTreasureRoom()”isDevilsCrownTreasureRoom(
roomDescriptor):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:699
Helper function to detect if the provided room is a Treasure Room created when entering with a Devil’s Crown trinket.
Under the hood, this checks for RoomDescriptorFlag.DEVIL_TREASURE.
Parameters
Section titled “Parameters”roomDescriptor
Section titled “roomDescriptor”RoomDescriptor
Returns
Section titled “Returns”boolean
isDogmaRoom()
Section titled “isDogmaRoom()”isDogmaRoom(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:718
Helper function to check to see if the provided room is the Boss Room for Dogma.
This function is useful because the Room.GetBossID method returns 0 for the Dogma room.
Note that the “living room” on the Home floor with the TV at the top of the room is not the Dogma Boss Room, as the player is teleported to a different room after watching the TV cutscene.
Under the hood, this checks the stage ID being equal to StageID.HOME (35) and the room type
being equal to RoomType.DEFAULT (1) and the variant being equal to 1000 (which is the only
Dogma Boss Room that exists in vanilla) and the sub-type being equal to
HomeRoomSubType.LIVING_ROOM (3).
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isDoubleTrouble()
Section titled “isDoubleTrouble()”isDoubleTrouble(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:739
Helper function to detect if the provided room is a Double Trouble Boss Room.
This is performed by checking for the string “Double Trouble” inside of the room name. The vanilla game uses this convention for every Double Trouble Boss Room. Note that this method might fail for mods that add extra Double Trouble rooms but do not follow the convention.
Internally, the game is coded to detect Double Trouble Boss Rooms by checking for the variant range of 3700 through 3850. We intentionally do not use this method since it may not work as well with modded rooms.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isGenesisRoom()
Section titled “isGenesisRoom()”isGenesisRoom(
roomGridIndex):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:748
Helper function to determine if the index of the provided room is equal to GridRoom.GENESIS.
Parameters
Section titled “Parameters”roomGridIndex
Section titled “roomGridIndex”int
Returns
Section titled “Returns”boolean
isHomeCloset()
Section titled “isHomeCloset()”isHomeCloset(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:759
Helper function to check if the provided room is either the left Home closet (behind the red door) or the right Home closet (with one random pickup).
Home closets have a unique shape that is different from any other room in the game.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isLRoom()
Section titled “isLRoom()”isLRoom(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:770
Helper function to determine if the provided room is one of the four L room shapes.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isMegaSatanRoom()
Section titled “isMegaSatanRoom()”isMegaSatanRoom(
roomGridIndex):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:777
Helper function to determine if the index of the provided room is equal to GridRoom.MEGA_SATAN.
Parameters
Section titled “Parameters”roomGridIndex
Section titled “roomGridIndex”int
Returns
Section titled “Returns”boolean
isMineShaft()
Section titled “isMineShaft()”isMineShaft(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:786
Helper function to determine if the provided room is part of the Repentance “escape sequence” in the Mines/Ashpit.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isMinibossRoomOf()
Section titled “isMinibossRoomOf()”isMinibossRoomOf(
roomData,minibossID):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:798
Helper function to check if the provided room is a miniboss room for a particular miniboss. This will only work for mini-bosses that have dedicated boss rooms in the “00.special rooms.stb” file.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
minibossID
Section titled “minibossID”MinibossID
Returns
Section titled “Returns”boolean
isMirrorRoom()
Section titled “isMirrorRoom()”isMirrorRoom(
roomData):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:814
Helper function to check if the provided room is a “mirror room” in Downpour or Dross. (These rooms are marked with a specific sub-type.)
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
Returns
Section titled “Returns”boolean
isRoomShape()
Section titled “isRoomShape()”isRoomShape(
roomData, …roomShapes):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:829
Helper function to check if the provided room matches one of the given room shapes.
This function is variadic, which means you can pass as many room shapes as you want to match for.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
roomShapes
Section titled “roomShapes”…readonly RoomShape[]
Returns
Section titled “Returns”boolean
isRoomType()
Section titled “isRoomType()”isRoomType(
roomData, …roomTypes):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:841
Helper function to check if the provided room matches one of the given room types.
This function is variadic, which means you can pass as many room types as you want to match for.
Parameters
Section titled “Parameters”roomData
Section titled “roomData”RoomConfig
roomTypes
Section titled “roomTypes”…readonly RoomType[]
Returns
Section titled “Returns”boolean
isSecretExit()
Section titled “isSecretExit()”isSecretExit(
roomGridIndex):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:852
Helper function for checking if the provided room is a secret exit that leads to a Repentance floor.
Parameters
Section titled “Parameters”roomGridIndex
Section titled “roomGridIndex”int
Returns
Section titled “Returns”boolean
isSecretRoomType()
Section titled “isSecretRoomType()”isSecretRoomType(
roomType):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:861
Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra Secret Room.
Parameters
Section titled “Parameters”roomType
Section titled “roomType”RoomType
Returns
Section titled “Returns”boolean
isSecretShop()
Section titled “isSecretShop()”isSecretShop(
roomGridIndex):boolean
Defined in: packages/isaacscript-common/src/functions/rooms.ts:873
Helper function for checking if the provided room is a secret shop (from the Member Card collectible).
Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus, the only way to detect them is by using the grid index.
Parameters
Section titled “Parameters”roomGridIndex
Section titled “roomGridIndex”int
Returns
Section titled “Returns”boolean
roomUpdateSafe()
Section titled “roomUpdateSafe()”roomUpdateSafe():
void
Defined in: packages/isaacscript-common/src/functions/rooms.ts:884
If the Room.Update method is called in a POST_NEW_ROOM callback, then some entities will
slide around (such as the player). Since those entity velocities are already at zero, setting
them to zero will have no effect. Thus, a generic solution is to record all of the entity
positions/velocities before updating the room, and then restore those positions/velocities.
Returns
Section titled “Returns”void
setBackdrop()
Section titled “setBackdrop()”setBackdrop(
backdropType):void
Defined in: packages/isaacscript-common/src/functions/rooms.ts:898
Helper function to set the backdrop (i.e. background) of the current room.
Parameters
Section titled “Parameters”backdropType
Section titled “backdropType”BackdropType
Returns
Section titled “Returns”void
setRoomCleared()
Section titled “setRoomCleared()”setRoomCleared():
void
Defined in: packages/isaacscript-common/src/functions/rooms.ts:908
Helper function to convert an uncleared room to a cleared room in the POST_NEW_ROOM callback.
This is useful because if enemies are removed in this callback, a room drop will be awarded and
the doors will start closed and then open.
Returns
Section titled “Returns”void
setRoomUncleared()
Section titled “setRoomUncleared()”setRoomUncleared():
void
Defined in: packages/isaacscript-common/src/functions/rooms.ts:944
Helper function to emulate what happens when you bomb an Angel Statue or push a Reward Plate that spawns an NPC.
Returns
Section titled “Returns”void
