isaacscript-common 71.2.0 → 71.2.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.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 71.2.0
3
+ isaacscript-common 71.2.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -42173,6 +42173,32 @@ function RunNextRoom.prototype.runNextRoom(self, func)
42173
42173
  ____v_run_queuedFunctions_0[#____v_run_queuedFunctions_0 + 1] = func
42174
42174
  end
42175
42175
  __TS__DecorateLegacy({Exported}, RunNextRoom.prototype, "runNextRoom", true)
42176
+ return ____exports
42177
+ end,
42178
+ ["src.functions.curses"] = function(...)
42179
+ local ____lualib = require("lualib_bundle")
42180
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
42181
+ local ____exports = {}
42182
+ local ____cachedClasses = require("src.core.cachedClasses")
42183
+ local game = ____cachedClasses.game
42184
+ local ____flag = require("src.functions.flag")
42185
+ local hasFlag = ____flag.hasFlag
42186
+ function ____exports.getCurseIDByName(self, name)
42187
+ local curseID = Isaac.GetCurseIdByName(name)
42188
+ if curseID == -1 then
42189
+ error(("Failed to get the curse ID corresponding to the curse name of \"" .. tostring(curseID)) .. "\". Does this name match what you put in the \"content/curses.xml\" file?")
42190
+ end
42191
+ return 1 << curseID - 1
42192
+ end
42193
+ function ____exports.hasCurse(self, ...)
42194
+ local curses = {...}
42195
+ local level = game:GetLevel()
42196
+ local levelCurses = level:GetCurses()
42197
+ return __TS__ArraySome(
42198
+ curses,
42199
+ function(____, curse) return hasFlag(nil, levelCurses, curse) end
42200
+ )
42201
+ end
42176
42202
  return ____exports
42177
42203
  end,
42178
42204
  ["src.functions.nextStage"] = function(...)
@@ -42180,10 +42206,13 @@ local ____exports = {}
42180
42206
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
42181
42207
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
42182
42208
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
42209
+ local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
42183
42210
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
42184
42211
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
42185
42212
  local ____cachedClasses = require("src.core.cachedClasses")
42186
42213
  local game = ____cachedClasses.game
42214
+ local ____curses = require("src.functions.curses")
42215
+ local hasCurse = ____curses.hasCurse
42187
42216
  local ____roomData = require("src.functions.roomData")
42188
42217
  local getRoomGridIndex = ____roomData.getRoomGridIndex
42189
42218
  local ____stage = require("src.functions.stage")
@@ -42223,7 +42252,7 @@ function ____exports.getNextStage(self)
42223
42252
  if repentanceStage then
42224
42253
  return asNumber(nil, stage) + 1
42225
42254
  end
42226
- if stage == LevelStage.DEPTHS_2 then
42255
+ if stage == LevelStage.DEPTHS_2 or stage == LevelStage.DEPTHS_1 and hasCurse(nil, LevelCurse.LABYRINTH) then
42227
42256
  return LevelStage.DEPTHS_2
42228
42257
  end
42229
42258
  return stage
@@ -55083,32 +55112,6 @@ function ____exports.renderChargeBar(self, sprites, position, normalCharges, bat
55083
55112
  sprites.meterBattery:Render(position, batteryChargesClamp)
55084
55113
  sprites.lines:Render(position)
55085
55114
  end
55086
- return ____exports
55087
- end,
55088
- ["src.functions.curses"] = function(...)
55089
- local ____lualib = require("lualib_bundle")
55090
- local __TS__ArraySome = ____lualib.__TS__ArraySome
55091
- local ____exports = {}
55092
- local ____cachedClasses = require("src.core.cachedClasses")
55093
- local game = ____cachedClasses.game
55094
- local ____flag = require("src.functions.flag")
55095
- local hasFlag = ____flag.hasFlag
55096
- function ____exports.getCurseIDByName(self, name)
55097
- local curseID = Isaac.GetCurseIdByName(name)
55098
- if curseID == -1 then
55099
- error(("Failed to get the curse ID corresponding to the curse name of \"" .. tostring(curseID)) .. "\". Does this name match what you put in the \"content/curses.xml\" file?")
55100
- end
55101
- return 1 << curseID - 1
55102
- end
55103
- function ____exports.hasCurse(self, ...)
55104
- local curses = {...}
55105
- local level = game:GetLevel()
55106
- local levelCurses = level:GetCurses()
55107
- return __TS__ArraySome(
55108
- curses,
55109
- function(____, curse) return hasFlag(nil, levelCurses, curse) end
55110
- )
55111
- end
55112
55115
  return ____exports
55113
55116
  end,
55114
55117
  ["src.functions.decorators"] = function(...)
@@ -1 +1 @@
1
- {"version":3,"file":"nextStage.d.ts","sourceRoot":"","sources":["../../../src/functions/nextStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,UAAU,CAyFzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,UAAQ,GAAG,SAAS,CAiF3D"}
1
+ {"version":3,"file":"nextStage.d.ts","sourceRoot":"","sources":["../../../src/functions/nextStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAWtC;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,UAAU,CA4FzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,UAAQ,GAAG,SAAS,CAiF3D"}
@@ -2,10 +2,13 @@ local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
4
4
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
5
+ local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
5
6
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
6
7
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
7
8
  local ____cachedClasses = require("src.core.cachedClasses")
8
9
  local game = ____cachedClasses.game
10
+ local ____curses = require("src.functions.curses")
11
+ local hasCurse = ____curses.hasCurse
9
12
  local ____roomData = require("src.functions.roomData")
10
13
  local getRoomGridIndex = ____roomData.getRoomGridIndex
11
14
  local ____stage = require("src.functions.stage")
@@ -51,7 +54,7 @@ function ____exports.getNextStage(self)
51
54
  if repentanceStage then
52
55
  return asNumber(nil, stage) + 1
53
56
  end
54
- if stage == LevelStage.DEPTHS_2 then
57
+ if stage == LevelStage.DEPTHS_2 or stage == LevelStage.DEPTHS_1 and hasCurse(nil, LevelCurse.LABYRINTH) then
55
58
  return LevelStage.DEPTHS_2
56
59
  end
57
60
  return stage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "71.2.0",
3
+ "version": "71.2.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  GameStateFlag,
3
3
  GridRoom,
4
+ LevelCurse,
4
5
  LevelStage,
5
6
  StageType,
6
7
  } from "isaac-typescript-definitions";
7
8
  import { game } from "../core/cachedClasses";
9
+ import { hasCurse } from "./curses";
8
10
  import { getRoomGridIndex } from "./roomData";
9
11
  import {
10
12
  calculateStageType,
@@ -56,7 +58,10 @@ export function getNextStage(): LevelStage {
56
58
  return asNumber(stage) + 1;
57
59
  }
58
60
 
59
- if (stage === LevelStage.DEPTHS_2) {
61
+ if (
62
+ stage === LevelStage.DEPTHS_2 ||
63
+ (stage === LevelStage.DEPTHS_1 && hasCurse(LevelCurse.LABYRINTH))
64
+ ) {
60
65
  // From Depths 2 to Mausoleum 2 through the strange door.
61
66
  return LevelStage.DEPTHS_2;
62
67
  }