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
|
@@ -3,33 +3,34 @@ import { Exported } from "../../../decorators";
|
|
|
3
3
|
import { logError } from "../../../functions/logMisc";
|
|
4
4
|
import { Feature } from "../../private/Feature";
|
|
5
5
|
|
|
6
|
+
const v = {
|
|
7
|
+
run: {
|
|
8
|
+
queuedTaintedLazarus: [] as EntityPlayer[],
|
|
9
|
+
queuedDeadTaintedLazarus: [] as EntityPlayer[],
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The `POST_PLAYER_INIT` callback fires for Dead Tainted Lazarus at the beginning of the run.
|
|
13
|
+
* However, the player index for the Dead Tainted Lazarus player object at that time does not
|
|
14
|
+
* actually correspond to the player index for the real player once Flip has been used. Thus, we
|
|
15
|
+
* revert to using PtrHash as an index for our map, which is consistent between the Dead Tainted
|
|
16
|
+
* Lazarus object in the `POST_PLAYER_INIT` callback and the "real" Dead Tainted Lazarus.
|
|
17
|
+
*
|
|
18
|
+
* We use `EntityPlayer` as the value for the map instead of `EntityPtr` because using the
|
|
19
|
+
* pointer does not work for some reason. (When we unwrap it after one or more flips have been
|
|
20
|
+
* used, the pointers no longer point to the original objects, even if we manually update the
|
|
21
|
+
* pointers in the `POST_FLIP` callback.)
|
|
22
|
+
*/
|
|
23
|
+
subPlayerMap: new Map<PtrHash, EntityPlayer>(),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
6
27
|
/**
|
|
7
28
|
* This feature provides a way for end-users to get the `EntityPlayer` object for the other Tainted
|
|
8
29
|
* Lazarus.
|
|
9
30
|
*/
|
|
10
31
|
export class TaintedLazarusPlayers extends Feature {
|
|
11
32
|
/** @internal */
|
|
12
|
-
public override v =
|
|
13
|
-
run: {
|
|
14
|
-
queuedTaintedLazarus: [] as EntityPlayer[],
|
|
15
|
-
queuedDeadTaintedLazarus: [] as EntityPlayer[],
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The `POST_PLAYER_INIT` callback fires for Dead Tainted Lazarus at the beginning of the run.
|
|
19
|
-
* However, the player index for the Dead Tainted Lazarus player object at that time does not
|
|
20
|
-
* actually correspond to the player index for the real player once Flip has been used. Thus,
|
|
21
|
-
* we revert to using PtrHash as an index for our map, which is consistent between the Dead
|
|
22
|
-
* Tainted Lazarus object in the `POST_PLAYER_INIT` callback and the "real" Dead Tainted
|
|
23
|
-
* Lazarus.
|
|
24
|
-
*
|
|
25
|
-
* We use `EntityPlayer` as the value for the map instead of `EntityPtr` because using the
|
|
26
|
-
* pointer does not work for some reason. (When we unwrap it after one or more flips have been
|
|
27
|
-
* used, the pointers no longer point to the original objects, even if we manually update the
|
|
28
|
-
* pointers in the `POST_FLIP` callback.)
|
|
29
|
-
*/
|
|
30
|
-
subPlayerMap: new Map<PtrHash, EntityPlayer>(),
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
+
public override v = v;
|
|
33
34
|
|
|
34
35
|
public override vConditionalFunc = (): boolean => false;
|
|
35
36
|
|
|
@@ -48,9 +49,9 @@ export class TaintedLazarusPlayers extends Feature {
|
|
|
48
49
|
const character = player.GetPlayerType();
|
|
49
50
|
|
|
50
51
|
if (character === PlayerType.LAZARUS_B) {
|
|
51
|
-
|
|
52
|
+
v.run.queuedTaintedLazarus.push(player);
|
|
52
53
|
} else if (character === PlayerType.LAZARUS_2_B) {
|
|
53
|
-
|
|
54
|
+
v.run.queuedDeadTaintedLazarus.push(player);
|
|
54
55
|
} else {
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
@@ -69,14 +70,14 @@ export class TaintedLazarusPlayers extends Feature {
|
|
|
69
70
|
*/
|
|
70
71
|
private checkDequeue() {
|
|
71
72
|
if (
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
v.run.queuedTaintedLazarus.length === 0 ||
|
|
74
|
+
v.run.queuedDeadTaintedLazarus.length === 0
|
|
74
75
|
) {
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
const taintedLazarus =
|
|
79
|
-
const deadTaintedLazarus =
|
|
79
|
+
const taintedLazarus = v.run.queuedTaintedLazarus.shift();
|
|
80
|
+
const deadTaintedLazarus = v.run.queuedDeadTaintedLazarus.shift();
|
|
80
81
|
|
|
81
82
|
if (taintedLazarus === undefined || deadTaintedLazarus === undefined) {
|
|
82
83
|
return;
|
|
@@ -92,8 +93,8 @@ export class TaintedLazarusPlayers extends Feature {
|
|
|
92
93
|
return;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
v.run.subPlayerMap.set(taintedLazarusPtrHash, deadTaintedLazarus);
|
|
97
|
+
v.run.subPlayerMap.set(deadTaintedLazarusPtrHash, taintedLazarus);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
/**
|
|
@@ -115,6 +116,6 @@ export class TaintedLazarusPlayers extends Feature {
|
|
|
115
116
|
player: EntityPlayer,
|
|
116
117
|
): EntityPlayer | undefined {
|
|
117
118
|
const ptrHash = GetPtrHash(player);
|
|
118
|
-
return
|
|
119
|
+
return v.run.subPlayerMap.get(ptrHash);
|
|
119
120
|
}
|
|
120
121
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonAction
|
|
1
|
+
import { ButtonAction } from "isaac-typescript-definitions";
|
|
2
2
|
import { CONTROLLER_INDEX_VALUES } from "../../../../arrays/cachedEnumValues";
|
|
3
3
|
import { fonts, game } from "../../../../core/cachedClasses";
|
|
4
4
|
import { KColorDefault, VectorOne } from "../../../../core/constants";
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getScreenTopCenterPos,
|
|
9
9
|
} from "../../../../functions/ui";
|
|
10
10
|
import { CustomStage } from "../../../../interfaces/private/CustomStage";
|
|
11
|
+
import { v } from "./v";
|
|
11
12
|
|
|
12
13
|
/** Corresponds to "resources/gfx/ui/ui_streak.anm2". */
|
|
13
14
|
const UI_STREAK_ANIMATION_END_FRAMES = {
|
|
@@ -81,43 +82,19 @@ const TEXT_OUT_SCALES = [
|
|
|
81
82
|
Vector(3, 0.2),
|
|
82
83
|
] as const;
|
|
83
84
|
|
|
84
|
-
interface StreakTextVars {
|
|
85
|
-
run: {
|
|
86
|
-
/** Whether we are on e.g. Caves 1 or Caves 2. */
|
|
87
|
-
firstFloor: boolean;
|
|
88
|
-
|
|
89
|
-
/** Values are the render frame that the controller first pressed the map button. */
|
|
90
|
-
controllerIndexPushingMapRenderFrame: Map<ControllerIndex, int>;
|
|
91
|
-
|
|
92
|
-
topStreakTextStartedRenderFrame: int | null;
|
|
93
|
-
|
|
94
|
-
topStreakText: {
|
|
95
|
-
animation: UIStreakAnimation;
|
|
96
|
-
frame: int;
|
|
97
|
-
pauseFrame: boolean;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
bottomStreakText: {
|
|
101
|
-
animation: UIStreakAnimation;
|
|
102
|
-
frame: int;
|
|
103
|
-
pauseFrame: boolean;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
85
|
// ModCallback.POST_RENDER (2)
|
|
109
|
-
export function streakTextPostRender(
|
|
86
|
+
export function streakTextPostRender(): void {
|
|
110
87
|
// The top streak only plays when the player arrives on the floor (or continues a game from the
|
|
111
88
|
// main menu.)
|
|
112
|
-
checkEndTopStreakText(
|
|
89
|
+
checkEndTopStreakText();
|
|
113
90
|
|
|
114
91
|
// The bottom streak only plays when the player holds down the map button.
|
|
115
|
-
trackMapInputPressed(
|
|
116
|
-
checkStartBottomStreakText(
|
|
117
|
-
checkEndBottomStreakText(
|
|
92
|
+
trackMapInputPressed();
|
|
93
|
+
checkStartBottomStreakText();
|
|
94
|
+
checkEndBottomStreakText();
|
|
118
95
|
}
|
|
119
96
|
|
|
120
|
-
function checkEndTopStreakText(
|
|
97
|
+
function checkEndTopStreakText() {
|
|
121
98
|
if (
|
|
122
99
|
v.run.topStreakTextStartedRenderFrame === null ||
|
|
123
100
|
v.run.topStreakText.animation !== UIStreakAnimation.TEXT_STAY
|
|
@@ -136,7 +113,7 @@ function checkEndTopStreakText(v: StreakTextVars) {
|
|
|
136
113
|
}
|
|
137
114
|
}
|
|
138
115
|
|
|
139
|
-
function trackMapInputPressed(
|
|
116
|
+
function trackMapInputPressed() {
|
|
140
117
|
for (const controllerIndex of CONTROLLER_INDEX_VALUES) {
|
|
141
118
|
const gameFrameCount = game.GetFrameCount();
|
|
142
119
|
const oldPushedMapFrame =
|
|
@@ -163,7 +140,7 @@ function trackMapInputPressed(v: StreakTextVars) {
|
|
|
163
140
|
* If the map input has been pressed down for long enough, play the animation where the level streak
|
|
164
141
|
* slides in from the left.
|
|
165
142
|
*/
|
|
166
|
-
function checkStartBottomStreakText(
|
|
143
|
+
function checkStartBottomStreakText() {
|
|
167
144
|
if (v.run.bottomStreakText.animation !== UIStreakAnimation.NONE) {
|
|
168
145
|
return;
|
|
169
146
|
}
|
|
@@ -188,7 +165,7 @@ function checkStartBottomStreakText(v: StreakTextVars) {
|
|
|
188
165
|
* If the map input has been released, play the animation where the level streak slides out to the
|
|
189
166
|
* right.
|
|
190
167
|
*/
|
|
191
|
-
function checkEndBottomStreakText(
|
|
168
|
+
function checkEndBottomStreakText() {
|
|
192
169
|
if (v.run.bottomStreakText.animation !== UIStreakAnimation.TEXT_STAY) {
|
|
193
170
|
return;
|
|
194
171
|
}
|
|
@@ -206,7 +183,6 @@ function checkEndBottomStreakText(v: StreakTextVars) {
|
|
|
206
183
|
|
|
207
184
|
// ModCallback.GET_SHADER_PARAMS (22)
|
|
208
185
|
export function streakTextGetShaderParams(
|
|
209
|
-
v: StreakTextVars,
|
|
210
186
|
customStage: CustomStage,
|
|
211
187
|
shaderName: string,
|
|
212
188
|
): void {
|
|
@@ -216,20 +192,14 @@ export function streakTextGetShaderParams(
|
|
|
216
192
|
|
|
217
193
|
const topCenterPos = getScreenTopCenterPos();
|
|
218
194
|
const topStreakPosition = topCenterPos.add(STREAK_SPRITE_TOP_OFFSET);
|
|
219
|
-
renderStreakText(
|
|
195
|
+
renderStreakText(customStage, v.run.topStreakText, topStreakPosition);
|
|
220
196
|
|
|
221
197
|
const bottomCenterPos = getScreenBottomCenterPos();
|
|
222
198
|
const bottomStreakPosition = bottomCenterPos.add(STREAK_SPRITE_BOTTOM_OFFSET);
|
|
223
|
-
renderStreakText(
|
|
224
|
-
v,
|
|
225
|
-
customStage,
|
|
226
|
-
v.run.bottomStreakText,
|
|
227
|
-
bottomStreakPosition,
|
|
228
|
-
);
|
|
199
|
+
renderStreakText(customStage, v.run.bottomStreakText, bottomStreakPosition);
|
|
229
200
|
}
|
|
230
201
|
|
|
231
202
|
function renderStreakText(
|
|
232
|
-
v: StreakTextVars,
|
|
233
203
|
customStage: CustomStage,
|
|
234
204
|
streakText: { animation: UIStreakAnimation; frame: int; pauseFrame: boolean },
|
|
235
205
|
position: Vector,
|
|
@@ -301,7 +271,7 @@ function renderStreakText(
|
|
|
301
271
|
);
|
|
302
272
|
}
|
|
303
273
|
|
|
304
|
-
export function topStreakTextStart(
|
|
274
|
+
export function topStreakTextStart(): void {
|
|
305
275
|
const level = game.GetLevel();
|
|
306
276
|
const renderFrameCount = Isaac.GetFrameCount();
|
|
307
277
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ControllerIndex } from "isaac-typescript-definitions";
|
|
2
|
+
import { UIStreakAnimation } from "../../../../enums/private/UIStreakAnimation";
|
|
3
|
+
import { CustomStage } from "../../../../interfaces/private/CustomStage";
|
|
4
|
+
|
|
5
|
+
export const v = {
|
|
6
|
+
run: {
|
|
7
|
+
currentCustomStage: null as CustomStage | null,
|
|
8
|
+
|
|
9
|
+
/** Whether we are on e.g. Caves 1 or Caves 2. */
|
|
10
|
+
firstFloor: true,
|
|
11
|
+
|
|
12
|
+
showingBossVersusScreen: false,
|
|
13
|
+
|
|
14
|
+
/** Values are the render frame that the controller first pressed the map button. */
|
|
15
|
+
controllerIndexPushingMapRenderFrame: new Map<ControllerIndex, int>(),
|
|
16
|
+
|
|
17
|
+
topStreakTextStartedRenderFrame: null as int | null,
|
|
18
|
+
|
|
19
|
+
topStreakText: {
|
|
20
|
+
animation: UIStreakAnimation.NONE,
|
|
21
|
+
frame: 0,
|
|
22
|
+
pauseFrame: false,
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
bottomStreakText: {
|
|
26
|
+
animation: UIStreakAnimation.NONE,
|
|
27
|
+
frame: 0,
|
|
28
|
+
pauseFrame: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -32,12 +32,7 @@ import {
|
|
|
32
32
|
DEFAULT_BASE_STAGE_TYPE,
|
|
33
33
|
ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH,
|
|
34
34
|
} from "./constants";
|
|
35
|
-
|
|
36
|
-
interface VersusScreenVars {
|
|
37
|
-
run: {
|
|
38
|
-
showingBossVersusScreen: boolean;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
35
|
+
import { v } from "./v";
|
|
41
36
|
|
|
42
37
|
const DEFAULT_STAGE_ID = StageID.BASEMENT;
|
|
43
38
|
const VERSUS_SCREEN_ANIMATION_NAME = "Scene";
|
|
@@ -116,7 +111,6 @@ const versusScreenBackgroundSprite = Sprite();
|
|
|
116
111
|
const versusScreenDirtSpotSprite = Sprite();
|
|
117
112
|
|
|
118
113
|
export function playVersusScreenAnimation(
|
|
119
|
-
v: VersusScreenVars,
|
|
120
114
|
customStage: CustomStage,
|
|
121
115
|
disableAllSound: DisableAllSound,
|
|
122
116
|
pause: Pause,
|
|
@@ -307,7 +301,6 @@ function getBossPNGPathsCustom(
|
|
|
307
301
|
}
|
|
308
302
|
|
|
309
303
|
function finishVersusScreenAnimation(
|
|
310
|
-
v: VersusScreenVars,
|
|
311
304
|
pause: Pause,
|
|
312
305
|
disableAllSound: DisableAllSound,
|
|
313
306
|
) {
|
|
@@ -325,7 +318,6 @@ function finishVersusScreenAnimation(
|
|
|
325
318
|
|
|
326
319
|
// ModCallback.POST_RENDER (2)
|
|
327
320
|
export function versusScreenPostRender(
|
|
328
|
-
v: VersusScreenVars,
|
|
329
321
|
pause: Pause,
|
|
330
322
|
disableAllSound: DisableAllSound,
|
|
331
323
|
): void {
|
|
@@ -337,7 +329,7 @@ export function versusScreenPostRender(
|
|
|
337
329
|
// black screen as soon as the slide animation starts.
|
|
338
330
|
|
|
339
331
|
if (versusScreenSprite.IsFinished(VERSUS_SCREEN_ANIMATION_NAME)) {
|
|
340
|
-
finishVersusScreenAnimation(
|
|
332
|
+
finishVersusScreenAnimation(pause, disableAllSound);
|
|
341
333
|
return;
|
|
342
334
|
}
|
|
343
335
|
|
|
@@ -428,6 +428,9 @@ export enum ModCallbackCustom {
|
|
|
428
428
|
*
|
|
429
429
|
* `POST_GAME_STARTED_REORDERED` --> `POST_NEW_LEVEL_REORDERED` --> `POST_NEW_ROOM_REORDERED`
|
|
430
430
|
*
|
|
431
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
432
|
+
* matches the `isContinued` value provided.
|
|
433
|
+
*
|
|
431
434
|
* ```ts
|
|
432
435
|
* function postGameStartedReordered(isContinued: boolean): void {}
|
|
433
436
|
* ```
|
|
@@ -440,6 +443,9 @@ export enum ModCallbackCustom {
|
|
|
440
443
|
* new run has started (or continued), but you can be sure that all new-run-related initialization
|
|
441
444
|
* has been completed.
|
|
442
445
|
*
|
|
446
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
447
|
+
* matches the `isContinued` value provided.
|
|
448
|
+
*
|
|
443
449
|
* ```ts
|
|
444
450
|
* function postGameStartedReorderedLast(isContinued: boolean): void {}
|
|
445
451
|
* ```
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
24
|
+
import { CallbackPriority } from "isaac-typescript-definitions/dist/src/enums/CallbackPriority";
|
|
24
25
|
import {
|
|
25
26
|
ModFeature,
|
|
26
27
|
MOD_FEATURE_CALLBACKS_KEY,
|
|
@@ -38,19 +39,58 @@ import { getTSTLClassName } from "./tstlClass";
|
|
|
38
39
|
* @ignore
|
|
39
40
|
*/
|
|
40
41
|
// We tell TypeDoc to ignore this function because it generates a bunch of spam.
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
41
43
|
export function Callback<T extends ModCallback>(
|
|
42
44
|
modCallback: T,
|
|
43
45
|
...optionalArgs: AllButFirst<AddCallbackParameters[T]>
|
|
46
|
+
) {
|
|
47
|
+
return PriorityCallback(
|
|
48
|
+
modCallback,
|
|
49
|
+
CallbackPriority.DEFAULT,
|
|
50
|
+
...optionalArgs,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* A decorator function that signifies that the decorated class method should be automatically
|
|
56
|
+
* registered with `ModUpgraded.AddCallbackCustom`.
|
|
57
|
+
*
|
|
58
|
+
* @ignore
|
|
59
|
+
*/
|
|
60
|
+
// We tell TypeDoc to ignore this function because it generates a bunch of spam.
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
62
|
+
export function CallbackCustom<T extends ModCallbackCustom>(
|
|
63
|
+
modCallbackCustom: T,
|
|
64
|
+
...optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>
|
|
65
|
+
) {
|
|
66
|
+
return PriorityCallbackCustom(
|
|
67
|
+
modCallbackCustom,
|
|
68
|
+
CallbackPriority.DEFAULT,
|
|
69
|
+
...optionalArgs,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A decorator function that signifies that the decorated class method should be automatically
|
|
75
|
+
* registered with `Mod.AddPriorityCallback`.
|
|
76
|
+
*
|
|
77
|
+
* @ignore
|
|
78
|
+
*/
|
|
79
|
+
// We tell TypeDoc to ignore this function because it generates a bunch of spam.
|
|
80
|
+
export function PriorityCallback<T extends ModCallback>(
|
|
81
|
+
modCallback: T,
|
|
82
|
+
priority: CallbackPriority | int,
|
|
83
|
+
...optionalArgs: AllButFirst<AddCallbackParameters[T]>
|
|
44
84
|
) {
|
|
45
85
|
return <Class extends ModFeature, Fn extends AddCallbackParameters[T][0]>(
|
|
46
86
|
target: Class,
|
|
47
87
|
propertyKey: string,
|
|
48
88
|
_descriptor: TypedPropertyDescriptor<Fn>,
|
|
49
89
|
): void => {
|
|
50
|
-
// First, prepare the arguments for the `Mod.
|
|
90
|
+
// First, prepare the arguments for the `Mod.AddPriorityCallback` method.
|
|
51
91
|
const methodName = propertyKey as keyof Class;
|
|
52
92
|
const method = target[methodName] as AddCallbackParameters[T][0];
|
|
53
|
-
const callbackTuple = [modCallback, method, optionalArgs];
|
|
93
|
+
const callbackTuple = [modCallback, priority, method, optionalArgs];
|
|
54
94
|
|
|
55
95
|
// Since the decorator runs prior to instantiation, we only have access to get and set static
|
|
56
96
|
// properties, which are located on the "constructor" table. Thus, we store the callback
|
|
@@ -84,8 +124,9 @@ export function Callback<T extends ModCallback>(
|
|
|
84
124
|
* @ignore
|
|
85
125
|
*/
|
|
86
126
|
// We tell TypeDoc to ignore this function because it generates a bunch of spam.
|
|
87
|
-
export function
|
|
127
|
+
export function PriorityCallbackCustom<T extends ModCallbackCustom>(
|
|
88
128
|
modCallbackCustom: T,
|
|
129
|
+
priority: CallbackPriority | int,
|
|
89
130
|
...optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>
|
|
90
131
|
) {
|
|
91
132
|
return <
|
|
@@ -99,7 +140,7 @@ export function CallbackCustom<T extends ModCallbackCustom>(
|
|
|
99
140
|
// First, prepare the arguments for the `Mod.AddCallbackCustom` method.
|
|
100
141
|
const methodName = propertyKey as keyof Class;
|
|
101
142
|
const method = target[methodName] as AddCallbackParametersCustom[T][0];
|
|
102
|
-
const callbackTuple
|
|
143
|
+
const callbackTuple = [modCallbackCustom, priority, method, optionalArgs];
|
|
103
144
|
|
|
104
145
|
// Since the decorator runs prior to instantiation, we only have access to get and set static
|
|
105
146
|
// properties, which are located on the "constructor" table. Thus, we store the callback
|
|
@@ -211,10 +211,12 @@ export interface AddCallbackParametersCustom {
|
|
|
211
211
|
|
|
212
212
|
[ModCallbackCustom.POST_GAME_STARTED_REORDERED]: [
|
|
213
213
|
callback: (isContinued: boolean) => void,
|
|
214
|
+
isContinued?: boolean,
|
|
214
215
|
];
|
|
215
216
|
|
|
216
217
|
[ModCallbackCustom.POST_GAME_STARTED_REORDERED_LAST]: [
|
|
217
218
|
callback: (isContinued: boolean) => void,
|
|
219
|
+
isContinued?: boolean,
|
|
218
220
|
];
|
|
219
221
|
|
|
220
222
|
[ModCallbackCustom.POST_GREED_MODE_WAVE]: [
|
package/src/shouldFire.ts
CHANGED
|
@@ -68,6 +68,16 @@ export function shouldFireBomb(
|
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
export function shouldFireBoolean(
|
|
72
|
+
fireArgs: [fireArg: boolean],
|
|
73
|
+
optionalArgs: [optionalArg?: boolean],
|
|
74
|
+
): boolean {
|
|
75
|
+
const [fireArg] = fireArgs;
|
|
76
|
+
const [optionalArg] = optionalArgs;
|
|
77
|
+
|
|
78
|
+
return optionalArg === undefined || optionalArg === fireArg;
|
|
79
|
+
}
|
|
80
|
+
|
|
71
81
|
export function shouldFireCollectible(
|
|
72
82
|
fireArgs: [collectible: EntityPickupCollectible],
|
|
73
83
|
optionalArgs: [collectibleType?: CollectibleType],
|