isaacscript-common 19.0.0 → 19.0.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.
package/dist/index.d.ts CHANGED
@@ -4563,7 +4563,7 @@ export declare function getDoorsToRoomIndex(...roomGridIndex: int[]): GridEntity
4563
4563
  * the third level of the run, but the game considers it to have a stage of 2. This function will
4564
4564
  * consider Downpour 2 to have a stage of 3.
4565
4565
  */
4566
- export declare function getEffectiveStage(): int;
4566
+ export declare function getEffectiveStage(): LevelStage;
4567
4567
 
4568
4568
  /**
4569
4569
  * Helper function to get all of the effects in the room.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 19.0.0
3
+ isaacscript-common 19.0.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -25540,7 +25540,7 @@ end
25540
25540
  function ____exports.onFirstFloor(self)
25541
25541
  local effectiveStage = ____exports.getEffectiveStage(nil)
25542
25542
  local isOnAscent = ____exports.onAscent(nil)
25543
- return effectiveStage == 1 and not isOnAscent
25543
+ return effectiveStage == LevelStage.BASEMENT_1 and not isOnAscent
25544
25544
  end
25545
25545
  function ____exports.onSheol(self)
25546
25546
  local level = game:GetLevel()
@@ -25550,7 +25550,7 @@ function ____exports.onSheol(self)
25550
25550
  end
25551
25551
  function ____exports.onStageWithNaturalDevilRoom(self)
25552
25552
  local effectiveStage = ____exports.getEffectiveStage(nil)
25553
- return inRange(nil, effectiveStage, 2, 8)
25553
+ return inRange(nil, effectiveStage, 2, 8) and effectiveStage ~= LevelStage.BLUE_WOMB
25554
25554
  end
25555
25555
  function ____exports.setStage(self, stage, stageType, reseed)
25556
25556
  if reseed == nil then
@@ -14,7 +14,7 @@ export declare function calculateStageTypeRepentance(stage: LevelStage): StageTy
14
14
  * the third level of the run, but the game considers it to have a stage of 2. This function will
15
15
  * consider Downpour 2 to have a stage of 3.
16
16
  */
17
- export declare function getEffectiveStage(): int;
17
+ export declare function getEffectiveStage(): LevelStage;
18
18
  /**
19
19
  * Helper function to get the English name of the level. For example, "Caves 1".
20
20
  *
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,8BAA8B,CAAC;AAStC;;;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,GAAG,CASvC;AAGD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,GACpB,MAAM,CAaR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,MAAM,CAG3E;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;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,CAQpC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED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AAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED,wBAAgB,OAAO,IAAI,OAAO,CASjC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAQpC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAK3C;AAED,wBAAgB,OAAO,IAAI,OAAO,CAQjC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAKrD;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"}
@@ -160,7 +160,7 @@ end
160
160
  function ____exports.onFirstFloor(self)
161
161
  local effectiveStage = ____exports.getEffectiveStage(nil)
162
162
  local isOnAscent = ____exports.onAscent(nil)
163
- return effectiveStage == 1 and not isOnAscent
163
+ return effectiveStage == LevelStage.BASEMENT_1 and not isOnAscent
164
164
  end
165
165
  function ____exports.onSheol(self)
166
166
  local level = game:GetLevel()
@@ -172,7 +172,7 @@ end
172
172
  -- Devil Room or Angel Room after killing the boss.
173
173
  function ____exports.onStageWithNaturalDevilRoom(self)
174
174
  local effectiveStage = ____exports.getEffectiveStage(nil)
175
- return inRange(nil, effectiveStage, 2, 8)
175
+ return inRange(nil, effectiveStage, 2, 8) and effectiveStage ~= LevelStage.BLUE_WOMB
176
176
  end
177
177
  --- Helper function to warp to a new stage/level.
178
178
  --
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "19.0.0",
3
+ "version": "19.0.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -77,7 +77,7 @@ export function calculateStageTypeRepentance(stage: LevelStage): StageType {
77
77
  * the third level of the run, but the game considers it to have a stage of 2. This function will
78
78
  * consider Downpour 2 to have a stage of 3.
79
79
  */
80
- export function getEffectiveStage(): int {
80
+ export function getEffectiveStage(): LevelStage {
81
81
  const level = game.GetLevel();
82
82
  const stage = level.GetStage();
83
83
 
@@ -224,7 +224,7 @@ export function onFirstFloor(): boolean {
224
224
  const effectiveStage = getEffectiveStage();
225
225
  const isOnAscent = onAscent();
226
226
 
227
- return effectiveStage === 1 && !isOnAscent;
227
+ return effectiveStage === LevelStage.BASEMENT_1 && !isOnAscent;
228
228
  }
229
229
 
230
230
  /**
@@ -254,7 +254,9 @@ export function onSheol(): boolean {
254
254
  */
255
255
  export function onStageWithNaturalDevilRoom(): boolean {
256
256
  const effectiveStage = getEffectiveStage();
257
- return inRange(effectiveStage, 2, 8);
257
+ return (
258
+ inRange(effectiveStage, 2, 8) && effectiveStage !== LevelStage.BLUE_WOMB
259
+ );
258
260
  }
259
261
 
260
262
  /**