isaacscript-common 1.0.525 → 1.0.529
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/seeds.d.ts +2 -0
- package/dist/functions/seeds.lua +8 -0
- package/dist/functions/stage.d.ts +9 -0
- package/dist/functions/stage.lua +23 -13
- package/dist/functions/util.d.ts +7 -2
- package/dist/functions/util.lua +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- 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 type. */
|
|
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
|
package/dist/functions/util.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
3
3
|
/**
|
|
4
|
-
* Using a
|
|
5
|
-
*
|
|
4
|
+
* Using a Map constructor to copy a Map does not seem to work properly, so use this helper function
|
|
5
|
+
* instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
|
|
8
|
+
/**
|
|
9
|
+
* Using a Set constructor to copy a Set does not seem to work properly, so use this helper function
|
|
10
|
+
* instead.
|
|
6
11
|
*/
|
|
7
12
|
export declare function copySet<T>(oldSet: Set<T>): Set<T>;
|
|
8
13
|
/**
|
package/dist/functions/util.lua
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local HEX_STRING_LENGTH = 6
|
|
5
|
+
function ____exports.copyMap(self, oldMap)
|
|
6
|
+
local newMap = __TS__New(Map)
|
|
7
|
+
for ____, ____value in __TS__Iterator(
|
|
8
|
+
oldMap:entries()
|
|
9
|
+
) do
|
|
10
|
+
local key
|
|
11
|
+
key = ____value[1]
|
|
12
|
+
local value
|
|
13
|
+
value = ____value[2]
|
|
14
|
+
newMap:set(key, value)
|
|
15
|
+
end
|
|
16
|
+
return newMap
|
|
17
|
+
end
|
|
5
18
|
function ____exports.copySet(self, oldSet)
|
|
6
19
|
local newSet = __TS__New(Set)
|
|
7
20
|
for ____, value in __TS__Iterator(
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from "./functions/position";
|
|
|
38
38
|
export * from "./functions/random";
|
|
39
39
|
export * from "./functions/revive";
|
|
40
40
|
export * from "./functions/rooms";
|
|
41
|
+
export * from "./functions/seeds";
|
|
41
42
|
export * from "./functions/spawnCollectible";
|
|
42
43
|
export * from "./functions/sprite";
|
|
43
44
|
export * from "./functions/stage";
|
package/dist/index.lua
CHANGED
|
@@ -310,6 +310,14 @@ do
|
|
|
310
310
|
end
|
|
311
311
|
end
|
|
312
312
|
end
|
|
313
|
+
do
|
|
314
|
+
local ____export = require("functions.seeds")
|
|
315
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
316
|
+
if ____exportKey ~= "default" then
|
|
317
|
+
____exports[____exportKey] = ____exportValue
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
end
|
|
313
321
|
do
|
|
314
322
|
local ____export = require("functions.spawnCollectible")
|
|
315
323
|
for ____exportKey, ____exportValue in pairs(____export) do
|