isaacscript-common 30.12.11 → 31.0.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.
@@ -9,9 +9,7 @@ local ____exports = {}
9
9
  local ADJACENT_ROOM_GRID_INDEX_DELTAS
10
10
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
11
11
  local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
12
- local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSubType
13
12
  local LevelStateFlag = ____isaac_2Dtypescript_2Ddefinitions.LevelStateFlag
14
- local MinesRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.MinesRoomSubType
15
13
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
16
14
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
17
15
  local ____cachedClasses = require("src.core.cachedClasses")
@@ -47,9 +45,9 @@ local getGridIndexDelta = ____roomShape.getGridIndexDelta
47
45
  local ____rooms = require("src.functions.rooms")
48
46
  local getRooms = ____rooms.getRooms
49
47
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
48
+ local isMineShaft = ____rooms.isMineShaft
49
+ local isMirrorRoom = ____rooms.isMirrorRoom
50
50
  local isSecretRoomType = ____rooms.isSecretRoomType
51
- local ____types = require("src.functions.types")
52
- local asNumber = ____types.asNumber
53
51
  --- Helper function to get only the adjacent room grid indexes that exist (i.e. have room data).
54
52
  --
55
53
  -- This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
@@ -89,12 +87,17 @@ function ____exports.getAdjacentRoomGridIndexes(self, roomGridIndex)
89
87
  )
90
88
  end
91
89
  --- Helper function to iterate through the possible doors for a room and see if any of them would be
92
- -- a valid spot to insert a brand new room on the floor. (Any potential new rooms cannot be
93
- -- connected to any other existing rooms on the floor.)
90
+ -- a valid spot to insert a brand new room on the floor.
94
91
  --
95
92
  -- @param roomGridIndex Optional. Default is the current room index.
93
+ -- @param ensureDeadEnd Optional. Whether to only include doors that lead to a valid dead end
94
+ -- attached to a normal room. If false, the function will include all doors
95
+ -- that would have a red door.
96
96
  -- @returns A array of tuples of `DoorSlot` and room grid index.
97
- function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
97
+ function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex, ensureDeadEnd)
98
+ if ensureDeadEnd == nil then
99
+ ensureDeadEnd = true
100
+ end
98
101
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
99
102
  if not ____exports.isRoomInsideGrid(nil, roomDescriptor.SafeGridIndex) then
100
103
  return {}
@@ -113,7 +116,7 @@ function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
113
116
  if not hasFlag(nil, roomData.Doors, doorSlotFlag) then
114
117
  goto __continue17
115
118
  end
116
- if not ____exports.isDeadEnd(nil, adjacentRoomGridIndex) then
119
+ if ensureDeadEnd and not ____exports.isDeadEnd(nil, adjacentRoomGridIndex) then
117
120
  goto __continue17
118
121
  end
