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
|
@@ -24,12 +24,14 @@ import { PostSlotDestroyed } from "../../callbacks/PostSlotDestroyed";
|
|
|
24
24
|
import { Feature } from "../../private/Feature";
|
|
25
25
|
import { RoomHistory } from "../other/RoomHistory";
|
|
26
26
|
|
|
27
|
+
const v = {
|
|
28
|
+
room: {
|
|
29
|
+
destroyedSlotSet: new Set<PtrHash>(),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
27
33
|
export class SlotDestroyedDetection extends Feature {
|
|
28
|
-
public override v =
|
|
29
|
-
room: {
|
|
30
|
-
destroyedSlotSet: new Set<PtrHash>(),
|
|
31
|
-
},
|
|
32
|
-
};
|
|
34
|
+
public override v = v;
|
|
33
35
|
|
|
34
36
|
private postSlotDestroyed: PostSlotDestroyed;
|
|
35
37
|
private roomHistory: RoomHistory;
|
|
@@ -92,7 +94,7 @@ export class SlotDestroyedDetection extends Feature {
|
|
|
92
94
|
private postSlotUpdate = (slot: EntitySlot) => {
|
|
93
95
|
const ptrHash = GetPtrHash(slot);
|
|
94
96
|
|
|
95
|
-
const alreadyDestroyed =
|
|
97
|
+
const alreadyDestroyed = v.room.destroyedSlotSet.has(ptrHash);
|
|
96
98
|
if (alreadyDestroyed) {
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
@@ -109,7 +111,7 @@ export class SlotDestroyedDetection extends Feature {
|
|
|
109
111
|
private checkDestroyedFromCollisionClass(slot: EntitySlot) {
|
|
110
112
|
if (slot.GridCollisionClass === EntityGridCollisionClass.GROUND) {
|
|
111
113
|
const ptrHash = GetPtrHash(slot);
|
|
112
|
-
|
|
114
|
+
v.room.destroyedSlotSet.add(ptrHash);
|
|
113
115
|
this.postSlotDestroyed.fire(slot, SlotDestructionType.NORMAL);
|
|
114
116
|
}
|
|
115
117
|
}
|
|
@@ -5,18 +5,20 @@ import { PostSlotRender } from "../../callbacks/PostSlotRender";
|
|
|
5
5
|
import { DefaultMap } from "../../DefaultMap";
|
|
6
6
|
import { Feature } from "../../private/Feature";
|
|
7
7
|
|
|
8
|
+
const v = {
|
|
9
|
+
room: {
|
|
10
|
+
slotAnimations: new DefaultMap<PtrHash, string, [slot: Entity]>(
|
|
11
|
+
(slot: Entity) => {
|
|
12
|
+
const sprite = slot.GetSprite();
|
|
13
|
+
return sprite.GetAnimation();
|
|
14
|
+
},
|
|
15
|
+
),
|
|
16
|
+
brokenSlots: new Set<PtrHash>(),
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
8
20
|
export class SlotRenderDetection extends Feature {
|
|
9
|
-
public override v =
|
|
10
|
-
room: {
|
|
11
|
-
slotAnimations: new DefaultMap<PtrHash, string, [slot: Entity]>(
|
|
12
|
-
(slot: Entity) => {
|
|
13
|
-
const sprite = slot.GetSprite();
|
|
14
|
-
return sprite.GetAnimation();
|
|
15
|
-
},
|
|
16
|
-
),
|
|
17
|
-
brokenSlots: new Set<PtrHash>(),
|
|
18
|
-
},
|
|
19
|
-
};
|
|
21
|
+
public override v = v;
|
|
20
22
|
|
|
21
23
|
private postSlotRender: PostSlotRender;
|
|
22
24
|
private postSlotAnimationChanged: PostSlotAnimationChanged;
|
|
@@ -48,11 +50,11 @@ export class SlotRenderDetection extends Feature {
|
|
|
48
50
|
const sprite = slot.GetSprite();
|
|
49
51
|
const currentAnimation = sprite.GetAnimation();
|
|
50
52
|
const ptrHash = GetPtrHash(slot);
|
|
51
|
-
const previousAnimation =
|
|
53
|
+
const previousAnimation = v.room.slotAnimations.getAndSetDefault(
|
|
52
54
|
ptrHash,
|
|
53
55
|
slot,
|
|
54
56
|
);
|
|
55
|
-
|
|
57
|
+
v.room.slotAnimations.set(ptrHash, currentAnimation);
|
|
56
58
|
|
|
57
59
|
if (currentAnimation !== previousAnimation) {
|
|
58
60
|
this.postSlotAnimationChanged.fire(
|
|
@@ -5,12 +5,14 @@ import { PostSlotInit } from "../../callbacks/PostSlotInit";
|
|
|
5
5
|
import { PostSlotUpdate } from "../../callbacks/PostSlotUpdate";
|
|
6
6
|
import { Feature } from "../../private/Feature";
|
|
7
7
|
|
|
8
|
+
const v = {
|
|
9
|
+
room: {
|
|
10
|
+
initializedSlots: new Set<PtrHash>(),
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
8
14
|
export class SlotUpdateDetection extends Feature {
|
|
9
|
-
public override v =
|
|
10
|
-
room: {
|
|
11
|
-
initializedSlots: new Set<PtrHash>(),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
15
|
+
public override v = v;
|
|
14
16
|
|
|
15
17
|
private postSlotInit: PostSlotInit;
|
|
16
18
|
private postSlotUpdate: PostSlotUpdate;
|
|
@@ -50,8 +52,8 @@ export class SlotUpdateDetection extends Feature {
|
|
|
50
52
|
|
|
51
53
|
private checkNewEntity(slot: EntitySlot) {
|
|
52
54
|
const ptrHash = GetPtrHash(slot);
|
|
53
|
-
if (!
|
|
54
|
-
|
|
55
|
+
if (!v.room.initializedSlots.has(ptrHash)) {
|
|
56
|
+
v.room.initializedSlots.add(ptrHash);
|
|
55
57
|
this.postSlotInit.fire(slot);
|
|
56
58
|
}
|
|
57
59
|
}
|
|
@@ -13,13 +13,15 @@ import { PickupIndex } from "../../../types/PickupIndex";
|
|
|
13
13
|
import { Feature } from "../../private/Feature";
|
|
14
14
|
import { PickupIndexCreation } from "./PickupIndexCreation";
|
|
15
15
|
|
|
16
|
+
const v = {
|
|
17
|
+
run: {
|
|
18
|
+
collectibleItemPoolTypeMap: new Map<PickupIndex, ItemPoolType>(),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
16
22
|
export class CollectibleItemPoolType extends Feature {
|
|
17
23
|
/** @internal */
|
|
18
|
-
public override v =
|
|
19
|
-
run: {
|
|
20
|
-
collectibleItemPoolTypeMap: new Map<PickupIndex, ItemPoolType>(),
|
|
21
|
-
},
|
|
22
|
-
};
|
|
24
|
+
public override v = v;
|
|
23
25
|
|
|
24
26
|
private pickupIndexCreation: PickupIndexCreation;
|
|
25
27
|
|
|
@@ -48,7 +50,7 @@ export class CollectibleItemPoolType extends Feature {
|
|
|
48
50
|
const pickupIndex = this.pickupIndexCreation.getPickupIndex(collectible);
|
|
49
51
|
const lastItemPoolType = itemPool.GetLastPool();
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
v.run.collectibleItemPoolTypeMap.set(pickupIndex, lastItemPoolType);
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
/**
|
|
@@ -70,7 +72,7 @@ export class CollectibleItemPoolType extends Feature {
|
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
const pickupIndex = this.pickupIndexCreation.getPickupIndex(collectible);
|
|
73
|
-
const itemPoolType =
|
|
75
|
+
const itemPoolType = v.run.collectibleItemPoolTypeMap.get(pickupIndex);
|
|
74
76
|
return itemPoolType === undefined ? getRoomItemPoolType() : itemPoolType;
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -8,13 +8,15 @@ import { getRandomIndexFromWeightedArray } from "../../../functions/weighted";
|
|
|
8
8
|
import { WeightedArray } from "../../../types/WeightedArray";
|
|
9
9
|
import { Feature } from "../../private/Feature";
|
|
10
10
|
|
|
11
|
+
const v = {
|
|
12
|
+
run: {
|
|
13
|
+
customItemPools: new Map<ItemPoolType, WeightedArray<CollectibleType>>(),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
11
17
|
export class CustomItemPools extends Feature {
|
|
12
18
|
/** @internal */
|
|
13
|
-
public override v =
|
|
14
|
-
run: {
|
|
15
|
-
customItemPools: new Map<ItemPoolType, WeightedArray<CollectibleType>>(),
|
|
16
|
-
},
|
|
17
|
-
};
|
|
19
|
+
public override v = v;
|
|
18
20
|
|
|
19
21
|
private customItemPoolMap = new Map<
|
|
20
22
|
ItemPoolType,
|
|
@@ -39,7 +41,7 @@ export class CustomItemPools extends Feature {
|
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
v.run.customItemPools = copyMap(this.customItemPoolMap);
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
/**
|
|
@@ -114,7 +116,7 @@ export class CustomItemPools extends Feature {
|
|
|
114
116
|
seedOrRNG: Seed | RNG = getRandomSeed(),
|
|
115
117
|
defaultItem = CollectibleType.NULL,
|
|
116
118
|
): CollectibleType {
|
|
117
|
-
const customItemPool =
|
|
119
|
+
const customItemPool = v.run.customItemPools.get(itemPoolTypeCustom);
|
|
118
120
|
if (customItemPool === undefined) {
|
|
119
121
|
error(`Failed to find the custom item pool of: ${itemPoolTypeCustom}`);
|
|
120
122
|
}
|
|
@@ -93,7 +93,6 @@ export class CustomPickups extends Feature {
|
|
|
93
93
|
|
|
94
94
|
// ModCallback.POST_EFFECT_RENDER (56)
|
|
95
95
|
// PICKUP_EFFECT_VARIANT
|
|
96
|
-
// eslint-disable-next-line class-methods-use-this
|
|
97
96
|
private postEffectRenderPickupEffect = (effect: EntityEffect) => {
|
|
98
97
|
if (effect.SubType !== asNumber(PICKUP_EFFECT_SUB_TYPE)) {
|
|
99
98
|
return;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ControllerIndex,
|
|
3
2
|
DoorSlotFlag,
|
|
4
3
|
GridEntityType,
|
|
5
4
|
LevelCurse,
|
|
@@ -14,7 +13,6 @@ import * as metadataJSON from "../../../customStageMetadata.json"; // This will
|
|
|
14
13
|
import { Exported } from "../../../decorators";
|
|
15
14
|
import { ISCFeature } from "../../../enums/ISCFeature";
|
|
16
15
|
import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
17
|
-
import { UIStreakAnimation } from "../../../enums/private/UIStreakAnimation";
|
|
18
16
|
import { isArray } from "../../../functions/array";
|
|
19
17
|
import {
|
|
20
18
|
doorSlotsToDoorSlotFlags,
|
|
@@ -66,6 +64,7 @@ import {
|
|
|
66
64
|
getRandomBossRoomFromPool,
|
|
67
65
|
getRandomCustomStageRoom,
|
|
68
66
|
} from "./customStages/utils";
|
|
67
|
+
import { v } from "./customStages/v";
|
|
69
68
|
import {
|
|
70
69
|
playVersusScreenAnimation,
|
|
71
70
|
versusScreenPostRender,
|
|
@@ -83,33 +82,7 @@ const MUSIC_DELAY_RENDER_FRAMES = 70;
|
|
|
83
82
|
|
|
84
83
|
export class CustomStages extends Feature {
|
|
85
84
|
/** @internal */
|
|
86
|
-
public override v =
|
|
87
|
-
run: {
|
|
88
|
-
currentCustomStage: null as CustomStage | null,
|
|
89
|
-
|
|
90
|
-
/** Whether we are on e.g. Caves 1 or Caves 2. */
|
|
91
|
-
firstFloor: true,
|
|
92
|
-
|
|
93
|
-
showingBossVersusScreen: false,
|
|
94
|
-
|
|
95
|
-
/** Values are the render frame that the controller first pressed the map button. */
|
|
96
|
-
controllerIndexPushingMapRenderFrame: new Map<ControllerIndex, int>(),
|
|
97
|
-
|
|
98
|
-
topStreakTextStartedRenderFrame: null as int | null,
|
|
99
|
-
|
|
100
|
-
topStreakText: {
|
|
101
|
-
animation: UIStreakAnimation.NONE,
|
|
102
|
-
frame: 0,
|
|
103
|
-
pauseFrame: false,
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
bottomStreakText: {
|
|
107
|
-
animation: UIStreakAnimation.NONE,
|
|
108
|
-
frame: 0,
|
|
109
|
-
pauseFrame: false,
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
};
|
|
85
|
+
public override v = v;
|
|
113
86
|
|
|
114
87
|
/** Indexed by custom stage name. */
|
|
115
88
|
private customStagesMap = new Map<string, CustomStage>();
|
|
@@ -222,20 +195,20 @@ export class CustomStages extends Feature {
|
|
|
222
195
|
|
|
223
196
|
// ModCallback.POST_RENDER (2)
|
|
224
197
|
private postRender = () => {
|
|
225
|
-
const customStage =
|
|
198
|
+
const customStage = v.run.currentCustomStage;
|
|
226
199
|
if (customStage === null) {
|
|
227
200
|
return;
|
|
228
201
|
}
|
|
229
202
|
|
|
230
|
-
streakTextPostRender(
|
|
231
|
-
versusScreenPostRender(this.
|
|
203
|
+
streakTextPostRender();
|
|
204
|
+
versusScreenPostRender(this.pause, this.disableAllSound);
|
|
232
205
|
};
|
|
233
206
|
|
|
234
207
|
// ModCallback.POST_CURSE_EVAL (12)
|
|
235
208
|
private postCurseEval = (
|
|
236
209
|
curses: BitFlags<LevelCurse>,
|
|
237
210
|
): BitFlags<LevelCurse> | undefined => {
|
|
238
|
-
const customStage =
|
|
211
|
+
const customStage = v.run.currentCustomStage;
|
|
239
212
|
if (customStage === null) {
|
|
240
213
|
return undefined;
|
|
241
214
|
}
|
|
@@ -252,19 +225,19 @@ export class CustomStages extends Feature {
|
|
|
252
225
|
private getShaderParams = (
|
|
253
226
|
shaderName: string,
|
|
254
227
|
): Record<string, unknown> | undefined => {
|
|
255
|
-
const customStage =
|
|
228
|
+
const customStage = v.run.currentCustomStage;
|
|
256
229
|
if (customStage === null) {
|
|
257
230
|
return;
|
|
258
231
|
}
|
|
259
232
|
|
|
260
|
-
streakTextGetShaderParams(
|
|
233
|
+
streakTextGetShaderParams(customStage, shaderName);
|
|
261
234
|
return undefined;
|
|
262
235
|
};
|
|
263
236
|
|
|
264
237
|
// ModCallbackCustom.POST_GRID_ENTITY_BROKEN
|
|
265
238
|
// GridEntityType.ROCK_ALT
|
|
266
239
|
private postGridEntityBrokenRockAlt = (gridEntity: GridEntity) => {
|
|
267
|
-
const customStage =
|
|
240
|
+
const customStage = v.run.currentCustomStage;
|
|
268
241
|
if (customStage === null) {
|
|
269
242
|
return;
|
|
270
243
|
}
|
|
@@ -282,7 +255,7 @@ export class CustomStages extends Feature {
|
|
|
282
255
|
|
|
283
256
|
// ModCallbackCustom.POST_GRID_ENTITY_INIT
|
|
284
257
|
private postGridEntityInit = (gridEntity: GridEntity) => {
|
|
285
|
-
const customStage =
|
|
258
|
+
const customStage = v.run.currentCustomStage;
|
|
286
259
|
if (customStage === null) {
|
|
287
260
|
return;
|
|
288
261
|
}
|
|
@@ -299,14 +272,14 @@ export class CustomStages extends Feature {
|
|
|
299
272
|
convertVanillaTrapdoors(
|
|
300
273
|
customStage,
|
|
301
274
|
gridEntity,
|
|
302
|
-
|
|
275
|
+
v.run.firstFloor,
|
|
303
276
|
this.customTrapdoors,
|
|
304
277
|
);
|
|
305
278
|
};
|
|
306
279
|
|
|
307
280
|
// ModCallbackCustom.POST_NEW_ROOM_REORDERED
|
|
308
281
|
private postNewRoomReordered = () => {
|
|
309
|
-
const customStage =
|
|
282
|
+
const customStage = v.run.currentCustomStage;
|
|
310
283
|
if (customStage === null) {
|
|
311
284
|
return;
|
|
312
285
|
}
|
|
@@ -314,7 +287,6 @@ export class CustomStages extends Feature {
|
|
|
314
287
|
setCustomStageBackdrop(customStage);
|
|
315
288
|
setShadows(customStage);
|
|
316
289
|
playVersusScreenAnimation(
|
|
317
|
-
this.v,
|
|
318
290
|
customStage,
|
|
319
291
|
this.disableAllSound,
|
|
320
292
|
this.pause,
|
|
@@ -456,8 +428,8 @@ export class CustomStages extends Feature {
|
|
|
456
428
|
const startSeed = seeds.GetStartSeed();
|
|
457
429
|
const rng = newRNG(startSeed);
|
|
458
430
|
|
|
459
|
-
|
|
460
|
-
|
|
431
|
+
v.run.currentCustomStage = customStage;
|
|
432
|
+
v.run.firstFloor = firstFloor;
|
|
461
433
|
|
|
462
434
|
// Before changing the stage, we have to revert the bugged stage, if necessary. This prevents
|
|
463
435
|
// the bug where the backdrop will not spawn.
|
|
@@ -504,7 +476,7 @@ export class CustomStages extends Feature {
|
|
|
504
476
|
// `POST_RENDER` callback. Thus, we run it on the next game frame as a workaround.
|
|
505
477
|
if (streakText) {
|
|
506
478
|
this.runInNFrames.runNextGameFrame(() => {
|
|
507
|
-
topStreakTextStart(
|
|
479
|
+
topStreakTextStart();
|
|
508
480
|
});
|
|
509
481
|
}
|
|
510
482
|
|
|
@@ -537,7 +509,7 @@ export class CustomStages extends Feature {
|
|
|
537
509
|
*/
|
|
538
510
|
@Exported
|
|
539
511
|
public disableCustomStage(): void {
|
|
540
|
-
|
|
512
|
+
v.run.currentCustomStage = null;
|
|
541
513
|
}
|
|
542
514
|
}
|
|
543
515
|
|
|
@@ -73,6 +73,24 @@ const PIXELATION_TO_BLACK_FRAMES = 60;
|
|
|
73
73
|
const OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = 6;
|
|
74
74
|
const OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = 5;
|
|
75
75
|
|
|
76
|
+
const v = {
|
|
77
|
+
run: {
|
|
78
|
+
state: StageTravelState.NONE,
|
|
79
|
+
|
|
80
|
+
/** The render frame that this state was reached. */
|
|
81
|
+
stateRenderFrame: null as int | null,
|
|
82
|
+
|
|
83
|
+
customTrapdoorActivated: null as CustomTrapdoorDescription | null,
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
level: {
|
|
87
|
+
/** Indexed by room list index and grid index. */
|
|
88
|
+
trapdoors: new DefaultMap<int, Map<int, CustomTrapdoorDescription>>(
|
|
89
|
+
() => new Map(),
|
|
90
|
+
),
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
76
94
|
export class CustomTrapdoors extends Feature {
|
|
77
95
|
/** Indexed by custom trapdoor ID. */
|
|
78
96
|
private destinationFuncMap = new Map<
|
|
@@ -85,23 +103,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
85
103
|
>();
|
|
86
104
|
|
|
87
105
|
/** @internal */
|
|
88
|
-
public override v =
|
|
89
|
-
run: {
|
|
90
|
-
state: StageTravelState.NONE,
|
|
91
|
-
|
|
92
|
-
/** The render frame that this state was reached. */
|
|
93
|
-
stateRenderFrame: null as int | null,
|
|
94
|
-
|
|
95
|
-
customTrapdoorActivated: null as CustomTrapdoorDescription | null,
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
level: {
|
|
99
|
-
/** Indexed by room list index and grid index. */
|
|
100
|
-
trapdoors: new DefaultMap<int, Map<int, CustomTrapdoorDescription>>(
|
|
101
|
-
() => new Map(),
|
|
102
|
-
),
|
|
103
|
-
},
|
|
104
|
-
};
|
|
106
|
+
public override v = v;
|
|
105
107
|
|
|
106
108
|
/**
|
|
107
109
|
* In order to represent a black sprite, we just use the first frame of the boss versus screen
|
|
@@ -177,7 +179,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
177
179
|
};
|
|
178
180
|
|
|
179
181
|
private checkAllPlayersJumpComplete() {
|
|
180
|
-
if (
|
|
182
|
+
if (v.run.state !== StageTravelState.PLAYERS_JUMPING_DOWN) {
|
|
181
183
|
return;
|
|
182
184
|
}
|
|
183
185
|
|
|
@@ -188,8 +190,8 @@ export class CustomTrapdoors extends Feature {
|
|
|
188
190
|
const renderFrameCount = Isaac.GetFrameCount();
|
|
189
191
|
const roomGridIndex = getRoomGridIndex();
|
|
190
192
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
v.run.state = StageTravelState.PIXELATION_TO_BLACK;
|
|
194
|
+
v.run.stateRenderFrame = renderFrameCount;
|
|
193
195
|
this.logStateChanged();
|
|
194
196
|
|
|
195
197
|
// In order to display the pixelation effect that should happen when we go to a new floor, we
|
|
@@ -209,8 +211,8 @@ export class CustomTrapdoors extends Feature {
|
|
|
209
211
|
|
|
210
212
|
private checkPixelationToBlackComplete() {
|
|
211
213
|
if (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
v.run.state !== StageTravelState.PIXELATION_TO_BLACK ||
|
|
215
|
+
v.run.stateRenderFrame === null
|
|
214
216
|
) {
|
|
215
217
|
return;
|
|
216
218
|
}
|
|
@@ -219,12 +221,12 @@ export class CustomTrapdoors extends Feature {
|
|
|
219
221
|
const renderFrameCount = Isaac.GetFrameCount();
|
|
220
222
|
|
|
221
223
|
const renderFrameScreenBlack =
|
|
222
|
-
|
|
224
|
+
v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES;
|
|
223
225
|
if (renderFrameCount < renderFrameScreenBlack) {
|
|
224
226
|
return;
|
|
225
227
|
}
|
|
226
228
|
|
|
227
|
-
|
|
229
|
+
v.run.state = StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END;
|
|
228
230
|
this.logStateChanged();
|
|
229
231
|
|
|
230
232
|
// Now, we display a black sprite on top of the pixelation effect, to prevent showing the rest
|
|
@@ -242,9 +244,9 @@ export class CustomTrapdoors extends Feature {
|
|
|
242
244
|
const startingRoomIndex = level.GetStartingRoomIndex();
|
|
243
245
|
const futureRenderFrameCount = Isaac.GetFrameCount();
|
|
244
246
|
|
|
245
|
-
|
|
247
|
+
v.run.state =
|
|
246
248
|
StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY;
|
|
247
|
-
|
|
249
|
+
v.run.stateRenderFrame = futureRenderFrameCount;
|
|
248
250
|
|
|
249
251
|
this.goToCustomTrapdoorDestination();
|
|
250
252
|
|
|
@@ -259,9 +261,9 @@ export class CustomTrapdoors extends Feature {
|
|
|
259
261
|
}
|
|
260
262
|
|
|
261
263
|
private goToCustomTrapdoorDestination() {
|
|
262
|
-
if (
|
|
264
|
+
if (v.run.customTrapdoorActivated === null) {
|
|
263
265
|
// This should never happen; provide some sane default values.
|
|
264
|
-
|
|
266
|
+
v.run.customTrapdoorActivated = {
|
|
265
267
|
destinationName: undefined,
|
|
266
268
|
destinationStage: LevelStage.BASEMENT_1,
|
|
267
269
|
destinationStageType: StageType.ORIGINAL,
|
|
@@ -271,12 +273,12 @@ export class CustomTrapdoors extends Feature {
|
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
const destinationFunc = this.getDestinationFunc(
|
|
274
|
-
|
|
276
|
+
v.run.customTrapdoorActivated,
|
|
275
277
|
);
|
|
276
278
|
destinationFunc(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
279
|
+
v.run.customTrapdoorActivated.destinationName,
|
|
280
|
+
v.run.customTrapdoorActivated.destinationStage,
|
|
281
|
+
v.run.customTrapdoorActivated.destinationStageType,
|
|
280
282
|
);
|
|
281
283
|
}
|
|
282
284
|
|
|
@@ -303,9 +305,9 @@ export class CustomTrapdoors extends Feature {
|
|
|
303
305
|
|
|
304
306
|
private checkSecondPixelationHalfWay() {
|
|
305
307
|
if (
|
|
306
|
-
|
|
308
|
+
v.run.state !==
|
|
307
309
|
StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY ||
|
|
308
|
-
|
|
310
|
+
v.run.stateRenderFrame === null
|
|
309
311
|
) {
|
|
310
312
|
return;
|
|
311
313
|
}
|
|
@@ -314,18 +316,18 @@ export class CustomTrapdoors extends Feature {
|
|
|
314
316
|
const renderFrameCount = Isaac.GetFrameCount();
|
|
315
317
|
|
|
316
318
|
const renderFrameScreenBlack =
|
|
317
|
-
|
|
319
|
+
v.run.stateRenderFrame + PIXELATION_TO_BLACK_FRAMES;
|
|
318
320
|
if (renderFrameCount < renderFrameScreenBlack) {
|
|
319
321
|
return;
|
|
320
322
|
}
|
|
321
323
|
|
|
322
|
-
|
|
324
|
+
v.run.state = StageTravelState.PIXELATION_TO_ROOM;
|
|
323
325
|
this.logStateChanged();
|
|
324
326
|
|
|
325
327
|
hud.SetVisible(true);
|
|
326
328
|
|
|
327
329
|
this.runNextRoom.runNextRoom(() => {
|
|
328
|
-
|
|
330
|
+
v.run.state = StageTravelState.PLAYERS_LAYING_DOWN;
|
|
329
331
|
this.logStateChanged();
|
|
330
332
|
|
|
331
333
|
// After the room transition, the players will be placed next to a door, but they should be in
|
|
@@ -351,7 +353,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
351
353
|
}
|
|
352
354
|
|
|
353
355
|
private checkAllPlayersLayingDownComplete() {
|
|
354
|
-
if (
|
|
356
|
+
if (v.run.state !== StageTravelState.PLAYERS_LAYING_DOWN) {
|
|
355
357
|
return;
|
|
356
358
|
}
|
|
357
359
|
|
|
@@ -359,7 +361,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
359
361
|
return;
|
|
360
362
|
}
|
|
361
363
|
|
|
362
|
-
|
|
364
|
+
v.run.state = StageTravelState.NONE;
|
|
363
365
|
this.logStateChanged();
|
|
364
366
|
|
|
365
367
|
const tstlClassName = getTSTLClassName(this);
|
|
@@ -374,9 +376,8 @@ export class CustomTrapdoors extends Feature {
|
|
|
374
376
|
|
|
375
377
|
private drawBlackSprite(): void {
|
|
376
378
|
if (
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.v.run.state !==
|
|
379
|
+
v.run.state !== StageTravelState.WAITING_FOR_FIRST_PIXELATION_TO_END &&
|
|
380
|
+
v.run.state !==
|
|
380
381
|
StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY
|
|
381
382
|
) {
|
|
382
383
|
return;
|
|
@@ -397,8 +398,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
397
398
|
const roomListIndex = getRoomListIndex();
|
|
398
399
|
const gridIndex = gridEntity.GetGridIndex();
|
|
399
400
|
|
|
400
|
-
const roomTrapdoorMap =
|
|
401
|
-
this.v.level.trapdoors.getAndSetDefault(roomListIndex);
|
|
401
|
+
const roomTrapdoorMap = v.level.trapdoors.getAndSetDefault(roomListIndex);
|
|
402
402
|
const trapdoorDescription = roomTrapdoorMap.get(gridIndex);
|
|
403
403
|
if (trapdoorDescription === undefined) {
|
|
404
404
|
return;
|
|
@@ -459,7 +459,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
459
459
|
gridEntity: GridEntity,
|
|
460
460
|
trapdoorDescription: CustomTrapdoorDescription,
|
|
461
461
|
): void {
|
|
462
|
-
if (
|
|
462
|
+
if (v.run.state !== StageTravelState.NONE) {
|
|
463
463
|
return;
|
|
464
464
|
}
|
|
465
465
|
|
|
@@ -499,8 +499,8 @@ export class CustomTrapdoors extends Feature {
|
|
|
499
499
|
trapdoorDescription: CustomTrapdoorDescription,
|
|
500
500
|
player: EntityPlayer,
|
|
501
501
|
) {
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
v.run.state = StageTravelState.PLAYERS_JUMPING_DOWN;
|
|
503
|
+
v.run.customTrapdoorActivated = trapdoorDescription;
|
|
504
504
|
this.logStateChanged();
|
|
505
505
|
|
|
506
506
|
const tstlClassName = getTSTLClassName(this);
|
|
@@ -556,7 +556,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
556
556
|
startPos: Vector,
|
|
557
557
|
endPos: Vector,
|
|
558
558
|
) {
|
|
559
|
-
if (
|
|
559
|
+
if (v.run.state !== StageTravelState.PLAYERS_JUMPING_DOWN) {
|
|
560
560
|
return;
|
|
561
561
|
}
|
|
562
562
|
|
|
@@ -607,7 +607,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
607
607
|
};
|
|
608
608
|
|
|
609
609
|
private checkJumpComplete(player: EntityPlayer) {
|
|
610
|
-
if (
|
|
610
|
+
if (v.run.state !== StageTravelState.PLAYERS_JUMPING_DOWN) {
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
613
|
|
|
@@ -652,9 +652,9 @@ export class CustomTrapdoors extends Feature {
|
|
|
652
652
|
private logStateChanged(): void {
|
|
653
653
|
if (DEBUG) {
|
|
654
654
|
log(
|
|
655
|
-
`Custom trapdoors state changed: ${
|
|
656
|
-
|
|
657
|
-
}
|
|
655
|
+
`Custom trapdoors state changed: ${StageTravelState[v.run.state]} (${
|
|
656
|
+
v.run.state
|
|
657
|
+
})`,
|
|
658
658
|
);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
@@ -781,8 +781,7 @@ export class CustomTrapdoors extends Feature {
|
|
|
781
781
|
? this.shouldTrapdoorSpawnOpen(gridEntity, firstSpawn)
|
|
782
782
|
: spawnOpen;
|
|
783
783
|
|
|
784
|
-
const roomTrapdoorMap =
|
|
785
|
-
this.v.level.trapdoors.getAndSetDefault(roomListIndex);
|
|
784
|
+
const roomTrapdoorMap = v.level.trapdoors.getAndSetDefault(roomListIndex);
|
|
786
785
|
const customTrapdoorDescription: CustomTrapdoorDescription = {
|
|
787
786
|
destinationName,
|
|
788
787
|
destinationStage,
|
|
@@ -4,13 +4,15 @@ import { Exported } from "../../../decorators";
|
|
|
4
4
|
import { stopAllSoundEffects } from "../../../functions/sound";
|
|
5
5
|
import { Feature } from "../../private/Feature";
|
|
6
6
|
|
|
7
|
+
const v = {
|
|
8
|
+
run: {
|
|
9
|
+
disableSoundSet: new Set<string>(),
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
7
13
|
export class DisableAllSound extends Feature {
|
|
8
14
|
/** @internal */
|
|
9
|
-
public override v =
|
|
10
|
-
run: {
|
|
11
|
-
disableSoundSet: new Set<string>(),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
15
|
+
public override v = v;
|
|
14
16
|
|
|
15
17
|
private musicWasEnabled = false;
|
|
16
18
|
|
|
@@ -26,7 +28,7 @@ export class DisableAllSound extends Feature {
|
|
|
26
28
|
|
|
27
29
|
// ModCallback.POST_RENDER (2)
|
|
28
30
|
private postRender = () => {
|
|
29
|
-
if (
|
|
31
|
+
if (v.run.disableSoundSet.size === 0) {
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -45,12 +47,12 @@ export class DisableAllSound extends Feature {
|
|
|
45
47
|
*/
|
|
46
48
|
@Exported
|
|
47
49
|
public enableAllSound(key: string): void {
|
|
48
|
-
if (!
|
|
50
|
+
if (!v.run.disableSoundSet.has(key)) {
|
|
49
51
|
return;
|
|
50
52
|
}
|
|
51
|
-
|
|
53
|
+
v.run.disableSoundSet.delete(key);
|
|
52
54
|
|
|
53
|
-
if (
|
|
55
|
+
if (v.run.disableSoundSet.size === 0 && this.musicWasEnabled) {
|
|
54
56
|
musicManager.Enable();
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -71,11 +73,11 @@ export class DisableAllSound extends Feature {
|
|
|
71
73
|
*/
|
|
72
74
|
@Exported
|
|
73
75
|
public disableAllSound(key: string): void {
|
|
74
|
-
if (
|
|
76
|
+
if (v.run.disableSoundSet.size === 0) {
|
|
75
77
|
this.musicWasEnabled = musicManager.IsEnabled();
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
v.run.disableSoundSet.add(key);
|
|
79
81
|
|
|
80
82
|
// Stop all sound effects that were initialized prior to disabling sounds.
|
|
81
83
|
stopAllSoundEffects();
|