isaacscript-common 28.2.0 → 28.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12728,6 +12728,10 @@ export declare const NUM_VANILLA_PILL_EFFECTS: number;
12728
12728
  /** Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.) */
12729
12729
  export declare const NUM_VANILLA_TRINKET_TYPES: number;
12730
12730
 
12731
+ /**
12732
+ * Helper function to check if the player has taken Dad's Note. This sets the game state flag of
12733
+ * `GameStateFlag.BACKWARDS_PATH` and causes floor generation to change.
12734
+ */
12731
12735
  export declare function onAscent(): boolean;
12732
12736
 
12733
12737
  export declare function onCathedral(): boolean;
@@ -12738,6 +12742,14 @@ export declare function onDarkRoom(): boolean;
12738
12742
 
12739
12743
  export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
12740
12744
 
12745
+ /**
12746
+ * Helper function to check if the current room matches one of the given stages. This uses the
12747
+ * `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
12748
+ *
12749
+ * This function is variadic, which means you can pass as many stages as you want to match for.
12750
+ */
12751
+ export declare function onEffectiveStage(...effectiveStages: LevelStage[]): boolean;
12752
+
12741
12753
  /**
12742
12754
  * Returns whether or not the player is on the "final floor" of the particular run. The final floor
12743
12755
  * is defined as one that prevents the player from entering the I AM ERROR room on.
@@ -12772,18 +12784,43 @@ export declare function onSetSeed(): boolean;
12772
12784
  export declare function onSheol(): boolean;
12773
12785
 
12774
12786
  /**
12775
- * Helper function to check if the current room matches one of the given room types.
12787
+ * Helper function to check if the current room matches one of the given stages.
12776
12788
  *
12777
- * This function is variadic, which means you can pass as many room types as you want to match for.
12789
+ * This function is variadic, which means you can pass as many stages as you want to match for.
12778
12790
  */
12779
12791
  export declare function onStage(...stages: LevelStage[]): boolean;
12780
12792
 
12793
+ /**
12794
+ * Helper function to check if the current room matches one of the given stage types.
12795
+ *
12796
+ * This function is variadic, which means you can pass as many room types as you want to match for.
12797
+ */
12798
+ export declare function onStageType(...stageTypes: StageType[]): boolean;
12799
+
12781
12800
  /**
12782
12801
  * Helper function to check if the current stage is one that has the possibility to grant a natural
12783
12802
  * Devil Room or Angel Room after killing the boss.
12784
12803
  */
12785
12804
  export declare function onStageWithNaturalDevilRoom(): boolean;
12786
12805
 
12806
+ /**
12807
+ * Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
12808
+ * defeating the boss.
12809
+ */
12810
+ export declare function onStageWithSecretExitToDownpour(): boolean;
12811
+
12812
+ /**
12813
+ * Helper function to check if the current stage will spawn a spiked door to Mausoleum/Gehenna after
12814
+ * defeating the boss.
12815
+ */
12816
+ export declare function onStageWithSecretExitToMausoleum(): boolean;
12817
+
12818
+ /**
12819
+ * Helper function to check if the current stage will spawn a wooden door to Mines/Ashpit after
12820
+ * defeating the boss.
12821
+ */
12822
+ export declare function onStageWithSecretExitToMines(): boolean;
12823
+
12787
12824
  /**
12788
12825
  * For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been
12789
12826
  * discovered yet will not be opened.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 28.2.0
3
+ isaacscript-common 28.3.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -26938,6 +26938,14 @@ function ____exports.onDarkRoom(self)
26938
26938
  local stageType = level:GetStageType()
26939
26939
  return stage == LevelStage.DARK_ROOM_CHEST and stageType == StageType.ORIGINAL
26940
26940
  end
26941
+ function ____exports.onEffectiveStage(self, ...)
26942
+ local effectiveStages = {...}
26943
+ local thisEffectiveStage = ____exports.getEffectiveStage(nil)
26944
+ return __TS__ArraySome(
26945
+ effectiveStages,
26946
+ function(____, effectiveStage) return effectiveStage == thisEffectiveStage end
26947
+ )
26948
+ end
26941
26949
  function ____exports.onFinalFloor(self)
26942
26950
  local level = game:GetLevel()
26943
26951
  local stage = level:GetStage()
@@ -26963,10 +26971,36 @@ function ____exports.onStage(self, ...)
26963
26971
  function(____, stage) return stage == thisStage end
26964
26972
  )
26965
26973
  end
26974
+ function ____exports.onStageType(self, ...)
26975
+ local stageTypes = {...}
26976
+ local level = game:GetLevel()
26977
+ local thisStageType = level:GetStageType()
26978
+ return __TS__ArraySome(
26979
+ stageTypes,
26980
+ function(____, stageType) return stageType == thisStageType end
26981
+ )
26982
+ end
26966
26983
  function ____exports.onStageWithNaturalDevilRoom(self)
26967
26984
  local effectiveStage = ____exports.getEffectiveStage(nil)
26968
26985
  return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
26969
26986
  end
26987
+ function ____exports.onStageWithSecretExitToDownpour(self)
26988
+ local level = game:GetLevel()
26989
+ local stage = level:GetStage()
26990
+ return stage == LevelStage.BASEMENT_1 or stage == LevelStage.BASEMENT_2
26991
+ end
26992
+ function ____exports.onStageWithSecretExitToMausoleum(self)
26993
+ local level = game:GetLevel()
26994
+ local stage = level:GetStage()
26995
+ local repentanceStage = ____exports.onRepentanceStage(nil)
26996
+ return stage == LevelStage.DEPTHS_1 and not repentanceStage or stage == LevelStage.CAVES_2 and repentanceStage
26997
+ end
26998
+ function ____exports.onStageWithSecretExitToMines(self)
26999
+ local level = game:GetLevel()
27000
+ local stage = level:GetStage()
27001
+ local repentanceStage = ____exports.onRepentanceStage(nil)
27002
+ return stage == LevelStage.CAVES_1 and not repentanceStage or stage == LevelStage.BASEMENT_2 and repentanceStage
27003
+ end
26970
27004
  function ____exports.setStage(self, stage, stageType, reseed)
26971
27005
  if reseed == nil then
26972
27006
  reseed = false
@@ -60,10 +60,21 @@ export declare function goToStage(stage: LevelStage, stageType: StageType): void
60
60
  * `StageType.REPENTANCE_B`.
61
61
  */
