isaacscript-common 6.20.0 → 6.21.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.
Files changed (106) hide show
  1. package/dist/constants.d.ts +5 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.lua +4 -0
  4. package/dist/constantsFirstLast.d.ts +2 -2
  5. package/dist/constantsFirstLast.lua +2 -2
  6. package/dist/enums/RockAltType.d.ts +12 -1
  7. package/dist/enums/RockAltType.d.ts.map +1 -1
  8. package/dist/enums/RockAltType.lua +4 -2
  9. package/dist/features/customStage/backdrop.d.ts.map +1 -1
  10. package/dist/features/customStage/backdrop.lua +3 -2
  11. package/dist/features/customStage/customStageConstants.d.ts +11 -0
  12. package/dist/features/customStage/customStageConstants.d.ts.map +1 -1
  13. package/dist/features/customStage/customStageConstants.lua +10 -0
  14. package/dist/features/customStage/customStageGridEntities.d.ts +1 -0
  15. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  16. package/dist/features/customStage/customStageGridEntities.lua +58 -23
  17. package/dist/features/customStage/exports.d.ts +6 -2
  18. package/dist/features/customStage/exports.d.ts.map +1 -1
  19. package/dist/features/customStage/exports.lua +51 -45
  20. package/dist/features/customStage/init.d.ts.map +1 -1
  21. package/dist/features/customStage/init.lua +7 -12
  22. package/dist/features/customStage/shadows.d.ts.map +1 -1
  23. package/dist/features/customStage/shadows.lua +2 -1
  24. package/dist/features/customStage/streakText.d.ts +0 -7
  25. package/dist/features/customStage/streakText.d.ts.map +1 -1
  26. package/dist/features/customStage/streakText.lua +51 -84
  27. package/dist/features/customStage/v.d.ts +13 -0
  28. package/dist/features/customStage/v.d.ts.map +1 -1
  29. package/dist/features/customStage/v.lua +6 -1
  30. package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -1
  31. package/dist/features/customTrapdoor/blackSprite.lua +1 -0
  32. package/dist/features/customTrapdoor/exports.d.ts +7 -6
  33. package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
  34. package/dist/features/customTrapdoor/exports.lua +6 -5
  35. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  36. package/dist/features/customTrapdoor/init.lua +11 -6
  37. package/dist/features/customTrapdoor/touched.lua +0 -1
  38. package/dist/features/customTrapdoor/v.d.ts +1 -1
  39. package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts.map +1 -1
  40. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
  41. package/dist/features/saveDataManager/exports.d.ts +3 -0
  42. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  43. package/dist/features/saveDataManager/exports.lua +3 -0
  44. package/dist/functions/collectibleSet.d.ts +1 -1
  45. package/dist/functions/collectibleSet.lua +1 -1
  46. package/dist/functions/doors.d.ts +10 -0
  47. package/dist/functions/doors.d.ts.map +1 -1
  48. package/dist/functions/doors.lua +6 -0
  49. package/dist/functions/levelGrid.d.ts +5 -2
  50. package/dist/functions/levelGrid.d.ts.map +1 -1
  51. package/dist/functions/levelGrid.lua +29 -6
  52. package/dist/functions/log.d.ts +1 -15
  53. package/dist/functions/log.d.ts.map +1 -1
  54. package/dist/functions/log.lua +3 -218
  55. package/dist/functions/logEntities.d.ts +16 -0
  56. package/dist/functions/logEntities.d.ts.map +1 -0
  57. package/dist/functions/logEntities.lua +220 -0
  58. package/dist/functions/rockAlt.d.ts +6 -5
  59. package/dist/functions/rockAlt.d.ts.map +1 -1
  60. package/dist/functions/rockAlt.lua +147 -18
  61. package/dist/functions/roomData.d.ts +2 -2
  62. package/dist/functions/roomData.d.ts.map +1 -1
  63. package/dist/functions/roomData.lua +2 -2
  64. package/dist/functions/roomTransition.d.ts +26 -0
  65. package/dist/functions/roomTransition.d.ts.map +1 -0
  66. package/dist/functions/roomTransition.lua +75 -0
  67. package/dist/functions/rooms.d.ts +39 -35
  68. package/dist/functions/rooms.d.ts.map +1 -1
  69. package/dist/functions/rooms.lua +97 -99
  70. package/dist/index.d.ts +1 -0
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.lua +8 -0
  73. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +1 -1
  74. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -1
  75. package/dist/objects/backdropTypeToRockAltType.lua +3 -3
  76. package/package.json +2 -2
  77. package/src/constants.ts +8 -0
  78. package/src/constantsFirstLast.ts +2 -2
  79. package/src/enums/RockAltType.ts +14 -1
  80. package/src/features/customStage/backdrop.ts +2 -1
  81. package/src/features/customStage/customStageConstants.ts +16 -0
  82. package/src/features/customStage/customStageGridEntities.ts +47 -0
  83. package/src/features/customStage/exports.ts +56 -40
  84. package/src/features/customStage/init.ts +7 -18
  85. package/src/features/customStage/shadows.ts +2 -1
  86. package/src/features/customStage/streakText.ts +58 -95
  87. package/src/features/customStage/v.ts +17 -0
  88. package/src/features/customTrapdoor/blackSprite.ts +1 -0
  89. package/src/features/customTrapdoor/exports.ts +9 -6
  90. package/src/features/customTrapdoor/init.ts +16 -5
  91. package/src/features/customTrapdoor/touched.ts +0 -2
  92. package/src/features/customTrapdoor/v.ts +1 -1
  93. package/src/features/extraConsoleCommands/commandsSubroutines.ts +4 -1
  94. package/src/features/saveDataManager/exports.ts +3 -0
  95. package/src/functions/collectibleSet.ts +1 -1
  96. package/src/functions/doors.ts +10 -0
  97. package/src/functions/levelGrid.ts +54 -10
  98. package/src/functions/log.ts +1 -279
  99. package/src/functions/logEntities.ts +276 -0
  100. package/src/functions/rockAlt.ts +147 -19
  101. package/src/functions/roomData.ts +3 -3
  102. package/src/functions/roomTransition.ts +78 -0
  103. package/src/functions/rooms.ts +107 -107
  104. package/src/index.ts +1 -0
  105. package/src/interfaces/private/CustomTrapdoorDescription.ts +3 -1
  106. package/src/objects/backdropTypeToRockAltType.ts +3 -3
