isaacscript-common 59.4.1 → 59.5.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.
Files changed (47) hide show
  1. package/dist/index.rollup.d.ts +86 -1
  2. package/dist/isaacscript-common.lua +149 -47
  3. package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
  4. package/dist/src/classes/ModUpgraded.lua +2 -2
  5. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -1
  6. package/dist/src/classes/callbacks/PostCursedTeleport.lua +3 -2
  7. package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
  8. package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts.map +1 -1
  9. package/dist/src/classes/callbacks/PostPickupInitFirst.lua +3 -5
  10. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  11. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +5 -5
  12. package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
  13. package/dist/src/classes/features/other/CustomTrapdoors.lua +10 -12
  14. package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
  15. package/dist/src/classes/features/other/PickupIndexCreation.lua +3 -2
  16. package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
  17. package/dist/src/classes/features/other/PreventCollectibleRotation.lua +3 -2
  18. package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
  19. package/dist/src/classes/features/other/SaveDataManager.lua +3 -4
  20. package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
  21. package/dist/src/classes/features/other/customStages/streakText.lua +6 -5
  22. package/dist/src/functions/debugFunctions.d.ts +7 -1
  23. package/dist/src/functions/debugFunctions.d.ts.map +1 -1
  24. package/dist/src/functions/debugFunctions.lua +22 -16
  25. package/dist/src/functions/frames.d.ts +68 -0
  26. package/dist/src/functions/frames.d.ts.map +1 -0
  27. package/dist/src/functions/frames.lua +119 -0
  28. package/dist/src/functions/revive.d.ts.map +1 -1
  29. package/dist/src/functions/revive.lua +3 -4
  30. package/dist/src/index.d.ts +1 -0
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/index.lua +8 -0
  33. package/package.json +1 -1
  34. package/src/classes/ModUpgraded.ts +2 -3
  35. package/src/classes/callbacks/PostCursedTeleport.ts +2 -2
  36. package/src/classes/callbacks/PostItemDischarge.ts +2 -0
  37. package/src/classes/callbacks/PostPickupInitFirst.ts +2 -4
  38. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +4 -6
  39. package/src/classes/features/other/CustomTrapdoors.ts +11 -14
  40. package/src/classes/features/other/PickupIndexCreation.ts +2 -2
  41. package/src/classes/features/other/PreventCollectibleRotation.ts +2 -3
  42. package/src/classes/features/other/SaveDataManager.ts +2 -3
  43. package/src/classes/features/other/customStages/streakText.ts +10 -6
  44. package/src/functions/debugFunctions.ts +10 -1
  45. package/src/functions/frames.ts +172 -0
  46. package/src/functions/revive.ts +2 -3
  47. package/src/index.ts +1 -0