62
62
  export declare function isRepentanceStage(stageType: StageType): boolean;
63
+ /**
64
+ * Helper function to check if the player has taken Dad's Note. This sets the game state flag of
65
+ * `GameStateFlag.BACKWARDS_PATH` and causes floor generation to change.
66
+ */
63
67
  export declare function onAscent(): boolean;
64
68
  export declare function onCathedral(): boolean;
65
69
  export declare function onChest(): boolean;
66
70
  export declare function onDarkRoom(): boolean;
71
+ /**
72
+ * Helper function to check if the current room matches one of the given stages. This uses the
73
+ * `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
74
+ *
75
+ * This function is variadic, which means you can pass as many stages as you want to match for.
76
+ */
77
+ export declare function onEffectiveStage(...effectiveStages: LevelStage[]): boolean;
67
78
  /**
68
79
  * Returns whether or not the player is on the "final floor" of the particular run. The final floor
69
80
  * is defined as one that prevents the player from entering the I AM ERROR room on.
@@ -87,16 +98,37 @@ export declare function onFirstFloor(): boolean;
87
98
  export declare function onRepentanceStage(): boolean;
88
99
  export declare function onSheol(): boolean;
89
100
  /**
90
- * Helper function to check if the current room matches one of the given room types.
101
+ * Helper function to check if the current room matches one of the given stages.
91
102
  *
92
- * This function is variadic, which means you can pass as many room types as you want to match for.
103
+ * This function is variadic, which means you can pass as many stages as you want to match for.
93
104
  */
94
105
  export declare function onStage(...stages: LevelStage[]): boolean;
106
+ /**
107
+ * Helper function to check if the current room matches one of the given stage types.
108
+ *
109
+ * This function is variadic, which means you can pass as many room types as you want to match for.
110
+ */
111
+ export declare function onStageType(...stageTypes: StageType[]): boolean;
95
112
  /**
96
113
  * Helper function to check if the current stage is one that has the possibility to grant a natural
97
114
  * Devil Room or Angel Room after killing the boss.
98
115
  */
99
116
  export declare function onStageWithNaturalDevilRoom(): boolean;
