isaacscript-common 20.11.1 → 20.11.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.d.ts CHANGED
@@ -13395,12 +13395,8 @@ declare class RunInNFrames extends Feature {
13395
13395
  */
13396
13396
  export declare function runMergeTests(): void;
13397
13397
 
13398
- /**
13399
- * Using the "luamod" console command with a mod that has custom shaders can crash the game. A
13400
- * simple fix for this is automatically applied to any upgraded mods. This method was originally
13401
- * discovered by AgentCucco.
13402
- */
13403
13398
  declare class RunNextRoom extends Feature {
13399
+ vConditionalFunc: () => boolean;
13404
13400
  private postNewRoomReordered;
13405
13401
  /**
13406
13402
  * Supply a function to run on the next `POST_NEW_ROOM` callback.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 20.11.1
3
+ isaacscript-common 20.11.3
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -38819,6 +38819,7 @@ __TS__ClassExtends(RunNextRoom, Feature)
38819
38819
  function RunNextRoom.prototype.____constructor(self)
38820
38820
  Feature.prototype.____constructor(self)
38821
38821
  self.v = {run = {queuedFunctions = {}}}
38822
+ self.vConditionalFunc = function() return false end
38822
38823
  self.postNewRoomReordered = function()
38823
38824
  for ____, func in ipairs(self.v.run.queuedFunctions) do
38824
38825
  func(nil)
@@ -39275,7 +39276,7 @@ local TRAPDOOR_OPEN_DISTANCE = 60
39275
39276
  local TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS = TRAPDOOR_OPEN_DISTANCE * 2.5
39276
39277
  local TRAPDOOR_BOSS_REACTION_FRAMES = 30
39277
39278
  local TRAPDOOR_TOUCH_DISTANCE = 16.5
39278
- ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = __TS__New(Set, {"Happy", "Sad", "Jump"})
39279
+ ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = __TS__New(Set, {"Death", "Happy", "Sad", "Jump"})
39279
39280
  local PIXELATION_TO_BLACK_FRAMES = 52
39280
39281
  local OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = 6
39281
39282
  local OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = 5
@@ -39590,7 +39591,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
39590
39591
  anm2Path = "gfx/grid/door_11_trapdoor.anm2"
39591
39592
  end
39592
39593
  if destinationName ~= nil and not self.destinationFuncMap:has(destinationName) then
39593
- error(("Failed to spawn a custom trapdoor with a destination of \"" .. destinationName) .. "\" since a destination with that name has not been registered with the \"registerCustomTrapdoor\" function.")
39594
+ error(("Failed to spawn a custom trapdoor with a destination of \"" .. destinationName) .. "\" since a destination with that name has not been registered with the \"registerCustomTrapdoorDestination\" function. (If you are trying to go to a custom stage, the custom stage library should automatically do this for you when your mod first boots.)")
39594
39595
  end
39595
39596
  if destinationStage == nil then
39596
39597
  destinationStage = self.stageHistory:getNextStageWithHistory()
@@ -42150,12 +42151,10 @@ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
42150
42151
  local Map = ____lualib.Map
42151
42152
  local __TS__New = ____lualib.__TS__New
42152
42153
  local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
42153
- local __TS__ArrayMap = ____lualib.__TS__ArrayMap
42154
42154
  local __TS__Decorate = ____lualib.__TS__Decorate
42155
42155
  local ____exports = {}
42156
42156
  local getRoomTypeMap
42157
42157
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
42158
- local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
42159
42158
  local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
42160
42159
  local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
42161
42160
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
@@ -42177,7 +42176,8 @@ local UIStreakAnimation = ____UIStreakAnimation.UIStreakAnimation
42177
42176
  local ____array = require("src.functions.array")
42178
42177
  local isArray = ____array.isArray
42179
42178
  local ____doors = require("src.functions.doors")
42180
- local doorSlotFlagsToDoorSlots = ____doors.doorSlotFlagsToDoorSlots
42179
+ local doorSlotsToDoorSlotFlags = ____doors.doorSlotsToDoorSlotFlags
42180
+ local getDoorSlotsForRoomShape = ____doors.getDoorSlotsForRoomShape
42181
42181
  local ____flag = require("src.functions.flag")
42182
42182
  local hasFlag = ____flag.hasFlag
42183
42183
  local removeFlag = ____flag.removeFlag
@@ -42409,19 +42409,16 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42409
42409
  local doorSlotFlags = room.Data.Doors
42410
42410
  local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
42411
42411
  if roomsMetadata == nil then
42412
- logError(
42413
- nil,
42414
- (((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + DoorSlotFlags ") .. tostring(doorSlotFlags)) .. " for custom stage: ") .. customStage.name
42415
- )
42416
- local header = ("For reference, a DoorSlotFlags of " .. tostring(doorSlotFlags)) .. " is equal to the following doors being enabled:\n"
42417
- local doorSlots = doorSlotFlagsToDoorSlots(nil, doorSlotFlags)
42418
- local doorSlotLines = __TS__ArrayMap(
42419
- doorSlots,
42420
- function(____, doorSlot) return ((("- DoorSlot." .. DoorSlot[doorSlot]) .. " (") .. tostring(doorSlot)) .. ")" end
42421
- )
42422
- local explanation = header .. table.concat(doorSlotLines, "\n")
42423
- logError(nil, explanation)
42424
- goto __continue26
42412
+ local allDoorSlots = getDoorSlotsForRoomShape(nil, roomShape)
42413
+ local allDoorSlotFlags = doorSlotsToDoorSlotFlags(nil, allDoorSlots)
42414
+ roomsMetadata = roomDoorSlotFlagMap:get(allDoorSlotFlags)
42415
+ if roomsMetadata == nil then
42416
+ logError(
42417
+ nil,
42418
+ (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name
42419
+ )
42420
+ goto __continue26
42421
+ end
42425
42422
  end
42426
42423
  local randomRoom
42427
42424
  if roomType == RoomType.BOSS then
@@ -1 +1 @@
1
- {"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAoChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAAwC;IAEzE,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,CAMrB;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;IAoEP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
1
+ {"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAoChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAAwC;IAEzE,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,CAMrB;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;IAoEP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
@@ -4,12 +4,10 @@ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
4
  local Map = ____lualib.Map
5
5
  local __TS__New = ____lualib.__TS__New
6
6
  local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
7
- local __TS__ArrayMap = ____lualib.__TS__ArrayMap
8
7
  local __TS__Decorate = ____lualib.__TS__Decorate
9
8
  local ____exports = {}
10
9
  local getRoomTypeMap
11
10
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
12
- local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
13
11
  local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
14
12
  local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
15
13
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
@@ -31,7 +29,8 @@ local UIStreakAnimation = ____UIStreakAnimation.UIStreakAnimation
31
29
  local ____array = require("src.functions.array")
32
30
  local isArray = ____array.isArray
33
31
  local ____doors = require("src.functions.doors")
34
- local doorSlotFlagsToDoorSlots = ____doors.doorSlotFlagsToDoorSlots
32
+ local doorSlotsToDoorSlotFlags = ____doors.doorSlotsToDoorSlotFlags
33
+ local getDoorSlotsForRoomShape = ____doors.getDoorSlotsForRoomShape
35
34
  local ____flag = require("src.functions.flag")
36
35
  local hasFlag = ____flag.hasFlag
37
36
  local removeFlag = ____flag.removeFlag
@@ -263,19 +262,16 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
263
262
  local doorSlotFlags = room.Data.Doors
264
263
  local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
265
264
  if roomsMetadata == nil then
266
- logError(
267
- nil,
268
- (((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + DoorSlotFlags ") .. tostring(doorSlotFlags)) .. " for custom stage: ") .. customStage.name
269
- )
270
- local header = ("For reference, a DoorSlotFlags of " .. tostring(doorSlotFlags)) .. " is equal to the following doors being enabled:\n"
271
- local doorSlots = doorSlotFlagsToDoorSlots(nil, doorSlotFlags)
272
- local doorSlotLines = __TS__ArrayMap(
273
- doorSlots,
274
- function(____, doorSlot) return ((("- DoorSlot." .. DoorSlot[doorSlot]) .. " (") .. tostring(doorSlot)) .. ")" end
275
- )
276
- local explanation = header .. table.concat(doorSlotLines, "\n")
277
- logError(nil, explanation)
278
- goto __continue26
265
+ local allDoorSlots = getDoorSlotsForRoomShape(nil, roomShape)
266
+ local allDoorSlotFlags = doorSlotsToDoorSlotFlags(nil, allDoorSlots)
267
+ roomsMetadata = roomDoorSlotFlagMap:get(allDoorSlotFlags)
268
+ if roomsMetadata == nil then
269
+ logError(
270
+ nil,
271
+ (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name
272
+ )
273
+ goto __continue26
274
+ end
279
275
  end
280
276
  local randomRoom
281
277
  if roomType == RoomType.BOSS then
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTrapdoors.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomTrapdoors.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAKV,SAAS,EACV,MAAM,8BAA8B,CAAC;AA4BtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA4BhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,qCAAqC;IACrC,OAAO,CAAC,kBAAkB,CAGtB;IAqBJ;;;;;OAKG;IACH,OAAO,CAAC,WAAW,CAAY;IAE/B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,YAAY,CAAe;IAmDnC,OAAO,CAAC,UAAU,CAMhB;IAEF,OAAO,CAAC,2BAA2B;IA8BnC,OAAO,CAAC,8BAA8B;IAkDtC,OAAO,CAAC,6BAA6B;IAqBrC,OAAO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APDOOR_OPEN_DISTANCE = 60
111
111
  local TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS = TRAPDOOR_OPEN_DISTANCE * 2.5
112
112
  local TRAPDOOR_BOSS_REACTION_FRAMES = 30
113
113
  local TRAPDOOR_TOUCH_DISTANCE = 16.5
114
- ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = __TS__New(Set, {"Happy", "Sad", "Jump"})
114
+ ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = __TS__New(Set, {"Death", "Happy", "Sad", "Jump"})
115
115
  local PIXELATION_TO_BLACK_FRAMES = 52
116
116
  local OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = 6
117
117
  local OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = 5
@@ -426,7 +426,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
426
426
  anm2Path = "gfx/grid/door_11_trapdoor.anm2"
427
427
  end
428
428
  if destinationName ~= nil and not self.destinationFuncMap:has(destinationName) then
429
- error(("Failed to spawn a custom trapdoor with a destination of \"" .. destinationName) .. "\" since a destination with that name has not been registered with the \"registerCustomTrapdoor\" function.")
429
+ error(("Failed to spawn a custom trapdoor with a destination of \"" .. destinationName) .. "\" since a destination with that name has not been registered with the \"registerCustomTrapdoorDestination\" function. (If you are trying to go to a custom stage, the custom stage library should automatically do this for you when your mod first boots.)")
430
430
  end
431
431
  if destinationStage == nil then
432
432
  destinationStage = self.stageHistory:getNextStageWithHistory()
@@ -1,10 +1,6 @@
1
1
  import { Feature } from "../../private/Feature";
2
- /**
3
- * Using the "luamod" console command with a mod that has custom shaders can crash the game. A
4
- * simple fix for this is automatically applied to any upgraded mods. This method was originally
5
- * discovered by AgentCucco.
6
- */
7
2
  export declare class RunNextRoom extends Feature {
3
+ vConditionalFunc: () => boolean;
8
4
  private postNewRoomReordered;
9
5
  /**
10
6
  * Supply a function to run on the next `POST_NEW_ROOM` callback.
@@ -1 +1 @@
1
- {"version":3,"file":"RunNextRoom.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/RunNextRoom.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,OAAO;IAkBtC,OAAO,CAAC,oBAAoB,CAM1B;IAEF;;;;;;;;OAQG;IAEI,WAAW,CAAC,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI;CAG3C"}
1
+ {"version":3,"file":"RunNextRoom.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/RunNextRoom.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,qBAAa,WAAY,SAAQ,OAAO;IAStB,gBAAgB,QAAO,OAAO,CAAU;IAYxD,OAAO,CAAC,oBAAoB,CAM1B;IAEF;;;;;;;;OAQG;IAEI,WAAW,CAAC,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI;CAG3C"}
@@ -11,9 +11,6 @@ local ____array = require("src.functions.array")
11
11
  local emptyArray = ____array.emptyArray
12
12
  local ____Feature = require("src.classes.private.Feature")
13
13
  local Feature = ____Feature.Feature
14
- --- Using the "luamod" console command with a mod that has custom shaders can crash the game. A
15
- -- simple fix for this is automatically applied to any upgraded mods. This method was originally
16
- -- discovered by AgentCucco.
17
14
  ____exports.RunNextRoom = __TS__Class()
18
15
  local RunNextRoom = ____exports.RunNextRoom
19
16
  RunNextRoom.name = "RunNextRoom"
@@ -21,6 +18,7 @@ __TS__ClassExtends(RunNextRoom, Feature)
21
18
  function RunNextRoom.prototype.____constructor(self)
22
19
  Feature.prototype.____constructor(self)
23
20
  self.v = {run = {queuedFunctions = {}}}
21
+ self.vConditionalFunc = function() return false end
24
22
  self.postNewRoomReordered = function()
25
23
  for ____, func in ipairs(self.v.run.queuedFunctions) do
26
24
  func(nil)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "20.11.1",
3
+ "version": "20.11.3",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  ControllerIndex,
3
- DoorSlot,
4
3
  DoorSlotFlag,
5
4
  GridEntityType,
6
5
  LevelCurse,
@@ -17,7 +16,10 @@ import { ISCFeature } from "../../../enums/ISCFeature";
17
16
  import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
18
17
  import { UIStreakAnimation } from "../../../enums/private/UIStreakAnimation";
19
18
  import { isArray } from "../../../functions/array";
20
- import { doorSlotFlagsToDoorSlots } from "../../../functions/doors";
19
+ import {
20
+ doorSlotsToDoorSlotFlags,
21
+ getDoorSlotsForRoomShape,
22
+ } from "../../../functions/doors";
21
23
  import { hasFlag, removeFlag } from "../../../functions/flag";
22
24
  import { logError } from "../../../functions/logMisc";
23
25
  import { newRNG } from "../../../functions/rng";
@@ -348,20 +350,20 @@ export class CustomStages extends Feature {
348
350
  }
349
351
 
350
352
  const doorSlotFlags = room.Data.Doors;
351
- const roomsMetadata = roomDoorSlotFlagMap.get(doorSlotFlags);
353
+ let roomsMetadata = roomDoorSlotFlagMap.get(doorSlotFlags);
352
354
  if (roomsMetadata === undefined) {
353
- logError(
354
- `Failed to find any custom rooms for RoomType.${RoomType[roomType]} (${roomType}) + RoomShape.${RoomShape[roomShape]} (${roomShape}) + DoorSlotFlags ${doorSlotFlags} for custom stage: ${customStage.name}`,
355
- );
356
-
357
- const header = `For reference, a DoorSlotFlags of ${doorSlotFlags} is equal to the following doors being enabled:\n`;
358
- const doorSlots = doorSlotFlagsToDoorSlots(doorSlotFlags);
359
- const doorSlotLines = doorSlots.map(
360
- (doorSlot) => `- DoorSlot.${DoorSlot[doorSlot]} (${doorSlot})`,
361
- );
362
- const explanation = header + doorSlotLines.join("\n");
363
- logError(explanation);
364
- continue;
355
+ // The custom stage does not have any rooms for the specific room type + room shape + door
356
+ // slot combination. As a fallback, check to see if the custom stage has one or more rooms
357
+ // for this specific room type + room shape + all doors.
358
+ const allDoorSlots = getDoorSlotsForRoomShape(roomShape);
359
+ const allDoorSlotFlags = doorSlotsToDoorSlotFlags(allDoorSlots);
360
+ roomsMetadata = roomDoorSlotFlagMap.get(allDoorSlotFlags);
361
+ if (roomsMetadata === undefined) {
362
+ logError(
363
+ `Failed to find any custom rooms for RoomType.${RoomType[roomType]} (${roomType}) + RoomShape.${RoomShape[roomShape]} (${roomShape}) + all doors enabled for custom stage: ${customStage.name}`,
364
+ );
365
+ continue;
366
+ }
365
367
  }
366
368
 
367
369
  let randomRoom: CustomStageRoomMetadata;
@@ -57,6 +57,7 @@ const TRAPDOOR_BOSS_REACTION_FRAMES = 30;
57
57
  const TRAPDOOR_TOUCH_DISTANCE = 16.5;
58
58
 
59
59
  const ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL: ReadonlySet<string> = new Set([
60
+ "Death",
60
61
  "Happy",
61
62
  "Sad",
62
63
  "Jump",
@@ -708,7 +709,7 @@ export class CustomTrapdoors extends Feature {
708
709
  !this.destinationFuncMap.has(destinationName)
709
710
  ) {
710
711
  error(
711
- `Failed to spawn a custom trapdoor with a destination of "${destinationName}" since a destination with that name has not been registered with the "registerCustomTrapdoor" function.`,
712
+ `Failed to spawn a custom trapdoor with a destination of "${destinationName}" since a destination with that name has not been registered with the "registerCustomTrapdoorDestination" function. (If you are trying to go to a custom stage, the custom stage library should automatically do this for you when your mod first boots.)`,
712
713
  );
713
714
  }
714
715
 
@@ -3,11 +3,6 @@ import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
3
3
  import { emptyArray } from "../../../functions/array";
4
4
  import { Feature } from "../../private/Feature";
5
5
 
6
- /**
7
- * Using the "luamod" console command with a mod that has custom shaders can crash the game. A
8
- * simple fix for this is automatically applied to any upgraded mods. This method was originally
9
- * discovered by AgentCucco.
10
- */
11
6
  export class RunNextRoom extends Feature {
12
7
  /** @internal */
13
8
  public override v = {
@@ -16,6 +11,9 @@ export class RunNextRoom extends Feature {
16
11
  },
17
12
  };
18
13
 
14
+ // eslint-disable-next-line class-methods-use-this
15
+ public override vConditionalFunc = (): boolean => false;
16
+
19
17
  /** @internal */
20
18
  constructor() {
21
19
  super();