isaacscript-common 77.3.1 → 78.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"RerunDetection.d.ts","sourceRoot":"","sources":["../../../../src/classes/features/other/RerunDetection.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD,qBAAa,cAAe,SAAQ,OAAO;IAkBzC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CASvC;IAGF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAIpC;IAEF;;;;;;;;;;OAUG;IAEI,OAAO,IAAI,OAAO;CAG1B"}
1
+ {"version":3,"file":"RerunDetection.d.ts","sourceRoot":"","sources":["../../../../src/classes/features/other/RerunDetection.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAUhD,qBAAa,cAAe,SAAQ,OAAO;IAkBzC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAcvC;IAGF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAEpC;IAEF;;;;;;;;;;OAUG;IAEI,OAAO,IAAI,OAAO;CAG1B"}
@@ -13,7 +13,7 @@ local ____stage = require("functions.stage")
13
13
  local onFirstFloor = ____stage.onFirstFloor
14
14
  local ____Feature = require("classes.private.Feature")
15
15
  local Feature = ____Feature.Feature
16
- local v = {run = {pastFirstFloor = false, onRerun = false}}
16
+ local v = {persistent = {pastFirstFloor = false, onRerun = false}}
17
17
  ____exports.RerunDetection = __TS__Class()
18
18
  local RerunDetection = ____exports.RerunDetection
19
19
  RerunDetection.name = "RerunDetection"
@@ -22,19 +22,26 @@ function RerunDetection.prototype.____constructor(self)
22
22
  Feature.prototype.____constructor(self)
23
23
  self.v = v
24
24
  self.postGameStartedReordered = function(____, isContinued)
25
- if isContinued and onFirstFloor(nil) and inStartingRoom(nil) and v.run.pastFirstFloor then
26
- v.run.onRerun = true
25
+ Isaac.DebugString("GETTING HERE 1 - " .. tostring(isContinued))
26
+ Isaac.DebugString("GETTING HERE 2 - " .. tostring(onFirstFloor(nil)))
27
+ Isaac.DebugString("GETTING HERE 3 - " .. tostring(inStartingRoom(nil)))
28
+ Isaac.DebugString("GETTING HERE 4 - " .. tostring(v.persistent.pastFirstFloor))
29
+ Isaac.DebugString("GETTING HERE 5 - " .. tostring(v.persistent.onRerun))
30
+ if isContinued then
31
+ if onFirstFloor(nil) and inStartingRoom(nil) and v.persistent.pastFirstFloor then
32
+ v.persistent.onRerun = true
33
+ end
34
+ else
35
+ v.persistent.onRerun = false
27
36
  end
28
37
  end
29
38
  self.postNewLevelReordered = function()
30
- if not onFirstFloor(nil) then
31
- v.run.pastFirstFloor = true
32
- end
39
+ v.persistent.pastFirstFloor = not onFirstFloor(nil)
33
40
  end
34
41
  self.customCallbacksUsed = {{ModCallbackCustom.POST_GAME_STARTED_REORDERED, self.postGameStartedReordered}, {ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
35
42
  end
36
43
  function RerunDetection.prototype.onRerun(self)
37
- return v.run.onRerun
44
+ return v.persistent.onRerun
38
45
  end
39
46
  __TS__DecorateLegacy({Exported}, RerunDetection.prototype, "onRerun", true)
40
47
  return ____exports
@@ -118,7 +118,7 @@ export declare class SaveDataManager extends Feature {
118
118
  *
119
119
  * Some features may have variables that need to be automatically reset per run/level, but not
120
120
  * saved to disk on game exit. (For example, if they contain functions or other non-serializable
121
- * data.) For these cases, set the second argument to `false`.
121
+ * data.) For these cases, set the second argument of this function to `false`.
122
122
  *
123
123
  * Note that when the player uses Glowing Hourglass, the save data manager will automatically
124
124
  * restore any variables on a "run" or "level" object with a backup that was created when the room
@@ -126,8 +126,8 @@ export declare class SaveDataManager extends Feature {
126
126
  * your mod features that use the save data manager. If this is undesired for your specific
127
127
  * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
128
128
  *
129
- * If you want the automatic variable restoring with Glowing Hour Glass functionality to apply to
130
- * a "persistent" object, you can add a key of `__rewindWithGlowingHourGlass: true` to the object.
129
+ * By default, the Glowing Hour Glass functionality will not apply to "persistent" objects. If
130
+ * this is undesired, you can add a key of `__rewindWithGlowingHourGlass: true` to the object.
131
131
  *
132
132
  * @param key The name of the file or feature that is submitting data to be managed by the save
133
133
  * data manager. The save data manager will throw an error if the key is already
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAST,SAAS,EACT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAuCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAcnD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,EAC3B,iCAAiC,UAAQ,GACxC,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAclC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAOlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,4BAA4B,UAAQ,GAC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AE,cAAc,GAAG,OAAO,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -55,14 +55,12 @@ export declare function getStageID(stage?: LevelStage, stageType?: StageType): S
55
55
  /** Alias for the `Level.GetStageType` method. */
56
56
  export declare function getStageType(): StageType;
57
57
  /**
58
- * Helper function to directly warp to a specific stage using the "stage" console command.
59
- *
60
- * Note that if you use this function on game frame 0, it will confuse the
61
- * `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
62
- * callbacks. If you are using the function in this situation, remember to call the
63
- * `reorderedCallbacksSetStage` function.
58
+ * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
59
+ * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
60
+ * console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
61
+ * to "c".
64
62
  */
65
- export declare function goToStage(stage: LevelStage, stageType: StageType): void;
63
+ export declare function getStageTypeSuffix(stageType: StageType): string;
66
64
  /**
67
65
  * Returns whether the provided stage and stage type represent a "final floor". This is defined as a
68
66
  * floor that prevents the player from entering the I AM ERROR room on.
@@ -223,11 +221,16 @@ export declare function onStageWithShovelTrapdoors(): boolean;
223
221
  */
224
222
  export declare function onStageWithStoryBoss(): boolean;
225
223
  /**
226
- * Helper function to warp to a new stage/level.
224
+ * Helper function to directly warp to a specific stage using the "stage" console command.
227
225
  *
228
- * Note that this is different from the `Level.SetStage` method, which will change the stage and/or
226
+ * This is different from the vanilla `Level.SetStage` method, which will change the stage and/or
229
227
  * stage type of the current floor without moving the player to a new floor.
230
228
  *
229
+ * Note that if you use this function on game frame 0, it will confuse the
230
+ * `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
231
+ * callbacks. If you are using the function in this situation, remember to call the
232
+ * `reorderedCallbacksSetStage` function.
233
+ *
231
234
  * @param stage The stage number to warp to.
232
235
  * @param stageType The stage type to warp to.
233
236
  * @param reseed Optional. Whether to reseed the floor upon arrival. Default is false. Set this to
@@ -235,11 +238,4 @@ export declare function onStageWithStoryBoss(): boolean;
235
238
  * floor layout will be identical to the old floor).
236
239
  */
237
240
  export declare function setStage(stage: LevelStage, stageType: StageType, reseed?: boolean): void;
238
- /**
239
- * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
240
- * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
241
- * console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
242
- * to "c".
243
- */
244
- export declare function stageTypeToLetter(stageType: StageType): string;
245
241
  //# sourceMappingURL=stage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,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;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,iCAAiC,UAAQ,GACxC,MAAM,CAOR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,K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AAE,GAAG,OAAO,CAIxD;AAED,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAI1D;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAIzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAI/D;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAGrD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAK1D;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAKzD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAM1D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAMtD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAMpD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAYN"}
@@ -16,8 +16,8 @@ local ____stageToStageID = require("objects.stageToStageID")
16
16
  local STAGE_TO_STAGE_ID = ____stageToStageID.STAGE_TO_STAGE_ID
17
17
  local ____stageTypeSuffixes = require("objects.stageTypeSuffixes")
18
18
  local STAGE_TYPE_SUFFIXES = ____stageTypeSuffixes.STAGE_TYPE_SUFFIXES
19
- local ____stageTypeToLetter = require("objects.stageTypeToLetter")
20
- local STAGE_TYPE_TO_LETTER = ____stageTypeToLetter.STAGE_TYPE_TO_LETTER
19
+ local ____log = require("functions.log")
20
+ local log = ____log.log
21
21
  local ____types = require("functions.types")
22
22
  local asLevelStage = ____types.asLevelStage
23
23
  local asNumber = ____types.asNumber
@@ -42,13 +42,6 @@ function ____exports.onRepentanceStage(self)
42
42
  local stageType = level:GetStageType()
43
43
  return ____exports.isRepentanceStage(nil, stageType)
44
44
  end
45
- --- Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
46
- -- console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
47
- -- console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
48
- -- to "c".
49
- function ____exports.stageTypeToLetter(self, stageType)
50
- return STAGE_TYPE_TO_LETTER[stageType]
51
- end
52
45
  --- Helper function that calculates what the stage type should be for the provided stage. This
53
46
  -- emulates what the game's internal code does.
54
47
  function ____exports.calculateStageType(self, stage)
@@ -157,16 +150,12 @@ function ____exports.getStageType(self)
157
150
  local level = game:GetLevel()
158
151
  return level:GetStageType()
159
152
  end
160
- --- Helper function to directly warp to a specific stage using the "stage" console command.
161
- --
162
- -- Note that if you use this function on game frame 0, it will confuse the
163
- -- `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
164
- -- callbacks. If you are using the function in this situation, remember to call the
165
- -- `reorderedCallbacksSetStage` function.
166
- function ____exports.goToStage(self, stage, stageType)
167
- local stageTypeLetterSuffix = ____exports.stageTypeToLetter(nil, stageType)
168
- local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
169
- Isaac.ExecuteCommand(command)
153
+ --- Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
154
+ -- console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
155
+ -- console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
156
+ -- to "c".
157
+ function ____exports.getStageTypeSuffix(self, stageType)
158
+ return STAGE_TYPE_SUFFIXES[stageType]
170
159
  end
171
160
  --- Returns whether the provided stage and stage type represent a "final floor". This is defined as a
172
161
  -- floor that prevents the player from entering the I AM ERROR room on.
@@ -370,11 +359,16 @@ function ____exports.onStageWithStoryBoss(self)
370
359
  local stage = level:GetStage()
371
360
  return ____exports.isStageWithStoryBoss(nil, stage)
372
361
  end
373
- --- Helper function to warp to a new stage/level.
362
+ --- Helper function to directly warp to a specific stage using the "stage" console command.
374
363
  --
375
- -- Note that this is different from the `Level.SetStage` method, which will change the stage and/or
364
+ -- This is different from the vanilla `Level.SetStage` method, which will change the stage and/or
376
365
  -- stage type of the current floor without moving the player to a new floor.
377
366
  --
367
+ -- Note that if you use this function on game frame 0, it will confuse the
368
+ -- `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
369
+ -- callbacks. If you are using the function in this situation, remember to call the
370
+ -- `reorderedCallbacksSetStage` function.
371
+ --
378
372
  -- @param stage The stage number to warp to.
379
373
  -- @param stageType The stage type to warp to.
380
374
  -- @param reseed Optional. Whether to reseed the floor upon arrival. Default is false. Set this to
@@ -384,10 +378,12 @@ function ____exports.setStage(self, stage, stageType, reseed)
384
378
  if reseed == nil then
385
379
  reseed = false
386
380
  end
387
- local stageTypeSuffix = STAGE_TYPE_SUFFIXES[stageType]
381
+ local stageTypeSuffix = ____exports.getStageTypeSuffix(nil, stageType)
388
382
  local command = ("stage " .. tostring(stage)) .. stageTypeSuffix
383
+ log("Warping to a stage with a console command of: " .. command)
389
384
  Isaac.ExecuteCommand(command)
390
385
  if reseed then
386
+ log("Reseeding the floor with a console command of: reseed")
391
387
  Isaac.ExecuteCommand("reseed")
392
388
  end
393
389
  end
@@ -7885,6 +7885,14 @@ export declare function getStageID(stage?: LevelStage, stageType?: StageType): S
7885
7885
  /** Alias for the `Level.GetStageType` method. */
7886
7886
  export declare function getStageType(): StageType;
7887
7887
 
7888
+ /**
7889
+ * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
7890
+ * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
7891
+ * console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
7892
+ * to "c".
7893
+ */
7894
+ export declare function getStageTypeSuffix(stageType: StageType): string;
7895
+
7888
7896
  /** Alias for the `Seeds.GetStartSeedString` method. */
7889
7897
  export declare function getStartSeedString(): string;
7890
7898
 
@@ -8184,16 +8192,6 @@ export declare function getVoidDoor(): GridEntityDoor | undefined;
8184
8192
  */
8185
8193
  export declare function giveTrinketsBack(player: EntityPlayer, trinketSituation: TrinketSituation | undefined): void;
8186
8194
 
8187
- /**
8188
- * Helper function to directly warp to a specific stage using the "stage" console command.
8189
- *
8190
- * Note that if you use this function on game frame 0, it will confuse the
8191
- * `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
8192
- * callbacks. If you are using the function in this situation, remember to call the
8193
- * `reorderedCallbacksSetStage` function.
8194
- */
8195
- export declare function goToStage(stage: LevelStage, stageType: StageType): void;
8196
-
8197
8195
  export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
8198
8196
 
8199
8197
  /**
@@ -17141,7 +17139,7 @@ declare class SaveDataManager extends Feature {
17141
17139
  *
17142
17140
  * Some features may have variables that need to be automatically reset per run/level, but not
17143
17141
  * saved to disk on game exit. (For example, if they contain functions or other non-serializable
17144
- * data.) For these cases, set the second argument to `false`.
17142
+ * data.) For these cases, set the second argument of this function to `false`.
17145
17143
  *
17146
17144
  * Note that when the player uses Glowing Hourglass, the save data manager will automatically
17147
17145
  * restore any variables on a "run" or "level" object with a backup that was created when the room
@@ -17149,8 +17147,8 @@ declare class SaveDataManager extends Feature {
17149
17147
  * your mod features that use the save data manager. If this is undesired for your specific
17150
17148
  * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
17151
17149
  *
17152
- * If you want the automatic variable restoring with Glowing Hour Glass functionality to apply to
17153
- * a "persistent" object, you can add a key of `__rewindWithGlowingHourGlass: true` to the object.
17150
+ * By default, the Glowing Hour Glass functionality will not apply to "persistent" objects. If
17151
+ * this is undesired, you can add a key of `__rewindWithGlowingHourGlass: true` to the object.
17154
17152
  *
17155
17153
  * @param key The name of the file or feature that is submitting data to be managed by the save
17156
17154
  * data manager. The save data manager will throw an error if the key is already
@@ -17726,11 +17724,16 @@ export declare function setSeed(rng: RNG, seed: Seed): void;
17726
17724
  export declare function setSpriteOpacity(sprite: Sprite, alpha: float): void;
17727
17725
 
17728
17726
  /**
17729
- * Helper function to warp to a new stage/level.
17727
+ * Helper function to directly warp to a specific stage using the "stage" console command.
17730
17728
  *
17731
- * Note that this is different from the `Level.SetStage` method, which will change the stage and/or
17729
+ * This is different from the vanilla `Level.SetStage` method, which will change the stage and/or
17732
17730
  * stage type of the current floor without moving the player to a new floor.
17733
17731
  *
17732
+ * Note that if you use this function on game frame 0, it will confuse the
17733
+ * `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
17734
+ * callbacks. If you are using the function in this situation, remember to call the
17735
+ * `reorderedCallbacksSetStage` function.
17736
+ *
17734
17737
  * @param stage The stage number to warp to.
17735
17738
  * @param stageType The stage type to warp to.
17736
17739
  * @param reseed Optional. Whether to reseed the floor upon arrival. Default is false. Set this to
@@ -18606,14 +18609,6 @@ export declare interface StageHistoryEntry {
18606
18609
  readonly stageType: StageType;
18607
18610
  }
18608
18611
 
18609
- /**
18610
- * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
18611
- * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
18612
- * console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
18613
- * to "c".
18614
- */
18615
- export declare function stageTypeToLetter(stageType: StageType): string;
18616
-
18617
18612
  declare class StartAmbush extends Feature {
18618
18613
  private readonly runInNFrames;
18619
18614
  /**
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 77.3.0
3
+ isaacscript-common 77.4.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -6476,6 +6476,10 @@ ____exports.MotherVariant.MOTHER_1 = 0
6476
6476
  ____exports.MotherVariant[____exports.MotherVariant.MOTHER_1] = "MOTHER_1"
6477
6477
  ____exports.MotherVariant.MOTHER_2 = 10
6478
6478
  ____exports.MotherVariant[____exports.MotherVariant.MOTHER_2] = "MOTHER_2"
6479
+ ____exports.MotherVariant.DEAD_ISAAC = 20
6480
+ ____exports.MotherVariant[____exports.MotherVariant.DEAD_ISAAC] = "DEAD_ISAAC"
6481
+ ____exports.MotherVariant.WORM = 30
6482
+ ____exports.MotherVariant[____exports.MotherVariant.WORM] = "WORM"
6479
6483
  ____exports.MotherVariant.BALL = 100
6480
6484
  ____exports.MotherVariant[____exports.MotherVariant.BALL] = "BALL"
6481
6485
  --- For `EntityType.SINGE` (915).
@@ -9514,6 +9518,20 @@ ____exports.LaserSubType.RING_FOLLOW_PARENT = 3
9514
9518
  ____exports.LaserSubType[____exports.LaserSubType.RING_FOLLOW_PARENT] = "RING_FOLLOW_PARENT"
9515
9519
  ____exports.LaserSubType.NO_IMPACT = 4
9516
9520
  ____exports.LaserSubType[____exports.LaserSubType.NO_IMPACT] = "NO_IMPACT"
9521
+ --- For `EntityType.GAPER` (10), `GaperVariant.ROTTEN_GAPER` (3).
9522
+ ____exports.RottenGaperSubType = {}
9523
+ ____exports.RottenGaperSubType.V1 = 0
9524
+ ____exports.RottenGaperSubType[____exports.RottenGaperSubType.V1] = "V1"
9525
+ ____exports.RottenGaperSubType.V2 = 1
9526
+ ____exports.RottenGaperSubType[____exports.RottenGaperSubType.V2] = "V2"
9527
+ ____exports.RottenGaperSubType.V3 = 2
9528
+ ____exports.RottenGaperSubType[____exports.RottenGaperSubType.V3] = "V3"
9529
+ ____exports.RottenGaperSubType.V4 = 3
9530
+ ____exports.RottenGaperSubType[____exports.RottenGaperSubType.V4] = "V4"
9531
+ ____exports.RottenGaperSubType.V5 = 4
9532
+ ____exports.RottenGaperSubType[____exports.RottenGaperSubType.V5] = "V5"
9533
+ ____exports.RottenGaperSubType.V6 = 5
9534
+ ____exports.RottenGaperSubType[____exports.RottenGaperSubType.V6] = "V6"
9517
9535
  --- For `EntityType.LARRY_JR` (19), `LarryJrVariant.LARRY_JR` (0).
9518
9536
  ____exports.LarryJrSubType = {}
9519
9537
  ____exports.LarryJrSubType.NORMAL = 0
@@ -9546,6 +9564,12 @@ ____exports.ChargerSubType.CHARGER = 0
9546
9564
  ____exports.ChargerSubType[____exports.ChargerSubType.CHARGER] = "CHARGER"
9547
9565
  ____exports.ChargerSubType.MY_SHADOW = 1
9548
9566
  ____exports.ChargerSubType[____exports.ChargerSubType.MY_SHADOW] = "MY_SHADOW"
9567
+ --- For `EntityType.BOOM_FLY` (25), `BoomFlyVariant.DRAGON_FLY` (3).
9568
+ ____exports.DragonFlySubType = {}
9569
+ ____exports.DragonFlySubType.NORMAL = 0
9570
+ ____exports.DragonFlySubType[____exports.DragonFlySubType.NORMAL] = "NORMAL"
9571
+ ____exports.DragonFlySubType.X = 1
9572
+ ____exports.DragonFlySubType[____exports.DragonFlySubType.X] = "X"
9549
9573
  --- For `EntityType.CHUB` (28), `ChubVariant.CHUB (0)`.
9550
9574
  ____exports.ChubSubType = {}
9551
9575
  ____exports.ChubSubType.NORMAL = 0
@@ -9566,6 +9590,12 @@ ____exports.GurdySubType.NORMAL = 0
9566
9590
  ____exports.GurdySubType[____exports.GurdySubType.NORMAL] = "NORMAL"
9567
9591
  ____exports.GurdySubType.GREEN = 1
9568
9592
  ____exports.GurdySubType[____exports.GurdySubType.GREEN] = "GREEN"
9593
+ --- For `EntityType.BABY` (37), variant `BabyVariant.ANGELIC_BABY`.
9594
+ ____exports.AngelicBabySubType = {}
9595
+ ____exports.AngelicBabySubType.NORMAL = 0
9596
+ ____exports.AngelicBabySubType[____exports.AngelicBabySubType.NORMAL] = "NORMAL"
9597
+ ____exports.AngelicBabySubType.SMALL = 1
9598
+ ____exports.AngelicBabySubType[____exports.AngelicBabySubType.SMALL] = "SMALL"
9569
9599
  --- For `EntityType.MONSTRO_2` (43), `Monstro2Variant.MONSTRO_2` (0).
9570
9600
  ____exports.Monstro2SubType = {}
9571
9601
  ____exports.Monstro2SubType.NORMAL = 0
@@ -9685,6 +9715,19 @@ ____exports.GurglingSubType.YELLOW = 1
9685
9715
  ____exports.GurglingSubType[____exports.GurglingSubType.YELLOW] = "YELLOW"
9686
9716
  ____exports.GurglingSubType.BLACK = 2
9687
9717
  ____exports.GurglingSubType[____exports.GurglingSubType.BLACK] = "BLACK"
9718
+ --- For `EntityType.CONSTANT_STONE_SHOOTER` (202),
9719
+ -- `ConstantStoneShooterVariant.CONSTANT_STONE_SHOOTER` (0).
9720
+ --
9721
+ -- This is the same as the `Direction` enum.
9722
+ ____exports.ConstantStoneShooterSubType = {}
9723
+ ____exports.ConstantStoneShooterSubType.LEFT = 0
9724
+ ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.LEFT] = "LEFT"
9725
+ ____exports.ConstantStoneShooterSubType.UP = 1
9726
+ ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.UP] = "UP"
9727
+ ____exports.ConstantStoneShooterSubType.RIGHT = 2
9728
+ ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.RIGHT] = "RIGHT"
9729
+ ____exports.ConstantStoneShooterSubType.DOWN = 3
9730
+ ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.DOWN] = "DOWN"
9688
9731
  --- For `EntityType.HAUNT` (260), `HauntVariant.HAUNT` (0).
9689
9732
  ____exports.HauntSubType = {}
9690
9733
  ____exports.HauntSubType.NORMAL = 0
@@ -9741,6 +9784,16 @@ ____exports.PolycephalusSubType.RED = 1
9741
9784
  ____exports.PolycephalusSubType[____exports.PolycephalusSubType.RED] = "RED"
9742
9785
  ____exports.PolycephalusSubType.PINK = 2
9743
9786
  ____exports.PolycephalusSubType[____exports.PolycephalusSubType.PINK] = "PINK"
9787
+ --- For `EntityType.LEPER` (310), variant 0.
9788
+ ____exports.LeperSubType = {}
9789
+ ____exports.LeperSubType.STAGE_1 = 0
9790
+ ____exports.LeperSubType[____exports.LeperSubType.STAGE_1] = "STAGE_1"
9791
+ ____exports.LeperSubType.STAGE_2 = 1
9792
+ ____exports.LeperSubType[____exports.LeperSubType.STAGE_2] = "STAGE_2"
9793
+ ____exports.LeperSubType.STAGE_3 = 2
9794
+ ____exports.LeperSubType[____exports.LeperSubType.STAGE_3] = "STAGE_3"
9795
+ ____exports.LeperSubType.STAGE_4 = 3
9796
+ ____exports.LeperSubType[____exports.LeperSubType.STAGE_4] = "STAGE_4"
9744
9797
  --- For `EntityType.STAIN` (401), variant 0.
9745
9798
  ____exports.StainSubType = {}
9746
9799
  ____exports.StainSubType.NORMAL = 0
@@ -9775,25 +9828,74 @@ ____exports.RagManSubType.RED = 1
9775
9828
  ____exports.RagManSubType[____exports.RagManSubType.RED] = "RED"
9776
9829
  ____exports.RagManSubType.BLACK = 2
9777
9830
  ____exports.RagManSubType[____exports.RagManSubType.BLACK] = "BLACK"
9778
- --- For `EntityType.CONSTANT_STONE_SHOOTER` (202),
9779
- -- `ConstantStoneShooterVariant.CONSTANT_STONE_SHOOTER` (0).
9831
+ --- For `EntityType.QUAKE_GRIMACE` (804), variant 0.
9780
9832
  --
9781
9833
  -- This is the same as the `Direction` enum.
9782
- ____exports.ConstantStoneShooterSubType = {}
9783
- ____exports.ConstantStoneShooterSubType.LEFT = 0
9784
- ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.LEFT] = "LEFT"
9785
- ____exports.ConstantStoneShooterSubType.UP = 1
9786
- ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.UP] = "UP"
9787
- ____exports.ConstantStoneShooterSubType.RIGHT = 2
9788
- ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.RIGHT] = "RIGHT"
9789
- ____exports.ConstantStoneShooterSubType.DOWN = 3
9790
- ____exports.ConstantStoneShooterSubType[____exports.ConstantStoneShooterSubType.DOWN] = "DOWN"
9834
+ ____exports.QuakeGrimaceSubType = {}
9835
+ ____exports.QuakeGrimaceSubType.LEFT = 0
9836
+ ____exports.QuakeGrimaceSubType[____exports.QuakeGrimaceSubType.LEFT] = "LEFT"
9837
+ ____exports.QuakeGrimaceSubType.UP = 1
9838
+ ____exports.QuakeGrimaceSubType[____exports.QuakeGrimaceSubType.UP] = "UP"
9839
+ ____exports.QuakeGrimaceSubType.RIGHT = 2
9840
+ ____exports.QuakeGrimaceSubType[____exports.QuakeGrimaceSubType.RIGHT] = "RIGHT"
9841
+ ____exports.QuakeGrimaceSubType.DOWN = 3
9842
+ ____exports.QuakeGrimaceSubType[____exports.QuakeGrimaceSubType.DOWN] = "DOWN"
9843
+ --- For `EntityType.DEEP_GAPER` (811), variant 0.
9844
+ ____exports.DeepGaperSubType = {}
9845
+ ____exports.DeepGaperSubType.V1 = 0
9846
+ ____exports.DeepGaperSubType[____exports.DeepGaperSubType.V1] = "V1"
9847
+ ____exports.DeepGaperSubType.V2 = 1
9848
+ ____exports.DeepGaperSubType[____exports.DeepGaperSubType.V2] = "V2"
9849
+ ____exports.DeepGaperSubType.V3 = 2
9850
+ ____exports.DeepGaperSubType[____exports.DeepGaperSubType.V3] = "V3"
9851
+ ____exports.DeepGaperSubType.V4 = 3
9852
+ ____exports.DeepGaperSubType[____exports.DeepGaperSubType.V4] = "V4"
9853
+ ____exports.DeepGaperSubType.V5 = 4
9854
+ ____exports.DeepGaperSubType[____exports.DeepGaperSubType.V5] = "V5"
9855
+ ____exports.DeepGaperSubType.V6 = 5
9856
+ ____exports.DeepGaperSubType[____exports.DeepGaperSubType.V6] = "V6"
9857
+ ____exports.DeepGaperSubType.V7 = 6
9858
+ ____exports.DeepGaperSubType[____exports.DeepGaperSubType.V7] = "V7"
9859
+ --- For `EntityType.MORNINGSTAR` (863), variant 0.
9860
+ ____exports.MorningStarSubType = {}
9861
+ ____exports.MorningStarSubType.RANDOM = 0
9862
+ ____exports.MorningStarSubType[____exports.MorningStarSubType.RANDOM] = "RANDOM"
9863
+ ____exports.MorningStarSubType.NORMAL = 1
9864
+ ____exports.MorningStarSubType[____exports.MorningStarSubType.NORMAL] = "NORMAL"
9865
+ ____exports.MorningStarSubType.ALTERNATE = 2
9866
+ ____exports.MorningStarSubType[____exports.MorningStarSubType.ALTERNATE] = "ALTERNATE"
9867
+ --- For `EntityType.DARK_ESAU` (866), variant 0.
9868
+ ____exports.DarkEsauSubType = {}
9869
+ ____exports.DarkEsauSubType.DARK = 0
9870
+ ____exports.DarkEsauSubType[____exports.DarkEsauSubType.DARK] = "DARK"
9871
+ ____exports.DarkEsauSubType.DARKER = 1
9872
+ ____exports.DarkEsauSubType[____exports.DarkEsauSubType.DARKER] = "DARKER"
9873
+ --- For `EntityType.MAZE_ROAMER` (890), variant 0.
9874
+ ____exports.MazeRoamerSubType = {}
9875
+ ____exports.MazeRoamerSubType.NORMAL = 0
9876
+ ____exports.MazeRoamerSubType[____exports.MazeRoamerSubType.NORMAL] = "NORMAL"
9877
+ ____exports.MazeRoamerSubType.MIRRORED = 1
9878
+ ____exports.MazeRoamerSubType[____exports.MazeRoamerSubType.MIRRORED] = "MIRRORED"
9791
9879
  --- For `EntityType.MOTHER` (912), `MotherVariant.MOTHER_1` (0).
9792
9880
  ____exports.MotherSubType = {}
9793
9881
  ____exports.MotherSubType.PHASE_1 = 0
9794
9882
  ____exports.MotherSubType[____exports.MotherSubType.PHASE_1] = "PHASE_1"
9795
9883
  ____exports.MotherSubType.PHASE_2 = 1
9796
9884
  ____exports.MotherSubType[____exports.MotherSubType.PHASE_2] = "PHASE_2"
9885
+ ____exports.MotherSubType.LEFT_ARM = 2
9886
+ ____exports.MotherSubType[____exports.MotherSubType.LEFT_ARM] = "LEFT_ARM"
9887
+ ____exports.MotherSubType.RIGHT_ARM = 3
9888
+ ____exports.MotherSubType[____exports.MotherSubType.RIGHT_ARM] = "RIGHT_ARM"
9889
+ ____exports.MotherSubType.DISAPPEAR = 4
9890
+ ____exports.MotherSubType[____exports.MotherSubType.DISAPPEAR] = "DISAPPEAR"
9891
+ --- For `EntityType.MOTHER` (912), `MotherVariant.BALL` (100).
9892
+ ____exports.MotherBallSubType = {}
9893
+ ____exports.MotherBallSubType.LARGE = 0
9894
+ ____exports.MotherBallSubType[____exports.MotherBallSubType.LARGE] = "LARGE"
9895
+ ____exports.MotherBallSubType.MEDIUM = 1
9896
+ ____exports.MotherBallSubType[____exports.MotherBallSubType.MEDIUM] = "MEDIUM"
9897
+ ____exports.MotherBallSubType.SMALL = 2
9898
+ ____exports.MotherBallSubType[____exports.MotherBallSubType.SMALL] = "SMALL"
9797
9899
  --- For `EntityType.EFFECT` (1000), `EffectVariant.BLOOD_EXPLOSION` (2).
9798
9900
  ____exports.BloodExplosionSubType = {}
9799
9901
  ____exports.BloodExplosionSubType.MEDIUM_WITH_LEFTOVER_BLOOD = 0
@@ -13678,7 +13780,7 @@ ____exports.NPCID.DADDY_LONG_LEGS = "101.0.0"
13678
13780
  ____exports.NPCID.TRIACHNID = "101.1.0"
13679
13781
  ____exports.NPCID.ISAAC = "102.0.0"
13680
13782
  ____exports.NPCID.BLUE_BABY = "102.1.0"
13681
- ____exports.NPCID.BLUE_BABY_ALT = "102.2.0"
13783
+ ____exports.NPCID.BLUE_BABY_HUSH = "102.2.0"
13682
13784
  ____exports.NPCID.STONE_EYE = "201.0.0"
13683
13785
  ____exports.NPCID.CONSTANT_STONE_SHOOTER_LEFT = "202.0.0"
13684
13786
  ____exports.NPCID.CONSTANT_STONE_SHOOTER_UP = "202.0.1"
@@ -13906,8 +14008,8 @@ ____exports.NPCID.SMALL_HOLE = "411.1.0"
13906
14008
  ____exports.NPCID.BIG_HOLE = "411.2.0"
13907
14009
  ____exports.NPCID.DELIRIUM = "412.0.0"
13908
14010
  ____exports.NPCID.THE_MATRIARCH = "413.0.0"
13909
- ____exports.NPCID.BLOOD_PUPPY = "802.0.0"
13910
- ____exports.NPCID.BLOOD_PUPPY_2 = "802.1.0"
14011
+ ____exports.NPCID.BLOOD_PUPPY_SMALL = "802.0.0"
14012
+ ____exports.NPCID.BLOOD_PUPPY_LARGE = "802.1.0"
13911
14013
  ____exports.NPCID.BLIND_BAT = "803.0.0"
13912
14014
  ____exports.NPCID.QUAKE_GRIMACE_LEFT = "804.0.0"
13913
14015
  ____exports.NPCID.QUAKE_GRIMACE_UP = "804.0.1"
@@ -14070,8 +14172,8 @@ ____exports.NPCID.CHIMERA_HEAD = "910.2.0"
14070
14172
  ____exports.NPCID.ROTGUT = "911.0.0"
14071
14173
  ____exports.NPCID.ROTGUT_MAGGOT = "911.1.0"
14072
14174
  ____exports.NPCID.ROTGUT_HEART = "911.2.0"
14073
- ____exports.NPCID.MOTHER = "912.0.0"
14074
- ____exports.NPCID.MOTHER_BACKDROP = "912.0.1"
14175
+ ____exports.NPCID.MOTHER_PHASE_1 = "912.0.0"
14176
+ ____exports.NPCID.MOTHER_PHASE_2 = "912.0.1"
14075
14177
  ____exports.NPCID.MOTHER_LEFT_ARM = "912.0.2"
14076
14178
  ____exports.NPCID.MOTHER_RIGHT_ARM = "912.0.3"
14077
14179
  ____exports.NPCID.MOTHER_DISAPPEAR = "912.0.4"
@@ -31825,20 +31927,6 @@ ____exports.STAGE_TYPE_SUFFIXES = {
31825
31927
  [StageType.REPENTANCE] = "c",
31826
31928
  [StageType.REPENTANCE_B] = "d"
31827
31929
  }
31828
- return ____exports
31829
- end,
31830
- ["objects.stageTypeToLetter"] = function(...)
31831
- local ____exports = {}
31832
- local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
31833
- local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
31834
- ____exports.STAGE_TYPE_TO_LETTER = {
31835
- [StageType.ORIGINAL] = "",
31836
- [StageType.WRATH_OF_THE_LAMB] = "a",
31837
- [StageType.AFTERBIRTH] = "b",
31838
- [StageType.GREED_MODE] = "",
31839
- [StageType.REPENTANCE] = "c",
31840
- [StageType.REPENTANCE_B] = "d"
31841
- }
31842
31930
  return ____exports
31843
31931
  end,
31844
31932
  ["functions.stage"] = function(...)
@@ -31860,8 +31948,8 @@ local ____stageToStageID = require("objects.stageToStageID")
31860
31948
  local STAGE_TO_STAGE_ID = ____stageToStageID.STAGE_TO_STAGE_ID
31861
31949
  local ____stageTypeSuffixes = require("objects.stageTypeSuffixes")
31862
31950
  local STAGE_TYPE_SUFFIXES = ____stageTypeSuffixes.STAGE_TYPE_SUFFIXES
31863
- local ____stageTypeToLetter = require("objects.stageTypeToLetter")
31864
- local STAGE_TYPE_TO_LETTER = ____stageTypeToLetter.STAGE_TYPE_TO_LETTER
31951
+ local ____log = require("functions.log")
31952
+ local log = ____log.log
31865
31953
  local ____types = require("functions.types")
31866
31954
  local asLevelStage = ____types.asLevelStage
31867
31955
  local asNumber = ____types.asNumber
@@ -31886,13 +31974,6 @@ function ____exports.onRepentanceStage(self)
31886
31974
  local stageType = level:GetStageType()
31887
31975
  return ____exports.isRepentanceStage(nil, stageType)
31888
31976
  end
31889
- --- Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
31890
- -- console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
31891
- -- console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
31892
- -- to "c".
31893
- function ____exports.stageTypeToLetter(self, stageType)
31894
- return STAGE_TYPE_TO_LETTER[stageType]
31895
- end
31896
31977
  --- Helper function that calculates what the stage type should be for the provided stage. This
31897
31978
  -- emulates what the game's internal code does.
31898
31979
  function ____exports.calculateStageType(self, stage)
@@ -32001,16 +32082,12 @@ function ____exports.getStageType(self)
32001
32082
  local level = game:GetLevel()
32002
32083
  return level:GetStageType()
32003
32084
  end
32004
- --- Helper function to directly warp to a specific stage using the "stage" console command.
32005
- --
32006
- -- Note that if you use this function on game frame 0, it will confuse the
32007
- -- `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
32008
- -- callbacks. If you are using the function in this situation, remember to call the
32009
- -- `reorderedCallbacksSetStage` function.
32010
- function ____exports.goToStage(self, stage, stageType)
32011
- local stageTypeLetterSuffix = ____exports.stageTypeToLetter(nil, stageType)
32012
- local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
32013
- Isaac.ExecuteCommand(command)
32085
+ --- Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
32086
+ -- console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
32087
+ -- console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
32088
+ -- to "c".
32089
+ function ____exports.getStageTypeSuffix(self, stageType)
32090
+ return STAGE_TYPE_SUFFIXES[stageType]
32014
32091
  end
32015
32092
  --- Returns whether the provided stage and stage type represent a "final floor". This is defined as a
32016
32093
  -- floor that prevents the player from entering the I AM ERROR room on.
@@ -32214,11 +32291,16 @@ function ____exports.onStageWithStoryBoss(self)
32214
32291
  local stage = level:GetStage()
32215
32292
  return ____exports.isStageWithStoryBoss(nil, stage)
32216
32293
  end
32217
- --- Helper function to warp to a new stage/level.
32294
+ --- Helper function to directly warp to a specific stage using the "stage" console command.
32218
32295
  --
32219
- -- Note that this is different from the `Level.SetStage` method, which will change the stage and/or
32296
+ -- This is different from the vanilla `Level.SetStage` method, which will change the stage and/or
32220
32297
  -- stage type of the current floor without moving the player to a new floor.
32221
32298
  --
32299
+ -- Note that if you use this function on game frame 0, it will confuse the
32300
+ -- `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
32301
+ -- callbacks. If you are using the function in this situation, remember to call the
32302
+ -- `reorderedCallbacksSetStage` function.
32303
+ --
32222
32304
  -- @param stage The stage number to warp to.
32223
32305
  -- @param stageType The stage type to warp to.
32224
32306
  -- @param reseed Optional. Whether to reseed the floor upon arrival. Default is false. Set this to
@@ -32228,10 +32310,12 @@ function ____exports.setStage(self, stage, stageType, reseed)
32228
32310
  if reseed == nil then
32229
32311
  reseed = false
32230
32312
  end
32231
- local stageTypeSuffix = STAGE_TYPE_SUFFIXES[stageType]
32313
+ local stageTypeSuffix = ____exports.getStageTypeSuffix(nil, stageType)
32232
32314
  local command = ("stage " .. tostring(stage)) .. stageTypeSuffix
32315
+ log("Warping to a stage with a console command of: " .. command)
32233
32316
  Isaac.ExecuteCommand(command)
32234
32317
  if reseed then
32318
+ log("Reseeding the floor with a console command of: reseed")
32235
32319
  Isaac.ExecuteCommand("reseed")
32236
32320
  end
32237
32321
  end
@@ -62122,7 +62206,7 @@ local ____stage = require("functions.stage")
62122
62206
  local onFirstFloor = ____stage.onFirstFloor
62123
62207
  local ____Feature = require("classes.private.Feature")
62124
62208
  local Feature = ____Feature.Feature
62125
- local v = {run = {pastFirstFloor = false, onRerun = false}}
62209
+ local v = {persistent = {pastFirstFloor = false, onRerun = false}}
62126
62210
  ____exports.RerunDetection = __TS__Class()
62127
62211
  local RerunDetection = ____exports.RerunDetection
62128
62212
  RerunDetection.name = "RerunDetection"
@@ -62131,19 +62215,26 @@ function RerunDetection.prototype.____constructor(self)
62131
62215
  Feature.prototype.____constructor(self)
62132
62216
  self.v = v
62133
62217
  self.postGameStartedReordered = function(____, isContinued)
62134
- if isContinued and onFirstFloor(nil) and inStartingRoom(nil) and v.run.pastFirstFloor then
62135
- v.run.onRerun = true
62218
+ Isaac.DebugString("GETTING HERE 1 - " .. tostring(isContinued))
62219
+ Isaac.DebugString("GETTING HERE 2 - " .. tostring(onFirstFloor(nil)))
62220
+ Isaac.DebugString("GETTING HERE 3 - " .. tostring(inStartingRoom(nil)))
62221
+ Isaac.DebugString("GETTING HERE 4 - " .. tostring(v.persistent.pastFirstFloor))
62222
+ Isaac.DebugString("GETTING HERE 5 - " .. tostring(v.persistent.onRerun))
62223
+ if isContinued then
62224
+ if onFirstFloor(nil) and inStartingRoom(nil) and v.persistent.pastFirstFloor then
62225
+ v.persistent.onRerun = true
62226
+ end
62227
+ else
62228
+ v.persistent.onRerun = false
62136
62229
  end
62137
62230
  end
62138
62231
  self.postNewLevelReordered = function()
62139
- if not onFirstFloor(nil) then
62140
- v.run.pastFirstFloor = true
62141
- end
62232
+ v.persistent.pastFirstFloor = not onFirstFloor(nil)
62142
62233
  end
62143
62234
  self.customCallbacksUsed = {{ModCallbackCustom.POST_GAME_STARTED_REORDERED, self.postGameStartedReordered}, {ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
62144
62235
  end
62145
62236
  function RerunDetection.prototype.onRerun(self)
62146
- return v.run.onRerun
62237
+ return v.persistent.onRerun
62147
62238
  end
62148
62239
  __TS__DecorateLegacy({Exported}, RerunDetection.prototype, "onRerun", true)
62149
62240
  return ____exports
@@ -1 +1 @@
1
- {"version":3,"file":"stageTypeSuffixes.d.ts","sourceRoot":"","sources":["../../src/objects/stageTypeSuffixes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;;CAOc,CAAC"}
1
+ {"version":3,"file":"stageTypeSuffixes.d.ts","sourceRoot":"","sources":["../../src/objects/stageTypeSuffixes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;;CAYc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "77.3.1",
3
+ "version": "78.0.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -37,6 +37,6 @@
37
37
  "lint": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/lint.mts"
38
38
  },
39
39
  "dependencies": {
40
- "isaac-typescript-definitions": "^38.2.0"
40
+ "isaac-typescript-definitions": "^38.3.0"
41
41
  }
42
42
  }
@@ -5,7 +5,8 @@ import { onFirstFloor } from "../../../functions/stage";
5
5
  import { Feature } from "../../private/Feature";
6
6
 
7
7
  const v = {
8
- run: {
8
+ // We cannot use a "run" object since the variables would be reset when a rerun starts.
9
+ persistent: {
9
10
  pastFirstFloor: false,
10
11
  onRerun: false,
11
12
  },
@@ -30,21 +31,18 @@ export class RerunDetection extends Feature {
30
31
 
31
32
  // ModCallbackCustom.POST_GAME_STARTED_REORDERED
32
33
  private readonly postGameStartedReordered = (isContinued: boolean) => {
33
- if (
34
- isContinued &&
35
- onFirstFloor() &&
36
- inStartingRoom() &&
37
- v.run.pastFirstFloor
38
- ) {
39
- v.run.onRerun = true;
34
+ if (isContinued) {
35
+ if (onFirstFloor() && inStartingRoom() && v.persistent.pastFirstFloor) {
36
+ v.persistent.onRerun = true;
37
+ }
38
+ } else {
39
+ v.persistent.onRerun = false;
40
40
  }
41
41
  };
42
42
 
43
43
  // ModCallbackCustom.POST_NEW_LEVEL_REORDERED
44
44
  private readonly postNewLevelReordered = () => {
45
- if (!onFirstFloor()) {
46
- v.run.pastFirstFloor = true;
47
- }
45
+ v.persistent.pastFirstFloor = !onFirstFloor();
48
46
  };
49
47
 
50
48
  /**
@@ -60,6 +58,6 @@ export class RerunDetection extends Feature {
60
58
  */
61
59
  @Exported
62
60
  public onRerun(): boolean {
63
- return v.run.onRerun;
61
+ return v.persistent.onRerun;
64
62
  }
65
63
  }
@@ -288,7 +288,7 @@ export class SaveDataManager extends Feature {
288
288
  *
289
289
  * Some features may have variables that need to be automatically reset per run/level, but not
290
290
  * saved to disk on game exit. (For example, if they contain functions or other non-serializable
291
- * data.) For these cases, set the second argument to `false`.
291
+ * data.) For these cases, set the second argument of this function to `false`.
292
292
  *
293
293
  * Note that when the player uses Glowing Hourglass, the save data manager will automatically
294
294
  * restore any variables on a "run" or "level" object with a backup that was created when the room
@@ -296,8 +296,8 @@ export class SaveDataManager extends Feature {
296
296
  * your mod features that use the save data manager. If this is undesired for your specific
297
297
  * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
298
298
  *
299
- * If you want the automatic variable restoring with Glowing Hour Glass functionality to apply to
300
- * a "persistent" object, you can add a key of `__rewindWithGlowingHourGlass: true` to the object.
299
+ * By default, the Glowing Hour Glass functionality will not apply to "persistent" objects. If
300
+ * this is undesired, you can add a key of `__rewindWithGlowingHourGlass: true` to the object.
301
301
  *
302
302
  * @param key The name of the file or feature that is submitting data to be managed by the save
303
303
  * data manager. The save data manager will throw an error if the key is already
@@ -153,6 +153,8 @@ export function getRoomDataForTypeVariant(
153
153
  roomVariant,
154
154
  useSpecialRoomsForRoomTypeDefault,
155
155
  );
156
+ // We do not want to log the command execution, because this function will potentially be called
157
+ // many times.
156
158
  Isaac.ExecuteCommand(command);
157
159
  const newRoomData = getRoomData(GridRoom.DEBUG);
158
160
 
@@ -10,7 +10,7 @@ import { LEVEL_NAMES } from "../objects/levelNames";
10
10
  import { ROOM_TYPE_SPECIAL_GOTO_PREFIXES } from "../objects/roomTypeSpecialGotoPrefixes";
11
11
  import { STAGE_TO_STAGE_ID } from "../objects/stageToStageID";
12
12
  import { STAGE_TYPE_SUFFIXES } from "../objects/stageTypeSuffixes";
13
- import { STAGE_TYPE_TO_LETTER } from "../objects/stageTypeToLetter";
13
+ import { log } from "./log";
14
14
  import { asLevelStage, asNumber } from "./types";
15
15
  import { inRange } from "./utils";
16
16
 
@@ -182,17 +182,13 @@ export function getStageType(): StageType {
182
182
  }
183
183
 
184
184
  /**
185
- * Helper function to directly warp to a specific stage using the "stage" console command.
186
- *
187
- * Note that if you use this function on game frame 0, it will confuse the
188
- * `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
189
- * callbacks. If you are using the function in this situation, remember to call the
190
- * `reorderedCallbacksSetStage` function.
185
+ * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
186
+ * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
187
+ * console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
188
+ * to "c".
191
189
  */
192
- export function goToStage(stage: LevelStage, stageType: StageType): void {
193
- const stageTypeLetterSuffix = stageTypeToLetter(stageType);
194
- const command = `stage ${stage}${stageTypeLetterSuffix}`;
195
- Isaac.ExecuteCommand(command);
190
+ export function getStageTypeSuffix(stageType: StageType): string {
191
+ return STAGE_TYPE_SUFFIXES[stageType];
196
192
  }
197
193
 
198
194
  /**
@@ -545,11 +541,16 @@ export function onStageWithStoryBoss(): boolean {
545
541
  }
546
542
 
547
543
  /**
548
- * Helper function to warp to a new stage/level.
544
+ * Helper function to directly warp to a specific stage using the "stage" console command.
549
545
  *
550
- * Note that this is different from the `Level.SetStage` method, which will change the stage and/or
546
+ * This is different from the vanilla `Level.SetStage` method, which will change the stage and/or
551
547
  * stage type of the current floor without moving the player to a new floor.
552
548
  *
549
+ * Note that if you use this function on game frame 0, it will confuse the
550
+ * `POST_GAME_STARTED_REORDERED`, `POST_NEW_LEVEL_REORDERED`, and `POST_NEW_ROOM_REORDERED` custom
551
+ * callbacks. If you are using the function in this situation, remember to call the
552
+ * `reorderedCallbacksSetStage` function.
553
+ *
553
554
  * @param stage The stage number to warp to.
554
555
  * @param stageType The stage type to warp to.
555
556
  * @param reseed Optional. Whether to reseed the floor upon arrival. Default is false. Set this to
@@ -562,22 +563,14 @@ export function setStage(
562
563
  reseed = false,
563
564
  ): void {
564
565
  // Build the command that will take us to the next floor.
565
- const stageTypeSuffix = STAGE_TYPE_SUFFIXES[stageType];
566
+ const stageTypeSuffix = getStageTypeSuffix(stageType);
566
567
  const command = `stage ${stage}${stageTypeSuffix}`;
568
+ log(`Warping to a stage with a console command of: ${command}`);
567
569
  Isaac.ExecuteCommand(command);
568
570
 
569
571
  if (reseed) {
570
572
  // Doing a "reseed" immediately after a "stage" command won't mess anything up.
573
+ log("Reseeding the floor with a console command of: reseed");
571
574
  Isaac.ExecuteCommand("reseed");
572
575
  }
573
576
  }
574
-
575
- /**
576
- * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
577
- * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
578
- * console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
579
- * to "c".
580
- */
581
- export function stageTypeToLetter(stageType: StageType): string {
582
- return STAGE_TYPE_TO_LETTER[stageType];
583
- }
@@ -1,10 +1,15 @@
1
1
  import { StageType } from "isaac-typescript-definitions";
2
2
 
3
3
  export const STAGE_TYPE_SUFFIXES = {
4
+ // For example, to go to Basement 2, the command is simply "stage 2" without a letter suffix.
4
5
  [StageType.ORIGINAL]: "", // 0
6
+
5
7
  [StageType.WRATH_OF_THE_LAMB]: "a", // 1
6
8
  [StageType.AFTERBIRTH]: "b", // 2
9
+
10
+ // There is no corresponding suffix for Greed Mode.
7
11
  [StageType.GREED_MODE]: "", // 3
12
+
8
13
  [StageType.REPENTANCE]: "c", // 4
9
14
  [StageType.REPENTANCE_B]: "d", // 5
10
15
  } as const satisfies Record<StageType, string>;
@@ -1,9 +0,0 @@
1
- export declare const STAGE_TYPE_TO_LETTER: {
2
- readonly 0: "";
3
- readonly 1: "a";
4
- readonly 2: "b";
5
- readonly 3: "";
6
- readonly 4: "c";
7
- readonly 5: "d";
8
- };
9
- //# sourceMappingURL=stageTypeToLetter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stageTypeToLetter.d.ts","sourceRoot":"","sources":["../../src/objects/stageTypeToLetter.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;;;;;;CAYa,CAAC"}
@@ -1,12 +0,0 @@
1
- local ____exports = {}
2
- local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
- local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
4
- ____exports.STAGE_TYPE_TO_LETTER = {
5
- [StageType.ORIGINAL] = "",
6
- [StageType.WRATH_OF_THE_LAMB] = "a",
7
- [StageType.AFTERBIRTH] = "b",
8
- [StageType.GREED_MODE] = "",
9
- [StageType.REPENTANCE] = "c",
10
- [StageType.REPENTANCE_B] = "d"
11
- }
12
- return ____exports
@@ -1,15 +0,0 @@
1
- import { StageType } from "isaac-typescript-definitions";
2
-
3
- export const STAGE_TYPE_TO_LETTER = {
4
- // For example, to go to Basement 2, the command is simply "stage 2" without a letter suffix.
5
- [StageType.ORIGINAL]: "", // 0
6
-
7
- [StageType.WRATH_OF_THE_LAMB]: "a", // 1
8
- [StageType.AFTERBIRTH]: "b", // 2
9
-
10
- // There is no corresponding suffix for Greed Mode.
11
- [StageType.GREED_MODE]: "", // 3
12
-
13
- [StageType.REPENTANCE]: "c", // 4
14
- [StageType.REPENTANCE_B]: "d", // 5
15
- } as const satisfies Record<StageType, string>;