isaacscript-common 17.7.2 → 17.7.3

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 (81) hide show
  1. package/dist/index.d.ts +24 -0
  2. package/dist/isaacscript-common.lua +4474 -4461
  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/package.json +2 -2
  46. package/src/classes/features/other/CharacterHealthConversion.ts +2 -1
  47. package/src/classes/features/other/CharacterStats.ts +2 -1
  48. package/src/classes/features/other/CollectibleItemPoolType.ts +2 -1
  49. package/src/classes/features/other/CustomHotkeys.ts +2 -1
  50. package/src/classes/features/other/CustomPickups.ts +5 -2
  51. package/src/classes/features/other/CustomStages.ts +8 -3
  52. package/src/classes/features/other/CustomTrapdoors.ts +2 -1
  53. package/src/classes/features/other/DisableAllSound.ts +2 -1
  54. package/src/classes/features/other/DisableInputs.ts +11 -6
  55. package/src/classes/features/other/ExtraConsoleCommands.ts +26 -9
  56. package/src/classes/features/other/FadeInRemover.ts +2 -1
  57. package/src/classes/features/other/FastReset.ts +2 -1
  58. package/src/classes/features/other/ModdedElementDetection.ts +2 -1
  59. package/src/classes/features/other/NoSirenSteal.ts +2 -1
  60. package/src/classes/features/other/Pause.ts +5 -2
  61. package/src/classes/features/other/PersistentEntities.ts +2 -1
  62. package/src/classes/features/other/PickupIndexCreation.ts +35 -13
  63. package/src/classes/features/other/PressInput.ts +2 -1
  64. package/src/classes/features/other/PreventChildEntities.ts +2 -1
  65. package/src/classes/features/other/PreventCollectibleRotation.ts +5 -2
  66. package/src/classes/features/other/PreventGridEntityRespawn.ts +2 -1
  67. package/src/classes/features/other/RunInNFrames.ts +5 -2
  68. package/src/classes/features/other/SaveDataManager.ts +36 -8
  69. package/src/classes/features/other/TaintedLazarusPlayers.ts +2 -1
  70. package/src/classes/features/other/debugDisplay/DebugDisplayBomb.ts +2 -1
  71. package/src/classes/features/other/debugDisplay/DebugDisplayEffect.ts +2 -1
  72. package/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.ts +2 -1
  73. package/src/classes/features/other/debugDisplay/DebugDisplayKnife.ts +2 -1
  74. package/src/classes/features/other/debugDisplay/DebugDisplayLaser.ts +2 -1
  75. package/src/classes/features/other/debugDisplay/DebugDisplayNPC.ts +2 -1
  76. package/src/classes/features/other/debugDisplay/DebugDisplayPickup.ts +2 -1
  77. package/src/classes/features/other/debugDisplay/DebugDisplayPlayer.ts +2 -1
  78. package/src/classes/features/other/debugDisplay/DebugDisplayProjectile.ts +2 -1
  79. package/src/classes/features/other/debugDisplay/DebugDisplayTear.ts +2 -1
  80. package/src/enums/ModCallbackCustom.ts +3 -0
  81. package/src/features.ts +6 -2
@@ -19,7 +19,8 @@ export class DisableAllSound extends Feature {
19
19
  super();
20
20
 
21
21
  this.callbacksUsed = [
22
- [ModCallback.POST_RENDER, [this.postRender]], // 2
22
+ // 2
23
+ [ModCallback.POST_RENDER, [this.postRender]],
23
24
  ];
24
25
  }
25
26
 
@@ -40,18 +40,23 @@ export class DisableInputs extends Feature {
40
40
  super();
41
41
 
42
42
  this.callbacksUsed = [
43
+ // 13
43
44
  [
44
45
  ModCallback.INPUT_ACTION,
45
- [this.isActionPressed, InputHook.IS_ACTION_PRESSED],
46
- ], // 13
46
+ [this.isActionPressed, InputHook.IS_ACTION_PRESSED], // 0
47
+ ],
48
+
49
+ // 13
47
50
  [
48
51
  ModCallback.INPUT_ACTION,
49
- [this.isActionTriggered, InputHook.IS_ACTION_TRIGGERED],
50
- ], // 13
52
+ [this.isActionTriggered, InputHook.IS_ACTION_TRIGGERED], // 1
53
+ ],
54
+
55
+ // 13
51
56
  [
52
57
  ModCallback.INPUT_ACTION,
53
- [this.getActionValue, InputHook.GET_ACTION_VALUE],
54
- ], // 13
58
+ [this.getActionValue, InputHook.GET_ACTION_VALUE], // 2
59
+ ],
55
60
  ];
