isaacscript-common 28.1.3 → 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.
@@ -12771,12 +12783,44 @@ export declare function onSetSeed(): boolean;
12771
12783
 
12772
12784
  export declare function onSheol(): boolean;
12773
12785
 
12786
+ /**
12787
+ * Helper function to check if the current room matches one of the given stages.
12788
+ *
12789
+ * This function is variadic, which means you can pass as many stages as you want to match for.
12790
+ */
12791
+ export declare function onStage(...stages: LevelStage[]): boolean;
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
+
12774
12800
  /**
12775
12801
  * Helper function to check if the current stage is one that has the possibility to grant a natural
12776
12802
  * Devil Room or Angel Room after killing the boss.
12777
12803
  */
12778
12804
  export declare function onStageWithNaturalDevilRoom(): boolean;
12779
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
+
12780
12824
  /**
12781
12825
  * For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been
12782
12826
  * discovered yet will not be opened.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 28.1.3
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
 
@@ -26802,6 +26802,8 @@ ____exports.STAGE_TYPE_TO_LETTER = {
26802
26802
  return ____exports
26803
26803
  end,
26804
26804
  ["src.functions.stage"] = function(...)
26805
+ local ____lualib = require("lualib_bundle")
26806
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
26805
26807
  local ____exports = {}
26806
26808
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
26807
26809
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
@@ -26936,6 +26938,14 @@ function ____exports.onDarkRoom(self)
26936
26938
  local stageType = level:GetStageType()
26937
26939
  return stage == LevelStage.DARK_ROOM_CHEST and stageType == StageType.ORIGINAL
26938
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
26939
26949
  function ____exports.onFinalFloor(self)
26940
26950
  local level = game:GetLevel()
26941
26951
  local stage = level:GetStage()
@@ -26952,10 +26962,45 @@ function ____exports.onSheol(self)
26952
26962
  local stageType = level:GetStageType()
26953
26963
  return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.ORIGINAL
26954
26964
  end
26965
+ function ____exports.onStage(self, ...)
26966
+ local stages = {...}
26967
+ local level = game:GetLevel()
26968
+ local thisStage = level:GetStage()
26969
+ return __TS__ArraySome(
26970
+ stages,
26971
+ function(____, stage) return stage == thisStage end
26972
+ )
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
26955
26983
  function ____exports.onStageWithNaturalDevilRoom(self)
26956
26984
  local effectiveStage = ____exports.getEffectiveStage(nil)
26957
26985
  return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
26958
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
26959
27004
  function ____exports.setStage(self, stage, stageType, reseed)
26960
27005
  if reseed == nil then
26961
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.
@@ -86,11 +97,38 @@ export declare function onFirstFloor(): boolean;
86
97
  */
87
98
  export declare function onRepentanceStage(): boolean;
88
99
  export declare function onSheol(): boolean;
100
+ /**
101
+ * Helper function to check if the current room matches one of the given stages.
102
+ *
103
+ * This function is variadic, which means you can pass as many stages as you want to match for.
104
+ */
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;
89
112
  /**
90
113
  * Helper function to check if the current stage is one that has the possibility to grant a natural
91
114
  * Devil Room or Angel Room after killing the boss.
92
115
  */
93
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;
94
132
  /**
95
133
  * Helper function to warp to a new stage/level.
96
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,O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AAgB,WAAW,CAAC,GAAG,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAI/D;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAMrD;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAKzD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAS1D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAStD;AAED;;;;;;;;GAQG;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"}
@@ -1,3 +1,5 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
1
3
  local ____exports = {}
2
4
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
5
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
@@ -154,6 +156,8 @@ function ____exports.goToStage(self, stage, stageType)
154
156
  local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
155
157
  Isaac.ExecuteCommand(command)
156
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.
157
161
  function ____exports.onAscent(self)
158
162
  return game:GetStateFlag(GameStateFlag.BACKWARDS_PATH)
159
163
  end
@@ -175,6 +179,18 @@ function ____exports.onDarkRoom(self)
175
179
  local stageType = level:GetStageType()
176
180
  return stage == LevelStage.DARK_ROOM_CHEST and stageType == StageType.ORIGINAL
177
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
178
194
  --- Returns whether or not the player is on the "final floor" of the particular run. The final floor
179
195
  -- is defined as one that prevents the player from entering the I AM ERROR room on.
180
196
  --
@@ -201,12 +217,59 @@ function ____exports.onSheol(self)
201
217
  local stageType = level:GetStageType()
202
218
  return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.ORIGINAL
203
219
  end
220
+ --- Helper function to check if the current room matches one of the given stages.
221
+ --
222
+ -- This function is variadic, which means you can pass as many stages as you want to match for.
223
+ function ____exports.onStage(self, ...)
224
+ local stages = {...}
225
+ local level = game:GetLevel()
226
+ local thisStage = level:GetStage()
227
+ return __TS__ArraySome(
228
+ stages,
229
+ function(____, stage) return stage == thisStage end
230
+ )
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
204
244
  --- Helper function to check if the current stage is one that has the possibility to grant a natural
205
245
  -- Devil Room or Angel Room after killing the boss.
206
246
  function ____exports.onStageWithNaturalDevilRoom(self)
207
247
  local effectiveStage = ____exports.getEffectiveStage(nil)
208
248
  return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
209
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
210
273
  --- Helper function to warp to a new stage/level.
211
274
  --
212
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.1.3",
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.
@@ -288,6 +305,28 @@ export function onSheol(): boolean {
288
305
  );
289
306
  }
290
307
 
308
+ /**
309
+ * Helper function to check if the current room matches one of the given stages.
310
+ *
311
+ * This function is variadic, which means you can pass as many stages as you want to match for.
312
+ */
313
+ export function onStage(...stages: LevelStage[]): boolean {
314
+ const level = game.GetLevel();
315
+ const thisStage = level.GetStage();
316
+ return stages.some((stage) => stage === thisStage);
317
+ }
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
+
291
330
  /**
292
331
  * Helper function to check if the current stage is one that has the possibility to grant a natural
293
332
  * Devil Room or Angel Room after killing the boss.
@@ -300,6 +339,47 @@ export function onStageWithNaturalDevilRoom(): boolean {
300
339
  );
301
340
  }
302
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
+
303
383
  /**
304
384
  * Helper function to warp to a new stage/level.
305
385
  *