isaacscript-common 7.5.1 → 7.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.
Files changed (51) hide show
  1. package/dist/features/customGridEntity.d.ts +6 -3
  2. package/dist/features/customGridEntity.d.ts.map +1 -1
  3. package/dist/features/customGridEntity.lua +20 -11
  4. package/dist/features/customStage/customStageConstants.d.ts +1 -0
  5. package/dist/features/customStage/customStageConstants.d.ts.map +1 -1
  6. package/dist/features/customStage/customStageConstants.lua +1 -0
  7. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  8. package/dist/features/customStage/customStageGridEntities.lua +9 -5
  9. package/dist/features/customStage/init.d.ts.map +1 -1
  10. package/dist/features/customStage/init.lua +3 -1
  11. package/dist/features/customStage/versusScreen.d.ts.map +1 -1
  12. package/dist/features/customStage/versusScreen.lua +6 -0
  13. package/dist/features/customTrapdoor/exports.d.ts +28 -16
  14. package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
  15. package/dist/features/customTrapdoor/exports.lua +45 -61
  16. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  17. package/dist/features/customTrapdoor/init.lua +12 -10
  18. package/dist/features/customTrapdoor/spawn.d.ts +6 -0
  19. package/dist/features/customTrapdoor/spawn.d.ts.map +1 -0
  20. package/dist/features/customTrapdoor/spawn.lua +51 -0
  21. package/dist/features/customTrapdoor/v.d.ts +2 -2
  22. package/dist/features/customTrapdoor/v.d.ts.map +1 -1
  23. package/dist/index.d.ts +172 -11148
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.lua +4 -4
  26. package/dist/interfaces/CustomStageTSConfig.d.ts +1 -1
  27. package/dist/interfaces/GridEntityCustomData.d.ts +2 -2
  28. package/dist/interfaces/GridEntityCustomData.d.ts.map +1 -1
  29. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +2 -2
  30. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -1
  31. package/dist/interfaces/private/CustomTrapdoorDestination.d.ts +14 -0
  32. package/dist/interfaces/private/CustomTrapdoorDestination.d.ts.map +1 -0
  33. package/dist/{types/TrapdoorDestination.lua → interfaces/private/CustomTrapdoorDestination.lua} +0 -0
  34. package/package.json +1 -1
  35. package/src/features/customGridEntity.ts +30 -20
  36. package/src/features/customStage/customStageConstants.ts +2 -0
  37. package/src/features/customStage/customStageGridEntities.ts +20 -16
  38. package/src/features/customStage/init.ts +2 -1
  39. package/src/features/customStage/versusScreen.ts +7 -1
  40. package/src/features/customTrapdoor/exports.ts +60 -66
  41. package/src/features/customTrapdoor/init.ts +12 -11
  42. package/src/features/customTrapdoor/spawn.ts +53 -0
  43. package/src/features/customTrapdoor/v.ts +2 -2
  44. package/src/index.ts +2 -3
  45. package/src/interfaces/CustomStageTSConfig.ts +1 -1
  46. package/src/interfaces/GridEntityCustomData.ts +2 -2
  47. package/src/interfaces/private/CustomTrapdoorDescription.ts +2 -2
  48. package/src/interfaces/private/CustomTrapdoorDestination.ts +14 -0
  49. package/dist/types/TrapdoorDestination.d.ts +0 -6
  50. package/dist/types/TrapdoorDestination.d.ts.map +0 -1
  51. package/src/types/TrapdoorDestination.ts +0 -8
@@ -28,8 +28,11 @@ export declare function customGridEntityInit(mod: ModUpgraded): void;
28
28
  * @param gridIndexOrPosition The grid index or position in the room that you want to spawn the grid
29
29
  * entity at. If a position is specified, the closest grid index will be
30
30
  * used.
31
- * @param gridCollisionClass The collision class that you want the custom grid entity to have.
32
- * @param anm2Path The path to the ANM2 file to use for the sprite.
31
+ * @param gridCollisionClass Optional. The collision class that you want the custom grid entity to
32
+ * have. If not specified, the grid collision class from the base grid
33
+ * entity will be used.
34
+ * @param anm2Path Optional. The path to the ANM2 file to use for the sprite. If not specified, the
35
+ * normal sprite from the base grid entity will be used.
33
36
  * @param defaultAnimation Optional. The name of the animation to play after the sprite is
34
37
  * initialized and after the player re-enters a room with this grid entity
35
38
  * in it. If not specified, the default animation in the anm2 will be used.