56
61
  }
57
62
 
@@ -29,30 +29,47 @@ export class ExtraConsoleCommands extends Feature {
29
29
  super();
30
30
 
31
31
  this.callbacksUsed = [
32
- [ModCallback.POST_UPDATE, [this.postUpdate]], // 1
32
+ // 1
33
+ [ModCallback.POST_UPDATE, [this.postUpdate]],
34
+
35
+ // 8
33
36
  [
34
37
  ModCallback.EVALUATE_CACHE,
35
38
  [this.evaluateCacheDamage, CacheFlag.DAMAGE], // 1 << 0
36
- ], // 8
39
+ ],
40
+
41
+ // 8
37
42
  [
38
43
  ModCallback.EVALUATE_CACHE,
39
44
  [this.evaluateCacheFireDelay, CacheFlag.FIRE_DELAY], // 1 << 1
40
- ], // 8
45
+ ],
46
+
47
+ // 8
41
48
  [
42
49
  ModCallback.EVALUATE_CACHE,
43
50
  [this.evaluateCacheSpeed, CacheFlag.SPEED], // 1 << 4
44
- ], // 8
51
+ ],
52
+
53
+ // 8
45
54
  [
46
55
  ModCallback.EVALUATE_CACHE,
47
56
  [this.evaluateCacheFlying, CacheFlag.FLYING], // 1 << 7
48
- ], // 8
57
+ ],
58
+
59
+ // 11
49
60
  [
50
61
  ModCallback.ENTITY_TAKE_DMG,
51
62
  [this.entityTakeDmgPlayer, EntityType.PLAYER],
52
- ], // 11
53
- [ModCallback.POST_CURSE_EVAL, [this.postCurseEval]], // 12
54
- [ModCallback.EXECUTE_CMD, [this.executeCmd]], // 22
55
- [ModCallback.POST_FIRE_TEAR, [this.postFireTear]], // 61
63
+ ],
64
+
65
+ // 12
66
+ [ModCallback.POST_CURSE_EVAL, [this.postCurseEval]],
67
+
68
+ // 22
69
+ [ModCallback.EXECUTE_CMD, [this.executeCmd]],
70
+
71
+ // 61
72
+ [ModCallback.POST_FIRE_TEAR, [this.postFireTear]],
56
73
  ];
57
74
 
58
75
  for (const [funcName, func] of Object.entries(commands)) {
@@ -13,7 +13,8 @@ export class FadeInRemover extends Feature {
13
13
  super();
14
14
 
15
15
  this.callbacksUsed = [
16
- [ModCallback.POST_GAME_STARTED, [this.postGameStarted]], // 15
16
+ // 15
17
+ [ModCallback.POST_GAME_STARTED, [this.postGameStarted]],
17
18
  ];
18
19
  }
19
20
 
@@ -19,7 +19,8 @@ export class FastReset extends Feature {
19
19
  super();
20
20
 
21
21
  this.callbacksUsed = [
22
- [ModCallback.POST_RENDER, [this.postRender]], // 2
22
+ // 2
23
+ [ModCallback.POST_RENDER, [this.postRender]],
23
24
  ];
24
25
  }
25
26
 
@@ -48,7 +48,8 @@ export class ModdedElementDetection extends Feature {
48
48
  super();
49
49
 
50
50
  this.callbacksUsed = [
51
- [ModCallback.POST_PLAYER_INIT, [this.postPlayerInit]], // 9
51
+ // 9
52
+ [ModCallback.POST_PLAYER_INIT, [this.postPlayerInit]],
52
53
  ];
53
54
  }
54
55
 
@@ -21,10 +21,11 @@ export class NoSirenSteal extends Feature {
21
21
  super();
22
22
 
23
23
  this.callbacksUsed = [
24
+ // 27
24
25
  [
25
26
  ModCallback.POST_NPC_INIT,
26
27
  [this.postNPCInitSirenHelper, EntityType.SIREN_HELPER],
27
- ], // 27
28
+ ],
28
29
  ];
29
30
  }
