isaacscript-common 59.6.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.
@@ -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).
@@ -8672,6 +8696,30 @@ export declare function isBattery(pickup: EntityPickup): pickup is EntityPickupB
8672
8696
  */
8673
8697
  export declare function isBeastRoom(roomData: RoomConfig): boolean;
8674
8698
 
8699
+ /**
8700
+ * Helper function to check if the current game frame count is lower than a specific game frame
8701
+ * count.
8702
+ *
8703
+ * This returns false if the submitted game frame count is null or undefined.
8704
+ */
8705
+ export declare function isBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
8706
+
8707
+ /**
8708
+ * Helper function to check if the current render frame count is lower than a specific render frame
8709
+ * count.
8710
+ *
8711
+ * This returns false if the submitted render frame count is null or undefined.
8712
+ */
8713
+ export declare function isBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
8714
+
8715
+ /**
8716
+ * Helper function to check if the current room frame count is lower than a specific room frame
8717
+ * count.
8718
+ *
8719
+ * This returns false if the submitted room frame count is null or undefined.
8720
+ */
8721
+ export declare function isBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
8722
+
8675
8723
  /**
8676
8724
  * Helper function for detecting when a player is Bethany or Tainted Bethany. This is useful if you
8677
8725
  * need to adjust UI elements to account for Bethany's soul charges or Tainted Bethany's blood
@@ -9413,30 +9461,6 @@ export declare function isOdd(num: int): boolean;
9413
9461
  */
9414
9462
  export declare function isPassiveOrFamiliarCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean;
9415
9463
 
9416
- /**
9417
- * Helper function to check if the current game frame count is higher than a specific game frame
9418
- * count.
9419
- *
9420
- * This returns false if the submitted game frame count is null or undefined.
9421
- */
9422
- export declare function isPastGameFrame(gameFrameCount: int | null | undefined): boolean;
9423
-
9424
- /**
9425
- * Helper function to check if the current render frame count is higher than a specific render frame
9426
- * count.
9427
- *
9428
- * This returns false if the submitted render frame count is null or undefined.
9429
- */
9430
- export declare function isPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
9431
-
9432
- /**
9433
- * Helper function to check if the current room frame count is higher than a specific room frame
9434
- * count.
9435
- *
9436
- * This returns false if the submitted room frame count is null or undefined.
9437
- */
9438
- export declare function isPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
9439
-
9440
9464
  /** Helper function to narrow the type of `PickingUpItem`. */
