isaacscript-common 59.4.1 → 59.6.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 (51) hide show
  1. package/dist/index.rollup.d.ts +110 -1
  2. package/dist/isaacscript-common.lua +182 -58
  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/gridEntities.d.ts +22 -0
  29. package/dist/src/functions/gridEntities.d.ts.map +1 -1
  30. package/dist/src/functions/gridEntities.lua +40 -11
  31. package/dist/src/functions/revive.d.ts.map +1 -1
  32. package/dist/src/functions/revive.lua +3 -4
  33. package/dist/src/index.d.ts +1 -0
  34. package/dist/src/index.d.ts.map +1 -1
  35. package/dist/src/index.lua +8 -0
  36. package/package.json +1 -1
  37. package/src/classes/ModUpgraded.ts +2 -3
  38. package/src/classes/callbacks/PostCursedTeleport.ts +2 -2
  39. package/src/classes/callbacks/PostItemDischarge.ts +2 -0
  40. package/src/classes/callbacks/PostPickupInitFirst.ts +2 -4
  41. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +4 -6
  42. package/src/classes/features/other/CustomTrapdoors.ts +11 -14
  43. package/src/classes/features/other/PickupIndexCreation.ts +2 -2
  44. package/src/classes/features/other/PreventCollectibleRotation.ts +2 -3
  45. package/src/classes/features/other/SaveDataManager.ts +2 -3
  46. package/src/classes/features/other/customStages/streakText.ts +10 -6
  47. package/src/functions/debugFunctions.ts +10 -1
  48. package/src/functions/frames.ts +172 -0
  49. package/src/functions/gridEntities.ts +59 -13
  50. package/src/functions/revive.ts +2 -3
  51. 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.
@@ -7629,6 +7642,24 @@ export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPl
7629
7642
  */
7630
7643
  export declare function getSurroundingGridEntities(gridEntity: GridEntity): GridEntity[];
7631
7644
 
7645
+ /**
7646
+ * Helper function to get the grid indexes on the surrounding tiles from the provided grid index.
7647
+ *
7648
+ * There are always 8 grid indexes returned (e.g. top-left + top + top-right + left + right +
7649
+ * bottom-left + bottom + right), even if the computed values would be negative or otherwise
7650
+ * invalid.
7651
+ */
7652
+ export declare function getSurroundingGridIndexes(gridIndex: int): [
7653
+ topLeft: int,
7654
+ top: int,
7655
+ topRight: int,
7656
+ left: int,
7657
+ right: int,
7658
+ bottomLeft: int,
7659
+ bottom: int,
7660
+ bottomRight: int
7661
+ ];
7662
+
7632
7663
  /**
7633
7664
  * Helper function to determine how many heart containers that Tainted Magdalene has that will not
7634
7665
  * be automatically depleted over time. By default, this is 2, but this function will return 4 so
@@ -7695,7 +7726,7 @@ export declare function getTeleporters(variant?: number): GridEntity[];
7695
7726
  * Default is true. If set to false, the `Isaac.GetTime()` method will
7696
7727
  * always be used.
7697
7728
  */
7698
- export declare function getTime(useSocketIfAvailable?: boolean): float;
7729
+ export declare function getTime(useSocketIfAvailable?: boolean): int | float;
7699
7730
 
7700
7731
  /** Helper function to get all of the `GridEntityTNT` in the room. */
7701
7732
  export declare function getTNT(variant?: number): GridEntityTNT[];
@@ -9185,6 +9216,12 @@ export declare function isGridEntityBroken(gridEntity: GridEntity): boolean;
9185
9216
  */
9186
9217
  export declare function isGridEntityXMLType(num: number): num is GridEntityXMLType;
9187
9218
 
9219
+ /**
9220
+ * Helper function to check if the provided grid index has a door on it or if the surrounding 8 grid
9221
+ * indexes have a door on it.
9222
+ */
9223
+ export declare function isGridIndexAdjacentToDoor(gridIndex: int): boolean;
9224
+
9188
9225
  /** For `PickupVariant.HEART` (10). */
9189
9226
  export declare function isHeart(pickup: EntityPickup): pickup is EntityPickupHeart;
9190
9227
 
@@ -9376,6 +9413,30 @@ export declare function isOdd(num: int): boolean;
9376
9413
  */
9377
9414
  export declare function isPassiveOrFamiliarCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean;
9378
9415
 
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
+
9379
9440
  /** Helper function to narrow the type of `PickingUpItem`. */
9380
9441
  export declare function isPickingUpItemCollectible(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemCollectible;
9381
9442
 
@@ -14387,12 +14448,60 @@ export declare function onFinalFloor(): boolean;
14387
14448
  */
14388
14449
  export declare function onFirstFloor(): boolean;
14389
14450
 
14451
+ /**
14452
+ * Helper function to check if the current game frame count is exactly equal to a specific game
14453
+ * frame count.
14454
+ *
14455
+ * This returns false if the submitted game frame count is null or undefined.
14456
+ */
14457
+ export declare function onGameFrame(gameFrameCount: int | null | undefined): boolean;
14458
+
14459
+ /**
14460
+ * Helper function to check if the current game frame count is equal to or higher than a specific
14461
+ * game frame count.
14462
+ *
14463
+ * This returns false if the submitted game frame count is null or undefined.
14464
+ */
14465
+ export declare function onOrPastGameFrame(gameFrameCount: int | null | undefined): boolean;
14466
+
14467
+ /**
14468
+ * Helper function to check if the current render frame count is equal to or higher than a specific
14469
+ * render frame count.
14470
+ *
14471
+ * This returns false if the submitted render frame count is null or undefined.
14472
+ */
14473
+ export declare function onOrPastRenderFrame(renderFrameCount: int | null | undefined): boolean;
14474
+
14475
+ /**
14476
+ * Helper function to check if the current room frame count is equal to or higher than a specific
14477
+ * room frame count.
14478
+ *
14479
+ * This returns false if the submitted room frame count is null or undefined.
14480
+ */
14481
+ export declare function onOrPastRoomFrame(roomFrameCount: int | null | undefined): boolean;
14482
+
14483
+ /**
14484
+ * Helper function to check if the current render frame count is exactly equal to a specific render
14485
+ * frame count.
14486
+ *
14487
+ * This returns false if the submitted render frame count is null or undefined.
14488
+ */
14489
+ export declare function onRenderFrame(renderFrameCount: int | null | undefined): boolean;
14490
+
14390
14491
  /**
14391
14492
  * Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or
14392
14493
  * `StageType.REPENTANCE_B`.
14393
14494
  */
14394
14495
  export declare function onRepentanceStage(): boolean;
14395
14496
 
14497
+ /**
14498
+ * Helper function to check if the current room frame count is exactly equal to a specific room
14499
+ * frame count.
14500
+ *
14501
+ * This returns false if the submitted room frame count is null or undefined.
14502
+ */
14503
+ export declare function onRoomFrame(roomFrameCount: int | null | undefined): boolean;
14504
+
14396
14505
  /**
14397
14506
  * Helper function to check whether the player is playing on a set seed (i.e. that they entered in a
14398
14507
  * specific seed by pressing tab on the character selection screen). When the player resets the game