30
31
 
@@ -46,11 +46,14 @@ export class Pause extends Feature {
46
46
  super();
47
47
 
48
48
  this.callbacksUsed = [
49
- [ModCallback.POST_UPDATE, [this.postUpdate]], // 1
49
+ // 1
50
+ [ModCallback.POST_UPDATE, [this.postUpdate]],
51
+
52
+ // 13
50
53
  [
51
54
  ModCallback.INPUT_ACTION,
52
55
  [this.inputActionGetActionValue, InputHook.GET_ACTION_VALUE],
53
- ], // 13
56
+ ],
54
57
  ];
55
58
 
56
59
  this.disableInputs = disableInputs;
@@ -55,7 +55,8 @@ export class PersistentEntities extends Feature {
55
55
  this.featuresUsed = [ISCFeature.ROOM_HISTORY];
56
56
 
57
57
  this.callbacksUsed = [
58
- [ModCallback.POST_ENTITY_REMOVE, [this.postEntityRemove]], // 67
58
+ // 67
59
+ [ModCallback.POST_ENTITY_REMOVE, [this.postEntityRemove]],
59
60
  ];
60
61
 
61
62
  this.customCallbacksUsed = [
@@ -14,6 +14,7 @@ import { PickupIndex } from "../../../types/PickupIndex";
14
14
  import { DefaultMap } from "../../DefaultMap";
15
15
  import { Feature } from "../../private/Feature";
16
16
  import { RoomHistory } from "./RoomHistory";
17
+ import { SaveDataManager } from "./SaveDataManager";
17
18
 
18
19
  interface PickupDescription {
19
20
  position: Vector;
@@ -24,6 +25,7 @@ export class PickupIndexCreation extends Feature {
24
25
  /** @internal */
25
26
  public override v = {
26
27
  run: {
28
+ /** Is incremented before assignment. Thus, the first pickup will have an index of 1. */
27
29
  pickupCounter: 0 as PickupIndex,
28
30
 
29
31
  pickupDataTreasureRooms: new Map<PickupIndex, PickupDescription>(),
@@ -43,22 +45,27 @@ export class PickupIndexCreation extends Feature {
43
45
  };
44
46
 
45
47
  private roomHistory: RoomHistory;
48
+ private saveDataManager: SaveDataManager;
46
49
 
47
50
  /** @internal */
48
- constructor(roomHistory: RoomHistory) {
51
+ constructor(roomHistory: RoomHistory, saveDataManager: SaveDataManager) {
49
52
  super();
50
53
 
51
- this.featuresUsed = [ISCFeature.ROOM_HISTORY];
54
+ this.featuresUsed = [ISCFeature.ROOM_HISTORY, ISCFeature.SAVE_DATA_MANAGER];
52
55
 
53
56
  this.callbacksUsed = [
54
- [ModCallback.POST_PICKUP_INIT, [this.postPickupInit]], // 34
57
+ // 34
58
+ [ModCallback.POST_PICKUP_INIT, [this.postPickupInit]],
59
+
60
+ // 67
55
61
  [
56
62
  ModCallback.POST_ENTITY_REMOVE,
57
63
  [this.postEntityRemovePickup, EntityType.PICKUP],
58
- ], // 67
64
+ ],
59
65
  ];
60
66
 
61
67
  this.roomHistory = roomHistory;
68
+ this.saveDataManager = saveDataManager;
62
69
  }
63
70
 
64
71
  // ModCallback.POST_PICKUP_INIT (34)
@@ -159,11 +166,28 @@ export class PickupIndexCreation extends Feature {
159
166
  };
160
167
  pickupDescriptions.set(pickupIndex, pickupDescription);
161
168
 
162
- // If the despawning pickup was in a Treasure Room or Boss Room, then it is possible that the
163
- // pickup could re-appear during The Ascent. If this is the case, we store the metadata on a
164
- // separate map to reference later.
169
+ const pickupDataMapForCurrentRoom = this.getPickupDataMapForCurrentRoom();
170
+ if (pickupDataMapForCurrentRoom !== undefined) {
171
+ pickupDataMapForCurrentRoom.set(pickupIndex, pickupDescription);
172
+ }
173
+
174
+ // Since the `POST_ENTITY_REMOVE` callback fires after the `PRE_GAME_EXIT` callback, we need to
175
+ // explicitly save data again if the player is in the process of saving and quitting the run.
176
+ if (this.saveDataManager.saveDataManagerInMenu()) {
177
+ this.saveDataManager.saveDataManagerSave();
178
+ }
179
+ }
180
+
181
+ /**
182
+ * If the despawning pickup was in a Treasure Room or Boss Room, then it is possible that the
183
+ * pickup could re-appear during The Ascent. If this is the case, we store the metadata on a
184
+ * separate map to reference later.
185
+ */
186
+ private getPickupDataMapForCurrentRoom():
187
+ | Map<PickupIndex, PickupDescription>
188
+ | undefined {
165
189
  if (onAscent()) {
166
- return;
190
+ return undefined;
167
191
  }
168
192
 
169
193
  const room = game.GetRoom();
@@ -171,17 +195,15 @@ export class PickupIndexCreation extends Feature {
171
195
 
172
196
  switch (roomType) {
173
197
  case RoomType.TREASURE: {
174
- this.v.run.pickupDataTreasureRooms.set(pickupIndex, pickupDescription);
175
- break;
198
+ return this.v.run.pickupDataTreasureRooms;
176
199
  }
177
200
 
178
201
  case RoomType.BOSS: {
179
- this.v.run.pickupDataBossRooms.set(pickupIndex, pickupDescription);
180
- break;
202
+ return this.v.run.pickupDataBossRooms;
181
203
  }
182
204
 
183
205
  default: {
184
- break;
206
+ return undefined;
185
207
  }
186
208
  }
187
209
  }
@@ -21,10 +21,11 @@ export class PressInput extends Feature {
21
21
  super();
22
22
 
23
23
  this.callbacksUsed = [
24
+ // 13
24
25
  [
25
26
  ModCallback.INPUT_ACTION,
26
27
  [this.isActionTriggered, InputHook.IS_ACTION_TRIGGERED],
27
- ], // 13
28
+ ],
28
29
  ];
29
30
  }
30
31
 
@@ -15,7 +15,8 @@ export class PreventChildEntities extends Feature {
15
15
  super();
16
16
 
17
17
  this.callbacksUsed = [
18
- [ModCallback.POST_NPC_INIT, [this.postNPCInit]], // 27
18
+ // 27
19
+ [ModCallback.POST_NPC_INIT, [this.postNPCInit]],
19
20
  ];
20
21
  }
21
22
 
@@ -34,14 +34,17 @@ export class PreventCollectibleRotation extends Feature {
34
34
  super();
35
35
 
36
36
  this.callbacksUsed = [
37
+ // 5
37
38
  [
38
39
  ModCallback.POST_USE_CARD,
39
40
  [this.useCardSoulOfIsaac, CardType.SOUL_ISAAC],
40
- ], // 5
41
+ ],
42
+
43
+ // 35
41
44
  [
42
45
  ModCallback.POST_PICKUP_UPDATE,
43
46
  [this.postPickupUpdateCollectible, PickupVariant.COLLECTIBLE],
44
- ], // 35
47
+ ],
45
48
  ];
46
49
  }
47
50
 
@@ -46,10 +46,11 @@ export class PreventGridEntityRespawn extends Feature {
46
46
  this.featuresUsed = [ISCFeature.RUN_IN_N_FRAMES];
47
47
 
48
48
  this.callbacksUsed = [
49
+ // 23
49
50
  [
50
51
  ModCallback.PRE_USE_ITEM,
51
52
  [this.preUseItemWeNeedToGoDeeper, CollectibleType.WE_NEED_TO_GO_DEEPER],
52
- ], // 23
53
+ ],
53
54
  ];
54
55
 
55
56
  this.customCallbacksUsed = [
@@ -39,8 +39,11 @@ export class RunInNFrames extends Feature {
39
39
  super();
40
40
 
41
41
  this.callbacksUsed = [
42
- [ModCallback.POST_UPDATE, [this.postUpdate]], // 1
43
- [ModCallback.POST_RENDER, [this.postRender]], // 2
42
+ // 1
43
+ [ModCallback.POST_UPDATE, [this.postUpdate]],
44
+
45
+ // 2
46
+ [ModCallback.POST_RENDER, [this.postRender]],
44
47
  ];
45
48
  }
46
49
 
@@ -87,13 +87,20 @@ export class SaveDataManager extends Feature {
87
87
  super();
88
88
 
89
89
  this.callbacksUsed = [
90
+ // 3
90
91
  [
91
92
  ModCallback.POST_USE_ITEM,
92
93
  [this.postUseItemGlowingHourGlass, CollectibleType.GLOWING_HOUR_GLASS],
93
- ], // 3
94
- [ModCallback.POST_PLAYER_INIT, [this.postPlayerInit]], // 9
95
- [ModCallback.PRE_GAME_EXIT, [this.preGameExit]], // 17
96
- [ModCallback.POST_NEW_LEVEL, [this.postNewLevel]], // 18
94
+ ],
95
+
96
+ // 9
97
+ [ModCallback.POST_PLAYER_INIT, [this.postPlayerInit]],
98
+
99
+ // 17
100
+ [ModCallback.PRE_GAME_EXIT, [this.preGameExit]],
101
+
102
+ // 18
103
+ [ModCallback.POST_NEW_LEVEL, [this.postNewLevel]],
97
104
  ];
98
105
 
99
106
  this.customCallbacksUsed = [
@@ -152,11 +159,14 @@ export class SaveDataManager extends Feature {
152
159
  // persistent variables should be recorded).
153
160
  saveToDisk(this.mod, this.saveDataMap, this.saveDataConditionalFuncMap);
154
161
 
155
- restoreDefaultsForAllFeaturesAndKeys(
156
- this.saveDataMap,
157
- this.saveDataDefaultsMap,
158
- );
162
+ // Mark that we are going to the menu. (Technically, the `POST_ENTITY_REMOVE` callback may fire
163
+ // before actually going to the menu, but that must be explicitly handled.)
159
164
  this.loadedDataOnThisRun = false;
165
+
166
+ // At this point, we could blow away the existing save data or restore defaults, but it is not
167
+ // necessary since we will have to do it again in the `POST_PLAYER_INIT` callback. Furthermore,
168
+ // the `POST_ENTITY_REMOVE` callback may fire after the `PRE_GAME_EXIT` callback, so wiping data
169
+ // now could result in bugs for features that depend on that (e.g. `PickupIndexCreation`).
160
170
  };
161
171
 
162
172
  // ModCallback.POST_NEW_LEVEL (18)
@@ -514,4 +524,22 @@ export class SaveDataManager extends Feature {
514
524
  childObjectKey,
515
525
  );
516
526
  }
527
+
528
+ /**
529
+ * Helper function to check to see if the game is in the menu, as far as the save data manager is
530
+ * concerned. This function will return true when the game is first opened until the
531
+ * `POST_PLAYER_INIT` callback fires. It will also return true in between the `PRE_GAME_EXIT`
532
+ * callback firing and the `POST_PLAYER_INIT` callback firing.
533
+ *
534
+ * This function is useful because the `POST_ENTITY_REMOVE` callback fires after the
535
+ * `PRE_GAME_EXIT` callback. Thus, if save data needs to be updated from the `POST_ENTITY_REMOVE`
536
+ * callback and the player is in the process of saving and quitting, the feature will have to
537
+ * explicitly call the `saveDataManagerSave` function.
538
+ *
539
+ * In order to use this function, you must upgrade your mod with `ISCFeature.SAVE_DATA_MANAGER`.
540
+ */
541
+ @Exported
542
+ public saveDataManagerInMenu(): boolean {
543
+ return !this.loadedDataOnThisRun;
544
+ }
517
545
  }
@@ -39,7 +39,8 @@ export class TaintedLazarusPlayers extends Feature {
39
39
  super();
40
40
 
41
41
  this.callbacksUsed = [
42
- [ModCallback.POST_PLAYER_INIT, [this.postPlayerInit]], // 9
42
+ // 9
43
+ [ModCallback.POST_PLAYER_INIT, [this.postPlayerInit]],
43
44
  ];
44
45
  }
45
46
 
@@ -10,7 +10,8 @@ export class DebugDisplayBomb extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_BOMB_RENDER, [this.postBombRender]], // 59
13
+ // 59
14
+ [ModCallback.POST_BOMB_RENDER, [this.postBombRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayEffect extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_EFFECT_RENDER, [this.postEffectRender]], // 56
13
+ // 56
14
+ [ModCallback.POST_EFFECT_RENDER, [this.postEffectRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayFamiliar extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_FAMILIAR_RENDER, [this.postFamiliarRender]], // 25
13
+ // 25
14
+ [ModCallback.POST_FAMILIAR_RENDER, [this.postFamiliarRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayKnife extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_KNIFE_RENDER, [this.postKnifeRender]], // 52
13
+ // 52
14
+ [ModCallback.POST_KNIFE_RENDER, [this.postKnifeRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayLaser extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_LASER_RENDER, [this.postLaserRender]], // 49
13
+ // 49
14
+ [ModCallback.POST_LASER_RENDER, [this.postLaserRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayNPC extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_NPC_RENDER, [this.postNPCRender]], // 28
13
+ // 28
14
+ [ModCallback.POST_NPC_RENDER, [this.postNPCRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayPickup extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_PICKUP_RENDER, [this.postPickupRender]], // 36
13
+ // 36
14
+ [ModCallback.POST_PICKUP_RENDER, [this.postPickupRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayPlayer extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_PLAYER_RENDER, [this.postPlayerRender]], // 32
13
+ // 32
14
+ [ModCallback.POST_PLAYER_RENDER, [this.postPlayerRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayProjectile extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_PROJECTILE_RENDER, [this.postProjectileRender]], // 45
13
+ // 45
14
+ [ModCallback.POST_PROJECTILE_RENDER, [this.postProjectileRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -10,7 +10,8 @@ export class DebugDisplayTear extends Feature {
10
10
  super();
11
11
 
12
12
  this.callbacksUsed = [
13
- [ModCallback.POST_TEAR_RENDER, [this.postTearRender]], // 41
13
+ // 41
14
+ [ModCallback.POST_TEAR_RENDER, [this.postTearRender]],
14
15
  ];
15
16
  }
16
17
 
@@ -954,6 +954,9 @@ export enum ModCallbackCustom {
954
954
  *
955
955
  * Use this callback to know when a pickup is added to the player's inventory or health.
956
956
  *
957
+ * Note that this will not fire when the player takes a collectible; use either the
958
+ * `POST_PLAYER_COLLECTIBLE_ADDED` or the `PRE_ITEM_PICKUP` callback for that.
959
+ *
957
960
  * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
958
961
  * - You can provide an optional third argument that will make the callback only fire if it
959
962
  * matches the `PickupVariant` provided.
package/src/features.ts CHANGED
@@ -144,13 +144,17 @@ export function getFeatures(
144
144
  const roomHistory = new RoomHistory();
145
145
  const runInNFrames = new RunInNFrames();
146
146
  const runNextRoom = new RunNextRoom();
147
+ const saveDataManager = new SaveDataManager(mod);
147
148
  const stageHistory = new StageHistory();
148
149
 
149
150
  const customGridEntities = new CustomGridEntities(runInNFrames);
150
151
  const moddedElementSets = new ModdedElementSets(moddedElementDetection);
151
152
  const itemPoolDetection = new ItemPoolDetection(moddedElementSets);
152
153
  const pause = new Pause(disableInputs);
153
- const pickupIndexCreation = new PickupIndexCreation(roomHistory);
154
+ const pickupIndexCreation = new PickupIndexCreation(
155
+ roomHistory,
156
+ saveDataManager,
157
+ );
154
158
  const preventGridEntityRespawn = new PreventGridEntityRespawn(runInNFrames);
155
159
  const spawnCollectible = new SpawnCollectible(preventCollectibleRotation);
156
160
 
@@ -276,7 +280,7 @@ export function getFeatures(
276
280
  [ISCFeature.ROOM_HISTORY]: roomHistory,
277
281
  [ISCFeature.RUN_IN_N_FRAMES]: runInNFrames,
278
282
  [ISCFeature.RUN_NEXT_ROOM]: runNextRoom,
279
- [ISCFeature.SAVE_DATA_MANAGER]: new SaveDataManager(mod),
283
+ [ISCFeature.SAVE_DATA_MANAGER]: saveDataManager,
280
284
  [ISCFeature.SPAWN_ALT_ROCK_REWARDS]: new SpawnRockAltRewards(
281
285
  itemPoolDetection,
282
286
  ),