@@ -38,7 +41,7 @@ export declare function customGridEntityInit(mod: ModUpgraded): void;
38
41
  * @param baseGridEntityVariant Optional. The variant of the grid entity to use as a "base" for this
39
42
  * custom grid entity. Default is 0.
40
43
  */
41
- export declare function spawnCustomGridEntity(gridEntityTypeCustom: GridEntityType, gridIndexOrPosition: int | Vector, gridCollisionClass: GridCollisionClass, anm2Path: string, defaultAnimation?: string, baseGridEntityType?: GridEntityType, baseGridEntityVariant?: number): GridEntity;
44
+ export declare function spawnCustomGridEntity(gridEntityTypeCustom: GridEntityType, gridIndexOrPosition: int | Vector, gridCollisionClass?: GridCollisionClass, anm2Path?: string, defaultAnimation?: string, baseGridEntityType?: GridEntityType, baseGridEntityVariant?: number): GridEntity;
42
45
  /**
43
46
  * Helper function to remove a custom grid entity created by the `spawnCustomGrid` function.
44
47
  *
@@ -1 +1 @@
1
- {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAerD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAoB1E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAmB3D;AAkID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU,CAyCZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAuCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAqBA;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,cAAc,GAAG,SAAS,CAsB5B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,OAAO,CAOT"}
1
+ {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAerD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAoB1E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAmB3D;AAoID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU,CA8CZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAuCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAqBA;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,cAAc,GAAG,SAAS,CAsB5B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,OAAO,CAOT"}
@@ -115,10 +115,12 @@ function postNewRoomReordered(self)
115
115
  roomCustomGridEntities:delete(gridIndex)
116
116
  goto __continue19
117
117
  end
118
- local sprite = decoration:GetSprite()
119
- sprite:Load(data.anm2Path, true)
120
- local animationToPlay = data.defaultAnimation == nil and sprite:GetDefaultAnimation() or data.defaultAnimation
121
- sprite:Play(animationToPlay, true)
118
+ if data.anm2Path ~= nil then
119
+ local sprite = decoration:GetSprite()
120
+ sprite:Load(data.anm2Path, true)
121
+ local animationToPlay = data.defaultAnimation == nil and sprite:GetDefaultAnimation() or data.defaultAnimation
122
+ sprite:Play(animationToPlay, true)
123
+ end
122
124
  end
123
125
  ::__continue19::
124
126
  end
@@ -165,8 +167,11 @@ end
165
167
  -- @param gridIndexOrPosition The grid index or position in the room that you want to spawn the grid
166
168
  -- entity at. If a position is specified, the closest grid index will be
167
169
  -- used.
168
- -- @param gridCollisionClass The collision class that you want the custom grid entity to have.
169
- -- @param anm2Path The path to the ANM2 file to use for the sprite.
170
+ -- @param gridCollisionClass Optional. The collision class that you want the custom grid entity to
171
+ -- have. If not specified, the grid collision class from the base grid
172
+ -- entity will be used.
173
+ -- @param anm2Path Optional. The path to the ANM2 file to use for the sprite. If not specified, the
174
+ -- normal sprite from the base grid entity will be used.
170
175
  -- @param defaultAnimation Optional. The name of the animation to play after the sprite is
171
176
  -- initialized and after the player re-enters a room with this grid entity
172
177
  -- in it. If not specified, the default animation in the anm2 will be used.
@@ -189,11 +194,15 @@ function ____exports.spawnCustomGridEntity(self, gridEntityTypeCustom, gridIndex
189
194
  if customGridEntity == nil then
190
195
  error("Failed to spawn a custom grid entity.")
191
196
  end
192
- customGridEntity.CollisionClass = gridCollisionClass
193
- local sprite = customGridEntity:GetSprite()
194
- sprite:Load(anm2Path, true)
195
- local animationToPlay = defaultAnimation == nil and sprite:GetDefaultAnimation() or defaultAnimation
196
- sprite:Play(animationToPlay, true)
197
+ if gridCollisionClass ~= nil then
198
+ customGridEntity.CollisionClass = gridCollisionClass
199
+ end
200
+ if anm2Path ~= nil then
201
+ local sprite = customGridEntity:GetSprite()
202
+ sprite:Load(anm2Path, true)
203
+ local animationToPlay = defaultAnimation == nil and sprite:GetDefaultAnimation() or defaultAnimation
204
+ sprite:Play(animationToPlay, true)
205
+ end
197
206
  local customGridEntityData = {
198
207
  gridEntityTypeCustom = gridEntityTypeCustom,
199
208
  roomListIndex = roomListIndex,
@@ -1,4 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ export declare const CUSTOM_STAGE_FEATURE_NAME = "customStage";
2
3
  export declare const ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = "gfx/isaacscript-custom-stage";
3
4
  /** Corresponds to "ui_streak.anm2". */
