isaacscript-common 21.6.0 → 21.6.2

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.
@@ -4964,8 +4964,15 @@ export declare function getGoldenTrinketType(trinketType: TrinketType): TrinketT
4964
4964
  /**
4965
4965
  * Helper function to get the corresponding "goto" console command that would correspond to the
4966
4966
  * provided room type and room variant.
4967
+ *
4968
+ * @param roomType The `RoomType` of the destination room.
4969
+ * @param roomVariant The variant of the destination room.
4970
+ * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
4971
+ * the `goto` command (instead of `d`). False by default. Set this
4972
+ * to true if you want to go to a special room of `RoomType.DEFAULT`
4973
+ * (1).
4967
4974
  */
4968
- export declare function getGotoCommand(roomType: RoomType, roomVariant: int): string;
4975
+ export declare function getGotoCommand(roomType: RoomType, roomVariant: int, useSpecialRoomsForRoomTypeDefault?: boolean): string;
4969
4976
 
4970
4977
  /**
4971
4978
  * Helper function to get every grid entity in the current room.
@@ -6097,13 +6104,17 @@ export declare function getRoomData(roomGridIndex?: int): RoomConfig | undefined
6097
6104
  * @param roomType The type of room to retrieve.
6098
6105
  * @param roomVariant The room variant to retrieve. (The room variant is the "ID" of the room in
6099
6106
  * Basement Renovator.)
6107
+ * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
6108
+ * the `goto` command (instead of `d`). False by default. Set this
6109
+ * to true if you want to go to a special room of `RoomType.DEFAULT`
6110
+ * (1).
6100
6111
  * @param cancelRoomTransition Optional. Whether to cancel the room transition by using the
6101
6112
  * `Game.StartRoomTransition` method to travel to the same room. Default
6102
6113
  * is true. Set this to false if you are getting the data for many rooms
6103
6114
  * at the same time, and then use the `teleport` helper function when
6104
6115
  * you are finished.
6105
6116
  */
6106
- export declare function getRoomDataForTypeVariant(roomType: RoomType, roomVariant: int, cancelRoomTransition?: boolean): Readonly<RoomConfig> | undefined;
6117
+ export declare function getRoomDataForTypeVariant(roomType: RoomType, roomVariant: int, useSpecialRoomsForRoomTypeDefault?: boolean, cancelRoomTransition?: boolean): Readonly<RoomConfig> | undefined;
6107
6118
 
