Doors
Functions
Section titled “Functions”closeAllDoors()
Section titled “closeAllDoors()”closeAllDoors():
void
Defined in: packages/isaacscript-common/src/functions/doors.ts:34
Returns
Section titled “Returns”void
closeDoorFast()
Section titled “closeDoorFast()”closeDoorFast(
door):void
Defined in: packages/isaacscript-common/src/functions/doors.ts:44
Use this instead of the GridEntityDoor.Close method if you want the door to immediately close
without an animation.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”void
doorSlotFlagsToDoorSlots()
Section titled “doorSlotFlagsToDoorSlots()”doorSlotFlagsToDoorSlots(
doorSlotFlags): readonlyDoorSlot[]
Defined in: packages/isaacscript-common/src/functions/doors.ts:51
Parameters
Section titled “Parameters”doorSlotFlags
Section titled “doorSlotFlags”BitFlags<DoorSlotFlagValue>
Returns
Section titled “Returns”readonly DoorSlot[]
doorSlotFlagToDoorSlot()
Section titled “doorSlotFlagToDoorSlot()”doorSlotFlagToDoorSlot(
doorSlotFlag):DoorSlot
Defined in: packages/isaacscript-common/src/functions/doors.ts:68
Parameters
Section titled “Parameters”doorSlotFlag
Section titled “doorSlotFlag”DoorSlotFlagValue
Returns
Section titled “Returns”DoorSlot
doorSlotsToDoorSlotFlags()
Section titled “doorSlotsToDoorSlotFlags()”doorSlotsToDoorSlotFlags(
doorSlots):BitFlags<DoorSlotFlagValue>
Defined in: packages/isaacscript-common/src/functions/doors.ts:77
Helper function to convert an array of door slots or a set of door slots to the resulting bit flag number.
Parameters
Section titled “Parameters”doorSlots
Section titled “doorSlots”readonly DoorSlot[] | ReadonlySet<DoorSlot>
Returns
Section titled “Returns”BitFlags<DoorSlotFlagValue>
doorSlotToDirection()
Section titled “doorSlotToDirection()”doorSlotToDirection(
doorSlot):Direction
Defined in: packages/isaacscript-common/src/functions/doors.ts:93
Parameters
Section titled “Parameters”doorSlot
Section titled “doorSlot”DoorSlot
Returns
Section titled “Returns”Direction
doorSlotToDoorSlotFlag()
Section titled “doorSlotToDoorSlotFlag()”doorSlotToDoorSlotFlag(
doorSlot):DoorSlotFlagValue
Defined in: packages/isaacscript-common/src/functions/doors.ts:97
Parameters
Section titled “Parameters”doorSlot
Section titled “doorSlot”DoorSlot
Returns
Section titled “Returns”DoorSlotFlagValue
getAngelRoomDoor()
Section titled “getAngelRoomDoor()”getAngelRoomDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:101
Returns
Section titled “Returns”GridEntityDoor | undefined
getBlueWombDoor()
Section titled “getBlueWombDoor()”getBlueWombDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:112
Helper function to get the door that leads to the off-grid room that contains the hole to the Blue Womb. (In vanilla, the door will only appear in the It Lives Boss Room.)
Returns undefined if the room has no Blue Womb doors.
Returns
Section titled “Returns”GridEntityDoor | undefined
getBossRushDoor()
Section titled “getBossRushDoor()”getBossRushDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:123
Helper function to get the door that leads to the Boss Rush. (In vanilla, the door will only appear in the Boss Room of the sixth floor.)
Returns undefined if the room has no Boss Rush doors.
Returns
Section titled “Returns”GridEntityDoor | undefined
getDevilRoomDoor()
Section titled “getDevilRoomDoor()”getDevilRoomDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:128
Returns
Section titled “Returns”GridEntityDoor | undefined
getDevilRoomOrAngelRoomDoor()
Section titled “getDevilRoomOrAngelRoomDoor()”getDevilRoomOrAngelRoomDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:137
If there is both a Devil Room and an Angel Room door, this function will return door with the lowest slot number.
Returns
Section titled “Returns”GridEntityDoor | undefined
getDoorEnterPosition()
Section titled “getDoorEnterPosition()”getDoorEnterPosition(
door):Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/doors.ts:151
Helper function to get the position that a player will enter a room at corresponding to a door.
When players enter a room, they do not appear exactly on the location of the door, because then they would immediately collide with the loading zone. Instead, they appear on the grid tile next to the door.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”Readonly<Vector>
getDoors()
Section titled “getDoors()”getDoors(…
roomTypes): readonlyGridEntityDoor[]
Defined in: packages/isaacscript-common/src/functions/doors.ts:164
Helper function to get all of the doors in the room. By default, it will return every door.
You can optionally specify one or more room types to return only the doors that match the specified room types.
Parameters
Section titled “Parameters”roomTypes
Section titled “roomTypes”…readonly RoomType[]
Returns
Section titled “Returns”readonly GridEntityDoor[]
Allow Empty Variadic
Section titled “Allow Empty Variadic”getDoorSlotEnterPosition()
Section titled “getDoorSlotEnterPosition()”getDoorSlotEnterPosition(
doorSlot):Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/doors.ts:204
Helper function to get the position that a player will enter a room at corresponding to a door slot.
When players enter a room, they do not appear exactly on the location of the door, because then they would immediately collide with the loading zone. Instead, they appear on the grid tile next to the door.
Parameters
Section titled “Parameters”doorSlot
Section titled “doorSlot”DoorSlot
Returns
Section titled “Returns”Readonly<Vector>
getDoorSlotEnterPositionOffset()
Section titled “getDoorSlotEnterPositionOffset()”getDoorSlotEnterPositionOffset(
doorSlot):Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/doors.ts:218
Helper function to get the offset from a door position that a player will enter a room at.
When players enter a room, they do not appear exactly on the location of the door, because then they would immediately collide with the loading zone. Instead, they appear on the grid tile next to the door.
Parameters
Section titled “Parameters”doorSlot
Section titled “doorSlot”DoorSlot
Returns
Section titled “Returns”Readonly<Vector>
getDoorSlotsForRoomShape()
Section titled “getDoorSlotsForRoomShape()”getDoorSlotsForRoomShape(
roomShape):ReadonlySet<DoorSlot>
Defined in: packages/isaacscript-common/src/functions/doors.ts:231
Helper function to get the possible door slots that can exist for a given room shape.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”ReadonlySet<DoorSlot>
getDoorsToRoomIndex()
Section titled “getDoorsToRoomIndex()”getDoorsToRoomIndex(…
roomGridIndex): readonlyGridEntityDoor[]
Defined in: packages/isaacscript-common/src/functions/doors.ts:243
Helper function to get all of the doors in the room that lead to the provided room index.
This function is variadic, meaning that you can specify N arguments to return all of the doors that match any of the N room grid indexes.
Parameters
Section titled “Parameters”roomGridIndex
Section titled “roomGridIndex”…readonly int[]
Returns
Section titled “Returns”readonly GridEntityDoor[]
getMegaSatanDoor()
Section titled “getMegaSatanDoor()”getMegaSatanDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:257
Helper function to get the door that leads to the Mega Satan Boss Room. (In vanilla, the door will only appear in the starting room of The Chest / Dark Room.)
Returns undefined if the room has no Mega Satan doors.
Returns
Section titled “Returns”GridEntityDoor | undefined
getOppositeDoorSlot()
Section titled “getOppositeDoorSlot()”getOppositeDoorSlot(
doorSlot):DoorSlot|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:262
Parameters
Section titled “Parameters”doorSlot
Section titled “doorSlot”DoorSlot
Returns
Section titled “Returns”DoorSlot | undefined
getRepentanceDoor()
Section titled “getRepentanceDoor()”getRepentanceDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:272
Helper function to get the door that leads to the “secret exit” off-grid room that takes you to the Repentance floor or to the version of Depths 2 that has Dad’s Key.
Returns undefined if the room has no Repentance doors.
Returns
Section titled “Returns”GridEntityDoor | undefined
getRoomShapeDoorSlot()
Section titled “getRoomShapeDoorSlot()”getRoomShapeDoorSlot(
roomShape,x,y):DoorSlot|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:280
Helper function to get the corresponding door slot for a given room shape and grid coordinates.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
int
int
Returns
Section titled “Returns”DoorSlot | undefined
getRoomShapeDoorSlotCoordinates()
Section titled “getRoomShapeDoorSlotCoordinates()”getRoomShapeDoorSlotCoordinates(
roomShape,doorSlot): readonly [int,int] |undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:310
Helper function to get the room grid coordinates for a specific room shape and door slot combination.
Parameters
Section titled “Parameters”roomShape
Section titled “roomShape”RoomShape
doorSlot
Section titled “doorSlot”DoorSlot
Returns
Section titled “Returns”readonly [int, int] | undefined
getUnusedDoorSlots()
Section titled “getUnusedDoorSlots()”getUnusedDoorSlots(): readonly
DoorSlot[]
Defined in: packages/isaacscript-common/src/functions/doors.ts:325
Helper function to find unused door slots in the current room that can be used to make custom doors.
Returns
Section titled “Returns”readonly DoorSlot[]
getVoidDoor()
Section titled “getVoidDoor()”getVoidDoor():
GridEntityDoor|undefined
Defined in: packages/isaacscript-common/src/functions/doors.ts:343
Helper function to get the door that leads to the off-grid room that contains the portal to The Void. (In vanilla, the door will only appear in the Hush Boss Room.)
Returns undefined if the room has no Void doors.
Returns
Section titled “Returns”GridEntityDoor | undefined
hasDoorType()
Section titled “hasDoorType()”hasDoorType(…
roomTypes):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:355
Helper function to check if the current room has one or more doors that lead to the given room type.
This function is variadic, meaning that you can supply as many door types as you want to check for. This function will return true if one or more room types match.
Parameters
Section titled “Parameters”roomTypes
Section titled “roomTypes”…readonly RoomType[]
Returns
Section titled “Returns”boolean
hasUnusedDoorSlot()
Section titled “hasUnusedDoorSlot()”hasUnusedDoorSlot():
boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:367
Helper function to check if the current room has one or more open door slots that can be used to make custom doors.
Returns
Section titled “Returns”boolean
isAngelRoomDoor()
Section titled “isAngelRoomDoor()”isAngelRoomDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:372
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isBlueWombDoor()
Section titled “isBlueWombDoor()”isBlueWombDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:381
Helper function to check if the provided door is the one that leads to the off-grid room that contains the hole to the Blue Womb. (In vanilla, the door will only appear in the It Lives Boss Room.)
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isBossRushDoor()
Section titled “isBossRushDoor()”isBossRushDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:390
Helper function to check if the provided door is the one that leads to the Boss Rush room. (In vanilla, the door will only appear in the Boss Room of the sixth floor.)
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isDevilRoomDoor()
Section titled “isDevilRoomDoor()”isDevilRoomDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:395
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isDoorSlotInRoomShape()
Section titled “isDoorSlotInRoomShape()”isDoorSlotInRoomShape(
doorSlot,roomShape):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:400
Helper function to see if a door slot could exist for a given room shape.
Parameters
Section titled “Parameters”doorSlot
Section titled “doorSlot”DoorSlot
roomShape
Section titled “roomShape”RoomShape
Returns
Section titled “Returns”boolean
isDoorToDownpour()
Section titled “isDoorToDownpour()”isDoorToDownpour(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:412
This refers to the Repentance door that spawns in a boss room after defeating the boss. You have to spend one key to open it. It has a sprite filename of “gfx/grid/door_downpour.anm2”.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isDoorToMausoleum()
Section titled “isDoorToMausoleum()”isDoorToMausoleum(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:428
This refers to the Repentance door that spawns in a boss room after defeating the boss. You have to spend two hearts to open it. It has a sprite filename of “gfx/grid/door_mausoleum.anm2”.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isDoorToMausoleumAscent()
Section titled “isDoorToMausoleumAscent()”isDoorToMausoleumAscent(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:444
This refers to the “strange door” located on the first room of Depths 2. You open it with either a Polaroid or a Negative. It has a sprite filename of “gfx/grid/door_mausoleum_alt.anm2”.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isDoorToMines()
Section titled “isDoorToMines()”isDoorToMines(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:460
This refers to the Repentance door that spawns in a boss room after defeating the boss. You have to spend two bombs to open it. It has a sprite filename of “gfx/grid/door_mines.anm2”.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isDoorToMomsHeart()
Section titled “isDoorToMomsHeart()”isDoorToMomsHeart(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:476
This refers to the Repentance door that spawns after defeating Mom. You open it with the completed knife. It has a sprite filename of “gfx/grid/door_momsheart.anm2”.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isHiddenSecretRoomDoor()
Section titled “isHiddenSecretRoomDoor()”isHiddenSecretRoomDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:488
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isMegaSatanDoor()
Section titled “isMegaSatanDoor()”isMegaSatanDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:499
Helper function to check if the provided door is the one that leads to the Mega Satan Boss Room. (In vanilla, the door will only appear in the starting room of The Chest / Dark Room.)
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isRepentanceDoor()
Section titled “isRepentanceDoor()”isRepentanceDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:508
Helper function to check if the provided door leads to the “secret exit” off-grid room that takes you to the Repentance floor.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isSecretRoomDoor()
Section titled “isSecretRoomDoor()”isSecretRoomDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:521
This refers to the hole in the wall that appears after bombing the entrance to a secret room. Note that the door still exists before it has been bombed open. It has a sprite filename of “gfx/grid/door_08_holeinwall.anm2”.
Note that since Ultra Secret Rooms do not use holes, this function will not detect an Ultra Secret Room door.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
isVoidDoor()
Section titled “isVoidDoor()”isVoidDoor(
door):boolean
Defined in: packages/isaacscript-common/src/functions/doors.ts:533
Helper function to check if the provided door is the one that leads to the off-grid room that contains the portal to The Void. (In vanilla, the door will only appear in the Hush Boss Room.)
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”boolean
lockDoor()
Section titled “lockDoor()”lockDoor(
door):void
Defined in: packages/isaacscript-common/src/functions/doors.ts:546
Helper function to reset an unlocked door back to a locked state. Doing this is non-trivial
because in addition to calling the GridEntityDoor.SetLocked method, you must also:
- Set the
VisitedCountof the room’sRoomDescriptionto 0. - Set the variant to
DoorVariant.DOOR_LOCKED. - Close the door.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”void
openAllDoors()
Section titled “openAllDoors()”openAllDoors():
void
Defined in: packages/isaacscript-common/src/functions/doors.ts:562
For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been discovered yet will not be opened.
Returns
Section titled “Returns”void
openDoorFast()
Section titled “openDoorFast()”openDoorFast(
door):void
Defined in: packages/isaacscript-common/src/functions/doors.ts:574
Use this instead of the GridEntityDoor.Open method if you want the door to immediately open
without an animation.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”void
removeAllDoors()
Section titled “removeAllDoors()”removeAllDoors(…
roomTypes):int
Defined in: packages/isaacscript-common/src/functions/doors.ts:589
Helper function to remove all of the doors in the room. By default, it will remove every door. You can optionally specify one or more room types to remove only the doors that match the specified room types.
Parameters
Section titled “Parameters”roomTypes
Section titled “roomTypes”…readonly RoomType[]
Returns
Section titled “Returns”int
The number of doors removed.
Allow Empty Variadic
Section titled “Allow Empty Variadic”removeDoor()
Section titled “removeDoor()”removeDoor(
door):void
Defined in: packages/isaacscript-common/src/functions/doors.ts:597
Helper function to remove a single door.
Parameters
Section titled “Parameters”GridEntityDoor
Returns
Section titled “Returns”void
removeDoors()
Section titled “removeDoors()”removeDoors(…
doors):void
Defined in: packages/isaacscript-common/src/functions/doors.ts:607
Helper function to remove the doors provided.
This function is variadic, meaning that you can specify as many doors as you want to remove.
Parameters
Section titled “Parameters”…readonly GridEntityDoor[]
Returns
Section titled “Returns”void