@@ -1,4 +1,9 @@
1
1
  import { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
2
+ export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
3
+ readonly __bitFlagBrand: symbol;
4
+ } & {
5
+ readonly __displayFlagBrand: symbol;
6
+ }>;
2
7
  /**
3
8
  * The distance of the laser when Azazel does not have any range up items yet. For more info, see
4
9
  * the documentation for the `getAzazelBrimstoneDistance` function.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAItC;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,oGAAoG;AACpG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,iBACrB,CAAC;AAExB,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,6DAA6D;AAC7D,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,eAAO,MAAM,wBAAwB,QAA6B,CAAC;AAEnE,yFAAyF;AACzF,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAM,CAAC;AAElC,yCAAyC;AACzC,eAAO,MAAM,uCAAuC,QAAmB,CAAC;AAExE,iCAAiC;AACjC,eAAO,MAAM,sCAAsC,QAAmB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,gCAAgC,QAAmB,CAAC;AAEjE,+EAA+E;AAC/E,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD,eAAO,MAAM,cAAc,QAA+B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAyB,CAAC;AAExD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAQ,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAsB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGf,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAKtC,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,oGAAoG;AACpG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,iBACrB,CAAC;AAExB,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,6DAA6D;AAC7D,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,eAAO,MAAM,wBAAwB,QAA6B,CAAC;AAEnE,yFAAyF;AACzF,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAM,CAAC;AAElC,yCAAyC;AACzC,eAAO,MAAM,uCAAuC,QAAmB,CAAC;AAExE,iCAAiC;AACjC,eAAO,MAAM,sCAAsC,QAAmB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,gCAAgC,QAAmB,CAAC;AAEjE,+EAA+E;AAC/E,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD,eAAO,MAAM,cAAc,QAA+B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAyB,CAAC;AAExD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAQ,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAsB,CAAC"}
@@ -1,12 +1,16 @@
1
1
  local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
4
+ local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
4
5
  local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
5
6
  local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
6
7
  local ____constantsFirstLast = require("constantsFirstLast")
7
8
  local NUM_NORMAL_PILL_COLORS = ____constantsFirstLast.NUM_NORMAL_PILL_COLORS
8
9
  local ____enums = require("functions.enums")
9
10
  local getEnumLength = ____enums.getEnumLength
11
+ local ____flag = require("functions.flag")
12
+ local addFlag = ____flag.addFlag
13
+ ____exports.ALL_DISPLAY_FLAGS = addFlag(nil, DisplayFlag.VISIBLE, DisplayFlag.SHADOW, DisplayFlag.SHOW_ICON)
10
14
  --- The distance of the laser when Azazel does not have any range up items yet. For more info, see
11
15
  -- the documentation for the `getAzazelBrimstoneDistance` function.
12
16
  ____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
@@ -4,8 +4,8 @@ export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
4
4
  /**
5
5
  * Will change depending on how many modded collectibles there are.
6
6
  *
7
- * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles. We
8
- * subtract one to account for `CollectibleType.NULL`.)
7
+ * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
8
+ * 666. We subtract one to account for `CollectibleType.NULL`.)
9
9
  */
10
10
  export declare const LAST_COLLECTIBLE_TYPE: CollectibleType;
