isaacscript-common 18.3.0 → 18.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +29 -20
- package/dist/isaacscript-common.lua +329 -319
- package/dist/src/classes/ModFeature.d.ts +2 -2
- package/dist/src/classes/ModFeature.d.ts.map +1 -1
- package/dist/src/classes/ModFeature.lua +18 -17
- package/dist/src/classes/ModUpgradedBase.d.ts.map +1 -1
- package/dist/src/classes/ModUpgradedBase.lua +10 -10
- package/dist/src/classes/callbacks/EntityTakeDmgFilter.lua +1 -1
- package/dist/src/classes/callbacks/EntityTakeDmgPlayer.d.ts.map +1 -1
- package/dist/src/classes/callbacks/EntityTakeDmgPlayer.lua +1 -1
- package/dist/src/classes/callbacks/InputActionFilter.lua +1 -1
- package/dist/src/classes/callbacks/InputActionPlayer.lua +1 -1
- package/dist/src/classes/callbacks/PostAmbushFinished.lua +1 -1
- package/dist/src/classes/callbacks/PostAmbushStarted.lua +1 -1
- package/dist/src/classes/callbacks/PostBombExploded.lua +1 -1
- package/dist/src/classes/callbacks/PostBombInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostBoneSwing.lua +1 -1
- package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCollectibleEmpty.lua +1 -1
- package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCollectibleInitFirst.lua +1 -1
- package/dist/src/classes/callbacks/PostCursedTeleport.d.ts +2 -2
- package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCursedTeleport.lua +19 -21
- package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostDiceRoomActivated.lua +1 -1
- package/dist/src/classes/callbacks/PostDoorRender.lua +1 -1
- package/dist/src/classes/callbacks/PostDoorUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostEffectInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostEffectStateChanged.lua +1 -1
- package/dist/src/classes/callbacks/PostFamiliarInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostFamiliarStateChanged.lua +1 -1
- package/dist/src/classes/callbacks/PostGreedModeWave.lua +1 -1
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +1 -1
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostItemDischarge.lua +2 -2
- package/dist/src/classes/callbacks/PostKnifeInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostLaserInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostNPCDeathFilter.lua +1 -1
- package/dist/src/classes/callbacks/PostNPCInitFilter.lua +1 -1
- package/dist/src/classes/callbacks/PostNPCInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostNPCRenderFilter.lua +1 -1
- package/dist/src/classes/callbacks/PostNPCStateChanged.lua +1 -1
- package/dist/src/classes/callbacks/PostNPCUpdateFilter.lua +1 -1
- package/dist/src/classes/callbacks/PostNewRoomEarly.lua +1 -1
- package/dist/src/classes/callbacks/PostPickupCollect.lua +1 -1
- package/dist/src/classes/callbacks/PostPickupInitFirst.lua +1 -1
- package/dist/src/classes/callbacks/PostPickupInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostPickupStateChanged.lua +1 -1
- package/dist/src/classes/callbacks/PostPitRender.lua +1 -1
- package/dist/src/classes/callbacks/PostPitUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostPlayerChangeHealth.lua +1 -1
- package/dist/src/classes/callbacks/PostPlayerChangeStat.lua +1 -1
- package/dist/src/classes/callbacks/PostPlayerChangeType.lua +1 -1
- package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts +1 -1
- package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPlayerFatalDamage.lua +19 -21
- package/dist/src/classes/callbacks/PostPlayerInitFirst.lua +1 -1
- package/dist/src/classes/callbacks/PostPlayerInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostPoopRender.lua +1 -1
- package/dist/src/classes/callbacks/PostPoopUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostPressurePlateRender.lua +1 -1
- package/dist/src/classes/callbacks/PostPressurePlateUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostProjectileInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostPurchase.lua +1 -1
- package/dist/src/classes/callbacks/PostRockRender.lua +1 -1
- package/dist/src/classes/callbacks/PostRockUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostRoomClearChanged.lua +2 -2
- package/dist/src/classes/callbacks/PostSacrifice.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostSacrifice.lua +4 -8
- package/dist/src/classes/callbacks/PostSlotCollision.lua +1 -1
- package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostSlotDestroyed.lua +2 -2
- package/dist/src/classes/callbacks/PostSpikesRender.lua +1 -1
- package/dist/src/classes/callbacks/PostSpikesUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostTNTRender.lua +1 -1
- package/dist/src/classes/callbacks/PostTNTUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostTearInitLate.lua +1 -1
- package/dist/src/classes/callbacks/PostTearInitVeryLate.lua +1 -1
- package/dist/src/classes/callbacks/PostTransformation.lua +1 -1
- package/dist/src/classes/callbacks/PostTrinketBreak.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostTrinketBreak.lua +5 -11
- package/dist/src/classes/callbacks/PreBerserkDeath.lua +1 -1
- package/dist/src/classes/callbacks/PreGetPedestal.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PreGetPedestal.lua +1 -1
- package/dist/src/classes/callbacks/PreNPCCollisionFilter.lua +1 -1
- package/dist/src/classes/callbacks/PreNPCUpdateFilter.lua +1 -1
- package/dist/src/classes/callbacks/PreNewLevel.lua +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +2 -2
- package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts +2 -2
- package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomRevive.lua +5 -5
- package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/EsauJrDetection.lua +1 -1
- package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/FlipDetection.lua +1 -1
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.lua +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.lua +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.lua +2 -2
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.lua +4 -3
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +8 -3
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +16 -21
- package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.lua +2 -2
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.lua +1 -1
- package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.lua +2 -2
- package/dist/src/classes/features/other/CharacterHealthConversion.d.ts.map +1 -1
- package/dist/src/classes/features/other/CharacterHealthConversion.lua +2 -2
- package/dist/src/classes/features/other/CharacterStats.lua +1 -1
- package/dist/src/classes/features/other/CollectibleItemPoolType.d.ts.map +1 -1
- package/dist/src/classes/features/other/CollectibleItemPoolType.lua +1 -1
- package/dist/src/classes/features/other/CustomHotkeys.lua +1 -1
- package/dist/src/classes/features/other/CustomItemPools.lua +1 -1
- package/dist/src/classes/features/other/CustomPickups.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomPickups.lua +1 -1
- package/dist/src/classes/features/other/CustomStages.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomStages.lua +2 -2
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.lua +2 -2
- package/dist/src/classes/features/other/DisableAllSound.lua +1 -1
- package/dist/src/classes/features/other/DisableInputs.d.ts.map +1 -1
- package/dist/src/classes/features/other/DisableInputs.lua +1 -1
- package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts +1 -1
- package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
- package/dist/src/classes/features/other/ExtraConsoleCommands.lua +17 -16
- package/dist/src/classes/features/other/FadeInRemover.lua +1 -1
- package/dist/src/classes/features/other/FastReset.lua +1 -1
- package/dist/src/classes/features/other/ModdedElementDetection.lua +1 -1
- package/dist/src/classes/features/other/NoSirenSteal.d.ts.map +1 -1
- package/dist/src/classes/features/other/NoSirenSteal.lua +1 -1
- package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
- package/dist/src/classes/features/other/Pause.lua +1 -1
- package/dist/src/classes/features/other/PersistentEntities.lua +2 -2
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.lua +1 -1
- package/dist/src/classes/features/other/PlayerInventory.lua +1 -1
- package/dist/src/classes/features/other/PonyDetection.lua +1 -1
- package/dist/src/classes/features/other/PressInput.d.ts.map +1 -1
- package/dist/src/classes/features/other/PressInput.lua +1 -1
- package/dist/src/classes/features/other/PreventChildEntities.lua +1 -1
- package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventCollectibleRotation.lua +1 -1
- package/dist/src/classes/features/other/PreventGridEntityRespawn.d.ts.map +1 -1
- package/dist/src/classes/features/other/PreventGridEntityRespawn.lua +2 -2
- package/dist/src/classes/features/other/RoomClearFrame.lua +1 -1
- package/dist/src/classes/features/other/RoomHistory.lua +1 -1
- package/dist/src/classes/features/other/RunInNFrames.lua +1 -1
- package/dist/src/classes/features/other/RunNextRoom.lua +1 -1
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.lua +2 -2
- package/dist/src/classes/features/other/StageHistory.d.ts.map +1 -1
- package/dist/src/classes/features/other/StageHistory.lua +1 -1
- package/dist/src/classes/features/other/TaintedLazarusPlayers.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayBomb.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayDoor.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayEffect.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayKnife.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayLaser.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayNPC.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPickup.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPit.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPlayer.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPoop.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayPressurePlate.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayProjectile.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayRock.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplaySlot.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplaySpikes.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayTNT.lua +1 -1
- package/dist/src/classes/features/other/debugDisplay/DebugDisplayTear.lua +1 -1
- package/dist/src/classes/private/CustomCallback.d.ts +2 -2
- package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
- package/dist/src/classes/private/CustomCallback.lua +7 -10
- package/dist/src/functions/array.d.ts +5 -1
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/array.lua +17 -8
- package/dist/src/functions/decorators.d.ts.map +1 -1
- package/dist/src/functions/decorators.lua +12 -22
- package/dist/src/functions/direction.d.ts +3 -1
- package/dist/src/functions/direction.d.ts.map +1 -1
- package/dist/src/functions/direction.lua +10 -0
- package/dist/src/functions/logMisc.d.ts +1 -0
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +2 -1
- package/dist/src/objects/directionToMoveAction.d.ts +9 -0
- package/dist/src/objects/directionToMoveAction.d.ts.map +1 -0
- package/dist/src/objects/directionToMoveAction.lua +12 -0
- package/dist/src/objects/directionToShootAction.d.ts +9 -0
- package/dist/src/objects/directionToShootAction.d.ts.map +1 -0
- package/dist/src/objects/directionToShootAction.lua +12 -0
- package/dist/src/types/ModUpgraded.d.ts +1 -1
- package/dist/src/types/ModUpgraded.d.ts.map +1 -1
- package/dist/src/types/private/CallbackTuple.d.ts +17 -8
- package/dist/src/types/private/CallbackTuple.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/classes/ModFeature.ts +43 -21
- package/src/classes/ModUpgradedBase.ts +18 -10
- package/src/classes/callbacks/EntityTakeDmgFilter.ts +1 -1
- package/src/classes/callbacks/EntityTakeDmgPlayer.ts +2 -1
- package/src/classes/callbacks/InputActionFilter.ts +1 -1
- package/src/classes/callbacks/InputActionPlayer.ts +1 -1
- package/src/classes/callbacks/PostAmbushFinished.ts +1 -1
- package/src/classes/callbacks/PostAmbushStarted.ts +1 -1
- package/src/classes/callbacks/PostBombExploded.ts +1 -1
- package/src/classes/callbacks/PostBombInitLate.ts +1 -1
- package/src/classes/callbacks/PostBoneSwing.ts +1 -1
- package/src/classes/callbacks/PostCollectibleEmpty.ts +2 -1
- package/src/classes/callbacks/PostCollectibleInitFirst.ts +2 -1
- package/src/classes/callbacks/PostCursedTeleport.ts +52 -60
- package/src/classes/callbacks/PostDiceRoomActivated.ts +2 -1
- package/src/classes/callbacks/PostDoorRender.ts +1 -1
- package/src/classes/callbacks/PostDoorUpdate.ts +1 -1
- package/src/classes/callbacks/PostEffectInitLate.ts +1 -1
- package/src/classes/callbacks/PostEffectStateChanged.ts +1 -1
- package/src/classes/callbacks/PostFamiliarInitLate.ts +1 -1
- package/src/classes/callbacks/PostFamiliarStateChanged.ts +1 -1
- package/src/classes/callbacks/PostGreedModeWave.ts +1 -1
- package/src/classes/callbacks/PostHolyMantleRemoved.ts +1 -1
- package/src/classes/callbacks/PostItemDischarge.ts +3 -2
- package/src/classes/callbacks/PostKnifeInitLate.ts +1 -1
- package/src/classes/callbacks/PostLaserInitLate.ts +1 -1
- package/src/classes/callbacks/PostNPCDeathFilter.ts +1 -1
- package/src/classes/callbacks/PostNPCInitFilter.ts +1 -1
- package/src/classes/callbacks/PostNPCInitLate.ts +1 -1
- package/src/classes/callbacks/PostNPCRenderFilter.ts +1 -1
- package/src/classes/callbacks/PostNPCStateChanged.ts +1 -1
- package/src/classes/callbacks/PostNPCUpdateFilter.ts +1 -1
- package/src/classes/callbacks/PostNewRoomEarly.ts +2 -2
- package/src/classes/callbacks/PostPickupCollect.ts +1 -1
- package/src/classes/callbacks/PostPickupInitFirst.ts +1 -1
- package/src/classes/callbacks/PostPickupInitLate.ts +1 -1
- package/src/classes/callbacks/PostPickupStateChanged.ts +1 -1
- package/src/classes/callbacks/PostPitRender.ts +1 -1
- package/src/classes/callbacks/PostPitUpdate.ts +1 -1
- package/src/classes/callbacks/PostPlayerChangeHealth.ts +1 -1
- package/src/classes/callbacks/PostPlayerChangeStat.ts +1 -1
- package/src/classes/callbacks/PostPlayerChangeType.ts +1 -1
- package/src/classes/callbacks/PostPlayerFatalDamage.ts +39 -48
- package/src/classes/callbacks/PostPlayerInitFirst.ts +2 -2
- package/src/classes/callbacks/PostPlayerInitLate.ts +1 -1
- package/src/classes/callbacks/PostPoopRender.ts +1 -1
- package/src/classes/callbacks/PostPoopUpdate.ts +1 -1
- package/src/classes/callbacks/PostPressurePlateRender.ts +1 -1
- package/src/classes/callbacks/PostPressurePlateUpdate.ts +1 -1
- package/src/classes/callbacks/PostProjectileInitLate.ts +1 -1
- package/src/classes/callbacks/PostPurchase.ts +1 -1
- package/src/classes/callbacks/PostRockRender.ts +1 -1
- package/src/classes/callbacks/PostRockUpdate.ts +1 -1
- package/src/classes/callbacks/PostRoomClearChanged.ts +2 -2
- package/src/classes/callbacks/PostSacrifice.ts +5 -20
- package/src/classes/callbacks/PostSlotCollision.ts +1 -1
- package/src/classes/callbacks/PostSlotDestroyed.ts +3 -2
- package/src/classes/callbacks/PostSpikesRender.ts +1 -1
- package/src/classes/callbacks/PostSpikesUpdate.ts +1 -1
- package/src/classes/callbacks/PostTNTRender.ts +1 -1
- package/src/classes/callbacks/PostTNTUpdate.ts +1 -1
- package/src/classes/callbacks/PostTearInitLate.ts +1 -1
- package/src/classes/callbacks/PostTearInitVeryLate.ts +1 -1
- package/src/classes/callbacks/PostTransformation.ts +1 -1
- package/src/classes/callbacks/PostTrinketBreak.ts +4 -18
- package/src/classes/callbacks/PreBerserkDeath.ts +1 -1
- package/src/classes/callbacks/PreGetPedestal.ts +2 -1
- package/src/classes/callbacks/PreNPCCollisionFilter.ts +1 -1
- package/src/classes/callbacks/PreNPCUpdateFilter.ts +1 -1
- package/src/classes/callbacks/PreNewLevel.ts +1 -1
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +5 -3
- package/src/classes/features/callbackLogic/CustomRevive.ts +19 -18
- package/src/classes/features/callbackLogic/EsauJrDetection.ts +6 -2
- package/src/classes/features/callbackLogic/FlipDetection.ts +2 -1
- package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +13 -5
- package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +2 -1
- package/src/classes/features/callbackLogic/GridEntityRenderDetection.ts +2 -1
- package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +3 -2
- package/src/classes/features/callbackLogic/ItemPickupDetection.ts +8 -5
- package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +67 -71
- package/src/classes/features/callbackLogic/PlayerReorderedCallbacks.ts +10 -5
- package/src/classes/features/callbackLogic/SlotRenderDetection.ts +2 -1
- package/src/classes/features/callbackLogic/SlotUpdateDetection.ts +3 -2
- package/src/classes/features/other/CharacterHealthConversion.ts +3 -2
- package/src/classes/features/other/CharacterStats.ts +1 -1
- package/src/classes/features/other/CollectibleItemPoolType.ts +2 -1
- package/src/classes/features/other/CustomHotkeys.ts +1 -1
- package/src/classes/features/other/CustomItemPools.ts +1 -1
- package/src/classes/features/other/CustomPickups.ts +3 -2
- package/src/classes/features/other/CustomStages.ts +7 -6
- package/src/classes/features/other/CustomTrapdoors.ts +4 -6
- package/src/classes/features/other/DisableAllSound.ts +1 -1
- package/src/classes/features/other/DisableInputs.ts +6 -3
- package/src/classes/features/other/ExtraConsoleCommands.ts +32 -31
- package/src/classes/features/other/FadeInRemover.ts +1 -1
- package/src/classes/features/other/FastReset.ts +1 -1
- package/src/classes/features/other/ModdedElementDetection.ts +1 -1
- package/src/classes/features/other/NoSirenSteal.ts +2 -1
- package/src/classes/features/other/Pause.ts +3 -2
- package/src/classes/features/other/PersistentEntities.ts +2 -2
- package/src/classes/features/other/PickupIndexCreation.ts +3 -2
- package/src/classes/features/other/PlayerInventory.ts +2 -2
- package/src/classes/features/other/PonyDetection.ts +1 -1
- package/src/classes/features/other/PressInput.ts +2 -1
- package/src/classes/features/other/PreventChildEntities.ts +1 -1
- package/src/classes/features/other/PreventCollectibleRotation.ts +4 -2
- package/src/classes/features/other/PreventGridEntityRespawn.ts +3 -2
- package/src/classes/features/other/RoomClearFrame.ts +1 -1
- package/src/classes/features/other/RoomHistory.ts +1 -1
- package/src/classes/features/other/RunInNFrames.ts +2 -2
- package/src/classes/features/other/RunNextRoom.ts +1 -1
- package/src/classes/features/other/SaveDataManager.ts +6 -5
- package/src/classes/features/other/StageHistory.ts +1 -4
- package/src/classes/features/other/TaintedLazarusPlayers.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayBomb.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayDoor.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayEffect.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayKnife.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayLaser.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayNPC.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPickup.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPit.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPlayer.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPoop.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayPressurePlate.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayProjectile.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayRock.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplaySlot.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplaySpikes.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayTNT.ts +1 -1
- package/src/classes/features/other/debugDisplay/DebugDisplayTear.ts +1 -1
- package/src/classes/private/CustomCallback.ts +19 -15
- package/src/functions/array.ts +14 -5
- package/src/functions/decorators.ts +14 -20
- package/src/functions/direction.ts +15 -1
- package/src/functions/logMisc.ts +4 -1
- package/src/objects/directionToMoveAction.ts +10 -0
- package/src/objects/directionToShootAction.ts +10 -0
- package/src/types/ModUpgraded.ts +1 -1
- package/src/types/private/CallbackTuple.ts +17 -8
- package/dist/src/types/private/AllButFirst.d.ts +0 -5
- package/dist/src/types/private/AllButFirst.d.ts.map +0 -1
- package/dist/src/types/private/AllButFirst.lua +0 -2
- package/src/types/private/AllButFirst.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directionToMoveAction.d.ts","sourceRoot":"","sources":["../../../src/objects/directionToMoveAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAa,MAAM,8BAA8B,CAAC;AAGvE,eAAO,MAAM,wBAAwB;;;;;;CAMmC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
|
|
4
|
+
local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
|
|
5
|
+
____exports.DIRECTION_TO_MOVE_ACTION = {
|
|
6
|
+
[Direction.NO_DIRECTION] = nil,
|
|
7
|
+
[Direction.LEFT] = ButtonAction.LEFT,
|
|
8
|
+
[Direction.UP] = ButtonAction.UP,
|
|
9
|
+
[Direction.RIGHT] = ButtonAction.RIGHT,
|
|
10
|
+
[Direction.DOWN] = ButtonAction.DOWN
|
|
11
|
+
}
|
|
12
|
+
return ____exports
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonAction } from "isaac-typescript-definitions";
|
|
2
|
+
export declare const DIRECTION_TO_SHOOT_ACTION: {
|
|
3
|
+
readonly [-1]: undefined;
|
|
4
|
+
readonly 0: ButtonAction.SHOOT_LEFT;
|
|
5
|
+
readonly 1: ButtonAction.SHOOT_UP;
|
|
6
|
+
readonly 2: ButtonAction.SHOOT_RIGHT;
|
|
7
|
+
readonly 3: ButtonAction.SHOOT_DOWN;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=directionToShootAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directionToShootAction.d.ts","sourceRoot":"","sources":["../../../src/objects/directionToShootAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAa,MAAM,8BAA8B,CAAC;AAGvE,eAAO,MAAM,yBAAyB;;;;;;CAMkC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
|
|
4
|
+
local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
|
|
5
|
+
____exports.DIRECTION_TO_SHOOT_ACTION = {
|
|
6
|
+
[Direction.NO_DIRECTION] = nil,
|
|
7
|
+
[Direction.LEFT] = ButtonAction.SHOOT_LEFT,
|
|
8
|
+
[Direction.UP] = ButtonAction.SHOOT_UP,
|
|
9
|
+
[Direction.RIGHT] = ButtonAction.SHOOT_RIGHT,
|
|
10
|
+
[Direction.DOWN] = ButtonAction.SHOOT_DOWN
|
|
11
|
+
}
|
|
12
|
+
return ____exports
|
|
@@ -26,7 +26,7 @@ type ISCFeaturesToKeys<T extends readonly ISCFeature[]> = Omit<TupleToIntersecti
|
|
|
26
26
|
* same private fields will cause a `never` type.
|
|
27
27
|
*/
|
|
28
28
|
type ISCFeatureTupleToClassTuple<T extends ISCFeature[]> = {
|
|
29
|
-
[
|
|
29
|
+
[Key in keyof T]: PublicInterface<ISCFeatureToClass[T[Key]]>;
|
|
30
30
|
};
|
|
31
31
|
export {};
|
|
32
32
|
//# sourceMappingURL=ModUpgraded.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModUpgraded.d.ts","sourceRoot":"","sources":["../../../src/types/ModUpgraded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,GAAG,EAAE,IAC1D,eAAe,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAEzC;;;GAGG;AACH,KAAK,iBAAiB,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,IAAI,IAAI,CAC5D,mBAAmB,CAAC,2BAA2B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAC9D,MAAM,OAAO,CACd,CAAC;AAEF;;;GAGG;AACH,KAAK,2BAA2B,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI;KACxD,
|
|
1
|
+
{"version":3,"file":"ModUpgraded.d.ts","sourceRoot":"","sources":["../../../src/types/ModUpgraded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,GAAG,EAAE,IAC1D,eAAe,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAEzC;;;GAGG;AACH,KAAK,iBAAiB,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,IAAI,IAAI,CAC5D,mBAAmB,CAAC,2BAA2B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAC9D,MAAM,OAAO,CACd,CAAC;AAEF;;;GAGG;AACH,KAAK,2BAA2B,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI;KACxD,GAAG,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7D,CAAC"}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
2
2
|
import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
|
|
3
3
|
import { AddCallbackParametersCustom } from "../../interfaces/private/AddCallbackParametersCustom";
|
|
4
|
+
import { AllButFirst } from "../AllButFirst";
|
|
4
5
|
/**
|
|
5
|
-
* A mapping of the callback enum to the associated callback
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* A mapping of the callback enum to the associated callback function and optional arguments. This
|
|
7
|
+
* is so that the respective callback functions can be added/removed on demand as subscribers get
|
|
8
|
+
* added/removed.
|
|
8
9
|
*/
|
|
9
10
|
export type CallbackTuple = {
|
|
10
|
-
[
|
|
11
|
+
[Key in ModCallback]: [
|
|
12
|
+
modCallback: Key,
|
|
13
|
+
callbackFunc: AddCallbackParameters[Key][0],
|
|
14
|
+
optionalArgs?: AllButFirst<AddCallbackParameters[Key]>
|
|
15
|
+
];
|
|
11
16
|
}[ModCallback];
|
|
12
17
|
/**
|
|
13
|
-
* A mapping of the custom callback enum to the associated callback
|
|
14
|
-
*
|
|
15
|
-
*
|
|
18
|
+
* A mapping of the custom callback enum to the associated callback function and optional arguments.
|
|
19
|
+
* This is so that the respective callback functions can be added/removed on demand as subscribers
|
|
20
|
+
* get added/removed.
|
|
16
21
|
*/
|
|
17
22
|
export type CustomCallbackTuple = {
|
|
18
|
-
[
|
|
23
|
+
[Key in ModCallbackCustom]: [
|
|
24
|
+
modCallback: Key,
|
|
25
|
+
callbackFunc: AddCallbackParametersCustom[Key][0],
|
|
26
|
+
optionalArgs?: AllButFirst<AddCallbackParametersCustom[Key]>
|
|
27
|
+
];
|
|
19
28
|
}[ModCallbackCustom];
|
|
20
29
|
//# sourceMappingURL=CallbackTuple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallbackTuple.d.ts","sourceRoot":"","sources":["../../../../src/types/private/CallbackTuple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"CallbackTuple.d.ts","sourceRoot":"","sources":["../../../../src/types/private/CallbackTuple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,WAAW,GAAG;QACpB,WAAW,EAAE,GAAG;QAChB,YAAY,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3C,YAAY,CAAC,EAAE,WAAW,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC;KACvD;CACF,CAAC,WAAW,CAAC,CAAC;AAEf;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;KAC/B,GAAG,IAAI,iBAAiB,GAAG;QAC1B,WAAW,EAAE,GAAG;QAChB,YAAY,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjD,YAAY,CAAC,EAAE,WAAW,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;KAC7D;CACF,CAAC,iBAAiB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
2
2
|
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
3
3
|
import { isArray } from "../functions/array";
|
|
4
|
-
import { deepCopy } from "../functions/deepCopy";
|
|
5
4
|
import {
|
|
6
5
|
getTSTLClassConstructor,
|
|
7
6
|
getTSTLClassName,
|
|
@@ -11,14 +10,26 @@ import { TSTLClassMetatable } from "../interfaces/TSTLClassMetatable";
|
|
|
11
10
|
import { AnyFunction } from "../types/AnyFunction";
|
|
12
11
|
import { ModUpgradedBase } from "./ModUpgradedBase";
|
|
13
12
|
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
13
|
+
export const MOD_FEATURE_CALLBACKS_KEY = "__callbacks";
|
|
14
|
+
export const MOD_FEATURE_CUSTOM_CALLBACKS_KEY = "__customCallbacks";
|
|
16
15
|
const WRAPPED_CALLBACK_METHODS_KEY = "__wrappedCallbackMethods";
|
|
17
16
|
const WRAPPED_CUSTOM_CALLBACK_METHODS_KEY = "__wrappedCustomCallbacksMethods";
|
|
18
17
|
|
|
19
18
|
type ModFeatureConstructor = TSTLClassMetatable["constructor"] & {
|
|
20
|
-
[
|
|
21
|
-
|
|
19
|
+
[MOD_FEATURE_CALLBACKS_KEY]:
|
|
20
|
+
| [
|
|
21
|
+
modCallback: ModCallback,
|
|
22
|
+
callbackFunc: AnyFunction,
|
|
23
|
+
parameters: unknown[],
|
|
24
|
+
]
|
|
25
|
+
| undefined;
|
|
26
|
+
[MOD_FEATURE_CUSTOM_CALLBACKS_KEY]:
|
|
27
|
+
| [
|
|
28
|
+
modCallbackCustom: ModCallbackCustom,
|
|
29
|
+
callbackFunc: AnyFunction,
|
|
30
|
+
parameters: unknown[],
|
|
31
|
+
]
|
|
32
|
+
| undefined;
|
|
22
33
|
[WRAPPED_CALLBACK_METHODS_KEY]: Map<ModCallback, AnyFunction> | undefined;
|
|
23
34
|
[WRAPPED_CUSTOM_CALLBACK_METHODS_KEY]:
|
|
24
35
|
| Map<ModCallbackCustom, AnyFunction>
|
|
@@ -138,40 +149,51 @@ function initDecoratedCallbacks(
|
|
|
138
149
|
init: boolean,
|
|
139
150
|
) {
|
|
140
151
|
const modFeatureConstructor = constructor as ModFeatureConstructor;
|
|
141
|
-
const
|
|
142
|
-
?
|
|
143
|
-
:
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
152
|
+
const callbackTuplesKey = vanilla
|
|
153
|
+
? MOD_FEATURE_CALLBACKS_KEY
|
|
154
|
+
: MOD_FEATURE_CUSTOM_CALLBACKS_KEY;
|
|
155
|
+
const callbackTuples = modFeatureConstructor[callbackTuplesKey];
|
|
156
|
+
if (callbackTuples === undefined) {
|
|
146
157
|
return;
|
|
147
158
|
}
|
|
148
159
|
|
|
149
|
-
if (!isArray(
|
|
160
|
+
if (!isArray(callbackTuples)) {
|
|
150
161
|
error(
|
|
151
|
-
`Failed to initialize/uninitialize the decorated callbacks on a mod feature since the callback arguments on the key of "${
|
|
162
|
+
`Failed to initialize/uninitialize the decorated callbacks on a mod feature since the callback arguments on the key of "${callbackTuplesKey}" was not an array and was instead of type: ${type(
|
|
163
|
+
callbackTuples,
|
|
164
|
+
)}`,
|
|
152
165
|
);
|
|
153
166
|
}
|
|
154
167
|
|
|
155
|
-
for (const
|
|
156
|
-
if (!isArray(
|
|
168
|
+
for (const callbackTuple of callbackTuples) {
|
|
169
|
+
if (!isArray(callbackTuple)) {
|
|
157
170
|
error(
|
|
158
|
-
|
|
171
|
+
`Failed to initialize/uninitialize the decorated callbacks on a mod feature since one of the callback arguments on the key of "${callbackTuplesKey}" was not an array and was instead of type: ${type(
|
|
172
|
+
callbackTuple,
|
|
173
|
+
)}`,
|
|
159
174
|
);
|
|
160
175
|
}
|
|
161
176
|
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
const modCallback = parameters.shift();
|
|
177
|
+
const modCallback = callbackTuple[0];
|
|
165
178
|
if (!isNumber(modCallback)) {
|
|
166
179
|
error(
|
|
167
|
-
`Failed to get the callback number from the
|
|
180
|
+
`Failed to get the callback number from the callback tuple for class: ${tstlClassName}`,
|
|
168
181
|
);
|
|
169
182
|
}
|
|
170
183
|
|
|
171
|
-
const callback =
|
|
184
|
+
const callback = callbackTuple[1];
|
|
172
185
|
if (!isFunction(callback)) {
|
|
173
186
|
error(
|
|
174
|
-
`Failed to get the callback function from the
|
|
187
|
+
`Failed to get the callback function from the callback tuple for class: ${tstlClassName}`,
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const parameters = callbackTuple[2];
|
|
192
|
+
// We must pass false as the second argument to `isArray` since the callback parameters may not
|
|
193
|
+
// necessarily be contiguous. (They might be separated by `undefined` values.)
|
|
194
|
+
if (!isArray(parameters, false)) {
|
|
195
|
+
error(
|
|
196
|
+
`Failed to get the callback parameters from the callback tuple for class: ${tstlClassName}`,
|
|
175
197
|
);
|
|
176
198
|
}
|
|
177
199
|
|
|
@@ -292,15 +292,25 @@ export class ModUpgradedBase implements Mod {
|
|
|
292
292
|
|
|
293
293
|
if (feature.callbacksUsed !== undefined) {
|
|
294
294
|
for (const callbackTuple of feature.callbacksUsed) {
|
|
295
|
-
const [modCallback,
|
|
296
|
-
|
|
295
|
+
const [modCallback, callbackFunc, optionalArgs] = callbackTuple;
|
|
296
|
+
// TypeScript is not smart enough to know that the arguments match the function.
|
|
297
|
+
(this.AddCallback as AnyFunction)(
|
|
298
|
+
modCallback,
|
|
299
|
+
callbackFunc,
|
|
300
|
+
...(optionalArgs ?? []),
|
|
301
|
+
);
|
|
297
302
|
}
|
|
298
303
|
}
|
|
299
304
|
|
|
300
305
|
if (feature.customCallbacksUsed !== undefined) {
|
|
301
306
|
for (const callbackTuple of feature.customCallbacksUsed) {
|
|
302
|
-
const [modCallback,
|
|
303
|
-
|
|
307
|
+
const [modCallback, callbackFunc, optionalArgs] = callbackTuple;
|
|
308
|
+
// TypeScript is not smart enough to know that the arguments match the function.
|
|
309
|
+
(this.AddCallbackCustom as AnyFunction)(
|
|
310
|
+
modCallback,
|
|
311
|
+
callbackFunc,
|
|
312
|
+
...(optionalArgs ?? []),
|
|
313
|
+
);
|
|
304
314
|
}
|
|
305
315
|
}
|
|
306
316
|
|
|
@@ -355,17 +365,15 @@ export class ModUpgradedBase implements Mod {
|
|
|
355
365
|
|
|
356
366
|
if (feature.callbacksUsed !== undefined) {
|
|
357
367
|
for (const callbackTuple of feature.callbacksUsed) {
|
|
358
|
-
const [modCallback,
|
|
359
|
-
|
|
360
|
-
this.RemoveCallback(modCallback, callback);
|
|
368
|
+
const [modCallback, callbackFunc] = callbackTuple;
|
|
369
|
+
this.RemoveCallback(modCallback, callbackFunc);
|
|
361
370
|
}
|
|
362
371
|
}
|
|
363
372
|
|
|
364
373
|
if (feature.customCallbacksUsed !== undefined) {
|
|
365
374
|
for (const callbackTuple of feature.customCallbacksUsed) {
|
|
366
|
-
const [modCallback,
|
|
367
|
-
|
|
368
|
-
this.RemoveCallbackCustom(modCallback, callback);
|
|
375
|
+
const [modCallback, callbackFunc] = callbackTuple;
|
|
376
|
+
this.RemoveCallbackCustom(modCallback, callbackFunc);
|
|
369
377
|
}
|
|
370
378
|
}
|
|
371
379
|
|
|
@@ -26,7 +26,8 @@ export class PostCollectibleEmpty extends CustomCallback<T> {
|
|
|
26
26
|
// 35
|
|
27
27
|
[
|
|
28
28
|
ModCallback.POST_PICKUP_UPDATE,
|
|
29
|
-
|
|
29
|
+
this.postPickupUpdateCollectible,
|
|
30
|
+
[PickupVariant.COLLECTIBLE],
|
|
30
31
|
],
|
|
31
32
|
];
|
|
32
33
|
}
|
|
@@ -19,7 +19,8 @@ export class PostCollectibleInitFirst extends CustomCallback<ModCallbackCustom.P
|
|
|
19
19
|
// 34
|
|
20
20
|
[
|
|
21
21
|
ModCallback.POST_PICKUP_INIT,
|
|
22
|
-
|
|
22
|
+
this.postPickupInitCollectible,
|
|
23
|
+
[PickupVariant.COLLECTIBLE],
|
|
23
24
|
],
|
|
24
25
|
];
|
|
25
26
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CollectibleType,
|
|
3
3
|
DamageFlag,
|
|
4
|
-
EntityType,
|
|
5
4
|
ModCallback,
|
|
6
5
|
PlayerVariant,
|
|
7
6
|
RoomType,
|
|
@@ -39,47 +38,82 @@ export class PostCursedTeleport extends CustomCallback<ModCallbackCustom.POST_CU
|
|
|
39
38
|
super();
|
|
40
39
|
|
|
41
40
|
this.callbacksUsed = [
|
|
42
|
-
// 11
|
|
43
|
-
[
|
|
44
|
-
ModCallback.ENTITY_TAKE_DMG,
|
|
45
|
-
[this.entityTakeDmgPlayer, EntityType.PLAYER],
|
|
46
|
-
],
|
|
47
|
-
|
|
48
41
|
// 32
|
|
49
42
|
[
|
|
50
43
|
ModCallback.POST_PLAYER_RENDER,
|
|
51
44
|
// Co-op babies cannot perform Cursed Eye teleports.
|
|
52
|
-
|
|
45
|
+
this.postPlayerRenderPlayer,
|
|
46
|
+
[PlayerVariant.PLAYER],
|
|
53
47
|
],
|
|
54
48
|
];
|
|
49
|
+
|
|
50
|
+
this.customCallbacksUsed = [
|
|
51
|
+
[ModCallbackCustom.ENTITY_TAKE_DMG_PLAYER, this.entityTakeDmgPlayer],
|
|
52
|
+
];
|
|
55
53
|
}
|
|
56
54
|
|
|
57
|
-
// ModCallback.
|
|
58
|
-
//
|
|
55
|
+
// ModCallback.POST_PLAYER_RENDER (32)
|
|
56
|
+
// PlayerVariant.PLAYER (0)
|
|
57
|
+
private postPlayerRenderPlayer = (
|
|
58
|
+
player: EntityPlayer,
|
|
59
|
+
_renderOffset: Vector,
|
|
60
|
+
): void => {
|
|
61
|
+
// Retrieve information about this player.
|
|
62
|
+
const trackingArray = mapGetPlayer(
|
|
63
|
+
this.v.run.playersDamageFrameMap,
|
|
64
|
+
player,
|
|
65
|
+
);
|
|
66
|
+
if (trackingArray === undefined) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const [lastDamageFrame, callbackActivatedOnThisFrame] = trackingArray;
|
|
70
|
+
|
|
71
|
+
if (!playerIsTeleportingFromCursedTeleport(player, lastDamageFrame)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Do nothing if the callback already fired on this frame.
|
|
76
|
+
if (callbackActivatedOnThisFrame) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const gameFrameCount = game.GetFrameCount();
|
|
81
|
+
const newTrackingArray = [gameFrameCount, true];
|
|
82
|
+
mapSetPlayer(this.v.run.playersDamageFrameMap, player, newTrackingArray);
|
|
83
|
+
|
|
84
|
+
this.fire(player);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// ModCallbackCustom.ENTITY_TAKE_DMG_PLAYER
|
|
59
88
|
private entityTakeDmgPlayer = (
|
|
60
|
-
|
|
89
|
+
player: EntityPlayer,
|
|
61
90
|
_amount: float,
|
|
62
91
|
damageFlags: BitFlags<DamageFlag>,
|
|
63
92
|
_source: EntityRef,
|
|
64
93
|
_countdownFrames: int,
|
|
65
94
|
): boolean | undefined => {
|
|
66
95
|
this.incrementNumSacrifices(damageFlags); // Has to be before setting the damage frame.
|
|
67
|
-
this.setDamageFrame(
|
|
96
|
+
this.setDamageFrame(player, damageFlags);
|
|
68
97
|
|
|
69
98
|
return undefined;
|
|
70
99
|
};
|
|
71
100
|
|
|
101
|
+
private incrementNumSacrifices(damageFlags: BitFlags<DamageFlag>): void {
|
|
102
|
+
const room = game.GetRoom();
|
|
103
|
+
const roomType = room.GetType();
|
|
104
|
+
const isSpikeDamage = hasFlag(damageFlags, DamageFlag.SPIKES);
|
|
105
|
+
|
|
106
|
+
if (roomType === RoomType.SACRIFICE && isSpikeDamage) {
|
|
107
|
+
this.v.level.numSacrifices++;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
72
111
|
private setDamageFrame(
|
|
73
|
-
|
|
112
|
+
player: EntityPlayer,
|
|
74
113
|
damageFlags: BitFlags<DamageFlag>,
|
|
75
114
|
): void {
|
|
76
115
|
const gameFrameCount = game.GetFrameCount();
|
|
77
116
|
|
|
78
|
-
const player = entity.ToPlayer();
|
|
79
|
-
if (player === undefined) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
117
|
// Don't do anything if we already activated the callback on this frame.
|
|
84
118
|
const trackingArray = mapGetPlayer(
|
|
85
119
|
this.v.run.playersDamageFrameMap,
|
|
@@ -116,48 +150,6 @@ export class PostCursedTeleport extends CustomCallback<ModCallbackCustom.POST_CU
|
|
|
116
150
|
(this.v.level.numSacrifices === 6 || this.v.level.numSacrifices >= 12)
|
|
117
151
|
);
|
|
118
152
|
}
|
|
119
|
-
|
|
120
|
-
private incrementNumSacrifices(damageFlags: BitFlags<DamageFlag>): void {
|
|
121
|
-
const room = game.GetRoom();
|
|
122
|
-
const roomType = room.GetType();
|
|
123
|
-
const isSpikeDamage = hasFlag(damageFlags, DamageFlag.SPIKES);
|
|
124
|
-
|
|
125
|
-
if (roomType === RoomType.SACRIFICE && isSpikeDamage) {
|
|
126
|
-
this.v.level.numSacrifices++;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// ModCallback.POST_PLAYER_RENDER (32)
|
|
131
|
-
// PlayerVariant.PLAYER (0)
|
|
132
|
-
private postPlayerRenderPlayer = (
|
|
133
|
-
player: EntityPlayer,
|
|
134
|
-
_renderOffset: Vector,
|
|
135
|
-
): void => {
|
|
136
|
-
// Retrieve information about this player.
|
|
137
|
-
const trackingArray = mapGetPlayer(
|
|
138
|
-
this.v.run.playersDamageFrameMap,
|
|
139
|
-
player,
|
|
140
|
-
);
|
|
141
|
-
if (trackingArray === undefined) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
const [lastDamageFrame, callbackActivatedOnThisFrame] = trackingArray;
|
|
145
|
-
|
|
146
|
-
if (!playerIsTeleportingFromCursedTeleport(player, lastDamageFrame)) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Do nothing if the callback already fired on this frame.
|
|
151
|
-
if (callbackActivatedOnThisFrame) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const gameFrameCount = game.GetFrameCount();
|
|
156
|
-
const newTrackingArray = [gameFrameCount, true];
|
|
157
|
-
mapSetPlayer(this.v.run.playersDamageFrameMap, player, newTrackingArray);
|
|
158
|
-
|
|
159
|
-
this.fire(player);
|
|
160
|
-
};
|
|
161
153
|
}
|
|
162
154
|
|
|
163
155
|
function playerIsTeleportingFromCursedTeleport(
|
|
@@ -15,7 +15,7 @@ export class PostFamiliarInitLate extends CustomCallback<ModCallbackCustom.POST_
|
|
|
15
15
|
|
|
16
16
|
this.callbacksUsed = [
|
|
17
17
|
// 6
|
|
18
|
-
[ModCallback.POST_FAMILIAR_UPDATE,
|
|
18
|
+
[ModCallback.POST_FAMILIAR_UPDATE, this.postFamiliarUpdate],
|
|
19
19
|
];
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -16,7 +16,7 @@ export class PostFamiliarStateChanged extends CustomCallback<ModCallbackCustom.P
|
|
|
16
16
|
|
|
17
17
|
this.callbacksUsed = [
|
|
18
18
|
// 6
|
|
19
|
-
[ModCallback.POST_FAMILIAR_UPDATE,
|
|
19
|
+
[ModCallback.POST_FAMILIAR_UPDATE, this.postFamiliarUpdate],
|
|
20
20
|
];
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -22,7 +22,7 @@ export class PostHolyMantleRemoved extends CustomCallback<ModCallbackCustom.POST
|
|
|
22
22
|
this.customCallbacksUsed = [
|
|
23
23
|
[
|
|
24
24
|
ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED,
|
|
25
|
-
|
|
25
|
+
this.postPEffectUpdateReordered,
|
|
26
26
|
],
|
|
27
27
|
];
|
|
28
28
|
}
|