isaacscript-common 7.6.0 → 7.6.1

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.
@@ -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":"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 +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,CAoCZ"}
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"}
@@ -43,10 +43,9 @@ function ____exports.spawnCustomTrapdoorToDestination(self, gridIndexOrPosition,
43
43
  local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
44
44
  local customTrapdoorDescription = {open = open, destination = destination, firstSpawn = firstSpawn}
45
45
  roomTrapdoorMap:set(gridIndex, customTrapdoorDescription)
46
- if not open then
47
- local sprite = gridEntity:GetSprite()
48
- sprite:Play(TrapdoorAnimation.CLOSED, true)
49
- end
46
+ local sprite = gridEntity:GetSprite()
47
+ local animation = open and TrapdoorAnimation.OPENED or TrapdoorAnimation.CLOSED
48
+ sprite:Play(animation, true)
50
49
  return gridEntity
51
50
  end
52
51
  return ____exports
@@ -26,7 +26,7 @@ export interface CustomStageTSConfig {
26
26
  * https://isaacscript.github.io/main/custom-stages
27
27
  *
28
28
  * @minimum 101
29
- * @maximum 109
29
+ * @maximum 999
30
30
  */
31
31
  roomVariantPrefix: number;
32
32
  /**
@@ -13,8 +13,8 @@ export interface GridEntityCustomData {
13
13
  gridEntityTypeCustom: GridEntityType;
14
14
  roomListIndex: int;
15
15
  gridIndex: int;
16
- anm2Path: string;
16
+ gridCollisionClass?: GridCollisionClass;
17
+ anm2Path?: string;
17
18
  defaultAnimation?: string;
18
- gridCollisionClass: GridCollisionClass;
19
19
  }
20
20
  //# sourceMappingURL=GridEntityCustomData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridEntityCustomData.d.ts","sourceRoot":"","sources":["../../src/interfaces/GridEntityCustomData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,CAAC;IAErC,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
1
+ {"version":3,"file":"GridEntityCustomData.d.ts","sourceRoot":"","sources":["../../src/interfaces/GridEntityCustomData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,CAAC;IAErC,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC;IACf,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "7.6.0",
3
+ "version": "7.6.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -184,13 +184,15 @@ function postNewRoomReordered() {
184
184
  continue;
185
185
  }
186
186
 
187
- const sprite = decoration.GetSprite();
188
- sprite.Load(data.anm2Path, true);
189
- const animationToPlay =
190
- data.defaultAnimation === undefined
191
- ? sprite.GetDefaultAnimation()
192
- : data.defaultAnimation;
193
- sprite.Play(animationToPlay, true);
187
+ if (data.anm2Path !== undefined) {
188
+ const sprite = decoration.GetSprite();
189
+ sprite.Load(data.anm2Path, true);
190
+ const animationToPlay =
191
+ data.defaultAnimation === undefined
192
+ ? sprite.GetDefaultAnimation()
193
+ : data.defaultAnimation;
194
+ sprite.Play(animationToPlay, true);
195
+ }
194
196
  }
195
197
  }
196
198
 
@@ -220,8 +222,11 @@ function postNewRoomReordered() {
220
222
  * @param gridIndexOrPosition The grid index or position in the room that you want to spawn the grid
221
223
  * entity at. If a position is specified, the closest grid index will be
222
224
  * used.
223
- * @param gridCollisionClass The collision class that you want the custom grid entity to have.
224
- * @param anm2Path The path to the ANM2 file to use for the sprite.
225
+ * @param gridCollisionClass Optional. The collision class that you want the custom grid entity to
226
+ * have. If not specified, the grid collision class from the base grid
227
+ * entity will be used.
228
+ * @param anm2Path Optional. The path to the ANM2 file to use for the sprite. If not specified, the
229
+ * normal sprite from the base grid entity will be used.
225
230
  * @param defaultAnimation Optional. The name of the animation to play after the sprite is
226
231
  * initialized and after the player re-enters a room with this grid entity
227
232
  * in it. If not specified, the default animation in the anm2 will be used.
@@ -233,8 +238,8 @@ function postNewRoomReordered() {
233
238
  export function spawnCustomGridEntity(
234
239
  gridEntityTypeCustom: GridEntityType,
235
240
  gridIndexOrPosition: int | Vector,
236
- gridCollisionClass: GridCollisionClass,
237
- anm2Path: string,
241
+ gridCollisionClass?: GridCollisionClass,
242
+ anm2Path?: string,
238
243
  defaultAnimation?: string,
239
244
  baseGridEntityType = GridEntityType.DECORATION,
240
245
  baseGridEntityVariant = 0,
@@ -255,15 +260,20 @@ export function spawnCustomGridEntity(
255
260
  if (customGridEntity === undefined) {
256
261
  error("Failed to spawn a custom grid entity.");
257
262
  }
258
- customGridEntity.CollisionClass = gridCollisionClass;
259
-
260
- const sprite = customGridEntity.GetSprite();
261
- sprite.Load(anm2Path, true);
262
- const animationToPlay =
263
- defaultAnimation === undefined
264
- ? sprite.GetDefaultAnimation()
265
- : defaultAnimation;
266
- sprite.Play(animationToPlay, true);
263
+
264
+ if (gridCollisionClass !== undefined) {
265
+ customGridEntity.CollisionClass = gridCollisionClass;
266
+ }
267
+
268
+ if (anm2Path !== undefined) {
269
+ const sprite = customGridEntity.GetSprite();
270
+ sprite.Load(anm2Path, true);
271
+ const animationToPlay =
272
+ defaultAnimation === undefined
273
+ ? sprite.GetDefaultAnimation()
274
+ : defaultAnimation;
275
+ sprite.Play(animationToPlay, true);
276
+ }
267
277
 
268
278
  const customGridEntityData: GridEntityCustomData = {
269
279
  gridEntityTypeCustom,
@@ -1,3 +1,5 @@
1
+ export const CUSTOM_STAGE_FEATURE_NAME = "customStage";
2
+
1
3
  export const ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = "gfx/isaacscript-custom-stage";
2
4
 
3
5
  /** Corresponds to "ui_streak.anm2". */
@@ -17,6 +17,7 @@ import {
17
17
  import { CustomStage, RoomTypeMap } from "../../interfaces/private/CustomStage";
18
18
  import { saveDataManager } from "../saveDataManager/exports";
19
19
  import { setCustomStageBackdrop } from "./backdrop";
20
+ import { CUSTOM_STAGE_FEATURE_NAME } from "./customStageConstants";
20
21
  import {
21
22
  convertVanillaTrapdoors,
22
23
  removeUrnRewards,
@@ -42,7 +43,7 @@ export function customStageInit(mod: ModUpgraded): void {
42
43
  return;
43
44
  }
44
45
 
45
- saveDataManager("customStage", v);
46
+ saveDataManager(CUSTOM_STAGE_FEATURE_NAME, v);
46
47
  versusScreenInit();
47
48
 
48
49
  mod.AddCallback(ModCallback.POST_RENDER, postRender); // 2
@@ -18,9 +18,13 @@ import { PLAYER_NAME_PNG_FILE_NAMES } from "../../objects/playerNamePNGFileNames
18
18
  import { PLAYER_PORTRAIT_PNG_FILE_NAMES } from "../../objects/playerPortraitPNGFileNames";
19
19
  import { VERSUS_SCREEN_BACKGROUND_COLORS } from "../../objects/versusScreenBackgroundColors";
20
20
  import { VERSUS_SCREEN_DIRT_SPOT_COLORS } from "../../objects/versusScreenDirtSpotColors";
21
+ import { disableAllSound, enableAllSound } from "../disableAllSound";
21
22
  import { pause, unpause } from "../pause";
22
23
  import { runNextGameFrame } from "../runInNFrames";
23
- import { ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH } from "./customStageConstants";
24
+ import {
25
+ CUSTOM_STAGE_FEATURE_NAME,
26
+ ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH,
27
+ } from "./customStageConstants";
24
28
  import {
25
29
  DEFAULT_BASE_STAGE,
26
30
  DEFAULT_BASE_STAGE_TYPE,
@@ -136,6 +140,7 @@ export function playVersusScreenAnimation(customStage: CustomStage): void {
136
140
 
137
141
  pause();
138
142
  hud.SetVisible(false);
143
+ disableAllSound(CUSTOM_STAGE_FEATURE_NAME);
139
144
 
140
145
  // Player
141
146
  {
@@ -273,6 +278,7 @@ function finishVersusScreenAnimation() {
273
278
 
274
279
  unpause();
275
280
  hud.SetVisible(true);
281
+ enableAllSound(CUSTOM_STAGE_FEATURE_NAME);
276
282
 
277
283
  // The sound effect only plays once the versus cutscene is over.
278
284
  sfxManager.Play(SoundEffect.CASTLE_PORTCULLIS);
@@ -45,10 +45,9 @@ export function spawnCustomTrapdoorToDestination(
45
45
  };
46
46
  roomTrapdoorMap.set(gridIndex, customTrapdoorDescription);
47
47
 
48
- if (!open) {
49
- const sprite = gridEntity.GetSprite();
50
- sprite.Play(TrapdoorAnimation.CLOSED, true);
51
- }
48
+ const sprite = gridEntity.GetSprite();
49
+ const animation = open ? TrapdoorAnimation.OPENED : TrapdoorAnimation.CLOSED;
50
+ sprite.Play(animation, true);
52
51
 
53
52
  return gridEntity;
54
53
  }
@@ -32,7 +32,7 @@ export interface CustomStageTSConfig {
32
32
  * https://isaacscript.github.io/main/custom-stages
33
33
  *
34
34
  * @minimum 101
35
- * @maximum 109
35
+ * @maximum 999
36
36
  */
37
37
  roomVariantPrefix: number;
38
38
 
@@ -18,7 +18,7 @@ export interface GridEntityCustomData {
18
18
 
19
19
  roomListIndex: int;
20
20
  gridIndex: int;
21
- anm2Path: string;
21
+ gridCollisionClass?: GridCollisionClass;
22
+ anm2Path?: string;
22
23
  defaultAnimation?: string;
23
- gridCollisionClass: GridCollisionClass;
24
24
  }