isaacscript-common 44.0.0 → 45.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.
Files changed (69) hide show
  1. package/dist/index.rollup.d.ts +31 -11
  2. package/dist/isaacscript-common.lua +5383 -5236
  3. package/dist/src/classes/features/other/{EdenStartingStats.d.ts → EdenStartingStatsHealth.d.ts} +17 -5
  4. package/dist/src/classes/features/other/EdenStartingStatsHealth.d.ts.map +1 -0
  5. package/dist/src/classes/features/other/EdenStartingStatsHealth.lua +75 -0
  6. package/dist/src/classes/features/other/ItemPoolDetection.d.ts.map +1 -1
  7. package/dist/src/classes/features/other/ItemPoolDetection.lua +2 -1
  8. package/dist/src/classes/features/other/Pause.lua +2 -2
  9. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +4 -3
  10. package/dist/src/enums/ISCFeature.d.ts +1 -1
  11. package/dist/src/enums/ISCFeature.d.ts.map +1 -1
  12. package/dist/src/enums/ISCFeature.lua +2 -2
  13. package/dist/src/features.d.ts +3 -3
  14. package/dist/src/features.d.ts.map +1 -1
  15. package/dist/src/features.lua +3 -3
  16. package/dist/src/functions/characters.d.ts +9 -2
  17. package/dist/src/functions/characters.d.ts.map +1 -1
  18. package/dist/src/functions/characters.lua +13 -4
  19. package/dist/src/functions/charge.lua +2 -2
  20. package/dist/src/functions/math.d.ts +1 -0
  21. package/dist/src/functions/math.d.ts.map +1 -1
  22. package/dist/src/functions/math.lua +1 -0
  23. package/dist/src/functions/playerCollectibles.d.ts +127 -0
  24. package/dist/src/functions/playerCollectibles.d.ts.map +1 -0
  25. package/dist/src/functions/playerCollectibles.lua +308 -0
  26. package/dist/src/functions/playerHealth.d.ts +1 -1
  27. package/dist/src/functions/playerHealth.d.ts.map +1 -1
  28. package/dist/src/functions/playerHealth.lua +10 -6
  29. package/dist/src/functions/playerTrinkets.d.ts +69 -0
  30. package/dist/src/functions/playerTrinkets.d.ts.map +1 -0
  31. package/dist/src/functions/playerTrinkets.lua +160 -0
  32. package/dist/src/functions/players.d.ts +5 -166
  33. package/dist/src/functions/players.d.ts.map +1 -1
  34. package/dist/src/functions/players.lua +20 -389
  35. package/dist/src/functions/trinketGive.lua +2 -2
  36. package/dist/src/functions/trinkets.d.ts +0 -30
  37. package/dist/src/functions/trinkets.d.ts.map +1 -1
  38. package/dist/src/functions/trinkets.lua +0 -71
  39. package/dist/src/index.d.ts +2 -0
  40. package/dist/src/index.d.ts.map +1 -1
  41. package/dist/src/index.lua +16 -0
  42. package/dist/src/objects/{characterStartingCollectibles.d.ts → characterStartingCollectibleTypes.d.ts} +2 -2
  43. package/dist/src/objects/characterStartingCollectibleTypes.d.ts.map +1 -0
  44. package/dist/src/objects/{characterStartingCollectibles.lua → characterStartingCollectibleTypes.lua} +1 -1
  45. package/dist/src/objects/characterStartingTrinketTypes.d.ts +46 -0
  46. package/dist/src/objects/characterStartingTrinketTypes.d.ts.map +1 -0
  47. package/dist/src/objects/characterStartingTrinketTypes.lua +49 -0
  48. package/package.json +1 -1
  49. package/src/classes/features/other/{EdenStartingStats.ts → EdenStartingStatsHealth.ts} +38 -5
  50. package/src/classes/features/other/ItemPoolDetection.ts +2 -4
  51. package/src/classes/features/other/Pause.ts +1 -1
  52. package/src/classes/features/other/extraConsoleCommands/commands.ts +3 -3
  53. package/src/enums/ISCFeature.ts +1 -1
  54. package/src/features.ts +3 -3
  55. package/src/functions/characters.ts +20 -4
  56. package/src/functions/charge.ts +1 -1
  57. package/src/functions/math.ts +1 -0
  58. package/src/functions/playerCollectibles.ts +372 -0
  59. package/src/functions/playerHealth.ts +23 -15
  60. package/src/functions/playerTrinkets.ts +184 -0
  61. package/src/functions/players.ts +16 -481
  62. package/src/functions/trinketGive.ts +1 -1
  63. package/src/functions/trinkets.ts +1 -84
  64. package/src/index.ts +2 -0
  65. package/src/objects/{characterStartingCollectibles.ts → characterStartingCollectibleTypes.ts} +1 -1
  66. package/src/objects/characterStartingTrinketTypes.ts +129 -0
  67. package/dist/src/classes/features/other/EdenStartingStats.d.ts.map +0 -1
  68. package/dist/src/classes/features/other/EdenStartingStats.lua +0 -54
  69. package/dist/src/objects/characterStartingCollectibles.d.ts.map +0 -1
@@ -4068,15 +4068,26 @@ export declare function easeOutQuint(time: number): number;
4068
4068
  */
4069
4069
  export declare function easeOutSine(time: number): number;
4070
4070
 
