isaacscript-common 25.3.0 → 25.4.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.rollup.d.ts +11 -2
- package/dist/isaacscript-common.lua +779 -684
- package/dist/src/classes/callbacks/PostAmbushFinished.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostAmbushFinished.lua +4 -3
- package/dist/src/classes/callbacks/PostAmbushStarted.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostAmbushStarted.lua +4 -3
- package/dist/src/classes/callbacks/PostBombInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostBombInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostBoneSwing.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostBoneSwing.lua +5 -4
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCollectibleEmpty.lua +6 -5
- package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCollectibleInitFirst.lua +6 -5
- package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCursedTeleport.lua +14 -13
- package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostDiceRoomActivated.lua +4 -3
- package/dist/src/classes/callbacks/PostEffectInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostEffectInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostEffectStateChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostEffectStateChanged.lua +8 -7
- package/dist/src/classes/callbacks/PostFamiliarInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostFamiliarInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostFamiliarStateChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostFamiliarStateChanged.lua +8 -7
- package/dist/src/classes/callbacks/PostGameStartedReordered.d.ts +2 -0
- package/dist/src/classes/callbacks/PostGameStartedReordered.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGameStartedReordered.lua +3 -0
- package/dist/src/classes/callbacks/PostGameStartedReorderedLast.d.ts +2 -0
- package/dist/src/classes/callbacks/PostGameStartedReorderedLast.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGameStartedReorderedLast.lua +3 -0
- package/dist/src/classes/callbacks/PostGreedModeWave.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGreedModeWave.lua +4 -3
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +5 -4
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostItemDischarge.lua +20 -19
- package/dist/src/classes/callbacks/PostKeyboardChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostKeyboardChanged.lua +8 -7
- package/dist/src/classes/callbacks/PostKnifeInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostKnifeInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostLaserInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostLaserInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostNPCInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostNPCInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostNPCStateChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostNPCStateChanged.lua +8 -7
- package/dist/src/classes/callbacks/PostPickupCollect.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPickupCollect.lua +6 -5
- package/dist/src/classes/callbacks/PostPickupInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPickupInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostPickupStateChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPickupStateChanged.lua +8 -7
- package/dist/src/classes/callbacks/PostPlayerChangeHealth.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPlayerChangeHealth.lua +8 -7
- package/dist/src/classes/callbacks/PostPlayerChangeStat.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPlayerChangeStat.lua +8 -7
- package/dist/src/classes/callbacks/PostPlayerChangeType.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPlayerChangeType.lua +8 -7
- package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPlayerFatalDamage.lua +6 -5
- package/dist/src/classes/callbacks/PostPlayerInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPlayerInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostProjectileInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostProjectileInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostPurchase.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPurchase.lua +5 -4
- package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostRoomClearChanged.lua +5 -4
- package/dist/src/classes/callbacks/PostSacrifice.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostSacrifice.lua +5 -4
- package/dist/src/classes/callbacks/PostTearInitLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostTearInitLate.lua +6 -5
- package/dist/src/classes/callbacks/PostTearInitVeryLate.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostTearInitVeryLate.lua +6 -5
- package/dist/src/classes/callbacks/PostTransformation.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostTransformation.lua +8 -7
- package/dist/src/classes/callbacks/PostTrinketBreak.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostTrinketBreak.lua +9 -8
- package/dist/src/classes/callbacks/PreNewLevel.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PreNewLevel.lua +4 -3
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +21 -20
- package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomRevive.lua +18 -17
- package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/EsauJrDetection.lua +11 -10
- package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/FlipDetection.lua +4 -3
- package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.lua +8 -7
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.lua +9 -8
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.lua +7 -6
- package/dist/src/classes/features/callbackLogic/PickupChangeDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/PickupChangeDetection.lua +11 -10
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +20 -19
- package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.lua +15 -14
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.lua +6 -5
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.lua +15 -14
- package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.lua +6 -5
- package/dist/src/classes/features/other/CollectibleItemPoolType.d.ts.map +1 -1
- package/dist/src/classes/features/other/CollectibleItemPoolType.lua +6 -5
- package/dist/src/classes/features/other/CustomItemPools.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomItemPools.lua +6 -5
- 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/CustomStages.lua +17 -26
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.lua +36 -35
- package/dist/src/classes/features/other/DisableAllSound.d.ts.map +1 -1
- package/dist/src/classes/features/other/DisableAllSound.lua +10 -9
- package/dist/src/classes/features/other/DisableInputs.d.ts.map +1 -1
- package/dist/src/classes/features/other/DisableInputs.lua +21 -20
- package/dist/src/classes/features/other/ExtraConsoleCommands.lua +19 -19
- package/dist/src/classes/features/other/NoSirenSteal.d.ts.map +1 -1
- package/dist/src/classes/features/other/NoSirenSteal.lua +5 -4
- package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
- package/dist/src/classes/features/other/Pause.lua +20 -19
- package/dist/src/classes/features/other/PersistentEntities.d.ts.map +1 -1
- package/dist/src/classes/features/other/PersistentEntities.lua +20 -19
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.lua +29 -28
- package/dist/src/classes/features/other/PlayerInventory.d.ts.map +1 -1
- package/dist/src/classes/features/other/PlayerInventory.lua +9 -8
- package/dist/src/classes/features/other/PonyDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/PonyDetection.lua +8 -7
- package/dist/src/classes/features/other/PressInput.d.ts.map +1 -1
- package/dist/src/classes/features/other/PressInput.lua +7 -6
- package/dist/src/classes/features/other/PreventChildEntities.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventChildEntities.lua +7 -6
- package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventCollectibleRotation.lua +7 -6
- package/dist/src/classes/features/other/PreventGridEntityRespawn.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventGridEntityRespawn.lua +16 -15
- package/dist/src/classes/features/other/RoomClearFrame.d.ts.map +1 -1
- package/dist/src/classes/features/other/RoomClearFrame.lua +6 -5
- package/dist/src/classes/features/other/RoomHistory.d.ts.map +1 -1
- package/dist/src/classes/features/other/RoomHistory.lua +9 -8
- package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -1
- package/dist/src/classes/features/other/RunInNFrames.lua +14 -13
- package/dist/src/classes/features/other/RunNextRoom.d.ts.map +1 -1
- package/dist/src/classes/features/other/RunNextRoom.lua +6 -5
- package/dist/src/classes/features/other/SaveDataManager.d.ts +1 -0
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.lua +12 -0
- package/dist/src/classes/features/other/StageHistory.d.ts.map +1 -1
- package/dist/src/classes/features/other/StageHistory.lua +7 -6
- package/dist/src/classes/features/other/TaintedLazarusPlayers.d.ts.map +1 -1
- package/dist/src/classes/features/other/TaintedLazarusPlayers.lua +18 -17
- package/dist/src/classes/features/other/customStages/streakText.d.ts +3 -25
- package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/streakText.lua +16 -26
- package/dist/src/classes/features/other/customStages/v.d.ts +25 -0
- package/dist/src/classes/features/other/customStages/v.d.ts.map +1 -0
- package/dist/src/classes/features/other/customStages/v.lua +16 -0
- package/dist/src/classes/features/other/customStages/versusScreen.d.ts +2 -8
- package/dist/src/classes/features/other/customStages/versusScreen.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/versusScreen.lua +6 -4
- package/dist/src/enums/ModCallbackCustom.d.ts +6 -0
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/interfaces/SaveData.d.ts.map +1 -1
- package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts +4 -2
- package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
- package/dist/src/shouldFire.d.ts +1 -0
- package/dist/src/shouldFire.d.ts.map +1 -1
- package/dist/src/shouldFire.lua +5 -0
- package/package.json +1 -1
- package/src/classes/callbacks/PostAmbushFinished.ts +9 -7
- package/src/classes/callbacks/PostAmbushStarted.ts +9 -7
- package/src/classes/callbacks/PostBombInitLate.ts +9 -7
- package/src/classes/callbacks/PostBoneSwing.ts +9 -7
- package/src/classes/callbacks/PostCollectibleEmpty.ts +9 -7
- package/src/classes/callbacks/PostCollectibleInitFirst.ts +9 -7
- package/src/classes/callbacks/PostCursedTeleport.ts +20 -24
- package/src/classes/callbacks/PostDiceRoomActivated.ts +9 -7
- package/src/classes/callbacks/PostEffectInitLate.ts +9 -7
- package/src/classes/callbacks/PostEffectStateChanged.ts +9 -7
- package/src/classes/callbacks/PostFamiliarInitLate.ts +9 -7
- package/src/classes/callbacks/PostFamiliarStateChanged.ts +9 -7
- package/src/classes/callbacks/PostGameStartedReordered.ts +3 -0
- package/src/classes/callbacks/PostGameStartedReorderedLast.ts +3 -0
- package/src/classes/callbacks/PostGreedModeWave.ts +9 -7
- package/src/classes/callbacks/PostHolyMantleRemoved.ts +9 -7
- package/src/classes/callbacks/PostItemDischarge.ts +21 -27
- package/src/classes/callbacks/PostKeyboardChanged.ts +11 -9
- package/src/classes/callbacks/PostKnifeInitLate.ts +9 -7
- package/src/classes/callbacks/PostLaserInitLate.ts +9 -7
- package/src/classes/callbacks/PostNPCInitLate.ts +9 -7
- package/src/classes/callbacks/PostNPCStateChanged.ts +11 -12
- package/src/classes/callbacks/PostPickupCollect.ts +9 -7
- package/src/classes/callbacks/PostPickupInitLate.ts +9 -7
- package/src/classes/callbacks/PostPickupStateChanged.ts +9 -7
- package/src/classes/callbacks/PostPlayerChangeHealth.ts +10 -8
- package/src/classes/callbacks/PostPlayerChangeStat.ts +11 -10
- package/src/classes/callbacks/PostPlayerChangeType.ts +13 -11
- package/src/classes/callbacks/PostPlayerFatalDamage.ts +10 -8
- package/src/classes/callbacks/PostPlayerInitLate.ts +9 -7
- package/src/classes/callbacks/PostProjectileInitLate.ts +9 -7
- package/src/classes/callbacks/PostPurchase.ts +11 -9
- package/src/classes/callbacks/PostRoomClearChanged.ts +10 -8
- package/src/classes/callbacks/PostSacrifice.ts +9 -7
- package/src/classes/callbacks/PostTearInitLate.ts +9 -7
- package/src/classes/callbacks/PostTearInitVeryLate.ts +9 -7
- package/src/classes/callbacks/PostTransformation.ts +12 -10
- package/src/classes/callbacks/PostTrinketBreak.ts +12 -16
- package/src/classes/callbacks/PreNewLevel.ts +9 -7
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +23 -21
- package/src/classes/features/callbackLogic/CustomRevive.ts +26 -27
- package/src/classes/features/callbackLogic/EsauJrDetection.ts +19 -17
- package/src/classes/features/callbackLogic/FlipDetection.ts +10 -8
- package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +11 -9
- package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +13 -12
- package/src/classes/features/callbackLogic/ItemPickupDetection.ts +10 -8
- package/src/classes/features/callbackLogic/PickupChangeDetection.ts +12 -10
- package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +21 -27
- package/src/classes/features/callbackLogic/PlayerReorderedCallbacks.ts +22 -29
- package/src/classes/features/callbackLogic/SlotDestroyedDetection.ts +9 -7
- package/src/classes/features/callbackLogic/SlotRenderDetection.ts +15 -13
- package/src/classes/features/callbackLogic/SlotUpdateDetection.ts +9 -7
- package/src/classes/features/other/CollectibleItemPoolType.ts +9 -7
- package/src/classes/features/other/CustomItemPools.ts +9 -7
- package/src/classes/features/other/CustomPickups.ts +0 -1
- package/src/classes/features/other/CustomStages.ts +16 -44
- package/src/classes/features/other/CustomTrapdoors.ts +53 -54
- package/src/classes/features/other/DisableAllSound.ts +13 -11
- package/src/classes/features/other/DisableInputs.ts +39 -37
- package/src/classes/features/other/ExtraConsoleCommands.ts +19 -19
- package/src/classes/features/other/NoSirenSteal.ts +11 -9
- package/src/classes/features/other/Pause.ts +21 -19
- package/src/classes/features/other/PersistentEntities.ts +33 -31
- package/src/classes/features/other/PickupIndexCreation.ts +35 -33
- package/src/classes/features/other/PlayerInventory.ts +14 -12
- package/src/classes/features/other/PonyDetection.ts +11 -9
- package/src/classes/features/other/PressInput.ts +11 -9
- package/src/classes/features/other/PreventChildEntities.ts +10 -8
- package/src/classes/features/other/PreventCollectibleRotation.ts +20 -18
- package/src/classes/features/other/PreventGridEntityRespawn.ts +18 -18
- package/src/classes/features/other/RoomClearFrame.ts +12 -10
- package/src/classes/features/other/RoomHistory.ts +13 -11
- package/src/classes/features/other/RunInNFrames.ts +19 -17
- package/src/classes/features/other/RunNextRoom.ts +10 -8
- package/src/classes/features/other/SaveDataManager.ts +11 -0
- package/src/classes/features/other/StageHistory.ts +11 -9
- package/src/classes/features/other/TaintedLazarusPlayers.ts +31 -30
- package/src/classes/features/other/customStages/streakText.ts +14 -44
- package/src/classes/features/other/customStages/v.ts +31 -0
- package/src/classes/features/other/customStages/versusScreen.ts +2 -10
- package/src/enums/ModCallbackCustom.ts +6 -0
- package/src/interfaces/SaveData.ts +0 -1
- package/src/interfaces/private/AddCallbackParametersCustom.ts +2 -0
- package/src/shouldFire.ts +10 -0
|
@@ -23,21 +23,23 @@ import { DefaultMap } from "../../DefaultMap";
|
|
|
23
23
|
import { Feature } from "../../private/Feature";
|
|
24
24
|
import { RunInNFrames } from "../other/RunInNFrames";
|
|
25
25
|
|
|
26
|
+
const v = {
|
|
27
|
+
level: {
|
|
28
|
+
/** Indexed by room list index and grid index. */
|
|
29
|
+
customGridEntities: new DefaultMap<int, Map<int, GridEntityCustomData>>(
|
|
30
|
+
() => new Map(),
|
|
31
|
+
),
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
room: {
|
|
35
|
+
genericPropPtrHashes: new Set<PtrHash>(),
|
|
36
|
+
manuallyUsingShovel: false,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
26
40
|
export class CustomGridEntities extends Feature {
|
|
27
41
|
/** @internal */
|
|
28
|
-
public override v =
|
|
29
|
-
level: {
|
|
30
|
-
/** Indexed by room list index and grid index. */
|
|
31
|
-
customGridEntities: new DefaultMap<int, Map<int, GridEntityCustomData>>(
|
|
32
|
-
() => new Map(),
|
|
33
|
-
),
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
room: {
|
|
37
|
-
genericPropPtrHashes: new Set<PtrHash>(),
|
|
38
|
-
manuallyUsingShovel: false,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
42
|
+
public override v = v;
|
|
41
43
|
|
|
42
44
|
private runInNFrames: RunInNFrames;
|
|
43
45
|
|
|
@@ -79,7 +81,7 @@ export class CustomGridEntities extends Feature {
|
|
|
79
81
|
const room = game.GetRoom();
|
|
80
82
|
const roomListIndex = getRoomListIndex();
|
|
81
83
|
const roomCustomGridEntities =
|
|
82
|
-
|
|
84
|
+
v.level.customGridEntities.get(roomListIndex);
|
|
83
85
|
if (roomCustomGridEntities === undefined) {
|
|
84
86
|
return undefined;
|
|
85
87
|
}
|
|
@@ -105,9 +107,9 @@ export class CustomGridEntities extends Feature {
|
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
v.room.manuallyUsingShovel = true;
|
|
109
111
|
futurePlayer.UseActiveItem(CollectibleType.WE_NEED_TO_GO_DEEPER);
|
|
110
|
-
|
|
112
|
+
v.room.manuallyUsingShovel = false;
|
|
111
113
|
});
|
|
112
114
|
|
|
113
115
|
// Cancel the original effect.
|
|
@@ -120,7 +122,7 @@ export class CustomGridEntities extends Feature {
|
|
|
120
122
|
// of a normal decoration. Thus, we must re-apply the anm2.
|
|
121
123
|
const roomListIndex = getRoomListIndex();
|
|
122
124
|
const roomCustomGridEntities =
|
|
123
|
-
|
|
125
|
+
v.level.customGridEntities.get(roomListIndex);
|
|
124
126
|
if (roomCustomGridEntities === undefined) {
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
@@ -274,7 +276,7 @@ export class CustomGridEntities extends Feature {
|
|
|
274
276
|
};
|
|
275
277
|
|
|
276
278
|
const roomCustomGridEntities =
|
|
277
|
-
|
|
279
|
+
v.level.customGridEntities.getAndSetDefault(roomListIndex);
|
|
278
280
|
roomCustomGridEntities.set(gridIndex, customGridEntityData);
|
|
279
281
|
|
|
280
282
|
return customGridEntity;
|
|
@@ -329,7 +331,7 @@ export class CustomGridEntities extends Feature {
|
|
|
329
331
|
|
|
330
332
|
const gridIndex = decoration.GetGridIndex();
|
|
331
333
|
const roomCustomGridEntities =
|
|
332
|
-
|
|
334
|
+
v.level.customGridEntities.getAndSetDefault(roomListIndex);
|
|
333
335
|
const exists = roomCustomGridEntities.has(gridIndex);
|
|
334
336
|
if (!exists) {
|
|
335
337
|
return undefined;
|
|
@@ -354,7 +356,7 @@ export class CustomGridEntities extends Feature {
|
|
|
354
356
|
> {
|
|
355
357
|
const roomListIndex = getRoomListIndex();
|
|
356
358
|
const roomCustomGridEntities =
|
|
357
|
-
|
|
359
|
+
v.level.customGridEntities.get(roomListIndex);
|
|
358
360
|
if (roomCustomGridEntities === undefined) {
|
|
359
361
|
return [];
|
|
360
362
|
}
|
|
@@ -393,7 +395,7 @@ export class CustomGridEntities extends Feature {
|
|
|
393
395
|
|
|
394
396
|
const roomListIndex = getRoomListIndex();
|
|
395
397
|
const roomCustomGridEntities =
|
|
396
|
-
|
|
398
|
+
v.level.customGridEntities.get(roomListIndex);
|
|
397
399
|
if (roomCustomGridEntities === undefined) {
|
|
398
400
|
return undefined;
|
|
399
401
|
}
|
|
@@ -36,14 +36,16 @@ enum CustomReviveState {
|
|
|
36
36
|
WAITING_FOR_ITEM_ANIMATION,
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const v = {
|
|
40
|
+
run: {
|
|
41
|
+
state: CustomReviveState.DISABLED,
|
|
42
|
+
revivalType: null as int | null,
|
|
43
|
+
dyingPlayerIndex: null as PlayerIndex | null,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
39
47
|
export class CustomRevive extends Feature {
|
|
40
|
-
public override v =
|
|
41
|
-
run: {
|
|
42
|
-
state: CustomReviveState.DISABLED,
|
|
43
|
-
revivalType: null as int | null,
|
|
44
|
-
dyingPlayerIndex: null as PlayerIndex | null,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
48
|
+
public override v = v;
|
|
47
49
|
|
|
48
50
|
private preCustomRevive: PreCustomRevive;
|
|
49
51
|
private postCustomRevive: PostCustomRevive;
|
|
@@ -87,7 +89,7 @@ export class CustomRevive extends Feature {
|
|
|
87
89
|
|
|
88
90
|
// ModCallback.POST_RENDER (2)
|
|
89
91
|
private postRender = (): void => {
|
|
90
|
-
if (
|
|
92
|
+
if (v.run.state !== CustomReviveState.WAITING_FOR_ITEM_ANIMATION) {
|
|
91
93
|
return;
|
|
92
94
|
}
|
|
93
95
|
|
|
@@ -99,7 +101,7 @@ export class CustomRevive extends Feature {
|
|
|
99
101
|
// ModCallback.POST_FAMILIAR_INIT (7)
|
|
100
102
|
// FamiliarVariant.ONE_UP (41)
|
|
101
103
|
private postFamiliarInitOneUp = (familiar: EntityFamiliar): void => {
|
|
102
|
-
if (
|
|
104
|
+
if (v.run.state !== CustomReviveState.WAITING_FOR_ROOM_TRANSITION) {
|
|
103
105
|
return;
|
|
104
106
|
}
|
|
105
107
|
|
|
@@ -108,11 +110,11 @@ export class CustomRevive extends Feature {
|
|
|
108
110
|
|
|
109
111
|
// ModCallbackCustom.POST_NEW_ROOM_REORDERED
|
|
110
112
|
private postNewRoomReordered = (): void => {
|
|
111
|
-
if (
|
|
113
|
+
if (v.run.state !== CustomReviveState.WAITING_FOR_ROOM_TRANSITION) {
|
|
112
114
|
return;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
v.run.state = CustomReviveState.WAITING_FOR_ITEM_ANIMATION;
|
|
116
118
|
this.logStateChanged();
|
|
117
119
|
};
|
|
118
120
|
|
|
@@ -122,16 +124,16 @@ export class CustomRevive extends Feature {
|
|
|
122
124
|
};
|
|
123
125
|
|
|
124
126
|
private checkWaitingForItemAnimation(player: EntityPlayer): void {
|
|
125
|
-
if (
|
|
127
|
+
if (v.run.state !== CustomReviveState.WAITING_FOR_ITEM_ANIMATION) {
|
|
126
128
|
return;
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
if (
|
|
131
|
+
if (v.run.dyingPlayerIndex === null) {
|
|
130
132
|
return;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
const playerIndex = getPlayerIndex(player);
|
|
134
|
-
if (playerIndex !==
|
|
136
|
+
if (playerIndex !== v.run.dyingPlayerIndex) {
|
|
135
137
|
return;
|
|
136
138
|
}
|
|
137
139
|
|
|
@@ -152,16 +154,13 @@ export class CustomRevive extends Feature {
|
|
|
152
154
|
// expected to play a new animation in the PostCustomRevive callback, which will overwrite the
|
|
153
155
|
// 1-Up animation.
|
|
154
156
|
|
|
155
|
-
if (
|
|
156
|
-
this.postCustomRevive.fire(
|
|
157
|
-
playerToCheckHoldingItem,
|
|
158
|
-
this.v.run.revivalType,
|
|
159
|
-
);
|
|
157
|
+
if (v.run.revivalType !== null) {
|
|
158
|
+
this.postCustomRevive.fire(playerToCheckHoldingItem, v.run.revivalType);
|
|
160
159
|
}
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
v.run.state = CustomReviveState.DISABLED;
|
|
162
|
+
v.run.revivalType = null;
|
|
163
|
+
v.run.dyingPlayerIndex = null;
|
|
165
164
|
this.logStateChanged();
|
|
166
165
|
}
|
|
167
166
|
|
|
@@ -188,9 +187,9 @@ export class CustomRevive extends Feature {
|
|
|
188
187
|
return;
|
|
189
188
|
}
|
|
190
189
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
v.run.state = CustomReviveState.WAITING_FOR_ROOM_TRANSITION;
|
|
191
|
+
v.run.revivalType = revivalType;
|
|
192
|
+
v.run.dyingPlayerIndex = getPlayerIndex(player);
|
|
194
193
|
this.logStateChanged();
|
|
195
194
|
|
|
196
195
|
player.AddCollectible(CollectibleType.ONE_UP, 0, false);
|
|
@@ -220,8 +219,8 @@ export class CustomRevive extends Feature {
|
|
|
220
219
|
private logStateChanged(): void {
|
|
221
220
|
if (DEBUG) {
|
|
222
221
|
log(
|
|
223
|
-
`Custom revive state changed: ${CustomReviveState[
|
|
224
|
-
|
|
222
|
+
`Custom revive state changed: ${CustomReviveState[v.run.state]} (${
|
|
223
|
+
v.run.state
|
|
225
224
|
})`,
|
|
226
225
|
);
|
|
227
226
|
}
|
|
@@ -10,14 +10,16 @@ import { PostEsauJr } from "../../callbacks/PostEsauJr";
|
|
|
10
10
|
import { PostFirstEsauJr } from "../../callbacks/PostFirstEsauJr";
|
|
11
11
|
import { Feature } from "../../private/Feature";
|
|
12
12
|
|
|
13
|
+
const v = {
|
|
14
|
+
run: {
|
|
15
|
+
usedEsauJrFrame: null as int | null,
|
|
16
|
+
usedEsauJrControllerIndex: null as ControllerIndex | null,
|
|
17
|
+
usedEsauJrAtLeastOnce: false,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
13
21
|
export class EsauJrDetection extends Feature {
|
|
14
|
-
public override v =
|
|
15
|
-
run: {
|
|
16
|
-
usedEsauJrFrame: null as int | null,
|
|
17
|
-
usedEsauJrControllerIndex: null as ControllerIndex | null,
|
|
18
|
-
usedEsauJrAtLeastOnce: false,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
22
|
+
public override v = v;
|
|
21
23
|
|
|
22
24
|
private postEsauJr: PostEsauJr;
|
|
23
25
|
private postFirstEsauJr: PostFirstEsauJr;
|
|
@@ -47,30 +49,30 @@ export class EsauJrDetection extends Feature {
|
|
|
47
49
|
|
|
48
50
|
// Check to see if it is the frame after the player has used Esau Jr.
|
|
49
51
|
if (
|
|
50
|
-
|
|
51
|
-
gameFrameCount <
|
|
52
|
+
v.run.usedEsauJrFrame === null ||
|
|
53
|
+
gameFrameCount < v.run.usedEsauJrFrame + 1
|
|
52
54
|
) {
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
|
-
|
|
57
|
+
v.run.usedEsauJrFrame = null;
|
|
56
58
|
|
|
57
59
|
// Find the player corresponding to the player who used Esau Jr. a frame ago (via matching the
|
|
58
60
|
// ControllerIndex).
|
|
59
|
-
if (
|
|
61
|
+
if (v.run.usedEsauJrControllerIndex === null) {
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
64
|
const players = getPlayersWithControllerIndex(
|
|
63
|
-
|
|
65
|
+
v.run.usedEsauJrControllerIndex,
|
|
64
66
|
);
|
|
65
|
-
|
|
67
|
+
v.run.usedEsauJrControllerIndex = null;
|
|
66
68
|
|
|
67
69
|
const player = players[0];
|
|
68
70
|
if (player === undefined) {
|
|
69
71
|
return;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
if (!
|
|
73
|
-
|
|
74
|
+
if (!v.run.usedEsauJrAtLeastOnce) {
|
|
75
|
+
v.run.usedEsauJrAtLeastOnce = true;
|
|
74
76
|
this.postFirstEsauJr.fire(player);
|
|
75
77
|
}
|
|
76
78
|
|
|
@@ -90,8 +92,8 @@ export class EsauJrDetection extends Feature {
|
|
|
90
92
|
const gameFrameCount = game.GetFrameCount();
|
|
91
93
|
|
|
92
94
|
// The player only changes to Esau Jr. on the frame after the item is used.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
v.run.usedEsauJrFrame = gameFrameCount + 1;
|
|
96
|
+
v.run.usedEsauJrControllerIndex = player.ControllerIndex;
|
|
95
97
|
|
|
96
98
|
return undefined;
|
|
97
99
|
};
|
|
@@ -9,13 +9,15 @@ import { PostFirstFlip } from "../../callbacks/PostFirstFlip";
|
|
|
9
9
|
import { PostFlip } from "../../callbacks/PostFlip";
|
|
10
10
|
import { Feature } from "../../private/Feature";
|
|
11
11
|
|
|
12
|
+
const v = {
|
|
13
|
+
run: {
|
|
14
|
+
/** We don't consider the case of a multiplayer game with more than one Tainted Lazarus. */
|
|
15
|
+
usedFlipAtLeastOnce: false,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
12
19
|
export class FlipDetection extends Feature {
|
|
13
|
-
public override v =
|
|
14
|
-
run: {
|
|
15
|
-
/** We don't consider the case of a multiplayer game with more than one Tainted Lazarus. */
|
|
16
|
-
usedFlipAtLeastOnce: false,
|
|
17
|
-
},
|
|
18
|
-
};
|
|
20
|
+
public override v = v;
|
|
19
21
|
|
|
20
22
|
private postFlip: PostFlip;
|
|
21
23
|
private postFirstFlip: PostFirstFlip;
|
|
@@ -53,8 +55,8 @@ export class FlipDetection extends Feature {
|
|
|
53
55
|
return undefined;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
if (!
|
|
57
|
-
|
|
58
|
+
if (!v.run.usedFlipAtLeastOnce) {
|
|
59
|
+
v.run.usedFlipAtLeastOnce = true;
|
|
58
60
|
this.postFirstFlip.fire(newLazarus, player);
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -9,15 +9,17 @@ import { DefaultMap } from "../../DefaultMap";
|
|
|
9
9
|
import { Feature } from "../../private/Feature";
|
|
10
10
|
import { CustomGridEntities } from "./CustomGridEntities";
|
|
11
11
|
|
|
12
|
+
const v = {
|
|
13
|
+
room: {
|
|
14
|
+
/** Indexed by grid entity pointer hash. */
|
|
15
|
+
collidingEntitiesMap: new DefaultMap<PtrHash, Set<PtrHash>>(
|
|
16
|
+
() => new Set(),
|
|
17
|
+
),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
12
21
|
export class GridEntityCollisionDetection extends Feature {
|
|
13
|
-
public override v =
|
|
14
|
-
room: {
|
|
15
|
-
/** Indexed by grid entity pointer hash. */
|
|
16
|
-
collidingEntitiesMap: new DefaultMap<PtrHash, Set<PtrHash>>(
|
|
17
|
-
() => new Set(),
|
|
18
|
-
),
|
|
19
|
-
},
|
|
20
|
-
};
|
|
22
|
+
public override v = v;
|
|
21
23
|
|
|
22
24
|
private postGridEntityCollision: PostGridEntityCollision;
|
|
23
25
|
private postGridEntityCustomCollision: PostGridEntityCustomCollision;
|
|
@@ -49,7 +51,7 @@ export class GridEntityCollisionDetection extends Feature {
|
|
|
49
51
|
for (const gridEntity of gridEntitiesWithCollision) {
|
|
50
52
|
const gridEntityPtrHash = GetPtrHash(gridEntity);
|
|
51
53
|
const oldCollidingEntities =
|
|
52
|
-
|
|
54
|
+
v.room.collidingEntitiesMap.getAndSetDefault(gridEntityPtrHash);
|
|
53
55
|
|
|
54
56
|
// Check for new colliding entities.
|
|
55
57
|
const collidingEntities = getCollidingEntitiesWithGridEntity(gridEntity);
|
|
@@ -24,13 +24,15 @@ type GridEntityTuple = [
|
|
|
24
24
|
state: int,
|
|
25
25
|
];
|
|
26
26
|
|
|
27
|
+
const v = {
|
|
28
|
+
room: {
|
|
29
|
+
/** Indexed by grid index. */
|
|
30
|
+
initializedGridEntities: new Map<int, GridEntityTuple>(),
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
27
34
|
export class GridEntityUpdateDetection extends Feature {
|
|
28
|
-
public override v =
|
|
29
|
-
room: {
|
|
30
|
-
/** Indexed by grid index. */
|
|
31
|
-
initializedGridEntities: new Map<int, GridEntityTuple>(),
|
|
32
|
-
},
|
|
33
|
-
};
|
|
35
|
+
public override v = v;
|
|
34
36
|
|
|
35
37
|
private postGridEntityInit: PostGridEntityInit;
|
|
36
38
|
private postGridEntityCustomInit: PostGridEntityCustomInit;
|
|
@@ -108,15 +110,14 @@ export class GridEntityUpdateDetection extends Feature {
|
|
|
108
110
|
private checkGridEntitiesRemoved(
|
|
109
111
|
gridEntitiesMap: Map<int, GridEntity>,
|
|
110
112
|
): void {
|
|
111
|
-
for (const [gridIndex, gridEntityTuple] of
|
|
112
|
-
.initializedGridEntities) {
|
|
113
|
+
for (const [gridIndex, gridEntityTuple] of v.room.initializedGridEntities) {
|
|
113
114
|
const [storedGridEntityType, storedGridEntityVariant] = gridEntityTuple;
|
|
114
115
|
const gridEntity = gridEntitiesMap.get(gridIndex);
|
|
115
116
|
if (
|
|
116
117
|
gridEntity === undefined ||
|
|
117
118
|
gridEntity.GetType() !== storedGridEntityType
|
|
118
119
|
) {
|
|
119
|
-
|
|
120
|
+
v.room.initializedGridEntities.delete(gridIndex);
|
|
120
121
|
|
|
121
122
|
const gridEntityTypeCustom =
|
|
122
123
|
this.customGridEntities.getCustomGridEntityType(gridIndex);
|
|
@@ -137,7 +138,7 @@ export class GridEntityUpdateDetection extends Feature {
|
|
|
137
138
|
gridIndex: int,
|
|
138
139
|
gridEntity: GridEntity,
|
|
139
140
|
): void {
|
|
140
|
-
const gridEntityTuple =
|
|
141
|
+
const gridEntityTuple = v.room.initializedGridEntities.get(gridIndex);
|
|
141
142
|
if (gridEntityTuple === undefined) {
|
|
142
143
|
// This grid entity did not exist a frame ago; we don't want to fire the state changed
|
|
143
144
|
// callback on the first frame that it exists.
|
|
@@ -177,7 +178,7 @@ export class GridEntityUpdateDetection extends Feature {
|
|
|
177
178
|
|
|
178
179
|
private checkNewGridEntity(gridIndex: int, gridEntity: GridEntity): void {
|
|
179
180
|
const gridEntityType = gridEntity.GetType();
|
|
180
|
-
const gridEntityTuple =
|
|
181
|
+
const gridEntityTuple = v.room.initializedGridEntities.get(gridIndex);
|
|
181
182
|
|
|
182
183
|
if (
|
|
183
184
|
gridEntityTuple === undefined ||
|
|
@@ -204,7 +205,7 @@ export class GridEntityUpdateDetection extends Feature {
|
|
|
204
205
|
variant,
|
|
205
206
|
gridEntity.State,
|
|
206
207
|
];
|
|
207
|
-
|
|
208
|
+
v.room.initializedGridEntities.set(gridIndex, newTuple);
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
// ModCallbackCustom.POST_NEW_ROOM_REORDERED
|
|
@@ -17,14 +17,16 @@ import { PreItemPickup } from "../../callbacks/PreItemPickup";
|
|
|
17
17
|
import { DefaultMap } from "../../DefaultMap";
|
|
18
18
|
import { Feature } from "../../private/Feature";
|
|
19
19
|
|
|
20
|
+
const v = {
|
|
21
|
+
run: {
|
|
22
|
+
playersPickingUpItemMap: new DefaultMap<PlayerIndex, PickingUpItem>(() =>
|
|
23
|
+
newPickingUpItem(),
|
|
24
|
+
),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
20
28
|
export class ItemPickupDetection extends Feature {
|
|
21
|
-
public override v =
|
|
22
|
-
run: {
|
|
23
|
-
playersPickingUpItemMap: new DefaultMap<PlayerIndex, PickingUpItem>(() =>
|
|
24
|
-
newPickingUpItem(),
|
|
25
|
-
),
|
|
26
|
-
},
|
|
27
|
-
};
|
|
29
|
+
public override v = v;
|
|
28
30
|
|
|
29
31
|
private postItemPickup: PostItemPickup;
|
|
30
32
|
private preItemPickup: PreItemPickup;
|
|
@@ -46,7 +48,7 @@ export class ItemPickupDetection extends Feature {
|
|
|
46
48
|
// ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED
|
|
47
49
|
private postPEffectUpdateReordered = (player: EntityPlayer) => {
|
|
48
50
|
const pickingUpItem = defaultMapGetPlayer(
|
|
49
|
-
|
|
51
|
+
v.run.playersPickingUpItemMap,
|
|
50
52
|
player,
|
|
51
53
|
);
|
|
52
54
|
|
|
@@ -5,13 +5,15 @@ import { PostPickupChanged } from "../../callbacks/PostPickupChanged";
|
|
|
5
5
|
import { Feature } from "../../private/Feature";
|
|
6
6
|
import { PickupIndexCreation } from "../other/PickupIndexCreation";
|
|
7
7
|
|
|
8
|
+
const v = {
|
|
9
|
+
room: {
|
|
10
|
+
pickupVariants: new Map<PickupIndex, PickupVariant>(),
|
|
11
|
+
pickupSubTypes: new Map<PickupIndex, int>(),
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
8
15
|
export class PickupChangeDetection extends Feature {
|
|
9
|
-
public override v =
|
|
10
|
-
room: {
|
|
11
|
-
pickupVariants: new Map<PickupIndex, PickupVariant>(),
|
|
12
|
-
pickupSubTypes: new Map<PickupIndex, int>(),
|
|
13
|
-
},
|
|
14
|
-
};
|
|
16
|
+
public override v = v;
|
|
15
17
|
|
|
16
18
|
private postPickupChanged: PostPickupChanged;
|
|
17
19
|
private pickupIndexCreation: PickupIndexCreation;
|
|
@@ -37,11 +39,11 @@ export class PickupChangeDetection extends Feature {
|
|
|
37
39
|
private postPickupUpdate = (pickup: EntityPickup) => {
|
|
38
40
|
const pickupIndex = this.pickupIndexCreation.getPickupIndex(pickup);
|
|
39
41
|
|
|
40
|
-
const oldVariant =
|
|
41
|
-
|
|
42
|
+
const oldVariant = v.room.pickupVariants.get(pickupIndex);
|
|
43
|
+
v.room.pickupVariants.set(pickupIndex, pickup.Variant);
|
|
42
44
|
|
|
43
|
-
const oldSubType =
|
|
44
|
-
|
|
45
|
+
const oldSubType = v.room.pickupSubTypes.get(pickupIndex);
|
|
46
|
+
v.room.pickupSubTypes.set(pickupIndex, pickup.SubType);
|
|
45
47
|
|
|
46
48
|
// If this is the first update frame for the pickup, it cannot have changed.
|
|
47
49
|
if (oldVariant === undefined || oldSubType === undefined) {
|
|
@@ -26,20 +26,22 @@ import { Feature } from "../../private/Feature";
|
|
|
26
26
|
import { ModdedElementSets } from "../other/ModdedElementSets";
|
|
27
27
|
import { RunInNFrames } from "../other/RunInNFrames";
|
|
28
28
|
|
|
29
|
+
const v = {
|
|
30
|
+
run: {
|
|
31
|
+
playersCollectibleCount: new DefaultMap<PlayerIndex, int>(0),
|
|
32
|
+
playersCollectibleMap: new DefaultMap<
|
|
33
|
+
PlayerIndex,
|
|
34
|
+
Map<CollectibleType, int>
|
|
35
|
+
>(() => new Map()),
|
|
36
|
+
playersActiveItemMap: new DefaultMap<
|
|
37
|
+
PlayerIndex,
|
|
38
|
+
Map<ActiveSlot, CollectibleType>
|
|
39
|
+
>(() => new Map()),
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
29
43
|
export class PlayerCollectibleDetection extends Feature {
|
|
30
|
-
public override v =
|
|
31
|
-
run: {
|
|
32
|
-
playersCollectibleCount: new DefaultMap<PlayerIndex, int>(0),
|
|
33
|
-
playersCollectibleMap: new DefaultMap<
|
|
34
|
-
PlayerIndex,
|
|
35
|
-
Map<CollectibleType, int>
|
|
36
|
-
>(() => new Map()),
|
|
37
|
-
playersActiveItemMap: new DefaultMap<
|
|
38
|
-
PlayerIndex,
|
|
39
|
-
Map<ActiveSlot, CollectibleType>
|
|
40
|
-
>(() => new Map()),
|
|
41
|
-
},
|
|
42
|
-
};
|
|
44
|
+
public override v = v;
|
|
43
45
|
|
|
44
46
|
private postPlayerCollectibleAdded: PostPlayerCollectibleAdded;
|
|
45
47
|
private postPlayerCollectibleRemoved: PostPlayerCollectibleRemoved;
|
|
@@ -96,12 +98,12 @@ export class PlayerCollectibleDetection extends Feature {
|
|
|
96
98
|
numCollectiblesChanged: int | undefined,
|
|
97
99
|
) {
|
|
98
100
|
const oldCollectibleMap = defaultMapGetPlayer(
|
|
99
|
-
|
|
101
|
+
v.run.playersCollectibleMap,
|
|
100
102
|
player,
|
|
101
103
|
);
|
|
102
104
|
const newCollectibleMap =
|
|
103
105
|
this.moddedElementSets.getPlayerCollectibleMap(player);
|
|
104
|
-
mapSetPlayer(
|
|
106
|
+
mapSetPlayer(v.run.playersCollectibleMap, player, newCollectibleMap);
|
|
105
107
|
|
|
106
108
|
const collectibleTypesSet = new Set<CollectibleType>([
|
|
107
109
|
...oldCollectibleMap.keys(),
|
|
@@ -204,11 +206,7 @@ export class PlayerCollectibleDetection extends Feature {
|
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
const newCollectibleCount = player.GetCollectibleCount();
|
|
207
|
-
mapSetPlayer(
|
|
208
|
-
this.v.run.playersCollectibleCount,
|
|
209
|
-
player,
|
|
210
|
-
newCollectibleCount,
|
|
211
|
-
);
|
|
209
|
+
mapSetPlayer(v.run.playersCollectibleCount, player, newCollectibleCount);
|
|
212
210
|
|
|
213
211
|
this.updateCollectibleMapAndFire(player, 1);
|
|
214
212
|
};
|
|
@@ -216,15 +214,11 @@ export class PlayerCollectibleDetection extends Feature {
|
|
|
216
214
|
// ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED
|
|
217
215
|
private postPEffectUpdateReordered = (player: EntityPlayer) => {
|
|
218
216
|
const oldCollectibleCount = defaultMapGetPlayer(
|
|
219
|
-
|
|
217
|
+
v.run.playersCollectibleCount,
|
|
220
218
|
player,
|
|
221
219
|
);
|
|
222
220
|
const newCollectibleCount = player.GetCollectibleCount();
|
|
223
|
-
mapSetPlayer(
|
|
224
|
-
this.v.run.playersCollectibleCount,
|
|
225
|
-
player,
|
|
226
|
-
newCollectibleCount,
|
|
227
|
-
);
|
|
221
|
+
mapSetPlayer(v.run.playersCollectibleCount, player, newCollectibleCount);
|
|
228
222
|
|
|
229
223
|
const difference = newCollectibleCount - oldCollectibleCount;
|
|
230
224
|
|
|
@@ -248,7 +242,7 @@ export class PlayerCollectibleDetection extends Feature {
|
|
|
248
242
|
*/
|
|
249
243
|
private checkActiveItemsChanged(player: EntityPlayer) {
|
|
250
244
|
const activeItemMap = defaultMapGetPlayer(
|
|
251
|
-
|
|
245
|
+
v.run.playersActiveItemMap,
|
|
252
246
|
player,
|
|
253
247
|
);
|
|
254
248
|
|
|
@@ -16,16 +16,18 @@ import { PostPlayerRenderReordered } from "../../callbacks/PostPlayerRenderReord
|
|
|
16
16
|
import { PostPlayerUpdateReordered } from "../../callbacks/PostPlayerUpdateReordered";
|
|
17
17
|
import { Feature } from "../../private/Feature";
|
|
18
18
|
|
|
19
|
+
const v = {
|
|
20
|
+
run: {
|
|
21
|
+
postGameStartedFiredOnThisRun: false,
|
|
22
|
+
|
|
23
|
+
postPEffectUpdateQueue: [] as PlayerIndex[],
|
|
24
|
+
postPlayerUpdateQueue: [] as PlayerIndex[],
|
|
25
|
+
postPlayerRenderQueue: [] as PlayerIndex[],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
19
29
|
export class PlayerReorderedCallbacks extends Feature {
|
|
20
|
-
public override v =
|
|
21
|
-
run: {
|
|
22
|
-
postGameStartedFiredOnThisRun: false,
|
|
23
|
-
|
|
24
|
-
postPEffectUpdateQueue: [] as PlayerIndex[],
|
|
25
|
-
postPlayerUpdateQueue: [] as PlayerIndex[],
|
|
26
|
-
postPlayerRenderQueue: [] as PlayerIndex[],
|
|
27
|
-
},
|
|
28
|
-
};
|
|
30
|
+
public override v = v;
|
|
29
31
|
|
|
30
32
|
private postPEffectUpdateReordered: PostPEffectUpdateReordered;
|
|
31
33
|
private postPlayerRenderReordered: PostPlayerRenderReordered;
|
|
@@ -63,23 +65,23 @@ export class PlayerReorderedCallbacks extends Feature {
|
|
|
63
65
|
|
|
64
66
|
// ModCallback.POST_PEFFECT_UPDATE (4)
|
|
65
67
|
private postPEffectUpdate = (player: EntityPlayer): void => {
|
|
66
|
-
if (
|
|
68
|
+
if (v.run.postGameStartedFiredOnThisRun) {
|
|
67
69
|
this.postPEffectUpdateReordered.fire(player);
|
|
68
70
|
} else {
|
|
69
71
|
// Defer callback execution until the `POST_GAME_STARTED` callback fires.
|
|
70
72
|
const playerIndex = getPlayerIndex(player);
|
|
71
|
-
|
|
73
|
+
v.run.postPEffectUpdateQueue.push(playerIndex);
|
|
72
74
|
}
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
// ModCallback.POST_PLAYER_UPDATE (31)
|
|
76
78
|
private postPlayerUpdate = (player: EntityPlayer): void => {
|
|
77
|
-
if (
|
|
79
|
+
if (v.run.postGameStartedFiredOnThisRun) {
|
|
78
80
|
this.postPlayerUpdateReordered.fire(player);
|
|
79
81
|
} else {
|
|
80
82
|
// Defer callback execution until the `POST_GAME_STARTED` callback fires.
|
|
81
83
|
const playerIndex = getPlayerIndex(player);
|
|
82
|
-
|
|
84
|
+
v.run.postPlayerUpdateQueue.push(playerIndex);
|
|
83
85
|
}
|
|
84
86
|
};
|
|
85
87
|
|
|
@@ -88,31 +90,22 @@ export class PlayerReorderedCallbacks extends Feature {
|
|
|
88
90
|
player: EntityPlayer,
|
|
89
91
|
_renderOffset: Vector,
|
|
90
92
|
): void => {
|
|
91
|
-
if (
|
|
93
|
+
if (v.run.postGameStartedFiredOnThisRun) {
|
|
92
94
|
this.postPlayerRenderReordered.fire(player);
|
|
93
95
|
} else {
|
|
94
96
|
// Defer callback execution until the `POST_GAME_STARTED` callback fires.
|
|
95
97
|
const playerIndex = getPlayerIndex(player);
|
|
96
|
-
|
|
98
|
+
v.run.postPlayerRenderQueue.push(playerIndex);
|
|
97
99
|
}
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
// ModCallbackCustom.POST_GAME_STARTED_REORDERED_LAST
|
|
101
103
|
private postGameStartedReorderedLast = (): void => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
dequeue(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
);
|
|
108
|
-
dequeue(
|
|
109
|
-
this.v.run.postPlayerUpdateQueue,
|
|
110
|
-
this.postPlayerUpdateReordered.fire,
|
|
111
|
-
);
|
|
112
|
-
dequeue(
|
|
113
|
-
this.v.run.postPlayerRenderQueue,
|
|
114
|
-
this.postPlayerRenderReordered.fire,
|
|
115
|
-
);
|
|
104
|
+
v.run.postGameStartedFiredOnThisRun = true;
|
|
105
|
+
|
|
106
|
+
dequeue(v.run.postPEffectUpdateQueue, this.postPEffectUpdateReordered.fire);
|
|
107
|
+
dequeue(v.run.postPlayerUpdateQueue, this.postPlayerUpdateReordered.fire);
|
|
108
|
+
dequeue(v.run.postPlayerRenderQueue, this.postPlayerRenderReordered.fire);
|
|
116
109
|
};
|
|
117
110
|
}
|
|
118
111
|
|