119
122
  roomCandidates[#roomCandidates + 1] = {doorSlot = doorSlot, roomGridIndex = adjacentRoomGridIndex}
@@ -122,20 +125,26 @@ function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
122
125
  end
123
126
  return roomCandidates
124
127
  end
125
- --- Helper function to search through all of the rooms on the floor for a spot to insert a brand new
126
- -- room.
128
+ --- Helper function to get all of the spots on the floor to insert a brand new room.
127
129
  --
130
+ -- @param ensureDeadEnd Optional. Whether to only include spots that are a valid dead end attached
131
+ -- to a normal room. If false, the function will include all valid spots that
132
+ -- have a red door.
128
133
  -- @returns A array of tuples containing the adjacent room grid index, the `DoorSlot`, and the new
129
134
  -- room grid index.
130
- function ____exports.getNewRoomCandidatesForLevel(self)
135
+ function ____exports.getNewRoomCandidatesForLevel(self, ensureDeadEnd)
136
+ if ensureDeadEnd == nil then
137
+ ensureDeadEnd = true
138
+ end
131
139
  local rooms = getRoomsInsideGrid(nil)
132
140
  local normalRooms = __TS__ArrayFilter(
133
141
  rooms,
134
- function(____, room) return room.Data ~= nil and room.Data.Type == RoomType.DEFAULT and room.Data.Subtype ~= asNumber(nil, DownpourRoomSubType.MIRROR) and room.Data.Subtype ~= asNumber(nil, MinesRoomSubType.MINESHAFT_ENTRANCE) end
142
+ function(____, room) return room.Data ~= nil and room.Data.Type == RoomType.DEFAULT and not isMirrorRoom(nil, room.Data) and not isMineShaft(nil, room.Data) end
135
143
  )
144
+ local roomsToLookThrough = ensureDeadEnd and normalRooms or rooms
136
145
  local newRoomCandidates = {}
137
- for ____, room in ipairs(normalRooms) do
138
- local newRoomCandidatesBesideRoom = ____exports.getNewRoomCandidatesBesideRoom(nil, room.SafeGridIndex)
146
+ for ____, room in ipairs(roomsToLookThrough) do
147
+ local newRoomCandidatesBesideRoom = ____exports.getNewRoomCandidatesBesideRoom(nil, room.SafeGridIndex, ensureDeadEnd)
139
148
  for ____, ____value in ipairs(newRoomCandidatesBesideRoom) do
140
149
  local doorSlot = ____value.doorSlot
141
150
  local roomGridIndex = ____value.roomGridIndex
@@ -275,13 +284,19 @@ end
275
284
  --
276
285
  -- @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
277
286
  -- `RNG.Next` method will be called. Default is `getRandomSeed()`.
287
+ -- @param ensureDeadEnd Optional. Whether to pick a valid dead end attached to a normal room. If
288
+ -- false, the function will randomly pick from any valid location that would
289
+ -- have a red door.
278
290
  -- @returns Either a tuple of adjacent room grid index, `DoorSlot`, and new room grid index, or
279
291
  -- undefined.
280
- function ____exports.getNewRoomCandidate(self, seedOrRNG)
292
+ function ____exports.getNewRoomCandidate(self, seedOrRNG, ensureDeadEnd)
281
293
  if seedOrRNG == nil then
282
294
  seedOrRNG = getRandomSeed(nil)
283
295
  end
284
- local newRoomCandidatesForLevel = ____exports.getNewRoomCandidatesForLevel(nil)
296
+ if ensureDeadEnd == nil then
297
+ ensureDeadEnd = true
298
+ end
299
+ local newRoomCandidatesForLevel = ____exports.getNewRoomCandidatesForLevel(nil, ensureDeadEnd)
285
300
  if #newRoomCandidatesForLevel == 0 then
286
301
  return nil
287
302
  end
@@ -364,28 +379,33 @@ function ____exports.isRedKeyRoom(self, roomGridIndex)
364
379
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
365
380
  return hasFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.RED_ROOM)
366
381
  end
367
- --- Helper function to generate a new room on the floor at a valid dead end attached to a normal
368
- -- room.
382
+ --- Helper function to generate a new room on the floor.
369
383
  --
370
384
  -- Under the hood, this function uses the `Level.MakeRedRoomDoor` method to create the room.
371
385
  --
372
- -- The newly created room will have data corresponding to the game's randomly generated red room. If
373
- -- you want to modify this, use the `setRoomData` helper function.
374
- --
375
386
  -- @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
376
387
  -- `RNG.Next` method will be called. Default is `Level.GetDungeonPlacementSeed`.
377
388
  -- Note that the RNG is only used to select the random location to put the room on
378
389
  -- the floor; it does not influence the randomly chosen room contents. (That is
379
390
  -- performed by the game and can not be manipulated prior to its generation.)
391
+ -- @param ensureDeadEnd Optional. Whether to place the room at a valid dead end attached to a normal
392
+ -- room. If false, it will randomly appear at any valid location that would
393
+ -- have a red door.
394
+ -- @param customRoomData Optional. By default, the newly created room will have data corresponding
395
+ -- to the game's randomly generated red room. If you provide this function
396
+ -- with room data, it will be used to override the vanilla data.
380
397
  -- @returns The room grid index of the new room or undefined if the floor had no valid dead ends to
381
398
  -- place a room.
382
- function ____exports.newRoom(self, seedOrRNG)
399
+ function ____exports.newRoom(self, seedOrRNG, ensureDeadEnd, customRoomData)
400
+ if ensureDeadEnd == nil then
401
+ ensureDeadEnd = true
402
+ end
383
403
  local level = game:GetLevel()
384
404
  if seedOrRNG == nil then
385
405
  seedOrRNG = level:GetDungeonPlacementSeed()
386
406
  end
387
407
  local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
388
- local newRoomCandidate = ____exports.getNewRoomCandidate(nil, rng)
408
+ local newRoomCandidate = ____exports.getNewRoomCandidate(nil, rng, ensureDeadEnd)
389
409
  if newRoomCandidate == nil then
390
410
  return nil
391
411
  end
@@ -395,6 +415,9 @@ function ____exports.newRoom(self, seedOrRNG)
395
415
  level:MakeRedRoomDoor(adjacentRoomGridIndex, doorSlot)
