UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

232 lines • 11.3 kB
import type { Direction, DoorSlotFlag, RoomShape } from "isaac-typescript-definitions"; import { DoorSlot, RoomType } from "isaac-typescript-definitions"; export declare function closeAllDoors(): void; /** * Use this instead of the `GridEntityDoor.Close` method if you want the door to immediately close * without an animation. */ export declare function closeDoorFast(door: GridEntityDoor): void; export declare function doorSlotFlagToDoorSlot(doorSlotFlag: DoorSlotFlag): DoorSlot; export declare function doorSlotFlagsToDoorSlots(doorSlotFlags: BitFlags<DoorSlotFlag>): readonly DoorSlot[]; export declare function doorSlotToDirection(doorSlot: DoorSlot): Direction; export declare function doorSlotToDoorSlotFlag(doorSlot: DoorSlot): DoorSlotFlag; /** * Helper function to convert an array of door slots or a set of door slots to the resulting bit * flag number. */ export declare function doorSlotsToDoorSlotFlags(doorSlots: readonly DoorSlot[] | ReadonlySet<DoorSlot>): BitFlags<DoorSlotFlag>; export declare function getAngelRoomDoor(): GridEntityDoor | undefined; /** * 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. */ export declare function getBlueWombDoor(): GridEntityDoor | undefined; /** * 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. */ export declare function getBossRushDoor(): GridEntityDoor | undefined; export declare function getDevilRoomDoor(): GridEntityDoor | undefined; /** * If there is both a Devil Room and an Angel Room door, this function will return door with the * lowest slot number. */ export declare function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefined; /** * 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. */ export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector>; /** * 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. */ export declare function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly<Vector>; /** * 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. */ export declare function getDoorSlotEnterPositionOffset(doorSlot: DoorSlot): Readonly<Vector>; /** Helper function to get the possible door slots that can exist for a given room shape. */ export declare function getDoorSlotsForRoomShape(roomShape: RoomShape): ReadonlySet<DoorSlot>; /** * 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. * * @allowEmptyVariadic */ export declare function getDoors(...roomTypes: readonly RoomType[]): readonly GridEntityDoor[]; /** * 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. */ export declare function getDoorsToRoomIndex(...roomGridIndex: readonly int[]): readonly GridEntityDoor[]; /** * 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. */ export declare function getMegaSatanDoor(): GridEntityDoor | undefined; export declare function getOppositeDoorSlot(doorSlot: DoorSlot): DoorSlot | undefined; /** * 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. */ export declare function getRepentanceDoor(): GridEntityDoor | undefined; /** * Helper function to get the corresponding door slot for a given room shape and grid coordinates. */ export declare function getRoomShapeDoorSlot(roomShape: RoomShape, x: int, y: int): DoorSlot | undefined; /** * Helper function to get the room grid coordinates for a specific room shape and door slot * combination. */ export declare function getRoomShapeDoorSlotCoordinates(roomShape: RoomShape, doorSlot: DoorSlot): readonly [x: int, y: int] | undefined; /** * Helper function to find unused door slots in the current room that can be used to make custom * doors. */ export declare function getUnusedDoorSlots(): readonly DoorSlot[]; /** * 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. */ export declare function getVoidDoor(): GridEntityDoor | undefined; /** * 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. */ export declare function hasDoorType(...roomTypes: readonly RoomType[]): boolean; /** * Helper function to check if the current room has one or more open door slots that can be used to * make custom doors. */ export declare function hasUnusedDoorSlot(): boolean; export declare function isAngelRoomDoor(door: GridEntityDoor): boolean; /** * 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.) */ export declare function isBlueWombDoor(door: GridEntityDoor): boolean; /** * 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.) */ export declare function isBossRushDoor(door: GridEntityDoor): boolean; export declare function isDevilRoomDoor(door: GridEntityDoor): boolean; /** Helper function to see if a door slot could exist for a given room shape. */ export declare function isDoorSlotInRoomShape(doorSlot: DoorSlot, roomShape: RoomShape): boolean; /** * 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". */ export declare function isDoorToDownpour(door: GridEntityDoor): boolean; /** * 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". */ export declare function isDoorToMausoleum(door: GridEntityDoor): boolean; /** * 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". */ export declare function isDoorToMausoleumAscent(door: GridEntityDoor): boolean; /** * 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". */ export declare function isDoorToMines(door: GridEntityDoor): boolean; /** * 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". */ export declare function isDoorToMomsHeart(door: GridEntityDoor): boolean; export declare function isHiddenSecretRoomDoor(door: GridEntityDoor): boolean; /** * 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.) */ export declare function isMegaSatanDoor(door: GridEntityDoor): boolean; /** * Helper function to check if the provided door leads to the "secret exit" off-grid room that takes * you to the Repentance floor. */ export declare function isRepentanceDoor(door: GridEntityDoor): boolean; /** * 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. */ export declare function isSecretRoomDoor(door: GridEntityDoor): boolean; /** * 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.) */ export declare function isVoidDoor(door: GridEntityDoor): boolean; /** * 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 `VisitedCount` of the room's `RoomDescription` to 0. * - Set the variant to `DoorVariant.DOOR_LOCKED`. * - Close the door. */ export declare function lockDoor(door: GridEntityDoor): void; /** * For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been * discovered yet will not be opened. */ export declare function openAllDoors(): void; /** * Use this instead of the `GridEntityDoor.Open` method if you want the door to immediately open * without an animation. */ export declare function openDoorFast(door: GridEntityDoor): void; /** * 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. * * @returns The number of doors removed. * @allowEmptyVariadic */ export declare function removeAllDoors(...roomTypes: readonly RoomType[]): int; /** Helper function to remove a single door. */ export declare function removeDoor(door: GridEntityDoor): void; /** * Helper function to remove the doors provided. * * This function is variadic, meaning that you can specify as many doors as you want to remove. */ export declare function removeDoors(...doors: readonly GridEntityDoor[]): void; //# sourceMappingURL=doors.d.ts.map