isaacscript-common 17.7.2 → 17.8.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 (85) hide show
  1. package/dist/index.d.ts +50 -0
  2. package/dist/isaacscript-common.lua +4478 -4459
  3. package/dist/src/classes/features/other/CharacterHealthConversion.d.ts.map +1 -1
  4. package/dist/src/classes/features/other/CharacterStats.d.ts.map +1 -1
  5. package/dist/src/classes/features/other/CollectibleItemPoolType.d.ts.map +1 -1
  6. package/dist/src/classes/features/other/CustomHotkeys.d.ts.map +1 -1
  7. package/dist/src/classes/features/other/CustomPickups.d.ts.map +1 -1
  8. package/dist/src/classes/features/other/CustomStages.d.ts.map +1 -1
  9. package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
  10. package/dist/src/classes/features/other/DisableAllSound.d.ts.map +1 -1
  11. package/dist/src/classes/features/other/DisableInputs.d.ts.map +1 -1
  12. package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
  13. package/dist/src/classes/features/other/FadeInRemover.d.ts.map +1 -1
  14. package/dist/src/classes/features/other/FastReset.d.ts.map +1 -1
  15. package/dist/src/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
  16. package/dist/src/classes/features/other/NoSirenSteal.d.ts.map +1 -1
  17. package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
  18. package/dist/src/classes/features/other/PersistentEntities.d.ts.map +1 -1
  19. package/dist/src/classes/features/other/PickupIndexCreation.d.ts +7 -0
  20. package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
  21. package/dist/src/classes/features/other/PickupIndexCreation.lua +26 -18
  22. package/dist/src/classes/features/other/PressInput.d.ts.map +1 -1
  23. package/dist/src/classes/features/other/PreventChildEntities.d.ts.map +1 -1
  24. package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
  25. package/dist/src/classes/features/other/PreventGridEntityRespawn.d.ts.map +1 -1
  26. package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -1
  27. package/dist/src/classes/features/other/SaveDataManager.d.ts +14 -0
  28. package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
  29. package/dist/src/classes/features/other/SaveDataManager.lua +4 -1
  30. package/dist/src/classes/features/other/TaintedLazarusPlayers.d.ts.map +1 -1
  31. package/dist/src/classes/features/other/debugDisplay/DebugDisplayBomb.d.ts.map +1 -1
  32. package/dist/src/classes/features/other/debugDisplay/DebugDisplayEffect.d.ts.map +1 -1
  33. package/dist/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.d.ts.map +1 -1
  34. package/dist/src/classes/features/other/debugDisplay/DebugDisplayKnife.d.ts.map +1 -1
  35. package/dist/src/classes/features/other/debugDisplay/DebugDisplayLaser.d.ts.map +1 -1
  36. package/dist/src/classes/features/other/debugDisplay/DebugDisplayNPC.d.ts.map +1 -1
  37. package/dist/src/classes/features/other/debugDisplay/DebugDisplayPickup.d.ts.map +1 -1
  38. package/dist/src/classes/features/other/debugDisplay/DebugDisplayPlayer.d.ts.map +1 -1
  39. package/dist/src/classes/features/other/debugDisplay/DebugDisplayProjectile.d.ts.map +1 -1
  40. package/dist/src/classes/features/other/debugDisplay/DebugDisplayTear.d.ts.map +1 -1
  41. package/dist/src/enums/ModCallbackCustom.d.ts +3 -0
  42. package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
  43. package/dist/src/features.d.ts.map +1 -1
  44. package/dist/src/features.lua +3 -2
  45. package/dist/src/functions/utils.d.ts +24 -0
  46. package/dist/src/functions/utils.d.ts.map +1 -1
  47. package/dist/src/functions/utils.lua +24 -0
  48. package/package.json +2 -2
  49. package/src/classes/features/other/CharacterHealthConversion.ts +2 -1
  50. package/src/classes/features/other/CharacterStats.ts +2 -1
  51. package/src/classes/features/other/CollectibleItemPoolType.ts +2 -1
  52. package/src/classes/features/other/CustomHotkeys.ts +2 -1
  53. package/src/classes/features/other/CustomPickups.ts +5 -2
  54. package/src/classes/features/other/CustomStages.ts +8 -3
  55. package/src/classes/features/other/CustomTrapdoors.ts +2 -1
  56. package/src/classes/features/other/DisableAllSound.ts +2 -1
  57. package/src/classes/features/other/DisableInputs.ts +11 -6
  58. package/src/classes/features/other/ExtraConsoleCommands.ts +26 -9
  59. package/src/classes/features/other/FadeInRemover.ts +2 -1
  60. package/src/classes/features/other/FastReset.ts +2 -1
  61. package/src/classes/features/other/ModdedElementDetection.ts +2 -1
  62. package/src/classes/features/other/NoSirenSteal.ts +2 -1
  63. package/src/classes/features/other/Pause.ts +5 -2
  64. package/src/classes/features/other/PersistentEntities.ts +2 -1
  65. package/src/classes/features/other/PickupIndexCreation.ts +35 -13
  66. package/src/classes/features/other/PressInput.ts +2 -1
  67. package/src/classes/features/other/PreventChildEntities.ts +2 -1
  68. package/src/classes/features/other/PreventCollectibleRotation.ts +5 -2
  69. package/src/classes/features/other/PreventGridEntityRespawn.ts +2 -1
  70. package/src/classes/features/other/RunInNFrames.ts +5 -2
  71. package/src/classes/features/other/SaveDataManager.ts +36 -8
  72. package/src/classes/features/other/TaintedLazarusPlayers.ts +2 -1
  73. package/src/classes/features/other/debugDisplay/DebugDisplayBomb.ts +2 -1
  74. package/src/classes/features/other/debugDisplay/DebugDisplayEffect.ts +2 -1
  75. package/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.ts +2 -1
  76. package/src/classes/features/other/debugDisplay/DebugDisplayKnife.ts +2 -1
  77. package/src/classes/features/other/debugDisplay/DebugDisplayLaser.ts +2 -1
  78. package/src/classes/features/other/debugDisplay/DebugDisplayNPC.ts +2 -1
  79. package/src/classes/features/other/debugDisplay/DebugDisplayPickup.ts +2 -1
  80. package/src/classes/features/other/debugDisplay/DebugDisplayPlayer.ts +2 -1
  81. package/src/classes/features/other/debugDisplay/DebugDisplayProjectile.ts +2 -1
  82. package/src/classes/features/other/debugDisplay/DebugDisplayTear.ts +2 -1
  83. package/src/enums/ModCallbackCustom.ts +3 -0
  84. package/src/features.ts +6 -2
  85. package/src/functions/utils.ts +30 -0