396
416
  local roomDescriptor = getRoomDescriptor(nil, newRoomGridIndex)
397
417
  roomDescriptor.Flags = removeFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.RED_ROOM)
418
+ if customRoomData ~= nil then
419
+ roomDescriptor.Data = customRoomData
420
+ end
398
421
  local roomData = roomDescriptor.Data
399
422
  if roomData ~= nil then
400
423
  local hasFullMap = level:GetStateFlag(LevelStateFlag.FULL_MAP_EFFECT)
@@ -1 +1 @@
1
- {"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EAMV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAoBtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,eAAe,EAAE,EACnC,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAQt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E,CAAC,EACxD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,IAAI,CAgCN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAkBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,IAAI,CAqBN;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GACnC,IAAI,CAEN;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GACjC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAoB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,IAAI,CAON"}
@@ -284,13 +284,9 @@ function ____exports.logRoom()
284
284
  local roomListIndex = getRoomListIndex(nil)
285
285
  local roomData = getRoomData(nil)
286
286
  log("Logging room information:")
287
- if roomData == nil then
288
- log("- Room data is undefined.")
289
- else
290
- log("- Room stage ID: " .. tostring(roomData.StageID))
291
- log((((("- Type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype))
292
- log("- Name: " .. roomData.Name)
293
- end
287
+ log("- Room stage ID: " .. tostring(roomData.StageID))
288
+ log((((("- Type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype))
289
+ log("- Name: " .. roomData.Name)
294
290
  local roomGridIndexName = GridRoom[roomGridIndex]
295
291
  if roomGridIndexName == nil then
296
292
  log("- Grid index: " .. tostring(roomGridIndex))
@@ -4,11 +4,7 @@ import type { DoorSlot, RoomShape, RoomType, StageID } from "isaac-typescript-de
4
4
  * This corresponds to the doors that are enabled in the STB/XML file for the room.
5
5
  */
6
6
  export declare function getRoomAllowedDoors(roomGridIndex?: int): Set<DoorSlot>;
7
- /**
8
- * Helper function to get the room data for the provided room.
9
- *
10
- * @param roomGridIndex Optional. Default is the current room index.
11
- */
7
+ export declare function getRoomData(): RoomConfig;
12
8
  export declare function getRoomData(roomGridIndex?: int): RoomConfig | undefined;
13
9
  /**
14
10
  * Helper function to get the descriptor for a room.
@@ -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;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,CAGvE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,cAAc,CAQrE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,QAAQ,CAAC,cAAc,CAAC,CAGpE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,IAAI,GAAG,CAatC;AAED;;;;;;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E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,cAAc,CAQrE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,QAAQ,CAAC,cAAc,CAAC,CAGpE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,IAAI,GAAG,CAatC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,MAAM,CAGvD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,SAAS,GAAG,SAAS,CAGvE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,CAAC,CAAC,CAGhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAGvD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,QAAQ,GAAG,CAAC,CAAC,CAG9D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAGvD;AAED;;;;;;;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"}
@@ -8,7 +8,7 @@ local ____roomShape = require("src.functions.roomShape")
8
8
  local getRoomShapeBottomRightPosition = ____roomShape.getRoomShapeBottomRightPosition
9
9
  local getRoomShapeTopLeftPosition = ____roomShape.getRoomShapeTopLeftPosition
10
10
  local getRoomShapeWidth = ____roomShape.getRoomShapeWidth
11
- local isLRoom = ____roomShape.isLRoom
11
+ local isLRoomShape = ____roomShape.isLRoomShape
12
12
  --- Helper function to convert a grid position `Vector` to a world position `Vector`.
13
13
  --
14
14
  -- For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
@@ -54,13 +54,13 @@ end
54
54
  --
55
55
  -- In this context, the grid position of the top-left wall is "Vector(-1, -1)".
56
56
  function ____exports.isValidGridPosition(self, gridPosition, roomShape)
57
- local ____isLRoom_result_0
58
- if isLRoom(nil, roomShape) then
59
- ____isLRoom_result_0 = isValidGridPositionLRoom(nil, gridPosition, roomShape)
57
+ local ____isLRoomShape_result_0
58
+ if isLRoomShape(nil, roomShape) then
59
+ ____isLRoomShape_result_0 = isValidGridPositionLRoom(nil, gridPosition, roomShape)
60
60
  else
61
- ____isLRoom_result_0 = isValidGridPositionNormal(nil, gridPosition, roomShape)
61
+ ____isLRoomShape_result_0 = isValidGridPositionNormal(nil, gridPosition, roomShape)
62
62
  end
63
- return ____isLRoom_result_0
63
+ return ____isLRoomShape_result_0
64
64
  end
65
65
  --- Helper function to convert a world position `Vector` to a grid position `Vector`.
66
66
  --
@@ -58,7 +58,7 @@ 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
- export declare function isLRoom(roomShape: RoomShape): boolean;
61
+ export declare function isLRoomShape(roomShape: RoomShape): boolean;
62
62
  export declare function isNarrowRoom(roomShape: RoomShape): boolean;
63
63
  /**
64
64
  * 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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1D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAGrE"}
@@ -88,7 +88,7 @@ end
88
88
  function ____exports.getRoomShapeWidth(self, roomShape)
89
89
  return ROOM_SHAPE_TO_GRID_WIDTH[roomShape]
90
90
  end
91
- function ____exports.isLRoom(self, roomShape)
91
+ function ____exports.isLRoomShape(self, roomShape)
92
92
  return L_ROOM_SHAPES_SET:has(roomShape)
93
93
  end
94
94
  function ____exports.isNarrowRoom(self, roomShape)
@@ -21,13 +21,13 @@ local ____gridIndex = require("src.functions.gridIndex")
21
21
  local getGridIndexesBetween = ____gridIndex.getGridIndexesBetween
22
22
  local ____roomShape = require("src.functions.roomShape")
23
23
  local getRoomShapeCorners = ____roomShape.getRoomShapeCorners
24
- local isLRoom = ____roomShape.isLRoom
24
+ local isLRoomShape = ____roomShape.isLRoomShape
25
25
  local ____rooms = require("src.functions.rooms")
26
26
  local inBossRoomOf = ____rooms.inBossRoomOf
27
27
  local inHomeCloset = ____rooms.inHomeCloset
28
28
  function getVanillaWallGridIndexSetForRoomShape(self, roomShape)
29
29
  local corners = getRoomShapeCorners(nil, roomShape)
30
- local lRoom = isLRoom(nil, roomShape)
30
+ local lRoom = isLRoomShape(nil, roomShape)
31
31
  if lRoom and #corners ~= 6 then
32
32
  error(((("Failed to get the correct amount of corners for: RoomShape." .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ")")
33
33
  end
@@ -113,7 +113,7 @@ export declare function inBossRoomOf(bossID: BossID): boolean;
113
113
  /**
114
114
  * Helper function for determining whether the current room is a crawl space. Use this function over
115
115
  * comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of the
116
- * player being in a boss fight that take place in a dungeon.
116
+ * player being in a boss fight that takes place in a dungeon.
117
117
  */
118
118
  export declare function inCrawlSpace(): boolean;
119
119
  /**
@@ -133,8 +133,13 @@ export declare function inDevilsCrownTreasureRoom(): boolean;
133
133
  * This is performed by checking for the string "Double Trouble" inside of the room name. The
134
134
  * vanilla game uses this convention for every Double Trouble Boss Room. Note that this method might
135
135
  * fail for mods that add extra Double Trouble rooms but do not follow the convention.
136
+ *
137
+ * Internally, the game is coded to detect Double Trouble Boss Rooms by checking for the variant
138
+ * range of 3700 through 3850. We intentionally do not use this method since it may not work as well
139
+ * with modded rooms.
136
140
  */
137
141
  export declare function inDoubleTrouble(): boolean;
142
+ /** Helper function to determine if the current room index is equal to `GridRoom.GENESIS`. */
138
143
  export declare function inGenesisRoom(): boolean;
139
144
  /**
140
145
  * Helper function to check if the current room is either the left Home closet (behind the red door)
@@ -188,6 +193,10 @@ export declare function inSecretShop(): boolean;
188
193
  * starting room of the mirror world does not count).
189
194
  */
190
195
  export declare function inStartingRoom(): boolean;
196
+ /**
197
+ * Helper function to determine if the provided room is equal to `RoomShape.1x2` or `RoomShape.2x1`.
198
+ */
199
+ export declare function is2x1Room(roomData: RoomConfig): boolean;
191
200
  /**
192
201
  * Helper function to loop through every room on the floor and see if it has been cleared.
193
202
  *
@@ -203,11 +212,99 @@ export declare function inStartingRoom(): boolean;
203
212
  * @allowEmptyVariadic
204
213
  */
205
214
  export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[], includeSecretAndSuperSecretRoom?: boolean, includeUltraSecretRoom?: boolean): boolean;
215
+ export declare function isAngelShop(roomData: RoomConfig): boolean;
216
+ export declare function isBeastRoom(roomData: RoomConfig): boolean;
217
+ /**
218
+ * Helper function to check if the provided room is a boss room for a particular boss. This will
219
+ * only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
220
+ */
221
+ export declare function isBossRoomOf(roomData: RoomConfig, bossID: BossID): boolean;
222
+ /**
223
+ * Helper function for determining whether the provided room is a crawl space. Use this function
224
+ * over comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of
225
+ * the player being in a boss fight that takes place in a dungeon.
226
+ */
227
+ export declare function isCrawlSpace(roomData: RoomConfig): boolean;
228
+ /**
229
+ * Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
230
+ */
231
+ export declare function isDeathCertificateArea(roomData: RoomConfig): boolean;
232
+ /**
233
+ * Helper function to detect if the provided room is a Treasure Room created when entering with a
234
+ * Devil's Crown trinket.
235
+ *
236
+ * Under the hood, this checks for `RoomDescriptorFlag.DEVIL_TREASURE`.
237
+ */
238
+ export declare function isDevilsCrownTreasureRoom(roomDescriptor: RoomDescriptor): boolean;
239
+ /**
240
+ * Helper function to detect if the provided room is a Double Trouble Boss Room.
241
+ *
242
+ * This is performed by checking for the string "Double Trouble" inside of the room name. The
243
+ * vanilla game uses this convention for every Double Trouble Boss Room. Note that this method might
244
+ * fail for mods that add extra Double Trouble rooms but do not follow the convention.
245
+ *
246
+ * Internally, the game is coded to detect Double Trouble Boss Rooms by checking for the variant
247
+ * range of 3700 through 3850. We intentionally do not use this method since it may not work as well
248
+ * with modded rooms.
249
+ */
250
+ export declare function isDoubleTrouble(roomData: RoomConfig): boolean;
251
+ /**
252
+ * Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
253
+ */
254
+ export declare function isGenesisRoom(roomDescriptor: RoomDescriptor): boolean;
255
+ /**
256
+ * Helper function to check if the provided room is either the left Home closet (behind the red
257
+ * door) or the right Home closet (with one random pickup).
258
+ *
259
+ * Home closets have a unique shape that is different from any other room in the game.
260
+ */
261
+ export declare function isHomeCloset(roomData: RoomConfig): boolean;
262
+ /** Helper function to determine if the provided room is one of the four L room shapes. */
263
+ export declare function isLRoom(roomData: RoomConfig): boolean;
264
+ /**
265
+ * Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
266
+ */
267
+ export declare function isMegaSatanRoom(roomDescriptor: RoomDescriptor): boolean;
268
+ /**
269
+ * Helper function to determine if the provided room is part of the Repentance "escape sequence" in
270
+ * the Mines/Ashpit.
271
+ */
272
+ export declare function isMineShaft(roomData: RoomConfig): boolean;
273
+ /**
274
+ * Helper function to check if the provided room is a miniboss room for a particular miniboss. This
275
+ * will only work for mini-bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
276
+ */
277
+ export declare function isMinibossRoomOf(roomData: RoomConfig, minibossID: MinibossID): boolean;
278
+ /**
279
+ * Helper function to check if the provided room is a "mirror room" in Downpour or Dross. (These
280
+ * rooms are marked with a specific sub-type.)
281
+ */
282
+ export declare function isMirrorRoom(roomData: RoomConfig): boolean;
283
+ /**
284
+ * Helper function to check if the provided room matches one of the given room types.
285
+ *
286
+ * This function is variadic, which means you can pass as many room types as you want to match for.
287
+ */
288
+ export declare function isRoomType(roomData: RoomConfig, ...roomTypes: RoomType[]): boolean;
289
+ /**
290
+ * Helper function for checking if the provided room is a secret exit that leads to a Repentance
291
+ * floor.
292
+ */
293
+ export declare function isSecretExit(roomDescriptor: RoomDescriptor): boolean;
206
294
  /**
207
295
  * Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
208
296
  * Secret Room.
209
297
  */
210
298
  export declare function isSecretRoomType(roomType: RoomType): boolean;
299
+ /**
300
+ * Helper function for checking if the provided room is a secret shop (from the Member Card
301
+ * collectible).
302
+ *
303
+ * Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other
304
+ * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
305
+ * the only way to detect them is by using the grid index.
306
+ */
307
+ export declare function isSecretShop(roomDescriptor: RoomDescriptor): boolean;
211
308
  /**
212
309
  * If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
213
310
  * 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,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAyCtC;;;;GAIG;AACH,wBAAgB,UAAU,C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