4
5
  export declare enum UIStreakAnimation {
@@ -1 +1 @@
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
+ {"version":3,"file":"customStageConstants.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageConstants.ts"],"names":[],"mappings":";AAAA,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AAEvD,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,4 +1,5 @@
1
1
  local ____exports = {}
2
+ ____exports.CUSTOM_STAGE_FEATURE_NAME = "customStage"
2
3
  ____exports.ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = "gfx/isaacscript-custom-stage"
3
4
  --- Corresponds to "ui_streak.anm2".
4
5
  ____exports.UIStreakAnimation = {}
@@ -1 +1 @@
1
- {"version":3,"file":"customStageGridEntities.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageGridEntities.ts"],"names":[],"mappings":";AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAOnE,0CAA0C;AAC1C,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAuBN;AAED,oCAAoC;AACpC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAyBN;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAuBN;AAuDD,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN;AAED;;;;;;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":";AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AASnE,0CAA0C;AAC1C,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAuBN;AAED,oCAAoC;AACpC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAyBN;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAuBN;AAuDD,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAwBN;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN"}
@@ -25,6 +25,7 @@ local ____customGridEntity = require("features.customGridEntity")
25
25
  local isCustomGridEntity = ____customGridEntity.isCustomGridEntity
26
26
  local ____exports = require("features.customTrapdoor.exports")
27
27
  local spawnCustomTrapdoor = ____exports.spawnCustomTrapdoor
28
+ local spawnCustomTrapdoorToVanilla = ____exports.spawnCustomTrapdoorToVanilla
28
29
  local ____exports = require("features.customStage.exports")
29
30
  local DEFAULT_BASE_STAGE = ____exports.DEFAULT_BASE_STAGE
30
31
  local ____v = require("features.customStage.v")
@@ -238,11 +239,14 @@ function ____exports.convertVanillaTrapdoors(self, customStage, gridEntity)
238
239
  return
239
240
  end
240
241
  removeGridEntity(nil, gridEntity, true)
241
- local baseStage = customStage.baseStage == nil and DEFAULT_BASE_STAGE or customStage.baseStage
242
- local vanillaNextStage = baseStage + 2
243
- local vanillaNextStageType = calculateStageType(nil, vanillaNextStage)
244
- local destination = v.run.firstFloor and ({customStage.name, 2}) or ({vanillaNextStage, vanillaNextStageType})
245
- spawnCustomTrapdoor(nil, gridEntity.Position, destination)
242
+ if v.run.firstFloor then
243
+ spawnCustomTrapdoor(nil, gridEntity.Position, customStage.name, 2)
244
+ else
245
+ local baseStage = customStage.baseStage == nil and DEFAULT_BASE_STAGE or customStage.baseStage
246
+ local stage = baseStage + 2
247
+ local stageType = calculateStageType(nil, stage)
248
+ spawnCustomTrapdoorToVanilla(nil, gridEntity.Position, stage, stageType)
249
+ end
246
250
  end
247
251
  --- The rewards are based on the ones from the wiki:
248
252
  -- https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Urns
@@ -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;AA6BxD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CA0BtD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA8BxD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CA0BtD"}
@@ -19,6 +19,8 @@ local ____exports = require("features.saveDataManager.exports")
19
19
  local saveDataManager = ____exports.saveDataManager
20
20
  local ____backdrop = require("features.customStage.backdrop")
21
21
  local setCustomStageBackdrop = ____backdrop.setCustomStageBackdrop
22
+ local ____customStageConstants = require("features.customStage.customStageConstants")
23
+ local CUSTOM_STAGE_FEATURE_NAME = ____customStageConstants.CUSTOM_STAGE_FEATURE_NAME
22
24
  local ____customStageGridEntities = require("features.customStage.customStageGridEntities")
23
25
  local convertVanillaTrapdoors = ____customStageGridEntities.convertVanillaTrapdoors
24
26
  local removeUrnRewards = ____customStageGridEntities.removeUrnRewards
@@ -133,7 +135,7 @@ function ____exports.customStageInit(self, mod)
133
135
  if customStagesMap.size == 0 then
