isaacscript-common 8.4.6 → 8.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 (63) hide show
  1. package/dist/features/characterStats.d.ts.map +1 -1
  2. package/dist/features/characterStats.lua +1 -2
  3. package/dist/features/firstLast.d.ts +6 -3
  4. package/dist/features/firstLast.d.ts.map +1 -1
  5. package/dist/features/firstLast.lua +6 -3
  6. package/dist/functions/bosses.d.ts +5 -2
  7. package/dist/functions/bosses.d.ts.map +1 -1
  8. package/dist/functions/bosses.lua +11 -6
  9. package/dist/functions/collectibleCacheFlag.d.ts +1 -1
  10. package/dist/functions/collectibleCacheFlag.d.ts.map +1 -1
  11. package/dist/functions/collectibleCacheFlag.lua +1 -2
  12. package/dist/functions/collectibleSet.lua +32 -32
  13. package/dist/functions/collectibleTag.d.ts +1 -1
  14. package/dist/functions/collectibleTag.d.ts.map +1 -1
  15. package/dist/functions/collectibleTag.lua +1 -3
  16. package/dist/functions/eden.d.ts +1 -1
  17. package/dist/functions/eden.d.ts.map +1 -1
  18. package/dist/functions/eden.lua +1 -2
  19. package/dist/functions/flying.d.ts +1 -1
  20. package/dist/functions/flying.d.ts.map +1 -1
  21. package/dist/functions/flying.lua +5 -2
  22. package/dist/functions/input.d.ts +2 -2
  23. package/dist/functions/input.d.ts.map +1 -1
  24. package/dist/functions/input.lua +2 -4
  25. package/dist/functions/playerHealth.d.ts +93 -0
  26. package/dist/functions/playerHealth.d.ts.map +1 -1
  27. package/dist/functions/playerHealth.lua +216 -33
  28. package/dist/functions/players.d.ts +1 -111
  29. package/dist/functions/players.d.ts.map +1 -1
  30. package/dist/functions/players.lua +20 -279
  31. package/dist/functions/revive.d.ts.map +1 -1
  32. package/dist/functions/revive.lua +2 -1
  33. package/dist/functions/stats.d.ts +16 -0
  34. package/dist/functions/stats.d.ts.map +1 -1
  35. package/dist/functions/stats.lua +78 -0
  36. package/dist/functions/transformations.d.ts +1 -1
  37. package/dist/functions/transformations.d.ts.map +1 -1
  38. package/dist/functions/trinketCacheFlag.d.ts +1 -1
  39. package/dist/functions/trinketCacheFlag.d.ts.map +1 -1
  40. package/dist/functions/trinketCacheFlag.lua +1 -3
  41. package/dist/functions/trinketSet.lua +32 -32
  42. package/dist/index.d.ts +19 -30
  43. package/dist/sets/bossSets.d.ts +1 -0
  44. package/dist/sets/bossSets.d.ts.map +1 -1
  45. package/dist/sets/bossSets.lua +19 -0
  46. package/package.json +1 -1
  47. package/src/features/characterStats.ts +1 -2
  48. package/src/features/firstLast.ts +6 -3
  49. package/src/functions/bosses.ts +15 -6
  50. package/src/functions/collectibleCacheFlag.ts +3 -3
  51. package/src/functions/collectibleSet.ts +32 -32
  52. package/src/functions/collectibleTag.ts +2 -3
  53. package/src/functions/eden.ts +3 -3
  54. package/src/functions/flying.ts +4 -4
  55. package/src/functions/input.ts +4 -5
  56. package/src/functions/playerHealth.ts +269 -7
  57. package/src/functions/players.ts +1 -348
  58. package/src/functions/revive.ts +2 -6
  59. package/src/functions/stats.ts +75 -0
  60. package/src/functions/transformations.ts +1 -1
  61. package/src/functions/trinketCacheFlag.ts +2 -3
  62. package/src/functions/trinketSet.ts +32 -32
  63. package/src/sets/bossSets.ts +24 -0
@@ -29,10 +29,16 @@ import {
29
29
  WarVariant,
30
30
  WidowVariant,
31
31
  } from "isaac-typescript-definitions";
32
+ import { parseEntityTypeVariantString } from "../functions/entities";
33
+ import { copySet } from "../functions/set";
34
+ import { STORY_BOSSES_SET } from "./storyBossesSet";
32
35
 
33
36
  // The "bosspools.xml" file does not actually correspond to the real boss pools, so these sets were
34
37
  // determined through experimentation on v1.7.8a.
35
38
 
39
+ // We use sets of strings instead of tuples for these data structures because TypeScript/Lua does
40
+ // not have real tuples. If we store bosses as tuples, then we cannot do a set lookup in O(1).
41
+
36
42
  /** Contains just the bosses in Basement (not e.g. Burning Basement). */
37
43
  const BASEMENT_BOSSES_SET: ReadonlySet<string> = new Set([
38
44
  `${EntityType.LARRY_JR}.${LarryJrVariant.LARRY_JR}`, // 19.0
@@ -468,3 +474,21 @@ export const ALL_BOSSES_SET: ReadonlySet<string> = new Set([
468
474
  ...ALL_STAGE_10_BOSSES_SET.values(),
469
475
  ...ALL_STAGE_11_BOSSES_SET.values(),
470
476
  ]);
477
+
478
+ // Since story bosses are stored by entity type, we copy the existing bosses and filter them (to
479
+ // avoid having to hard-code story boss variants).
480
+ const allBossesExcludingStoryBossesSet = copySet(ALL_BOSSES_SET);
481
+ const allBosses = [...ALL_BOSSES_SET.values()];
482
+ for (const entityTypeVariantString of allBosses) {
483
+ const tuple = parseEntityTypeVariantString(entityTypeVariantString);
484
+ if (tuple === undefined) {
485
+ error("Failed to parse a boss tuple when constructing the story boss set.");
486
+ }
487
+
488
+ const [entityType, _variant] = tuple;
489
+ if (STORY_BOSSES_SET.has(entityType)) {
490
+ allBossesExcludingStoryBossesSet.delete(entityTypeVariantString);
491
+ }
492
+ }
493
+ export const ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET: ReadonlySet<string> =
494
+ allBossesExcludingStoryBossesSet;