11
11
  /**
@@ -17,8 +17,8 @@ local getLastEnumValue = ____enums.getLastEnumValue
17
17
  ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
18
18
  --- Will change depending on how many modded collectibles there are.
19
19
  --
20
- -- Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles. We
21
- -- subtract one to account for `CollectibleType.NULL`.)
20
+ -- Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
21
+ -- 666. We subtract one to account for `CollectibleType.NULL`.)
22
22
  ____exports.LAST_COLLECTIBLE_TYPE = itemConfig:GetCollectibles().Size - 1
23
23
  --- Calculated from the `CollectibleType` enum.
24
24
  --
@@ -3,6 +3,17 @@ export declare enum RockAltType {
3
3
  MUSHROOM = 1,
4
4
  SKULL = 2,
5
5
  POLYP = 3,
6
- BUCKET = 4
6
+ /**
7
+ * Destroying buckets in Downpour give different outcomes than in Dross.
8
+ *
9
+ * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets
10
+ */
11
+ BUCKET_DOWNPOUR = 4,
12
+ /**
13
+ * Destroying buckets in Dross give different outcomes than in Downpour.
14
+ *
15
+ * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets
16
+ */
17
+ BUCKET_DROSS = 5
7
18
  }
8
19
  //# sourceMappingURL=RockAltType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RockAltType.d.ts","sourceRoot":"","sources":["../../src/enums/RockAltType.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,GAAG,IAAA;IACH,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,KAAK,IAAA;IACL,MAAM,IAAA;CACP"}
1
+ {"version":3,"file":"RockAltType.d.ts","sourceRoot":"","sources":["../../src/enums/RockAltType.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,GAAG,IAAA;IACH,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,KAAK,IAAA;IAEL;;;;OAIG;IACH,eAAe,IAAA;IAEf;;;;OAIG;IACH,YAAY,IAAA;CACb"}
@@ -8,6 +8,8 @@ ____exports.RockAltType.SKULL = 2
8
8
  ____exports.RockAltType[____exports.RockAltType.SKULL] = "SKULL"
9
9
  ____exports.RockAltType.POLYP = 3
10
10
  ____exports.RockAltType[____exports.RockAltType.POLYP] = "POLYP"
11
- ____exports.RockAltType.BUCKET = 4
12
- ____exports.RockAltType[____exports.RockAltType.BUCKET] = "BUCKET"
11
+ ____exports.RockAltType.BUCKET_DOWNPOUR = 4
12
+ ____exports.RockAltType[____exports.RockAltType.BUCKET_DOWNPOUR] = "BUCKET_DOWNPOUR"
13
+ ____exports.RockAltType.BUCKET_DROSS = 5
14
+ ____exports.RockAltType[____exports.RockAltType.BUCKET_DROSS] = "BUCKET_DROSS"
13
15
  return ____exports
@@ -1 +1 @@
1
- {"version":3,"file":"backdrop.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/backdrop.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA0E3D,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAc1D"}
1
+ {"version":3,"file":"backdrop.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/backdrop.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA2E3D,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAc1D"}
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
2
2
  local Set = ____lualib.Set
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
- local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind, DEFAULT_BACKDROP, ROOM_SHAPE_WALL_ANM2_LAYERS, ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS, WALL_OFFSET, L_FLOOR_ANM2_LAYERS, N_FLOOR_ANM2_LAYERS, BACKDROP_EFFECT_VARIANT
5
+ local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind, DEFAULT_BACKDROP, ROOM_SHAPE_WALL_ANM2_LAYERS, ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS, WALL_OFFSET, L_FLOOR_ANM2_LAYERS, N_FLOOR_ANM2_LAYERS, BACKDROP_EFFECT_VARIANT, BACKDROP_EFFECT_SUBTYPE
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
7
  local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
8
8
  local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
@@ -39,7 +39,7 @@ function spawnWallEntity(self, customStage, rng, isExtraWall)
39
39
  local wallEffect = spawnEffectWithSeed(
40
40
  nil,
41
41
  BACKDROP_EFFECT_VARIANT,
42
- 0,
42
+ BACKDROP_EFFECT_SUBTYPE,
43
43
  VectorZero,
44
44
  1
45
45
  )
@@ -177,6 +177,7 @@ WALL_OFFSET = Vector(-80, -80)
177
177
  L_FLOOR_ANM2_LAYERS = {16, 17}
178
178
  N_FLOOR_ANM2_LAYERS = {18, 19}
179
179
  BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER
180
+ BACKDROP_EFFECT_SUBTYPE = 101
180
181
  local BACKDROP_ROOM_TYPE_SET = __TS__New(Set, {RoomType.DEFAULT, RoomType.BOSS, RoomType.MINI_BOSS})
181
182
  function ____exports.setBackdrop(self, customStage)
182
183
  local room = game:GetRoom()
@@ -1,2 +1,13 @@
1
+ /// <reference types="isaac-typescript-definitions" />
1
2
  export declare const ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = "gfx/isaacscript-custom-stage";
3
+ /** Corresponds to "ui_streak.anm2". */
4
+ export declare enum UIStreakAnimation {
5
+ NONE = 0,
6
+ TEXT = 1,
7
+ TEXT_STAY = 2
8
+ }
9
+ /** Corresponds to "ui_streak.anm2". */
10
+ export declare const UI_STREAK_ANIMATION_END_FRAMES: {
11
+ readonly [key in UIStreakAnimation]: int;
12
+ };
2
13
  //# sourceMappingURL=customStageConstants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customStageConstants.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,iCAAiC,CAAC"}
1
+ {"version":3,"file":"customStageConstants.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageConstants.ts"],"names":[],"mappings":";AAAA,eAAO,MAAM,iCAAiC,iCAAiC,CAAC;AAEhF,uCAAuC;AACvC,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,SAAS,IAAA;CACV;AAED,uCAAuC;AACvC,eAAO,MAAM,8BAA8B,EAAE;IAC3C,QAAQ,EAAE,GAAG,IAAI,iBAAiB,GAAG,GAAG;CAKhC,CAAC"}
@@ -1,3 +1,13 @@
1
1
  local ____exports = {}
