isaacscript-common 28.1.3 → 28.2.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.
@@ -12771,6 +12771,13 @@ export declare function onSetSeed(): boolean;
12771
12771
 
12772
12772
  export declare function onSheol(): boolean;
12773
12773
 
12774
+ /**
12775
+ * Helper function to check if the current room matches one of the given room types.
12776
+ *
12777
+ * This function is variadic, which means you can pass as many room types as you want to match for.
12778
+ */
12779
+ export declare function onStage(...stages: LevelStage[]): boolean;
12780
+
12774
12781
  /**
12775
12782
  * Helper function to check if the current stage is one that has the possibility to grant a natural
12776
12783
  * Devil Room or Angel Room after killing the boss.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 28.1.3
3
+ isaacscript-common 28.2.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
@@ -26952,6 +26954,15 @@ function ____exports.onSheol(self)
26952
26954
  local stageType = level:GetStageType()
26953
26955
  return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.ORIGINAL
26954
26956
  end
26957
+ function ____exports.onStage(self, ...)
26958
+ local stages = {...}
26959
+ local level = game:GetLevel()
26960
+ local thisStage = level:GetStage()
26961
+ return __TS__ArraySome(
26962
+ stages,
26963
+ function(____, stage) return stage == thisStage end
26964
+ )
26965
+ end
26955
26966
  function ____exports.onStageWithNaturalDevilRoom(self)
26956
26967
  local effectiveStage = ____exports.getEffectiveStage(nil)
26957
26968
  return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
@@ -86,6 +86,12 @@ export declare function onFirstFloor(): boolean;
86
86
  */
87
87
  export declare function onRepentanceStage(): boolean;
88
88
  export declare function onSheol(): boolean;
89
+ /**
90
+ * Helper function to check if the current room matches one of the given room types.
91
+ *
92
+ * This function is variadic, which means you can pass as many room types as you want to match for.
93
+ */
94
+ export declare function onStage(...stages: LevelStage[]): boolean;
89
95
  /**
90
96
  * Helper function to check if the current stage is one that has the possibility to grant a natural
91
97
  * Devil Room or Angel Room after killing the boss.
@@ -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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M,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
@@ -201,6 +203,18 @@ function ____exports.onSheol(self)
201
203
  local stageType = level:GetStageType()
202
204
  return stage == LevelStage.SHEOL_CATHEDRAL and stageType == StageType.ORIGINAL
203
205
  end
206
+ --- Helper function to check if the current room matches one of the given room types.
207
+ --
208
+ -- This function is variadic, which means you can pass as many room types as you want to match for.
209
+ function ____exports.onStage(self, ...)
210
+ local stages = {...}
211
+ local level = game:GetLevel()
212
+ local thisStage = level:GetStage()
213
+ return __TS__ArraySome(
214
+ stages,
215
+ function(____, stage) return stage == thisStage end
216
+ )
217
+ end
204
218
  --- Helper function to check if the current stage is one that has the possibility to grant a natural
205
219
  -- Devil Room or Angel Room after killing the boss.
206
220
  function ____exports.onStageWithNaturalDevilRoom(self)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "28.1.3",
3
+ "version": "28.2.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -288,6 +288,17 @@ export function onSheol(): boolean {
288
288
  );
289
289
  }
290
290
 
291
+ /**
292
+ * Helper function to check if the current room matches one of the given room types.
293
+ *
294
+ * This function is variadic, which means you can pass as many room types as you want to match for.
295
+ */
296
+ export function onStage(...stages: LevelStage[]): boolean {
297
+ const level = game.GetLevel();
298
+ const thisStage = level.GetStage();
299
+ return stages.some((stage) => stage === thisStage);
300
+ }
301
+
291
302
  /**
292
303
  * Helper function to check if the current stage is one that has the possibility to grant a natural
293
304
  * Devil Room or Angel Room after killing the boss.