isaacscript-common 76.2.0 → 77.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 (144) hide show
  1. package/dist/classes/features/callbackLogic/CustomGridEntities.d.ts +8 -0
  2. package/dist/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
  3. package/dist/classes/features/callbackLogic/GameReorderedCallbacks.d.ts +6 -0
  4. package/dist/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  5. package/dist/classes/features/other/CharacterHealthConversion.d.ts +2 -0
  6. package/dist/classes/features/other/CharacterHealthConversion.d.ts.map +1 -1
  7. package/dist/classes/features/other/CharacterStats.d.ts +2 -0
  8. package/dist/classes/features/other/CharacterStats.d.ts.map +1 -1
  9. package/dist/classes/features/other/CollectibleItemPoolType.d.ts +2 -0
  10. package/dist/classes/features/other/CollectibleItemPoolType.d.ts.map +1 -1
  11. package/dist/classes/features/other/CustomHotkeys.d.ts +4 -0
  12. package/dist/classes/features/other/CustomHotkeys.d.ts.map +1 -1
  13. package/dist/classes/features/other/CustomItemPools.d.ts +2 -0
  14. package/dist/classes/features/other/CustomItemPools.d.ts.map +1 -1
  15. package/dist/classes/features/other/CustomPickups.d.ts +1 -0
  16. package/dist/classes/features/other/CustomPickups.d.ts.map +1 -1
  17. package/dist/classes/features/other/CustomStages.d.ts +3 -0
  18. package/dist/classes/features/other/CustomStages.d.ts.map +1 -1
  19. package/dist/classes/features/other/DebugDisplay.d.ts +54 -0
  20. package/dist/classes/features/other/DebugDisplay.d.ts.map +1 -1
  21. package/dist/classes/features/other/DeployJSONRoom.d.ts +1 -0
  22. package/dist/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
  23. package/dist/classes/features/other/DisableInputs.d.ts +9 -0
  24. package/dist/classes/features/other/DisableInputs.d.ts.map +1 -1
  25. package/dist/classes/features/other/EdenStartingStatsHealth.d.ts +6 -0
  26. package/dist/classes/features/other/EdenStartingStatsHealth.d.ts.map +1 -1
  27. package/dist/classes/features/other/ExtraConsoleCommands.d.ts +6 -0
  28. package/dist/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
  29. package/dist/classes/features/other/FadeInRemover.d.ts +4 -0
  30. package/dist/classes/features/other/FadeInRemover.d.ts.map +1 -1
  31. package/dist/classes/features/other/FastReset.d.ts +4 -0
  32. package/dist/classes/features/other/FastReset.d.ts.map +1 -1
  33. package/dist/classes/features/other/FlyingDetection.d.ts +2 -0
  34. package/dist/classes/features/other/FlyingDetection.d.ts.map +1 -1
  35. package/dist/classes/features/other/FlyingDetection.lua +2 -3
  36. package/dist/classes/features/other/ForgottenSwitch.d.ts +2 -0
  37. package/dist/classes/features/other/ForgottenSwitch.d.ts.map +1 -1
  38. package/dist/classes/features/other/ItemPoolDetection.d.ts +7 -1
  39. package/dist/classes/features/other/ItemPoolDetection.d.ts.map +1 -1
  40. package/dist/classes/features/other/ModdedElementDetection.d.ts +32 -0
  41. package/dist/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
  42. package/dist/classes/features/other/ModdedElementSets.d.ts +88 -20
  43. package/dist/classes/features/other/ModdedElementSets.d.ts.map +1 -1
  44. package/dist/classes/features/other/ModdedElementSets.lua +75 -86
  45. package/dist/classes/features/other/NoSirenSteal.d.ts +1 -0
  46. package/dist/classes/features/other/NoSirenSteal.d.ts.map +1 -1
  47. package/dist/classes/features/other/Pause.d.ts +10 -0
  48. package/dist/classes/features/other/Pause.d.ts.map +1 -1
  49. package/dist/classes/features/other/PersistentEntities.d.ts +2 -0
  50. package/dist/classes/features/other/PersistentEntities.d.ts.map +1 -1
  51. package/dist/classes/features/other/PlayerCollectibleTracking.d.ts +3 -0
  52. package/dist/classes/features/other/PlayerCollectibleTracking.d.ts.map +1 -1
  53. package/dist/classes/features/other/PonyDetection.d.ts +4 -0
  54. package/dist/classes/features/other/PonyDetection.d.ts.map +1 -1
  55. package/dist/classes/features/other/PreventChildEntities.d.ts +2 -0
  56. package/dist/classes/features/other/PreventChildEntities.d.ts.map +1 -1
  57. package/dist/classes/features/other/RoomClearFrame.d.ts +19 -0
  58. package/dist/classes/features/other/RoomClearFrame.d.ts.map +1 -1
  59. package/dist/classes/features/other/RoomClearFrame.lua +8 -2
  60. package/dist/classes/features/other/RoomHistory.d.ts +17 -1
  61. package/dist/classes/features/other/RoomHistory.d.ts.map +1 -1
  62. package/dist/classes/features/other/RunInNFrames.d.ts +9 -2
  63. package/dist/classes/features/other/RunInNFrames.d.ts.map +1 -1
  64. package/dist/classes/features/other/RunNextRun.d.ts +2 -0
  65. package/dist/classes/features/other/RunNextRun.d.ts.map +1 -1
  66. package/dist/classes/features/other/SaveDataManager.d.ts +21 -0
  67. package/dist/classes/features/other/SaveDataManager.d.ts.map +1 -1
  68. package/dist/classes/features/other/SpawnRockAltRewards.d.ts +1 -0
  69. package/dist/classes/features/other/SpawnRockAltRewards.d.ts.map +1 -1
  70. package/dist/classes/features/other/StageHistory.d.ts +3 -0
  71. package/dist/classes/features/other/StageHistory.d.ts.map +1 -1
  72. package/dist/classes/features/other/StartAmbush.d.ts +2 -0
  73. package/dist/classes/features/other/StartAmbush.d.ts.map +1 -1
  74. package/dist/classes/features/other/TaintedLazarusPlayers.d.ts +2 -0
  75. package/dist/classes/features/other/TaintedLazarusPlayers.d.ts.map +1 -1
  76. package/dist/classes/features/other/UnlockAchievementsDetection.d.ts +2 -0
  77. package/dist/classes/features/other/UnlockAchievementsDetection.d.ts.map +1 -1
  78. package/dist/classes/private/CustomCallback.d.ts +0 -1
  79. package/dist/classes/private/CustomCallback.d.ts.map +1 -1
  80. package/dist/classes/private/CustomCallback.lua +0 -19
  81. package/dist/functions/array.d.ts +3 -3
  82. package/dist/functions/array.d.ts.map +1 -1
  83. package/dist/functions/array.lua +34 -28
  84. package/dist/functions/cards.lua +3 -3
  85. package/dist/functions/collectibles.d.ts +2 -2
  86. package/dist/functions/collectibles.d.ts.map +1 -1
  87. package/dist/functions/collectibles.lua +4 -5
  88. package/dist/functions/pills.d.ts +3 -3
  89. package/dist/functions/pills.d.ts.map +1 -1
  90. package/dist/functions/playerTrinkets.d.ts +1 -1
  91. package/dist/functions/playerTrinkets.d.ts.map +1 -1
  92. package/dist/functions/players.d.ts.map +1 -1
  93. package/dist/functions/players.lua +7 -7
  94. package/dist/index.rollup.d.ts +354 -34
  95. package/dist/isaacscript-common.lua +490 -510
  96. package/dist/sets/{itemConfigCardTypesForCardsSet.d.ts → itemConfigCardTypesForCards.d.ts} +2 -2
  97. package/dist/sets/itemConfigCardTypesForCards.d.ts.map +1 -0
  98. package/dist/sets/{itemConfigCardTypesForCardsSet.lua → itemConfigCardTypesForCards.lua} +1 -1
  99. package/package.json +1 -1
  100. package/src/classes/features/callbackLogic/CustomGridEntities.ts +8 -0
  101. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +6 -0
  102. package/src/classes/features/other/CharacterHealthConversion.ts +2 -0
  103. package/src/classes/features/other/CharacterStats.ts +2 -0
  104. package/src/classes/features/other/CollectibleItemPoolType.ts +2 -0
  105. package/src/classes/features/other/CustomHotkeys.ts +4 -0
  106. package/src/classes/features/other/CustomItemPools.ts +2 -0
  107. package/src/classes/features/other/CustomPickups.ts +1 -0
  108. package/src/classes/features/other/CustomStages.ts +3 -0
  109. package/src/classes/features/other/DebugDisplay.ts +54 -0
  110. package/src/classes/features/other/DeployJSONRoom.ts +1 -0
  111. package/src/classes/features/other/DisableInputs.ts +9 -0
  112. package/src/classes/features/other/EdenStartingStatsHealth.ts +6 -0
  113. package/src/classes/features/other/ExtraConsoleCommands.ts +6 -0
  114. package/src/classes/features/other/FadeInRemover.ts +4 -0
  115. package/src/classes/features/other/FastReset.ts +4 -0
  116. package/src/classes/features/other/FlyingDetection.ts +2 -0
  117. package/src/classes/features/other/ForgottenSwitch.ts +2 -0
  118. package/src/classes/features/other/ItemPoolDetection.ts +7 -1
  119. package/src/classes/features/other/ModdedElementDetection.ts +32 -0
  120. package/src/classes/features/other/ModdedElementSets.ts +174 -121
  121. package/src/classes/features/other/NoSirenSteal.ts +1 -0
  122. package/src/classes/features/other/Pause.ts +10 -0
  123. package/src/classes/features/other/PersistentEntities.ts +2 -0
  124. package/src/classes/features/other/PlayerCollectibleTracking.ts +3 -0
  125. package/src/classes/features/other/PonyDetection.ts +4 -0
  126. package/src/classes/features/other/PreventChildEntities.ts +2 -0
  127. package/src/classes/features/other/RoomClearFrame.ts +27 -1
  128. package/src/classes/features/other/RoomHistory.ts +17 -1
  129. package/src/classes/features/other/RunInNFrames.ts +9 -2
  130. package/src/classes/features/other/RunNextRun.ts +2 -0
  131. package/src/classes/features/other/SaveDataManager.ts +21 -0
  132. package/src/classes/features/other/SpawnRockAltRewards.ts +1 -0
  133. package/src/classes/features/other/StageHistory.ts +3 -0
  134. package/src/classes/features/other/StartAmbush.ts +2 -0
  135. package/src/classes/features/other/TaintedLazarusPlayers.ts +2 -0
  136. package/src/classes/features/other/UnlockAchievementsDetection.ts +2 -0
  137. package/src/classes/private/CustomCallback.ts +0 -15
  138. package/src/functions/array.ts +12 -5
  139. package/src/functions/cards.ts +2 -2
  140. package/src/functions/collectibles.ts +7 -7
  141. package/src/functions/pills.ts +3 -3
  142. package/src/functions/playerTrinkets.ts +3 -1
  143. package/src/sets/{itemConfigCardTypesForCardsSet.ts → itemConfigCardTypesForCards.ts} +3 -1
  144. package/dist/sets/itemConfigCardTypesForCardsSet.d.ts.map +0 -1