6108
6119
  /**
6109
6120
  * Helper function to get the descriptor for a room.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 21.6.0
3
+ isaacscript-common 21.6.2
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -26084,7 +26084,7 @@ local ____exports = {}
26084
26084
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
26085
26085
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
26086
26086
  ____exports.ROOM_TYPE_GOTO_PREFIXES = {
26087
- [RoomType.DEFAULT] = "s.default",
26087
+ [RoomType.DEFAULT] = "d",
26088
26088
  [RoomType.SHOP] = "s.shop",
26089
26089
  [RoomType.ERROR] = "s.error",
26090
26090
  [RoomType.TREASURE] = "s.treasure",
@@ -26244,6 +26244,7 @@ local ____exports = {}
26244
26244
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
26245
26245
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
26246
26246
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
26247
+ local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
26247
26248
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
26248
26249
  local ____cachedClasses = require("src.core.cachedClasses")
26249
26250
  local game = ____cachedClasses.game
@@ -26319,8 +26320,11 @@ function ____exports.getEnglishLevelName(self, stage, stageType)
26319
26320
  local stageNames = ENGLISH_LEVEL_NAMES[stage]
26320
26321
  return stageNames[stageType]
26321
26322
  end
26322
- function ____exports.getGotoCommand(self, roomType, roomVariant)
26323
- local prefix = ROOM_TYPE_GOTO_PREFIXES[roomType]
26323
+ function ____exports.getGotoCommand(self, roomType, roomVariant, useSpecialRoomsForRoomTypeDefault)
26324
+ if useSpecialRoomsForRoomTypeDefault == nil then
26325
+ useSpecialRoomsForRoomTypeDefault = false
26326
+ end
26327
+ local prefix = roomType == RoomType.DEFAULT and useSpecialRoomsForRoomTypeDefault and "s.default" or ROOM_TYPE_GOTO_PREFIXES[roomType]
26324
26328
  return (("goto " .. prefix) .. ".") .. tostring(roomVariant)
26325
26329
  end
26326
26330
  function ____exports.getStage(self)
@@ -26530,11 +26534,14 @@ function ____exports.getNumRooms(self)
26530
26534
  local rooms = ____exports.getRoomsInsideGrid(nil)
26531
26535
  return #rooms
26532
26536
  end
26533
- function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, cancelRoomTransition)
26537
+ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, useSpecialRoomsForRoomTypeDefault, cancelRoomTransition)
26538
+ if useSpecialRoomsForRoomTypeDefault == nil then
26539
+ useSpecialRoomsForRoomTypeDefault = false
26540
+ end
26534
26541
  if cancelRoomTransition == nil then
26535
26542
  cancelRoomTransition = true
26536
26543
  end
26537
- local command = getGotoCommand(nil, roomType, roomVariant)
26544
+ local command = getGotoCommand(nil, roomType, roomVariant, useSpecialRoomsForRoomTypeDefault)
26538
26545
  Isaac.ExecuteCommand(command)
26539
26546
  local newRoomData = getRoomData(nil, GridRoom.DEBUG)
26540
26547
  if cancelRoomTransition then
@@ -42822,7 +42829,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42822
42829
  end
42823
42830
  local newRoomData = self.customStageCachedRoomData:get(randomRoom.variant)
42824
42831
  if newRoomData == nil then
42825
- newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
42832
+ newRoomData = getRoomDataForTypeVariant(
42833
+ nil,
42834
+ roomType,
42835
+ randomRoom.variant,
42836
+ true,
42837
+ false
42838
+ )
42826
42839
  if newRoomData == nil then
42827
42840
  logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name)
42828
42841
  goto __continue27
@@ -1 +1 @@
1
- {"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA0ChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAA8B;IAE/D,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,sBAAsB,CAAyB;IACvD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAe;IAqDnC,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,eAAe,CAarB;IAGF,OAAO,CAAC,UAAU,CAQhB;IAGF,OAAO,CAAC,aAAa,CAcnB;IAGF,OAAO,CAAC,eAAe,CAUrB;IAIF,OAAO,CAAC,2BAA2B,CAejC;IAGF,OAAO,CAAC,kBAAkB,CAqBxB;IAGF,OAAO,CAAC,oBAAoB,CAe1B;IAEF,gDAAgD;IAChD,OAAO,CAAC,iBAAiB;IA+FzB;;;;;;;;;;;;;;;;OAgBG;IAEI,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI;IAuFP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
1
+ {"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA0ChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAA8B;IAE/D,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,sBAAsB,CAAyB;IACvD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAe;IAqDnC,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,eAAe,CAarB;IAGF,OAAO,CAAC,UAAU,CAQhB;IAGF,OAAO,CAAC,aAAa,CAcnB;IAGF,OAAO,CAAC,eAAe,CAUrB;IAIF,OAAO,CAAC,2BAA2B,CAejC;IAGF,OAAO,CAAC,kBAAkB,CAqBxB;IAGF,OAAO,CAAC,oBAAoB,CAe1B;IAEF,gDAAgD;IAChD,OAAO,CAAC,iBAAiB;IAgGzB;;;;;;;;;;;;;;;;OAgBG;IAEI,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI;IAuFP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
@@ -290,7 +290,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
290
290
  end
291
291
  local newRoomData = self.customStageCachedRoomData:get(randomRoom.variant)
292
292
  if newRoomData == nil then
293
- newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
293
+ newRoomData = getRoomDataForTypeVariant(
294
+ nil,
295
+ roomType,
296
+ randomRoom.variant,
297
+ true,
298
+ false
299
+ )
294
300
  if newRoomData == nil then
295
301
  logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name)
296
302
  goto __continue27
@@ -37,13 +37,17 @@ export declare function getReadOnlyRooms(): Array<Readonly<RoomDescriptor>>;
37
37
  * @param roomType The type of room to retrieve.
38
38
  * @param roomVariant The room variant to retrieve. (The room variant is the "ID" of the room in
39
39
  * Basement Renovator.)
40
+ * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
41
+ * the `goto` command (instead of `d`). False by default. Set this
42
+ * to true if you want to go to a special room of `RoomType.DEFAULT`
43
+ * (1).
40
44
  * @param cancelRoomTransition Optional. Whether to cancel the room transition by using the
41
45
  * `Game.StartRoomTransition` method to travel to the same room. Default
42
46
  * is true. Set this to false if you are getting the data for many rooms
43
47
  * at the same time, and then use the `teleport` helper function when
44
48
  * you are finished.
45
49
  */