9441
9465
  export declare function isPickingUpItemCollectible(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemCollectible;
9442
9466
 
@@ -14462,7 +14486,7 @@ export declare function onGameFrame(gameFrameCount: int | null | undefined): boo
14462
14486
  *
14463
14487
  * This returns false if the submitted game frame count is null or undefined.
14464
14488
  */
14465
- export declare function onOrPastGameFrame(gameFrameCount: int | null | undefined): boolean;
14489
+ export declare function onOrAfterGameFrame(gameFrameCount: int | null | undefined): boolean;
14466
14490
 
14467
14491
  /**
14468
14492
  * Helper function to check if the current render frame count is equal to or higher than a specific
@@ -14470,7 +14494,7 @@ export declare function onOrPastGameFrame(gameFrameCount: int | null | undefined
14470
14494
  *
14471
14495
  * This returns false if the submitted render frame count is null or undefined.
14472
14496
  */
14473
- export declare function onOrPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
14497
+ export declare function onOrAfterRenderFrame(renderFrameCount: int | null | undefined): boolean;
14474
14498
 
14475
14499
  /**
14476
14500
  * Helper function to check if the current room frame count is equal to or higher than a specific
@@ -14478,7 +14502,31 @@ export declare function onOrPastRenderFrame(renderFrameCount: int | null | undef
14478
14502
  *
14479
14503
  * This returns false if the submitted room frame count is null or undefined.
14480
14504
  */
14481
- export declare function onOrPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
14505
+ export declare function onOrAfterRoomFrame(roomFrameCount: int | null | undefined): boolean;
14506
+
14507
+ /**
14508
+ * Helper function to check if the current game frame count is equal to or lower than a specific
14509
+ * game frame count.
14510
+ *
14511
+ * This returns false if the submitted game frame count is null or undefined.
14512
+ */
14513
+ export declare function onOrBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
14514
+
14515
+ /**
14516
+ * Helper function to check if the current render frame count is equal to or lower than a specific
14517
+ * render frame count.
14518
+ *
14519
+ * This returns false if the submitted render frame count is null or undefined.
14520
+ */
14521
+ export declare function onOrBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
14522
+
14523
+ /**
14524
+ * Helper function to check if the current room frame count is equal to or lower than a specific
14525
+ * room frame count.
14526
+ *
14527
+ * This returns false if the submitted room frame count is null or undefined.
14528
+ */
14529
+ export declare function onOrBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
14482
14530
 
14483
14531
  /**
14484
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 59.6.0
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,21 +19091,21 @@ function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
19091
19091
  local thisRoomFrameCount = room:GetFrameCount()
19092
19092
  return thisRoomFrameCount - roomFrameCount
19093
19093
  end
19094
- function ____exports.isPastGameFrame(self, gameFrameCount)
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
19099
  return thisGameFrameCount > gameFrameCount
19100
19100
  end
19101
- function ____exports.isPastRenderFrame(self, renderFrameCount)
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 >= renderFrameCount
19106
+ return thisRenderFrameCount > renderFrameCount
19107
19107
  end
19108
- function ____exports.isPastRoomFrame(self, roomFrameCount)
19108
+ function ____exports.isAfterRoomFrame(self, roomFrameCount)
19109
19109
  if roomFrameCount == nil or roomFrameCount == nil then
19110
19110
  return false
19111
19111
  end
@@ -19113,6 +19113,28 @@ function ____exports.isPastRoomFrame(self, roomFrameCount)
19113
19113
  local thisGameFrameCount = room:GetFrameCount()
19114
19114
  return thisGameFrameCount > roomFrameCount
19115
19115
  end
19116
+ function ____exports.isBeforeGameFrame(self, gameFrameCount)
19117
+ if gameFrameCount == nil or gameFrameCount == nil then
19118
+ return false
19119
+ end
19120
+ local thisGameFrameCount = game:GetFrameCount()
19121
+ return thisGameFrameCount < gameFrameCount
19122
+ end
19123
+ function ____exports.isBeforeRenderFrame(self, renderFrameCount)
19124
+ if renderFrameCount == nil or renderFrameCount == nil then
19125
+ return false
19126
+ end
19127
+ local thisRenderFrameCount = Isaac.GetFrameCount()
19128
+ return thisRenderFrameCount < renderFrameCount
19129
+ end
19130
+ function ____exports.isBeforeRoomFrame(self, roomFrameCount)
19131
+ if roomFrameCount == nil or roomFrameCount == nil then
19132
+ return false
19133
+ end
19134
+ local room = game:GetRoom()
19135
+ local thisGameFrameCount = room:GetFrameCount()
19136
+ return thisGameFrameCount < roomFrameCount
19137
+ end
19116
19138
  function ____exports.onGameFrame(self, gameFrameCount)
19117
19139
  if gameFrameCount == nil or gameFrameCount == nil then
19118
19140
  return false
@@ -19120,21 +19142,43 @@ function ____exports.onGameFrame(self, gameFrameCount)
19120
19142
  local thisGameFrameCount = game:GetFrameCount()
19121
19143
  return thisGameFrameCount == gameFrameCount
19122
19144
  end
19123
- function ____exports.onOrPastGameFrame(self, gameFrameCount)
19145
+ function ____exports.onOrAfterGameFrame(self, gameFrameCount)
19124
19146
  if gameFrameCount == nil or gameFrameCount == nil then
19125
19147
  return false
19126
19148
  end
19127
19149
  local thisGameFrameCount = game:GetFrameCount()
19128
19150
  return thisGameFrameCount >= gameFrameCount
19129
19151
  end
19130
- function ____exports.onOrPastRenderFrame(self, renderFrameCount)
19152
+ function ____exports.onOrAfterRenderFrame(self, renderFrameCount)
19131
19153
  if renderFrameCount == nil or renderFrameCount == nil then
19132
19154
  return false
19133
19155
  end
19134
19156
  local thisRenderFrameCount = Isaac.GetFrameCount()
19135
19157
  return thisRenderFrameCount >= renderFrameCount
19136
19158
  end
19137
- function ____exports.onOrPastRoomFrame(self, roomFrameCount)
19159
+ function ____exports.onOrAfterRoomFrame(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
19167
+ function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
19168
+ if gameFrameCount == nil or gameFrameCount == nil then
19169
+ return false
19170
+ end
19171
+ local thisGameFrameCount = game:GetFrameCount()
19172
+ return thisGameFrameCount <= gameFrameCount
19173
+ end
19174
+ function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
19175
+ if renderFrameCount == nil or renderFrameCount == nil then
19176
+ return false
19177
+ end
19178
+ local thisRenderFrameCount = Isaac.GetFrameCount()
19179
+ return thisRenderFrameCount <= renderFrameCount
19180
+ end
19181
+ function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
19138
19182
  if roomFrameCount == nil or roomFrameCount == nil then
19139
19183
  return false
19140
19184
  end
@@ -29561,7 +29605,7 @@ local ____exports = {}
29561
29605
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
29562
29606
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
29563
29607
  local ____frames = require("src.functions.frames")
29564
- local isPastRoomFrame = ____frames.isPastRoomFrame
29608
+ local isAfterRoomFrame = ____frames.isAfterRoomFrame
29565
29609
  local ____roomData = require("src.functions.roomData")
29566
29610
  local getRoomVisitedCount = ____roomData.getRoomVisitedCount
29567
29611
  local ____shouldFire = require("src.shouldFire")
@@ -29578,7 +29622,7 @@ function PostPickupInitFirst.prototype.____constructor(self)
29578
29622
  self.shouldFire = shouldFirePickup
29579
29623
  self.postPickupInit = function(____, pickup)
29580
29624
  local roomVisitedCount = getRoomVisitedCount(nil)
29581
- if isPastRoomFrame(nil, 0) or roomVisitedCount == 0 then
29625
+ if isAfterRoomFrame(nil, 0) or roomVisitedCount == 0 then
29582
29626
  self:fire(pickup)
29583
29627
  end
29584
29628
  end
@@ -37865,7 +37909,7 @@ local SerializationType = ____SerializationType.SerializationType
37865
37909
  local ____deepCopy = require("src.functions.deepCopy")
37866
37910
  local deepCopy = ____deepCopy.deepCopy
37867
37911
  local ____frames = require("src.functions.frames")
37868
- local isPastGameFrame = ____frames.isPastGameFrame
37912
+ local isAfterGameFrame = ____frames.isAfterGameFrame
37869
37913
  local ____log = require("src.functions.log")
37870
37914
  local log = ____log.log
37871
37915
  local ____stage = require("src.functions.stage")
@@ -37918,7 +37962,7 @@ function SaveDataManager.prototype.____constructor(self, mod)
37918
37962
  self.inARun = true
37919
37963
  self.restoreGlowingHourGlassDataOnNextRoom = false
37920
37964
  loadFromDisk(nil, self.mod, self.saveDataMap, self.classConstructors)
37921
- local isContinued = isPastGameFrame(nil, 0)
37965
+ local isContinued = isAfterGameFrame(nil, 0)
37922
37966
  if not isContinued then
37923
37967
  restoreDefaultsForAllFeaturesAndKeys(nil, self.saveDataMap, self.saveDataDefaultsMap)
37924
37968
  end
@@ -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 isPastRoomFrame = ____frames.isPastRoomFrame
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 not isPastRoomFrame(nil, 0) then
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,8 +42495,9 @@ 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")
42454
- local isPastRoomFrame = ____frames.isPastRoomFrame
42455
- local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
42498
+ local isAfterRoomFrame = ____frames.isAfterRoomFrame
42499
+ local isBeforeRenderFrame = ____frames.isBeforeRenderFrame
42500
+ local onOrAfterRenderFrame = ____frames.onOrAfterRenderFrame
42456
42501
  local ____log = require("src.functions.log")
42457
42502
  local log = ____log.log
42458
42503
  local ____playerCenter = require("src.functions.playerCenter")
@@ -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 not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
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 not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
42704
+ if isBeforeRenderFrame(nil, renderFrameScreenBlack) then
42660
42705
  return
42661
42706
  end
42662
42707
  v.run.state = StageTravelState.PIXELATION_TO_ROOM
@@ -42720,7 +42765,7 @@ function CustomTrapdoors.prototype.isPlayerCloseAfterBoss(self, position)
42720
42765
  local room = game:GetRoom()
42721
42766
  local roomType = room:GetType()
42722
42767
  local roomClearGameFrame = self.roomClearFrame:getRoomClearGameFrame()
42723
- if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrPastRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
42768
+ if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrAfterRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
42724
42769
  return false
42725
42770
  end
42726
42771
  return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
@@ -42831,7 +42876,7 @@ end
42831
42876
  function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, firstSpawn)
42832
42877
  local room = game:GetRoom()
42833
42878
  local roomClear = room:IsClear()
42834
- if isPastRoomFrame(nil, 0) then
42879
+ if isAfterRoomFrame(nil, 0) then
42835
42880
  return false
42836
42881
  end
42837
42882
  if not roomClear then
@@ -42874,7 +42919,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
42874
42919
  anm2Path,
42875
42920
  TrapdoorAnimation.OPENED
42876
42921
  )
42877
- local firstSpawn = isPastRoomFrame(nil, 0)
42922
+ local firstSpawn = isAfterRoomFrame(nil, 0)
42878
42923
  local ____spawnOpen_0 = spawnOpen
42879
42924
  if ____spawnOpen_0 == nil then
42880
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 isPastRoomFrame = ____frames.isPastRoomFrame
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 isPastRoomFrame(nil, 0) or roomVisitedCount == 0 then
27
+ if isAfterRoomFrame(nil, 0) or roomVisitedCount == 0 then
28
28
  self:fire(pickup)
29
29
  end
30
30
  end
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTrapdoors.d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,QAAQ,CAAC,UAAU,CAMzB;IAEF,OAAO,CAAC,2BAA2B;IA+BnC,OAAO,CAAC,8BAA8B;IAiDtC,OAAO,CAAC,6BAA6B;IAsBrC,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,4BAA4B;IA+CpC,OAAO,CAAC,iCAAiC;IAqBzC,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAcjD;IAEF,OAAO,CAAC,4BAA4B;IAcpC,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,gCAAgC;IAuCxC,OAAO,CAAC,2BAA2B;IAoCnC,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,8BAA8B;IAmDtC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAEzC;IAEF,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,uBAAuB;IA2B/B,OAAO,CAAC,eAAe;IAUvB;;;;;;;;;;;;;;;;;;OAkBG;IAEI,iCAAiC,CACtC,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,CACf,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,gBAAgB,EAAE,UAAU,EAC5B,oBAAoB,EAAE,SAAS,KAC5B,IAAI,GACR,IAAI;IAUP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IAEI,mBAAmB,CACxB,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,eAAe,CAAC,EAAE,MAAM,EACxB,gBAAgB,CAAC,EAAE,UAAU,EAC7B,oBAAoB,CAAC,EAAE,SAAS,EAChC,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU;CAsDd"}
@@ -41,8 +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 isPastRoomFrame = ____frames.isPastRoomFrame
45
- local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
44
+ local isAfterRoomFrame = ____frames.isAfterRoomFrame
45
+ local isBeforeRenderFrame = ____frames.isBeforeRenderFrame
46
+ local onOrAfterRenderFrame = ____frames.onOrAfterRenderFrame
46
47
  local ____log = require("src.functions.log")
47
48
  local log = ____log.log
48
49
  local ____playerCenter = require("src.functions.playerCenter")
@@ -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 not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
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 not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
251
+ if isBeforeRenderFrame(nil, renderFrameScreenBlack) then
251
252
  return
252
253
  end
253
254
  v.run.state = StageTravelState.PIXELATION_TO_ROOM
@@ -311,7 +312,7 @@ function CustomTrapdoors.prototype.isPlayerCloseAfterBoss(self, position)
311
312
  local room = game:GetRoom()
312
313
  local roomType = room:GetType()
313
314
  local roomClearGameFrame = self.roomClearFrame:getRoomClearGameFrame()
314
- if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrPastRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
315
+ if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrAfterRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
315
316
  return false
316
317
  end
317
318
  return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
@@ -422,7 +423,7 @@ end
422
423
  function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, firstSpawn)
423
424
  local room = game:GetRoom()
424
425
  local roomClear = room:IsClear()
425
- if isPastRoomFrame(nil, 0) then
426
+ if isAfterRoomFrame(nil, 0) then
426
427
  return false
427
428
  end
428
429
  if not roomClear then
@@ -465,7 +466,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
465
466
  anm2Path,
466
467
  TrapdoorAnimation.OPENED
467
468
  )
468
- local firstSpawn = isPastRoomFrame(nil, 0)
469
+ local firstSpawn = isAfterRoomFrame(nil, 0)
469
470
  local ____spawnOpen_0 = spawnOpen
470
471
  if ____spawnOpen_0 == nil then
471
472
  ____spawnOpen_0 = self:shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
@@ -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 isPastRoomFrame = ____frames.isPastRoomFrame
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 not isPastRoomFrame(nil, 0) then
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
@@ -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 isPastGameFrame = ____frames.isPastGameFrame
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 = isPastGameFrame(nil, 0)
77
+ local isContinued = isAfterGameFrame(nil, 0)
78
78
  if not isContinued then
79
79
  restoreDefaultsForAllFeaturesAndKeys(nil, self.saveDataMap, self.saveDataDefaultsMap)
80
80
  end
@@ -8,21 +8,42 @@ export declare function getElapsedRoomFramesSince(roomFrameCount: int): int;
8
8
  *
9
9
  * This returns false if the submitted game frame count is null or undefined.
10
10
  */
11
- export declare function isPastGameFrame(gameFrameCount: int | null | undefined): boolean;
11
+ export declare function isAfterGameFrame(gameFrameCount: int | null | undefined): boolean;
12
12
  /**
13
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 isPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
18
+ export declare function isAfterRenderFrame(renderFrameCount: int | null | undefined): boolean;
19
19
  /**
20
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 isPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
25
+ export declare function isAfterRoomFrame(roomFrameCount: int | null | undefined): boolean;
26
+ /**
27
+ * Helper function to check if the current game frame count is lower than a specific game frame
28
+ * count.
29
+ *
30
+ * This returns false if the submitted game frame count is null or undefined.
31
+ */
32
+ export declare function isBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
33
+ /**
34
+ * Helper function to check if the current render frame count is lower than a specific render frame
35
+ * count.
36
+ *
37
+ * This returns false if the submitted render frame count is null or undefined.
38
+ */
39
+ export declare function isBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
40
+ /**
41
+ * Helper function to check if the current room frame count is lower than a specific room frame
42
+ * count.
43
+ *
44
+ * This returns false if the submitted room frame count is null or undefined.
45
+ */
46
+ export declare function isBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
26
47
  /**
27
48
  * Helper function to check if the current game frame count is exactly equal to a specific game
28
49
  * frame count.
@@ -36,21 +57,42 @@ export declare function onGameFrame(gameFrameCount: int | null | undefined): boo
36
57
  *
37
58
  * This returns false if the submitted game frame count is null or undefined.
38
59
  */
39
- export declare function onOrPastGameFrame(gameFrameCount: int | null | undefined): boolean;
60
+ export declare function onOrAfterGameFrame(gameFrameCount: int | null | undefined): boolean;
40
61
  /**
41
62
  * Helper function to check if the current render frame count is equal to or higher than a specific
42
63
  * render frame count.
43
64
  *
44
65
  * This returns false if the submitted render frame count is null or undefined.
45
66
  */
46
- export declare function onOrPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
67
+ export declare function onOrAfterRenderFrame(renderFrameCount: int | null | undefined): boolean;
47
68
  /**
48
69
  * Helper function to check if the current room frame count is equal to or higher than a specific
49
70
  * room frame count.
50
71
  *
51
72
  * This returns false if the submitted room frame count is null or undefined.
52
73
  */
53
- export declare function onOrPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
74
+ export declare function onOrAfterRoomFrame(roomFrameCount: int | null | undefined): boolean;
75
+ /**
76
+ * Helper function to check if the current game frame count is equal to or lower than a specific
77
+ * game frame count.
78
+ *
79
+ * This returns false if the submitted game frame count is null or undefined.
80
+ */
81
+ export declare function onOrBeforeGameFrame(gameFrameCount: int | null | undefined): boolean;
82
+ /**
83
+ * Helper function to check if the current render frame count is equal to or lower than a specific
84
+ * render frame count.
85
+ *
86
+ * This returns false if the submitted render frame count is null or undefined.
87
+ */
88
+ export declare function onOrBeforeRenderFrame(renderFrameCount: int | null | undefined): boolean;
89
+ /**
90
+ * Helper function to check if the current room frame count is equal to or lower than a specific
91
+ * room frame count.
92
+ *
93
+ * This returns false if the submitted room frame count is null or undefined.
94
+ */
95
+ export declare function onOrBeforeRoomFrame(roomFrameCount: int | null | undefined): boolean;
54
96
  /**
55
97
  * Helper function to check if the current render frame count is exactly equal to a specific render
56
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,eAAe,CAC7B,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GACvC,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,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,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,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G;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"}
@@ -18,7 +18,7 @@ end
18
18
  -- count.
19
19
  --
20
20
  -- This returns false if the submitted game frame count is null or undefined.
21
- function ____exports.isPastGameFrame(self, gameFrameCount)
21
+ function ____exports.isAfterGameFrame(self, gameFrameCount)
22
22
  if gameFrameCount == nil or gameFrameCount == nil then
23
23
  return false
24
24
  end
@@ -29,18 +29,18 @@ end
29
29
  -- count.
30
30
  --
31
31
  -- This returns false if the submitted render frame count is null or undefined.
32
- function ____exports.isPastRenderFrame(self, renderFrameCount)
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 >= renderFrameCount
37
+ return thisRenderFrameCount > renderFrameCount
38
38
  end
39
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.isPastRoomFrame(self, roomFrameCount)
43
+ function ____exports.isAfterRoomFrame(self, roomFrameCount)
44
44
  if roomFrameCount == nil or roomFrameCount == nil then
45
45
  return false
46
46
  end
@@ -48,6 +48,40 @@ function ____exports.isPastRoomFrame(self, roomFrameCount)
48
48
  local thisGameFrameCount = room:GetFrameCount()
49
49
  return thisGameFrameCount > roomFrameCount
50
50
  end
51
+ --- Helper function to check if the current game frame count is lower than a specific game frame
52
+ -- count.
53
+ --
54
+ -- This returns false if the submitted game frame count is null or undefined.
55
+ function ____exports.isBeforeGameFrame(self, gameFrameCount)
56
+ if gameFrameCount == nil or gameFrameCount == nil then
57
+ return false
58
+ end
59
+ local thisGameFrameCount = game:GetFrameCount()
60
+ return thisGameFrameCount < gameFrameCount
61
+ end
62
+ --- Helper function to check if the current render frame count is lower than a specific render frame
63
+ -- count.
64
+ --
65
+ -- This returns false if the submitted render frame count is null or undefined.
66
+ function ____exports.isBeforeRenderFrame(self, renderFrameCount)
67
+ if renderFrameCount == nil or renderFrameCount == nil then
68
+ return false
69
+ end
70
+ local thisRenderFrameCount = Isaac.GetFrameCount()
71
+ return thisRenderFrameCount < renderFrameCount
72
+ end
73
+ --- Helper function to check if the current room frame count is lower than a specific room frame
74
+ -- count.
75
+ --
76
+ -- This returns false if the submitted room frame count is null or undefined.
77
+ function ____exports.isBeforeRoomFrame(self, roomFrameCount)
78
+ if roomFrameCount == nil or roomFrameCount == nil then
79
+ return false
80
+ end
81
+ local room = game:GetRoom()
82
+ local thisGameFrameCount = room:GetFrameCount()
83
+ return thisGameFrameCount < roomFrameCount
84
+ end
51
85
  --- Helper function to check if the current game frame count is exactly equal to a specific game
52
86
  -- frame count.
53
87
  --
@@ -63,7 +97,7 @@ end
63
97
  -- game frame count.
64
98
  --
65
99
  -- This returns false if the submitted game frame count is null or undefined.
66
- function ____exports.onOrPastGameFrame(self, gameFrameCount)
100
+ function ____exports.onOrAfterGameFrame(self, gameFrameCount)
67
101
  if gameFrameCount == nil or gameFrameCount == nil then
68
102
  return false
69
103
  end
@@ -74,7 +108,7 @@ end
74
108
  -- render frame count.
75
109
  --
76
110
  -- This returns false if the submitted render frame count is null or undefined.
77
- function ____exports.onOrPastRenderFrame(self, renderFrameCount)
111
+ function ____exports.onOrAfterRenderFrame(self, renderFrameCount)
78
112
  if renderFrameCount == nil or renderFrameCount == nil then
79
113
  return false
80
114
  end
@@ -85,7 +119,41 @@ end
85
119
  -- room frame count.
86
120
  --
87
121
  -- This returns false if the submitted room frame count is null or undefined.
88
- function ____exports.onOrPastRoomFrame(self, roomFrameCount)
122
+ function ____exports.onOrAfterRoomFrame(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
130
+ --- Helper function to check if the current game frame count is equal to or lower than a specific
131
+ -- game frame count.
132
+ --
133
+ -- This returns false if the submitted game frame count is null or undefined.
134
+ function ____exports.onOrBeforeGameFrame(self, gameFrameCount)
135
+ if gameFrameCount == nil or gameFrameCount == nil then
136
+ return false
137
+ end
138
+ local thisGameFrameCount = game:GetFrameCount()
139
+ return thisGameFrameCount <= gameFrameCount
140
+ end
141
+ --- Helper function to check if the current render frame count is equal to or lower than a specific
142
+ -- render frame count.
143
+ --
144
+ -- This returns false if the submitted render frame count is null or undefined.
145
+ function ____exports.onOrBeforeRenderFrame(self, renderFrameCount)
146
+ if renderFrameCount == nil or renderFrameCount == nil then
147
+ return false
148
+ end
149
+ local thisRenderFrameCount = Isaac.GetFrameCount()
150
+ return thisRenderFrameCount <= renderFrameCount
151
+ end
152
+ --- Helper function to check if the current room frame count is equal to or lower than a specific
153
+ -- room frame count.
154
+ --
155
+ -- This returns false if the submitted room frame count is null or undefined.
156
+ function ____exports.onOrBeforeRoomFrame(self, roomFrameCount)
89
157
  if roomFrameCount == nil or roomFrameCount == nil then
90
158
  return false
91
159
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "59.6.0",
3
+ "version": "60.0.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,6 +1,6 @@
1
1
  import { ModCallback } from "isaac-typescript-definitions";
2
2
  import type { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
- import { isPastRoomFrame } from "../../functions/frames";
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 (isPastRoomFrame(0) || roomVisitedCount === 0) {
32
+ if (isAfterRoomFrame(0) || roomVisitedCount === 0) {
33
33
  this.fire(pickup);
34
34
  }
35
35
  };
@@ -22,8 +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
- isPastRoomFrame,
26
- onOrPastRenderFrame,
25
+ isAfterRoomFrame,
26
+ isBeforeRenderFrame,
27
+ onOrAfterRenderFrame,
27
28
  } from "../../../functions/frames";
28
29
  import { log } from "../../../functions/log";
29
30
  import { movePlayersToCenter } from "../../../functions/playerCenter";
@@ -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 (!onOrPastRenderFrame(renderFrameScreenBlack)) {
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 (!onOrPastRenderFrame(renderFrameScreenBlack)) {
321
+ if (isBeforeRenderFrame(renderFrameScreenBlack)) {
321
322
  return;
322
323
  }
323
324
 
@@ -448,7 +449,7 @@ export class CustomTrapdoors extends Feature {
448
449
  if (
449
450
  roomType !== RoomType.BOSS ||
450
451
  roomClearGameFrame === undefined ||
451
- onOrPastRenderFrame(roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES)
452
+ onOrAfterRenderFrame(roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES)
452
453
  ) {
453
454
  return false;
454
455
  }
@@ -633,7 +634,7 @@ export class CustomTrapdoors extends Feature {
633
634
  // into them.
634
635
  // - Trapdoors created by We Need to Go Deeper should spawn closed because the player will be
635
636
  // standing on top of them.
636
- if (isPastRoomFrame(0)) {
637
+ if (isAfterRoomFrame(0)) {
637
638
  return false;
638
639
  }
639
640
 
@@ -773,7 +774,7 @@ export class CustomTrapdoors extends Feature {
773
774
  TrapdoorAnimation.OPENED,
774
775
  );
775
776
 
776
- const firstSpawn = isPastRoomFrame(0);
777
+ const firstSpawn = isAfterRoomFrame(0);
777
778
  const open =
778
779
  spawnOpen ?? this.shouldTrapdoorSpawnOpen(gridEntity, firstSpawn);
779
780
 
@@ -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 { isPastRoomFrame } from "../../../functions/frames";
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
- !isPastRoomFrame(0)
100
+ onOrBeforeRoomFrame(0)
101
101
  ) {
102
102
  v.room.pickupIndexes.set(ptrHash, pickupIndexFromLevelData);
103
103
  return;
@@ -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 { isPastGameFrame } from "../../../functions/frames";
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 = isPastGameFrame(0);
148
+ const isContinued = isAfterGameFrame(0);
149
149
  if (!isContinued) {
150
150
  restoreDefaultsForAllFeaturesAndKeys(
151
151
  this.saveDataMap,
@@ -22,7 +22,7 @@ export function getElapsedRoomFramesSince(roomFrameCount: int): int {
22
22
  *
23
23
  * This returns false if the submitted game frame count is null or undefined.
24
24
  */
25
- export function isPastGameFrame(
25
+ export function isAfterGameFrame(
26
26
  gameFrameCount: int | null | undefined,
27
27
  ): boolean {
28
28
  if (gameFrameCount === null || gameFrameCount === undefined) {
@@ -39,7 +39,7 @@ export function isPastGameFrame(
39
39
  *
40
40
  * This returns false if the submitted render frame count is null or undefined.
41
41
  */
42
- export function isPastRenderFrame(
42
+ export function isAfterRenderFrame(
43
43
  renderFrameCount: int | null | undefined,
44
44
  ): boolean {
45
45
  if (renderFrameCount === null || renderFrameCount === undefined) {
@@ -47,7 +47,7 @@ export function isPastRenderFrame(
47
47
  }
48
48
 
49
49
  const thisRenderFrameCount = Isaac.GetFrameCount();
50
- return thisRenderFrameCount >= renderFrameCount;
50
+ return thisRenderFrameCount > renderFrameCount;
51
51
  }
52
52
 
53
53
  /**
@@ -56,7 +56,7 @@ export function isPastRenderFrame(
56
56
  *
57
57
  * This returns false if the submitted room frame count is null or undefined.
58
58
  */
59
- export function isPastRoomFrame(
59
+ export function isAfterRoomFrame(
60
60
  roomFrameCount: int | null | undefined,
61
61
  ): boolean {
62
62
  if (roomFrameCount === null || roomFrameCount === undefined) {
@@ -69,6 +69,59 @@ export function isPastRoomFrame(
69
69
  return thisGameFrameCount > roomFrameCount;
70
70
  }
71
71
 
72
+ /**
73
+ * Helper function to check if the current game frame count is lower than a specific game frame
74
+ * count.
75
+ *
76
+ * This returns false if the submitted game frame count is null or undefined.
77
+ */
78
+ export function isBeforeGameFrame(
79
+ gameFrameCount: int | null | undefined,
80
+ ): boolean {
81
+ if (gameFrameCount === null || gameFrameCount === undefined) {
82
+ return false;
83
+ }
84
+
85
+ const thisGameFrameCount = game.GetFrameCount();
86
+ return thisGameFrameCount < gameFrameCount;
87
+ }
88
+
89
+ /**
90
+ * Helper function to check if the current render frame count is lower than a specific render frame
91
+ * count.
92
+ *
93
+ * This returns false if the submitted render frame count is null or undefined.
94
+ */
95
+ export function isBeforeRenderFrame(
96
+ renderFrameCount: int | null | undefined,
97
+ ): boolean {
98
+ if (renderFrameCount === null || renderFrameCount === undefined) {
99
+ return false;
100
+ }
101
+
102
+ const thisRenderFrameCount = Isaac.GetFrameCount();
103
+ return thisRenderFrameCount < renderFrameCount;
104
+ }
105
+
106
+ /**
107
+ * Helper function to check if the current room frame count is lower than a specific room frame
108
+ * count.
109
+ *
110
+ * This returns false if the submitted room frame count is null or undefined.
111
+ */
112
+ export function isBeforeRoomFrame(
113
+ roomFrameCount: int | null | undefined,
114
+ ): boolean {
115
+ if (roomFrameCount === null || roomFrameCount === undefined) {
116
+ return false;
117
+ }
118
+
119
+ const room = game.GetRoom();
120
+
121
+ const thisGameFrameCount = room.GetFrameCount();
122
+ return thisGameFrameCount < roomFrameCount;
123
+ }
124
+
72
125
  /**
73
126
  * Helper function to check if the current game frame count is exactly equal to a specific game
74
127
  * frame count.
@@ -90,7 +143,7 @@ export function onGameFrame(gameFrameCount: int | null | undefined): boolean {
90
143
  *
91
144
  * This returns false if the submitted game frame count is null or undefined.
92
145
  */
93
- export function onOrPastGameFrame(
146
+ export function onOrAfterGameFrame(
94
147
  gameFrameCount: int | null | undefined,
95
148
  ): boolean {
96
149
  if (gameFrameCount === null || gameFrameCount === undefined) {
@@ -107,7 +160,7 @@ export function onOrPastGameFrame(
107
160
  *
108
161
  * This returns false if the submitted render frame count is null or undefined.
109
162
  */
110
- export function onOrPastRenderFrame(
163
+ export function onOrAfterRenderFrame(
111
164
  renderFrameCount: int | null | undefined,
112
165
  ): boolean {
113
166
  if (renderFrameCount === null || renderFrameCount === undefined) {
@@ -124,7 +177,60 @@ export function onOrPastRenderFrame(
124
177
  *
125
178
  * This returns false if the submitted room frame count is null or undefined.
126
179
  */
127
- export function onOrPastRoomFrame(
180
+ export function onOrAfterRoomFrame(
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
+
193
+ /**
194
+ * Helper function to check if the current game frame count is equal to or lower than a specific
195
+ * game frame count.
196
+ *
197
+ * This returns false if the submitted game frame count is null or undefined.
198
+ */
199
+ export function onOrBeforeGameFrame(
200
+ gameFrameCount: int | null | undefined,
201
+ ): boolean {
202
+ if (gameFrameCount === null || gameFrameCount === undefined) {
203
+ return false;
204
+ }
205
+
206
+ const thisGameFrameCount = game.GetFrameCount();
207
+ return thisGameFrameCount <= gameFrameCount;
208
+ }
209
+
210
+ /**
211
+ * Helper function to check if the current render frame count is equal to or lower than a specific
212
+ * render frame count.
213
+ *
214
+ * This returns false if the submitted render frame count is null or undefined.
215
+ */
216
+ export function onOrBeforeRenderFrame(
217
+ renderFrameCount: int | null | undefined,
218
+ ): boolean {
219
+ if (renderFrameCount === null || renderFrameCount === undefined) {
220
+ return false;
221
+ }
222
+
223
+ const thisRenderFrameCount = Isaac.GetFrameCount();
224
+ return thisRenderFrameCount <= renderFrameCount;
225
+ }
226
+
227
+ /**
228
+ * Helper function to check if the current room frame count is equal to or lower than a specific
229
+ * room frame count.
230
+ *
231
+ * This returns false if the submitted room frame count is null or undefined.
232
+ */
233
+ export function onOrBeforeRoomFrame(
128
234
  roomFrameCount: int | null | undefined,
129
235
  ): boolean {
130
236
  if (roomFrameCount === null || roomFrameCount === undefined) {