@@ -87,6 +87,7 @@ export class NoSirenSteal extends Feature {
87
87
  * @param familiarVariant The familiar variant to blacklist.
88
88
  * @param familiarSubType The sub-type to blacklist. Optional. The default is to blacklist all
89
89
  * sub-types of the given variant.
90
+ * @public
90
91
  */
91
92
  @Exported
92
93
  public setFamiliarNoSirenSteal(
@@ -121,6 +121,12 @@ export class Pause extends Feature {
121
121
  return 1;
122
122
  };
123
123
 
124
+ /**
125
+ * Helper function to check if the pause feature from `isaacscript-common` is currently
126
+ * pseudo-pausing the game.
127
+ *
128
+ * @public
129
+ */
124
130
  @Exported
125
131
  public isPaused(): boolean {
126
132
  return v.run.isPseudoPaused;
@@ -136,6 +142,8 @@ export class Pause extends Feature {
136
142
  * `ButtonAction.CONSOLE`)
137
143
  *
138
144
  * In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`.
145
+ *
146
+ * @public
139
147
  */
140
148
  @Exported
141
149
  public pause(): void {
@@ -199,6 +207,8 @@ export class Pause extends Feature {
199
207
  * Helper function to put things back to normal after the `pause` function was used.
200
208
  *
201
209
  * In order to use this function, you must upgrade your mod with `ISCFeature.PAUSE`.
210
+ *
211
+ * @public
202
212
  */
203
213
  @Exported
204
214
  public unpause(): void {
@@ -160,6 +160,7 @@ export class PersistentEntities extends Feature {
160
160
  * @param removeEntity Optional. True by default. Set to false if you want to stop an entity from
161
161
  * being persistent but you don't want to actually remove the
162
162
  * currently-spawned entity from the room.
163
+ * @public
163
164
  */
164
165
  @Exported
165
166
  public removePersistentEntity(
@@ -199,6 +200,7 @@ export class PersistentEntities extends Feature {
199
200
  *
200
201
  * @returns An object containing the entity and the persistent entity index. You can use the index
201
202
  * with the `removePersistentEntity` function.
203
+ * @public
202
204
  */
203
205
  @Exported
204
206
  public spawnPersistentEntity(
@@ -86,6 +86,7 @@ export class PlayerCollectibleTracking extends Feature {
86
86
  * @param player The player to get the collectible types for.
87
87
  * @param includeActiveCollectibles Optional. If true, will include all active collectibles.
88
88
  * Default is true.
89
+ * @public
89
90
  */
90
91
  @Exported
91
92
  public getPlayerCollectibleTypes(
@@ -115,6 +116,8 @@ export class PlayerCollectibleTracking extends Feature {
115
116
  *
116
117
  * In order to use this function, you must upgrade your mod with
117
118
  * `ISCFeature.PLAYER_COLLECTIBLE_TRACKING`.
119
+ *
120
+ * @public
118
121
  */
119
122
  @Exported
120
123
  public getPlayerLastPassiveCollectibleType(
@@ -66,6 +66,8 @@ export class PonyDetection extends Feature {
66
66
  * Detecting this is difficult, as the temporary effect will disappear upon entering a new room.
67
67
  *
68
68
  * In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`.
69
+ *
70
+ * @public
69
71
  */
70
72
  @Exported
71
73
  public isPlayerUsingPony(player: EntityPlayer): boolean {
@@ -77,6 +79,8 @@ export class PonyDetection extends Feature {
77
79
  * Detecting this is difficult, as the temporary effect will disappear upon entering a new room.
78
80
  *
79
81
  * In order to use this function, you must upgrade your mod with `ISCFeature.PONY_DETECTION`.
82
+ *
83
+ * @public
80
84
  */
81
85
  @Exported
82
86
  public anyPlayerUsingPony(): boolean {
@@ -47,6 +47,8 @@ export class PreventChildEntities extends Feature {
47
47
  *
48
48
  * In order to use this function, you must upgrade your mod with
49
49
  * `ISCFeature.PREVENT_CHILD_ENTITIES`.
50
+ *
51
+ * @public
50
52
  */
51
53
  @Exported
52
54
  public preventChildEntities(entity: Entity): void {
@@ -6,6 +6,7 @@ import { Feature } from "../../private/Feature";
6
6
  const v = {
7
7
  room: {
8
8
  roomClearGameFrame: undefined as int | undefined,
9
+ roomClearRenderFrame: undefined as int | undefined,
9
10
  roomClearRoomFrame: undefined as int | undefined,
10
11
  },
11
12
  };
@@ -32,8 +33,10 @@ export class RoomClearFrame extends Feature {
32
33
  const gameFrameCount = game.GetFrameCount();
33
34
  const room = game.GetRoom();
34
35
  const roomFrameCount = room.GetFrameCount();
36
+ const renderFrameCount = Isaac.GetFrameCount();
35
37
 
36
38
  v.room.roomClearGameFrame = gameFrameCount;
39
+ v.room.roomClearRenderFrame = renderFrameCount;
37
40
  v.room.roomClearRoomFrame = roomFrameCount;
38
41
  };
39
42
 
@@ -41,21 +44,44 @@ export class RoomClearFrame extends Feature {
41
44
  * Helper function to get the game frame (i.e. `Game.GetFrameCount`) of the last time that this
42
45
  * room was cleared. Returns undefined if the room has never been cleared.
43
46
  *
47
+ * Note that if the room is left, all room clear tracking for it will be discarded.
48
+ *
44
49
  * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`.
50
+ *
51
+ * @public
45
52
  */
46
53
  @Exported
47
54
  public getRoomClearGameFrame(): int | undefined {
48
55
  return v.room.roomClearGameFrame;
49
56
  }
50
57
 
58
+ /**
59
+ * Helper function to get the render frame (i.e. `Isaac.GetFrameCount`) of the last time that this
60
+ * room was cleared. Returns undefined if the room has never been cleared.
61
+ *
62
+ * Note that if the room is left, all room clear tracking for it will be discarded.
63
+ *
64
+ * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`.
65
+ *
66
+ * @public
67
+ */
68
+ @Exported
69
+ public getRoomClearRenderFrame(): int | undefined {
70
+ return v.room.roomClearRenderFrame;
71
+ }
72
+
51
73
  /**
52
74
  * Helper function to get the room frame (i.e. `Room.GetFrameCount`) of the last time that this
53
75
  * room was cleared. Returns undefined if the room has never been cleared.
54
76
  *
77
+ * Note that if the room is left, all room clear tracking for it will be discarded.
78
+ *
55
79
  * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_CLEAR_FRAME`.
80
+ *
81
+ * @public
56
82
  */
57
83
  @Exported
58
84
  public getRoomClearRoomFrame(): int | undefined {
59
- return v.room.roomClearGameFrame;
85
+ return v.room.roomClearRoomFrame;
60
86
  }
61
87
  }
@@ -72,6 +72,8 @@ export class RoomHistory extends Feature {
72
72
  * Helper function to manually delete the last room description from the internal array. This is
73
73
  * useful if a mod needs to send the player to a room temporarily and the room should not count as
74
74
  * the player having traveled to that room.
75
+ *
76
+ * @public
75
77
  */
76
78
  @Exported
77
79
  public deleteLastRoomDescription(): void {
@@ -83,6 +85,8 @@ export class RoomHistory extends Feature {
83
85
  * run. (Re-entering the same room will increment the number returned.)
84
86
  *
85
87
  * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
88
+ *
89
+ * @public
86
90
  */
87
91
  @Exported
88
92
  public getNumRoomsEntered(): int {
@@ -94,6 +98,8 @@ export class RoomHistory extends Feature {
94
98
  * this run.
95
99
  *
96
100
  * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
101
+ *
102
+ * @public
97
103
  */
98
104
  @Exported
99
105
  public getRoomHistory(): ReadonlyArray<Readonly<RoomDescription>> {
@@ -107,6 +113,8 @@ export class RoomHistory extends Feature {
107
113
  * the run), the starting room will be returned.
108
114
  *
109
115
  * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
116
+ *
117
+ * @public
110
118
  */
111
119
  @Exported
112
120
  public getPreviousRoomDescription(): Readonly<RoomDescription> {
@@ -135,13 +143,19 @@ export class RoomHistory extends Feature {
135
143
  * of the run.
136
144
  *
137
145
  * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
146
+ *
147
+ * @public
138
148
  */
139
149
  @Exported
140
150
  public getLatestRoomDescription(): Readonly<RoomDescription> | undefined {
141
151
  return v.run.roomHistory.at(-1);
142
152
  }
143
153
 
144
- /** Helper function to detect if the player is on the first room of the room. */
154
+ /**
155
+ * Helper function to detect if the player is on the first room of the room.
156
+ *
157
+ * @public
158
+ */
145
159
  @Exported
146
160
  public inFirstRoom(): boolean {
147
161
  return v.run.roomHistory.length === 1;
@@ -157,6 +171,8 @@ export class RoomHistory extends Feature {
157
171
  * entity is despawning.
158
172
  *
159
173
  * In order to use this function, you must upgrade your mod with `ISCFeature.ROOM_HISTORY`.
174
+ *
175
+ * @public
160
176
  */
161
177
  @Exported
162
178
  public isLeavingRoom(): boolean {
@@ -100,9 +100,10 @@ export class RunInNFrames extends Feature {
100
100
  * the game inside of the `POST_NEW_ROOM`, `POST_NEW_LEVEL`, or `POST_GAME_STARTED` callbacks when
101
101
  * a run is first starting.
102
102
  *
103
- * You can optionally specify a `PlayerType` to restart the game as that character.
104
- *
105
103
  * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_IN_N_FRAMES`.
104
+ *
105
+ * @param character Optional. If specified, will restart the game as the specified character.
106
+ * @public
106
107
  */
107
108
  @Exported
108
109
  public restartNextRenderFrame(character?: PlayerType): void {
@@ -127,6 +128,7 @@ export class RunInNFrames extends Feature {
127
128
  * @param numGameFrames The amount of game frames to wait before running the function.
128
129
  * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is
129
130
  * loaded in the interim. Default is false.
131
+ * @public
130
132
  */
131
133
  @Exported
132
134
  public runInNGameFrames(
@@ -163,6 +165,7 @@ export class RunInNFrames extends Feature {
163
165
  * @param numRenderFrames The amount of render frames to wait before running the function.
164
166
  * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is
165
167
  * loaded in the interim. Default is false.
168
+ * @public
166
169
  */
167
170
  @Exported
168
171
  public runInNRenderFrames(
@@ -216,6 +219,7 @@ export class RunInNFrames extends Feature {
216
219
  * @param func The function to run.
217
220
  * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is
218
221
  * loaded in the interim. Default is false.
222
+ * @public
219
223
  */
220
224
  @Exported
221
225
  public runNextGameFrame(func: () => void, cancelIfRoomChanges = false): void {
@@ -235,6 +239,7 @@ export class RunInNFrames extends Feature {
235
239
  * @param func The function to run.
236
240
  * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is
237
241
  * loaded in the interim. Default is false.
242
+ * @public
238
243
  */
239
244
  @Exported
240
245
  public runNextRenderFrame(
@@ -263,6 +268,7 @@ export class RunInNFrames extends Feature {
263
268
  * interval.
264
269
  * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is
265
270
  * loaded in the interim. Default is false.
271
+ * @public
266
272
  */
267
273
  @Exported
268
274
  public setIntervalGameFrames(
@@ -310,6 +316,7 @@ export class RunInNFrames extends Feature {
310
316
  * interval.
311
317
  * @param cancelIfRoomChanges Optional. Whether to cancel running the function if a new room is
312
318
  * loaded in the interim. Default is false.
319
+ * @public
313
320
  */
314
321
  @Exported
315
322
  public setIntervalRenderFrames(
@@ -46,6 +46,8 @@ export class RunNextRun extends Feature {
46
46
  * deferred functions manually using serializable data.
47
47
  *
48
48
  * In order to use this function, you must upgrade your mod with `ISCFeature.RUN_NEXT_ROOM`.
49
+ *
50
+ * @public
49
51
  */
50
52
  @Exported
51
53
  public runNextRun(func: () => void): void {
@@ -314,6 +314,7 @@ export class SaveDataManager extends Feature {
314
314
  * specify `false` to this argument in order to completely disable saving
315
315
  * data. (Specifying `false` will allow you to use non-serializable objects
316
316
  * in your save data, such as `EntityPtr`.
317
+ * @public
317
318
  */
318
319
  // This is the overload for the standard case with serializable data.
319
320
  public saveDataManager<Persistent, Run, Level>(
@@ -414,6 +415,8 @@ export class SaveDataManager extends Feature {
414
415
  * result in lost state.
415
416
  *
416
417
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
418
+ *
419
+ * @public
417
420
  */
418
421
  @Exported
419
422
  public saveDataManagerLoad(): void {
@@ -426,6 +429,8 @@ export class SaveDataManager extends Feature {
426
429
  * all of its variables to disk immediately.
427
430
  *
428
431
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
432
+ *
433
+ * @public
429
434
  */
430
435
  @Exported
431
436
  public saveDataManagerSave(): void {
@@ -439,6 +444,8 @@ export class SaveDataManager extends Feature {
439
444
  * e.g. `l print(g.feature1.run.foo)`
440
445
  *
441
446
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
447
+ *
448
+ * @public
442
449
  */
443
450
  @Exported
444
451
  public saveDataManagerSetGlobal(): void {
@@ -456,6 +463,8 @@ export class SaveDataManager extends Feature {
456
463
  * This function is variadic, which means you can pass as many classes as you want to register.
457
464
  *
458
465
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
466
+ *
467
+ * @public
459
468
  */
460
469
  @Exported
461
470
  public saveDataManagerRegisterClass(...tstlClasses: AnyClass[]): void {
@@ -476,6 +485,8 @@ export class SaveDataManager extends Feature {
476
485
  * "saveDataManager" method.
477
486
  *
478
487
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
488
+ *
489
+ * @public
479
490
  */
480
491
  @Exported
481
492
  public saveDataManagerRemove(key: string): void {
@@ -519,6 +530,8 @@ export class SaveDataManager extends Feature {
519
530
  * ```
520
531
  *
521
532
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
533
+ *
534
+ * @public
522
535
  */
523
536
  @Exported
524
537
  public saveDataManagerReset(key: string, childObjectKey: SaveDataKey): void {
@@ -554,12 +567,20 @@ export class SaveDataManager extends Feature {
554
567
  * explicitly call the `saveDataManagerSave` function.
555
568
  *
556
569
  * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
570
+ *
571
+ * @public
557
572
  */
558
573
  @Exported
559
574
  public saveDataManagerInMenu(): boolean {
560
575
  return !this.inARun;
561
576
  }
562
577
 
578
+ /**
579
+ * Helper function to see all of the mod features that are using the save data manager. Useful for
580
+ * debugging if a certain mod feature is not getting its data saved correctly.
581
+ *
582
+ * @public
583
+ */
563
584
  @Exported
564
585
  public saveDataManagerLogSubscribers(): void {
565
586
  log("List of save data manager subscribers:");
@@ -103,6 +103,7 @@ export class SpawnRockAltRewards extends Feature {
103
103
  * `RNG.Next` method will be called. If `undefined` is provided, it will default
104
104
  * to a random seed.
105
105
  * @returns Whether this function spawned something.
106
+ * @public
106
107
  */
107
108
  @Exported
108
109
  public spawnRockAltReward(
@@ -55,6 +55,7 @@ export class StageHistory extends Feature {
55
55
  *
56
56
  * @param upwards Whether the player should go up to Cathedral in the case of being on Womb 2.
57
57
  * Default is false.
58
+ * @public
58
59
  */
59
60
  @Exported
60
61
  public getNextStageTypeWithHistory(upwards = false): StageType {
@@ -295,6 +296,8 @@ export class StageHistory extends Feature {
295
296
  * Helper function to get all of the stages that a player has visited thus far on this run.
296
297
  *
297
298
  * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
299
+ *
300
+ * @public
298
301
  */
299
302
  @Exported
300
303
  public getStageHistory(): readonly StageHistoryEntry[] {
@@ -31,6 +31,8 @@ export class StartAmbush extends Feature {
31
31
  * and then removing the sack and the pickups that the sack dropped.
32
32
  *
33
33
  * In order to use this function, you must upgrade your mod with `ISCFeature.START_AMBUSH`.
34
+ *
35
+ * @public
34
36
  */
35
37
  @Exported
36
38
  public startAmbush(): void {
@@ -110,6 +110,8 @@ export class TaintedLazarusPlayers extends Feature {
110
110
  *
111
111
  * In order to use this function, you must upgrade your mod with
112
112
  * `ISCFeature.CHARACTER_HEALTH_CONVERSION`.
113
+ *
114
+ * @public
113
115
  */
114
116
  @Exported
115
117
  public getTaintedLazarusSubPlayer(
@@ -48,6 +48,8 @@ export class UnlockAchievementsDetection extends Feature {
48
48
  *
49
49
  * In order to use this function, you must upgrade your mod with
50
50
  * `ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION`.
51
+ *
52
+ * @public
51
53
  */
52
54
  @Exported
53
55
  public canRunUnlockAchievements(): boolean {
@@ -1,8 +1,6 @@
1
1
  import type { CallbackPriority } from "isaac-typescript-definitions";
2
2
  import type { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
- import { log } from "../../functions/log";
4
3
  import { sortObjectArrayByKey, stableSort } from "../../functions/sort";
5
- import { getTSTLClassName } from "../../functions/tstlClass";
6
4
  import type { AddCallbackParametersCustom } from "../../interfaces/private/AddCallbackParametersCustom";
7
5
  import type { AllButFirst } from "../../types/AllButFirst";
8
6
  import type { AnyFunction } from "../../types/AnyFunction";
@@ -105,17 +103,4 @@ export abstract class CustomCallback<
105
103
  fireArgs: FireArgs<T>,
106
104
  optionalArgs: OptionalArgs<T>,
107
105
  ) => boolean = () => true;
108
-
109
- public logSubscriptions(): void {
110
- const tstlClassName = getTSTLClassName(this);
111
- log(`Logging subscriptions for custom callback: ${tstlClassName}`);
112
-
113
- if (this.subscriptions.length === 0) {
114
- log("- n/a (no subscriptions)");
115
- } else {
116
- for (const [i, subscription] of this.subscriptions.entries()) {
117
- log(`- ${i + 1} - priority: ${subscription.priority}`);
118
- }
119
- }
120
- }
121
106
  }
@@ -24,9 +24,9 @@ export function arrayEquals<T>(
24
24
  }
25
25
 
26
26
  /**
27
- * Shallow copies and removes the specified element(s) from the array. Returns the copied array. If
28
- * the specified element(s) are not found in the array, it will simply return a shallow copy of the
29
- * array.
27
+ * Builds a new array based on the original array without the specified element(s). Returns the new
28
+ * array. If the specified element(s) are not found in the array, it will simply return a shallow
29
+ * copy of the array.
30
30
  *
31
31
  * This function is variadic, meaning that you can specify N arguments to remove N elements.
32
32
  *
@@ -38,8 +38,15 @@ export function arrayRemove<T>(
38
38
  originalArray: T[] | readonly T[],
39
39
  ...elementsToRemove: T[]
40
40
  ): T[] {
41
- const array = copyArray(originalArray);
42
- arrayRemoveInPlace(array, ...elementsToRemove);
41
+ const elementsToRemoveSet = new ReadonlySet(elementsToRemove);
42
+
43
+ const array: T[] = [];
44
+ for (const element of originalArray) {
45
+ if (!elementsToRemoveSet.has(element)) {
46
+ array.push(element);
47
+ }
48
+ }
49
+
43
50
  return array;
44
51
  }
45
52
 
@@ -8,7 +8,7 @@ import {
8
8
  DEFAULT_CARD_DESCRIPTION,
9
9
  } from "../objects/cardDescriptions";
10
10
  import { CARD_NAMES, DEFAULT_CARD_NAME } from "../objects/cardNames";
11
- import { ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET } from "../sets/itemConfigCardTypesForCardsSet";
11
+ import { ITEM_CONFIG_CARD_TYPES_FOR_CARDS } from "../sets/itemConfigCardTypesForCards";
12
12
  import { addFlag } from "./flag";
13
13
 
14
14
  /**
@@ -112,7 +112,7 @@ export function isCard(cardType: CardType): boolean {
112
112
  return false;
113
113
  }
114
114
 
115
- return ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET.has(itemConfigCardType);
115
+ return ITEM_CONFIG_CARD_TYPES_FOR_CARDS.has(itemConfigCardType);
116
116
  }
117
117
 
118
118
  /** Returns whether the given card type matches the specified item config card type. */
@@ -47,21 +47,21 @@ const GLITCHED_ITEM_THRESHOLD = 4_000_000_000;
47
47
 
48
48
  const QUALITY_TO_VANILLA_COLLECTIBLE_TYPES_MAP: ReadonlyMap<
49
49
  Quality,
50
- ReadonlySet<CollectibleType>
50
+ CollectibleType[]
51
51
  > = (() => {
52
- const qualityToCollectibleTypesMap = new Map<Quality, Set<CollectibleType>>();
52
+ const qualityToCollectibleTypesMap = new Map<Quality, CollectibleType[]>();
53
53
 
54
54
  for (const quality of QUALITIES) {
55
- const collectibleTypesSet = new Set<CollectibleType>();
55
+ const collectibleTypes: CollectibleType[] = [];
56
56
 
57
57
  for (const collectibleType of VANILLA_COLLECTIBLE_TYPES) {
58
58
  const collectibleTypeQuality = getCollectibleQuality(collectibleType);
59
59
  if (collectibleTypeQuality === quality) {
60
- collectibleTypesSet.add(collectibleType);
60
+ collectibleTypes.push(collectibleType);
61
61
  }
62
62
  }
63
63
 
64
- qualityToCollectibleTypesMap.set(quality, collectibleTypesSet);
64
+ qualityToCollectibleTypesMap.set(quality, collectibleTypes);
65
65
  }
66
66
 
67
67
  return qualityToCollectibleTypesMap;
@@ -433,14 +433,14 @@ export function getCollectibleTags(
433
433
  }
434
434
 
435
435
  /**
436
- * Returns a set containing every vanilla collectible type with the given quality.
436
+ * Returns an array containing every vanilla collectible type with the given quality.
437
437
  *
438
438
  * Note that this function will only return vanilla collectible types. To handle modded collectible
439
439
  * types, use the `getCollectibleTypesOfQuality` helper function instead.
440
440
  */
441
441
  export function getVanillaCollectibleTypesOfQuality(
442
442
  quality: Quality,
443
- ): ReadonlySet<CollectibleType> {
443
+ ): readonly CollectibleType[] {
444
444
  const collectibleTypes =
445
445
  QUALITY_TO_VANILLA_COLLECTIBLE_TYPES_MAP.get(quality);
446
446
  assertDefined(
@@ -44,7 +44,7 @@ const HORSE_PILL_ADJUSTMENT = 2048;
44
44
  * Helper function to get an array with every non-null pill color. This includes all gold colors and
45
45
  * all horse colors.
46
46
  */
47
- export function getAllPillColors(): PillColor[] {
47
+ export function getAllPillColors(): readonly PillColor[] {
48
48
  return PILL_COLOR_VALUES.slice(1); // Remove `PillColor.NULL`
49
49
  }
50
50
 
@@ -68,7 +68,7 @@ export function getHorsePillColor(pillColor: PillColor): PillColor {
68
68
  }
69
69
 
70
70
  /** Helper function to get an array with every non-gold horse pill color. */
71
- export function getHorsePillColors(): PillColor[] {
71
+ export function getHorsePillColors(): readonly PillColor[] {
72
72
  return iRange(FIRST_HORSE_PILL_COLOR, LAST_HORSE_PILL_COLOR);
73
73
  }
74
74
 
@@ -88,7 +88,7 @@ export function getNormalPillColorFromHorse(pillColor: PillColor): PillColor {
88
88
  }
89
89
 
90
90
  /** Helper function to get an array with every non-gold and non-horse pill color. */
91
- export function getNormalPillColors(): PillColor[] {
91
+ export function getNormalPillColors(): readonly PillColor[] {
92
92
  return iRange(FIRST_PILL_COLOR, LAST_NORMAL_PILL_COLOR);
93
93
  }
94
94
 
@@ -76,7 +76,9 @@ export function getOpenTrinketSlot(player: EntityPlayer): int | undefined {
76
76
  * Helper function to get all of the trinkets that the player is currently holding. This will not
77
77
  * include any smelted trinkets.
78
78
  */
79
- export function getPlayerTrinkets(player: EntityPlayer): TrinketType[] {
79
+ export function getPlayerTrinkets(
80
+ player: EntityPlayer,
81
+ ): readonly TrinketType[] {
80
82
  const trinketTypes: TrinketType[] = [];
81
83
 
82
84
  for (const trinketSlot of TRINKET_SLOT_VALUES) {
@@ -2,10 +2,12 @@ import { ItemConfigCardType } from "isaac-typescript-definitions";
2
2
  import { ReadonlySet } from "../types/ReadonlySet";
3
3
 
4
4
  /** The set of all `ItemConfigCardType` values that are not a rune or special object. */
5
- export const ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET =
5
+ export const ITEM_CONFIG_CARD_TYPES_FOR_CARDS =
6
6
  new ReadonlySet<ItemConfigCardType>([
7
7
  ItemConfigCardType.TAROT, // 0
8
8
  ItemConfigCardType.SUIT, // 1
9
+ // - ItemConfigCardType.RUNE (2)
9
10
  ItemConfigCardType.SPECIAL, // 3
11
+ // - ItemConfigCardType.SPECIAL_OBJECT (4)
10
12
  ItemConfigCardType.TAROT_REVERSE, // 5
11
13
  ]);
@@ -1 +0,0 @@
1
- {"version":3,"file":"itemConfigCardTypesForCardsSet.d.ts","sourceRoot":"","sources":["../../src/sets/itemConfigCardTypesForCardsSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,wFAAwF;AACxF,eAAO,MAAM,oCAAoC,iCAM7C,CAAC"}