117
+ /**
118
+ * Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
119
+ * defeating the boss.
120
+ */
121
+ export declare function onStageWithSecretExitToDownpour(): boolean;
122
+ /**
123
+ * Helper function to check if the current stage will spawn a spiked door to Mausoleum/Gehenna after
124
+ * defeating the boss.
125
+ */
126
+ export declare function onStageWithSecretExitToMausoleum(): boolean;
127
+ /**
128
+ * Helper function to check if the current stage will spawn a wooden door to Mines/Ashpit after
129
+ * defeating the boss.
130
+ */
131
+ export declare function onStageWithSecretExitToMines(): boolean;
100
132
  /**
101
133
  * Helper function to warp to a new stage/level.
102
134
  *
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAS9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,GACpB,MAAM,CAaR;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,iCAAiC,UAAQ,GACxC,MAAM,CAOR;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAa7E;AAED,iDAAiD;AACjD,wBAAgB,YAAY,IAAI,SAAS,CAIxC;AAED,8FAA8F;AAC9F,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAIvE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAI/D;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED,wBAAgB,OAAO,IAAI,OAAO,CASjC;AAED,wBAAgB,UAAU,IAAI,OAAO,C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AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
@@ -156,6 +156,8 @@ function ____exports.goToStage(self, stage, stageType)
156
156
  local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
157
157
  Isaac.ExecuteCommand(command)
158
158
  end
159
+ --- Helper function to check if the player has taken Dad's Note. This sets the game state flag of
160
+ -- `GameStateFlag.BACKWARDS_PATH` and causes floor generation to change.
159
161
  function ____exports.onAscent(self)
160
162
  return game:GetStateFlag(GameStateFlag.BACKWARDS_PATH)
161
163
  end
@@ -177,6 +179,18 @@ function ____exports.onDarkRoom(self)
177
179
  local stageType = level:GetStageType()
178
180
  return stage == LevelStage.DARK_ROOM_CHEST and stageType == StageType.ORIGINAL
179
181
  end
182
+ --- Helper function to check if the current room matches one of the given stages. This uses the
183
+ -- `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
184
+ --
185
+ -- This function is variadic, which means you can pass as many stages as you want to match for.
186
+ function ____exports.onEffectiveStage(self, ...)
187
+ local effectiveStages = {...}
188
+ local thisEffectiveStage = ____exports.getEffectiveStage(nil)
189
+ return __TS__ArraySome(
190
+ effectiveStages,
191
+ function(____, effectiveStage) return effectiveStage == thisEffectiveStage end
192
+ )
193
+ end
180
194
  --- Returns whether or not the player is on the "final floor" of the particular run. The final floor
181
195
  -- is defined as one that prevents the player from entering the I AM ERROR room on.
182
196
  --
@@ -203,9 +217,9 @@ function ____exports.onSheol(self)
203
217
  local stageType = level:GetStageType()
204
218
  return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.ORIGINAL
205
219
  end
206
- --- Helper function to check if the current room matches one of the given room types.
220
+ --- Helper function to check if the current room matches one of the given stages.
207
221
  --
208
- -- This function is variadic, which means you can pass as many room types as you want to match for.
222
+ -- This function is variadic, which means you can pass as many stages as you want to match for.
209
223
  function ____exports.onStage(self, ...)
210
224
  local stages = {...}
211
225
  local level = game:GetLevel()
@@ -215,12 +229,47 @@ function ____exports.onStage(self, ...)
215
229
  function(____, stage) return stage == thisStage end
216
230
  )
217
231
  end
232
+ --- Helper function to check if the current room matches one of the given stage types.
233
+ --
234
+ -- This function is variadic, which means you can pass as many room types as you want to match for.
235
+ function ____exports.onStageType(self, ...)
236
+ local stageTypes = {...}
237
+ local level = game:GetLevel()
238
+ local thisStageType = level:GetStageType()
239
+ return __TS__ArraySome(
240
+ stageTypes,
241
+ function(____, stageType) return stageType == thisStageType end
242
+ )
243
+ end
218
244
  --- Helper function to check if the current stage is one that has the possibility to grant a natural
219
245
  -- Devil Room or Angel Room after killing the boss.
220
246
  function ____exports.onStageWithNaturalDevilRoom(self)
221
247
  local effectiveStage = ____exports.getEffectiveStage(nil)
222
248
  return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
223
249
  end
250
+ --- Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
251
+ -- defeating the boss.
252
+ function ____exports.onStageWithSecretExitToDownpour(self)
253
+ local level = game:GetLevel()
254
+ local stage = level:GetStage()
255
+ return stage == LevelStage.BASEMENT_1 or stage == LevelStage.BASEMENT_2
256
+ end
257
+ --- Helper function to check if the current stage will spawn a spiked door to Mausoleum/Gehenna after
258
+ -- defeating the boss.
259
+ function ____exports.onStageWithSecretExitToMausoleum(self)
260
+ local level = game:GetLevel()
261
+ local stage = level:GetStage()
262
+ local repentanceStage = ____exports.onRepentanceStage(nil)
263
+ return stage == LevelStage.DEPTHS_1 and not repentanceStage or stage == LevelStage.CAVES_2 and repentanceStage
264
+ end
265
+ --- Helper function to check if the current stage will spawn a wooden door to Mines/Ashpit after
266
+ -- defeating the boss.
267
+ function ____exports.onStageWithSecretExitToMines(self)
268
+ local level = game:GetLevel()
269
+ local stage = level:GetStage()
270
+ local repentanceStage = ____exports.onRepentanceStage(nil)
271
+ return stage == LevelStage.CAVES_1 and not repentanceStage or stage == LevelStage.BASEMENT_2 and repentanceStage
272
+ end
224
273
  --- Helper function to warp to a new stage/level.
225
274
  --
226
275
  -- @param stage The stage number to warp to.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "28.2.0",
3
+ "version": "28.3.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -198,6 +198,10 @@ export function isRepentanceStage(stageType: StageType): boolean {
198
198
  );
199
199
  }
200
200
 
201
+ /**
202
+ * Helper function to check if the player has taken Dad's Note. This sets the game state flag of
203
+ * `GameStateFlag.BACKWARDS_PATH` and causes floor generation to change.
204
+ */
201
205
  export function onAscent(): boolean {
202
206
  return game.GetStateFlag(GameStateFlag.BACKWARDS_PATH);
203
207
  }
