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.
- package/dist/index.d.ts +24 -0
- package/dist/isaacscript-common.lua +4474 -4461
- package/dist/src/classes/features/other/CharacterHealthConversion.d.ts.map +1 -1
- package/dist/src/classes/features/other/CharacterStats.d.ts.map +1 -1
- package/dist/src/classes/features/other/CollectibleItemPoolType.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomHotkeys.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomPickups.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomStages.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/src/classes/features/other/DisableAllSound.d.ts.map +1 -1
- package/dist/src/classes/features/other/DisableInputs.d.ts.map +1 -1
- package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
- package/dist/src/classes/features/other/FadeInRemover.d.ts.map +1 -1
- package/dist/src/classes/features/other/FastReset.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/NoSirenSteal.d.ts.map +1 -1
- package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
- package/dist/src/classes/features/other/PersistentEntities.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts +7 -0
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.lua +26 -18
- package/dist/src/classes/features/other/PressInput.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventChildEntities.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventGridEntityRespawn.d.ts.map +1 -1
- package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.d.ts +14 -0
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.lua +4 -1
- package/dist/src/classes/features/other/TaintedLazarusPlayers.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayBomb.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayEffect.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayKnife.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayLaser.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayNPC.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPickup.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPlayer.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayProjectile.d.ts.map +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayTear.d.ts.map +1 -1
- package/dist/src/enums/ModCallbackCustom.d.ts +3 -0
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/features.d.ts.map +1 -1
- package/dist/src/features.lua +3 -2
- package/package.json +2 -2
- package/src/classes/features/other/CharacterHealthConversion.ts +2 -1
- package/src/classes/features/other/CharacterStats.ts +2 -1
- package/src/classes/features/other/CollectibleItemPoolType.ts +2 -1
- package/src/classes/features/other/CustomHotkeys.ts +2 -1
- package/src/classes/features/other/CustomPickups.ts +5 -2
- package/src/classes/features/other/CustomStages.ts +8 -3
- package/src/classes/features/other/CustomTrapdoors.ts +2 -1
- package/src/classes/features/other/DisableAllSound.ts +2 -1
- package/src/classes/features/other/DisableInputs.ts +11 -6
- package/src/classes/features/other/ExtraConsoleCommands.ts +26 -9
- package/src/classes/features/other/FadeInRemover.ts +2 -1
- package/src/classes/features/other/FastReset.ts +2 -1
- package/src/classes/features/other/ModdedElementDetection.ts +2 -1
- package/src/classes/features/other/NoSirenSteal.ts +2 -1
- package/src/classes/features/other/Pause.ts +5 -2
- package/src/classes/features/other/PersistentEntities.ts +2 -1
- package/src/classes/features/other/PickupIndexCreation.ts +35 -13
- package/src/classes/features/other/PressInput.ts +2 -1
- package/src/classes/features/other/PreventChildEntities.ts +2 -1
- package/src/classes/features/other/PreventCollectibleRotation.ts +5 -2
- package/src/classes/features/other/PreventGridEntityRespawn.ts +2 -1
- package/src/classes/features/other/RunInNFrames.ts +5 -2
- package/src/classes/features/other/SaveDataManager.ts +36 -8
- package/src/classes/features/other/TaintedLazarusPlayers.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayBomb.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayEffect.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayKnife.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayLaser.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayNPC.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPickup.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPlayer.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayProjectile.ts +2 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayTear.ts +2 -1
- package/src/enums/ModCallbackCustom.ts +3 -0
- package/src/features.ts +6 -2
|
@@ -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
|
-
],
|
|
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
|
-
],
|
|
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
|
-
],
|
|
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
|
-
|
|
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
|
-
],
|
|
39
|
+
],
|
|
40
|
+
|
|
41
|
+
// 8
|
|
37
42
|
[
|
|
38
43
|
ModCallback.EVALUATE_CACHE,
|
|
39
44
|
[this.evaluateCacheFireDelay, CacheFlag.FIRE_DELAY], // 1 << 1
|
|
40
|
-
],
|
|
45
|
+
],
|
|
46
|
+
|
|
47
|
+
// 8
|
|
41
48
|
[
|
|
42
49
|
ModCallback.EVALUATE_CACHE,
|
|
43
50
|
[this.evaluateCacheSpeed, CacheFlag.SPEED], // 1 << 4
|
|
44
|
-
],
|
|
51
|
+
],
|
|
52
|
+
|
|
53
|
+
// 8
|
|
45
54
|
[
|
|
46
55
|
ModCallback.EVALUATE_CACHE,
|
|
47
56
|
[this.evaluateCacheFlying, CacheFlag.FLYING], // 1 << 7
|
|
48
|
-
],
|
|
57
|
+
],
|
|
58
|
+
|
|
59
|
+
// 11
|
|
49
60
|
[
|
|
50
61
|
ModCallback.ENTITY_TAKE_DMG,
|
|
51
62
|
[this.entityTakeDmgPlayer, EntityType.PLAYER],
|
|
52
|
-
],
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
[ModCallback.
|
|
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)) {
|
|
@@ -46,11 +46,14 @@ export class Pause extends Feature {
|
|
|
46
46
|
super();
|
|
47
47
|
|
|
48
48
|
this.callbacksUsed = [
|
|
49
|
-
|
|
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
|
-
],
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
],
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
|
175
|
-
break;
|
|
198
|
+
return this.v.run.pickupDataTreasureRooms;
|
|
176
199
|
}
|
|
177
200
|
|
|
178
201
|
case RoomType.BOSS: {
|
|
179
|
-
this.v.run.pickupDataBossRooms
|
|
180
|
-
break;
|
|
202
|
+
return this.v.run.pickupDataBossRooms;
|
|
181
203
|
}
|
|
182
204
|
|
|
183
205
|
default: {
|
|
184
|
-
|
|
206
|
+
return undefined;
|
|
185
207
|
}
|
|
186
208
|
}
|
|
187
209
|
}
|
|
@@ -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
|
-
],
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
// 35
|
|
41
44
|
[
|
|
42
45
|
ModCallback.POST_PICKUP_UPDATE,
|
|
43
46
|
[this.postPickupUpdateCollectible, PickupVariant.COLLECTIBLE],
|
|
44
|
-
],
|
|
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
|
-
],
|
|
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
|
-
|
|
43
|
-
[ModCallback.
|
|
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
|
-
],
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
[ModCallback.
|
|
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
|
-
|
|
156
|
-
|
|
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
|
}
|
|
@@ -10,7 +10,8 @@ export class DebugDisplayProjectile extends Feature {
|
|
|
10
10
|
super();
|
|
11
11
|
|
|
12
12
|
this.callbacksUsed = [
|
|
13
|
-
|
|
13
|
+
// 45
|
|
14
|
+
[ModCallback.POST_PROJECTILE_RENDER, [this.postProjectileRender]],
|
|
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(
|
|
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]:
|
|
283
|
+
[ISCFeature.SAVE_DATA_MANAGER]: saveDataManager,
|
|
280
284
|
[ISCFeature.SPAWN_ALT_ROCK_REWARDS]: new SpawnRockAltRewards(
|
|
281
285
|
itemPoolDetection,
|
|
282
286
|
),
|