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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,C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,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC"}
package/dist/index.lua CHANGED
@@ -151,10 +151,10 @@ do
151
151
  end
152
152
  do
153
153
  local ____customGridEntity = require("features.customGridEntity")
154
- local removeCustomGrid = ____customGridEntity.removeCustomGridEntity
155
- local spawnCustomGrid = ____customGridEntity.spawnCustomGridEntity
156
- ____exports.removeCustomGrid = removeCustomGrid
157
- ____exports.spawnCustomGrid = spawnCustomGrid
154
+ local removeCustomGridEntity = ____customGridEntity.removeCustomGridEntity
155
+ local spawnCustomGridEntity = ____customGridEntity.spawnCustomGridEntity
156
+ ____exports.removeCustomGridEntity = removeCustomGridEntity
157
+ ____exports.spawnCustomGridEntity = spawnCustomGridEntity
158
158
  end
159
159
  do
160
160
  local ____export = require("features.customStage.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"}
@@ -1,7 +1,7 @@
1
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
1
+ import { CustomTrapdoorDestination } from "./CustomTrapdoorDestination";
2
2
  export interface CustomTrapdoorDescription {
3
3
  open: boolean;
4
- destination: TrapdoorDestination;
4
+ destination: CustomTrapdoorDestination;
5
5
  firstSpawn: boolean;
6
6
  }
7
7
  //# sourceMappingURL=CustomTrapdoorDescription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTrapdoorDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/CustomTrapdoorDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"CustomTrapdoorDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/CustomTrapdoorDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,yBAAyB,CAAC;IACvC,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,14 @@