46
- export declare function getRoomDataForTypeVariant(roomType: RoomType, roomVariant: int, cancelRoomTransition?: boolean): Readonly<RoomConfig> | undefined;
50
+ export declare function getRoomDataForTypeVariant(roomType: RoomType, roomVariant: int, useSpecialRoomsForRoomTypeDefault?: boolean, cancelRoomTransition?: boolean): Readonly<RoomConfig> | undefined;
47
51
  /**
48
52
  * Helper function to get the item pool type for the current room. For example, this returns
49
53
  * `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAMT,YAAY,EAEZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAkCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EA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AgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAWhE;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAWtC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI5D;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAItC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAItC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAgBxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -167,16 +167,23 @@ end
167
167
  -- @param roomType The type of room to retrieve.
168
168
  -- @param roomVariant The room variant to retrieve. (The room variant is the "ID" of the room in
169
169
  -- Basement Renovator.)
170
+ -- @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
171
+ -- the `goto` command (instead of `d`). False by default. Set this
172
+ -- to true if you want to go to a special room of `RoomType.DEFAULT`
173
+ -- (1).
170
174
  -- @param cancelRoomTransition Optional. Whether to cancel the room transition by using the
171
175
  -- `Game.StartRoomTransition` method to travel to the same room. Default
172
176
  -- is true. Set this to false if you are getting the data for many rooms
173
177
  -- at the same time, and then use the `teleport` helper function when
174
178
  -- you are finished.
175
- function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, cancelRoomTransition)
179
+ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, useSpecialRoomsForRoomTypeDefault, cancelRoomTransition)
180
+ if useSpecialRoomsForRoomTypeDefault == nil then
181
+ useSpecialRoomsForRoomTypeDefault = false
182
+ end
176
183
  if cancelRoomTransition == nil then
177
184
  cancelRoomTransition = true
178
185
  end
179
- local command = getGotoCommand(nil, roomType, roomVariant)
186
+ local command = getGotoCommand(nil, roomType, roomVariant, useSpecialRoomsForRoomTypeDefault)
180
187
  Isaac.ExecuteCommand(command)
181
188
  local newRoomData = getRoomData(nil, GridRoom.DEBUG)
182
189
  if cancelRoomTransition then
@@ -30,8 +30,15 @@ export declare function getEnglishLevelName(stage?: LevelStage, stageType?: Stag
30
30
  /**
31
31
  * Helper function to get the corresponding "goto" console command that would correspond to the
32
32
  * provided room type and room variant.
33
+ *
34
+ * @param roomType The `RoomType` of the destination room.
35
+ * @param roomVariant The variant of the destination room.
36
+ * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
37
+ * the `goto` command (instead of `d`). False by default. Set this
38
+ * to true if you want to go to a special room of `RoomType.DEFAULT`
39
+ * (1).
33
40
  */
34
- export declare function getGotoCommand(roomType: RoomType, roomVariant: int): string;
41
+ export declare function getGotoCommand(roomType: RoomType, roomVariant: int, useSpecialRoomsForRoomTypeDefault?: boolean): string;
35
42
  /** Alias for the `Level.GetStage` method. */
36
43
  export declare function getStage(): LevelStage;
37
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAS9C;AAED;;;;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I,OAAO,CAUtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAK3C;AAED,wBAAgB,OAAO,IAAI,OAAO,CAQjC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAMrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
@@ -2,6 +2,7 @@ local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
4
4
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
5
+ local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
5
6
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
6
7
  local ____cachedClasses = require("src.core.cachedClasses")
7
8
  local game = ____cachedClasses.game
@@ -103,8 +104,18 @@ function ____exports.getEnglishLevelName(self, stage, stageType)
103
104
  end
104
105
  --- Helper function to get the corresponding "goto" console command that would correspond to the
105
106
  -- provided room type and room variant.
106
- function ____exports.getGotoCommand(self, roomType, roomVariant)
107
- local prefix = ROOM_TYPE_GOTO_PREFIXES[roomType]
107
+ --
108
+ -- @param roomType The `RoomType` of the destination room.
109
+ -- @param roomVariant The variant of the destination room.
110
+ -- @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
111
+ -- the `goto` command (instead of `d`). False by default. Set this
112
+ -- to true if you want to go to a special room of `RoomType.DEFAULT`
113
+ -- (1).
114
+ function ____exports.getGotoCommand(self, roomType, roomVariant, useSpecialRoomsForRoomTypeDefault)
115
+ if useSpecialRoomsForRoomTypeDefault == nil then
116
+ useSpecialRoomsForRoomTypeDefault = false
117
+ end
118
+ local prefix = roomType == RoomType.DEFAULT and useSpecialRoomsForRoomTypeDefault and "s.default" or ROOM_TYPE_GOTO_PREFIXES[roomType]
108
119
  return (("goto " .. prefix) .. ".") .. tostring(roomVariant)
109
120
  end
110
121
  --- Alias for the `Level.GetStage` method.
