isaacscript-common 1.0.527 → 1.0.528
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/functions/stage.d.ts +9 -0
- package/dist/functions/stage.lua +23 -13
- package/package.json +1 -1
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to account for Repentance floors being offset by 1. For example, Downpour 2 is
|
|
4
|
+
* the third level of the run, but the game considers it to have a stage of 2. This function will
|
|
5
|
+
* consider Downpour 2 to have a stage of 3.
|
|
6
|
+
*/
|
|
2
7
|
export declare function getEffectiveStage(): int;
|
|
8
|
+
/** Helper function to get the current stage. */
|
|
9
|
+
export declare function getStage(): LevelStage;
|
|
10
|
+
/** Helper function to get the current stage. */
|
|
11
|
+
export declare function getStageType(): StageType;
|
|
3
12
|
/** Helper function to directly warp to a specific stage using the "stage" console command. */
|
|
4
13
|
export declare function goToStage(stage: LevelStage, stageType: StageType): void;
|
|
5
14
|
export declare function onCathedral(): boolean;
|
package/dist/functions/stage.lua
CHANGED
|
@@ -10,39 +10,39 @@ function ____exports.onRepentanceStage(self)
|
|
|
10
10
|
end
|
|
11
11
|
function ____exports.stageTypeToLetter(self, stageType)
|
|
12
12
|
repeat
|
|
13
|
-
local
|
|
14
|
-
local
|
|
15
|
-
if
|
|
13
|
+
local ____switch14 = stageType
|
|
14
|
+
local ____cond14 = ____switch14 == StageType.STAGETYPE_ORIGINAL
|
|
15
|
+
if ____cond14 then
|
|
16
16
|
do
|
|
17
17
|
return ""
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
|
-
|
|
21
|
-
if
|
|
20
|
+
____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_WOTL)
|
|
21
|
+
if ____cond14 then
|
|
22
22
|
do
|
|
23
23
|
return "a"
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
|
-
|
|
27
|
-
if
|
|
26
|
+
____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_AFTERBIRTH)
|
|
27
|
+
if ____cond14 then
|
|
28
28
|
do
|
|
29
29
|
return "b"
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
|
-
|
|
33
|
-
if
|
|
32
|
+
____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_GREEDMODE)
|
|
33
|
+
if ____cond14 then
|
|
34
34
|
do
|
|
35
35
|
return ""
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
|
-
|
|
39
|
-
if
|
|
38
|
+
____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_REPENTANCE)
|
|
39
|
+
if ____cond14 then
|
|
40
40
|
do
|
|
41
41
|
return "c"
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
|
-
|
|
45
|
-
if
|
|
44
|
+
____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_REPENTANCE_B)
|
|
45
|
+
if ____cond14 then
|
|
46
46
|
do
|
|
47
47
|
return "d"
|
|
48
48
|
end
|
|
@@ -64,6 +64,16 @@ function ____exports.getEffectiveStage(self)
|
|
|
64
64
|
end
|
|
65
65
|
return stage
|
|
66
66
|
end
|
|
67
|
+
function ____exports.getStage(self)
|
|
68
|
+
local game = Game()
|
|
69
|
+
local level = game:GetLevel()
|
|
70
|
+
return level:GetStage()
|
|
71
|
+
end
|
|
72
|
+
function ____exports.getStageType(self)
|
|
73
|
+
local game = Game()
|
|
74
|
+
local level = game:GetLevel()
|
|
75
|
+
return level:GetStageType()
|
|
76
|
+
end
|
|
67
77
|
function ____exports.goToStage(self, stage, stageType)
|
|
68
78
|
local stageTypeLetterSuffix = ____exports.stageTypeToLetter(nil, stageType)
|
|
69
79
|
local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
|