package/dist/index.d.ts CHANGED
@@ -6839,6 +6839,19 @@ export declare function inDimension(dimension: Dimension): boolean;
6839
6839
 
6840
6840
  export declare function inDoubleTrouble(): boolean;
6841
6841
 
6842
+ /**
6843
+ * Helper function to check if a variable is within a certain range, exclusive on both ends. (The
6844
+ * "e" stands for exclusive.)
6845
+ *
6846
+ * - For example, `inERange(1, 1, 3)` will return `false`.
6847
+ * - For example, `inERange(1.01, 1, 3)` will return `true`.
6848
+ *
6849
+ * @param num The number to check.
6850
+ * @param start The start of the range to check.
6851
+ * @param end The end of the range to check.
6852
+ */
6853
+ export declare function inERange(num: int, start: int, end: int): boolean;
6854
+
6842
6855
  export declare function inGenesisRoom(): boolean;
6843
6856
 
6844
6857
  /**
@@ -6849,6 +6862,19 @@ export declare function inGenesisRoom(): boolean;
6849
6862
  */
6850
6863
  export declare function inHomeCloset(): boolean;
6851
6864
 
6865
+ /**
6866
+ * Helper function to check if a variable is within a certain range, inclusive on both ends. (The
6867
+ * "i" stands for inclusive.)
6868
+ *
6869
+ * - For example, `inIRange(1, 1, 3)` will return `true`.
6870
+ * - For example, `inIRange(0, 1, 3)` will return `false`.
6871
+ *
6872
+ * @param num The number to check.
6873
+ * @param start The start of the range to check.
6874
+ * @param end The end of the range to check.
6875
+ */
6876
+ export declare function inIRange(num: int, start: int, end: int): boolean;
6877
+
6852
6878
  /**
6853
6879
  * Initializes an array with all of the elements containing the specified default value.
6854
6880
  *
@@ -9463,6 +9489,9 @@ export declare enum ModCallbackCustom {
9463
9489
  *
9464
9490
  * Use this callback to know when a pickup is added to the player's inventory or health.
9465
9491
  *
9492
+ * Note that this will not fire when the player takes a collectible; use either the
9493
+ * `POST_PLAYER_COLLECTIBLE_ADDED` or the `PRE_ITEM_PICKUP` callback for that.
9494
+ *
9466
9495
  * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9467
9496
  * - You can provide an optional third argument that will make the callback only fire if it
9468
9497
  * matches the `PickupVariant` provided.
@@ -11549,6 +11578,7 @@ export declare type PickupIndex = int & {
11549
11578
 
11550
11579
  declare class PickupIndexCreation extends Feature {
11551
11580
  private roomHistory;
11581
+ private saveDataManager;
11552
11582
  private postPickupInit;
11553
11583
  private setPickupIndex;
11554
11584
  private getPickupIndexFromPreviousData;
@@ -11559,6 +11589,12 @@ declare class PickupIndexCreation extends Feature {
11559
11589
  * Keep track of the metadata for later.
11560
11590
  */
11561
11591
  private trackDespawningPickupMetadata;
11592
+ /**
11593
+ * If the despawning pickup was in a Treasure Room or Boss Room, then it is possible that the
11594
+ * pickup could re-appear during The Ascent. If this is the case, we store the metadata on a
11595
+ * separate map to reference later.
11596
+ */
11597
+ private getPickupDataMapForCurrentRoom;
11562
11598
  private getPostAscentPickupIndex;
11563
11599
  /**
11564
11600
  * Mods often have to track variables relating to a pickups. Finding an index for these kinds of
@@ -13239,6 +13275,20 @@ declare class SaveDataManager extends Feature {
13239
13275
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13240
13276
  */
13241
13277
  saveDataManagerReset(key: string, childObjectKey: SaveDataKey): void;
13278
+ /**
13279
+ * Helper function to check to see if the game is in the menu, as far as the save data manager is
13280
+ * concerned. This function will return true when the game is first opened until the
13281
+ * `POST_PLAYER_INIT` callback fires. It will also return true in between the `PRE_GAME_EXIT`
13282
+ * callback firing and the `POST_PLAYER_INIT` callback firing.
13283
+ *
13284
+ * This function is useful because the `POST_ENTITY_REMOVE` callback fires after the
13285
+ * `PRE_GAME_EXIT` callback. Thus, if save data needs to be updated from the `POST_ENTITY_REMOVE`
13286
+ * callback and the player is in the process of saving and quitting, the feature will have to
13287
+ * explicitly call the `saveDataManagerSave` function.
13288
+ *
13289
+ * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
13290
+ */
13291
+ saveDataManagerInMenu(): boolean;
13242
13292
  }
13243
13293
 
13244
13294
  export declare const SECOND_IN_MILLISECONDS = 1000;