@@ -5487,6 +5487,19 @@ export declare function getEffects(effectVariant?: EffectVariant | -1, subType?:
5487
5487
  */
5488
5488
  export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
5489
5489
 
5490
+ export declare function getElapsedGameFramesSince(gameFrameCount: int): int;
5491
+
5492
+ export declare function getElapsedRenderFramesSince(renderFrameCount: int): int;
5493
+
5494
+ export declare function getElapsedRoomFramesSince(roomFrameCount: int): int;
5495
+
5496
+ /**
5497
+ * Helper function to get the amount of elapsed time for benchmarking / profiling purposes.
5498
+ *
5499
+ * For more information, see the documentation for the `getTime` helper function.
5500
+ */
5501
+ export declare function getElapsedTimeSince(time: int | float): int;
5502
+
5490
5503
  /**
5491
5504
  * Helper function to get all of the entities in the room or all of the entities that match a
5492
5505
  * specific entity type / variant / sub-type.
@@ -7695,7 +7708,7 @@ export declare function getTeleporters(variant?: number): GridEntity[];
7695
7708
  * Default is true. If set to false, the `Isaac.GetTime()` method will
7696
7709
  * always be used.
7697
7710
  */
7698
- export declare function getTime(useSocketIfAvailable?: boolean): float;
7711
+ export declare function getTime(useSocketIfAvailable?: boolean): int | float;
7699
7712
 
7700
7713
  /** Helper function to get all of the `GridEntityTNT` in the room. */
7701
7714
  export declare function getTNT(variant?: number): GridEntityTNT[];
@@ -9376,6 +9389,30 @@ export declare function isOdd(num: int): boolean;
9376
9389
  */
9377
9390
  export declare function isPassiveOrFamiliarCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean;
9378
9391
 
9392
+ /**
9393
+ * Helper function to check if the current game frame count is higher than a specific game frame
9394
+ * count.
9395
+ *
9396
+ * This returns false if the submitted game frame count is null or undefined.
9397
+ */
9398
+ export declare function isPastGameFrame(gameFrameCount: int | null | undefined): boolean;
9399
+
9400
+ /**
9401
+ * Helper function to check if the current render frame count is higher than a specific render frame
9402
+ * count.
9403
+ *
9404
+ * This returns false if the submitted render frame count is null or undefined.
9405
+ */
9406
+ export declare function isPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
9407
+
9408
+ /**
9409
+ * Helper function to check if the current room frame count is higher than a specific room frame
9410
+ * count.
9411
+ *
9412
+ * This returns false if the submitted room frame count is null or undefined.
9413
+ */
9414
+ export declare function isPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
9415
+
9379
9416
  /** Helper function to narrow the type of `PickingUpItem`. */
9380
9417
  export declare function isPickingUpItemCollectible(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemCollectible;
9381
9418
 
@@ -14387,12 +14424,60 @@ export declare function onFinalFloor(): boolean;
14387
14424
  */
14388
14425
  export declare function onFirstFloor(): boolean;
14389
14426
 
14427
+ /**
14428
+ * Helper function to check if the current game frame count is exactly equal to a specific game
14429
+ * frame count.
14430
+ *
14431
+ * This returns false if the submitted game frame count is null or undefined.
14432
+ */
14433
+ export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
14434
+
14435
+ /**
14436
+ * Helper function to check if the current game frame count is equal to or higher than a specific
14437
+ * game frame count.
14438
+ *
14439
+ * This returns false if the submitted game frame count is null or undefined.
14440
+ */
14441
+ export declare function onOrPastGameFrame(gameFrameCount: int | null | undefined): boolean;
14442
+
14443
+ /**
14444
+ * Helper function to check if the current render frame count is equal to or higher than a specific
14445
+ * render frame count.
14446
+ *
14447
+ * This returns false if the submitted render frame count is null or undefined.
14448
+ */
14449
+ export declare function onOrPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
14450
+
14451
+ /**
14452
+ * Helper function to check if the current room frame count is equal to or higher than a specific
14453
+ * room frame count.
14454
+ *
14455
+ * This returns false if the submitted room frame count is null or undefined.
14456
+ */
14457
+ export declare function onOrPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
14458
+
14459
+ /**
14460
+ * Helper function to check if the current render frame count is exactly equal to a specific render
14461
+ * frame count.
14462
+ *
14463
+ * This returns false if the submitted render frame count is null or undefined.
14464
+ */
14465
+ export declare function onRenderFrame(renderFrameCount: int | null | undefined): boolean;
14466
+
14390
14467
  /**
14391
14468
  * Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or
14392
14469
  * `StageType.REPENTANCE_B`.
14393
14470
  */
14394
14471
  export declare function onRepentanceStage(): boolean;
14395
14472
 
14473
+ /**
14474
+ * Helper function to check if the current room frame count is exactly equal to a specific room
14475
+ * frame count.
14476
+ *
14477
+ * This returns false if the submitted room frame count is null or undefined.
14478
+ */
14479
+ export declare function onRoomFrame(roomFrameCount: int | null | undefined): boolean;
14480
+
14396
14481
  /**
14397
14482
  * Helper function to check whether the player is playing on a set seed (i.e. that they entered in a
14398
14483
  * specific seed by pressing tab on the character selection screen). When the player resets the game
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 59.4.1
3
+ isaacscript-common 59.5.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -19072,6 +19072,91 @@ function PostCollectibleEmpty.prototype.collectibleTypeChanged(self, collectible
19072
19072
  self:fire(collectible, oldCollectibleType)
19073
19073
  end
19074
19074
  end
19075
+ return ____exports
19076
+ end,
19077
+ ["src.functions.frames"] = function(...)
19078
+ local ____exports = {}
19079
+ local ____cachedClasses = require("src.core.cachedClasses")
19080
+ local game = ____cachedClasses.game
19081
+ function ____exports.getElapsedGameFramesSince(self, gameFrameCount)
19082
+ local thisGameFrameCount = game:GetFrameCount()
19083
+ return thisGameFrameCount - gameFrameCount
19084
+ end
19085
+ function ____exports.getElapsedRenderFramesSince(self, renderFrameCount)
19086
+ local thisRenderFrameCount = Isaac.GetFrameCount()
19087
+ return thisRenderFrameCount - renderFrameCount
19088
+ end
19089
+ function ____exports.getElapsedRoomFramesSince(self, roomFrameCount)
19090
+ local room = game:GetRoom()
19091
+ local thisRoomFrameCount = room:GetFrameCount()
19092
+ return thisRoomFrameCount - roomFrameCount
19093
+ end
19094
+ function ____exports.isPastGameFrame(self, gameFrameCount)
19095
+ if gameFrameCount == nil or gameFrameCount == nil then
19096
+ return false
19097
+ end
19098
+ local thisGameFrameCount = game:GetFrameCount()
19099
+ return thisGameFrameCount > gameFrameCount
19100
+ end
19101
+ function ____exports.isPastRenderFrame(self, renderFrameCount)
19102
+ if renderFrameCount == nil or renderFrameCount == nil then
19103
+ return false
19104
+ end
19105
+ local thisRenderFrameCount = Isaac.GetFrameCount()
19106
+ return thisRenderFrameCount >= renderFrameCount
19107
+ end
19108
+ function ____exports.isPastRoomFrame(self, roomFrameCount)
19109
+ if roomFrameCount == nil or roomFrameCount == nil then
19110
+ return false
19111
+ end
19112
+ local room = game:GetRoom()
19113
+ local thisGameFrameCount = room:GetFrameCount()
19114
+ return thisGameFrameCount > roomFrameCount
19115
+ end
19116
+ function ____exports.onGameFrame(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.onOrPastGameFrame(self, gameFrameCount)
19124
+ if gameFrameCount == nil or gameFrameCount == nil then
19125
+ return false
19126
+ end
19127
+ local thisGameFrameCount = game:GetFrameCount()
19128
+ return thisGameFrameCount >= gameFrameCount
19129
+ end
19130
+ function ____exports.onOrPastRenderFrame(self, renderFrameCount)
19131
+ if renderFrameCount == nil or renderFrameCount == nil then
19132
+ return false
19133
+ end
19134
+ local thisRenderFrameCount = Isaac.GetFrameCount()
19135
+ return thisRenderFrameCount >= renderFrameCount
19136
+ end
19137
+ function ____exports.onOrPastRoomFrame(self, roomFrameCount)
19138
+ if roomFrameCount == nil or roomFrameCount == nil then
19139
+ return false
19140
+ end
19141
+ local room = game:GetRoom()
19142
+ local thisGameFrameCount = room:GetFrameCount()
19143
+ return thisGameFrameCount >= roomFrameCount
19144
+ end
19145
+ function ____exports.onRenderFrame(self, renderFrameCount)
19146
+ if renderFrameCount == nil or renderFrameCount == nil then
19147
+ return false
19148
+ end
19149
+ local thisRenderFrameCount = Isaac.GetFrameCount()
19150
+ return thisRenderFrameCount >= renderFrameCount
19151
+ end
19152
+ function ____exports.onRoomFrame(self, roomFrameCount)
19153
+ if roomFrameCount == nil or roomFrameCount == nil then
19154
+ return false
19155
+ end
19156
+ local room = game:GetRoom()
19157
+ local thisGameFrameCount = room:GetFrameCount()
19158
+ return thisGameFrameCount == roomFrameCount
19159
+ end
19075
19160
  return ____exports
19076
19161
  end,
19077
19162
  ["src.functions.playerDataStructures"] = function(...)
@@ -19951,6 +20036,8 @@ local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
19951
20036
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
19952
20037
  local ____flag = require("src.functions.flag")
19953
20038
  local hasFlag = ____flag.hasFlag
20039
+ local ____frames = require("src.functions.frames")
20040
+ local onGameFrame = ____frames.onGameFrame
19954
20041
  local ____playerDataStructures = require("src.functions.playerDataStructures")
19955
20042
  local mapGetPlayer = ____playerDataStructures.mapGetPlayer
19956
20043
  local mapSetPlayer = ____playerDataStructures.mapSetPlayer
@@ -20027,8 +20114,7 @@ function PostCursedTeleport.prototype.isPotentialNaturalTeleportFromSacrificeRoo
20027
20114
  return roomType == RoomType.SACRIFICE and isSpikeDamage and (v.level.numSacrifices == 6 or v.level.numSacrifices >= 12)
20028
20115
  end
20029
20116
  function PostCursedTeleport.prototype.playerIsTeleportingFromCursedTeleport(self, player, lastDamageFrame)
20030
- local gameFrameCount = game:GetFrameCount()
20031
- if gameFrameCount ~= lastDamageFrame then
20117
+ if not onGameFrame(nil, lastDamageFrame) then
20032
20118
  return false
20033
20119
  end
20034
20120
  local sprite = player:GetSprite()
@@ -29452,8 +29538,8 @@ local __TS__New = ____lualib.__TS__New
29452
29538
  local ____exports = {}
29453
29539
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
29454
29540
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
29455
- local ____cachedClasses = require("src.core.cachedClasses")
29456
- local game = ____cachedClasses.game
29541
+ local ____frames = require("src.functions.frames")
29542
+ local isPastRoomFrame = ____frames.isPastRoomFrame
29457
29543
  local ____roomData = require("src.functions.roomData")
29458
29544
  local getRoomVisitedCount = ____roomData.getRoomVisitedCount
29459
29545
  local ____shouldFire = require("src.shouldFire")
@@ -29469,10 +29555,8 @@ function PostPickupInitFirst.prototype.____constructor(self)
29469
29555
  self.v = {room = {firedSet = __TS__New(Set)}}
29470
29556
  self.shouldFire = shouldFirePickup
29471
29557
  self.postPickupInit = function(____, pickup)
29472
- local room = game:GetRoom()
29473
- local roomFrameCount = room:GetFrameCount()
29474
29558
  local roomVisitedCount = getRoomVisitedCount(nil)
29475
- if roomFrameCount > 0 or roomVisitedCount == 0 then
29559
+ if isPastRoomFrame(nil, 0) or roomVisitedCount == 0 then
29476
29560
  self:fire(pickup)
29477
29561
  end
29478
29562
  end
@@ -31570,8 +31654,6 @@ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
31570
31654
  local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
31571
31655
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
31572
31656
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
31573
- local ____cachedClasses = require("src.core.cachedClasses")
31574
- local game = ____cachedClasses.game
31575
31657
  local ____constants = require("src.core.constants")
31576
31658
  local MAX_TAINTED_SAMSON_BERSERK_CHARGE = ____constants.MAX_TAINTED_SAMSON_BERSERK_CHARGE
31577
31659
  local TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = ____constants.TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE
@@ -31579,6 +31661,8 @@ local ____MysteriousPaperEffect = require("src.enums.MysteriousPaperEffect")
31579
31661
  local MysteriousPaperEffect = ____MysteriousPaperEffect.MysteriousPaperEffect
31580
31662
  local ____characters = require("src.functions.characters")
31581
31663
  local getCharacterDeathAnimationName = ____characters.getCharacterDeathAnimationName
31664
+ local ____frames = require("src.functions.frames")
31665
+ local onGameFrame = ____frames.onGameFrame
31582
31666
  local ____playerHealth = require("src.functions.playerHealth")
31583
31667
  local getPlayerMaxHeartContainers = ____playerHealth.getPlayerMaxHeartContainers
31584
31668
  local ____players = require("src.functions.players")
@@ -31612,7 +31696,6 @@ function ____exports.willReviveFromSpiritShackles(self, player)
31612
31696
  return spiritShacklesEnabled and not playerInSoulForm
31613
31697
  end
31614
31698
  function ____exports.isDamageToPlayerFatal(self, player, amount, source, lastDamageGameFrame)
31615
- local gameFrameCount = game:GetFrameCount()
31616
31699
  local character = player:GetPlayerType()
31617
31700
  local effects = player:GetEffects()
31618
31701
  local isBerserk = effects:HasCollectibleEffect(CollectibleType.BERSERK)
@@ -31642,7 +31725,7 @@ function ____exports.isDamageToPlayerFatal(self, player, amount, source, lastDam
31642
31725
  if ____exports.willReviveFromHeartbreak(nil, player) then
31643
31726
  return false
31644
31727
  end
31645
- if player:HasCollectible(CollectibleType.BROKEN_GLASS_CANNON) and gameFrameCount == lastDamageGameFrame then
31728
+ if player:HasCollectible(CollectibleType.BROKEN_GLASS_CANNON) and onGameFrame(nil, lastDamageGameFrame) then
31646
31729
  return false
31647
31730
  end
31648
31731
  local hearts = player:GetHearts()
@@ -35692,6 +35775,9 @@ local ____cachedClasses = require("src.core.cachedClasses")
35692
35775
  local game = ____cachedClasses.game
35693
35776
  local ____decorators = require("src.decorators")
35694
35777
  local Exported = ____decorators.Exported
35778
+ local ____frames = require("src.functions.frames")
35779
+ local onGameFrame = ____frames.onGameFrame
35780
+ local onRenderFrame = ____frames.onRenderFrame
35695
35781
  local ____Feature = require("src.classes.private.Feature")
35696
35782
  local Feature = ____Feature.Feature
35697
35783
  ____exports.GameReorderedCallbacks = __TS__Class()
@@ -35733,13 +35819,12 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
35733
35819
  self.renderFrameRunStarted = nil
35734
35820
  end
35735
35821
  self.postNewLevel = function()
35736
- local gameFrameCount = game:GetFrameCount()
35737
35822
  local level = game:GetLevel()
35738
35823
  local stage = level:GetStage()
35739
35824
  local stageType = level:GetStageType()
35740
35825
  local room = game:GetRoom()
35741
35826
  local roomType = room:GetType()
35742
- if gameFrameCount == 0 and not self.forceNewLevel then
35827
+ if onGameFrame(nil, 0) and not self.forceNewLevel then
35743
35828
  return
35744
35829
  end
35745
35830
  self.forceNewLevel = false
@@ -35748,13 +35833,11 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
35748
35833
  self.postNewRoomReordered:fire(roomType)
35749
35834
  end
35750
35835
  self.postNewRoom = function()
35751
- local gameFrameCount = game:GetFrameCount()
35752
35836
  local level = game:GetLevel()
35753
35837
  local stage = level:GetStage()
35754
35838
  local stageType = level:GetStageType()
35755
35839
  local room = game:GetRoom()
35756
35840
  local roomType = room:GetType()
35757
- local renderFrameCount = Isaac.GetFrameCount()
35758
35841
  if self.usedGlowingHourGlass then
35759
35842
  self.usedGlowingHourGlass = false
35760
35843
  if self.currentStage ~= stage or self.currentStageType ~= stageType then
@@ -35764,7 +35847,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
35764
35847
  return
35765
35848
  end
35766
35849
  end
35767
- if (gameFrameCount == 0 or renderFrameCount == self.renderFrameRunStarted or self.currentStage ~= stage or self.currentStageType ~= stageType) and not self.forceNewRoom then
35850
+ if (onGameFrame(nil, 0) or onRenderFrame(nil, self.renderFrameRunStarted) or self.currentStage ~= stage or self.currentStageType ~= stageType) and not self.forceNewRoom then
35768
35851
  return
35769
35852
  end
35770
35853
  self.forceNewRoom = false
@@ -37749,8 +37832,6 @@ local ____exports = {}
37749
37832
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
37750
37833
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
37751
37834
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
37752
- local ____cachedClasses = require("src.core.cachedClasses")
37753
- local game = ____cachedClasses.game
37754
37835
  local ____decorators = require("src.decorators")
37755
37836
  local Exported = ____decorators.Exported
37756
37837
  local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
@@ -37761,6 +37842,8 @@ local ____SerializationType = require("src.enums.SerializationType")
37761
37842
  local SerializationType = ____SerializationType.SerializationType
37762
37843
  local ____deepCopy = require("src.functions.deepCopy")
37763
37844
  local deepCopy = ____deepCopy.deepCopy
37845
+ local ____frames = require("src.functions.frames")
37846
+ local isPastGameFrame = ____frames.isPastGameFrame
37764
37847
  local ____log = require("src.functions.log")
37765
37848
  local log = ____log.log
37766
37849
  local ____stage = require("src.functions.stage")
@@ -37813,8 +37896,7 @@ function SaveDataManager.prototype.____constructor(self, mod)
37813
37896
  self.inARun = true
37814
37897
  self.restoreGlowingHourGlassDataOnNextRoom = false
37815
37898
  loadFromDisk(nil, self.mod, self.saveDataMap, self.classConstructors)
37816
- local gameFrameCount = game:GetFrameCount()
37817
- local isContinued = gameFrameCount ~= 0
37899
+ local isContinued = isPastGameFrame(nil, 0)
37818
37900
  if not isContinued then
37819
37901
  restoreDefaultsForAllFeaturesAndKeys(nil, self.saveDataMap, self.saveDataDefaultsMap)
37820
37902
  end
@@ -37973,6 +38055,8 @@ local ____ISCFeature = require("src.enums.ISCFeature")
37973
38055
  local ISCFeature = ____ISCFeature.ISCFeature
37974
38056
  local ____entities = require("src.functions.entities")
37975
38057
  local getEntityID = ____entities.getEntityID
38058
+ local ____frames = require("src.functions.frames")
38059
+ local isPastRoomFrame = ____frames.isPastRoomFrame
37976
38060
  local ____roomData = require("src.functions.roomData")
37977
38061
  local getRoomListIndex = ____roomData.getRoomListIndex
37978
38062
  local ____stage = require("src.functions.stage")
@@ -38031,8 +38115,7 @@ function PickupIndexCreation.prototype.setPickupIndex(self, pickup)
38031
38115
  local pickupIndexFromLevelData = self:getPickupIndexFromPreviousData(pickup)
38032
38116
  local room = game:GetRoom()
38033
38117
  local isFirstVisit = room:IsFirstVisit()
38034
- local roomFrameCount = room:GetFrameCount()
38035
- if pickupIndexFromLevelData ~= nil and not isFirstVisit and roomFrameCount <= 0 then
38118
+ if pickupIndexFromLevelData ~= nil and not isFirstVisit and not isPastRoomFrame(nil, 0) then
38036
38119
  v.room.pickupIndexes:set(ptrHash, pickupIndexFromLevelData)
38037
38120
  return
38038
38121
  end
@@ -42345,6 +42428,9 @@ local ____TrapdoorAnimation = require("src.enums.private.TrapdoorAnimation")
42345
42428
  local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
42346
42429
  local ____easing = require("src.functions.easing")
42347
42430
  local easeOutSine = ____easing.easeOutSine
42431
+ local ____frames = require("src.functions.frames")
42432
+ local isPastRoomFrame = ____frames.isPastRoomFrame
42433
+ local onOrPastRenderFrame = ____frames.onOrPastRenderFrame
42348
42434
  local ____log = require("src.functions.log")
42349
42435
  local log = ____log.log
42350
42436
  local ____playerCenter = require("src.functions.playerCenter")
@@ -42502,14 +42588,13 @@ function CustomTrapdoors.prototype.checkPixelationToBlackComplete(self)
42502
42588
  if v.run.state ~= StageTravelState.PIXELATION_TO_BLACK or v.run.stateRenderFrame == nil then
42503
42589
  return
42504
42590
  end
42505
- local hud = game:GetHUD()
42506
- local renderFrameCount = Isaac.GetFrameCount()
42507
42591
  local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
42508
- if renderFrameCount < renderFrameScreenBlack then
42592
+ if not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
42509
42593
  return
42510
42594
  end
42511
42595
  v.run.state = StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END
42512
42596
  self:logStateChanged()
42597
+ local hud = game:GetHUD()
42513
42598
  hud:SetVisible(false)
42514
42599
  self.runInNFrames:runNextGameFrame(function()
42515
42600
  local level = game:GetLevel()
@@ -42548,14 +42633,13 @@ function CustomTrapdoors.prototype.checkSecondPixelationHalfWay(self)
42548
42633
  if v.run.state ~= StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY or v.run.stateRenderFrame == nil then
42549
42634
  return
42550
42635
  end
42551
- local hud = game:GetHUD()
42552
- local renderFrameCount = Isaac.GetFrameCount()
42553
42636
  local renderFrameScreenBlack = v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES
42554
- if renderFrameCount < renderFrameScreenBlack then
42637
+ if not onOrPastRenderFrame(nil, renderFrameScreenBlack) then
42555
42638
  return
42556
42639
  end
42557
42640
  v.run.state = StageTravelState.PIXELATION_TO_ROOM
42558
42641
  self:logStateChanged()
42642
+ local hud = game:GetHUD()
42559
42643
  hud:SetVisible(true)
42560
42644
  self.runNextRoom:runNextRoom(function()
42561
42645
  v.run.state = StageTravelState.PLAYERS_LAYING_DOWN
@@ -42611,11 +42695,10 @@ function CustomTrapdoors.prototype.shouldTrapdoorOpen(self, gridEntity, firstSpa
42611
42695
  return not anyPlayerCloserThan(nil, gridEntity.Position, TRAPDOOR_OPEN_DISTANCE) and not self:isPlayerCloseAfterBoss(gridEntity.Position) and not shouldBeClosedFromStartingInRoomWithEnemies(nil, firstSpawn, roomClear)
42612
42696
  end
42613
42697
  function CustomTrapdoors.prototype.isPlayerCloseAfterBoss(self, position)
42614
- local gameFrameCount = game:GetFrameCount()
42615
42698
  local room = game:GetRoom()
42616
42699
  local roomType = room:GetType()
42617
42700
  local roomClearGameFrame = self.roomClearFrame:getRoomClearGameFrame()
42618
- if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or gameFrameCount >= roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES then
42701
+ if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or onOrPastRenderFrame(nil, roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES) then
42619
42702
  return false
42620
42703
  end
42621
42704
  return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
@@ -42725,9 +42808,8 @@ function CustomTrapdoors.prototype.checkJumpComplete(self, player)
42725
42808
  end
42726
42809
  function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, firstSpawn)
42727
42810
  local room = game:GetRoom()
42728
- local roomFrameCount = room:GetFrameCount()
42729
42811
  local roomClear = room:IsClear()
42730
- if roomFrameCount > 0 then
42812
+ if isPastRoomFrame(nil, 0) then
42731
42813
  return false
42732
42814
  end
42733
42815
  if not roomClear then
@@ -42761,7 +42843,6 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
42761
42843
  destinationStageType = self.stageHistory:getNextStageTypeWithHistory()
42762
42844
  end
42763
42845
  local room = game:GetRoom()
42764
- local roomFrameCount = room:GetFrameCount()
42765
42846
  local roomListIndex = getRoomListIndex(nil)
42766
42847
  local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
42767
42848
  local gridEntity = self.customGridEntities:spawnCustomGridEntity(
@@ -42771,7 +42852,7 @@ function CustomTrapdoors.prototype.spawnCustomTrapdoor(self, gridIndexOrPosition
42771
42852
  anm2Path,
42772
42853
  TrapdoorAnimation.OPENED
42773
42854
  )
42774
- local firstSpawn = roomFrameCount ~= 0
42855
+ local firstSpawn = isPastRoomFrame(nil, 0)
42775
42856
  local ____spawnOpen_0 = spawnOpen
42776
42857
  if ____spawnOpen_0 == nil then
42777
42858
  ____spawnOpen_0 = self:shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
@@ -43648,6 +43729,9 @@ local KColorDefault = ____constants.KColorDefault
43648
43729
  local VectorOne = ____constants.VectorOne
43649
43730
  local ____UIStreakAnimation = require("src.enums.private.UIStreakAnimation")
43650
43731
  local UIStreakAnimation = ____UIStreakAnimation.UIStreakAnimation
43732
+ local ____frames = require("src.functions.frames")
43733
+ local getElapsedGameFramesSince = ____frames.getElapsedGameFramesSince
43734
+ local getElapsedRenderFramesSince = ____frames.getElapsedRenderFramesSince
43651
43735
  local ____ui = require("src.functions.ui")
43652
43736
  local getScreenBottomCenterPos = ____ui.getScreenBottomCenterPos
43653
43737
  local getScreenTopCenterPos = ____ui.getScreenTopCenterPos
@@ -43657,16 +43741,15 @@ function checkEndTopStreakText(self)
43657
43741
  if v.run.topStreakTextStartedRenderFrame == nil or v.run.topStreakText.animation ~= UIStreakAnimation.TEXT_STAY then
43658
43742
  return
43659
43743
  end
43660
- local renderFrameCount = Isaac.GetFrameCount()
43661
- local elapsedFrames = renderFrameCount - v.run.topStreakTextStartedRenderFrame
43744
+ local elapsedFrames = getElapsedRenderFramesSince(nil, v.run.topStreakTextStartedRenderFrame)
43662
43745
  if elapsedFrames >= 115 then
43663
43746
  v.run.topStreakText.animation = UIStreakAnimation.TEXT
43664
43747
  v.run.topStreakText.frame = TEXT_OUT_FRAME - 2
43665
43748
  end
43666
43749
  end
43667
43750
  function trackMapInputPressed(self)
43751
+ local gameFrameCount = game:GetFrameCount()
43668
43752
  for ____, controllerIndex in ipairs(CONTROLLER_INDEX_VALUES) do
43669
- local gameFrameCount = game:GetFrameCount()
43670
43753
  local oldPushedMapFrame = v.run.controllerIndexPushingMapRenderFrame:get(controllerIndex)
43671
43754
  local isPushingMap = Input.IsActionPressed(ButtonAction.MAP, controllerIndex)
43672
43755
  if isPushingMap then
@@ -43687,8 +43770,7 @@ function checkStartBottomStreakText(self)
43687
43770
  return
43688
43771
  end
43689
43772
  local earliestFrame = math.min(table.unpack(pushedMapFrames))
43690
- local gameFrameCount = game:GetFrameCount()
43691
- local elapsedFrames = gameFrameCount - earliestFrame
43773
+ local elapsedFrames = getElapsedGameFramesSince(nil, earliestFrame)
43692
43774
  if elapsedFrames >= NUM_RENDER_FRAMES_MAP_HELD_BEFORE_STREAK_TEXT then
43693
43775
  v.run.bottomStreakText.animation = UIStreakAnimation.TEXT
43694
43776
  v.run.bottomStreakText.frame = 0
@@ -47819,6 +47901,8 @@ local ____collectibles = require("src.functions.collectibles")
47819
47901
  local setCollectibleSubType = ____collectibles.setCollectibleSubType
47820
47902
  local ____entities = require("src.functions.entities")
47821
47903
  local getEntityID = ____entities.getEntityID
47904
+ local ____frames = require("src.functions.frames")
47905
+ local onGameFrame = ____frames.onGameFrame
47822
47906
  local ____pickupVariants = require("src.functions.pickupVariants")
47823
47907
  local isCollectible = ____pickupVariants.isCollectible
47824
47908
  local ____pickupsSpecific = require("src.functions.pickupsSpecific")
@@ -47872,8 +47956,7 @@ function PreventCollectibleRotation.prototype.____constructor(self, pickupIndexC
47872
47956
  if trackedCollectibleType == nil then
47873
47957
  return
47874
47958
  end
47875
- local gameFrameCount = game:GetFrameCount()
47876
- if v.run.rollGameFrame ~= nil and (gameFrameCount == v.run.rollGameFrame or gameFrameCount == v.run.rollGameFrame + 1) then
47959
+ if v.run.rollGameFrame ~= nil and (onGameFrame(nil, v.run.rollGameFrame) or onGameFrame(nil, v.run.rollGameFrame + 1)) then
47877
47960
  v.run.trackedCollectibles:delete(pickupIndex)
47878
47961
  return
47879
47962
  end
@@ -53731,9 +53814,6 @@ return ____exports
53731
53814
  local ____exports = {}
53732
53815
  local ____log = require("src.functions.log")
53733
53816
  local log = ____log.log
53734
- function ____exports.isLuaDebugEnabled(self)
53735
- return _G.package ~= nil
53736
- end
53737
53817
  function ____exports.getTime(self, useSocketIfAvailable)
53738
53818
  if useSocketIfAvailable == nil then
53739
53819
  useSocketIfAvailable = true
@@ -53752,6 +53832,12 @@ function ____exports.getTime(self, useSocketIfAvailable)
53752
53832
  end
53753
53833
  return Isaac.GetTime()
53754
53834
  end
53835
+ function ____exports.isLuaDebugEnabled(self)
53836
+ return _G.package ~= nil
53837
+ end
53838
+ function ____exports.getElapsedTimeSince(self, time)
53839
+ return ____exports.getTime(nil) - time
53840
+ end
53755
53841
  function ____exports.getTraceback()
53756
53842
  if SandboxGetTraceback ~= nil then
53757
53843
  return SandboxGetTraceback()
@@ -53796,6 +53882,7 @@ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
53796
53882
  local ____features = require("src.features")
53797
53883
  local getFeatures = ____features.getFeatures
53798
53884
  local ____debugFunctions = require("src.functions.debugFunctions")
53885
+ local getElapsedTimeSince = ____debugFunctions.getElapsedTimeSince
53799
53886
  local getTime = ____debugFunctions.getTime
53800
53887
  local ____log = require("src.functions.log")
53801
53888
  local getParentFunctionDescription = ____log.getParentFunctionDescription
@@ -53852,8 +53939,7 @@ function ModUpgraded.prototype.AddPriorityCallback(self, modCallback, priority,
53852
53939
  local startTime = getTime(nil)
53853
53940
  Isaac.DebugString(signature .. " - START")
53854
53941
  local returnValue = callback(nil, ...)
53855
- local endTime = getTime(nil)
53856
- local elapsedTime = endTime - startTime
53942
+ local elapsedTime = getElapsedTimeSince(nil, startTime)
53857
53943
  if self.timeThreshold == nil or self.timeThreshold <= elapsedTime then
53858
53944
  Isaac.DebugString((signature .. " - END - time: ") .. tostring(elapsedTime))
53859
53945
  else
@@ -56374,6 +56460,14 @@ do
56374
56460
  end
56375
56461
  end
56376
56462
  end
56463
+ do
56464
+ local ____export = require("src.functions.frames")
56465
+ for ____exportKey, ____exportValue in pairs(____export) do
56466
+ if ____exportKey ~= "default" then
56467
+ ____exports[____exportKey] = ____exportValue
56468
+ end
56469
+ end
56470
+ end
56377
56471
  do
56378
56472
  local ____export = require("src.functions.globals")
56379
56473
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -57546,6 +57640,14 @@ do
57546
57640
  end
57547
57641
  end
57548
57642
  end
57643
+ do
57644
+ local ____export = require("src.functions.frames")
57645
+ for ____exportKey, ____exportValue in pairs(____export) do
57646
+ if ____exportKey ~= "default" then
57647
+ ____exports[____exportKey] = ____exportValue
57648
+ end
57649
+ end
57650
+ end
57549
57651
  do
57550
57652
  local ____export = require("src.functions.globals")
57551
57653
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -1 +1 @@
1
- {"version":3,"file":"ModUpgraded.d.ts","sourceRoot":"","sources":["../../../src/classes/ModUpgraded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAIhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAS/D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAMrG;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,YAAW,GAAG;IAK9B,IAAI,EAAE,MAAM,CAAC;IAMpB,4FAA4F;IAC5F,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAE1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAElD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAMd,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,KAAK;IAgBpD,WAAW,CAAC,CAAC,SAAS,MAAM,qBAAqB,GAAG,MAAM,EAC/D,WAAW,EAAE,CAAC,EACd,G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M;IAIlB,cAAc,CAAC,CAAC,SAAS,WAAW,EACzC,WAAW,EAAE,CAAC,EACd,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACpC,IAAI;IAIA,UAAU,IAAI,IAAI;IAIlB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQnC;;;;;;OAMG;IACI,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,EAClD,iBAAiB,EAAE,CAAC,EACpB,GAAG,IAAI,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,IAAI;IAQP;;;;OAIG;IACI,yBAAyB,CAAC,CAAC,SAAS,iBAAiB,EAC1D,iBAAiB,EAAE,CAAC,EACpB,QAAQ,EAAE,gBAAgB,GAAG,GAAG,EAChC,GAAG,IAAI,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,IAAI;IAQP;;;;;;;;;OASG;IACI,oBAAoB,CAAC,CAAC,SAAS,iBAAiB,EACrD,iBAAiB,EAAE,CAAC,EACpB,QAAQ,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1C,IAAI;IAOP;;;OAGG;IACI,eAAe,IAAI,IAAI;IA0C9B;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAgEnB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAqDrB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;CAM5B"}
@@ -22,6 +22,7 @@ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
22
22
  local ____features = require("src.features")
23
23
  local getFeatures = ____features.getFeatures
24
24
  local ____debugFunctions = require("src.functions.debugFunctions")
25
+ local getElapsedTimeSince = ____debugFunctions.getElapsedTimeSince
25
26
  local getTime = ____debugFunctions.getTime
26
27
  local ____log = require("src.functions.log")
27
28
  local getParentFunctionDescription = ____log.getParentFunctionDescription
@@ -89,8 +90,7 @@ function ModUpgraded.prototype.AddPriorityCallback(self, modCallback, priority,
89
90
  local startTime = getTime(nil)
90
91
  Isaac.DebugString(signature .. " - START")
91
92
  local returnValue = callback(nil, ...)
92
- local endTime = getTime(nil)
93
- local elapsedTime = endTime - startTime
93
+ local elapsedTime = getElapsedTimeSince(nil, startTime)
94
94
  if self.timeThreshold == nil or self.timeThreshold <= elapsedTime then
95
95
  Isaac.DebugString((signature .. " - END - time: ") .. tostring(elapsedTime))
96
96
  else
@@ -1 +1 @@
1
- {"version":3,"file":"PostCursedTeleport.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostCursedTeleport.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAOlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAe3D,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,oBAAoB,CAAC;IAC5E,CAAC;;;;;;;MAAK;IAEtB,UAAmB,UAAU,0BAAoB;;IAgBjD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAWlC;IAEF,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,2CAA2C;IAkBnD,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAyB9C;IAEF,OAAO,CAAC,qCAAqC;CA8B9C"}
1
+ {"version":3,"file":"PostCursedTeleport.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostCursedTeleport.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAQlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAe3D,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,oBAAoB,CAAC;IAC5E,CAAC;;;;;;;MAAK;IAEtB,UAAmB,UAAU,0BAAoB;;IAgBjD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAWlC;IAEF,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,2CAA2C;IAkBnD,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAyB9C;IAEF,OAAO,CAAC,qCAAqC;CA6B9C"}
@@ -16,6 +16,8 @@ local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
16
16
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
17
17
  local ____flag = require("src.functions.flag")
18
18
  local hasFlag = ____flag.hasFlag
19
+ local ____frames = require("src.functions.frames")
20
+ local onGameFrame = ____frames.onGameFrame
19
21
  local ____playerDataStructures = require("src.functions.playerDataStructures")
20
22
  local mapGetPlayer = ____playerDataStructures.mapGetPlayer
21
23
  local mapSetPlayer = ____playerDataStructures.mapSetPlayer
@@ -92,8 +94,7 @@ function PostCursedTeleport.prototype.isPotentialNaturalTeleportFromSacrificeRoo
92
94
  return roomType == RoomType.SACRIFICE and isSpikeDamage and (v.level.numSacrifices == 6 or v.level.numSacrifices >= 12)
93
95
  end
94
96
  function PostCursedTeleport.prototype.playerIsTeleportingFromCursedTeleport(self, player, lastDamageFrame)
95
- local gameFrameCount = game:GetFrameCount()
96
- if gameFrameCount ~= lastDamageFrame then
97
+ if not onGameFrame(nil, lastDamageFrame) then
97
98
  return false
98
99
  end
99
100
  local sprite = player:GetSprite()
@@ -1 +1 @@
1
- {"version":3,"file":"PostItemDischarge.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostItemDischarge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,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,KAAK,CAAC,GAAG,iBAAiB,CAAC,mBAAmB,CAAC;AAI/C,KAAK,8BAA8B,GAAG,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AACvE,KAAK,qBAAqB,GAAG,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AAkBlD,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,CAAC,CAAC;IACtC,CAAC;;;;;;;;MAAK;;IAsBtB,UAAmB,UAAU,6GAEb,aAAa,CAAC,CAAC,KAC5B,OAAO,CAQR;IAIF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CASpC;IAIF,OAAO,CAAC,mBAAmB;IAQ3B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAqCzC;IAEF;;;OAGG;IACH,OAAO,CAAC,8BAA8B;CAYvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PostPickupInitFirst.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPickupInitFirst.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,sBAAsB,CAAC;IAC/E,CAAC;;;;MAIf;;IAWF,UAAmB,UAAU,0BAAoB;IAGjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAU7B;CACH"}
1
+ {"version":3,"file":"PostPickupInitFirst.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPickupInitFirst.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,sBAAsB,CAAC;IAC/E,CAAC;;;;MAIf;;IAWF,UAAmB,UAAU,0BAAoB;IAGjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAQ7B;CACH"}