1
+ import { LevelStage, StageType } from "isaac-typescript-definitions";
2
+ /**
3
+ * - If the destination is a custom stage, then `vanillaStage` and `vanillaStageType` will be
4
+ * undefined.
5
+ * - If the destination is a vanilla stage, then `customStageName` and `customStageFloorNum` will be
6
+ * undefined.
7
+ */
8
+ export interface CustomTrapdoorDestination {
9
+ customStageName?: string;
10
+ customStageFloorNum?: int;
11
+ vanillaStage?: LevelStage;
12
+ vanillaStageType?: StageType;
13
+ }
14
+ //# sourceMappingURL=CustomTrapdoorDestination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomTrapdoorDestination.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/CustomTrapdoorDestination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,GAAG,CAAC;IAC1B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "7.5.1",
3
+ "version": "7.6.2",
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". */
@@ -16,9 +16,11 @@ import {
16
16
  import { calculateStageType } from "../../functions/stage";
17
17
  import { vectorEquals } from "../../functions/vector";
18
18
  import { CustomStage } from "../../interfaces/private/CustomStage";
19
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
20
19
  import { isCustomGridEntity } from "../customGridEntity";
21
- import { spawnCustomTrapdoor } from "../customTrapdoor/exports";
20
+ import {
21
+ spawnCustomTrapdoor,
22
+ spawnCustomTrapdoorToVanilla,
23
+ } from "../customTrapdoor/exports";
22
24
  import { DEFAULT_BASE_STAGE } from "./exports";
23
25
  import v from "./v";
24
26
 
@@ -203,20 +205,22 @@ export function convertVanillaTrapdoors(
203
205
 
204
206
  removeGridEntity(gridEntity, true);
205
207
 
206
- // - If we are on the first floor of a custom stage, then the destination will be the second floor
207
- // of the custom stage. (e.g. Caves 1 to Caves 2)
208
- // - If we are on the second floor of a custom stage, then the destination will be the vanilla
209
- // floor equivalent to 2 floors after the floor used as a basis for the custom stage.
210
- const baseStage =
211
- customStage.baseStage === undefined
212
- ? DEFAULT_BASE_STAGE
213
- : customStage.baseStage;
214
- const vanillaNextStage = (baseStage + 2) as LevelStage;
215
- const vanillaNextStageType = calculateStageType(vanillaNextStage);
216
- const destination: TrapdoorDestination = v.run.firstFloor
217
- ? [customStage.name, 2]
218
- : [vanillaNextStage, vanillaNextStageType];
219
- spawnCustomTrapdoor(gridEntity.Position, destination);
208
+ if (v.run.firstFloor) {
209
+ // If we are on the first floor of a custom stage, then the destination will be the second floor
210
+ // of the custom stage. (e.g. Caves 1 to Caves 2)
211
+ spawnCustomTrapdoor(gridEntity.Position, customStage.name, 2);
212
+ } else {
213
+ // If we are on the second floor of a custom stage, then the destination will be the vanilla
214
+ // floor equivalent to 2 floors after the floor used as a basis for the custom stage.
215
+ const baseStage =
216
+ customStage.baseStage === undefined
217
+ ? DEFAULT_BASE_STAGE
218
+ : customStage.baseStage;
219
+ const stage = (baseStage + 2) as LevelStage;
220
+ const stageType = calculateStageType(stage);
221
+
222
+ spawnCustomTrapdoorToVanilla(gridEntity.Position, stage, stageType);
223
+ }
220
224
  }
221
225
 
222
226
  /**
@@ -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);
@@ -1,45 +1,28 @@
1
- import {
2
- GridCollisionClass,
3
- LevelStage,
4
- StageType,
5
- } from "isaac-typescript-definitions";
6
- import { game } from "../../core/cachedClasses";
7
- import { TrapdoorAnimation } from "../../enums/private/TrapdoorAnimation";
1
+ import { LevelStage, StageType } from "isaac-typescript-definitions";
8
2
  import { errorIfFeaturesNotInitialized } from "../../featuresInitialized";
9
3
  import { getNextStage, getNextStageType } from "../../functions/nextStage";
10
- import { getRoomListIndex } from "../../functions/roomData";
11
- import { isVector } from "../../functions/vector";
12
- import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
13
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
14
- import { spawnCustomGridEntity } from "../customGridEntity";
15
- import {
16
- CUSTOM_TRAPDOOR_FEATURE_NAME,
17
- GridEntityTypeCustom,
18
- } from "./customTrapdoorConstants";
19
- import { shouldTrapdoorSpawnOpen } from "./openClose";
20
- import v from "./v";
4
+ import { CustomTrapdoorDestination } from "../../interfaces/private/CustomTrapdoorDestination";
5
+ import { CUSTOM_TRAPDOOR_FEATURE_NAME } from "./customTrapdoorConstants";
6
+ import { spawnCustomTrapdoorToDestination } from "./spawn";
21
7
 
22
8
  /**
23
- * Helper function to spawn a trapdoor grid entity that will have one or more of the following
24
- * attributes:
9
+ * Helper function to spawn a trapdoor grid entity that will take a player to a custom stage. If you
10
+ * want to create a custom trapdoor that goes to a vanilla stage instead, use the
11
+ * `spawnCustomTrapdoorToVanilla` helper function.
12
+ *
13
+ * Custom trapdoors can have one or more of the following attributes:
25
14
  *
26
15
  * - custom destination (or custom logic for after the player enters)
27
16
  * - custom graphics
28
17
  * - custom logic for opening/closing
29
18
  *
30
- * You can use this function to take the player to your custom stage.
31
- *
32
19
  * Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
33
20
  * respawned every time the player re-enters the room.
34
21
  *
35
22
  * @param gridIndexOrPosition The location in the room to spawn the trapdoor.
36
- * @param destination Optional. Used to specify where the player will go after jumping into the
37
- * trapdoor. Can either be a vanilla stage tuple, a custom stage tuple, or
38
- * undefined. For example, a destination of `[LevelStage.CAVES_1,
39
- * StageType.ORIGINAL]` corresponds to Caves 1, and a destination of
40
- * `["Slaughterhouse", 1]` corresponds to a custom stage of Slaughterhouse 1. If
41
- * the destination is undefined, then the "normal" destination corresponding to
42
- * the current stage and room will be used (e.g. the next floor, in most cases).
23
+ * @param customStageName The name of the custom stage.
24
+ * @param customStageFloorNum The floor of the custom stage. For most purposes, you should use 1 or
25
+ * 2.
43
26
  * @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
44
27
  * of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
45
28
  * have animations called "Opened", "Closed", and "Open Animation".
@@ -48,54 +31,65 @@ import v from "./v";
48
31
  */
49
32
  export function spawnCustomTrapdoor(
50
33
  gridIndexOrPosition: int | Vector,
51
- destination?: TrapdoorDestination,
34
+ customStageName: string,
35
+ customStageFloorNum: int,
52
36
  anm2Path = "gfx/grid/door_11_trapdoor.anm2",
53
37
  spawnOpen?: boolean,
54
38
  ): GridEntity {
55
39
  errorIfFeaturesNotInitialized(CUSTOM_TRAPDOOR_FEATURE_NAME);
56
40
 
57
- const room = game.GetRoom();
58
- const roomFrameCount = room.GetFrameCount();
59
- const roomListIndex = getRoomListIndex();
60
- const gridIndex = isVector(gridIndexOrPosition)
61
- ? room.GetGridIndex(gridIndexOrPosition)
62
- : gridIndexOrPosition;
41
+ const destination: CustomTrapdoorDestination = {
42
+ customStageName,
43
+ customStageFloorNum,
44
+ };
63
45
 
64
- const gridEntity = spawnCustomGridEntity(
65
- GridEntityTypeCustom.TRAPDOOR_CUSTOM,
46
+ return spawnCustomTrapdoorToDestination(
66
47
  gridIndexOrPosition,
67
- GridCollisionClass.NONE,
48
+ destination,
68
49
  anm2Path,
69
- TrapdoorAnimation.OPENED,
50
+ spawnOpen,
70
51
  );
52
+ }
71
53
 
72
- const firstSpawn = roomFrameCount !== 0;
73
- const open =
74
- spawnOpen === undefined
75
- ? shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
76
- : spawnOpen;
77
- const destinationToUse =
78
- destination === undefined ? getDefaultDestination() : destination;
79
-
80
- const roomTrapdoorMap = v.level.trapdoors.getAndSetDefault(roomListIndex);
81
- const customTrapdoorDescription: CustomTrapdoorDescription = {
82
- open,
83
- destination: destinationToUse,
84
- firstSpawn,
85
- };
86
- roomTrapdoorMap.set(gridIndex, customTrapdoorDescription);
87
-
88
- if (!open) {
89
- const sprite = gridEntity.GetSprite();
90
- sprite.Play(TrapdoorAnimation.CLOSED, true);
91
- }
54
+ /**
55
+ * This is the same thing as the `spawnCustomTrapdoor` function, but instead of having a destination
56
+ * of a custom stage, it has a destination of a vanilla stage.
57
+ *
58
+ * For more information, see the `spawnCustomTrapdoor` function.
59
+ *
60
+ * @param gridIndexOrPosition The location in the room to spawn the trapdoor.
61
+ * @param stage Optional. The number of the vanilla stage to go to. If not provided, the "normal"
62
+ * next stage will be selected.
63
+ * @param stageType The stage type of the vanilla stage to go to. If not provided, the "normal" next
64
+ * stage type will be selected.
65
+ * @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
66
+ * of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
67
+ * have animations called "Opened", "Closed", and "Open Animation".
68
+ * @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
69
+ * behavior will be used that emulates a vanilla trapdoor.
70
+ */
71
+ export function spawnCustomTrapdoorToVanilla(
72
+ gridIndexOrPosition: int | Vector,
73
+ stage?: LevelStage,
74
+ stageType?: StageType,
75
+ anm2Path = "gfx/grid/door_11_trapdoor.anm2",
76
+ spawnOpen?: boolean,
77
+ ): GridEntity {
78
+ errorIfFeaturesNotInitialized(CUSTOM_TRAPDOOR_FEATURE_NAME);
92
79
 
93
- return gridEntity;
94
- }
80
+ const vanillaStage = stage === undefined ? getNextStage() : stage;
81
+ const vanillaStageType =
82
+ stageType === undefined ? getNextStageType() : stageType;
95
83
 
96
- function getDefaultDestination(): [stage: LevelStage, stageType: StageType] {
97
- const nextStage = getNextStage();
98
- const nextStageType = getNextStageType();
84
+ const destination: CustomTrapdoorDestination = {
85
+ vanillaStage,
86
+ vanillaStageType,
87
+ };
99
88
 
100
- return [nextStage, nextStageType];
89
+ return spawnCustomTrapdoorToDestination(
90
+ gridIndexOrPosition,
91
+ destination,
92
+ anm2Path,
93
+ spawnOpen,
94
+ );
101
95
  }
@@ -4,7 +4,6 @@ import {
4
4
  EntityGridCollisionClass,
5
5
  ModCallback,
6
6
  RoomTransitionAnim,
7
- StageType,
8
7
  } from "isaac-typescript-definitions";
9
8
  import { ModUpgraded } from "../../classes/ModUpgraded";
10
9
  import { game } from "../../core/cachedClasses";
@@ -15,7 +14,6 @@ import { getAllPlayers } from "../../functions/playerIndex";
15
14
  import { getRoomGridIndex, getRoomListIndex } from "../../functions/roomData";
16
15
  import { teleport } from "../../functions/roomTransition";
17
16
  import { setStage } from "../../functions/stage";
18
- import { isString } from "../../functions/types";
19
17
  import { disableCustomStage, setCustomStage } from "../customStage/exports";
20
18
  import { topStreakTextStart } from "../customStage/streakText";
21
19
  import { enableAllInputs } from "../disableInputs";
@@ -119,7 +117,7 @@ function checkPixelationToBlackComplete() {
119
117
  StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY;
120
118
  v.run.stateRenderFrame = futureRenderFrameCount;
121
119
 
122
- goToCustomDestination();
120
+ goToCustomTrapdoorDestination();
123
121
 
124
122
  // Start another pixelation effect. This time, we will keep the screen black with the sprite,
125
123
  // and then remove the black sprite once the pixelation effect is halfway complete.
@@ -193,21 +191,24 @@ function checkAllPlayersLayingDownComplete() {
193
191
  enableAllInputs(CUSTOM_TRAPDOOR_FEATURE_NAME);
194
192
  }
195
193
 
196
- function goToCustomDestination() {
194
+ function goToCustomTrapdoorDestination() {
197
195
  if (v.run.destination === null) {
198
196
  return;
199
197
  }
200
198
 
201
- const [arg1, arg2] = v.run.destination;
199
+ const {
200
+ customStageName,
201
+ customStageFloorNum,
202
+ vanillaStage,
203
+ vanillaStageType,
204
+ } = v.run.destination;
202
205
 
203
- if (isString(arg1)) {
204
- // A string represents a custom stage.
205
- const firstFloor = arg2 === 1;
206
+ if (customStageName !== undefined && customStageFloorNum !== undefined) {
207
+ const firstFloor = customStageFloorNum === 1;
206
208
  setCustomStage("Slaughterhouse", firstFloor);
207
- } else {
208
- // A number represents a vanilla `LevelStage`.
209
+ } else if (vanillaStage !== undefined && vanillaStageType !== undefined) {
209
210
  disableCustomStage();
210
- setStage(arg1, arg2 as StageType);
211
+ setStage(vanillaStage, vanillaStageType);
211
212
  }
212
213
  }
213
214
 
@@ -0,0 +1,53 @@
1
+ import { GridCollisionClass } from "isaac-typescript-definitions";
2
+ import { game } from "../../core/cachedClasses";
3
+ import { TrapdoorAnimation } from "../../enums/private/TrapdoorAnimation";
4
+ import { getRoomListIndex } from "../../functions/roomData";
5
+ import { isVector } from "../../functions/vector";
6
+ import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
7
+ import { CustomTrapdoorDestination } from "../../interfaces/private/CustomTrapdoorDestination";
8
+ import { spawnCustomGridEntity } from "../customGridEntity";
9
+ import { GridEntityTypeCustom } from "./customTrapdoorConstants";
10
+ import { shouldTrapdoorSpawnOpen } from "./openClose";
11
+ import v from "./v";
12
+
13
+ export function spawnCustomTrapdoorToDestination(
14
+ gridIndexOrPosition: int | Vector,
15
+ destination: CustomTrapdoorDestination,
16
+ anm2Path: string,
17
+ spawnOpen?: boolean,
18
+ ): GridEntity {
19
+ const room = game.GetRoom();
20
+ const roomFrameCount = room.GetFrameCount();
21
+ const roomListIndex = getRoomListIndex();
22
+ const gridIndex = isVector(gridIndexOrPosition)
23
+ ? room.GetGridIndex(gridIndexOrPosition)
24
+ : gridIndexOrPosition;
25
+
26
+ const gridEntity = spawnCustomGridEntity(
27
+ GridEntityTypeCustom.TRAPDOOR_CUSTOM,
28
+ gridIndexOrPosition,
29
+ GridCollisionClass.NONE,
30
+ anm2Path,
31
+ TrapdoorAnimation.OPENED,
32
+ );
33
+
34
+ const firstSpawn = roomFrameCount !== 0;
35
+ const open =
36
+ spawnOpen === undefined
37
+ ? shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
38
+ : spawnOpen;
39
+
40
+ const roomTrapdoorMap = v.level.trapdoors.getAndSetDefault(roomListIndex);
41
+ const customTrapdoorDescription: CustomTrapdoorDescription = {
42
+ open,
43
+ destination,
44
+ firstSpawn,
45
+ };
46
+ roomTrapdoorMap.set(gridIndex, customTrapdoorDescription);
47
+
48
+ const sprite = gridEntity.GetSprite();
49
+ const animation = open ? TrapdoorAnimation.OPENED : TrapdoorAnimation.CLOSED;
50
+ sprite.Play(animation, true);
51
+
52
+ return gridEntity;
53
+ }
@@ -1,7 +1,7 @@
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
 
6
6
  const v = {
7
7
  run: {
@@ -10,7 +10,7 @@ const v = {
10
10
  /** The render frame that this state was reached. */
11
11
  stateRenderFrame: null as int | null,
12
12
 
13
- destination: null as TrapdoorDestination | null,
13
+ destination: null as CustomTrapdoorDestination | null,
14
14
  },
15
15
 
16
16
  level: {
package/src/index.ts CHANGED
@@ -22,8 +22,8 @@ export { registerCharacterStats } from "./features/characterStats";
22
22
  export { getCollectibleItemPoolType } from "./features/collectibleItemPoolType";
23
23
  export { initCustomDoor, spawnCustomDoor } from "./features/customDoor";
24
24
  export {
25
- removeCustomGridEntity as removeCustomGrid,
26
- spawnCustomGridEntity as spawnCustomGrid,
25
+ removeCustomGridEntity,
26
+ spawnCustomGridEntity,
27
27
  } from "./features/customGridEntity";
28
28
  export * from "./features/customStage/exports";
29
29
  export * from "./features/customTrapdoor/exports";
@@ -204,5 +204,4 @@ export * from "./types/PickupIndex";
204
204
  export * from "./types/PlayerIndex";
205
205
  export * from "./types/PossibleStatType";
206
206
  export * from "./types/SerializedIsaacAPIClass";
207
- export * from "./types/TrapdoorDestination";
208
207
  export * from "./types/TSTLClass";
@@ -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
  }