134
136
  return
135
137
  end
136
- saveDataManager(nil, "customStage", v)
138
+ saveDataManager(nil, CUSTOM_STAGE_FEATURE_NAME, v)
137
139
  versusScreenInit(nil)
138
140
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
139
141
  mod:AddCallback(ModCallback.POST_CURSE_EVAL, postCurseEval)
@@ -1 +1 @@
1
- {"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AA2EnE;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CA2ExE;AAkGD,wBAAgB,sBAAsB,IAAI,IAAI,CAkC7C"}
1
+ {"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AA+EnE;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CA4ExE;AAmGD,wBAAgB,sBAAsB,IAAI,IAAI,CAkC7C"}
@@ -33,12 +33,16 @@ local ____versusScreenBackgroundColors = require("objects.versusScreenBackground
33
33
  local VERSUS_SCREEN_BACKGROUND_COLORS = ____versusScreenBackgroundColors.VERSUS_SCREEN_BACKGROUND_COLORS
34
34
  local ____versusScreenDirtSpotColors = require("objects.versusScreenDirtSpotColors")
35
35
  local VERSUS_SCREEN_DIRT_SPOT_COLORS = ____versusScreenDirtSpotColors.VERSUS_SCREEN_DIRT_SPOT_COLORS
36
+ local ____disableAllSound = require("features.disableAllSound")
37
+ local disableAllSound = ____disableAllSound.disableAllSound
38
+ local enableAllSound = ____disableAllSound.enableAllSound
36
39
  local ____pause = require("features.pause")
37
40
  local pause = ____pause.pause
38
41
  local unpause = ____pause.unpause
39
42
  local ____runInNFrames = require("features.runInNFrames")
40
43
  local runNextGameFrame = ____runInNFrames.runNextGameFrame
41
44
  local ____customStageConstants = require("features.customStage.customStageConstants")
45
+ local CUSTOM_STAGE_FEATURE_NAME = ____customStageConstants.CUSTOM_STAGE_FEATURE_NAME
42
46
  local ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = ____customStageConstants.ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH
43
47
  local ____exports = require("features.customStage.exports")
44
48
  local DEFAULT_BASE_STAGE = ____exports.DEFAULT_BASE_STAGE
@@ -174,6 +178,7 @@ function ____exports.playVersusScreenAnimation(self, customStage)
174
178
  v.run.showingBossVersusScreen = true
175
179
  pause(nil)
176
180
  hud:SetVisible(false)
181
+ disableAllSound(nil, CUSTOM_STAGE_FEATURE_NAME)
177
182
  do
178
183
  local ____getPlayerPNGPaths_result_0 = getPlayerPNGPaths(nil)
179
184
  local namePNGPath = ____getPlayerPNGPaths_result_0.namePNGPath
@@ -226,6 +231,7 @@ local function finishVersusScreenAnimation(self)
226
231
  v.run.showingBossVersusScreen = false
227
232
  unpause(nil)
228
233
  hud:SetVisible(true)
234
+ enableAllSound(nil, CUSTOM_STAGE_FEATURE_NAME)
229
235
  sfxManager:Play(SoundEffect.CASTLE_PORTCULLIS)
230
236
  end
231
237
  function ____exports.versusScreenPostRender(self)
@@ -1,33 +1,45 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- /// <reference types="isaac-typescript-definitions" />
3
- /// <reference types="isaac-typescript-definitions" />
4
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
1
+ import { LevelStage, StageType } from "isaac-typescript-definitions";
5
2
  /**
6
- * Helper function to spawn a trapdoor grid entity that will have one or more of the following
7
- * attributes:
3
+ * Helper function to spawn a trapdoor grid entity that will take a player to a custom stage. If you
4
+ * want to create a custom trapdoor that goes to a vanilla stage instead, use the
5
+ * `spawnCustomTrapdoorToVanilla` helper function.
6
+ *
7
+ * Custom trapdoors can have one or more of the following attributes:
8
8
  *
9
9
  * - custom destination (or custom logic for after the player enters)
10
10
  * - custom graphics
11
11
  * - custom logic for opening/closing
12
12
  *
13
- * You can use this function to take the player to your custom stage.
14
- *
15
13
  * Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
16
14
  * respawned every time the player re-enters the room.
17
15
  *
18
16
  * @param gridIndexOrPosition The location in the room to spawn the trapdoor.
19
- * @param destination Optional. Used to specify where the player will go after jumping into the
20
- * trapdoor. Can either be a vanilla stage tuple, a custom stage tuple, or
21
- * undefined. For example, a destination of `[LevelStage.CAVES_1,
22
- * StageType.ORIGINAL]` corresponds to Caves 1, and a destination of
23
- * `["Slaughterhouse", 1]` corresponds to a custom stage of Slaughterhouse 1. If
24
- * the destination is undefined, then the "normal" destination corresponding to
25
- * the current stage and room will be used (e.g. the next floor, in most cases).
17
+ * @param customStageName The name of the custom stage.
18
+ * @param customStageFloorNum The floor of the custom stage. For most purposes, you should use 1 or
19
+ * 2.
20
+ * @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
21
+ * of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
22
+ * have animations called "Opened", "Closed", and "Open Animation".
23
+ * @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
24
+ * behavior will be used that emulates a vanilla trapdoor.
25
+ */
26
+ export declare function spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, customStageName: string, customStageFloorNum: int, anm2Path?: string, spawnOpen?: boolean): GridEntity;
27
+ /**
28
+ * This is the same thing as the `spawnCustomTrapdoor` function, but instead of having a destination
29
+ * of a custom stage, it has a destination of a vanilla stage.
30
+ *
31
+ * For more information, see the `spawnCustomTrapdoor` function.
32
+ *
33
+ * @param gridIndexOrPosition The location in the room to spawn the trapdoor.
34
+ * @param stage Optional. The number of the vanilla stage to go to. If not provided, the "normal"
35
+ * next stage will be selected.
36
+ * @param stageType The stage type of the vanilla stage to go to. If not provided, the "normal" next
37
+ * stage type will be selected.
26
38
  * @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
27
39
  * of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
28
40
  * have animations called "Opened", "Closed", and "Open Animation".
29
41
  * @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
30
42
  * behavior will be used that emulates a vanilla trapdoor.
31
43
  */