4071
- declare class EdenStartingStats extends Feature {
4071
+ declare class EdenStartingStatsHealth extends Feature {
4072
4072
  /**
4073
4073
  * We must use the `POST_PLAYER_INIT` callback since the two random collectibles have not been
4074
4074
  * granted yet.
4075
4075
  */
4076
4076
  private readonly postPlayerInit;
4077
+ private getEdenStats;
4078
+ private getEdenHealth;
4077
4079
  /**
4078
- * Helper function to get the value of the randomized starting stat for Eden. (At the beginning of
4079
- * a run, Eden starts with randomized stats.)
4080
+ * Helper function to get the health that Eden started with at the beginning of the run before any
4081
+ * of the random collectibles were added.
4082
+ *
4083
+ * Returns undefined if passed a player that is not Eden.
4084
+ *
4085
+ * In order to use this function, you must upgrade your mod with `ISCFeature.EDEN_STARTING_STATS`.
4086
+ */
4087
+ getEdenStartingHealth(player: EntityPlayer): Readonly<PlayerHealth> | undefined;
4088
+ /**
4089
+ * Helper function to get the value of the randomized starting stat for Eden that was assigned at
4090
+ * the beginning of the run before any of the random collectibles were added.
4080
4091
  *
4081
4092
  * Returns undefined if passed a player that is not Eden.
4082
4093
  *
@@ -4085,7 +4096,7 @@ declare class EdenStartingStats extends Feature {
4085
4096
  getEdenStartingStat<T extends PlayerStat>(player: EntityPlayer, playerStat: T): PlayerStats[T] | undefined;
4086
4097
  /**
4087
4098
  * Helper function to get all of the stat values that Eden started with at the beginning of the
4088
- * run.
4099
+ * run before any of the random collectibles were added.
4089
4100
  *
4090
4101
  * Returns undefined if passed a player that is not Eden.
4091
4102
  *
@@ -4917,7 +4928,15 @@ export declare function getCharacters(): PlayerType[];
4917
4928
  *
4918
4929
  * Note that this will return an empty array for Eden and Tainted Eden.
4919
4930
  */
4920
- export declare function getCharacterStartingCollectibles(character: PlayerType): readonly CollectibleType[];
4931
+ export declare function getCharacterStartingCollectibleTypes(character: PlayerType): readonly CollectibleType[];
4932
+
4933
+ /**
4934
+ * Helper function to get the trinket that is granted to a particular character at the beginning of
4935
+ * a run. Returns undefined if the character does not start with a trinket.
4936
+ *
4937
+ * Note that this will return undefined for Eden and Tainted Eden.
4938
+ */
4939
+ export declare function getCharacterStartingTrinketType(character: PlayerType): TrinketType | undefined;
4921
4940
 
4922
4941
  /**
4923
4942
  * Helper function to get the amount of charges away from the maximum charge that a particular
@@ -6232,7 +6251,7 @@ export declare function getPlayerFromPtr(entityPtr: EntityPtr): EntityPlayer | u
6232
6251
  *
6233
6252
  * This is based on the `REVEL.StoreHealth` function in the Revelations mod.
6234
6253
  */
6235
- export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth;
6254
+ export declare function getPlayerHealth(player: EntityPlayer): Readonly<PlayerHealth>;
6236
6255
 
6237
6256
  export declare function getPlayerHealthType(player: EntityPlayer, healthType: HealthType): int;
6238
6257
 
@@ -6339,9 +6358,9 @@ export declare function getPlayers(performCharacterExclusions?: boolean): Entity
6339
6358
  export declare function getPlayersOfType(...characters: PlayerType[]): EntityPlayer[];
6340
6359
 
6341
6360
  /**
6342
- * Helper function to get all of the players that match the provided controller index. This function
6343
- * returns an array of players because it is possible that there is more than one player with the
6344
- * same controller index (e.g. Jacob & Esau).
6361
+ * Helper function to get all of the players that are using keyboard (i.e.
6362
+ * `ControllerIndex.KEYBOARD`). This function returns an array of players because it is possible
6363
+ * that there is more than one player with the same controller index (e.g. Jacob & Esau).
6345
6364
  *
6346
6365
  * Note that this function includes players with a non-undefined parent like e.g. the Strawman
6347
6366
  * Keeper.
@@ -8322,7 +8341,7 @@ export declare enum ISCFeature {
8322
8341
  DEPLOY_JSON_ROOM = 24,
8323
8342
  DISABLE_ALL_SOUND = 25,
8324
8343
  DISABLE_INPUTS = 26,
8325
- EDEN_STARTING_STATS = 27,
8344
+ EDEN_STARTING_STATS_HEALTH = 27,
8326
8345
  FADE_IN_REMOVER = 28,
8327
8346
  FAST_RESET = 29,
8328
8347
  FLYING_DETECTION = 30,
@@ -8387,7 +8406,7 @@ declare interface ISCFeatureToClass {
8387
8406
  [ISCFeature.DEPLOY_JSON_ROOM]: DeployJSONRoom;
8388
8407
  [ISCFeature.DISABLE_ALL_SOUND]: DisableAllSound;
8389
8408
  [ISCFeature.DISABLE_INPUTS]: DisableInputs;
8390
- [ISCFeature.EDEN_STARTING_STATS]: EdenStartingStats;
8409
+ [ISCFeature.EDEN_STARTING_STATS_HEALTH]: EdenStartingStatsHealth;
8391
8410
  [ISCFeature.FADE_IN_REMOVER]: FadeInRemover;
8392
8411
  [ISCFeature.FAST_RESET]: FastReset;
8393
8412
  [ISCFeature.FLYING_DETECTION]: FlyingDetection;
@@ -15600,6 +15619,7 @@ export declare function roomUpdateSafe(): void;
15600
15619
 
15601
15620
  /**
15602
15621
  * If rounding fails, this function returns 0.
15622
+ *
15603
15623
  * From: http://lua-users.org/wiki/SimpleRound
15604
15624
  *
15605
15625
  * @param num The number to round.