isaacscript-common 59.7.0 → 60.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 +36 -36
- package/dist/isaacscript-common.lua +32 -32
- 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/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/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/SaveDataManager.ts +2 -2
- package/src/functions/frames.ts +34 -34
package/dist/index.rollup.d.ts
CHANGED
|
@@ -8592,6 +8592,30 @@ export declare function isActiveSlotDoubleCharged(player: EntityPlayer, activeSl
|
|
|
8592
8592
|
*/
|
|
8593
8593
|
export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot?: ActiveSlot): boolean;
|
|
8594
8594
|
|
|
8595
|
+
/**
|
|
8596
|
+
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
8597
|
+
* count.
|
|
8598
|
+
*
|
|
8599
|
+
* This returns false if the submitted game frame count is null or undefined.
|
|
8600
|
+
*/
|
|
8601
|
+
export declare function isAfterGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
8602
|
+
|
|
8603
|
+
/**
|
|
8604
|
+
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
8605
|
+
* count.
|
|
8606
|
+
*
|
|
8607
|
+
* This returns false if the submitted render frame count is null or undefined.
|
|
8608
|
+
*/
|
|
8609
|
+
export declare function isAfterRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
8610
|
+
|
|
8611
|
+
/**
|
|
8612
|
+
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
8613
|
+
* count.
|
|
8614
|
+
*
|
|
8615
|
+
* This returns false if the submitted room frame count is null or undefined.
|
|
8616
|
+
*/
|
|
8617
|
+
export declare function isAfterRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
8618
|
+
|
|
8595
8619
|
/**
|
|
8596
8620
|
* Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
|
|
8597
8621
|
* not actually keep the doors closed (like Death's scythes).
|
|
@@ -9437,30 +9461,6 @@ export declare function isOdd(num: int): boolean;
|
|
|
9437
9461
|
*/
|
|
9438
9462
|
export declare function isPassiveOrFamiliarCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean;
|
|
9439
9463
|
|
|
9440
|
-
/**
|
|
9441
|
-
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
9442
|
-
* count.
|
|
9443
|
-
*
|
|
9444
|
-
* This returns false if the submitted game frame count is null or undefined.
|
|
9445
|
-
*/
|
|
9446
|
-
export declare function isPastGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
9447
|
-
|
|
9448
|
-
/**
|
|
9449
|
-
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
9450
|
-
* count.
|
|
9451
|
-
*
|
|
9452
|
-
* This returns false if the submitted render frame count is null or undefined.
|
|
9453
|
-
*/
|
|
9454
|
-
export declare function isPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
9455
|
-
|
|
9456
|
-
/**
|
|
9457
|
-
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
9458
|
-
* count.
|
|
9459
|
-
*
|
|
9460
|
-
* This returns false if the submitted room frame count is null or undefined.
|
|
9461
|
-
*/
|
|
9462
|
-
export declare function isPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
9463
|
-
|
|
9464
9464
|
/** Helper function to narrow the type of `PickingUpItem`. */
|
|
9465
9465
|
export declare function isPickingUpItemCollectible(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemCollectible;
|
|
9466
9466
|
|
|
@@ -14481,52 +14481,52 @@ export declare function onFirstFloor(): boolean;
|
|
|
14481
14481
|
export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
14482
14482
|
|
|
14483
14483
|
/**
|
|
14484
|
-
* Helper function to check if the current game frame count is equal to or
|
|
14484
|
+
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
14485
14485
|
* game frame count.
|
|
14486
14486
|
*
|
|
14487
14487
|
* This returns false if the submitted game frame count is null or undefined.
|
|
14488
14488
|
*/
|
|
14489
|
-
export declare function
|
|
14489
|
+
export declare function onOrAfterGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
14490
14490
|
|
|
14491
14491
|
/**
|
|
14492
|
-
* Helper function to check if the current render frame count is equal to or
|
|
14492
|
+
* Helper function to check if the current render frame count is equal to or higher than a specific
|
|
14493
14493
|
* render frame count.
|
|
14494
14494
|
*
|
|
14495
14495
|
* This returns false if the submitted render frame count is null or undefined.
|
|
14496
14496
|
*/
|
|
14497
|
-
export declare function
|
|
14497
|
+
export declare function onOrAfterRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
14498
14498
|
|
|
14499
14499
|
/**
|
|
14500
|
-
* Helper function to check if the current room frame count is equal to or
|
|
14500
|
+
* Helper function to check if the current room frame count is equal to or higher than a specific
|
|
14501
14501
|
* room frame count.
|
|
14502
14502
|
*
|
|
14503
14503
|
* This returns false if the submitted room frame count is null or undefined.
|
|
14504
14504
|
*/
|
|
14505
|
-
export declare function
|
|
14505
|
+
export declare function onOrAfterRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
14506
14506
|
|
|
14507
14507
|
/**
|
|
14508
|
-
* Helper function to check if the current game frame count is equal to or
|
|
14508
|
+
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
14509
14509
|
* game frame count.
|
|
14510
14510
|
*
|
|
14511
14511
|
* This returns false if the submitted game frame count is null or undefined.
|
|
14512
14512
|
*/
|
|
14513
|
-
export declare function
|
|
14513
|
+
export declare function onOrBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
|
|
14514
14514
|
|
|
14515
14515
|
/**
|
|
14516
|
-
* Helper function to check if the current render frame count is equal to or
|
|
14516
|
+
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
14517
14517
|
* render frame count.
|
|
14518
14518
|
*
|
|
14519
14519
|
* This returns false if the submitted render frame count is null or undefined.
|
|
14520
14520
|
*/
|
|
14521
|
-
export declare function
|
|
14521
|
+
export declare function onOrBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
|
|
14522
14522
|
|
|
14523
14523
|
/**
|
|
14524
|
-
* Helper function to check if the current room frame count is equal to or
|
|
14524
|
+
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
14525
14525
|
* room frame count.
|
|
14526
14526
|
*
|
|
14527
14527
|
* This returns false if the submitted room frame count is null or undefined.
|
|
14528
14528
|
*/
|
|
14529
|
-
export declare function
|
|
14529
|
+
export declare function onOrBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
|
|
14530
14530
|
|
|
14531
14531
|
/**
|
|
14532
14532
|
* Helper function to check if the current render frame count is exactly equal to a specific render
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 60.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -19091,49 +19091,49 @@ function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
|
|
|
19091
19091
|
local thisRoomFrameCount = room:GetFrameCount()
|
|
19092
19092
|
return thisRoomFrameCount - roomFrameCount
|
|
19093
19093
|
end
|
|
19094
|
-
function ____exports.
|
|
19094
|
+
function ____exports.isAfterGameFrame(self, gameFrameCount)
|
|
19095
19095
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19096
19096
|
return false
|
|
19097
19097
|
end
|
|
19098
19098
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19099
|
-
return thisGameFrameCount
|
|
19099
|
+
return thisGameFrameCount > gameFrameCount
|
|
19100
19100
|
end
|
|
19101
|
-
function ____exports.
|
|
19101
|
+
function ____exports.isAfterRenderFrame(self, renderFrameCount)
|
|
19102
19102
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19103
19103
|
return false
|
|
19104
19104
|
end
|
|
19105
19105
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19106
|
-
return thisRenderFrameCount
|
|
19106
|
+
return thisRenderFrameCount > renderFrameCount
|
|
19107
19107
|
end
|
|
19108
|
-
function ____exports.
|
|
19108
|
+
function ____exports.isAfterRoomFrame(self, roomFrameCount)
|
|
19109
19109
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19110
19110
|
return false
|
|
19111
19111
|
end
|
|
19112
19112
|
local room = game:GetRoom()
|
|
19113
19113
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19114
|
-
return thisGameFrameCount
|
|
19114
|
+
return thisGameFrameCount > roomFrameCount
|
|
19115
19115
|
end
|
|
19116
|
-
function ____exports.
|
|
19116
|
+
function ____exports.isBeforeGameFrame(self, gameFrameCount)
|
|
19117
19117
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19118
19118
|
return false
|
|
19119
19119
|
end
|
|
19120
19120
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19121
|
-
return thisGameFrameCount
|
|
19121
|
+
return thisGameFrameCount < gameFrameCount
|
|
19122
19122
|
end
|
|
19123
|
-
function ____exports.
|
|
19123
|
+
function ____exports.isBeforeRenderFrame(self, renderFrameCount)
|
|
19124
19124
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19125
19125
|
return false
|
|
19126
19126
|
end
|
|
19127
19127
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19128
|
-
return thisRenderFrameCount
|
|
19128
|
+
return thisRenderFrameCount < renderFrameCount
|
|
19129
19129
|
end
|
|
19130
|
-
function ____exports.
|
|
19130
|
+
function ____exports.isBeforeRoomFrame(self, roomFrameCount)
|
|
19131
19131
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19132
19132
|
return false
|
|
19133
19133
|
end
|
|
19134
19134
|
local room = game:GetRoom()
|
|
19135
19135
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19136
|
-
return thisGameFrameCount
|
|
19136
|
+
return thisGameFrameCount < roomFrameCount
|
|
19137
19137
|
end
|
|
19138
19138
|
function ____exports.onGameFrame(self, gameFrameCount)
|
|
19139
19139
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
@@ -19142,21 +19142,21 @@ function ____exports.onGameFrame(self, gameFrameCount)
|
|
|
19142
19142
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19143
19143
|
return thisGameFrameCount == gameFrameCount
|
|
19144
19144
|
end
|
|
19145
|
-
function ____exports.
|
|
19145
|
+
function ____exports.onOrAfterGameFrame(self, gameFrameCount)
|
|
19146
19146
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19147
19147
|
return false
|
|
19148
19148
|
end
|
|
19149
19149
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19150
|
-
return thisGameFrameCount
|
|
19150
|
+
return thisGameFrameCount >= gameFrameCount
|
|
19151
19151
|
end
|
|
19152
|
-
function ____exports.
|
|
19152
|
+
function ____exports.onOrAfterRenderFrame(self, renderFrameCount)
|
|
19153
19153
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19154
19154
|
return false
|
|
19155
19155
|
end
|
|
19156
19156
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19157
|
-
return thisRenderFrameCount
|
|
19157
|
+
return thisRenderFrameCount >= renderFrameCount
|
|
19158
19158
|
end
|
|
19159
|
-
function ____exports.
|
|
19159
|
+
function ____exports.onOrAfterRoomFrame(self, roomFrameCount)
|
|
19160
19160
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19161
19161
|
return false
|
|
19162
19162
|
end
|
|
@@ -19164,21 +19164,21 @@ function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
|
19164
19164
|
local thisGameFrameCount = room:GetFrameCount()
|
|
19165
19165
|
return thisGameFrameCount >= roomFrameCount
|
|
19166
19166
|
end
|
|
19167
|
-
function ____exports.
|
|
19167
|
+
function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
|
|
19168
19168
|
if gameFrameCount == nil or gameFrameCount == nil then
|
|
19169
19169
|
return false
|
|
19170
19170
|
end
|
|
19171
19171
|
local thisGameFrameCount = game:GetFrameCount()
|
|
19172
|
-
return thisGameFrameCount
|
|
19172
|
+
return thisGameFrameCount <= gameFrameCount
|
|
19173
19173
|
end
|
|
19174
|
-
function ____exports.
|
|
19174
|
+
function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
|
|
19175
19175
|
if renderFrameCount == nil or renderFrameCount == nil then
|
|
19176
19176
|
return false
|
|
19177
19177
|
end
|
|
19178
19178
|
local thisRenderFrameCount = Isaac.GetFrameCount()
|
|
19179
|
-
return thisRenderFrameCount
|
|
19179
|
+
return thisRenderFrameCount <= renderFrameCount
|
|
19180
19180
|
end
|
|
19181
|
-
function ____exports.
|
|
19181
|
+
function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
|
|
19182
19182
|
if roomFrameCount == nil or roomFrameCount == nil then
|
|
19183
19183
|
return false
|
|
19184
19184
|
end
|
|
@@ -29605,7 +29605,7 @@ local ____exports = {}
|
|
|
29605
29605
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
29606
29606
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
29607
29607
|
local ____frames = require("src.functions.frames")
|
|
29608
|
-
local
|
|
29608
|
+
local isAfterRoomFrame = ____frames.isAfterRoomFrame
|
|
29609
29609
|
local ____roomData = require("src.functions.roomData")
|
|
29610
29610
|
local getRoomVisitedCount = ____roomData.getRoomVisitedCount
|
|
29611
29611
|
local ____shouldFire = require("src.shouldFire")
|
|
@@ -29622,7 +29622,7 @@ function PostPickupInitFirst.prototype.____constructor(self)
|
|
|
29622
29622
|
self.shouldFire = shouldFirePickup
|
|
29623
29623
|
self.postPickupInit = function(____, pickup)
|
|
29624
29624
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
29625
|
-
if
|
|
29625
|
+
if isAfterRoomFrame(nil, 0) or roomVisitedCount == 0 then
|
|
29626
29626
|
self:fire(pickup)
|
|
29627
29627
|
end
|
|
29628
29628
|
end
|
|
@@ -37909,7 +37909,7 @@ local SerializationType = ____SerializationType.SerializationType
|
|
|
37909
37909
|
local ____deepCopy = require("src.functions.deepCopy")
|
|
37910
37910
|
local deepCopy = ____deepCopy.deepCopy
|
|
37911
37911
|
local ____frames = require("src.functions.frames")
|
|
37912
|
-
local
|
|
37912
|
+
local isAfterGameFrame = ____frames.isAfterGameFrame
|
|
37913
37913
|
local ____log = require("src.functions.log")
|
|
37914
37914
|
local log = ____log.log
|
|
37915
37915
|
local ____stage = require("src.functions.stage")
|
|
@@ -37962,7 +37962,7 @@ function SaveDataManager.prototype.____constructor(self, mod)
|
|
|
37962
37962
|
self.inARun = true
|
|
37963
37963
|
self.restoreGlowingHourGlassDataOnNextRoom = false
|
|
37964
37964
|
loadFromDisk(nil, self.mod, self.saveDataMap, self.classConstructors)
|
|
37965
|
-
local isContinued =
|
|
37965
|
+
local isContinued = isAfterGameFrame(nil, 0)
|
|
37966
37966
|
if not isContinued then
|
|
37967
37967
|
restoreDefaultsForAllFeaturesAndKeys(nil, self.saveDataMap, self.saveDataDefaultsMap)
|
|
37968
37968
|
end
|
|
@@ -42495,9 +42495,9 @@ local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
|
|
|
42495
42495
|
local ____easing = require("src.functions.easing")
|
|
42496
42496
|
local easeOutSine = ____easing.easeOutSine
|
|
42497
42497
|
local ____frames = require("src.functions.frames")
|
|
42498
|
+
local isAfterRoomFrame = ____frames.isAfterRoomFrame
|
|
42498
42499
|
local isBeforeRenderFrame = ____frames.isBeforeRenderFrame
|
|
42499
|
-
local
|
|
42500
|
-
local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
|
|
42500
|
+
local onOrAfterRenderFrame = ____frames.onOrAfterRenderFrame
|
|
42501
42501
|
local ____log = require("src.functions.log")
|
|
42502
42502
|
local log = ____log.log
|
|
42503
42503
|
local ____playerCenter = require("src.functions.playerCenter")
|
|
@@ -42765,7 +42765,7 @@ function CustomTrapdoors.prototype.isPlayerCloseAfterBoss(self, position)
|
|
|
42765
42765
|
local room = game:GetRoom()
|
|
42766
42766
|
local roomType = room:GetType()
|
|
42767
42767
|
local roomClearGameFrame = self.roomClearFrame:getRoomClearGameFrame()
|
|
42768
|
-
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or
|
|
42768
|
+
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrAfterRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
|
|
42769
42769
|
return false
|
|
42770
42770
|
end
|
|
42771
42771
|
return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
|
|
@@ -42876,7 +42876,7 @@ end
|
|
|
42876
42876
|
function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, firstSpawn)
|
|
42877
42877
|
local room = game:GetRoom()
|
|
42878
42878
|
local roomClear = room:IsClear()
|
|
42879
|
-
if
|
|
42879
|
+
if isAfterRoomFrame(nil, 0) then
|
|
42880
42880
|
return false
|
|
42881
42881
|
end
|
|
42882
42882
|
if not roomClear then
|
|
@@ -42919,7 +42919,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
|
|
|
42919
42919
|
anm2Path,
|
|
42920
42920
|
TrapdoorAnimation.OPENED
|
|
42921
42921
|
)
|
|
42922
|
-
local firstSpawn =
|
|
42922
|
+
local firstSpawn = isAfterRoomFrame(nil, 0)
|
|
42923
42923
|
local ____spawnOpen_0 = spawnOpen
|
|
42924
42924
|
if ____spawnOpen_0 == nil then
|
|
42925
42925
|
____spawnOpen_0 = self:shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
|
|
@@ -7,7 +7,7 @@ local ____exports = {}
|
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
8
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
9
9
|
local ____frames = require("src.functions.frames")
|
|
10
|
-
local
|
|
10
|
+
local isAfterRoomFrame = ____frames.isAfterRoomFrame
|
|
11
11
|
local ____roomData = require("src.functions.roomData")
|
|
12
12
|
local getRoomVisitedCount = ____roomData.getRoomVisitedCount
|
|
13
13
|
local ____shouldFire = require("src.shouldFire")
|
|
@@ -24,7 +24,7 @@ function PostPickupInitFirst.prototype.____constructor(self)
|
|
|
24
24
|
self.shouldFire = shouldFirePickup
|
|
25
25
|
self.postPickupInit = function(____, pickup)
|
|
26
26
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
27
|
-
if
|
|
27
|
+
if isAfterRoomFrame(nil, 0) or roomVisitedCount == 0 then
|
|
28
28
|
self:fire(pickup)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
@@ -41,9 +41,9 @@ local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
|
|
|
41
41
|
local ____easing = require("src.functions.easing")
|
|
42
42
|
local easeOutSine = ____easing.easeOutSine
|
|
43
43
|
local ____frames = require("src.functions.frames")
|
|
44
|
+
local isAfterRoomFrame = ____frames.isAfterRoomFrame
|
|
44
45
|
local isBeforeRenderFrame = ____frames.isBeforeRenderFrame
|
|
45
|
-
local
|
|
46
|
-
local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
|
|
46
|
+
local onOrAfterRenderFrame = ____frames.onOrAfterRenderFrame
|
|
47
47
|
local ____log = require("src.functions.log")
|
|
48
48
|
local log = ____log.log
|
|
49
49
|
local ____playerCenter = require("src.functions.playerCenter")
|
|
@@ -312,7 +312,7 @@ function CustomTrapdoors.prototype.isPlayerCloseAfterBoss(self, position)
|
|
|
312
312
|
local room = game:GetRoom()
|
|
313
313
|
local roomType = room:GetType()
|
|
314
314
|
local roomClearGameFrame = self.roomClearFrame:getRoomClearGameFrame()
|
|
315
|
-
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or
|
|
315
|
+
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrAfterRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
|
|
316
316
|
return false
|
|
317
317
|
end
|
|
318
318
|
return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
|
|
@@ -423,7 +423,7 @@ end
|
|
|
423
423
|
function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, firstSpawn)
|
|
424
424
|
local room = game:GetRoom()
|
|
425
425
|
local roomClear = room:IsClear()
|
|
426
|
-
if
|
|
426
|
+
if isAfterRoomFrame(nil, 0) then
|
|
427
427
|
return false
|
|
428
428
|
end
|
|
429
429
|
if not roomClear then
|
|
@@ -466,7 +466,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
|
|
|
466
466
|
anm2Path,
|
|
467
467
|
TrapdoorAnimation.OPENED
|
|
468
468
|
)
|
|
469
|
-
local firstSpawn =
|
|
469
|
+
local firstSpawn = isAfterRoomFrame(nil, 0)
|
|
470
470
|
local ____spawnOpen_0 = spawnOpen
|
|
471
471
|
if ____spawnOpen_0 == nil then
|
|
472
472
|
____spawnOpen_0 = self:shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
|
|
@@ -21,7 +21,7 @@ local SerializationType = ____SerializationType.SerializationType
|
|
|
21
21
|
local ____deepCopy = require("src.functions.deepCopy")
|
|
22
22
|
local deepCopy = ____deepCopy.deepCopy
|
|
23
23
|
local ____frames = require("src.functions.frames")
|
|
24
|
-
local
|
|
24
|
+
local isAfterGameFrame = ____frames.isAfterGameFrame
|
|
25
25
|
local ____log = require("src.functions.log")
|
|
26
26
|
local log = ____log.log
|
|
27
27
|
local ____stage = require("src.functions.stage")
|
|
@@ -74,7 +74,7 @@ function SaveDataManager.prototype.____constructor(self, mod)
|
|
|
74
74
|
self.inARun = true
|
|
75
75
|
self.restoreGlowingHourGlassDataOnNextRoom = false
|
|
76
76
|
loadFromDisk(nil, self.mod, self.saveDataMap, self.classConstructors)
|
|
77
|
-
local isContinued =
|
|
77
|
+
local isContinued = isAfterGameFrame(nil, 0)
|
|
78
78
|
if not isContinued then
|
|
79
79
|
restoreDefaultsForAllFeaturesAndKeys(nil, self.saveDataMap, self.saveDataDefaultsMap)
|
|
80
80
|
end
|
|
@@ -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,kBAAkB,CAChC,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAST;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAST;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAO3E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAST;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAST;AAED;;;;;GAKG;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
|
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
|
|
|
@@ -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,
|
package/src/functions/frames.ts
CHANGED
|
@@ -17,12 +17,12 @@ export function getElapsedRoomFramesSince(roomFrameCount: int): int {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Helper function to check if the current game frame count is
|
|
20
|
+
* Helper function to check if the current game frame count is higher than a specific game frame
|
|
21
21
|
* count.
|
|
22
22
|
*
|
|
23
23
|
* This returns false if the submitted game frame count is null or undefined.
|
|
24
24
|
*/
|
|
25
|
-
export function
|
|
25
|
+
export function isAfterGameFrame(
|
|
26
26
|
gameFrameCount: int | null | undefined,
|
|
27
27
|
): boolean {
|
|
28
28
|
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
@@ -30,16 +30,16 @@ export function isBeforeGameFrame(
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const thisGameFrameCount = game.GetFrameCount();
|
|
33
|
-
return thisGameFrameCount
|
|
33
|
+
return thisGameFrameCount > gameFrameCount;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Helper function to check if the current render frame count is
|
|
37
|
+
* Helper function to check if the current render frame count is higher than a specific render frame
|
|
38
38
|
* count.
|
|
39
39
|
*
|
|
40
40
|
* This returns false if the submitted render frame count is null or undefined.
|
|
41
41
|
*/
|
|
42
|
-
export function
|
|
42
|
+
export function isAfterRenderFrame(
|
|
43
43
|
renderFrameCount: int | null | undefined,
|
|
44
44
|
): boolean {
|
|
45
45
|
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
@@ -47,16 +47,16 @@ export function isBeforeRenderFrame(
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
50
|
-
return thisRenderFrameCount
|
|
50
|
+
return thisRenderFrameCount > renderFrameCount;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Helper function to check if the current room frame count is
|
|
54
|
+
* Helper function to check if the current room frame count is higher than a specific room frame
|
|
55
55
|
* count.
|
|
56
56
|
*
|
|
57
57
|
* This returns false if the submitted room frame count is null or undefined.
|
|
58
58
|
*/
|
|
59
|
-
export function
|
|
59
|
+
export function isAfterRoomFrame(
|
|
60
60
|
roomFrameCount: int | null | undefined,
|
|
61
61
|
): boolean {
|
|
62
62
|
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
@@ -66,16 +66,16 @@ export function isBeforeRoomFrame(
|
|
|
66
66
|
const room = game.GetRoom();
|
|
67
67
|
|
|
68
68
|
const thisGameFrameCount = room.GetFrameCount();
|
|
69
|
-
return thisGameFrameCount
|
|
69
|
+
return thisGameFrameCount > roomFrameCount;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* Helper function to check if the current game frame count is
|
|
73
|
+
* Helper function to check if the current game frame count is lower than a specific game frame
|
|
74
74
|
* count.
|
|
75
75
|
*
|
|
76
76
|
* This returns false if the submitted game frame count is null or undefined.
|
|
77
77
|
*/
|
|
78
|
-
export function
|
|
78
|
+
export function isBeforeGameFrame(
|
|
79
79
|
gameFrameCount: int | null | undefined,
|
|
80
80
|
): boolean {
|
|
81
81
|
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
@@ -83,16 +83,16 @@ export function isPastGameFrame(
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const thisGameFrameCount = game.GetFrameCount();
|
|
86
|
-
return thisGameFrameCount
|
|
86
|
+
return thisGameFrameCount < gameFrameCount;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* Helper function to check if the current render frame count is
|
|
90
|
+
* Helper function to check if the current render frame count is lower than a specific render frame
|
|
91
91
|
* count.
|
|
92
92
|
*
|
|
93
93
|
* This returns false if the submitted render frame count is null or undefined.
|
|
94
94
|
*/
|
|
95
|
-
export function
|
|
95
|
+
export function isBeforeRenderFrame(
|
|
96
96
|
renderFrameCount: int | null | undefined,
|
|
97
97
|
): boolean {
|
|
98
98
|
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
@@ -100,16 +100,16 @@ export function isPastRenderFrame(
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
103
|
-
return thisRenderFrameCount
|
|
103
|
+
return thisRenderFrameCount < renderFrameCount;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
* Helper function to check if the current room frame count is
|
|
107
|
+
* Helper function to check if the current room frame count is lower than a specific room frame
|
|
108
108
|
* count.
|
|
109
109
|
*
|
|
110
110
|
* This returns false if the submitted room frame count is null or undefined.
|
|
111
111
|
*/
|
|
112
|
-
export function
|
|
112
|
+
export function isBeforeRoomFrame(
|
|
113
113
|
roomFrameCount: int | null | undefined,
|
|
114
114
|
): boolean {
|
|
115
115
|
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
@@ -119,7 +119,7 @@ export function isPastRoomFrame(
|
|
|
119
119
|
const room = game.GetRoom();
|
|
120
120
|
|
|
121
121
|
const thisGameFrameCount = room.GetFrameCount();
|
|
122
|
-
return thisGameFrameCount
|
|
122
|
+
return thisGameFrameCount < roomFrameCount;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/**
|
|
@@ -138,12 +138,12 @@ export function onGameFrame(gameFrameCount: int | null | undefined): boolean {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
* Helper function to check if the current game frame count is equal to or
|
|
141
|
+
* Helper function to check if the current game frame count is equal to or higher than a specific
|
|
142
142
|
* game frame count.
|
|
143
143
|
*
|
|
144
144
|
* This returns false if the submitted game frame count is null or undefined.
|
|
145
145
|
*/
|
|
146
|
-
export function
|
|
146
|
+
export function onOrAfterGameFrame(
|
|
147
147
|
gameFrameCount: int | null | undefined,
|
|
148
148
|
): boolean {
|
|
149
149
|
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
@@ -151,16 +151,16 @@ export function onOrBeforeGameFrame(
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
const thisGameFrameCount = game.GetFrameCount();
|
|
154
|
-
return thisGameFrameCount
|
|
154
|
+
return thisGameFrameCount >= gameFrameCount;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
* Helper function to check if the current render frame count is equal to or
|
|
158
|
+
* Helper function to check if the current render frame count is equal to or higher than a specific
|
|
159
159
|
* render frame count.
|
|
160
160
|
*
|
|
161
161
|
* This returns false if the submitted render frame count is null or undefined.
|
|
162
162
|
*/
|
|
163
|
-
export function
|
|
163
|
+
export function onOrAfterRenderFrame(
|
|
164
164
|
renderFrameCount: int | null | undefined,
|
|
165
165
|
): boolean {
|
|
166
166
|
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
@@ -168,16 +168,16 @@ export function onOrBeforeRenderFrame(
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
171
|
-
return thisRenderFrameCount
|
|
171
|
+
return thisRenderFrameCount >= renderFrameCount;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
|
-
* Helper function to check if the current room frame count is equal to or
|
|
175
|
+
* Helper function to check if the current room frame count is equal to or higher than a specific
|
|
176
176
|
* room frame count.
|
|
177
177
|
*
|
|
178
178
|
* This returns false if the submitted room frame count is null or undefined.
|
|
179
179
|
*/
|
|
180
|
-
export function
|
|
180
|
+
export function onOrAfterRoomFrame(
|
|
181
181
|
roomFrameCount: int | null | undefined,
|
|
182
182
|
): boolean {
|
|
183
183
|
if (roomFrameCount === null || roomFrameCount === undefined) {
|
|
@@ -191,12 +191,12 @@ export function onOrBeforeRoomFrame(
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
|
-
* Helper function to check if the current game frame count is equal to or
|
|
194
|
+
* Helper function to check if the current game frame count is equal to or lower than a specific
|
|
195
195
|
* game frame count.
|
|
196
196
|
*
|
|
197
197
|
* This returns false if the submitted game frame count is null or undefined.
|
|
198
198
|
*/
|
|
199
|
-
export function
|
|
199
|
+
export function onOrBeforeGameFrame(
|
|
200
200
|
gameFrameCount: int | null | undefined,
|
|
201
201
|
): boolean {
|
|
202
202
|
if (gameFrameCount === null || gameFrameCount === undefined) {
|
|
@@ -204,16 +204,16 @@ export function onOrPastGameFrame(
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
const thisGameFrameCount = game.GetFrameCount();
|
|
207
|
-
return thisGameFrameCount
|
|
207
|
+
return thisGameFrameCount <= gameFrameCount;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
|
-
* Helper function to check if the current render frame count is equal to or
|
|
211
|
+
* Helper function to check if the current render frame count is equal to or lower than a specific
|
|
212
212
|
* render frame count.
|
|
213
213
|
*
|
|
214
214
|
* This returns false if the submitted render frame count is null or undefined.
|
|
215
215
|
*/
|
|
216
|
-
export function
|
|
216
|
+
export function onOrBeforeRenderFrame(
|
|
217
217
|
renderFrameCount: int | null | undefined,
|
|
218
218
|
): boolean {
|
|
219
219
|
if (renderFrameCount === null || renderFrameCount === undefined) {
|
|
@@ -221,16 +221,16 @@ export function onOrPastRenderFrame(
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
const thisRenderFrameCount = Isaac.GetFrameCount();
|
|
224
|
-
return thisRenderFrameCount
|
|
224
|
+
return thisRenderFrameCount <= renderFrameCount;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
|
-
* Helper function to check if the current room frame count is equal to or
|
|
228
|
+
* Helper function to check if the current room frame count is equal to or lower than a specific
|
|
229
229
|
* room frame count.
|
|
230
230
|
*
|
|
231
231
|
* This returns false if the submitted room frame count is null or undefined.
|
|
232
232
|
*/
|
|
233
|
-
export function
|
|
233
|
+
export function onOrBeforeRoomFrame(
|
|
234
234
|
roomFrameCount: int | null | undefined,
|
|
235
235
|
): boolean {
|
|
236
236
|
if (roomFrameCount === null || roomFrameCount === undefined) {
|