32
- export declare function spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, destination?: TrapdoorDestination, anm2Path?: string, spawnOpen?: boolean): GridEntity;
44
+ export declare function spawnCustomTrapdoorToVanilla(gridIndexOrPosition: int | Vector, stage?: LevelStage, stageType?: StageType, anm2Path?: string, spawnOpen?: boolean): GridEntity;
33
45
  //# sourceMappingURL=exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":";;;AAYA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,WAAW,CAAC,EAAE,mBAAmB,EACjC,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAwCZ"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOrE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,eAAe,EAAE,MAAM,EACvB,mBAAmB,EAAE,GAAG,EACxB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAcZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,EACrB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAkBZ"}
@@ -1,94 +1,78 @@
1
- local ____lualib = require("lualib_bundle")
2
- local Map = ____lualib.Map
3
1
  local ____exports = {}
4
- local getDefaultDestination
5
- local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
- local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
7
- local ____cachedClasses = require("core.cachedClasses")
8
- local game = ____cachedClasses.game
9
- local ____TrapdoorAnimation = require("enums.private.TrapdoorAnimation")
10
- local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
11
2
  local ____featuresInitialized = require("featuresInitialized")
12
3
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
13
4
  local ____nextStage = require("functions.nextStage")
14
5
  local getNextStage = ____nextStage.getNextStage
15
6
  local getNextStageType = ____nextStage.getNextStageType
16
- local ____roomData = require("functions.roomData")
17
- local getRoomListIndex = ____roomData.getRoomListIndex
18
- local ____vector = require("functions.vector")
19
- local isVector = ____vector.isVector
20
- local ____customGridEntity = require("features.customGridEntity")
21
- local spawnCustomGridEntity = ____customGridEntity.spawnCustomGridEntity
22
7
  local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
23
8
  local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
24
- local GridEntityTypeCustom = ____customTrapdoorConstants.GridEntityTypeCustom
25
- local ____openClose = require("features.customTrapdoor.openClose")
26
- local shouldTrapdoorSpawnOpen = ____openClose.shouldTrapdoorSpawnOpen
27
- local ____v = require("features.customTrapdoor.v")
28
- local v = ____v.default
29
- function getDefaultDestination(self)
30
- local nextStage = getNextStage(nil)
31
- local nextStageType = getNextStageType(nil)
32
- return {nextStage, nextStageType}
33
- end
34
- --- Helper function to spawn a trapdoor grid entity that will have one or more of the following
35
- -- attributes:
9
+ local ____spawn = require("features.customTrapdoor.spawn")
10
+ local spawnCustomTrapdoorToDestination = ____spawn.spawnCustomTrapdoorToDestination
11
+ --- Helper function to spawn a trapdoor grid entity that will take a player to a custom stage. If you
12
+ -- want to create a custom trapdoor that goes to a vanilla stage instead, use the
13
+ -- `spawnCustomTrapdoorToVanilla` helper function.
14
+ --
15
+ -- Custom trapdoors can have one or more of the following attributes:
36
16
  --
