isaacscript-common 59.7.0 → 61.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/index.rollup.d.ts +42 -42
- package/dist/isaacscript-common.lua +54 -54
- package/dist/src/classes/callbacks/PostPickupInitFirst.lua +2 -2
- package/dist/src/classes/features/other/CustomTrapdoors.lua +5 -5
- package/dist/src/classes/features/other/DisableInputs.lua +4 -4
- package/dist/src/classes/features/other/SaveDataManager.lua +2 -2
- package/dist/src/functions/frames.d.ts +24 -24
- package/dist/src/functions/frames.d.ts.map +1 -1
- package/dist/src/functions/frames.lua +34 -34
- package/dist/src/functions/input.d.ts +6 -6
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +18 -18
- package/package.json +1 -1
- package/src/classes/callbacks/PostPickupInitFirst.ts +2 -2
- package/src/classes/features/other/CustomTrapdoors.ts +5 -5
- package/src/classes/features/other/DisableInputs.ts +4 -4
- package/src/classes/features/other/SaveDataManager.ts +2 -2
- package/src/functions/frames.ts +34 -34
- package/src/functions/input.ts +20 -20
|
@@ -3,47 +3,47 @@ export declare function getElapsedGameFramesSince(gameFrameCount: int): int;
|
|
|
3
3
|
export declare function getElapsedRenderFramesSince(renderFrameCount: int): int;
|
|
4
4
|
export declare function getElapsedRoomFramesSince(roomFrameCount: int): int;
|
|
5
5
|
/**
|
|
6
|
-
* Helper function to check if the current game frame count is
|
|
6
|
+
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
7
7
|
* count.
|
|
8
8
|
*
|
|
9
9
|
* This returns false if the submitted game frame count is null or undefined.
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function isAfterGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
12
12
|
/**
|
|
13
|
-
* Helper function to check if the current render frame count is
|
|
13
|
+
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
14
14
|
* count.
|
|
15
15
|
*
|
|
16
16
|
* This returns false if the submitted render frame count is null or undefined.
|
|
17
17
|
*/
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function isAfterRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
19
19
|
/**
|
|
20
|
-
* Helper function to check if the current room frame count is
|
|
20
|
+
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
21
21
|
* count.
|
|
22
22
|
*
|
|
23
23
|
* This returns false if the submitted room frame count is null or undefined.
|
|
24
24
|
*/
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function isAfterRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
26
26
|
/**
|
|
27
|
-
* Helper function to check if the current game frame count is
|
|
27
|
+
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
28
28
|
* count.
|
|
29
29
|
*
|
|
30
30
|
* This returns false if the submitted game frame count is null or undefined.
|
|
31
31
|
*/
|
|
32
|
-
export declare function
|
|
32
|
+
export declare function isBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
33
33
|
/**
|
|
34
|
-
* Helper function to check if the current render frame count is
|
|
34
|
+
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
35
35
|
* count.
|
|
36
36
|
*
|
|
37
37
|
* This returns false if the submitted render frame count is null or undefined.
|
|
38
38
|
*/
|
|
39
|
-
export declare function
|
|
39
|
+
export declare function isBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
40
40
|
/**
|
|
41
|
-
* Helper function to check if the current room frame count is
|
|
41
|
+
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
42
42
|
* count.
|
|
43
43
|
*
|
|
44
44
|
* This returns false if the submitted room frame count is null or undefined.
|
|
45
45
|
*/
|
|
46
|
-
export declare function
|
|
46
|
+
export declare function isBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
47
47
|
/**
|
|
48
48
|
* Helper function to check if the current game frame count is exactly equal to a specific game
|
|
49
49
|
* frame count.
|
|
@@ -52,47 +52,47 @@ export declare function isPastRoomFrame(roomFrameCount: int | null | undefined):
|
|
|
52
52
|
*/
|
|
53
53
|
export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
54
54
|
/**
|
|
55
|
-
* Helper function to check if the current game frame count is equal to or
|
|
55
|
+
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
56
56
|
* game frame count.
|
|
57
57
|
*
|
|
58
58
|
* This returns false if the submitted game frame count is null or undefined.
|
|
59
59
|
*/
|
|
60
|
-
export declare function
|
|
60
|
+
export declare function onOrAfterGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
61
61
|
/**
|
|
62
|
-
* Helper function to check if the current render frame count is equal to or
|
|
62
|
+
* Helper function to check if the current render frame count is equal to or higher than a specific
|
|
63
63
|
* render frame count.
|
|
64
64
|
*
|
|
65
65
|
* This returns false if the submitted render frame count is null or undefined.
|
|
66
66
|
*/
|
|
67
|
-
export declare function
|
|
67
|
+
export declare function onOrAfterRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
68
68
|
/**
|
|
69
|
-
* Helper function to check if the current room frame count is equal to or
|
|
69
|
+
* Helper function to check if the current room frame count is equal to or higher than a specific
|
|
70
70
|
* room frame count.
|
|
71
71
|
*
|
|
72
72
|
* This returns false if the submitted room frame count is null or undefined.
|
|
73
73
|
*/
|
|
74
|
-
export declare function
|
|
74
|
+
export declare function onOrAfterRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
75
75
|
/**
|
|
76
|
-
* Helper function to check if the current game frame count is equal to or
|
|
76
|
+
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
77
77
|
* game frame count.
|
|
78
78
|
*
|
|
79
79
|
* This returns false if the submitted game frame count is null or undefined.
|
|
80
80
|
*/
|
|
81
|
-
export declare function
|
|
81
|
+
export declare function onOrBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
82
82
|
/**
|
|
83
|
-
* Helper function to check if the current render frame count is equal to or
|
|
83
|
+
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
84
84
|
* render frame count.
|
|
85
85
|
*
|
|
86
86
|
* This returns false if the submitted render frame count is null or undefined.
|
|
87
87
|
*/
|
|
88
|
-
export declare function
|
|
88
|
+
export declare function onOrBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
89
89
|
/**
|
|
90
|
-
* Helper function to check if the current room frame count is equal to or
|
|
90
|
+
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
91
91
|
* room frame count.
|
|
92
92
|
*
|
|
93
93
|
* This returns false if the submitted room frame count is null or undefined.
|
|
94
94
|
*/
|
|
95
|
-
export declare function
|
|
95
|
+
export declare function onOrBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
96
96
|
/**
|
|
97
97
|
* Helper function to check if the current render frame count is exactly equal to a specific render
|
|
98
98
|
* frame count.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../../src/functions/frames.ts"],"names":[],"mappings":";AAEA,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAGlE;AAED,wBAAgB,2BAA2B,CAAC,gBAAgB,EAAE,GAAG,GAAG,GAAG,CAGtE;AAED,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAIlE;AAED;;;;;GAKG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../../src/functions/frames.ts"],"names":[],"mappings":";AAEA,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAGlE;AAED,wBAAgB,2BAA2B,CAAC,gBAAgB,EAAE,GAAG,GAAG,GAAG,CAGtE;AAED,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAIlE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,kBA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AACH,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAS3E"}
|
|
@@ -14,73 +14,73 @@ function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
|
|
|
14
14
|
local thisRoomFrameCount = room:GetFrameCount()
|
|
15
15
|
return thisRoomFrameCount - roomFrameCount
|
|
16
16
|
end
|
|
17
|
-
--- Helper function to check if the current game frame count is
|
|
17
|
+
--- Helper function to check if the current game frame count is higher than a specific game frame
|
|
18
18
|
-- count.
|
|
19
19
|
--
|
|
20
20
|
-- This returns false if the submitted game frame count is null or undefined.
|
|
21
|
-
function ____exports.
|
|
21
|
+
function ____exports.isAfterGameFrame(self, gameFrameCount)
|
|
22
22
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
23
23
|
return false
|
|
24
24
|
end
|
|
25
25
|
local thisGameFrameCount = game:GetFrameCount()
|
|
26
|
-
return thisGameFrameCount
|
|
26
|
+
return thisGameFrameCount > gameFrameCount
|
|
27
27
|
end
|
|
28
|
-
--- Helper function to check if the current render frame count is
|
|
28
|
+
--- Helper function to check if the current render frame count is higher than a specific render frame
|
|
29
29
|
-- count.
|
|
30
30
|
--
|
|
31
31
|
-- This returns false if the submitted render frame count is null or undefined.
|
|
32
|
-
function ____exports.
|
|
32
|
+
function ____exports.isAfterRenderFrame(self, renderFrameCount)
|
|
33
33
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
34
34
|
return false
|
|
35
35
|
end
|
|
36
36
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
37
|
-
return thisRenderFrameCount
|
|
37
|
+
return thisRenderFrameCount > renderFrameCount
|
|
38
38
|
end
|
|
39
|
-
--- Helper function to check if the current room frame count is
|
|
39
|
+
--- Helper function to check if the current room frame count is higher than a specific room frame
|
|
40
40
|
-- count.
|
|
41
41
|
--
|
|
42
42
|
-- This returns false if the submitted room frame count is null or undefined.
|
|
43
|
-
function ____exports.
|
|
43
|
+
function ____exports.isAfterRoomFrame(self, roomFrameCount)
|
|
44
44
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
45
45
|
return false
|
|
46
46
|
end
|
|
47
47
|
local room = game:GetRoom()
|
|
48
48
|
local thisGameFrameCount = room:GetFrameCount()
|
|
49
|
-
return thisGameFrameCount
|
|
49
|
+
return thisGameFrameCount > roomFrameCount
|
|
50
50
|
end
|
|
51
|
-
--- Helper function to check if the current game frame count is
|
|
51
|
+
--- Helper function to check if the current game frame count is lower than a specific game frame
|
|
52
52
|
-- count.
|
|
53
53
|
--
|
|
54
54
|
-- This returns false if the submitted game frame count is null or undefined.
|
|
55
|
-
function ____exports.
|
|
55
|
+
function ____exports.isBeforeGameFrame(self, gameFrameCount)
|
|
56
56
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
57
57
|
return false
|
|
58
58
|
end
|
|
59
59
|
local thisGameFrameCount = game:GetFrameCount()
|
|
60
|
-
return thisGameFrameCount
|
|
60
|
+
return thisGameFrameCount < gameFrameCount
|
|
61
61
|
end
|
|
62
|
-
--- Helper function to check if the current render frame count is
|
|
62
|
+
--- Helper function to check if the current render frame count is lower than a specific render frame
|
|
63
63
|
-- count.
|
|
64
64
|
--
|
|
65
65
|
-- This returns false if the submitted render frame count is null or undefined.
|
|
66
|
-
function ____exports.
|
|
66
|
+
function ____exports.isBeforeRenderFrame(self, renderFrameCount)
|
|
67
67
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
68
68
|
return false
|
|
69
69
|
end
|
|
70
70
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
71
|
-
return thisRenderFrameCount
|
|
71
|
+
return thisRenderFrameCount < renderFrameCount
|
|
72
72
|
end
|
|
73
|
-
--- Helper function to check if the current room frame count is
|
|
73
|
+
--- Helper function to check if the current room frame count is lower than a specific room frame
|
|
74
74
|
-- count.
|
|
75
75
|
--
|
|
76
76
|
-- This returns false if the submitted room frame count is null or undefined.
|
|
77
|
-
function ____exports.
|
|
77
|
+
function ____exports.isBeforeRoomFrame(self, roomFrameCount)
|
|
78
78
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
79
79
|
return false
|
|
80
80
|
end
|
|
81
81
|
local room = game:GetRoom()
|
|
82
82
|
local thisGameFrameCount = room:GetFrameCount()
|
|
83
|
-
return thisGameFrameCount
|
|
83
|
+
return thisGameFrameCount < roomFrameCount
|
|
84
84
|
end
|
|
85
85
|
--- Helper function to check if the current game frame count is exactly equal to a specific game
|
|
86
86
|
-- frame count.
|
|
@@ -93,33 +93,33 @@ function ____exports.onGameFrame(self, gameFrameCount)
|
|
|
93
93
|
local thisGameFrameCount = game:GetFrameCount()
|
|
94
94
|
return thisGameFrameCount == gameFrameCount
|
|
95
95
|
end
|
|
96
|
-
--- Helper function to check if the current game frame count is equal to or
|
|
96
|
+
--- Helper function to check if the current game frame count is equal to or higher than a specific
|
|
97
97
|
-- game frame count.
|
|
98
98
|
--
|
|
99
99
|
-- This returns false if the submitted game frame count is null or undefined.
|
|
100
|
-
function ____exports.
|
|
100
|
+
function ____exports.onOrAfterGameFrame(self, gameFrameCount)
|
|
101
101
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
102
102
|
return false
|
|
103
103
|
end
|
|
104
104
|
local thisGameFrameCount = game:GetFrameCount()
|
|
105
|
-
return thisGameFrameCount
|
|
105
|
+
return thisGameFrameCount >= gameFrameCount
|
|
106
106
|
end
|
|
107
|
-
--- Helper function to check if the current render frame count is equal to or
|
|
107
|
+
--- Helper function to check if the current render frame count is equal to or higher than a specific
|
|
108
108
|
-- render frame count.
|
|
109
109
|
--
|
|
110
110
|
-- This returns false if the submitted render frame count is null or undefined.
|
|
111
|
-
function ____exports.
|
|
111
|
+
function ____exports.onOrAfterRenderFrame(self, renderFrameCount)
|
|
112
112
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
113
113
|
return false
|
|
114
114
|
end
|
|
115
115
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
116
|
-
return thisRenderFrameCount
|
|
116
|
+
return thisRenderFrameCount >= renderFrameCount
|
|
117
117
|
end
|
|
118
|
-
--- Helper function to check if the current room frame count is equal to or
|
|
118
|
+
--- Helper function to check if the current room frame count is equal to or higher than a specific
|
|
119
119
|
-- room frame count.
|
|
120
120
|
--
|
|
121
121
|
-- This returns false if the submitted room frame count is null or undefined.
|
|
122
|
-
function ____exports.
|
|
122
|
+
function ____exports.onOrAfterRoomFrame(self, roomFrameCount)
|
|
123
123
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
124
124
|
return false
|
|
125
125
|
end
|
|
@@ -127,33 +127,33 @@ function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
|
127
127
|
local thisGameFrameCount = room:GetFrameCount()
|
|
128
128
|
return thisGameFrameCount >= roomFrameCount
|
|
129
129
|
end
|
|
130
|
-
--- Helper function to check if the current game frame count is equal to or
|
|
130
|
+
--- Helper function to check if the current game frame count is equal to or lower than a specific
|
|
131
131
|
-- game frame count.
|
|
132
132
|
--
|
|
133
133
|
-- This returns false if the submitted game frame count is null or undefined.
|
|
134
|
-
function ____exports.
|
|
134
|
+
function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
|
|
135
135
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
136
136
|
return false
|
|
137
137
|
end
|
|
138
138
|
local thisGameFrameCount = game:GetFrameCount()
|
|
139
|
-
return thisGameFrameCount
|
|
139
|
+
return thisGameFrameCount <= gameFrameCount
|
|
140
140
|
end
|
|
141
|
-
--- Helper function to check if the current render frame count is equal to or
|
|
141
|
+
--- Helper function to check if the current render frame count is equal to or lower than a specific
|
|
142
142
|
-- render frame count.
|
|
143
143
|
--
|
|
144
144
|
-- This returns false if the submitted render frame count is null or undefined.
|
|
145
|
-
function ____exports.
|
|
145
|
+
function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
|
|
146
146
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
147
147
|
return false
|
|
148
148
|
end
|
|
149
149
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
150
|
-
return thisRenderFrameCount
|
|
150
|
+
return thisRenderFrameCount <= renderFrameCount
|
|
151
151
|
end
|
|
152
|
-
--- Helper function to check if the current room frame count is equal to or
|
|
152
|
+
--- Helper function to check if the current room frame count is equal to or lower than a specific
|
|
153
153
|
-- room frame count.
|
|
154
154
|
--
|
|
155
155
|
-- This returns false if the submitted room frame count is null or undefined.
|
|
156
|
-
function ____exports.
|
|
156
|
+
function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
157
157
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
158
158
|
return false
|
|
159
159
|
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ButtonAction, Controller, ControllerIndex, Keyboard } from "isaac-typescript-definitions";
|
|
2
2
|
export declare const MODIFIER_KEYS: readonly [Keyboard.LEFT_SHIFT, Keyboard.LEFT_CONTROL, Keyboard.LEFT_ALT, Keyboard.LEFT_SUPER, Keyboard.RIGHT_SHIFT, Keyboard.RIGHT_CONTROL, Keyboard.RIGHT_ALT, Keyboard.RIGHT_SUPER];
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
3
|
+
export declare const MOVEMENT_BUTTON_ACTIONS: readonly [ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP, ButtonAction.DOWN];
|
|
4
|
+
export declare const MOVEMENT_BUTTON_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
5
|
+
export declare const SHOOTING_BUTTON_ACTIONS: readonly [ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN];
|
|
6
|
+
export declare const SHOOTING_BUTTON_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
7
7
|
/**
|
|
8
8
|
* Helper function to get the enum name for the specified `Controller` value. Note that this will
|
|
9
9
|
* trim off the "BUTTON_" prefix.
|
|
@@ -16,13 +16,13 @@ export declare function controllerToString(controller: Controller): string | und
|
|
|
16
16
|
* pressing down. This returns an array because a player can be holding down more than one movement
|
|
17
17
|
* key at a time.
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function getMoveButtonActions(controllerIndex: ControllerIndex): ButtonAction[];
|
|
20
20
|
/**
|
|
21
21
|
* Helper function to get the shooting actions that the specified `ControllerIndex` is currently
|
|
22
22
|
* pressing down. This returns an array because a player can be holding down more than one shooting
|
|
23
23
|
* key at a time.
|
|
24
24
|
*/
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function getShootButtonActions(controllerIndex: ControllerIndex): ButtonAction[];
|
|
26
26
|
/**
|
|
27
27
|
* Helper function to check if a player is pressing a specific button (i.e. holding it down).
|
|
28
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAMtC,eAAO,MAAM,aAAa,uLAShB,CAAC;AAEX,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAMtC,eAAO,MAAM,aAAa,uLAShB,CAAC;AAEX,eAAO,MAAM,uBAAuB,sFAK1B,CAAC;AAEX,eAAO,MAAM,2BAA2B,2BAEvC,CAAC;AAEF,eAAO,MAAM,uBAAuB,8GAK1B,CAAC;AAEX,eAAO,MAAM,2BAA2B,2BAEvC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAA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CAIxD;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAI1D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
|
|
@@ -26,10 +26,10 @@ ____exports.MODIFIER_KEYS = {
|
|
|
26
26
|
Keyboard.RIGHT_ALT,
|
|
27
27
|
Keyboard.RIGHT_SUPER
|
|
28
28
|
}
|
|
29
|
-
____exports.
|
|
30
|
-
____exports.
|
|
31
|
-
____exports.
|
|
32
|
-
____exports.
|
|
29
|
+
____exports.MOVEMENT_BUTTON_ACTIONS = {ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP, ButtonAction.DOWN}
|
|
30
|
+
____exports.MOVEMENT_BUTTON_ACTIONS_SET = __TS__New(ReadonlySet, ____exports.MOVEMENT_BUTTON_ACTIONS)
|
|
31
|
+
____exports.SHOOTING_BUTTON_ACTIONS = {ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN}
|
|
32
|
+
____exports.SHOOTING_BUTTON_ACTIONS_SET = __TS__New(ReadonlySet, ____exports.SHOOTING_BUTTON_ACTIONS)
|
|
33
33
|
--- Helper function to get the enum name for the specified `Controller` value. Note that this will
|
|
34
34
|
-- trim off the "BUTTON_" prefix.
|
|
35
35
|
--
|
|
@@ -44,18 +44,18 @@ end
|
|
|
44
44
|
--- Helper function to get the movement actions that the specified `ControllerIndex` is currently
|
|
45
45
|
-- pressing down. This returns an array because a player can be holding down more than one movement
|
|
46
46
|
-- key at a time.
|
|
47
|
-
function ____exports.
|
|
47
|
+
function ____exports.getMoveButtonActions(self, controllerIndex)
|
|
48
48
|
return __TS__ArrayFilter(
|
|
49
|
-
____exports.
|
|
49
|
+
____exports.MOVEMENT_BUTTON_ACTIONS,
|
|
50
50
|
function(____, buttonAction) return Input.IsActionPressed(buttonAction, controllerIndex) end
|
|
51
51
|
)
|
|
52
52
|
end
|
|
53
53
|
--- Helper function to get the shooting actions that the specified `ControllerIndex` is currently
|
|
54
54
|
-- pressing down. This returns an array because a player can be holding down more than one shooting
|
|
55
55
|
-- key at a time.
|
|
56
|
-
function ____exports.
|
|
56
|
+
function ____exports.getShootButtonActions(self, controllerIndex)
|
|
57
57
|
return __TS__ArrayFilter(
|
|
58
|
-
____exports.
|
|
58
|
+
____exports.SHOOTING_BUTTON_ACTIONS,
|
|
59
59
|
function(____, buttonAction) return Input.IsActionPressed(buttonAction, controllerIndex) end
|
|
60
60
|
)
|
|
61
61
|
end
|
|
@@ -136,18 +136,18 @@ function ____exports.isModifierKeyPressed(self)
|
|
|
136
136
|
)
|
|
137
137
|
end
|
|
138
138
|
function ____exports.isMoveAction(self, buttonAction)
|
|
139
|
-
return ____exports.
|
|
139
|
+
return ____exports.MOVEMENT_BUTTON_ACTIONS_SET:has(buttonAction)
|
|
140
140
|
end
|
|
141
141
|
function ____exports.isMoveActionPressed(self, controllerIndex)
|
|
142
142
|
return ____exports.isActionPressed(
|
|
143
143
|
nil,
|
|
144
144
|
controllerIndex,
|
|
145
|
-
table.unpack(____exports.
|
|
145
|
+
table.unpack(____exports.MOVEMENT_BUTTON_ACTIONS)
|
|
146
146
|
)
|
|
147
147
|
end
|
|
148
148
|
function ____exports.isMoveActionPressedOnAnyInput(self)
|
|
149
149
|
return __TS__ArraySome(
|
|
150
|
-
____exports.
|
|
150
|
+
____exports.MOVEMENT_BUTTON_ACTIONS,
|
|
151
151
|
function(____, moveAction) return ____exports.isActionPressedOnAnyInput(nil, moveAction) end
|
|
152
152
|
)
|
|
153
153
|
end
|
|
@@ -155,28 +155,28 @@ function ____exports.isMoveActionTriggered(self, controllerIndex)
|
|
|
155
155
|
return ____exports.isActionTriggered(
|
|
156
156
|
nil,
|
|
157
157
|
controllerIndex,
|
|
158
|
-
table.unpack(____exports.
|
|
158
|
+
table.unpack(____exports.MOVEMENT_BUTTON_ACTIONS)
|
|
159
159
|
)
|
|
160
160
|
end
|
|
161
161
|
function ____exports.isMoveActionTriggeredOnAnyInput(self)
|
|
162
162
|
return __TS__ArraySome(
|
|
163
|
-
____exports.
|
|
163
|
+
____exports.MOVEMENT_BUTTON_ACTIONS,
|
|
164
164
|
function(____, moveAction) return ____exports.isActionTriggeredOnAnyInput(nil, moveAction) end
|
|
165
165
|
)
|
|
166
166
|
end
|
|
167
167
|
function ____exports.isShootAction(self, buttonAction)
|
|
168
|
-
return ____exports.
|
|
168
|
+
return ____exports.SHOOTING_BUTTON_ACTIONS_SET:has(buttonAction)
|
|
169
169
|
end
|
|
170
170
|
function ____exports.isShootActionPressed(self, controllerIndex)
|
|
171
171
|
return ____exports.isActionPressed(
|
|
172
172
|
nil,
|
|
173
173
|
controllerIndex,
|
|
174
|
-
table.unpack(____exports.
|
|
174
|
+
table.unpack(____exports.SHOOTING_BUTTON_ACTIONS)
|
|
175
175
|
)
|
|
176
176
|
end
|
|
177
177
|
function ____exports.isShootActionPressedOnAnyInput(self)
|
|
178
178
|
return __TS__ArraySome(
|
|
179
|
-
____exports.
|
|
179
|
+
____exports.SHOOTING_BUTTON_ACTIONS,
|
|
180
180
|
function(____, shootAction) return ____exports.isActionPressedOnAnyInput(nil, shootAction) end
|
|
181
181
|
)
|
|
182
182
|
end
|
|
@@ -184,12 +184,12 @@ function ____exports.isShootActionTriggered(self, controllerIndex)
|
|
|
184
184
|
return ____exports.isActionTriggered(
|
|
185
185
|
nil,
|
|
186
186
|
controllerIndex,
|
|
187
|
-
table.unpack(____exports.
|
|
187
|
+
table.unpack(____exports.SHOOTING_BUTTON_ACTIONS)
|
|
188
188
|
)
|
|
189
189
|
end
|
|
190
190
|
function ____exports.isShootActionTriggeredOnAnyInput(self)
|
|
191
191
|
return __TS__ArraySome(
|
|
192
|
-
____exports.
|
|
192
|
+
____exports.SHOOTING_BUTTON_ACTIONS,
|
|
193
193
|
function(____, shootAction) return ____exports.isActionTriggeredOnAnyInput(nil, shootAction) end
|
|
194
194
|
)
|
|
195
195
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
2
2
|
import type { ModCallbackCustom } from "../../enums/ModCallbackCustom";
|
|
3
|
-
import {
|
|
3
|
+
import { isAfterRoomFrame } from "../../functions/frames";
|
|
4
4
|
import { getRoomVisitedCount } from "../../functions/roomData";
|
|
5
5
|
import { shouldFirePickup } from "../../shouldFire";
|
|
6
6
|
import { CustomCallback } from "../private/CustomCallback";
|
|
@@ -29,7 +29,7 @@ export class PostPickupInitFirst extends CustomCallback<ModCallbackCustom.POST_P
|
|
|
29
29
|
|
|
30
30
|
// The room visited count is not reset when re-entering a Treasure Room or Boss room in the
|
|
31
31
|
// Ascent.
|
|
32
|
-
if (
|
|
32
|
+
if (isAfterRoomFrame(0) || roomVisitedCount === 0) {
|
|
33
33
|
this.fire(pickup);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
@@ -22,9 +22,9 @@ import { StageTravelState } from "../../../enums/private/StageTravelState";
|
|
|
22
22
|
import { TrapdoorAnimation } from "../../../enums/private/TrapdoorAnimation";
|
|
23
23
|
import { easeOutSine } from "../../../functions/easing";
|
|
24
24
|
import {
|
|
25
|
+
isAfterRoomFrame,
|
|
25
26
|
isBeforeRenderFrame,
|
|
26
|
-
|
|
27
|
-
onOrPastRenderFrame,
|
|
27
|
+
onOrAfterRenderFrame,
|
|
28
28
|
} from "../../../functions/frames";
|
|
29
29
|
import { log } from "../../../functions/log";
|
|
30
30
|
import { movePlayersToCenter } from "../../../functions/playerCenter";
|
|
@@ -449,7 +449,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
449
449
|
if (
|
|
450
450
|
roomType !== RoomType.BOSS ||
|
|
451
451
|
roomClearGameFrame === undefined ||
|
|
452
|
-
|
|
452
|
+
onOrAfterRenderFrame(roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES)
|
|
453
453
|
) {
|
|
454
454
|
return false;
|
|
455
455
|
}
|
|
@@ -634,7 +634,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
634
634
|
// into them.
|
|
635
635
|
// - Trapdoors created by We Need to Go Deeper should spawn closed because the player will be
|
|
636
636
|
// standing on top of them.
|
|
637
|
-
if (
|
|
637
|
+
if (isAfterRoomFrame(0)) {
|
|
638
638
|
return false;
|
|
639
639
|
}
|
|
640
640
|
|
|
@@ -774,7 +774,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
774
774
|
TrapdoorAnimation.OPENED,
|
|
775
775
|
);
|
|
776
776
|
|
|
777
|
-
const firstSpawn =
|
|
777
|
+
const firstSpawn = isAfterRoomFrame(0);
|
|
778
778
|
const open =
|
|
779
779
|
spawnOpen ?? this.shouldTrapdoorSpawnOpen(gridEntity, firstSpawn);
|
|
780
780
|
|
|
@@ -2,8 +2,8 @@ import type { ButtonAction } from "isaac-typescript-definitions";
|
|
|
2
2
|
import { InputHook, ModCallback } from "isaac-typescript-definitions";
|
|
3
3
|
import { Exported } from "../../../decorators";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
MOVEMENT_BUTTON_ACTIONS_SET,
|
|
6
|
+
SHOOTING_BUTTON_ACTIONS_SET,
|
|
7
7
|
} from "../../../functions/input";
|
|
8
8
|
import { ReadonlySet } from "../../../types/ReadonlySet";
|
|
9
9
|
import { Feature } from "../../private/Feature";
|
|
@@ -246,7 +246,7 @@ export class DisableInputs extends Feature {
|
|
|
246
246
|
*/
|
|
247
247
|
@Exported
|
|
248
248
|
public disableMovementInputs(key: string): void {
|
|
249
|
-
this.enableAllInputsExceptFor(key,
|
|
249
|
+
this.enableAllInputsExceptFor(key, MOVEMENT_BUTTON_ACTIONS_SET);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
/**
|
|
@@ -264,6 +264,6 @@ export class DisableInputs extends Feature {
|
|
|
264
264
|
*/
|
|
265
265
|
@Exported
|
|
266
266
|
public disableShootingInputs(key: string): void {
|
|
267
|
-
this.enableAllInputsExceptFor(key,
|
|
267
|
+
this.enableAllInputsExceptFor(key, SHOOTING_BUTTON_ACTIONS_SET);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
@@ -5,7 +5,7 @@ import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
|
5
5
|
import { SaveDataKey } from "../../../enums/SaveDataKey";
|
|
6
6
|
import { SerializationType } from "../../../enums/SerializationType";
|
|
7
7
|
import { deepCopy } from "../../../functions/deepCopy";
|
|
8
|
-
import {
|
|
8
|
+
import { isAfterGameFrame } from "../../../functions/frames";
|
|
9
9
|
import { log } from "../../../functions/log";
|
|
10
10
|
import { onFirstFloor } from "../../../functions/stage";
|
|
11
11
|
import { getTSTLClassName, isTSTLClass } from "../../../functions/tstlClass";
|
|
@@ -145,7 +145,7 @@ export class SaveDataManager extends Feature {
|
|
|
145
145
|
// data that is not tied to an individual run.
|
|
146
146
|
loadFromDisk(this.mod, this.saveDataMap, this.classConstructors);
|
|
147
147
|
|
|
148
|
-
const isContinued =
|
|
148
|
+
const isContinued = isAfterGameFrame(0);
|
|
149
149
|
if (!isContinued) {
|
|
150
150
|
restoreDefaultsForAllFeaturesAndKeys(
|
|
151
151
|
this.saveDataMap,
|