isaacscript-common 13.3.4 → 14.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.
- package/dist/index.d.ts +576 -401
- package/dist/isaacscript-common.lua +14654 -13908
- package/dist/src/callbacks/postAmbush.d.ts.map +1 -1
- package/dist/src/callbacks/postAmbush.lua +7 -12
- package/dist/src/callbacks/postBombExploded.lua +3 -3
- package/dist/src/callbacks/postRoomClearChanged.d.ts.map +1 -1
- package/dist/src/callbacks/postRoomClearChanged.lua +3 -5
- package/dist/src/callbacks/subscriptions/{postBoneExploded.d.ts → postBombExploded.d.ts} +1 -1
- package/dist/src/callbacks/subscriptions/{postBoneExploded.d.ts.map → postBombExploded.d.ts.map} +1 -1
- package/dist/src/callbacks/subscriptions/{postBoneExploded.lua → postBombExploded.lua} +0 -0
- package/dist/src/callbacks/subscriptions/postCollectibleEmpty.d.ts +1 -1
- package/dist/src/callbacks/subscriptions/postCollectibleEmpty.d.ts.map +1 -1
- package/dist/src/callbacks/subscriptions/postCollectibleInitFirst.d.ts +1 -1
- package/dist/src/callbacks/subscriptions/postCollectibleInitFirst.d.ts.map +1 -1
- package/dist/src/callbacks/subscriptions/postCursedTeleport.d.ts +4 -2
- package/dist/src/callbacks/subscriptions/postCursedTeleport.d.ts.map +1 -1
- package/dist/src/callbacks/subscriptions/postCursedTeleport.lua +13 -1
- package/dist/src/callbacks/subscriptions/postHolyMantleRemoved.d.ts.map +1 -1
- package/dist/src/callbacks/subscriptions/postHolyMantleRemoved.lua +2 -2
- package/dist/src/callbacks/subscriptions/postPEffectUpdateReordered.d.ts.map +1 -1
- package/dist/src/callbacks/subscriptions/postPEffectUpdateReordered.lua +2 -2
- package/dist/src/classes/ModUpgraded.d.ts +9 -5
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/src/classes/ModUpgraded.lua +101 -14
- package/dist/src/classes/callbacks/PostAmbushFinished.d.ts +12 -0
- package/dist/src/classes/callbacks/PostAmbushFinished.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostAmbushFinished.lua +37 -0
- package/dist/src/classes/callbacks/PostAmbushStarted.d.ts +12 -0
- package/dist/src/classes/callbacks/PostAmbushStarted.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostAmbushStarted.lua +37 -0
- package/dist/src/classes/callbacks/PostBombExploded.d.ts +7 -0
- package/dist/src/classes/callbacks/PostBombExploded.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostBombExploded.lua +24 -0
- package/dist/src/classes/callbacks/PostBombInitLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostBombInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostBombInitLate.lua +27 -0
- package/dist/src/classes/callbacks/PostBoneSwing.d.ts +15 -0
- package/dist/src/classes/callbacks/PostBoneSwing.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostBoneSwing.lua +43 -0
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts +17 -0
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostCollectibleEmpty.lua +47 -0
- package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts +13 -0
- package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostCollectibleInitFirst.lua +32 -0
- package/dist/src/classes/callbacks/PostCursedTeleport.d.ts +21 -0
- package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostCursedTeleport.lua +113 -0
- package/dist/src/classes/callbacks/PostKnifeInitLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostKnifeInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostKnifeInitLate.lua +27 -0
- package/dist/src/classes/callbacks/PostNewRoomEarly.d.ts +14 -0
- package/dist/src/classes/callbacks/PostNewRoomEarly.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostNewRoomEarly.lua +65 -0
- package/dist/src/classes/callbacks/PostPitRender.d.ts +7 -0
- package/dist/src/classes/callbacks/PostPitRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPitRender.lua +24 -0
- package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts +13 -0
- package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostRoomClearChanged.lua +33 -0
- package/dist/src/classes/callbacks/PostSpikesRender.d.ts +7 -0
- package/dist/src/classes/callbacks/PostSpikesRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSpikesRender.lua +24 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.lua +19 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackBomb.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackBomb.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackBomb.lua +19 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.lua +19 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackKnife.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackKnife.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackKnife.lua +19 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPit.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPit.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPit.lua +20 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.lua +23 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.lua +20 -0
- package/dist/src/classes/private/CustomCallback.d.ts +32 -0
- package/dist/src/classes/private/CustomCallback.d.ts.map +1 -0
- package/dist/src/classes/private/CustomCallback.lua +53 -0
- package/dist/src/core/upgradeMod.d.ts.map +1 -1
- package/dist/src/core/upgradeMod.lua +16 -0
- package/dist/src/enums/IsaacScriptCommonFeature.d.ts +35 -0
- package/dist/src/enums/IsaacScriptCommonFeature.d.ts.map +1 -0
- package/dist/src/enums/IsaacScriptCommonFeature.lua +35 -0
- package/dist/src/enums/LadderSubTypeCustom.d.ts +17 -0
- package/dist/src/enums/LadderSubTypeCustom.d.ts.map +1 -0
- package/dist/src/enums/LadderSubTypeCustom.lua +19 -0
- package/dist/src/enums/ModCallbackCustom.d.ts +399 -327
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/enums/ModCallbackCustom.lua +85 -87
- package/dist/src/enums/ModCallbackCustom2.d.ts +17 -0
- package/dist/src/enums/ModCallbackCustom2.d.ts.map +1 -0
- package/dist/src/enums/ModCallbackCustom2.lua +30 -0
- package/dist/src/features/{setHotkey.d.ts → customHotkeys.d.ts} +1 -1
- package/dist/src/features/customHotkeys.d.ts.map +1 -0
- package/dist/src/features/{setHotkey.lua → customHotkeys.lua} +2 -2
- package/dist/src/features/customPickup.d.ts.map +1 -1
- package/dist/src/features/customPickup.lua +6 -2
- package/dist/src/features/customStage/backdrop.d.ts.map +1 -1
- package/dist/src/features/customStage/backdrop.lua +3 -1
- package/dist/src/features/customStage/shadows.d.ts.map +1 -1
- package/dist/src/features/customStage/shadows.lua +3 -1
- package/dist/src/features/customTrapdoor/init.lua +1 -7
- package/dist/src/features/firstLast.d.ts.map +1 -1
- package/dist/src/features/firstLast.lua +3 -3
- package/dist/src/features/saveDataManager/main.d.ts +5 -2
- package/dist/src/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/main.lua +3 -5
- package/dist/src/functions/ambush.d.ts +6 -0
- package/dist/src/functions/ambush.d.ts.map +1 -1
- package/dist/src/functions/ambush.lua +31 -0
- package/dist/src/functions/minimap.d.ts +4 -0
- package/dist/src/functions/minimap.d.ts.map +1 -1
- package/dist/src/functions/minimap.lua +4 -0
- package/dist/src/functions/roomTransition.d.ts +3 -4
- package/dist/src/functions/roomTransition.d.ts.map +1 -1
- package/dist/src/functions/roomTransition.lua +4 -32
- package/dist/src/functions/spawnCollectible.d.ts +24 -5
- package/dist/src/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/src/functions/spawnCollectible.lua +44 -4
- package/dist/src/functions/utils.d.ts +7 -2
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +7 -2
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +26 -10
- package/dist/src/initCustomCallbacks.d.ts.map +1 -1
- package/dist/src/initCustomCallbacks.lua +0 -3
- package/dist/src/initFeatures.lua +3 -3
- package/dist/src/interfaces/private/{AddCallbackParameterCustom.d.ts → AddCallbackParametersCustom.d.ts} +3 -5
- package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -0
- package/dist/src/interfaces/private/{AddCallbackParameterCustom.lua → AddCallbackParametersCustom.lua} +0 -0
- package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts +55 -0
- package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts.map +1 -0
- package/dist/src/interfaces/private/AddCallbackParametersCustom2.lua +4 -0
- package/dist/src/objects/callbackRegisterFunctions.d.ts +1 -1
- package/dist/src/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/src/objects/callbackRegisterFunctions.lua +2 -5
- package/dist/src/types/private/AllButFirst.d.ts +5 -0
- package/dist/src/types/private/AllButFirst.d.ts.map +1 -0
- package/dist/src/types/private/AllButFirst.lua +2 -0
- package/dist/src/types/private/CallbackTuple.d.ts +20 -0
- package/dist/src/types/private/CallbackTuple.d.ts.map +1 -0
- package/dist/src/types/private/CallbackTuple.lua +2 -0
- package/dist/src/types/private/MatchingCallbackCustom.d.ts +14 -0
- package/dist/src/types/private/MatchingCallbackCustom.d.ts.map +1 -0
- package/dist/src/types/private/MatchingCallbackCustom.lua +2 -0
- package/package.json +2 -2
- package/src/callbacks/postAmbush.ts +7 -14
- package/src/callbacks/postBombExploded.ts +1 -1
- package/src/callbacks/postBoneSwing.ts +2 -1
- package/src/callbacks/postCollectibleEmpty.ts +2 -0
- package/src/callbacks/postCollectibleInitFirst.ts +2 -0
- package/src/callbacks/postNewRoomEarly.ts +1 -1
- package/src/callbacks/postRoomClearChanged.ts +3 -7
- package/src/callbacks/subscriptions/{postBoneExploded.ts → postBombExploded.ts} +0 -0
- package/src/callbacks/subscriptions/postCollectibleEmpty.ts +1 -1
- package/src/callbacks/subscriptions/postCollectibleInitFirst.ts +1 -1
- package/src/callbacks/subscriptions/postCursedTeleport.ts +24 -1
- package/src/callbacks/subscriptions/postHolyMantleRemoved.ts +9 -2
- package/src/callbacks/subscriptions/postPEffectUpdateReordered.ts +9 -2
- package/src/classes/ModUpgraded.ts +118 -27
- package/src/classes/callbacks/PostAmbushFinished.ts +39 -0
- package/src/classes/callbacks/PostAmbushStarted.ts +39 -0
- package/src/classes/callbacks/PostBombExploded.ts +21 -0
- package/src/classes/callbacks/PostBombInitLate.ts +28 -0
- package/src/classes/callbacks/PostBoneSwing.ts +58 -0
- package/src/classes/callbacks/PostCollectibleEmpty.ts +72 -0
- package/src/classes/callbacks/PostCollectibleInitFirst.ts +37 -0
- package/src/classes/callbacks/PostCursedTeleport.ts +183 -0
- package/src/classes/callbacks/PostKnifeInitLate.ts +28 -0
- package/src/classes/callbacks/PostNewRoomEarly.ts +93 -0
- package/src/classes/callbacks/PostPitRender.ts +21 -0
- package/src/classes/callbacks/PostRoomClearChanged.ts +40 -0
- package/src/classes/callbacks/PostSpikesRender.ts +21 -0
- package/src/classes/callbacks/validation/CustomCallbackAmbush.ts +28 -0
- package/src/classes/callbacks/validation/CustomCallbackBomb.ts +27 -0
- package/src/classes/callbacks/validation/CustomCallbackCollectible.ts +30 -0
- package/src/classes/callbacks/validation/CustomCallbackKnife.ts +27 -0
- package/src/classes/callbacks/validation/CustomCallbackPit.ts +28 -0
- package/src/classes/callbacks/validation/CustomCallbackPlayer.ts +37 -0
- package/src/classes/callbacks/validation/CustomCallbackSpikes.ts +28 -0
- package/src/classes/private/CustomCallback.ts +79 -0
- package/src/core/upgradeMod.ts +16 -2
- package/src/enums/IsaacScriptCommonFeature.ts +34 -0
- package/src/enums/LadderSubTypeCustom.ts +17 -0
- package/src/enums/ModCallbackCustom.ts +314 -243
- package/src/enums/ModCallbackCustom2.ts +17 -0
- package/src/features/{setHotkey.ts → customHotkeys.ts} +2 -2
- package/src/features/customPickup.ts +4 -2
- package/src/features/customStage/backdrop.ts +2 -1
- package/src/features/customStage/shadows.ts +2 -1
- package/src/features/customTrapdoor/init.ts +0 -1
- package/src/features/firstLast.ts +3 -7
- package/src/features/saveDataManager/main.ts +32 -21
- package/src/functions/ambush.ts +26 -1
- package/src/functions/minimap.ts +4 -0
- package/src/functions/roomTransition.ts +3 -27
- package/src/functions/spawnCollectible.ts +44 -4
- package/src/functions/utils.ts +7 -2
- package/src/index.ts +4 -2
- package/src/initCustomCallbacks.ts +1 -2
- package/src/initFeatures.ts +2 -2
- package/src/interfaces/private/{AddCallbackParameterCustom.ts → AddCallbackParametersCustom.ts} +2 -24
- package/src/interfaces/private/AddCallbackParametersCustom2.ts +79 -0
- package/src/objects/callbackRegisterFunctions.ts +2 -4
- package/src/types/private/AllButFirst.ts +6 -0
- package/src/types/private/CallbackTuple.ts +21 -0
- package/src/types/private/MatchingCallbackCustom.ts +26 -0
- package/dist/src/callbacks/postCustomDoorEnter.d.ts +0 -6
- package/dist/src/callbacks/postCustomDoorEnter.d.ts.map +0 -1
- package/dist/src/callbacks/postCustomDoorEnter.lua +0 -199
- package/dist/src/callbacks/subscriptions/postCustomDoorEnter.d.ts +0 -9
- package/dist/src/callbacks/subscriptions/postCustomDoorEnter.d.ts.map +0 -1
- package/dist/src/callbacks/subscriptions/postCustomDoorEnter.lua +0 -29
- package/dist/src/classes/CustomCallback.d.ts +0 -8
- package/dist/src/classes/CustomCallback.d.ts.map +0 -1
- package/dist/src/classes/CustomCallback.lua +0 -28
- package/dist/src/features/customDoor.d.ts +0 -51
- package/dist/src/features/customDoor.d.ts.map +0 -1
- package/dist/src/features/customDoor.lua +0 -53
- package/dist/src/features/setHotkey.d.ts.map +0 -1
- package/dist/src/interfaces/private/AddCallbackParameterCustom.d.ts.map +0 -1
- package/src/callbacks/postCustomDoorEnter.ts +0 -250
- package/src/callbacks/subscriptions/postCustomDoorEnter.ts +0 -42
- package/src/classes/CustomCallback.ts +0 -23
- package/src/features/customDoor.ts +0 -66
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** TODO */
|
|
2
|
+
export enum ModCallbackCustom2 {
|
|
3
|
+
POST_AMBUSH_FINISHED,
|
|
4
|
+
POST_AMBUSH_STARTED,
|
|
5
|
+
POST_BOMB_EXPLODED,
|
|
6
|
+
POST_BOMB_INIT_LATE,
|
|
7
|
+
POST_BONE_SWING,
|
|
8
|
+
POST_COLLECTIBLE_EMPTY,
|
|
9
|
+
POST_COLLECTIBLE_INIT_FIRST,
|
|
10
|
+
POST_CURSED_TELEPORT,
|
|
11
|
+
|
|
12
|
+
POST_KNIFE_INIT_LATE,
|
|
13
|
+
POST_NEW_ROOM_EARLY,
|
|
14
|
+
POST_PIT_RENDER,
|
|
15
|
+
POST_ROOM_CLEAR_CHANGED,
|
|
16
|
+
POST_SPIKES_RENDER,
|
|
17
|
+
}
|
|
@@ -3,7 +3,7 @@ import { DefaultMap } from "../classes/DefaultMap";
|
|
|
3
3
|
import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
|
|
4
4
|
import { isKeyboardPressed } from "../functions/input";
|
|
5
5
|
|
|
6
|
-
const FEATURE_NAME = "
|
|
6
|
+
const FEATURE_NAME = "customHotkeys";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The keys are the keyboard keys that trigger the hotkey. The values are the functions that contain
|
|
@@ -23,7 +23,7 @@ const dynamicHotkeyFunctionMap = new Map<
|
|
|
23
23
|
const keyPressedMap = new DefaultMap<Keyboard, boolean>(false);
|
|
24
24
|
|
|
25
25
|
/** @internal */
|
|
26
|
-
export function
|
|
26
|
+
export function customHotkeysInit(mod: Mod): void {
|
|
27
27
|
mod.AddCallback(ModCallback.POST_RENDER, postRender); // 2
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -4,12 +4,14 @@ import {
|
|
|
4
4
|
ModCallback,
|
|
5
5
|
PickupVariant,
|
|
6
6
|
} from "isaac-typescript-definitions";
|
|
7
|
+
import { LadderSubTypeCustom } from "../enums/LadderSubTypeCustom";
|
|
7
8
|
import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
|
|
8
9
|
import {
|
|
9
10
|
getEntityID,
|
|
10
11
|
getEntityIDFromConstituents,
|
|
11
12
|
} from "../functions/entities";
|
|
12
13
|
import { spawnEffect } from "../functions/entitiesSpecific";
|
|
14
|
+
import { asNumber } from "../functions/types";
|
|
13
15
|
|
|
14
16
|
const FEATURE_NAME = "customPickup";
|
|
15
17
|
|
|
@@ -27,7 +29,7 @@ interface CustomPickupFunctions {
|
|
|
27
29
|
* time passes, like most other effects.
|
|
28
30
|
*/
|
|
29
31
|
const PICKUP_EFFECT_VARIANT = EffectVariant.LADDER;
|
|
30
|
-
const PICKUP_EFFECT_SUB_TYPE =
|
|
32
|
+
const PICKUP_EFFECT_SUB_TYPE = LadderSubTypeCustom.CUSTOM_PICKUP;
|
|
31
33
|
|
|
32
34
|
/** Indexed by entity ID. */
|
|
33
35
|
const customPickupFunctionsMap = new Map<string, CustomPickupFunctions>();
|
|
@@ -85,7 +87,7 @@ function prePickupCollision(
|
|
|
85
87
|
// ModCallback.POST_EFFECT_RENDER (56)
|
|
86
88
|
// PICKUP_EFFECT_VARIANT
|
|
87
89
|
function postEffectRenderPickupEffect(effect: EntityEffect) {
|
|
88
|
-
if (effect.SubType !== PICKUP_EFFECT_SUB_TYPE) {
|
|
90
|
+
if (effect.SubType !== asNumber(PICKUP_EFFECT_SUB_TYPE)) {
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
93
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "isaac-typescript-definitions";
|
|
11
11
|
import { game } from "../../core/cachedClasses";
|
|
12
12
|
import { VectorZero } from "../../core/constants";
|
|
13
|
+
import { LadderSubTypeCustom } from "../../enums/LadderSubTypeCustom";
|
|
13
14
|
import { getRandomArrayElement } from "../../functions/array";
|
|
14
15
|
import { spawnEffectWithSeed } from "../../functions/entitiesSpecific";
|
|
15
16
|
import { newRNG } from "../../functions/rng";
|
|
@@ -83,7 +84,7 @@ const N_FLOOR_ANM2_LAYERS: readonly int[] = [18, 19];
|
|
|
83
84
|
* time passes, like most other effects.
|
|
84
85
|
*/
|
|
85
86
|
const BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER;
|
|
86
|
-
const BACKDROP_EFFECT_SUB_TYPE =
|
|
87
|
+
const BACKDROP_EFFECT_SUB_TYPE = LadderSubTypeCustom.CUSTOM_BACKDROP;
|
|
87
88
|
|
|
88
89
|
const BACKDROP_ROOM_TYPE_SET: ReadonlySet<RoomType> = new Set([
|
|
89
90
|
RoomType.DEFAULT,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EffectVariant, RoomShape } from "isaac-typescript-definitions";
|
|
2
2
|
import { game } from "../../core/cachedClasses";
|
|
3
|
+
import { LadderSubTypeCustom } from "../../enums/LadderSubTypeCustom";
|
|
3
4
|
import { getRandomArrayElement } from "../../functions/array";
|
|
4
5
|
import { spawnEffectWithSeed } from "../../functions/entitiesSpecific";
|
|
5
6
|
import { removeCharactersBefore } from "../../functions/string";
|
|
@@ -18,7 +19,7 @@ type ShadowAnimation = "1x1" | "1x2" | "2x1" | "2x2";
|
|
|
18
19
|
* time passes, like most other effects.
|
|
19
20
|
*/
|
|
20
21
|
const SHADOW_EFFECT_VARIANT = EffectVariant.LADDER;
|
|
21
|
-
const SHADOW_EFFECT_SUB_TYPE =
|
|
22
|
+
const SHADOW_EFFECT_SUB_TYPE = LadderSubTypeCustom.CUSTOM_SHADOW;
|
|
22
23
|
|
|
23
24
|
/** The animation comes from StageAPI. */
|
|
24
25
|
const ROOM_SHAPE_TO_SHADOW_ANIMATION: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CardType,
|
|
3
3
|
CollectibleType,
|
|
4
|
+
ModCallback,
|
|
4
5
|
PillEffect,
|
|
5
6
|
TrinketType,
|
|
6
7
|
} from "isaac-typescript-definitions";
|
|
7
|
-
import { ModUpgraded } from "../classes/ModUpgraded";
|
|
8
8
|
import { itemConfig } from "../core/cachedClasses";
|
|
9
9
|
import {
|
|
10
10
|
FIRST_CARD_TYPE,
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
NUM_VANILLA_PILL_EFFECTS,
|
|
20
20
|
NUM_VANILLA_TRINKET_TYPES,
|
|
21
21
|
} from "../core/constantsFirstLast";
|
|
22
|
-
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
23
22
|
import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
|
|
24
23
|
import {
|
|
25
24
|
asCardType,
|
|
@@ -35,11 +34,8 @@ const FEATURE_NAME = "firstLast";
|
|
|
35
34
|
let atLeastOneCallbackFired = false;
|
|
36
35
|
|
|
37
36
|
/** @internal */
|
|
38
|
-
export function firstLastInit(mod:
|
|
39
|
-
mod.
|
|
40
|
-
ModCallbackCustom.POST_NEW_ROOM_EARLY,
|
|
41
|
-
postNewRoomEarly,
|
|
42
|
-
);
|
|
37
|
+
export function firstLastInit(mod: Mod): void {
|
|
38
|
+
mod.AddCallback(ModCallback.POST_NEW_ROOM, postNewRoomEarly);
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
// ModCallbackCustom.POST_NEW_ROOM_EARLY
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CollectibleType, ModCallback } from "isaac-typescript-definitions";
|
|
2
|
-
import { ModUpgraded } from "../../classes/ModUpgraded";
|
|
3
2
|
import { game } from "../../core/cachedClasses";
|
|
4
3
|
import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
|
|
5
4
|
import { SaveDataKey } from "../../enums/SaveDataKey";
|
|
@@ -9,6 +8,10 @@ import { logError } from "../../functions/logMisc";
|
|
|
9
8
|
import { onFirstFloor } from "../../functions/stage";
|
|
10
9
|
import { clearTable, iterateTableInOrder } from "../../functions/table";
|
|
11
10
|
import { SaveData } from "../../interfaces/SaveData";
|
|
11
|
+
import {
|
|
12
|
+
CallbackTuple,
|
|
13
|
+
CustomCallbackTuple,
|
|
14
|
+
} from "../../types/private/CallbackTuple";
|
|
12
15
|
import {
|
|
13
16
|
SAVE_DATA_MANAGER_DEBUG,
|
|
14
17
|
SAVE_DATA_MANAGER_FEATURE_NAME,
|
|
@@ -31,36 +34,38 @@ const RESETTABLE_SAVE_DATA_KEYS: ReadonlySet<SaveDataKey> = new Set([
|
|
|
31
34
|
SaveDataKey.ROOM,
|
|
32
35
|
]);
|
|
33
36
|
|
|
34
|
-
let mod:
|
|
37
|
+
let mod: Mod | null = null;
|
|
35
38
|
let loadedDataOnThisRun = false;
|
|
36
39
|
let restoreGlowingHourGlassDataOnNextRoom = false;
|
|
37
40
|
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
mod.AddCallback(
|
|
41
|
+
export const SAVE_DATA_MANAGER_CALLBACKS: CallbackTuple[] = [
|
|
42
|
+
[
|
|
42
43
|
ModCallback.POST_USE_ITEM,
|
|
43
|
-
postUseItemGlowingHourGlass,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
[postUseItemGlowingHourGlass, CollectibleType.GLOWING_HOUR_GLASS],
|
|
45
|
+
], // 3
|
|
46
|
+
[ModCallback.POST_PLAYER_INIT, [postPlayerInit]], // 9
|
|
47
|
+
[ModCallback.PRE_GAME_EXIT, [preGameExit]], // 17
|
|
48
|
+
[ModCallback.POST_NEW_LEVEL, [postNewLevel]], // 18
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
export const SAVE_DATA_MANAGER_CUSTOM_CALLBACKS: CustomCallbackTuple[] = [
|
|
52
|
+
[ModCallbackCustom.POST_NEW_ROOM_EARLY, [postNewRoomEarly]],
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
export function saveDataManagerInit(incomingMod: Mod): void {
|
|
56
|
+
mod = incomingMod;
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
// ModCallback.POST_USE_ITEM (3)
|
|
56
60
|
// CollectibleType.GLOWING_HOUR_GLASS (422)
|
|
57
|
-
function postUseItemGlowingHourGlass() {
|
|
61
|
+
function postUseItemGlowingHourGlass(): boolean | undefined {
|
|
58
62
|
restoreGlowingHourGlassDataOnNextRoom = true;
|
|
59
63
|
return undefined;
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
// ModCallback.POST_PLAYER_INIT (9)
|
|
63
|
-
|
|
67
|
+
// eslint-disable-next-line isaacscript/no-void-return-type
|
|
68
|
+
function postPlayerInit(): void {
|
|
64
69
|
if (mod === null) {
|
|
65
70
|
error(
|
|
66
71
|
`The mod for the ${SAVE_DATA_MANAGER_FEATURE_NAME} was not initialized.`,
|
|
@@ -74,6 +79,9 @@ function postPlayerInit() {
|
|
|
74
79
|
}
|
|
75
80
|
loadedDataOnThisRun = true;
|
|
76
81
|
|
|
82
|
+
// Handle the race-condition of using the Glowing Hour Glass and then resetting the run.
|
|
83
|
+
restoreGlowingHourGlassDataOnNextRoom = false;
|
|
84
|
+
|
|
77
85
|
// We want to unconditionally load save data on every new run since there might be persistent data
|
|
78
86
|
// that is not tied to an individual run.
|
|
79
87
|
loadFromDisk(mod, saveDataMap);
|
|
@@ -89,7 +97,8 @@ function postPlayerInit() {
|
|
|
89
97
|
}
|
|
90
98
|
|
|
91
99
|
// ModCallback.PRE_GAME_EXIT (17)
|
|
92
|
-
|
|
100
|
+
// eslint-disable-next-line isaacscript/no-void-return-type
|
|
101
|
+
function preGameExit(): void {
|
|
93
102
|
if (mod === null) {
|
|
94
103
|
error(
|
|
95
104
|
`The mod for the ${SAVE_DATA_MANAGER_FEATURE_NAME} was not initialized.`,
|
|
@@ -105,7 +114,8 @@ function preGameExit() {
|
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
// ModCallback.POST_NEW_LEVEL (18)
|
|
108
|
-
|
|
117
|
+
// eslint-disable-next-line isaacscript/no-void-return-type
|
|
118
|
+
function postNewLevel(): void {
|
|
109
119
|
if (mod === null) {
|
|
110
120
|
error(
|
|
111
121
|
`The mod for the ${SAVE_DATA_MANAGER_FEATURE_NAME} was not initialized.`,
|
|
@@ -122,7 +132,8 @@ function postNewLevel() {
|
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
// ModCallbackCustom.POST_NEW_ROOM_EARLY
|
|
125
|
-
|
|
135
|
+
// eslint-disable-next-line isaacscript/no-void-return-type
|
|
136
|
+
function postNewRoomEarly(): void {
|
|
126
137
|
restoreDefaults(SaveDataKey.ROOM);
|
|
127
138
|
|
|
128
139
|
// Handle the Glowing Hour Glass.
|
package/src/functions/ambush.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { SackSubType } from "isaac-typescript-definitions";
|
|
1
|
+
import { RoomType, SackSubType } from "isaac-typescript-definitions";
|
|
2
|
+
import { game } from "../core/cachedClasses";
|
|
3
|
+
import { AmbushType } from "../enums/AmbushType";
|
|
2
4
|
import { runNextGameFrame } from "../features/runInNFrames";
|
|
3
5
|
import { removeEntities } from "./entities";
|
|
4
6
|
import { getCoins, spawnSackWithSeed } from "./pickupsSpecific";
|
|
@@ -6,6 +8,29 @@ import { getCoins, spawnSackWithSeed } from "./pickupsSpecific";
|
|
|
6
8
|
/** Hard-coding this makes it easier to clean up the pickups afterwards. */
|
|
7
9
|
const SACK_SEED_THAT_SPAWNS_TWO_COINS = 6 as Seed;
|
|
8
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Helper function to get the corresponding ambush type for the current room. Returns undefined if
|
|
13
|
+
* the current room does not correspond to any particular ambush type.
|
|
14
|
+
*/
|
|
15
|
+
export function getAmbushType(): AmbushType | undefined {
|
|
16
|
+
const room = game.GetRoom();
|
|
17
|
+
const roomType = room.GetType();
|
|
18
|
+
|
|
19
|
+
switch (roomType) {
|
|
20
|
+
case RoomType.BOSS_RUSH: {
|
|
21
|
+
return AmbushType.BOSS_RUSH;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
case RoomType.CHALLENGE: {
|
|
25
|
+
return AmbushType.CHALLENGE_ROOM;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
default: {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
9
34
|
/**
|
|
10
35
|
* Helper function to start a Challenge Room or the Boss Rush.
|
|
11
36
|
*
|
package/src/functions/minimap.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { getRoomsInsideGrid } from "./rooms";
|
|
|
8
8
|
* Helper function to add a `DisplayFlag` to a particular room's minimap display flags (e.g. whether
|
|
9
9
|
* or not it is visible and so on).
|
|
10
10
|
*
|
|
11
|
+
* This function automatically accounts for whether or not MinimapAPI is being used.
|
|
12
|
+
*
|
|
11
13
|
* @param roomGridIndex Set to undefined to use the current room index.
|
|
12
14
|
* @param displayFlag The `DisplayFlag` to set. (See the `DisplayFlag` enum.)
|
|
13
15
|
* @param updateVisibility Optional. Whether to call the `Level.UpdateVisibility` method in order to
|
|
@@ -97,6 +99,8 @@ export function getRoomDisplayFlags(
|
|
|
97
99
|
* This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
|
|
98
100
|
* the changes will be immediately visible.
|
|
99
101
|
*
|
|
102
|
+
* This function automatically accounts for whether or not MinimapAPI is being used.
|
|
103
|
+
*
|
|
100
104
|
* @param displayFlagsMap A map of the display flags that is indexed by the room's safe grid index.
|
|
101
105
|
*/
|
|
102
106
|
export function setDisplayFlags(
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Direction,
|
|
3
3
|
DoorSlot,
|
|
4
|
-
LevelCurse,
|
|
5
4
|
RoomTransitionAnim,
|
|
6
5
|
} from "isaac-typescript-definitions";
|
|
7
6
|
import { game } from "../core/cachedClasses";
|
|
8
|
-
import { runNextRoom } from "../features/runNextRoom";
|
|
9
|
-
import { hasCurse } from "./curses";
|
|
10
7
|
import { getRoomData, getRoomGridIndex } from "./roomData";
|
|
11
8
|
|
|
12
9
|
/**
|
|
@@ -17,12 +14,7 @@ import { getRoomData, getRoomGridIndex } from "./roomData";
|
|
|
17
14
|
*/
|
|
18
15
|
export function reloadRoom(): void {
|
|
19
16
|
const roomGridIndex = getRoomGridIndex();
|
|
20
|
-
teleport(
|
|
21
|
-
roomGridIndex,
|
|
22
|
-
Direction.NO_DIRECTION,
|
|
23
|
-
RoomTransitionAnim.FADE,
|
|
24
|
-
true,
|
|
25
|
-
);
|
|
17
|
+
teleport(roomGridIndex, Direction.NO_DIRECTION, RoomTransitionAnim.FADE);
|
|
26
18
|
}
|
|
27
19
|
|
|
28
20
|
/**
|
|
@@ -33,29 +25,20 @@ export function reloadRoom(): void {
|
|
|
33
25
|
* Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
|
|
34
26
|
* - you do not forget to set the `Level.LeaveDoor` field
|
|
35
27
|
* - to prevent crashing on invalid room grid indexes
|
|
36
|
-
*
|
|
28
|
+
*
|
|
29
|
+
* Note that if the current floor has Curse of the Maze, it may redirect the intended teleport.
|
|
37
30
|
*
|
|
38
31
|
* @param roomGridIndex The room grid index of the destination room.
|
|
39
32
|
* @param direction Optional. Default is `Direction.NO_DIRECTION`.
|
|
40
33
|
* @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
|
|
41
|
-
* @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
|
|
42
|
-
* to false, then this function may not go to the provided room grid index.
|
|
43
34
|
*/
|
|
44
35
|
export function teleport(
|
|
45
36
|
roomGridIndex: int,
|
|
46
37
|
direction = Direction.NO_DIRECTION,
|
|
47
38
|
roomTransitionAnim = RoomTransitionAnim.TELEPORT,
|
|
48
|
-
force = false,
|
|
49
39
|
): void {
|
|
50
40
|
const level = game.GetLevel();
|
|
51
41
|
|
|
52
|
-
// Before starting a room transition, we must ensure that Curse of the Maze is not in effect, or
|
|
53
|
-
// else the room transition might send us to the wrong room.
|
|
54
|
-
const shouldTempDisableCurse = force && hasCurse(LevelCurse.MAZE);
|
|
55
|
-
if (shouldTempDisableCurse) {
|
|
56
|
-
level.RemoveCurses(LevelCurse.MAZE);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
42
|
const roomData = getRoomData(roomGridIndex);
|
|
60
43
|
if (roomData === undefined) {
|
|
61
44
|
error(
|
|
@@ -68,11 +51,4 @@ export function teleport(
|
|
|
68
51
|
level.LeaveDoor = DoorSlot.NO_DOOR_SLOT;
|
|
69
52
|
|
|
70
53
|
game.StartRoomTransition(roomGridIndex, direction, roomTransitionAnim);
|
|
71
|
-
|
|
72
|
-
if (shouldTempDisableCurse) {
|
|
73
|
-
runNextRoom(() => {
|
|
74
|
-
const futureLevel = game.GetLevel();
|
|
75
|
-
futureLevel.AddCurse(LevelCurse.MAZE, false);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
54
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CollectibleType,
|
|
3
|
+
ItemPoolType,
|
|
3
4
|
PickupVariant,
|
|
4
5
|
PlayerType,
|
|
5
6
|
} from "isaac-typescript-definitions";
|
|
7
|
+
import { game } from "../core/cachedClasses";
|
|
6
8
|
import { VectorZero } from "../core/constants";
|
|
7
9
|
import { preventCollectibleRotation } from "../features/preventCollectibleRotation";
|
|
8
10
|
import { areFeaturesInitialized } from "../featuresInitialized";
|
|
@@ -13,10 +15,11 @@ import { anyPlayerIs } from "./players";
|
|
|
13
15
|
import { getRandomSeed, isRNG } from "./rng";
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
|
-
* Helper function to spawn a collectible.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Helper function to spawn a collectible.
|
|
19
|
+
*
|
|
20
|
+
* Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
|
|
21
|
+
* collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
|
|
22
|
+
* rotation mechanic. (Rotation prevention will only occur in upgraded mods.)
|
|
20
23
|
*
|
|
21
24
|
* @param collectibleType The collectible type to spawn.
|
|
22
25
|
* @param position The position to spawn the collectible at.
|
|
@@ -74,6 +77,43 @@ export function spawnCollectible(
|
|
|
74
77
|
return collectible;
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Helper function to spawn a collectible from a specific item pool.
|
|
82
|
+
*
|
|
83
|
+
* Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
|
|
84
|
+
* collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
|
|
85
|
+
* rotation mechanic. (Rotation prevention will only occur in upgraded mods.)
|
|
86
|
+
*
|
|
87
|
+
* @param itemPoolType The item pool to draw the collectible type from.
|
|
88
|
+
* @param position The position to spawn the collectible at.
|
|
89
|
+
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
90
|
+
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
91
|
+
* @param options Optional. Set to true to make the collectible a "There's Options" style
|
|
92
|
+
* collectible. Default is false.
|
|
93
|
+
* @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
|
|
94
|
+
* Tainted Keeper. Default is false.
|
|
95
|
+
* @param spawner Optional.
|
|
96
|
+
*/
|
|
97
|
+
export function spawnCollectibleFromPool(
|
|
98
|
+
itemPoolType: ItemPoolType,
|
|
99
|
+
position: Vector,
|
|
100
|
+
seedOrRNG: Seed | RNG = getRandomSeed(),
|
|
101
|
+
options = false,
|
|
102
|
+
forceFreeItem = false,
|
|
103
|
+
spawner?: Entity,
|
|
104
|
+
): EntityPickupCollectible {
|
|
105
|
+
const itemPool = game.GetItemPool();
|
|
106
|
+
const collectibleType = itemPool.GetCollectible(itemPoolType);
|
|
107
|
+
return spawnCollectible(
|
|
108
|
+
collectibleType,
|
|
109
|
+
position,
|
|
110
|
+
seedOrRNG,
|
|
111
|
+
options,
|
|
112
|
+
forceFreeItem,
|
|
113
|
+
spawner,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
77
117
|
/**
|
|
78
118
|
* Helper function to spawn an empty collectible. Doing this is tricky since spawning a collectible
|
|
79
119
|
* with `CollectibleType.NULL` will result in spawning a collectible with a random type from the
|
package/src/functions/utils.ts
CHANGED
|
@@ -72,8 +72,13 @@ export function iRange(start: int, end?: int, increment = 1): int[] {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
75
|
+
* Helper function to see if the current render callback is rendering a water reflection.
|
|
76
|
+
*
|
|
77
|
+
* When the player is in a room with water, things will be rendered twice: once for the normal
|
|
78
|
+
* rendering, and once for the reflecting rendering. Thus, any mod code in a render callback will
|
|
79
|
+
* run twice per frame in these situations, which may be unexpected or cause bugs.
|
|
80
|
+
*
|
|
81
|
+
* This function is typically used to early return from a render function if it returns true.
|
|
77
82
|
*/
|
|
78
83
|
export function isReflectionRender(): boolean {
|
|
79
84
|
const room = game.GetRoom();
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,10 @@ export * from "./core/upgradeMod";
|
|
|
7
7
|
export * from "./enums/AmbushType";
|
|
8
8
|
export * from "./enums/CornerType";
|
|
9
9
|
export * from "./enums/HealthType";
|
|
10
|
+
export * from "./enums/IsaacScriptCommonFeature";
|
|
11
|
+
export * from "./enums/LadderSubTypeCustom";
|
|
10
12
|
export * from "./enums/ModCallbackCustom";
|
|
13
|
+
export * from "./enums/ModCallbackCustom2";
|
|
11
14
|
export * from "./enums/PocketItemType";
|
|
12
15
|
export * from "./enums/RockAltType";
|
|
13
16
|
export * from "./enums/SaveDataKey";
|
|
@@ -17,8 +20,8 @@ export * from "./enums/StatType";
|
|
|
17
20
|
export * from "./features/characterHealthConversion";
|
|
18
21
|
export * from "./features/characterStats";
|
|
19
22
|
export * from "./features/collectibleItemPoolType";
|
|
20
|
-
export * from "./features/customDoor";
|
|
21
23
|
export * from "./features/customGridEntity";
|
|
24
|
+
export * from "./features/customHotkeys";
|
|
22
25
|
export * from "./features/customPickup";
|
|
23
26
|
export * from "./features/customStage/exports";
|
|
24
27
|
export * from "./features/customTrapdoor/exports";
|
|
@@ -42,7 +45,6 @@ export * from "./features/roomClearFrame";
|
|
|
42
45
|
export * from "./features/roomHistory";
|
|
43
46
|
export * from "./features/runInNFrames";
|
|
44
47
|
export * from "./features/saveDataManager/exports";
|
|
45
|
-
export * from "./features/setHotkey";
|
|
46
48
|
export * from "./features/sirenHelpers";
|
|
47
49
|
export * from "./features/stageHistory";
|
|
48
50
|
export * from "./features/taintedLazarusPlayers";
|
|
@@ -7,7 +7,6 @@ import { postBoneSwingInit } from "./callbacks/postBoneSwing";
|
|
|
7
7
|
import { postCollectibleEmptyInit } from "./callbacks/postCollectibleEmpty";
|
|
8
8
|
import { postCollectibleInitFirstInit } from "./callbacks/postCollectibleInitFirst";
|
|
9
9
|
import { postCursedTeleportInit } from "./callbacks/postCursedTeleport";
|
|
10
|
-
import { postCustomDoorEnterInit } from "./callbacks/postCustomDoorEnter";
|
|
11
10
|
import { postDiceRoomActivatedInit } from "./callbacks/postDiceRoomActivated";
|
|
12
11
|
import { postDoorRenderInit } from "./callbacks/postDoorRender";
|
|
13
12
|
import { postDoorUpdateInit } from "./callbacks/postDoorUpdate";
|
|
@@ -82,7 +81,6 @@ export function initCustomCallbacks(mod: ModUpgraded): void {
|
|
|
82
81
|
postCollectibleEmptyInit(mod);
|
|
83
82
|
postCollectibleInitFirstInit(mod);
|
|
84
83
|
postCursedTeleportInit(mod);
|
|
85
|
-
postCustomDoorEnterInit();
|
|
86
84
|
postDiceRoomActivatedInit(mod);
|
|
87
85
|
postDoorRenderInit(mod);
|
|
88
86
|
postDoorUpdateInit(mod);
|
|
@@ -103,6 +101,7 @@ export function initCustomCallbacks(mod: ModUpgraded): void {
|
|
|
103
101
|
postItemDischargeInit(mod);
|
|
104
102
|
postLaserInitLateInit(mod);
|
|
105
103
|
postKnifeInitLateInit(mod);
|
|
104
|
+
// "postNewRoomEarlyCallbackInit" has already been called.
|
|
106
105
|
postNPCInitLateInit(mod);
|
|
107
106
|
postNPCStateChangedInit(mod);
|
|
108
107
|
postPickupCollectInit(mod);
|
package/src/initFeatures.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { characterHealthConversionInit } from "./features/characterHealthConvers
|
|
|
3
3
|
import { characterStatsInit } from "./features/characterStats";
|
|
4
4
|
import { collectibleItemPoolTypeInit } from "./features/collectibleItemPoolType";
|
|
5
5
|
import { customGridEntityInit } from "./features/customGridEntity";
|
|
6
|
+
import { customHotkeysInit } from "./features/customHotkeys";
|
|
6
7
|
import { customPickupInit } from "./features/customPickup";
|
|
7
8
|
import { customStageInit } from "./features/customStage/init";
|
|
8
9
|
import { customTrapdoorInit } from "./features/customTrapdoor/init";
|
|
@@ -24,7 +25,6 @@ import { roomClearFrameInit } from "./features/roomClearFrame";
|
|
|
24
25
|
import { roomHistoryInit } from "./features/roomHistory";
|
|
25
26
|
import { runInNFramesInit } from "./features/runInNFrames";
|
|
26
27
|
import { runNextRoomInit } from "./features/runNextRoom";
|
|
27
|
-
import { setHotkeyInit } from "./features/setHotkey";
|
|
28
28
|
import { sirenHelpersInit } from "./features/sirenHelpers";
|
|
29
29
|
import { stageHistoryInit } from "./features/stageHistory";
|
|
30
30
|
import { taintedLazarusPlayersInit } from "./features/taintedLazarusPlayers";
|
|
@@ -44,6 +44,7 @@ function initFeaturesMajor(mod: ModUpgraded) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function initFeaturesMinor(mod: ModUpgraded) {
|
|
47
|
+
customHotkeysInit(mod);
|
|
47
48
|
customPickupInit(mod);
|
|
48
49
|
customTrapdoorInit(mod);
|
|
49
50
|
disableAllSoundInit(mod);
|
|
@@ -63,7 +64,6 @@ function initFeaturesMinor(mod: ModUpgraded) {
|
|
|
63
64
|
roomClearFrameInit(mod);
|
|
64
65
|
roomHistoryInit(mod);
|
|
65
66
|
runNextRoomInit(mod);
|
|
66
|
-
setHotkeyInit(mod);
|
|
67
67
|
sirenHelpersInit(mod);
|
|
68
68
|
stageHistoryInit(mod);
|
|
69
69
|
taintedLazarusPlayersInit(mod);
|
package/src/interfaces/private/{AddCallbackParameterCustom.ts → AddCallbackParametersCustom.ts}
RENAMED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { PostAmbushFinishedRegisterParameters } from "../../callbacks/subscriptions/postAmbushFinished";
|
|
2
2
|
import { PostAmbushStartedRegisterParameters } from "../../callbacks/subscriptions/postAmbushStarted";
|
|
3
|
+
import { PostBombExplodedRegisterParameters } from "../../callbacks/subscriptions/postBombExploded";
|
|
3
4
|
import { PostBombInitRegisterParameters } from "../../callbacks/subscriptions/postBombInitLate";
|
|
4
|
-
import { PostBombExplodedRegisterParameters } from "../../callbacks/subscriptions/postBoneExploded";
|
|
5
5
|
import { PostBoneSwingRegisterParameters } from "../../callbacks/subscriptions/postBoneSwing";
|
|
6
6
|
import { PostCollectibleEmptyRegisterParameters } from "../../callbacks/subscriptions/postCollectibleEmpty";
|
|
7
7
|
import { PostCollectibleInitFirstRegisterParameters } from "../../callbacks/subscriptions/postCollectibleInitFirst";
|
|
8
8
|
import { PostCursedTeleportRegisterParameters } from "../../callbacks/subscriptions/postCursedTeleport";
|
|
9
|
-
import { PostCustomDoorEnterRegisterParameters } from "../../callbacks/subscriptions/postCustomDoorEnter";
|
|
10
9
|
import { PostCustomReviveRegisterParameters } from "../../callbacks/subscriptions/postCustomRevive";
|
|
11
10
|
import { PostDiceRoomActivatedRegisterParameters } from "../../callbacks/subscriptions/postDiceRoomActivated";
|
|
12
11
|
import { PostDoorRenderRegisterParameters } from "../../callbacks/subscriptions/postDoorRender";
|
|
@@ -103,7 +102,6 @@ export interface AddCallbackParametersCustom {
|
|
|
103
102
|
[ModCallbackCustom.POST_COLLECTIBLE_EMPTY]: PostCollectibleEmptyRegisterParameters;
|
|
104
103
|
[ModCallbackCustom.POST_COLLECTIBLE_INIT_FIRST]: PostCollectibleInitFirstRegisterParameters;
|
|
105
104
|
[ModCallbackCustom.POST_CURSED_TELEPORT]: PostCursedTeleportRegisterParameters;
|
|
106
|
-
[ModCallbackCustom.POST_CUSTOM_DOOR_ENTER]: PostCustomDoorEnterRegisterParameters;
|
|
107
105
|
[ModCallbackCustom.POST_CUSTOM_REVIVE]: PostCustomReviveRegisterParameters;
|
|
108
106
|
[ModCallbackCustom.POST_DICE_ROOM_ACTIVATED]: PostDiceRoomActivatedRegisterParameters;
|
|
109
107
|
[ModCallbackCustom.POST_DOOR_RENDER]: PostDoorRenderRegisterParameters;
|
|
@@ -148,7 +146,6 @@ export interface AddCallbackParametersCustom {
|
|
|
148
146
|
[ModCallbackCustom.POST_PICKUP_INIT_FIRST]: PostPickupInitFirstRegisterParameters;
|
|
149
147
|
[ModCallbackCustom.POST_PICKUP_INIT_LATE]: PostPickupInitLateRegisterParameters;
|
|
150
148
|
[ModCallbackCustom.POST_PICKUP_STATE_CHANGED]: PostPickupStateChangedRegisterParameters;
|
|
151
|
-
[ModCallbackCustom.POST_PIT_RENDER]: PostPitRenderRegisterParameters;
|
|
152
149
|
[ModCallbackCustom.POST_PIT_UPDATE]: PostPitUpdateRegisterParameters;
|
|
153
150
|
[ModCallbackCustom.POST_PLAYER_CHANGE_HEALTH]: PostPlayerChangeHealthRegisterParameters;
|
|
154
151
|
[ModCallbackCustom.POST_PLAYER_CHANGE_STAT]: PostPlayerChangeStatRegisterParameters;
|
|
@@ -160,6 +157,7 @@ export interface AddCallbackParametersCustom {
|
|
|
160
157
|
[ModCallbackCustom.POST_PLAYER_INIT_LATE]: PostPlayerInitLateRegisterParameters;
|
|
161
158
|
[ModCallbackCustom.POST_PLAYER_RENDER_REORDERED]: PostPlayerRenderReorderedRegisterParameters;
|
|
162
159
|
[ModCallbackCustom.POST_PLAYER_UPDATE_REORDERED]: PostPlayerUpdateReorderedRegisterParameters;
|
|
160
|
+
[ModCallbackCustom.POST_PIT_RENDER]: PostPitRenderRegisterParameters;
|
|
163
161
|
[ModCallbackCustom.POST_POOP_RENDER]: PostPoopRenderRegisterParameters;
|
|
164
162
|
[ModCallbackCustom.POST_POOP_UPDATE]: PostPoopUpdateRegisterParameters;
|
|
165
163
|
[ModCallbackCustom.POST_PRESSURE_PLATE_RENDER]: PostPressurePlateRenderRegisterParameters;
|
|
@@ -190,23 +188,3 @@ export interface AddCallbackParametersCustom {
|
|
|
190
188
|
[ModCallbackCustom.PRE_ITEM_PICKUP]: PreItemPickupRegisterParameters;
|
|
191
189
|
[ModCallbackCustom.PRE_NEW_LEVEL]: PreNewLevelRegisterParameters;
|
|
192
190
|
}
|
|
193
|
-
|
|
194
|
-
// Make copies of the objects we need to verify so that we can easily re-use the code block below.
|
|
195
|
-
type EnumToCheck = ModCallbackCustom;
|
|
196
|
-
type InterfaceToCheck = AddCallbackParametersCustom;
|
|
197
|
-
|
|
198
|
-
// Throw a compiler error if InterfaceToCheck does not match the values of EnumToCheck.
|
|
199
|
-
// From: https://stackoverflow.com/questions/51829842
|
|
200
|
-
type KeysMissing = Exclude<EnumToCheck, keyof InterfaceToCheck>;
|
|
201
|
-
type ExtraKeys = {
|
|
202
|
-
[K in keyof InterfaceToCheck]: Extract<EnumToCheck, K> extends never
|
|
203
|
-
? K
|
|
204
|
-
: never;
|
|
205
|
-
}[keyof InterfaceToCheck];
|
|
206
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
207
|
-
type Verify<
|
|
208
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
209
|
-
_Missing extends never = KeysMissing,
|
|
210
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
211
|
-
_Extra extends never = ExtraKeys,
|
|
212
|
-
> = 0;
|