37
17
  -- - custom destination (or custom logic for after the player enters)
38
18
  -- - custom graphics
39
19
  -- - custom logic for opening/closing
40
20
  --
41
- -- You can use this function to take the player to your custom stage.
42
- --
43
21
  -- Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
44
22
  -- respawned every time the player re-enters the room.
45
23
  --
46
24
  -- @param gridIndexOrPosition The location in the room to spawn the trapdoor.
47
- -- @param destination Optional. Used to specify where the player will go after jumping into the
48
- -- trapdoor. Can either be a vanilla stage tuple, a custom stage tuple, or
49
- -- undefined. For example, a destination of `[LevelStage.CAVES_1,
50
- -- StageType.ORIGINAL]` corresponds to Caves 1, and a destination of
51
- -- `["Slaughterhouse", 1]` corresponds to a custom stage of Slaughterhouse 1. If
52
- -- the destination is undefined, then the "normal" destination corresponding to
53
- -- the current stage and room will be used (e.g. the next floor, in most cases).
25
+ -- @param customStageName The name of the custom stage.
26
+ -- @param customStageFloorNum The floor of the custom stage. For most purposes, you should use 1 or
27
+ -- 2.
54
28
  -- @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
55
29
  -- of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
56
30
  -- have animations called "Opened", "Closed", and "Open Animation".
57
31
  -- @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
58
32
  -- behavior will be used that emulates a vanilla trapdoor.
59
- function ____exports.spawnCustomTrapdoor(self, gridIndexOrPosition, destination, anm2Path, spawnOpen)
33
+ function ____exports.spawnCustomTrapdoor(self, gridIndexOrPosition, customStageName, customStageFloorNum, anm2Path, spawnOpen)
60
34
  if anm2Path == nil then
61
35
  anm2Path = "gfx/grid/door_11_trapdoor.anm2"
62
36
  end
