isaacscript-common 77.4.0 → 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.
- package/dist/classes/features/other/RerunDetection.d.ts.map +1 -1
- package/dist/classes/features/other/RerunDetection.lua +14 -7
- package/dist/classes/features/other/SaveDataManager.d.ts +3 -3
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/stage.d.ts +12 -16
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +18 -22
- package/dist/index.rollup.d.ts +18 -23
- package/dist/isaacscript-common.lua +33 -44
- package/dist/objects/stageTypeSuffixes.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/classes/features/other/RerunDetection.ts +10 -12
- package/src/classes/features/other/SaveDataManager.ts +3 -3
- package/src/functions/rooms.ts +2 -0
- package/src/functions/stage.ts +17 -24
- package/src/objects/stageTypeSuffixes.ts +5 -0
- package/dist/objects/stageTypeToLetter.d.ts +0 -9
- package/dist/objects/stageTypeToLetter.d.ts.map +0 -1
- package/dist/objects/stageTypeToLetter.lua +0 -12
- package/src/objects/stageTypeToLetter.ts +0 -15
|
@@ -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;
|
|
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 = {
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
*
|
|
130
|
-
*
|
|
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,a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;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,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
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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
|
|
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
|
|
224
|
+
* Helper function to directly warp to a specific stage using the "stage" console command.
|
|
227
225
|
*
|
|
228
|
-
*
|
|
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/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S,EACpB,MAAM,UAAQ,GACb,IAAI,CAYN"}
|
package/dist/functions/stage.lua
CHANGED
|
@@ -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
|
|
20
|
-
local
|
|
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
|
|
161
|
-
--
|
|
162
|
-
--
|
|
163
|
-
--
|
|
164
|
-
|
|
165
|
-
|
|
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
|
|
362
|
+
--- Helper function to directly warp to a specific stage using the "stage" console command.
|
|
374
363
|
--
|
|
375
|
-
--
|
|
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 =
|
|
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
|
package/dist/index.rollup.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
17153
|
-
*
|
|
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
|
|
17727
|
+
* Helper function to directly warp to a specific stage using the "stage" console command.
|
|
17730
17728
|
*
|
|
17731
|
-
*
|
|
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
|
+
isaacscript-common 77.4.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -31927,20 +31927,6 @@ ____exports.STAGE_TYPE_SUFFIXES = {
|
|
|
31927
31927
|
[StageType.REPENTANCE] = "c",
|
|
31928
31928
|
[StageType.REPENTANCE_B] = "d"
|
|
31929
31929
|
}
|
|
31930
|
-
return ____exports
|
|
31931
|
-
end,
|
|
31932
|
-
["objects.stageTypeToLetter"] = function(...)
|
|
31933
|
-
local ____exports = {}
|
|
31934
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
|
|
31935
|
-
local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
|
|
31936
|
-
____exports.STAGE_TYPE_TO_LETTER = {
|
|
31937
|
-
[StageType.ORIGINAL] = "",
|
|
31938
|
-
[StageType.WRATH_OF_THE_LAMB] = "a",
|
|
31939
|
-
[StageType.AFTERBIRTH] = "b",
|
|
31940
|
-
[StageType.GREED_MODE] = "",
|
|
31941
|
-
[StageType.REPENTANCE] = "c",
|
|
31942
|
-
[StageType.REPENTANCE_B] = "d"
|
|
31943
|
-
}
|
|
31944
31930
|
return ____exports
|
|
31945
31931
|
end,
|
|
31946
31932
|
["functions.stage"] = function(...)
|
|
@@ -31962,8 +31948,8 @@ local ____stageToStageID = require("objects.stageToStageID")
|
|
|
31962
31948
|
local STAGE_TO_STAGE_ID = ____stageToStageID.STAGE_TO_STAGE_ID
|
|
31963
31949
|
local ____stageTypeSuffixes = require("objects.stageTypeSuffixes")
|
|
31964
31950
|
local STAGE_TYPE_SUFFIXES = ____stageTypeSuffixes.STAGE_TYPE_SUFFIXES
|
|
31965
|
-
local
|
|
31966
|
-
local
|
|
31951
|
+
local ____log = require("functions.log")
|
|
31952
|
+
local log = ____log.log
|
|
31967
31953
|
local ____types = require("functions.types")
|
|
31968
31954
|
local asLevelStage = ____types.asLevelStage
|
|
31969
31955
|
local asNumber = ____types.asNumber
|
|
@@ -31988,13 +31974,6 @@ function ____exports.onRepentanceStage(self)
|
|
|
31988
31974
|
local stageType = level:GetStageType()
|
|
31989
31975
|
return ____exports.isRepentanceStage(nil, stageType)
|
|
31990
31976
|
end
|
|
31991
|
-
--- Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
|
|
31992
|
-
-- console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
|
|
31993
|
-
-- console command to go to Downpour is "stage 1c", so this function converts `StageType.REPENTANCE`
|
|
31994
|
-
-- to "c".
|
|
31995
|
-
function ____exports.stageTypeToLetter(self, stageType)
|
|
31996
|
-
return STAGE_TYPE_TO_LETTER[stageType]
|
|
31997
|
-
end
|
|
31998
31977
|
--- Helper function that calculates what the stage type should be for the provided stage. This
|
|
31999
31978
|
-- emulates what the game's internal code does.
|
|
32000
31979
|
function ____exports.calculateStageType(self, stage)
|
|
@@ -32103,16 +32082,12 @@ function ____exports.getStageType(self)
|
|
|
32103
32082
|
local level = game:GetLevel()
|
|
32104
32083
|
return level:GetStageType()
|
|
32105
32084
|
end
|
|
32106
|
-
--- Helper function to
|
|
32107
|
-
--
|
|
32108
|
-
--
|
|
32109
|
-
--
|
|
32110
|
-
|
|
32111
|
-
|
|
32112
|
-
function ____exports.goToStage(self, stage, stageType)
|
|
32113
|
-
local stageTypeLetterSuffix = ____exports.stageTypeToLetter(nil, stageType)
|
|
32114
|
-
local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
|
|
32115
|
-
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]
|
|
32116
32091
|
end
|
|
32117
32092
|
--- Returns whether the provided stage and stage type represent a "final floor". This is defined as a
|
|
32118
32093
|
-- floor that prevents the player from entering the I AM ERROR room on.
|
|
@@ -32316,11 +32291,16 @@ function ____exports.onStageWithStoryBoss(self)
|
|
|
32316
32291
|
local stage = level:GetStage()
|
|
32317
32292
|
return ____exports.isStageWithStoryBoss(nil, stage)
|
|
32318
32293
|
end
|
|
32319
|
-
--- Helper function to warp to a
|
|
32294
|
+
--- Helper function to directly warp to a specific stage using the "stage" console command.
|
|
32320
32295
|
--
|
|
32321
|
-
--
|
|
32296
|
+
-- This is different from the vanilla `Level.SetStage` method, which will change the stage and/or
|
|
32322
32297
|
-- stage type of the current floor without moving the player to a new floor.
|
|
32323
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
|
+
--
|
|
32324
32304
|
-- @param stage The stage number to warp to.
|
|
32325
32305
|
-- @param stageType The stage type to warp to.
|
|
32326
32306
|
-- @param reseed Optional. Whether to reseed the floor upon arrival. Default is false. Set this to
|
|
@@ -32330,10 +32310,12 @@ function ____exports.setStage(self, stage, stageType, reseed)
|
|
|
32330
32310
|
if reseed == nil then
|
|
32331
32311
|
reseed = false
|
|
32332
32312
|
end
|
|
32333
|
-
local stageTypeSuffix =
|
|
32313
|
+
local stageTypeSuffix = ____exports.getStageTypeSuffix(nil, stageType)
|
|
32334
32314
|
local command = ("stage " .. tostring(stage)) .. stageTypeSuffix
|
|
32315
|
+
log("Warping to a stage with a console command of: " .. command)
|
|
32335
32316
|
Isaac.ExecuteCommand(command)
|
|
32336
32317
|
if reseed then
|
|
32318
|
+
log("Reseeding the floor with a console command of: reseed")
|
|
32337
32319
|
Isaac.ExecuteCommand("reseed")
|
|
32338
32320
|
end
|
|
32339
32321
|
end
|
|
@@ -62224,7 +62206,7 @@ local ____stage = require("functions.stage")
|
|
|
62224
62206
|
local onFirstFloor = ____stage.onFirstFloor
|
|
62225
62207
|
local ____Feature = require("classes.private.Feature")
|
|
62226
62208
|
local Feature = ____Feature.Feature
|
|
62227
|
-
local v = {
|
|
62209
|
+
local v = {persistent = {pastFirstFloor = false, onRerun = false}}
|
|
62228
62210
|
____exports.RerunDetection = __TS__Class()
|
|
62229
62211
|
local RerunDetection = ____exports.RerunDetection
|
|
62230
62212
|
RerunDetection.name = "RerunDetection"
|
|
@@ -62233,19 +62215,26 @@ function RerunDetection.prototype.____constructor(self)
|
|
|
62233
62215
|
Feature.prototype.____constructor(self)
|
|
62234
62216
|
self.v = v
|
|
62235
62217
|
self.postGameStartedReordered = function(____, isContinued)
|
|
62236
|
-
|
|
62237
|
-
|
|
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
|
|
62238
62229
|
end
|
|
62239
62230
|
end
|
|
62240
62231
|
self.postNewLevelReordered = function()
|
|
62241
|
-
|
|
62242
|
-
v.run.pastFirstFloor = true
|
|
62243
|
-
end
|
|
62232
|
+
v.persistent.pastFirstFloor = not onFirstFloor(nil)
|
|
62244
62233
|
end
|
|
62245
62234
|
self.customCallbacksUsed = {{ModCallbackCustom.POST_GAME_STARTED_REORDERED, self.postGameStartedReordered}, {ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
|
|
62246
62235
|
end
|
|
62247
62236
|
function RerunDetection.prototype.onRerun(self)
|
|
62248
|
-
return v.
|
|
62237
|
+
return v.persistent.onRerun
|
|
62249
62238
|
end
|
|
62250
62239
|
__TS__DecorateLegacy({Exported}, RerunDetection.prototype, "onRerun", true)
|
|
62251
62240
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stageTypeSuffixes.d.ts","sourceRoot":"","sources":["../../src/objects/stageTypeSuffixes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;;
|
|
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
|
@@ -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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
*
|
|
300
|
-
*
|
|
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
|
package/src/functions/rooms.ts
CHANGED
|
@@ -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
|
|
package/src/functions/stage.ts
CHANGED
|
@@ -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 {
|
|
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
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
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
|
|
193
|
-
|
|
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
|
|
544
|
+
* Helper function to directly warp to a specific stage using the "stage" console command.
|
|
549
545
|
*
|
|
550
|
-
*
|
|
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 =
|
|
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 +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>;
|