isaacscript-common 25.2.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 +27 -2
- package/dist/isaacscript-common.lua +803 -693
- package/dist/src/classes/ModFeature.d.ts.map +1 -1
- package/dist/src/classes/ModFeature.lua +12 -5
- 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/functions/decorators.d.ts +15 -0
- package/dist/src/functions/decorators.d.ts.map +1 -1
- package/dist/src/functions/decorators.lua +21 -5
- 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/ModFeature.ts +16 -4
- 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/functions/decorators.ts +45 -4
- package/src/interfaces/SaveData.ts +0 -1
- package/src/interfaces/private/AddCallbackParametersCustom.ts +2 -0
- package/src/shouldFire.ts +10 -0
|
@@ -7,33 +7,35 @@ import { Exported } from "../../../decorators";
|
|
|
7
7
|
import { getMoveActions, getShootActions } from "../../../functions/input";
|
|
8
8
|
import { Feature } from "../../private/Feature";
|
|
9
9
|
|
|
10
|
+
const v = {
|
|
11
|
+
run: {
|
|
12
|
+
/**
|
|
13
|
+
* Glowing Hour Glass support is disabled by default since it can cause bugs with extra-gameplay
|
|
14
|
+
* features. (For example, whether the player should be able to move or not should often not be
|
|
15
|
+
* reset by the Glowing Hour Glass.)
|
|
16
|
+
*/
|
|
17
|
+
__ignoreGlowingHourGlass: true,
|
|
18
|
+
|
|
19
|
+
/** Indexed by the requesting feature key. */
|
|
20
|
+
disableInputs: new Map<string, ReadonlySet<ButtonAction>>(),
|
|
21
|
+
|
|
22
|
+
/** Indexed by the requesting feature key. */
|
|
23
|
+
enableAllInputsWithBlacklistMap: new Map<
|
|
24
|
+
string,
|
|
25
|
+
ReadonlySet<ButtonAction>
|
|
26
|
+
>(),
|
|
27
|
+
|
|
28
|
+
/** Indexed by the requesting feature key. */
|
|
29
|
+
disableAllInputsWithWhitelistMap: new Map<
|
|
30
|
+
string,
|
|
31
|
+
ReadonlySet<ButtonAction>
|
|
32
|
+
>(),
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
10
36
|
export class DisableInputs extends Feature {
|
|
11
37
|
/** @internal */
|
|
12
|
-
public override v =
|
|
13
|
-
run: {
|
|
14
|
-
/**
|
|
15
|
-
* Glowing Hour Glass support is disabled by default since it can cause bugs with
|
|
16
|
-
* extra-gameplay features. (For example, whether the player should be able to move or not
|
|
17
|
-
* should often not be reset by the Glowing Hour Glass.)
|
|
18
|
-
*/
|
|
19
|
-
__ignoreGlowingHourGlass: true,
|
|
20
|
-
|
|
21
|
-
/** Indexed by the requesting feature key. */
|
|
22
|
-
disableInputs: new Map<string, ReadonlySet<ButtonAction>>(),
|
|
23
|
-
|
|
24
|
-
/** Indexed by the requesting feature key. */
|
|
25
|
-
enableAllInputsWithBlacklistMap: new Map<
|
|
26
|
-
string,
|
|
27
|
-
ReadonlySet<ButtonAction>
|
|
28
|
-
>(),
|
|
29
|
-
|
|
30
|
-
/** Indexed by the requesting feature key. */
|
|
31
|
-
disableAllInputsWithWhitelistMap: new Map<
|
|
32
|
-
string,
|
|
33
|
-
ReadonlySet<ButtonAction>
|
|
34
|
-
>(),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
38
|
+
public override v = v;
|
|
37
39
|
|
|
38
40
|
/** @internal */
|
|
39
41
|
constructor() {
|
|
@@ -87,19 +89,19 @@ export class DisableInputs extends Feature {
|
|
|
87
89
|
private getReturnValue(buttonAction: ButtonAction, booleanCallback: boolean) {
|
|
88
90
|
const disableValue = booleanCallback ? false : 0;
|
|
89
91
|
|
|
90
|
-
for (const blacklist of
|
|
92
|
+
for (const blacklist of v.run.disableInputs.values()) {
|
|
91
93
|
if (blacklist.has(buttonAction)) {
|
|
92
94
|
return disableValue;
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
for (const whitelist of
|
|
98
|
+
for (const whitelist of v.run.disableAllInputsWithWhitelistMap.values()) {
|
|
97
99
|
if (!whitelist.has(buttonAction)) {
|
|
98
100
|
return disableValue;
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
for (const blacklist of
|
|
104
|
+
for (const blacklist of v.run.enableAllInputsWithBlacklistMap.values()) {
|
|
103
105
|
if (blacklist.has(buttonAction)) {
|
|
104
106
|
return disableValue;
|
|
105
107
|
}
|
|
@@ -119,8 +121,8 @@ export class DisableInputs extends Feature {
|
|
|
119
121
|
*/
|
|
120
122
|
@Exported
|
|
121
123
|
public enableAllInputs(key: string): void {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
v.run.disableAllInputsWithWhitelistMap.delete(key);
|
|
125
|
+
v.run.enableAllInputsWithBlacklistMap.delete(key);
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
/**
|
|
@@ -140,7 +142,7 @@ export class DisableInputs extends Feature {
|
|
|
140
142
|
@Exported
|
|
141
143
|
public disableInputs(key: string, ...buttonActions: ButtonAction[]): void {
|
|
142
144
|
const buttonActionsSet = new Set(buttonActions);
|
|
143
|
-
|
|
145
|
+
v.run.disableInputs.set(key, buttonActionsSet);
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
/**
|
|
@@ -156,8 +158,8 @@ export class DisableInputs extends Feature {
|
|
|
156
158
|
*/
|
|
157
159
|
@Exported
|
|
158
160
|
public disableAllInputs(key: string): void {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
v.run.disableAllInputsWithWhitelistMap.set(key, new Set());
|
|
162
|
+
v.run.enableAllInputsWithBlacklistMap.delete(key);
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
/**
|
|
@@ -177,8 +179,8 @@ export class DisableInputs extends Feature {
|
|
|
177
179
|
key: string,
|
|
178
180
|
blacklist: Set<ButtonAction> | ReadonlySet<ButtonAction>,
|
|
179
181
|
): void {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
v.run.disableAllInputsWithWhitelistMap.delete(key);
|
|
183
|
+
v.run.enableAllInputsWithBlacklistMap.set(key, blacklist);
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
/**
|
|
@@ -198,8 +200,8 @@ export class DisableInputs extends Feature {
|
|
|
198
200
|
key: string,
|
|
199
201
|
whitelist: Set<ButtonAction> | ReadonlySet<ButtonAction>,
|
|
200
202
|
): void {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
v.run.disableAllInputsWithWhitelistMap.set(key, whitelist);
|
|
204
|
+
v.run.enableAllInputsWithBlacklistMap.delete(key);
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
/**
|
|
@@ -78,7 +78,7 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
78
78
|
|
|
79
79
|
// ModCallback.POST_UPDATE (1)
|
|
80
80
|
private postUpdate = () => {
|
|
81
|
-
if (
|
|
81
|
+
if (v.persistent.spamBloodRights) {
|
|
82
82
|
const player = Isaac.GetPlayer();
|
|
83
83
|
player.UseActiveItem(CollectibleType.BLOOD_RIGHTS);
|
|
84
84
|
}
|
|
@@ -87,31 +87,31 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
87
87
|
// ModCallback.EVALUATE_CACHE (8)
|
|
88
88
|
// CacheFlag.DAMAGE (1 << 0)
|
|
89
89
|
private evaluateCacheDamage = (player: EntityPlayer) => {
|
|
90
|
-
if (
|
|
91
|
-
player.Damage =
|
|
90
|
+
if (v.persistent.damage) {
|
|
91
|
+
player.Damage = v.persistent.damageAmount;
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
// ModCallback.EVALUATE_CACHE (8)
|
|
96
96
|
// CacheFlag.FIRE_DELAY (1 << 1)
|
|
97
97
|
private evaluateCacheFireDelay = (player: EntityPlayer) => {
|
|
98
|
-
if (
|
|
99
|
-
player.FireDelay =
|
|
98
|
+
if (v.persistent.tears) {
|
|
99
|
+
player.FireDelay = v.persistent.tearsAmount;
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
// ModCallback.EVALUATE_CACHE (8)
|
|
104
104
|
// CacheFlag.SPEED (1 << 4)
|
|
105
105
|
private evaluateCacheSpeed = (player: EntityPlayer) => {
|
|
106
|
-
if (
|
|
107
|
-
player.MoveSpeed =
|
|
106
|
+
if (v.persistent.speed) {
|
|
107
|
+
player.MoveSpeed = v.persistent.speedAmount;
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
// ModCallback.EVALUATE_CACHE (8)
|
|
112
112
|
// CacheFlag.FLYING (1 << 7)
|
|
113
113
|
private evaluateCacheFlying = (player: EntityPlayer) => {
|
|
114
|
-
if (
|
|
114
|
+
if (v.persistent.flight) {
|
|
115
115
|
player.CanFly = true;
|
|
116
116
|
}
|
|
117
117
|
};
|
|
@@ -120,49 +120,49 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
120
120
|
private postCurseEval = (
|
|
121
121
|
curses: BitFlags<LevelCurse>,
|
|
122
122
|
): BitFlags<LevelCurse> | undefined => {
|
|
123
|
-
if (
|
|
123
|
+
if (v.persistent.disableCurses) {
|
|
124
124
|
return bitFlags(LevelCurse.NONE);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
let newCurses = curses;
|
|
128
128
|
|
|
129
129
|
// 1
|
|
130
|
-
if (
|
|
130
|
+
if (v.persistent.darkness) {
|
|
131
131
|
newCurses = addFlag(newCurses, LevelCurse.DARKNESS);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// 2
|
|
135
|
-
if (
|
|
135
|
+
if (v.persistent.labyrinth) {
|
|
136
136
|
newCurses = addFlag(newCurses, LevelCurse.LABYRINTH);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
// 3
|
|
140
|
-
if (
|
|
140
|
+
if (v.persistent.lost) {
|
|
141
141
|
newCurses = addFlag(newCurses, LevelCurse.LOST);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// 4
|
|
145
|
-
if (
|
|
145
|
+
if (v.persistent.unknown) {
|
|
146
146
|
newCurses = addFlag(newCurses, LevelCurse.UNKNOWN);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
// 5
|
|
150
|
-
if (
|
|
150
|
+
if (v.persistent.cursed) {
|
|
151
151
|
newCurses = addFlag(newCurses, LevelCurse.CURSED);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
// 6
|
|
155
|
-
if (
|
|
155
|
+
if (v.persistent.maze) {
|
|
156
156
|
newCurses = addFlag(newCurses, LevelCurse.MAZE);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
// 7
|
|
160
|
-
if (
|
|
160
|
+
if (v.persistent.blind) {
|
|
161
161
|
newCurses = addFlag(newCurses, LevelCurse.BLIND);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
// 8
|
|
165
|
-
if (
|
|
165
|
+
if (v.persistent.giant) {
|
|
166
166
|
newCurses = addFlag(newCurses, LevelCurse.GIANT);
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -185,7 +185,7 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
185
185
|
|
|
186
186
|
// ModCallback.POST_FIRE_TEAR (61)
|
|
187
187
|
private postFireTear = (tear: EntityTear) => {
|
|
188
|
-
if (
|
|
188
|
+
if (v.persistent.chaosCardTears) {
|
|
189
189
|
tear.ChangeVariant(TearVariant.CHAOS_CARD);
|
|
190
190
|
}
|
|
191
191
|
};
|
|
@@ -198,7 +198,7 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
198
198
|
_damageSource: EntityRef,
|
|
199
199
|
_damageCountdownFrames: int,
|
|
200
200
|
) => {
|
|
201
|
-
if (
|
|
201
|
+
if (v.persistent.spamBloodRights) {
|
|
202
202
|
return false;
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -6,15 +6,17 @@ import {
|
|
|
6
6
|
import { Exported } from "../../../decorators";
|
|
7
7
|
import { Feature } from "../../private/Feature";
|
|
8
8
|
|
|
9
|
+
const v = {
|
|
10
|
+
run: {
|
|
11
|
+
familiarBlacklist: [] as Array<
|
|
12
|
+
[variant: FamiliarVariant, subType: int | undefined]
|
|
13
|
+
>,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
9
17
|
export class NoSirenSteal extends Feature {
|
|
10
18
|
/** @internal */
|
|
11
|
-
public override v =
|
|
12
|
-
run: {
|
|
13
|
-
familiarBlacklist: [] as Array<
|
|
14
|
-
[variant: FamiliarVariant, subType: int | undefined]
|
|
15
|
-
>,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
19
|
+
public override v = v;
|
|
18
20
|
|
|
19
21
|
/** @internal */
|
|
20
22
|
constructor() {
|
|
@@ -56,7 +58,7 @@ export class NoSirenSteal extends Feature {
|
|
|
56
58
|
incomingFamiliarVariant: FamiliarVariant,
|
|
57
59
|
incomingFamiliarSubType: int | undefined,
|
|
58
60
|
): boolean {
|
|
59
|
-
for (const familiarTuple of
|
|
61
|
+
for (const familiarTuple of v.run.familiarBlacklist) {
|
|
60
62
|
const [familiarVariant, familiarSubType] = familiarTuple;
|
|
61
63
|
|
|
62
64
|
if (
|
|
@@ -98,6 +100,6 @@ export class NoSirenSteal extends Feature {
|
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
|
|
103
|
+
v.run.familiarBlacklist.push([familiarVariant, familiarSubType]);
|
|
102
104
|
}
|
|
103
105
|
}
|
|
@@ -29,15 +29,17 @@ interface InitialDescription {
|
|
|
29
29
|
fallingAcceleration: float;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
const v = {
|
|
33
|
+
run: {
|
|
34
|
+
isPseudoPaused: false,
|
|
35
|
+
shouldUnpause: false,
|
|
36
|
+
initialDescriptions: new Map<PtrHash, InitialDescription>(),
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
32
40
|
export class Pause extends Feature {
|
|
33
41
|
/** @internal */
|
|
34
|
-
public override v =
|
|
35
|
-
run: {
|
|
36
|
-
isPseudoPaused: false,
|
|
37
|
-
shouldUnpause: false,
|
|
38
|
-
initialDescriptions: new Map<PtrHash, InitialDescription>(),
|
|
39
|
-
},
|
|
40
|
-
};
|
|
42
|
+
public override v = v;
|
|
41
43
|
|
|
42
44
|
private disableInputs: DisableInputs;
|
|
43
45
|
|
|
@@ -62,7 +64,7 @@ export class Pause extends Feature {
|
|
|
62
64
|
|
|
63
65
|
// ModCallback.POST_UPDATE (1)
|
|
64
66
|
private postUpdate = () => {
|
|
65
|
-
if (!
|
|
67
|
+
if (!v.run.isPseudoPaused) {
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -77,7 +79,7 @@ export class Pause extends Feature {
|
|
|
77
79
|
|
|
78
80
|
for (const tearOrProjectile of tearsAndProjectiles) {
|
|
79
81
|
const ptrHash = GetPtrHash(tearOrProjectile);
|
|
80
|
-
const initialDescription =
|
|
82
|
+
const initialDescription = v.run.initialDescriptions.get(ptrHash);
|
|
81
83
|
if (initialDescription === undefined) {
|
|
82
84
|
continue;
|
|
83
85
|
}
|
|
@@ -107,10 +109,10 @@ export class Pause extends Feature {
|
|
|
107
109
|
return;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
if (!
|
|
112
|
+
if (!v.run.shouldUnpause) {
|
|
111
113
|
return;
|
|
112
114
|
}
|
|
113
|
-
|
|
115
|
+
v.run.shouldUnpause = false;
|
|
114
116
|
|
|
115
117
|
// Returning a value of 1 for a single sub-frame will be enough for the game to register an
|
|
116
118
|
// unpause but not enough for a tear to actually be fired.
|
|
@@ -119,7 +121,7 @@ export class Pause extends Feature {
|
|
|
119
121
|
|
|
120
122
|
@Exported
|
|
121
123
|
public isPaused(): boolean {
|
|
122
|
-
return
|
|
124
|
+
return v.run.isPseudoPaused;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
/**
|
|
@@ -135,18 +137,18 @@ export class Pause extends Feature {
|
|
|
135
137
|
*/
|
|
136
138
|
@Exported
|
|
137
139
|
public pause(): void {
|
|
138
|
-
if (
|
|
140
|
+
if (v.run.isPseudoPaused) {
|
|
139
141
|
logError(
|
|
140
142
|
"Failed to pseudo-pause the game, since it was already pseudo-paused.",
|
|
141
143
|
);
|
|
142
144
|
return;
|
|
143
145
|
}
|
|
144
|
-
|
|
146
|
+
v.run.isPseudoPaused = true;
|
|
145
147
|
|
|
146
148
|
// Tears/projectiles in the room will move slightly on every frame, even when the Pause
|
|
147
149
|
// collectible is active. Thus, we manually reset the initial positions and heights on every
|
|
148
150
|
// frame.
|
|
149
|
-
|
|
151
|
+
v.run.initialDescriptions.clear();
|
|
150
152
|
const tearsAndProjectiles = [...getTears(), ...getProjectiles()];
|
|
151
153
|
for (const tearOrProjectile of tearsAndProjectiles) {
|
|
152
154
|
const ptrHash = GetPtrHash(tearOrProjectile);
|
|
@@ -160,7 +162,7 @@ export class Pause extends Feature {
|
|
|
160
162
|
? tearOrProjectile.FallingAcceleration
|
|
161
163
|
: tearOrProjectile.FallingAccel,
|
|
162
164
|
};
|
|
163
|
-
|
|
165
|
+
v.run.initialDescriptions.set(ptrHash, initialDescription);
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
const firstPlayer = Isaac.GetPlayer();
|
|
@@ -197,14 +199,14 @@ export class Pause extends Feature {
|
|
|
197
199
|
*/
|
|
198
200
|
@Exported
|
|
199
201
|
public unpause(): void {
|
|
200
|
-
if (!
|
|
202
|
+
if (!v.run.isPseudoPaused) {
|
|
201
203
|
logError(
|
|
202
204
|
"Failed to pseudo-unpause the game, since it was not already pseudo-paused.",
|
|
203
205
|
);
|
|
204
206
|
return;
|
|
205
207
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
v.run.isPseudoPaused = false;
|
|
209
|
+
v.run.shouldUnpause = true;
|
|
208
210
|
|
|
209
211
|
const tstlClassName = getTSTLClassName(this);
|
|
210
212
|
if (tstlClassName === undefined) {
|
|
@@ -23,28 +23,30 @@ interface PersistentEntityDescription {
|
|
|
23
23
|
|
|
24
24
|
type PersistentEntityTuple = [index: int, entityPtr: EntityPtr];
|
|
25
25
|
|
|
26
|
+
const v = {
|
|
27
|
+
run: {
|
|
28
|
+
/** Iterates upward as new persistent entities are created. */
|
|
29
|
+
persistentEntityIndexCounter: 0,
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
level: {
|
|
33
|
+
/**
|
|
34
|
+
* Indexed by persistent entity index.
|
|
35
|
+
*
|
|
36
|
+
* When the entity is spawned in the currently room, its corresponding entry in this map will be
|
|
37
|
+
* temporarily deleted (until the entity itself is despawned).
|
|
38
|
+
*/
|
|
39
|
+
persistentEntities: new Map<int, PersistentEntityDescription>(),
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
room: {
|
|
43
|
+
spawnedPersistentEntities: new Map<PtrHash, PersistentEntityTuple>(),
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
26
47
|
export class PersistentEntities extends Feature {
|
|
27
48
|
/** @internal */
|
|
28
|
-
public override v =
|
|
29
|
-
run: {
|
|
30
|
-
/** Iterates upward as new persistent entities are created. */
|
|
31
|
-
persistentEntityIndexCounter: 0,
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
level: {
|
|
35
|
-
/**
|
|
36
|
-
* Indexed by persistent entity index.
|
|
37
|
-
*
|
|
38
|
-
* When the entity is spawned in the currently room, its corresponding entry in this map will
|
|
39
|
-
* be temporarily deleted (until the entity itself is despawned).
|
|
40
|
-
*/
|
|
41
|
-
persistentEntities: new Map<int, PersistentEntityDescription>(),
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
room: {
|
|
45
|
-
spawnedPersistentEntities: new Map<PtrHash, PersistentEntityTuple>(),
|
|
46
|
-
},
|
|
47
|
-
};
|
|
49
|
+
public override v = v;
|
|
48
50
|
|
|
49
51
|
private roomHistory: RoomHistory;
|
|
50
52
|
|
|
@@ -69,7 +71,7 @@ export class PersistentEntities extends Feature {
|
|
|
69
71
|
// ModCallback.POST_ENTITY_REMOVE (67)
|
|
70
72
|
private postEntityRemove = (entity: Entity) => {
|
|
71
73
|
const ptrHash = GetPtrHash(entity);
|
|
72
|
-
const tuple =
|
|
74
|
+
const tuple = v.room.spawnedPersistentEntities.get(ptrHash);
|
|
73
75
|
if (tuple === undefined) {
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
@@ -105,19 +107,19 @@ export class PersistentEntities extends Feature {
|
|
|
105
107
|
roomListIndex: previousRoomDescription.roomListIndex,
|
|
106
108
|
position: entity.Position,
|
|
107
109
|
};
|
|
108
|
-
|
|
110
|
+
v.level.persistentEntities.set(index, persistentEntityDescription);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
// ModCallbackCustom.POST_NEW_ROOM_REORDERED
|
|
112
114
|
private postNewRoomReordered = () => {
|
|
113
115
|
const roomListIndex = getRoomListIndex();
|
|
114
|
-
const persistentEntities = [...
|
|
116
|
+
const persistentEntities = [...v.level.persistentEntities.entries()];
|
|
115
117
|
const persistentEntitiesInThisRoom = persistentEntities.filter(
|
|
116
118
|
([_index, description]) => roomListIndex === description.roomListIndex,
|
|
117
119
|
);
|
|
118
120
|
|
|
119
121
|
for (const [index, description] of persistentEntitiesInThisRoom) {
|
|
120
|
-
|
|
122
|
+
v.level.persistentEntities.delete(index);
|
|
121
123
|
this.spawnAndTrack(
|
|
122
124
|
description.entityType,
|
|
123
125
|
description.variant,
|
|
@@ -146,7 +148,7 @@ export class PersistentEntities extends Feature {
|
|
|
146
148
|
|
|
147
149
|
// Keep track that we spawned it so that we can respawn it if the player re-enters the room.
|
|
148
150
|
const tuple: [int, EntityPtr] = [index, EntityPtr(entity)];
|
|
149
|
-
|
|
151
|
+
v.room.spawnedPersistentEntities.set(ptrHash, tuple);
|
|
150
152
|
|
|
151
153
|
return entity;
|
|
152
154
|
}
|
|
@@ -168,15 +170,15 @@ export class PersistentEntities extends Feature {
|
|
|
168
170
|
persistentEntityIndex: int,
|
|
169
171
|
removeEntity = true,
|
|
170
172
|
): void {
|
|
171
|
-
|
|
173
|
+
v.level.persistentEntities.delete(persistentEntityIndex);
|
|
172
174
|
|
|
173
|
-
for (const [ptrHash, tuple] of
|
|
175
|
+
for (const [ptrHash, tuple] of v.room.spawnedPersistentEntities) {
|
|
174
176
|
const [index, entityPtr] = tuple;
|
|
175
177
|
if (index !== persistentEntityIndex) {
|
|
176
178
|
continue;
|
|
177
179
|
}
|
|
178
180
|
|
|
179
|
-
|
|
181
|
+
v.room.spawnedPersistentEntities.delete(ptrHash);
|
|
180
182
|
|
|
181
183
|
if (removeEntity && entityPtr.Ref !== undefined) {
|
|
182
184
|
entityPtr.Ref.Remove();
|
|
@@ -209,16 +211,16 @@ export class PersistentEntities extends Feature {
|
|
|
209
211
|
subType: int,
|
|
210
212
|
position: Vector,
|
|
211
213
|
): [Entity, int] {
|
|
212
|
-
|
|
214
|
+
v.run.persistentEntityIndexCounter++;
|
|
213
215
|
|
|
214
216
|
const entity = this.spawnAndTrack(
|
|
215
217
|
entityType,
|
|
216
218
|
variant,
|
|
217
219
|
subType,
|
|
218
220
|
position,
|
|
219
|
-
|
|
221
|
+
v.run.persistentEntityIndexCounter,
|
|
220
222
|
);
|
|
221
223
|
|
|
222
|
-
return [entity,
|
|
224
|
+
return [entity, v.run.persistentEntityIndexCounter];
|
|
223
225
|
}
|
|
224
226
|
}
|
|
@@ -21,28 +21,30 @@ interface PickupDescription {
|
|
|
21
21
|
initSeed: Seed;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
const v = {
|
|
25
|
+
run: {
|
|
26
|
+
/** Is incremented before assignment. Thus, the first pickup will have an index of 1. */
|
|
27
|
+
pickupCounter: 0 as PickupIndex,
|
|
28
|
+
|
|
29
|
+
pickupDataTreasureRooms: new Map<PickupIndex, PickupDescription>(),
|
|
30
|
+
pickupDataBossRooms: new Map<PickupIndex, PickupDescription>(),
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
level: {
|
|
34
|
+
/** Indexed by room list index. */
|
|
35
|
+
pickupData: new DefaultMap<int, Map<PickupIndex, PickupDescription>>(
|
|
36
|
+
() => new Map(),
|
|
37
|
+
),
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
room: {
|
|
41
|
+
pickupIndexes: new Map<PtrHash, PickupIndex>(),
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
24
45
|
export class PickupIndexCreation extends Feature {
|
|
25
46
|
/** @internal */
|
|
26
|
-
public override v =
|
|
27
|
-
run: {
|
|
28
|
-
/** Is incremented before assignment. Thus, the first pickup will have an index of 1. */
|
|
29
|
-
pickupCounter: 0 as PickupIndex,
|
|
30
|
-
|
|
31
|
-
pickupDataTreasureRooms: new Map<PickupIndex, PickupDescription>(),
|
|
32
|
-
pickupDataBossRooms: new Map<PickupIndex, PickupDescription>(),
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
level: {
|
|
36
|
-
/** Indexed by room list index. */
|
|
37
|
-
pickupData: new DefaultMap<int, Map<PickupIndex, PickupDescription>>(
|
|
38
|
-
() => new Map(),
|
|
39
|
-
),
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
room: {
|
|
43
|
-
pickupIndexes: new Map<PtrHash, PickupIndex>(),
|
|
44
|
-
},
|
|
45
|
-
};
|
|
47
|
+
public override v = v;
|
|
46
48
|
|
|
47
49
|
private roomHistory: RoomHistory;
|
|
48
50
|
private saveDataManager: SaveDataManager;
|
|
@@ -81,7 +83,7 @@ export class PickupIndexCreation extends Feature {
|
|
|
81
83
|
// callback but should not incur a new pickup counter. (For example, the collectible rotation
|
|
82
84
|
// with Tainted Isaac.) For these situations, we will already be tracking an index for this
|
|
83
85
|
// pointer hash.
|
|
84
|
-
if (
|
|
86
|
+
if (v.room.pickupIndexes.has(ptrHash)) {
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
89
|
|
|
@@ -97,13 +99,13 @@ export class PickupIndexCreation extends Feature {
|
|
|
97
99
|
!isFirstVisit &&
|
|
98
100
|
roomFrameCount <= 0
|
|
99
101
|
) {
|
|
100
|
-
|
|
102
|
+
v.room.pickupIndexes.set(ptrHash, pickupIndexFromLevelData);
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
// This is a brand new pickup that we have not previously seen on this run.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
v.run.pickupCounter++;
|
|
108
|
+
v.room.pickupIndexes.set(ptrHash, v.run.pickupCounter);
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
private getPickupIndexFromPreviousData(
|
|
@@ -111,7 +113,7 @@ export class PickupIndexCreation extends Feature {
|
|
|
111
113
|
): PickupIndex | undefined {
|
|
112
114
|
const roomListIndex = getRoomListIndex();
|
|
113
115
|
const pickupDescriptions =
|
|
114
|
-
|
|
116
|
+
v.level.pickupData.getAndSetDefault(roomListIndex);
|
|
115
117
|
|
|
116
118
|
let pickupIndex = getStoredPickupIndex(pickup, pickupDescriptions);
|
|
117
119
|
if (pickupIndex === undefined) {
|
|
@@ -129,7 +131,7 @@ export class PickupIndexCreation extends Feature {
|
|
|
129
131
|
|
|
130
132
|
private checkDespawningFromPlayerLeavingRoom(entity: Entity) {
|
|
131
133
|
const ptrHash = GetPtrHash(entity);
|
|
132
|
-
const pickupIndex =
|
|
134
|
+
const pickupIndex = v.room.pickupIndexes.get(ptrHash);
|
|
133
135
|
if (pickupIndex === undefined) {
|
|
134
136
|
return;
|
|
135
137
|
}
|
|
@@ -157,7 +159,7 @@ export class PickupIndexCreation extends Feature {
|
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
const previousRoomListIndex = previousRoomDescription.roomListIndex;
|
|
160
|
-
const pickupDescriptions =
|
|
162
|
+
const pickupDescriptions = v.level.pickupData.getAndSetDefault(
|
|
161
163
|
previousRoomListIndex,
|
|
162
164
|
);
|
|
163
165
|
|
|
@@ -196,11 +198,11 @@ export class PickupIndexCreation extends Feature {
|
|
|
196
198
|
|
|
197
199
|
switch (roomType) {
|
|
198
200
|
case RoomType.TREASURE: {
|
|
199
|
-
return
|
|
201
|
+
return v.run.pickupDataTreasureRooms;
|
|
200
202
|
}
|
|
201
203
|
|
|
202
204
|
case RoomType.BOSS: {
|
|
203
|
-
return
|
|
205
|
+
return v.run.pickupDataBossRooms;
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
default: {
|
|
@@ -223,11 +225,11 @@ export class PickupIndexCreation extends Feature {
|
|
|
223
225
|
|
|
224
226
|
switch (roomType) {
|
|
225
227
|
case RoomType.TREASURE: {
|
|
226
|
-
return getStoredPickupIndex(pickup,
|
|
228
|
+
return getStoredPickupIndex(pickup, v.run.pickupDataTreasureRooms);
|
|
227
229
|
}
|
|
228
230
|
|
|
229
231
|
case RoomType.BOSS: {
|
|
230
|
-
return getStoredPickupIndex(pickup,
|
|
232
|
+
return getStoredPickupIndex(pickup, v.run.pickupDataBossRooms);
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
default: {
|
|
@@ -255,13 +257,13 @@ export class PickupIndexCreation extends Feature {
|
|
|
255
257
|
@Exported
|
|
256
258
|
public getPickupIndex(pickup: EntityPickup): PickupIndex {
|
|
257
259
|
const ptrHash = GetPtrHash(pickup);
|
|
258
|
-
const pickupIndexInitial =
|
|
260
|
+
const pickupIndexInitial = v.room.pickupIndexes.get(ptrHash);
|
|
259
261
|
if (pickupIndexInitial !== undefined) {
|
|
260
262
|
return pickupIndexInitial;
|
|
261
263
|
}
|
|
262
264
|
|
|
263
265
|
this.setPickupIndex(pickup);
|
|
264
|
-
const pickupIndex =
|
|
266
|
+
const pickupIndex = v.room.pickupIndexes.get(ptrHash);
|
|
265
267
|
if (pickupIndex !== undefined) {
|
|
266
268
|
return pickupIndex;
|
|
267
269
|
}
|