63
37
  errorIfFeaturesNotInitialized(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
64
- local room = game:GetRoom()
65
- local roomFrameCount = room:GetFrameCount()
66
- local roomListIndex = getRoomListIndex(nil)
67
- local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
68
- local gridEntity = spawnCustomGridEntity(
38
+ local destination = {customStageName = customStageName, customStageFloorNum = customStageFloorNum}
39
+ return spawnCustomTrapdoorToDestination(
69
40
  nil,
70
- GridEntityTypeCustom.TRAPDOOR_CUSTOM,
71
41
  gridIndexOrPosition,
72
- GridCollisionClass.NONE,
42
+ destination,
73
43
  anm2Path,
74
- TrapdoorAnimation.OPENED
44
+ spawnOpen
75
45
  )
76
- local firstSpawn = roomFrameCount ~= 0
77
- local ____temp_0
78
- if spawnOpen == nil then
79
- ____temp_0 = shouldTrapdoorSpawnOpen(nil, gridEntity, firstSpawn)
80
- else
81
- ____temp_0 = spawnOpen
82
- end
83
- local open = ____temp_0
84
- local destinationToUse = destination == nil and getDefaultDestination(nil) or destination
85
- local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
86
- local customTrapdoorDescription = {open = open, destination = destinationToUse, firstSpawn = firstSpawn}
87
- roomTrapdoorMap:set(gridIndex, customTrapdoorDescription)
88
- if not open then
89
- local sprite = gridEntity:GetSprite()
90
- sprite:Play(TrapdoorAnimation.CLOSED, true)
46
+ end
47
+ --- This is the same thing as the `spawnCustomTrapdoor` function, but instead of having a destination
48
+ -- of a custom stage, it has a destination of a vanilla stage.
49
+ --
50
+ -- For more information, see the `spawnCustomTrapdoor` function.
51
+ --
52
+ -- @param gridIndexOrPosition The location in the room to spawn the trapdoor.
53
+ -- @param stage Optional. The number of the vanilla stage to go to. If not provided, the "normal"
54
+ -- next stage will be selected.
55
+ -- @param stageType The stage type of the vanilla stage to go to. If not provided, the "normal" next
56
+ -- stage type will be selected.
57
+ -- @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
58
+ -- of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
59
+ -- have animations called "Opened", "Closed", and "Open Animation".
60
+ -- @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
61
+ -- behavior will be used that emulates a vanilla trapdoor.
62
+ function ____exports.spawnCustomTrapdoorToVanilla(self, gridIndexOrPosition, stage, stageType, anm2Path, spawnOpen)
63
+ if anm2Path == nil then
64
+ anm2Path = "gfx/grid/door_11_trapdoor.anm2"
91
65
  end
92
- return gridEntity
66
+ errorIfFeaturesNotInitialized(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
67
+ local vanillaStage = stage == nil and getNextStage(nil) or stage
68
+ local vanillaStageType = stageType == nil and getNextStageType(nil) or stageType
69
+ local destination = {vanillaStage = vanillaStage, vanillaStageType = vanillaStageType}
70
+ return spawnCustomTrapdoorToDestination(
71
+ nil,
72
+ gridIndexOrPosition,
73
+ destination,
74
+ anm2Path,
75
+ spawnOpen
76
+ )
93
77
  end
94
78
  return ____exports
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA0BxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUzD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAyBxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUzD"}
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__ArraySome = ____lualib.__TS__ArraySome
3
3
  local Map = ____lualib.Map
4
4
  local ____exports = {}
5
- local postRender, checkAllPlayersJumpComplete, checkPixelationToBlackComplete, checkSecondPixelationHalfWay, checkAllPlayersLayingDownComplete, goToCustomDestination, anyPlayerPlayingExtraAnimation, postPEffectUpdate, checkJumpComplete, postGridEntityCustomUpdateTrapdoor
5
+ local postRender, checkAllPlayersJumpComplete, checkPixelationToBlackComplete, checkSecondPixelationHalfWay, checkAllPlayersLayingDownComplete, goToCustomTrapdoorDestination, anyPlayerPlayingExtraAnimation, postPEffectUpdate, checkJumpComplete, postGridEntityCustomUpdateTrapdoor
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
7
  local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
8
8
  local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
@@ -26,8 +26,6 @@ local ____roomTransition = require("functions.roomTransition")
26
26
  local teleport = ____roomTransition.teleport
27
27
  local ____stage = require("functions.stage")
28
28
  local setStage = ____stage.setStage
29
- local ____types = require("functions.types")
30
- local isString = ____types.isString
31
29
  local ____exports = require("features.customStage.exports")
32
30
  local disableCustomStage = ____exports.disableCustomStage
33
31
  local setCustomStage = ____exports.setCustomStage
@@ -93,7 +91,7 @@ function checkPixelationToBlackComplete(self)
93
91
  local futureRenderFrameCount = Isaac.GetFrameCount()
94
92
  v.run.state = StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY
95
93
  v.run.stateRenderFrame = futureRenderFrameCount
96
- goToCustomDestination(nil)
94
+ goToCustomTrapdoorDestination(nil)
97
95
  teleport(
98
96
  nil,
99
97
  startingRoomIndex,
@@ -145,17 +143,21 @@ function checkAllPlayersLayingDownComplete(self)
145
143
  v.run.state = StageTravelState.NONE
146
144
  enableAllInputs(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
147
145
  end
148
- function goToCustomDestination(self)
146
+ function goToCustomTrapdoorDestination(self)
149
147
  if v.run.destination == nil then
150
148
  return
151
149
  end
152
- local arg1, arg2 = table.unpack(v.run.destination)
153
- if isString(nil, arg1) then
154
- local firstFloor = arg2 == 1
150
+ local ____v_run_destination_0 = v.run.destination
151
+ local customStageName = ____v_run_destination_0.customStageName
152
+ local customStageFloorNum = ____v_run_destination_0.customStageFloorNum
153
+ local vanillaStage = ____v_run_destination_0.vanillaStage
154
+ local vanillaStageType = ____v_run_destination_0.vanillaStageType
155
+ if customStageName ~= nil and customStageFloorNum ~= nil then
156
+ local firstFloor = customStageFloorNum == 1
155
157
  setCustomStage(nil, "Slaughterhouse", firstFloor)
156
- else
158
+ elseif vanillaStage ~= nil and vanillaStageType ~= nil then
157
159
  disableCustomStage(nil)
158
- setStage(nil, arg1, arg2)
160
+ setStage(nil, vanillaStage, vanillaStageType)
159
161
  end
160
162
  end
161
163
  function anyPlayerPlayingExtraAnimation(self)
@@ -0,0 +1,6 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /// <reference types="isaac-typescript-definitions" />
3
+ /// <reference types="isaac-typescript-definitions" />
4
+ import { CustomTrapdoorDestination } from "../../interfaces/private/CustomTrapdoorDestination";
5
+ export declare function spawnCustomTrapdoorToDestination(gridIndexOrPosition: int | Vector, destination: CustomTrapdoorDestination, anm2Path: string, spawnOpen?: boolean): GridEntity;
6
+ //# sourceMappingURL=spawn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/spawn.ts"],"names":[],"mappings":";;;AAMA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAM/F,wBAAgB,gCAAgC,CAC9C,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,WAAW,EAAE,yBAAyB,EACtC,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAmCZ"}
@@ -0,0 +1,51 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local ____exports = {}
4
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
5
+ local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
6
+ local ____cachedClasses = require("core.cachedClasses")
7
+ local game = ____cachedClasses.game
8
+ local ____TrapdoorAnimation = require("enums.private.TrapdoorAnimation")
9
+ local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
10
+ local ____roomData = require("functions.roomData")
11
+ local getRoomListIndex = ____roomData.getRoomListIndex
12
+ local ____vector = require("functions.vector")
13
+ local isVector = ____vector.isVector
14
+ local ____customGridEntity = require("features.customGridEntity")
15
+ local spawnCustomGridEntity = ____customGridEntity.spawnCustomGridEntity
16
+ local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
17
+ local GridEntityTypeCustom = ____customTrapdoorConstants.GridEntityTypeCustom
18
+ local ____openClose = require("features.customTrapdoor.openClose")
19
+ local shouldTrapdoorSpawnOpen = ____openClose.shouldTrapdoorSpawnOpen
20
+ local ____v = require("features.customTrapdoor.v")
21
+ local v = ____v.default
22
+ function ____exports.spawnCustomTrapdoorToDestination(self, gridIndexOrPosition, destination, anm2Path, spawnOpen)
23
+ local room = game:GetRoom()
24
+ local roomFrameCount = room:GetFrameCount()
25
+ local roomListIndex = getRoomListIndex(nil)
26
+ local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
27
+ local gridEntity = spawnCustomGridEntity(
28
+ nil,
29
+ GridEntityTypeCustom.TRAPDOOR_CUSTOM,
30
+ gridIndexOrPosition,
31
+ GridCollisionClass.NONE,
32
+ anm2Path,
33
+ TrapdoorAnimation.OPENED
34
+ )
35
+ local firstSpawn = roomFrameCount ~= 0
36
+ local ____temp_0
37
+ if spawnOpen == nil then
38
+ ____temp_0 = shouldTrapdoorSpawnOpen(nil, gridEntity, firstSpawn)
39
+ else
40
+ ____temp_0 = spawnOpen
41
+ end
42
+ local open = ____temp_0
43
+ local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
44
+ local customTrapdoorDescription = {open = open, destination = destination, firstSpawn = firstSpawn}
45
+ roomTrapdoorMap:set(gridIndex, customTrapdoorDescription)
46
+ local sprite = gridEntity:GetSprite()
47
+ local animation = open and TrapdoorAnimation.OPENED or TrapdoorAnimation.CLOSED
48
+ sprite:Play(animation, true)
49
+ return gridEntity
50
+ end
51
+ return ____exports
@@ -1,13 +1,13 @@
1
1
  import { DefaultMap } from "../../classes/DefaultMap";
2
2
  import { StageTravelState } from "../../enums/private/StageTravelState";
3
3
  import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
4
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
4
+ import { CustomTrapdoorDestination } from "../../interfaces/private/CustomTrapdoorDestination";
5
5
  declare const v: {
6
6
  run: {
7
7
  state: StageTravelState;
8
8
  /** The render frame that this state was reached. */
9
9
  stateRenderFrame: number | null;
10
- destination: TrapdoorDestination | null;
10
+ destination: CustomTrapdoorDestination | null;
11
11
  };
12
12
  level: {
13
13
  /** Indexed by room list index and grid index. */
@@ -1 +1 @@
1
- {"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,QAAA,MAAM,CAAC;;;QAIH,oDAAoD;;;;;QAOpD,iDAAiD;;;CAKpD,CAAC;AACF,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAE/F,QAAA,MAAM,CAAC;;;QAIH,oDAAoD;;;;;QAOpD,iDAAiD;;;CAKpD,CAAC;AACF,eAAe,CAAC,CAAC"}