isaacscript-common 20.2.0 → 20.3.1

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 (103) hide show
  1. package/dist/index.d.ts +54 -21
  2. package/dist/isaacscript-common.lua +10293 -10005
  3. package/dist/src/callbackClasses.d.ts +1 -0
  4. package/dist/src/callbackClasses.d.ts.map +1 -1
  5. package/dist/src/callbackClasses.lua +5 -0
  6. package/dist/src/callbacks.d.ts +1 -0
  7. package/dist/src/callbacks.d.ts.map +1 -1
  8. package/dist/src/callbacks.lua +2 -1
  9. package/dist/src/classes/ModUpgradedBase.d.ts +1 -1
  10. package/dist/src/classes/callbacks/PreRoomEntitySpawnFilter.d.ts +11 -0
  11. package/dist/src/classes/callbacks/PreRoomEntitySpawnFilter.d.ts.map +1 -0
  12. package/dist/src/classes/callbacks/PreRoomEntitySpawnFilter.lua +29 -0
  13. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +3 -3
  14. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.lua +1 -1
  15. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -1
  16. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.lua +3 -3
  17. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +1 -1
  18. package/dist/src/classes/features/other/CustomHotkeys.d.ts.map +1 -1
  19. package/dist/src/classes/features/other/CustomHotkeys.lua +2 -2
  20. package/dist/src/classes/features/other/DeployJSONRoom.lua +1 -1
  21. package/dist/src/classes/features/other/ItemPoolDetection.d.ts.map +1 -1
  22. package/dist/src/classes/features/other/ModdedElementSets.lua +3 -3
  23. package/dist/src/classes/features/other/PersistentEntities.d.ts.map +1 -1
  24. package/dist/src/classes/features/other/PersistentEntities.lua +1 -1
  25. package/dist/src/classes/features/other/PickupIndexCreation.lua +1 -1
  26. package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
  27. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +0 -1
  28. package/dist/src/core/constants.d.ts +1 -1
  29. package/dist/src/core/constants.d.ts.map +1 -1
  30. package/dist/src/enums/ModCallbackCustom.d.ts +32 -7
  31. package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
  32. package/dist/src/enums/ModCallbackCustom.lua +2 -0
  33. package/dist/src/functions/cards.lua +0 -2
  34. package/dist/src/functions/entities.lua +1 -1
  35. package/dist/src/functions/hex.d.ts +4 -3
  36. package/dist/src/functions/hex.d.ts.map +1 -1
  37. package/dist/src/functions/hex.lua +8 -0
  38. package/dist/src/functions/isaacAPIClass.d.ts +1 -1
  39. package/dist/src/functions/isaacAPIClass.d.ts.map +1 -1
  40. package/dist/src/functions/levelGrid.d.ts.map +1 -1
  41. package/dist/src/functions/levelGrid.lua +2 -2
  42. package/dist/src/functions/map.d.ts +2 -2
  43. package/dist/src/functions/map.lua +1 -1
  44. package/dist/src/functions/minimap.lua +1 -1
  45. package/dist/src/functions/table.d.ts +1 -1
  46. package/dist/src/functions/table.d.ts.map +1 -1
  47. package/dist/src/functions/utils.d.ts +5 -5
  48. package/dist/src/functions/utils.d.ts.map +1 -1
  49. package/dist/src/functions/utils.lua +9 -18
  50. package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts +7 -1
  51. package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
  52. package/dist/src/maps/characterNameToTypeMap.d.ts +1 -1
  53. package/dist/src/maps/characterNameToTypeMap.d.ts.map +1 -1
  54. package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts +1 -1
  55. package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts.map +1 -1
  56. package/dist/src/sets/bossSets.lua +5 -5
  57. package/dist/src/sets/entitiesWithArmorSet.d.ts +1 -1
  58. package/dist/src/sets/entitiesWithArmorSet.d.ts.map +1 -1
  59. package/package.json +2 -2
  60. package/src/callbackClasses.ts +1 -0
  61. package/src/callbacks.ts +1 -0
  62. package/src/classes/ModUpgradedBase.ts +1 -1
  63. package/src/classes/callbacks/PostTrinketBreak.ts +2 -2
  64. package/src/classes/callbacks/PreRoomEntitySpawnFilter.ts +55 -0
  65. package/src/classes/features/callbackLogic/CustomGridEntities.ts +3 -3
  66. package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +1 -1
  67. package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +4 -6
  68. package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +1 -1
  69. package/src/classes/features/other/CustomHotkeys.ts +2 -8
  70. package/src/classes/features/other/DeployJSONRoom.ts +1 -1
  71. package/src/classes/features/other/FlyingDetection.ts +2 -2
  72. package/src/classes/features/other/ItemPoolDetection.ts +3 -5
  73. package/src/classes/features/other/ModdedElementSets.ts +4 -4
  74. package/src/classes/features/other/PersistentEntities.ts +1 -4
  75. package/src/classes/features/other/PickupIndexCreation.ts +1 -1
  76. package/src/classes/features/other/PonyDetection.ts +2 -2
  77. package/src/classes/features/other/customStages/backdrop.ts +2 -2
  78. package/src/classes/features/other/customStages/streakText.ts +6 -4
  79. package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +2 -2
  80. package/src/core/constants.ts +7 -6
  81. package/src/enums/ModCallbackCustom.ts +32 -6
  82. package/src/functions/bitSet128.ts +1 -1
  83. package/src/functions/color.ts +1 -1
  84. package/src/functions/hex.ts +4 -2
  85. package/src/functions/input.ts +6 -6
  86. package/src/functions/isaacAPIClass.ts +1 -1
  87. package/src/functions/kColor.ts +1 -1
  88. package/src/functions/levelGrid.ts +3 -9
  89. package/src/functions/map.ts +2 -2
  90. package/src/functions/merge.ts +1 -1
  91. package/src/functions/minimap.ts +1 -1
  92. package/src/functions/rng.ts +1 -1
  93. package/src/functions/table.ts +1 -1
  94. package/src/functions/utils.ts +9 -15
  95. package/src/functions/vector.ts +1 -1
  96. package/src/interfaces/private/AddCallbackParametersCustom.ts +14 -0
  97. package/src/maps/characterNameToTypeMap.ts +86 -85
  98. package/src/objects/roomShapeBounds.ts +2 -2
  99. package/src/objects/roomShapeLayoutSizes.ts +4 -4
  100. package/src/objects/roomShapeToDoorSlotCoordinates.ts +1 -1
  101. package/src/patchErrorFunctions.ts +2 -2
  102. package/src/sets/bossSets.ts +5 -5
  103. package/src/sets/entitiesWithArmorSet.ts +1 -1