@@ -1,5 +1,5 @@
1
1
  export declare const ROOM_TYPE_GOTO_PREFIXES: {
2
- readonly 1: "s.default";
2
+ readonly 1: "d";
3
3
  readonly 2: "s.shop";
4
4
  readonly 3: "s.error";
5
5
  readonly 4: "s.treasure";
@@ -2,7 +2,7 @@ local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
4
4
  ____exports.ROOM_TYPE_GOTO_PREFIXES = {
5
- [RoomType.DEFAULT] = "s.default",
5
+ [RoomType.DEFAULT] = "d",
6
6
  [RoomType.SHOP] = "s.shop",
7
7
  [RoomType.ERROR] = "s.error",
8
8
  [RoomType.TREASURE] = "s.treasure",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "21.6.0",
3
+ "version": "21.6.2",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -402,7 +402,8 @@ export class CustomStages extends Feature {
402
402
  newRoomData = getRoomDataForTypeVariant(
403
403
  roomType,
404
404
  randomRoom.variant,
405
- false,
405
+ true, // The custom stage rooms are loaded inside of the "00.special rooms.stb" file.
406
+ false, // Since we are going to multiple rooms, we cancel the transition.
406
407
  );
407
408
  if (newRoomData === undefined) {
408
409
  logError(
@@ -126,6 +126,10 @@ export function getReadOnlyRooms(): Array<Readonly<RoomDescriptor>> {
126
126
  * @param roomType The type of room to retrieve.
127
127
  * @param roomVariant The room variant to retrieve. (The room variant is the "ID" of the room in
128
128
  * Basement Renovator.)
129
+ * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
130
+ * the `goto` command (instead of `d`). False by default. Set this
131
+ * to true if you want to go to a special room of `RoomType.DEFAULT`
132
+ * (1).
129
133
  * @param cancelRoomTransition Optional. Whether to cancel the room transition by using the
130
134
  * `Game.StartRoomTransition` method to travel to the same room. Default
131
135
  * is true. Set this to false if you are getting the data for many rooms
@@ -135,9 +139,14 @@ export function getReadOnlyRooms(): Array<Readonly<RoomDescriptor>> {
135
139
  export function getRoomDataForTypeVariant(
136
140
  roomType: RoomType,
137
141
  roomVariant: int,
142
+ useSpecialRoomsForRoomTypeDefault = false,
138
143
  cancelRoomTransition = true,
139
144
  ): Readonly<RoomConfig> | undefined {
140
- const command = getGotoCommand(roomType, roomVariant);
145
+ const command = getGotoCommand(
146
+ roomType,
147
+ roomVariant,
148
+ useSpecialRoomsForRoomTypeDefault,
149
+ );
141
150
  Isaac.ExecuteCommand(command);
142
151
  const newRoomData = getRoomData(GridRoom.DEBUG);
143
152
 
@@ -122,9 +122,24 @@ export function getEnglishLevelName(
122
122
  /**
123
123
  * Helper function to get the corresponding "goto" console command that would correspond to the
124
124
  * provided room type and room variant.
125
+ *
126
+ * @param roomType The `RoomType` of the destination room.
127
+ * @param roomVariant The variant of the destination room.
128
+ * @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
129
+ * the `goto` command (instead of `d`). False by default. Set this
130
+ * to true if you want to go to a special room of `RoomType.DEFAULT`
131
+ * (1).
125
132
  */
126
- export function getGotoCommand(roomType: RoomType, roomVariant: int): string {
127
- const prefix = ROOM_TYPE_GOTO_PREFIXES[roomType];
133
+ export function getGotoCommand(
134
+ roomType: RoomType,
135
+ roomVariant: int,
136
+ useSpecialRoomsForRoomTypeDefault = false,
137
+ ): string {
138
+ const prefix =
139
+ roomType === RoomType.DEFAULT && useSpecialRoomsForRoomTypeDefault
140
+ ? `s.default`
141
+ : ROOM_TYPE_GOTO_PREFIXES[roomType];
142
+
128
143
  return `goto ${prefix}.${roomVariant}`;
129
144
  }
130
145
 
@@ -1,7 +1,7 @@
1
1
  import { RoomType } from "isaac-typescript-definitions";
2
2
 
3
3
  export const ROOM_TYPE_GOTO_PREFIXES = {
4
- [RoomType.DEFAULT]: "s.default", // 1
4
+ [RoomType.DEFAULT]: "d", // 1
5
5
  [RoomType.SHOP]: "s.shop", // 2
6
6
  [RoomType.ERROR]: "s.error", // 3
7
7
  [RoomType.TREASURE]: "s.treasure", // 4