@@ -234,6 +238,19 @@ export function onDarkRoom(): boolean {
234
238
  );
235
239
  }
236
240
 
241
+ /**
242
+ * Helper function to check if the current room matches one of the given stages. This uses the
243
+ * `getEffectiveStage` helper function so that the Repentance floors are correctly adjusted.
244
+ *
245
+ * This function is variadic, which means you can pass as many stages as you want to match for.
246
+ */
247
+ export function onEffectiveStage(...effectiveStages: LevelStage[]): boolean {
248
+ const thisEffectiveStage = getEffectiveStage();
249
+ return effectiveStages.some(
250
+ (effectiveStage) => effectiveStage === thisEffectiveStage,
251
+ );
252
+ }
253
+
237
254
  /**
238
255
  * Returns whether or not the player is on the "final floor" of the particular run. The final floor
239
256
  * is defined as one that prevents the player from entering the I AM ERROR room on.
@@ -289,9 +306,9 @@ export function onSheol(): boolean {
289
306
  }
290
307
 
291
308
  /**
292
- * Helper function to check if the current room matches one of the given room types.
309
+ * Helper function to check if the current room matches one of the given stages.
293
310
  *
294
- * This function is variadic, which means you can pass as many room types as you want to match for.
311
+ * This function is variadic, which means you can pass as many stages as you want to match for.
295
312
  */
296
313
  export function onStage(...stages: LevelStage[]): boolean {
297
314
  const level = game.GetLevel();
@@ -299,6 +316,17 @@ export function onStage(...stages: LevelStage[]): boolean {
299
316
  return stages.some((stage) => stage === thisStage);
300
317
  }
301
318
 
319
+ /**
320
+ * Helper function to check if the current room matches one of the given stage types.
321
+ *
322
+ * This function is variadic, which means you can pass as many room types as you want to match for.
323
+ */
324
+ export function onStageType(...stageTypes: StageType[]): boolean {
325
+ const level = game.GetLevel();
326
+ const thisStageType = level.GetStageType();
327
+ return stageTypes.some((stageType) => stageType === thisStageType);
328
+ }
329
+
302
330
  /**
303
331
  * Helper function to check if the current stage is one that has the possibility to grant a natural
304
332
  * Devil Room or Angel Room after killing the boss.
@@ -311,6 +339,47 @@ export function onStageWithNaturalDevilRoom(): boolean {
311
339
  );
312
340
  }
313
341
 
342
+ /**
343
+ * Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
344
+ * defeating the boss.
345
+ */
346
+ export function onStageWithSecretExitToDownpour(): boolean {
347
+ const level = game.GetLevel();
348
+ const stage = level.GetStage();
349
+
350
+ return stage === LevelStage.BASEMENT_1 || stage === LevelStage.BASEMENT_2;
351
+ }
352
+
353
+ /**
354
+ * Helper function to check if the current stage will spawn a spiked door to Mausoleum/Gehenna after
355
+ * defeating the boss.
356
+ */
357
+ export function onStageWithSecretExitToMausoleum(): boolean {
358
+ const level = game.GetLevel();
359
+ const stage = level.GetStage();
360
+ const repentanceStage = onRepentanceStage();
361
+
362
+ return (
363
+ (stage === LevelStage.DEPTHS_1 && !repentanceStage) ||
364
+ (stage === LevelStage.CAVES_2 && repentanceStage)
365
+ );
366
+ }
367
+
368
+ /**
369
+ * Helper function to check if the current stage will spawn a wooden door to Mines/Ashpit after
370
+ * defeating the boss.
371
+ */
372
+ export function onStageWithSecretExitToMines(): boolean {
373
+ const level = game.GetLevel();
374
+ const stage = level.GetStage();
375
+ const repentanceStage = onRepentanceStage();
376
+
377
+ return (
378
+ (stage === LevelStage.CAVES_1 && !repentanceStage) ||
379
+ (stage === LevelStage.BASEMENT_2 && repentanceStage)
380
+ );
381
+ }
382
+
314
383
  /**
315
384
  * Helper function to warp to a new stage/level.
316
385
  *