@@ -7,19 +7,19 @@ import {
7
7
  const ONE_BY_ONE_LAYOUT_SIZE: readonly [width: int, height: int] = [
8
8
  ONE_BY_ONE_CONTENTS_WIDTH,
9
9
  ONE_BY_ONE_CONTENTS_HEIGHT,
10
- ];
10
+ ] as const;
11
11
  const TWO_BY_ONE_VERTICAL_LAYOUT_SIZE: readonly [width: int, height: int] = [
12
12
  ONE_BY_ONE_CONTENTS_WIDTH,
13
13
  ONE_BY_ONE_CONTENTS_HEIGHT * 2,
14
- ];
14
+ ] as const;
15
15
  const TWO_BY_ONE_HORIZONTAL_LAYOUT_SIZE: readonly [width: int, height: int] = [
16
16
  ONE_BY_ONE_CONTENTS_WIDTH * 2,
17
17
  ONE_BY_ONE_CONTENTS_HEIGHT,
18
- ];
18
+ ] as const;
19
19
  const TWO_BY_TWO_LAYOUT_SIZE: readonly [width: int, height: int] = [
20
20
  ONE_BY_ONE_CONTENTS_WIDTH * 2,
21
21
  ONE_BY_ONE_CONTENTS_HEIGHT * 2,
22
- ];
22
+ ] as const;
23
23
 
24
24
  /**
25
25
  * The dimensions of a room shape's layout. This is NOT the size of the room's actual contents! For
@@ -8,7 +8,7 @@ import { DoorSlot, RoomShape } from "isaac-typescript-definitions";
8
8
  // We need the maps to be read-only, so we specify the type instead of using the `satisfies`
9
9
  // operator.
10
10
  export const ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES: {
11
- readonly [Key in RoomShape]: ReadonlyMap<DoorSlot, [x: int, y: int]>;
11
+ readonly [Key in RoomShape]: ReadonlyMap<DoorSlot, readonly [x: int, y: int]>;
12
12
  } = {
13
13
  // 1
14
14
  [RoomShape.SHAPE_1x1]: new Map([
@@ -11,14 +11,14 @@ const LINE_SEPARATOR = "\n";
11
11
  * These must be listed in order from how they appear in the traceback from top to bottom, or they
12
12
  * won't be properly removed.
13
13
  */
14
- const USELESS_TRACEBACK_MESSAGES: readonly string[] = [
14
+ const USELESS_TRACEBACK_MESSAGES = [
15
15
  // The second line of the traceback will always be the "getTraceback" function.
16
16
  "in upvalue 'getTraceback'",
17
17
  "in function 'sandbox.GetTraceback'",
18
18
 
19
19
  // The third line of the traceback will always be a line within the "errorWithTraceback" function.
20
20
  "in function 'error'",
21
- ];
21
+ ] as const;
22
22
 
23
23
  let vanillaError: ErrorFunction | undefined;
24
24
 
