isaacscript-common 59.6.0 → 59.7.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 +48 -0
- package/dist/isaacscript-common.lua +51 -6
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.lua +3 -2
- package/dist/src/classes/features/other/PickupIndexCreation.lua +2 -2
- package/dist/src/functions/frames.d.ts +42 -0
- package/dist/src/functions/frames.d.ts.map +1 -1
- package/dist/src/functions/frames.lua +69 -1
- package/package.json +1 -1
- package/src/classes/features/other/CustomTrapdoors.ts +3 -2
- package/src/classes/features/other/PickupIndexCreation.ts +2 -2
- package/src/functions/frames.ts +107 -1
package/dist/index.rollup.d.ts
CHANGED
|
@@ -8672,6 +8672,30 @@ export declare function isBattery(pickup: EntityPickup): pickup is EntityPickupB
|
|
|
8672
8672
|
*/
|
|
8673
8673
|
export declare function isBeastRoom(roomData: RoomConfig): boolean;
|
|
8674
8674
|
|
|
8675
|
+
/**
|
|
8676
|
+
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
8677
|
+
* count.
|
|
8678
|
+
*
|
|
8679
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
8680
|
+
*/
|
|
8681
|
+
export declare function isBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
8682
|
+
|
|
8683
|
+
/**
|
|
8684
|
+
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
8685
|
+
* count.
|
|
8686
|
+
*
|
|
8687
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
8688
|
+
*/
|
|
8689
|
+
export declare function isBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
8690
|
+
|
|
8691
|
+
/**
|
|
8692
|
+
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
8693
|
+
* count.
|
|
8694
|
+
*
|
|
8695
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
8696
|
+
*/
|
|
8697
|
+
export declare function isBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
8698
|
+
|
|
8675
8699
|
/**
|
|
8676
8700
|
* Helper function for detecting when a player is Bethany or Tainted Bethany. This is useful if you
|
|
8677
8701
|
* need to adjust UI elements to account for Bethany's soul charges or Tainted Bethany's blood
|
|
@@ -14456,6 +14480,30 @@ export declare function onFirstFloor(): boolean;
|
|
|
14456
14480
|
*/
|
|
14457
14481
|
export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
14458
14482
|
|
|
14483
|
+
/**
|
|
14484
|
+
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
14485
|
+
* game frame count.
|
|
14486
|
+
*
|
|
14487
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
14488
|
+
*/
|
|
14489
|
+
export declare function onOrBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
14490
|
+
|
|
14491
|
+
/**
|
|
14492
|
+
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
14493
|
+
* render frame count.
|
|
14494
|
+
*
|
|
14495
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
14496
|
+
*/
|
|
14497
|
+
export declare function onOrBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
14498
|
+
|
|
14499
|
+
/**
|
|
14500
|
+
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
14501
|
+
* room frame count.
|
|
14502
|
+
*
|
|
14503
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
14504
|
+
*/
|
|
14505
|
+
export declare function onOrBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
14506
|
+
|
|
14459
14507
|
/**
|
|
14460
14508
|
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
14461
14509
|
* game frame count.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 59.
|
|
3
|
+
isaacscript-common 59.7.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -19091,6 +19091,28 @@ function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
|
|
|
19091
19091
|
local thisRoomFrameCount = room:GetFrameCount()
|
|
19092
19092
|
return thisRoomFrameCount - roomFrameCount
|
|
19093
19093
|
end
|
|
19094
|
+
function ____exports.isBeforeGameFrame(self, gameFrameCount)
|
|
19095
|
+
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19096
|
+
return false
|
|
19097
|
+
end
|
|
19098
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
19099
|
+
return thisGameFrameCount < gameFrameCount
|
|
19100
|
+
end
|
|
19101
|
+
function ____exports.isBeforeRenderFrame(self, renderFrameCount)
|
|
19102
|
+
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19103
|
+
return false
|
|
19104
|
+
end
|
|
19105
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19106
|
+
return thisRenderFrameCount < renderFrameCount
|
|
19107
|
+
end
|
|
19108
|
+
function ____exports.isBeforeRoomFrame(self, roomFrameCount)
|
|
19109
|
+
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19110
|
+
return false
|
|
19111
|
+
end
|
|
19112
|
+
local room = game:GetRoom()
|
|
19113
|
+
local thisGameFrameCount = room:GetFrameCount()
|
|
19114
|
+
return thisGameFrameCount < roomFrameCount
|
|
19115
|
+
end
|
|
19094
19116
|
function ____exports.isPastGameFrame(self, gameFrameCount)
|
|
19095
19117
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19096
19118
|
return false
|
|
@@ -19103,7 +19125,7 @@ function ____exports.isPastRenderFrame(self, renderFrameCount)
|
|
|
19103
19125
|
return false
|
|
19104
19126
|
end
|
|
19105
19127
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19106
|
-
return thisRenderFrameCount
|
|
19128
|
+
return thisRenderFrameCount > renderFrameCount
|
|
19107
19129
|
end
|
|
19108
19130
|
function ____exports.isPastRoomFrame(self, roomFrameCount)
|
|
19109
19131
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
@@ -19120,6 +19142,28 @@ function ____exports.onGameFrame(self, gameFrameCount)
|
|
|
19120
19142
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19121
19143
|
return thisGameFrameCount == gameFrameCount
|
|
19122
19144
|
end
|
|
19145
|
+
function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
|
|
19146
|
+
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19147
|
+
return false
|
|
19148
|
+
end
|
|
19149
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
19150
|
+
return thisGameFrameCount <= gameFrameCount
|
|
19151
|
+
end
|
|
19152
|
+
function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
|
|
19153
|
+
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19154
|
+
return false
|
|
19155
|
+
end
|
|
19156
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19157
|
+
return thisRenderFrameCount <= renderFrameCount
|
|
19158
|
+
end
|
|
19159
|
+
function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
19160
|
+
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19161
|
+
return false
|
|
19162
|
+
end
|
|
19163
|
+
local room = game:GetRoom()
|
|
19164
|
+
local thisGameFrameCount = room:GetFrameCount()
|
|
19165
|
+
return thisGameFrameCount >= roomFrameCount
|
|
19166
|
+
end
|
|
19123
19167
|
function ____exports.onOrPastGameFrame(self, gameFrameCount)
|
|
19124
19168
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19125
19169
|
return false
|
|
@@ -38078,7 +38122,7 @@ local ISCFeature = ____ISCFeature.ISCFeature
|
|
|
38078
38122
|
local ____entities = require("src.functions.entities")
|
|
38079
38123
|
local getEntityID = ____entities.getEntityID
|
|
38080
38124
|
local ____frames = require("src.functions.frames")
|
|
38081
|
-
local
|
|
38125
|
+
local onOrBeforeRoomFrame = ____frames.onOrBeforeRoomFrame
|
|
38082
38126
|
local ____roomData = require("src.functions.roomData")
|
|
38083
38127
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
38084
38128
|
local ____stage = require("src.functions.stage")
|
|
@@ -38137,7 +38181,7 @@ function PickupIndexCreation.prototype.setPickupIndex(self, pickup)
|
|
|
38137
38181
|
local pickupIndexFromLevelData = self:getPickupIndexFromPreviousData(pickup)
|
|
38138
38182
|
local room = game:GetRoom()
|
|
38139
38183
|
local isFirstVisit = room:IsFirstVisit()
|
|
38140
|
-
if pickupIndexFromLevelData ~= nil and not isFirstVisit and
|
|
38184
|
+
if pickupIndexFromLevelData ~= nil and not isFirstVisit and onOrBeforeRoomFrame(nil, 0) then
|
|
38141
38185
|
v.room.pickupIndexes:set(ptrHash, pickupIndexFromLevelData)
|
|
38142
38186
|
return
|
|
38143
38187
|
end
|
|
@@ -42451,6 +42495,7 @@ local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
|
|
|
42451
42495
|
local ____easing = require("src.functions.easing")
|
|
42452
42496
|
local easeOutSine = ____easing.easeOutSine
|
|
42453
42497
|
local ____frames = require("src.functions.frames")
|
|
42498
|
+
local isBeforeRenderFrame = ____frames.isBeforeRenderFrame
|
|
42454
42499
|
local isPastRoomFrame = ____frames.isPastRoomFrame
|
|
42455
42500
|
local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
|
|
42456
42501
|
local ____log = require("src.functions.log")
|
|
@@ -42611,7 +42656,7 @@ function CustomTrapdoors.prototype.checkPixelationToBlackComplete(self)
|
|
|
42611
42656
|
return
|
|
42612
42657
|
end
|
|
42613
42658
|
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
42614
|
-
if
|
|
42659
|
+
if isBeforeRenderFrame(nil, renderFrameScreenBlack) then
|
|
42615
42660
|
return
|
|
42616
42661
|
end
|
|
42617
42662
|
v.run.state = StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END
|
|
@@ -42656,7 +42701,7 @@ function CustomTrapdoors.prototype.checkSecondPixelationHalfWay(self)
|
|
|
42656
42701
|
return
|
|
42657
42702
|
end
|
|
42658
42703
|
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
42659
|
-
if
|
|
42704
|
+
if isBeforeRenderFrame(nil, renderFrameScreenBlack) then
|
|
42660
42705
|
return
|
|
42661
42706
|
end
|
|
42662
42707
|
v.run.state = StageTravelState.PIXELATION_TO_ROOM
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomTrapdoors.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomTrapdoors.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAKV,SAAS,EACV,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomTrapdoors.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomTrapdoors.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAKV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAoCtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAkDhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,qCAAqC;IACrC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAO/B;IAKJ;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAY;IAExC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAmD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utSine
|
|
43
43
|
local ____frames = require("src.functions.frames")
|
|
44
|
+
local isBeforeRenderFrame = ____frames.isBeforeRenderFrame
|
|
44
45
|
local isPastRoomFrame = ____frames.isPastRoomFrame
|
|
45
46
|
local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
|
|
46
47
|
local ____log = require("src.functions.log")
|
|
@@ -202,7 +203,7 @@ function CustomTrapdoors.prototype.checkPixelationToBlackComplete(self)
|
|
|
202
203
|
return
|
|
203
204
|
end
|
|
204
205
|
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
205
|
-
if
|
|
206
|
+
if isBeforeRenderFrame(nil, renderFrameScreenBlack) then
|
|
206
207
|
return
|
|
207
208
|
end
|
|
208
209
|
v.run.state = StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END
|
|
@@ -247,7 +248,7 @@ function CustomTrapdoors.prototype.checkSecondPixelationHalfWay(self)
|
|
|
247
248
|
return
|
|
248
249
|
end
|
|
249
250
|
local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
|
|
250
|
-
if
|
|
251
|
+
if isBeforeRenderFrame(nil, renderFrameScreenBlack) then
|
|
251
252
|
return
|
|
252
253
|
end
|
|
253
254
|
v.run.state = StageTravelState.PIXELATION_TO_ROOM
|
|
@@ -20,7 +20,7 @@ local ISCFeature = ____ISCFeature.ISCFeature
|
|
|
20
20
|
local ____entities = require("src.functions.entities")
|
|
21
21
|
local getEntityID = ____entities.getEntityID
|
|
22
22
|
local ____frames = require("src.functions.frames")
|
|
23
|
-
local
|
|
23
|
+
local onOrBeforeRoomFrame = ____frames.onOrBeforeRoomFrame
|
|
24
24
|
local ____roomData = require("src.functions.roomData")
|
|
25
25
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
26
26
|
local ____stage = require("src.functions.stage")
|
|
@@ -79,7 +79,7 @@ function PickupIndexCreation.prototype.setPickupIndex(self, pickup)
|
|
|
79
79
|
local pickupIndexFromLevelData = self:getPickupIndexFromPreviousData(pickup)
|
|
80
80
|
local room = game:GetRoom()
|
|
81
81
|
local isFirstVisit = room:IsFirstVisit()
|
|
82
|
-
if pickupIndexFromLevelData ~= nil and not isFirstVisit and
|
|
82
|
+
if pickupIndexFromLevelData ~= nil and not isFirstVisit and onOrBeforeRoomFrame(nil, 0) then
|
|
83
83
|
v.room.pickupIndexes:set(ptrHash, pickupIndexFromLevelData)
|
|
84
84
|
return
|
|
85
85
|
end
|
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
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
|
+
/**
|
|
6
|
+
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
7
|
+
* count.
|
|
8
|
+
*
|
|
9
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
14
|
+
* count.
|
|
15
|
+
*
|
|
16
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
21
|
+
* count.
|
|
22
|
+
*
|
|
23
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
5
26
|
/**
|
|
6
27
|
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
7
28
|
* count.
|
|
@@ -30,6 +51,27 @@ export declare function isPastRoomFrame(roomFrameCount: int | null | undefined):
|
|
|
30
51
|
* This returns false if the submitted game frame count is null or undefined.
|
|
31
52
|
*/
|
|
32
53
|
export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
56
|
+
* game frame count.
|
|
57
|
+
*
|
|
58
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
59
|
+
*/
|
|
60
|
+
export declare function onOrBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
63
|
+
* render frame count.
|
|
64
|
+
*
|
|
65
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
66
|
+
*/
|
|
67
|
+
export declare function onOrBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
70
|
+
* room frame count.
|
|
71
|
+
*
|
|
72
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
73
|
+
*/
|
|
74
|
+
export declare function onOrBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
33
75
|
/**
|
|
34
76
|
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
35
77
|
* game 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,eAAe,CAC7B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,g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AAgB,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,6 +14,40 @@ 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 lower than a specific game frame
|
|
18
|
+
-- count.
|
|
19
|
+
--
|
|
20
|
+
-- This returns false if the submitted game frame count is null or undefined.
|
|
21
|
+
function ____exports.isBeforeGameFrame(self, gameFrameCount)
|
|
22
|
+
if gameFrameCount == nil or gameFrameCount == nil then
|
|
23
|
+
return false
|
|
24
|
+
end
|
|
25
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
26
|
+
return thisGameFrameCount < gameFrameCount
|
|
27
|
+
end
|
|
28
|
+
--- Helper function to check if the current render frame count is lower than a specific render frame
|
|
29
|
+
-- count.
|
|
30
|
+
--
|
|
31
|
+
-- This returns false if the submitted render frame count is null or undefined.
|
|
32
|
+
function ____exports.isBeforeRenderFrame(self, renderFrameCount)
|
|
33
|
+
if renderFrameCount == nil or renderFrameCount == nil then
|
|
34
|
+
return false
|
|
35
|
+
end
|
|
36
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
37
|
+
return thisRenderFrameCount < renderFrameCount
|
|
38
|
+
end
|
|
39
|
+
--- Helper function to check if the current room frame count is lower than a specific room frame
|
|
40
|
+
-- count.
|
|
41
|
+
--
|
|
42
|
+
-- This returns false if the submitted room frame count is null or undefined.
|
|
43
|
+
function ____exports.isBeforeRoomFrame(self, roomFrameCount)
|
|
44
|
+
if roomFrameCount == nil or roomFrameCount == nil then
|
|
45
|
+
return false
|
|
46
|
+
end
|
|
47
|
+
local room = game:GetRoom()
|
|
48
|
+
local thisGameFrameCount = room:GetFrameCount()
|
|
49
|
+
return thisGameFrameCount < roomFrameCount
|
|
50
|
+
end
|
|
17
51
|
--- Helper function to check if the current game frame count is higher than a specific game frame
|
|
18
52
|
-- count.
|
|
19
53
|
--
|
|
@@ -34,7 +68,7 @@ function ____exports.isPastRenderFrame(self, renderFrameCount)
|
|
|
34
68
|
return false
|
|
35
69
|
end
|
|
36
70
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
37
|
-
return thisRenderFrameCount
|
|
71
|
+
return thisRenderFrameCount > renderFrameCount
|
|
38
72
|
end
|
|
39
73
|
--- Helper function to check if the current room frame count is higher than a specific room frame
|
|
40
74
|
-- count.
|
|
@@ -59,6 +93,40 @@ function ____exports.onGameFrame(self, gameFrameCount)
|
|
|
59
93
|
local thisGameFrameCount = game:GetFrameCount()
|
|
60
94
|
return thisGameFrameCount == gameFrameCount
|
|
61
95
|
end
|
|
96
|
+
--- Helper function to check if the current game frame count is equal to or lower than a specific
|
|
97
|
+
-- game frame count.
|
|
98
|
+
--
|
|
99
|
+
-- This returns false if the submitted game frame count is null or undefined.
|
|
100
|
+
function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
|
|
101
|
+
if gameFrameCount == nil or gameFrameCount == nil then
|
|
102
|
+
return false
|
|
103
|
+
end
|
|
104
|
+
local thisGameFrameCount = game:GetFrameCount()
|
|
105
|
+
return thisGameFrameCount <= gameFrameCount
|
|
106
|
+
end
|
|
107
|
+
--- Helper function to check if the current render frame count is equal to or lower than a specific
|
|
108
|
+
-- render frame count.
|
|
109
|
+
--
|
|
110
|
+
-- This returns false if the submitted render frame count is null or undefined.
|
|
111
|
+
function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
|
|
112
|
+
if renderFrameCount == nil or renderFrameCount == nil then
|
|
113
|
+
return false
|
|
114
|
+
end
|
|
115
|
+
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
116
|
+
return thisRenderFrameCount <= renderFrameCount
|
|
117
|
+
end
|
|
118
|
+
--- Helper function to check if the current room frame count is equal to or lower than a specific
|
|
119
|
+
-- room frame count.
|
|
120
|
+
--
|
|
121
|
+
-- This returns false if the submitted room frame count is null or undefined.
|
|
122
|
+
function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
123
|
+
if roomFrameCount == nil or roomFrameCount == nil then
|
|
124
|
+
return false
|
|
125
|
+
end
|
|
126
|
+
local room = game:GetRoom()
|
|
127
|
+
local thisGameFrameCount = room:GetFrameCount()
|
|
128
|
+
return thisGameFrameCount >= roomFrameCount
|
|
129
|
+
end
|
|
62
130
|
--- Helper function to check if the current game frame count is equal to or higher than a specific
|
|
63
131
|
-- game frame count.
|
|
64
132
|
--
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ 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
|
+
isBeforeRenderFrame,
|
|
25
26
|
isPastRoomFrame,
|
|
26
27
|
onOrPastRenderFrame,
|
|
27
28
|
} from "../../../functions/frames";
|
|
@@ -224,7 +225,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
224
225
|
|
|
225
226
|
const renderFrameScreenBlack =
|
|
226
227
|
v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES;
|
|
227
|
-
if (
|
|
228
|
+
if (isBeforeRenderFrame(renderFrameScreenBlack)) {
|
|
228
229
|
return;
|
|
229
230
|
}
|
|
230
231
|
|
|
@@ -317,7 +318,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
317
318
|
|
|
318
319
|
const renderFrameScreenBlack =
|
|
319
320
|
v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES;
|
|
320
|
-
if (
|
|
321
|
+
if (isBeforeRenderFrame(renderFrameScreenBlack)) {
|
|
321
322
|
return;
|
|
322
323
|
}
|
|
323
324
|
|
|
@@ -7,7 +7,7 @@ import { game } from "../../../core/cachedClasses";
|
|
|
7
7
|
import { Exported } from "../../../decorators";
|
|
8
8
|
import { ISCFeature } from "../../../enums/ISCFeature";
|
|
9
9
|
import { getEntityID } from "../../../functions/entities";
|
|
10
|
-
import {
|
|
10
|
+
import { onOrBeforeRoomFrame } from "../../../functions/frames";
|
|
11
11
|
import { getRoomListIndex } from "../../../functions/roomData";
|
|
12
12
|
import { onAscent } from "../../../functions/stage";
|
|
13
13
|
import { vectorEquals } from "../../../functions/vector";
|
|
@@ -97,7 +97,7 @@ export class PickupIndexCreation extends Feature {
|
|
|
97
97
|
if (
|
|
98
98
|
pickupIndexFromLevelData !== undefined &&
|
|
99
99
|
!isFirstVisit &&
|
|
100
|
-
|
|
100
|
+
onOrBeforeRoomFrame(0)
|
|
101
101
|
) {
|
|
102
102
|
v.room.pickupIndexes.set(ptrHash, pickupIndexFromLevelData);
|
|
103
103
|
return;
|
package/src/functions/frames.ts
CHANGED
|
@@ -16,6 +16,59 @@ export function getElapsedRoomFramesSince(roomFrameCount: int): int {
|
|
|
16
16
|
return thisRoomFrameCount - roomFrameCount;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
21
|
+
* count.
|
|
22
|
+
*
|
|
23
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
24
|
+
*/
|
|
25
|
+
export function isBeforeGameFrame(
|
|
26
|
+
gameFrameCount: int | null | undefined,
|
|
27
|
+
): boolean {
|
|
28
|
+
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const thisGameFrameCount = game.GetFrameCount();
|
|
33
|
+
return thisGameFrameCount < gameFrameCount;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
38
|
+
* count.
|
|
39
|
+
*
|
|
40
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
41
|
+
*/
|
|
42
|
+
export function isBeforeRenderFrame(
|
|
43
|
+
renderFrameCount: int | null | undefined,
|
|
44
|
+
): boolean {
|
|
45
|
+
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
50
|
+
return thisRenderFrameCount < renderFrameCount;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
55
|
+
* count.
|
|
56
|
+
*
|
|
57
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
58
|
+
*/
|
|
59
|
+
export function isBeforeRoomFrame(
|
|
60
|
+
roomFrameCount: int | null | undefined,
|
|
61
|
+
): boolean {
|
|
62
|
+
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const room = game.GetRoom();
|
|
67
|
+
|
|
68
|
+
const thisGameFrameCount = room.GetFrameCount();
|
|
69
|
+
return thisGameFrameCount < roomFrameCount;
|
|
70
|
+
}
|
|
71
|
+
|
|
19
72
|
/**
|
|
20
73
|
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
21
74
|
* count.
|
|
@@ -47,7 +100,7 @@ export function isPastRenderFrame(
|
|
|
47
100
|
}
|
|
48
101
|
|
|
49
102
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
50
|
-
return thisRenderFrameCount
|
|
103
|
+
return thisRenderFrameCount > renderFrameCount;
|
|
51
104
|
}
|
|
52
105
|
|
|
53
106
|
/**
|
|
@@ -84,6 +137,59 @@ export function onGameFrame(gameFrameCount: int | null | undefined): boolean {
|
|
|
84
137
|
return thisGameFrameCount === gameFrameCount;
|
|
85
138
|
}
|
|
86
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
142
|
+
* game frame count.
|
|
143
|
+
*
|
|
144
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
145
|
+
*/
|
|
146
|
+
export function onOrBeforeGameFrame(
|
|
147
|
+
gameFrameCount: int | null | undefined,
|
|
148
|
+
): boolean {
|
|
149
|
+
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const thisGameFrameCount = game.GetFrameCount();
|
|
154
|
+
return thisGameFrameCount <= gameFrameCount;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
159
|
+
* render frame count.
|
|
160
|
+
*
|
|
161
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
162
|
+
*/
|
|
163
|
+
export function onOrBeforeRenderFrame(
|
|
164
|
+
renderFrameCount: int | null | undefined,
|
|
165
|
+
): boolean {
|
|
166
|
+
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
171
|
+
return thisRenderFrameCount <= renderFrameCount;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
176
|
+
* room frame count.
|
|
177
|
+
*
|
|
178
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
179
|
+
*/
|
|
180
|
+
export function onOrBeforeRoomFrame(
|
|
181
|
+
roomFrameCount: int | null | undefined,
|
|
182
|
+
): boolean {
|
|
183
|
+
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const room = game.GetRoom();
|
|
188
|
+
|
|
189
|
+
const thisGameFrameCount = room.GetFrameCount();
|
|
190
|
+
return thisGameFrameCount >= roomFrameCount;
|
|
191
|
+
}
|
|
192
|
+
|
|
87
193
|
/**
|
|
88
194
|
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
89
195
|
* game frame count.
|