isaacscript-common 21.6.1 → 21.6.3
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.
- package/dist/index.rollup.d.ts +13 -2
- package/dist/isaacscript-common.lua +19 -6
- package/dist/src/classes/features/other/CustomStages.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomStages.lua +7 -1
- package/dist/src/functions/rooms.d.ts +5 -1
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +9 -2
- package/dist/src/functions/stage.d.ts +8 -1
- package/dist/src/functions/stage.d.ts.map +1 -1
- package/dist/src/functions/stage.lua +13 -2
- package/package.json +1 -1
- package/src/classes/features/other/CustomStages.ts +2 -1
- package/src/functions/rooms.ts +10 -1
- package/src/functions/stage.ts +17 -2
package/dist/index.rollup.d.ts
CHANGED
|
@@ -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.
|
|
@@ -6102,8 +6109,12 @@ export declare function getRoomData(roomGridIndex?: int): RoomConfig | undefined
|
|
|
6102
6109
|
* is true. Set this to false if you are getting the data for many rooms
|
|
6103
6110
|
* at the same time, and then use the `teleport` helper function when
|
|
6104
6111
|
* you are finished.
|
|
6112
|
+
* @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
|
|
6113
|
+
* the `goto` command (instead of `d`). False by default. Set this
|
|
6114
|
+
* to true if you want to go to a special room of `RoomType.DEFAULT`
|
|
6115
|
+
* (1).
|
|
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, cancelRoomTransition?: boolean, useSpecialRoomsForRoomTypeDefault?: 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.
|
|
3
|
+
isaacscript-common 21.6.3
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -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
|
-
|
|
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, cancelRoomTransition, useSpecialRoomsForRoomTypeDefault)
|
|
26534
26538
|
if cancelRoomTransition == nil then
|
|
26535
26539
|
cancelRoomTransition = true
|
|
26536
26540
|
end
|
|
26537
|
-
|
|
26541
|
+
if useSpecialRoomsForRoomTypeDefault == nil then
|
|
26542
|
+
useSpecialRoomsForRoomTypeDefault = false
|
|
26543
|
+
end
|
|
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(
|
|
42832
|
+
newRoomData = getRoomDataForTypeVariant(
|
|
42833
|
+
nil,
|
|
42834
|
+
roomType,
|
|
42835
|
+
randomRoom.variant,
|
|
42836
|
+
false,
|
|
42837
|
+
true
|
|
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;
|
|
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(
|
|
293
|
+
newRoomData = getRoomDataForTypeVariant(
|
|
294
|
+
nil,
|
|
295
|
+
roomType,
|
|
296
|
+
randomRoom.variant,
|
|
297
|
+
false,
|
|
298
|
+
true
|
|
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
|
|
@@ -42,8 +42,12 @@ export declare function getReadOnlyRooms(): Array<Readonly<RoomDescriptor>>;
|
|
|
42
42
|
* is true. Set this to false if you are getting the data for many rooms
|
|
43
43
|
* at the same time, and then use the `teleport` helper function when
|
|
44
44
|
* you are finished.
|
|
45
|
+
* @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
|
|
46
|
+
* the `goto` command (instead of `d`). False by default. Set this
|
|
47
|
+
* to true if you want to go to a special room of `RoomType.DEFAULT`
|
|
48
|
+
* (1).
|
|
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, cancelRoomTransition?: boolean, useSpecialRoomsForRoomTypeDefault?: 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,aAA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rC;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"}
|
|
@@ -172,11 +172,18 @@ end
|
|
|
172
172
|
-- is true. Set this to false if you are getting the data for many rooms
|
|
173
173
|
-- at the same time, and then use the `teleport` helper function when
|
|
174
174
|
-- you are finished.
|
|
175
|
-
|
|
175
|
+
-- @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
|
|
176
|
+
-- the `goto` command (instead of `d`). False by default. Set this
|
|
177
|
+
-- to true if you want to go to a special room of `RoomType.DEFAULT`
|
|
178
|
+
-- (1).
|
|
179
|
+
function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, cancelRoomTransition, useSpecialRoomsForRoomTypeDefault)
|
|
176
180
|
if cancelRoomTransition == nil then
|
|
177
181
|
cancelRoomTransition = true
|
|
178
182
|
end
|
|
179
|
-
|
|
183
|
+
if useSpecialRoomsForRoomTypeDefault == nil then
|
|
184
|
+
useSpecialRoomsForRoomTypeDefault = false
|
|
185
|
+
end
|
|
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;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,GACpB,MAAM,CAaR;AAED
|
|
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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AgB,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
|
-
|
|
107
|
-
|
|
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.
|
package/package.json
CHANGED
|
@@ -402,7 +402,8 @@ export class CustomStages extends Feature {
|
|
|
402
402
|
newRoomData = getRoomDataForTypeVariant(
|
|
403
403
|
roomType,
|
|
404
404
|
randomRoom.variant,
|
|
405
|
-
false,
|
|
405
|
+
false, // Since we are going to multiple rooms, we cancel the transition.
|
|
406
|
+
true, // The custom stage rooms are loaded inside of the "00.special rooms.stb" file.
|
|
406
407
|
);
|
|
407
408
|
if (newRoomData === undefined) {
|
|
408
409
|
logError(
|
package/src/functions/rooms.ts
CHANGED
|
@@ -131,13 +131,22 @@ export function getReadOnlyRooms(): Array<Readonly<RoomDescriptor>> {
|
|
|
131
131
|
* is true. Set this to false if you are getting the data for many rooms
|
|
132
132
|
* at the same time, and then use the `teleport` helper function when
|
|
133
133
|
* you are finished.
|
|
134
|
+
* @param useSpecialRoomsForRoomTypeDefault Optional. Whether to use `s.default` as the prefix for
|
|
135
|
+
* the `goto` command (instead of `d`). False by default. Set this
|
|
136
|
+
* to true if you want to go to a special room of `RoomType.DEFAULT`
|
|
137
|
+
* (1).
|
|
134
138
|
*/
|
|
135
139
|
export function getRoomDataForTypeVariant(
|
|
136
140
|
roomType: RoomType,
|
|
137
141
|
roomVariant: int,
|
|
138
142
|
cancelRoomTransition = true,
|
|
143
|
+
useSpecialRoomsForRoomTypeDefault = false,
|
|
139
144
|
): Readonly<RoomConfig> | undefined {
|
|
140
|
-
const command = getGotoCommand(
|
|
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
|
|
package/src/functions/stage.ts
CHANGED
|
@@ -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(
|
|
127
|
-
|
|
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
|
|