@@ -3,7 +3,7 @@ import {
3
3
  ChubVariant,
4
4
  DaddyLongLegsVariant,
5
5
  DingleVariant,
6
- DukeVariant,
6
+ DukeOfFliesVariant,
7
7
  EntityType,
8
8
  FallenVariant,
9
9
  FistulaVariant,
@@ -44,7 +44,7 @@ const BASEMENT_BOSSES_SET: ReadonlySet<string> = new Set([
44
44
  `${EntityType.LARRY_JR}.${LarryJrVariant.LARRY_JR}`, // 19.0
45
45
  `${EntityType.MONSTRO}.0`, // 20.0
46
46
  `${EntityType.FAMINE}.0`, // 63.0
47
- `${EntityType.DUKE}.${DukeVariant.DUKE_OF_FLIES}`, // 67.0
47
+ `${EntityType.DUKE_OF_FLIES}.${DukeOfFliesVariant.DUKE_OF_FLIES}`, // 67.0
48
48
  `${EntityType.GEMINI}.${GeminiVariant.GEMINI}`, // 79.0
49
49
  `${EntityType.GEMINI}.${GeminiVariant.STEVEN}`, // 79.1
50
50
  `${EntityType.FALLEN}.${FallenVariant.FALLEN}`, // 81.0
@@ -61,7 +61,7 @@ const BASEMENT_BOSSES_SET: ReadonlySet<string> = new Set([
61
61
  const CELLAR_BOSSES_SET: ReadonlySet<string> = new Set([
62
62
  `${EntityType.PIN}.${PinVariant.PIN}`, // 62.0
63
63
  `${EntityType.FAMINE}.0`, // 63.0
64
- `${EntityType.DUKE}.${DukeVariant.DUKE_OF_FLIES}`, // 67.0
64
+ `${EntityType.DUKE_OF_FLIES}.${DukeOfFliesVariant.DUKE_OF_FLIES}`, // 67.0
65
65
  `${EntityType.GEMINI}.${GeminiVariant.BLIGHTED_OVUM}`, // 79.2
66
66
  `${EntityType.FALLEN}.${FallenVariant.FALLEN}`, // 81.0
67
67
  `${EntityType.HEADLESS_HORSEMAN}.0`, // 82.0
@@ -77,7 +77,7 @@ const BURNING_BASEMENT_BOSSES_SET: ReadonlySet<string> = new Set([
77
77
  `${EntityType.LARRY_JR}.${LarryJrVariant.LARRY_JR}`, // 19.0
78
78
  `${EntityType.MONSTRO}.0`, // 20.0
79
79
  `${EntityType.FAMINE}.0`, // 63.0
80
- `${EntityType.DUKE}.${DukeVariant.DUKE_OF_FLIES}`, // 67.0
80
+ `${EntityType.DUKE_OF_FLIES}.${DukeOfFliesVariant.DUKE_OF_FLIES}`, // 67.0
81
81
  `${EntityType.GEMINI}.${GeminiVariant.GEMINI}`, // 79.0
82
82
  `${EntityType.GEMINI}.${GeminiVariant.STEVEN}`, // 79.1
83
83
  `${EntityType.FALLEN}.${FallenVariant.FALLEN}`, // 81.0
@@ -153,7 +153,7 @@ const CATACOMBS_BOSSES_SET: ReadonlySet<string> = new Set([
153
153
  `${EntityType.CHUB}.${ChubVariant.CARRION_QUEEN}`, // 28.2
154
154
  `${EntityType.PIN}.${PinVariant.FRAIL}`, // 62.2
155
155
  `${EntityType.PESTILENCE}.0`, // 64.0
156
- `${EntityType.DUKE}.${DukeVariant.THE_HUSK}`, // 67.1
156
+ `${EntityType.DUKE_OF_FLIES}.${DukeOfFliesVariant.THE_HUSK}`, // 67.1
157
157
  `${EntityType.PEEP}.${PeepVariant.PEEP}`, // 68.0
158
158
  `${EntityType.FALLEN}.${FallenVariant.FALLEN}`, // 81.0
159
159
  `${EntityType.HEADLESS_HORSEMAN}.0`, // 82.0
@@ -33,7 +33,7 @@ import {
33
33
  *
34
34
  * We use strings instead of a type + variant tuple so that we can have O(1) lookups.
35
35
  */
36
- export const ENTITIES_WITH_ARMOR_SET = new Set([
36
+ export const ENTITIES_WITH_ARMOR_SET: ReadonlySet<string> = new Set([
37
37
  `${EntityType.POOTER}.${PooterVariant.TAINTED_POOTER}`, // 14.2
38
38
  `${EntityType.HIVE}.${HiveVariant.TAINTED_MULLIGAN}`, // 22.3
39
39
  `${EntityType.BOOM_FLY}.${BoomFlyVariant.TAINTED_BOOM_FLY}`, // 25.6