Skip to content

Rooms

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.

int

void


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.

int


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.

readonly Readonly<RoomDescriptor>[]


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.

RoomType

The type of room to retrieve.

int

The room variant to retrieve. (The room variant is the “ID” of the room in Basement Renovator.)

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.

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.

Readonly<RoomConfig> | undefined


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.

ItemPoolType


getRooms(includeExtraDimensionalRooms?): readonly RoomDescriptor[]

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 getRoomsInsideGrid helper function.
  • If you want just the rooms outside of the grid, use the getRoomsOutsideGrid helper function.

boolean = false

Optional. On some floors (e.g. Downpour 2, Mines 2), extra-dimensional rooms are automatically generated. Default is false.

readonly RoomDescriptor[]


getRoomsInsideGrid(includeExtraDimensionalRooms?): readonly RoomDescriptor[]

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.

boolean = false

Optional. On some floors (e.g. Downpour 2, Mines 2), extra-dimensional rooms will be generated. Default is false.

readonly RoomDescriptor[]


getRoomsOfDimension(dimension): readonly RoomDescriptor[]

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.

Dimension

readonly RoomDescriptor[]


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.

readonly RoomDescriptor[]


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”.

RoomType

string


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.

boolean


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).

boolean


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).

boolean


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.

boolean


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.

BossID

boolean


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.

boolean


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).

boolean


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.

boolean


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.

boolean


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).

boolean


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.

boolean


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.

boolean


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.

boolean


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.

boolean


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.

boolean


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.

boolean


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.

MinibossID

boolean


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.)

boolean


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.

…readonly RoomShape[]

boolean


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.

…readonly RoomType[]

boolean


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.

boolean


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.

boolean


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).

boolean


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.

RoomConfig

boolean


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.

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.

boolean = false

Optional. Whether to include the Secret Room. Default is false.

boolean = false

Optional. Whether to include the Super Secret Room. Default is false.

boolean = false

Optional. Whether to include the Ultra Secret Room. Default is false.

boolean


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).

RoomConfig

boolean


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).

RoomConfig

boolean


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.

RoomConfig

boolean


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.

RoomConfig

BossID

boolean


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.

RoomConfig

boolean


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).

RoomConfig

boolean


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.

RoomConfig

boolean


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.

RoomDescriptor

boolean


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).

RoomConfig

boolean


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.

RoomConfig

boolean


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.

int

boolean


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.

RoomConfig

boolean


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.

RoomConfig

boolean


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.

int

boolean


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.

RoomConfig

boolean


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.

RoomConfig

MinibossID

boolean


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.)

RoomConfig

boolean


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.

RoomConfig

…readonly RoomShape[]

boolean


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.

RoomConfig

…readonly RoomType[]

boolean


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.

int

boolean


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.

RoomType

boolean


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.

int

boolean


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.

void


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.

BackdropType

void


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.

void


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.

void