2
2
  ____exports.ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = "gfx/isaacscript-custom-stage"
3
+ --- Corresponds to "ui_streak.anm2".
4
+ ____exports.UIStreakAnimation = {}
5
+ ____exports.UIStreakAnimation.NONE = 0
6
+ ____exports.UIStreakAnimation[____exports.UIStreakAnimation.NONE] = "NONE"
7
+ ____exports.UIStreakAnimation.TEXT = 1
8
+ ____exports.UIStreakAnimation[____exports.UIStreakAnimation.TEXT] = "TEXT"
9
+ ____exports.UIStreakAnimation.TEXT_STAY = 2
10
+ ____exports.UIStreakAnimation[____exports.UIStreakAnimation.TEXT_STAY] = "TEXT_STAY"
11
+ --- Corresponds to "ui_streak.anm2".
12
+ ____exports.UI_STREAK_ANIMATION_END_FRAMES = {[____exports.UIStreakAnimation.NONE] = 0, [____exports.UIStreakAnimation.TEXT] = 69, [____exports.UIStreakAnimation.TEXT_STAY] = 1}
3
13
  return ____exports
@@ -8,6 +8,7 @@ export declare function setCustomRockGraphics(customStage: CustomStage, gridEnti
8
8
  export declare function setCustomPitGraphics(customStage: CustomStage, gridEntity: GridEntity): void;
9
9
  /** For GridEntityType.DOOR (16) */
10
10
  export declare function setCustomDoorGraphics(customStage: CustomStage, gridEntity: GridEntity): void;
11
+ export declare function convertVanillaTrapdoors(customStage: CustomStage, gridEntity: GridEntity): void;
11
12
  /**
12
13
  * The rewards are based on the ones from the wiki:
13
14
  * https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Urns
@@ -1 +1 @@
1
- {"version":3,"file":"customStageGridEntities.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageGridEntities.ts"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,0CAA0C;AAC1C,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAoBN;AAED,oCAAoC;AACpC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAgBN;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAaN;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAQN;AAuDD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN"}
1
+ {"version":3,"file":"customStageGridEntities.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageGridEntities.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI3D,0CAA0C;AAC1C,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAyBN;AAED,oCAAoC;AACpC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAqBN;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAkBN;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAmBN;AAuDD,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAYN;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN"}
@@ -5,6 +5,7 @@ local getNewDoorPNGPath, removeEntitiesSpawnedFromGridEntity
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
7
7
  local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
8
+ local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
8
9
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
9
10
  local ____DecorationVariant = require("enums.DecorationVariant")
10
11
  local DecorationVariant = ____DecorationVariant.DecorationVariant
@@ -12,17 +13,23 @@ local ____entities = require("functions.entities")
12
13
  local removeEntities = ____entities.removeEntities
13
14
  local ____entitiesSpecific = require("functions.entitiesSpecific")
14
15
  local getNPCs = ____entitiesSpecific.getNPCs
16
+ local ____gridEntities = require("functions.gridEntities")
17
+ local removeGridEntity = ____gridEntities.removeGridEntity
15
18
  local ____pickupsSpecific = require("functions.pickupsSpecific")
16
19
  local getCoins = ____pickupsSpecific.getCoins
17
20
  local getCollectibles = ____pickupsSpecific.getCollectibles
18
21
  local getTrinkets = ____pickupsSpecific.getTrinkets
19
22
  local ____vector = require("functions.vector")
20
23
  local vectorEquals = ____vector.vectorEquals
24
+ local ____exports = require("features.customTrapdoor.exports")
25
+ local spawnCustomTrapdoor = ____exports.spawnCustomTrapdoor
26
+ local ____v = require("features.customStage.v")
27
+ local v = ____v.default
21
28
  function getNewDoorPNGPath(self, customStage, fileName)
22
29
  repeat
23
- local ____switch16 = fileName
24
- local ____cond16 = ____switch16 == "gfx/grid/door_01_normaldoor.anm2"
25
- if ____cond16 then
30
+ local ____switch21 = fileName
31
+ local ____cond21 = ____switch21 == "gfx/grid/door_01_normaldoor.anm2"
32
+ if ____cond21 then
26
33
  do
27
34
  local ____customStage_doorPNGPaths_normal_0 = customStage.doorPNGPaths
28
35
  if ____customStage_doorPNGPaths_normal_0 ~= nil then
@@ -31,8 +38,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
31
38
  return ____customStage_doorPNGPaths_normal_0
32
39
  end
33
40
  end
34
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_02_treasureroomdoor.anm2"
35
- if ____cond16 then
41
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_02_treasureroomdoor.anm2"
42
+ if ____cond21 then
36
43
  do
37
44
  local ____customStage_doorPNGPaths_treasureRoom_2 = customStage.doorPNGPaths
38
45
  if ____customStage_doorPNGPaths_treasureRoom_2 ~= nil then
@@ -41,8 +48,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
41
48
  return ____customStage_doorPNGPaths_treasureRoom_2
42
49
  end
43
50
  end
44
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_03_ambushroomdoor.anm2"
45
- if ____cond16 then
51
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_03_ambushroomdoor.anm2"
52
+ if ____cond21 then
46
53
  do
47
54
  local ____customStage_doorPNGPaths_normalChallengeRoom_4 = customStage.doorPNGPaths
48
55
  if ____customStage_doorPNGPaths_normalChallengeRoom_4 ~= nil then
@@ -51,8 +58,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
51
58
  return ____customStage_doorPNGPaths_normalChallengeRoom_4
52
59
  end
53
60
  end
54
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_04_selfsacrificeroomdoor.anm2"
55
- if ____cond16 then
61
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_04_selfsacrificeroomdoor.anm2"
62
+ if ____cond21 then
56
63
  do
57
64
  local ____customStage_doorPNGPaths_curseRoom_6 = customStage.doorPNGPaths
58
65
  if ____customStage_doorPNGPaths_curseRoom_6 ~= nil then
@@ -61,8 +68,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
61
68
  return ____customStage_doorPNGPaths_curseRoom_6
62
69
  end
63
70
  end
64
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_05_arcaderoomdoor.anm2"
65
- if ____cond16 then
71
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_05_arcaderoomdoor.anm2"
72
+ if ____cond21 then
66
73
  do
67
74
  local ____customStage_doorPNGPaths_arcade_8 = customStage.doorPNGPaths
68
75
  if ____customStage_doorPNGPaths_arcade_8 ~= nil then
@@ -71,8 +78,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
71
78
  return ____customStage_doorPNGPaths_arcade_8
72
79
  end
73
80
  end
74
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_07_devilroomdoor.anm2"
75
- if ____cond16 then
81
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_07_devilroomdoor.anm2"
82
+ if ____cond21 then
76
83
  do
77
84
  local ____customStage_doorPNGPaths_devilRoom_10 = customStage.doorPNGPaths
78
85
  if ____customStage_doorPNGPaths_devilRoom_10 ~= nil then
@@ -81,8 +88,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
81
88
  return ____customStage_doorPNGPaths_devilRoom_10
82
89
  end
83
90
  end
84
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_07_holyroomdoor.anm2"
85
- if ____cond16 then
91
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_07_holyroomdoor.anm2"
92
+ if ____cond21 then
86
93
  do
87
94
  local ____customStage_doorPNGPaths_angelRoom_12 = customStage.doorPNGPaths
88
95
  if ____customStage_doorPNGPaths_angelRoom_12 ~= nil then
@@ -91,8 +98,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
91
98
  return ____customStage_doorPNGPaths_angelRoom_12
92
99
  end
93
100
  end
94
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_08_holeinwall.anm2"
95
- if ____cond16 then
101
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_08_holeinwall.anm2"
102
+ if ____cond21 then
96
103
  do
97
104
  local ____customStage_doorPNGPaths_secretRoom_14 = customStage.doorPNGPaths
98
105
  if ____customStage_doorPNGPaths_secretRoom_14 ~= nil then
@@ -101,8 +108,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
101
108
  return ____customStage_doorPNGPaths_secretRoom_14
102
109
  end
103
110
  end
104
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_09_bossambushroomdoor.anm2"
105
- if ____cond16 then
111
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_09_bossambushroomdoor.anm2"
112
+ if ____cond21 then
106
113
  do
107
114
  local ____customStage_doorPNGPaths_bossChallengeRoom_16 = customStage.doorPNGPaths
108
115
  if ____customStage_doorPNGPaths_bossChallengeRoom_16 ~= nil then
@@ -111,8 +118,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
111
118
  return ____customStage_doorPNGPaths_bossChallengeRoom_16
112
119
  end
113
120
  end
114
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_10_bossroomdoor.anm2"
115
- if ____cond16 then
121
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_10_bossroomdoor.anm2"
122
+ if ____cond21 then
116
123
  do
117
124
  local ____customStage_doorPNGPaths_bossRoom_18 = customStage.doorPNGPaths
118
125
  if ____customStage_doorPNGPaths_bossRoom_18 ~= nil then
@@ -121,8 +128,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
121
128
  return ____customStage_doorPNGPaths_bossRoom_18
122
129
  end
123
130
  end
124
- ____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_15_bossrushdoor.anm2"
125
- if ____cond16 then
131
+ ____cond21 = ____cond21 or ____switch21 == "gfx/grid/door_15_bossrushdoor.anm2"
132
+ if ____cond21 then
126
133
  do
127
134
  local ____customStage_doorPNGPaths_bossRush_20 = customStage.doorPNGPaths
128
135
  if ____customStage_doorPNGPaths_bossRush_20 ~= nil then
@@ -146,6 +153,10 @@ function ____exports.setCustomDecorationGraphics(self, customStage, gridEntity)
146
153
  if customStage.decorationsPNGPath == nil then
147
154
  return
148
155
  end
156
+ local gridEntityType = gridEntity:GetType()
157
+ if gridEntityType ~= GridEntityType.DECORATION then
158
+ return
159
+ end
149
160
  local variant = gridEntity:GetVariant()
150
161
  if variant ~= DecorationVariant.VANILLA_DECORATION then
151
162
  return
@@ -162,6 +173,10 @@ function ____exports.setCustomRockGraphics(self, customStage, gridEntity)
162
173
  if customStage.rocksPNGPath == nil then
163
174
  return
164
175
  end
176
+ local gridEntityRock = gridEntity:ToRock()
177
+ if gridEntityRock == nil then
178
+ return
179
+ end
165
180
  local sprite = gridEntity:GetSprite()
166
181
  local fileName = sprite:GetFilename()
167
182
  if fileName == "gfx/grid/grid_rock.anm2" then
@@ -177,6 +192,10 @@ function ____exports.setCustomPitGraphics(self, customStage, gridEntity)
177
192
  if customStage.pitsPNGPath == nil then
178
193
  return
179
194
  end
195
+ local gridEntityPit = gridEntity:ToPit()
196
+ if gridEntityPit == nil then
197
+ return
198
+ end
180
199
  local sprite = gridEntity:GetSprite()
181
200
  local fileName = sprite:GetFilename()
182
201
  if fileName == "gfx/grid/grid_pit.anm2" then
@@ -186,6 +205,13 @@ function ____exports.setCustomPitGraphics(self, customStage, gridEntity)
186
205
  end
187
206
  --- For GridEntityType.DOOR (16)
188
207
  function ____exports.setCustomDoorGraphics(self, customStage, gridEntity)
208
+ if customStage.doorPNGPaths == nil then
209
+ return
210
+ end
211
+ local gridEntityDoor = gridEntity:ToDoor()
212
+ if gridEntityDoor == nil then
213
+ return
214
+ end
189
215
  local sprite = gridEntity:GetSprite()
190
216
  local fileName = sprite:GetFilename()
191
217
  local doorPNGPath = getNewDoorPNGPath(nil, customStage, fileName)
@@ -194,6 +220,15 @@ function ____exports.setCustomDoorGraphics(self, customStage, gridEntity)
194
220
  sprite:LoadGraphics()
195
221
  end
196
222
  end
223
+ function ____exports.convertVanillaTrapdoors(self, customStage, gridEntity)
224
+ local gridEntityType = gridEntity:GetType()
225
+ if gridEntityType ~= GridEntityType.TRAPDOOR then
226
+ return
227
+ end
228
+ removeGridEntity(nil, gridEntity, true)
229
+ local destination = v.run.firstFloor and ({customStage.name, 2}) or nil
230
+ spawnCustomTrapdoor(nil, gridEntity.Position, destination)
231
+ end
197
232
  --- The rewards are based on the ones from the wiki:
198
233
  -- https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Urns
199
234
  --
@@ -4,9 +4,13 @@ import { EntityType } from "isaac-typescript-definitions";
4
4
  *
5
5
  * Custom stages/levels must first be defined in the "tsconfig.json" file. See the documentation for
6
6
  * more details: https://isaacscript.github.io/main/custom-stages/
7
+ *
8
+ * @param name The name of the custom stage, corresponding to what is in the "tsconfig.json" file.
9
+ * @param firstFloor Whether to go to the first floor or the second floor. For example, if you have
10
+ * a custom stage emulating Caves, then the first floor would be Caves 1, and the
11
+ * second floor would be Caves 2.
7
12
  */
8
- export declare function setCustomStage(name: string, verbose?: boolean): void;
9
- export declare function setCustomStageDebug(): void;
13
+ export declare function setCustomStage(name: string, firstFloor?: boolean, verbose?: boolean): void;
10
14
  /**
11
15
  * By default, unknown bosses will be drawn on the boss "versus" screen as "???". If your custom
12
16
  * stage has custom bosses, you can use this function to register the corresponding graphic file
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKX,MAAM,8BAA8B,CAAC;AAmBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,IAAI,CAyGlE;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAQ1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKX,MAAM,8BAA8B,CAAC;AAsBtC;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI,CA6CN;AA4ED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN"}
@@ -1,6 +1,7 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local Map = ____lualib.Map
3
3
  local ____exports = {}
4
+ local setStageRoomsData
4
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
5
6
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
6
7
  local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
@@ -13,102 +14,107 @@ local reorderedCallbacksSetStage = ____reorderedCallbacks.reorderedCallbacksSetS
13
14
  local ____entities = require("functions.entities")
14
15
  local getEntityIDFromConstituents = ____entities.getEntityIDFromConstituents
15
16
  local ____log = require("functions.log")
16
- local log = ____log.log
17
17
  local logError = ____log.logError
18
18
  local ____rng = require("functions.rng")
19
19
  local newRNG = ____rng.newRNG
20
20
  local ____rooms = require("functions.rooms")
21
21
  local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
22
- local getRooms = ____rooms.getRooms
22
+ local getRoomsInGrid = ____rooms.getRoomsInGrid
23
23
  local ____stage = require("functions.stage")
24
24
  local setStage = ____stage.setStage
25
25
  local ____customStageUtils = require("features.customStage.customStageUtils")
26
26
  local getRandomCustomStageRoom = ____customStageUtils.getRandomCustomStageRoom
27
- local ____streakText = require("features.customStage.streakText")
28
- local topStreakTextStart = ____streakText.topStreakTextStart
29
27
  local ____v = require("features.customStage.v")
30
28
  local v = ____v.default
31
29
  local customBossPNGPaths = ____v.customBossPNGPaths
32
30
  local customStageCachedRoomData = ____v.customStageCachedRoomData
33
31
  local customStagesMap = ____v.customStagesMap
34
- local DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2
35
- local DEFAULT_BASE_STAGE_TYPE = StageType.ORIGINAL
36
- --- Helper function to warp to a custom stage/level.
37
- --
38
- -- Custom stages/levels must first be defined in the "tsconfig.json" file. See the documentation for
39
- -- more details: https://isaacscript.github.io/main/custom-stages/
40
- function ____exports.setCustomStage(self, name, verbose)
41
- if verbose == nil then
42
- verbose = false
43
- end
44
- local customStage = customStagesMap:get(name)
45
- if customStage == nil then
46
- error(("Failed to set the custom stage of \"" .. name) .. "\" because it was not found in the custom stages map. (Try restarting IsaacScript / recompiling the mod, and try again. If that does not work, you probably forgot to define it in your \"tsconfig.json\" file.) See the website for more details on how to set up custom stages.")
47
- end
32
+ function setStageRoomsData(self, customStage, rng, verbose)
48
33
  local level = game:GetLevel()
49
34
  local startingRoomGridIndex = level:GetStartingRoomIndex()
50
- local seeds = game:GetSeeds()
51
- local startSeed = seeds:GetStartSeed()
52
- local rng = newRNG(nil, startSeed)
53
- v.run.currentCustomStage = customStage
54
- local baseStage = customStage.baseStage == nil and DEFAULT_BASE_STAGE or customStage.baseStage
55
- local baseStageType = customStage.baseStageType == nil and DEFAULT_BASE_STAGE_TYPE or customStage.baseStageType
56
- setStage(nil, baseStage, baseStageType)
57
- for ____, room in ipairs(getRooms(nil)) do
35
+ for ____, room in ipairs(getRoomsInGrid(nil)) do
58
36
  do
59
37
  if room.SafeGridIndex == startingRoomGridIndex then
60
- goto __continue4
38
+ goto __continue6
61
39
  end
62
40
  if room.Data == nil then
63
- goto __continue4
41
+ goto __continue6
64
42
  end
65
43
  local roomType = room.Data.Type
66
44
  local roomShapeMap = customStage.roomTypeMap:get(roomType)
67
45
  if roomShapeMap == nil then
68
46
  if roomType == RoomType.DEFAULT then
69
- logError((((("Failed to find any custom rooms for RoomType." .. tostring(RoomType[roomType])) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. name)
47
+ logError((((("Failed to find any custom rooms for RoomType." .. tostring(RoomType[roomType])) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name)
70
48
  end
71
- goto __continue4
49
+ goto __continue6
72
50
  end
73
51
  local roomShape = room.Data.Shape
74
52
  local roomDoorSlotFlagMap = roomShapeMap:get(roomShape)
75
53
  if roomDoorSlotFlagMap == nil then
76
- logError((((((((("Failed to find any custom rooms for RoomType." .. tostring(RoomType[roomType])) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. name)
77
- goto __continue4
54
+ logError((((((((("Failed to find any custom rooms for RoomType." .. tostring(RoomType[roomType])) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name)
55
+ goto __continue6
78
56
  end
79
57
  local doorSlotFlags = room.Data.Doors
80
58
  local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
81
59
  if roomsMetadata == nil then
82
- logError((((((((((("Failed to find any custom rooms for RoomType." .. tostring(RoomType[roomType])) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ") + DoorSlotFlags ") .. tostring(doorSlotFlags)) .. " for custom stage: ") .. name)
83
- goto __continue4
60
+ logError((((((((((("Failed to find any custom rooms for RoomType." .. tostring(RoomType[roomType])) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ") + DoorSlotFlags ") .. tostring(doorSlotFlags)) .. " for custom stage: ") .. customStage.name)
61
+ goto __continue6
84
62
  end
85
63
  local randomRoom = getRandomCustomStageRoom(nil, roomsMetadata, rng, verbose)
86
64
  local newRoomData = customStageCachedRoomData:get(randomRoom.variant)
87
65
  if newRoomData == nil then
88
66
  newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
89
67
  if newRoomData == nil then
90
- logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. name)
91
- goto __continue4
68
+ logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name)
69
+ goto __continue6
92
70
  end
93
71
  customStageCachedRoomData:set(randomRoom.variant, newRoomData)
94
72
  end
95
73
  room.Data = newRoomData
96
74
  end
97
- ::__continue4::
75
+ ::__continue6::
76
+ end
77
+ end
78
+ local DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2
79
+ local DEFAULT_BASE_STAGE_TYPE = StageType.ORIGINAL
80
+ --- Helper function to warp to a custom stage/level.
81
+ --
82
+ -- Custom stages/levels must first be defined in the "tsconfig.json" file. See the documentation for
83
+ -- more details: https://isaacscript.github.io/main/custom-stages/
84
+ --
85
+ -- @param name The name of the custom stage, corresponding to what is in the "tsconfig.json" file.
86
+ -- @param firstFloor Whether to go to the first floor or the second floor. For example, if you have
87
+ -- a custom stage emulating Caves, then the first floor would be Caves 1, and the
88
+ -- second floor would be Caves 2.
89
+ function ____exports.setCustomStage(self, name, firstFloor, verbose)
90
+ if firstFloor == nil then
91
+ firstFloor = true
92
+ end
93
+ if verbose == nil then
94
+ verbose = false
95
+ end
96
+ local customStage = customStagesMap:get(name)
97
+ if customStage == nil then
98
+ error(("Failed to set the custom stage of \"" .. name) .. "\" because it was not found in the custom stages map. (Try restarting IsaacScript / recompiling the mod / restarting the game, and try again. If that does not work, you probably forgot to define it in your \"tsconfig.json\" file.) See the website for more details on how to set up custom stages.")
98
99
  end
100
+ local level = game:GetLevel()
101
+ local seeds = game:GetSeeds()
102
+ local startSeed = seeds:GetStartSeed()
103
+ local rng = newRNG(nil, startSeed)
104
+ v.run.currentCustomStage = customStage
105
+ v.run.firstFloor = firstFloor
106
+ local baseStage = customStage.baseStage == nil and DEFAULT_BASE_STAGE or customStage.baseStage
107
+ if not firstFloor then
108
+ baseStage = baseStage + 1
109
+ end
110
+ local baseStageType = customStage.baseStageType == nil and DEFAULT_BASE_STAGE_TYPE or customStage.baseStageType
111
+ setStage(nil, baseStage, baseStageType)
112
+ setStageRoomsData(nil, customStage, rng, verbose)
99
113
  local stage = -1
100
114
  local stageType = StageType.WRATH_OF_THE_LAMB
101
115
  level:SetStage(stage, stageType)
102
116
  reorderedCallbacksSetStage(nil, stage, stageType)
103
117
  end
104
- function ____exports.setCustomStageDebug(self)
105
- local customStage = v.run.currentCustomStage
106
- if customStage == nil then
107
- log("No custom stage is currently loaded.")
108
- return
109
- end
110
- topStreakTextStart(nil)
111
- end
112
118
  --- By default, unknown bosses will be drawn on the boss "versus" screen as "???". If your custom
113
119
  -- stage has custom bosses, you can use this function to register the corresponding graphic file
114
120
  -- files for them.
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAiCxD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CA4BtD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA6BxD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CA0BtD"}