isaacscript-common 18.2.1 → 18.3.1
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 +179 -119
- package/dist/isaacscript-common.lua +464 -416
- package/dist/src/callbackClasses.d.ts +2 -0
- package/dist/src/callbackClasses.d.ts.map +1 -1
- package/dist/src/callbackClasses.lua +10 -0
- package/dist/src/callbacks.d.ts +101 -99
- package/dist/src/callbacks.d.ts.map +1 -1
- package/dist/src/callbacks.lua +2 -0
- 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.d.ts +11 -0
- package/dist/src/classes/callbacks/InputActionFilter.d.ts.map +1 -0
- package/dist/src/classes/callbacks/InputActionFilter.lua +23 -0
- package/dist/src/classes/callbacks/InputActionPlayer.d.ts +11 -0
- package/dist/src/classes/callbacks/InputActionPlayer.d.ts.map +1 -0
- package/dist/src/classes/callbacks/InputActionPlayer.lua +33 -0
- 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/enums/ModCallbackCustom.d.ts +141 -99
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/enums/ModCallbackCustom.lua +103 -99
- 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/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/interfaces/private/AddCallbackParametersCustom.d.ts +13 -1
- package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
- 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/callbackClasses.ts +2 -0
- package/src/callbacks.ts +2 -0
- 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 +46 -0
- package/src/classes/callbacks/InputActionPlayer.ts +67 -0
- 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/enums/ModCallbackCustom.ts +44 -0
- package/src/functions/array.ts +14 -5
- package/src/functions/decorators.ts +14 -20
- package/src/functions/logMisc.ts +4 -1
- package/src/interfaces/private/AddCallbackParametersCustom.ts +24 -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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
|
|
2
2
|
import { AddCallbackParametersCustom } from "../../interfaces/private/AddCallbackParametersCustom";
|
|
3
|
-
import { AllButFirst } from "../../types/
|
|
3
|
+
import { AllButFirst } from "../../types/AllButFirst";
|
|
4
|
+
import { AnyFunction } from "../../types/AnyFunction";
|
|
4
5
|
import { Feature } from "./Feature";
|
|
5
6
|
|
|
6
7
|
export type FireArgs<T extends ModCallbackCustom> = Parameters<
|
|
@@ -10,6 +11,11 @@ export type OptionalArgs<T extends ModCallbackCustom> = AllButFirst<
|
|
|
10
11
|
AddCallbackParametersCustom[T]
|
|
11
12
|
>;
|
|
12
13
|
|
|
14
|
+
type Subscription<T extends ModCallbackCustom> = [
|
|
15
|
+
callbackFunc: AddCallbackParametersCustom[T][0],
|
|
16
|
+
optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>,
|
|
17
|
+
];
|
|
18
|
+
|
|
13
19
|
/**
|
|
14
20
|
* The base class for a custom callback. Individual custom callbacks (and validation callbacks) will
|
|
15
21
|
* extend from this class.
|
|
@@ -17,10 +23,14 @@ export type OptionalArgs<T extends ModCallbackCustom> = AllButFirst<
|
|
|
17
23
|
export abstract class CustomCallback<
|
|
18
24
|
T extends ModCallbackCustom,
|
|
19
25
|
> extends Feature {
|
|
20
|
-
private subscriptions: Array<
|
|
26
|
+
private subscriptions: Array<Subscription<T>> = [];
|
|
21
27
|
|
|
22
|
-
public addSubscriber(
|
|
23
|
-
|
|
28
|
+
public addSubscriber(
|
|
29
|
+
callbackFunc: AddCallbackParametersCustom[T][0],
|
|
30
|
+
...optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>
|
|
31
|
+
): void {
|
|
32
|
+
const subscription: Subscription<T> = [callbackFunc, optionalArgs];
|
|
33
|
+
this.subscriptions.push(subscription);
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
/**
|
|
@@ -42,20 +52,14 @@ export abstract class CustomCallback<
|
|
|
42
52
|
public fire = (
|
|
43
53
|
...fireArgs: FireArgs<T>
|
|
44
54
|
): ReturnType<AddCallbackParametersCustom[T][0]> => {
|
|
45
|
-
for (const
|
|
46
|
-
|
|
47
|
-
// optional arguments to an array instead of a tuple.
|
|
48
|
-
const optionalArgs = optionalArgsArray as OptionalArgs<T>;
|
|
55
|
+
for (const subscription of this.subscriptions) {
|
|
56
|
+
const [callbackFunc, optionalArgs] = subscription;
|
|
49
57
|
|
|
50
58
|
if (this.shouldFire(fireArgs, optionalArgs)) {
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
const callbackCasted = callback as (
|
|
54
|
-
...args: FireArgs<T>
|
|
55
|
-
) => ReturnType<AddCallbackParametersCustom[T][0]>;
|
|
56
|
-
const value = callbackCasted(...fireArgs);
|
|
59
|
+
// TypeScript is not smart enough to know that the arguments match the function.
|
|
60
|
+
const value = (callbackFunc as AnyFunction)(...fireArgs);
|
|
57
61
|
if (value !== undefined) {
|
|
58
|
-
return value
|
|
62
|
+
return value as ReturnType<AddCallbackParametersCustom[T][0]>;
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
}
|
|
@@ -65,6 +65,50 @@ export enum ModCallbackCustom {
|
|
|
65
65
|
*/
|
|
66
66
|
ENTITY_TAKE_DMG_PLAYER,
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* The exact same thing as the vanilla `INPUT_ACTION` callback, except this callback allows you to
|
|
70
|
+
* specify extra arguments for additional filtration.
|
|
71
|
+
*
|
|
72
|
+
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
|
|
73
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
74
|
+
* matches the `InputHook` provided.
|
|
75
|
+
* - You can provide an optional fourth argument that will make the callback only fire if it
|
|
76
|
+
* matches the `ButtonAction` provided.
|
|
77
|
+
*
|
|
78
|
+
* ```ts
|
|
79
|
+
* function inputActionFilter(
|
|
80
|
+
* entity: Entity | undefined,
|
|
81
|
+
* inputHook: InputHook,
|
|
82
|
+
* buttonAction: ButtonAction,
|
|
83
|
+
* ): boolean | undefined {}
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
INPUT_ACTION_FILTER,
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The exact same thing as the vanilla `INPUT_ACTION` callback, except this callback automatically
|
|
90
|
+
* filters for `EntityType.ENTITY_PLAYER` and casts the `Entity` object to a `EntityPlayer`. It
|
|
91
|
+
* also allows you to specify extra arguments for additional filtration.
|
|
92
|
+
*
|
|
93
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
94
|
+
* matches the `PlayerVariant` provided.
|
|
95
|
+
* - You can provide an optional fourth argument that will make the callback only fire if it
|
|
96
|
+
* matches the `PlayerType` provided.
|
|
97
|
+
* - You can provide an optional fifth argument that will make the callback only fire if it
|
|
98
|
+
* matches the `InputHook` provided.
|
|
99
|
+
* - You can provide an optional sixth argument that will make the callback only fire if it
|
|
100
|
+
* matches the `ButtonAction` provided.
|
|
101
|
+
*
|
|
102
|
+
* ```ts
|
|
103
|
+
* function inputActionPlayer(
|
|
104
|
+
* player: EntityPlayer,
|
|
105
|
+
* inputHook: InputHook,
|
|
106
|
+
* buttonAction: ButtonAction,
|
|
107
|
+
* ): boolean | undefined {}
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
INPUT_ACTION_PLAYER,
|
|
111
|
+
|
|
68
112
|
/**
|
|
69
113
|
* Fires from the `POST_UPDATE` callback when a Challenge Room or Boss Rush is started.
|
|
70
114
|
* Specifically, this happens on the first frame that `Room.IsAmbushDone` is true.
|
package/src/functions/array.ts
CHANGED
|
@@ -405,8 +405,15 @@ export function getRandomArrayIndex<T>(
|
|
|
405
405
|
*
|
|
406
406
|
* - the table contains all numerical indexes that are contiguous, starting at 1
|
|
407
407
|
* - the table has no keys (i.e. an "empty" table)
|
|
408
|
+
*
|
|
409
|
+
* @param object The object to analyze.
|
|
410
|
+
* @param ensureContiguousValues Optional. Whether or not the Lua table has to have all contiguous
|
|
411
|
+
* keys in order to be considered an array. Default is true.
|
|
408
412
|
*/
|
|
409
|
-
export function isArray(
|
|
413
|
+
export function isArray(
|
|
414
|
+
object: unknown,
|
|
415
|
+
ensureContiguousValues = true,
|
|
416
|
+
): object is unknown[] {
|
|
410
417
|
if (!isTable(object)) {
|
|
411
418
|
return false;
|
|
412
419
|
}
|
|
@@ -431,10 +438,12 @@ export function isArray(object: unknown): object is unknown[] {
|
|
|
431
438
|
}
|
|
432
439
|
|
|
433
440
|
// Fourth, check for non-contiguous elements. (Lua tables start at an index of 1.)
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
441
|
+
if (ensureContiguousValues) {
|
|
442
|
+
for (let i = 1; i <= keys.length; i++) {
|
|
443
|
+
const element = object.get(i);
|
|
444
|
+
if (element === undefined) {
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
438
447
|
}
|
|
439
448
|
}
|
|
440
449
|
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
import { ModCallback } from "isaac-typescript-definitions";
|
|
24
24
|
import {
|
|
25
|
-
ADD_CALLBACK_ARGS_KEY,
|
|
26
|
-
ADD_CALLBACK_CUSTOM_ARGS_KEY,
|
|
27
25
|
ModFeature,
|
|
26
|
+
MOD_FEATURE_CALLBACKS_KEY,
|
|
27
|
+
MOD_FEATURE_CUSTOM_CALLBACKS_KEY,
|
|
28
28
|
} from "../classes/ModFeature";
|
|
29
29
|
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
30
30
|
import { AddCallbackParametersCustom } from "../interfaces/private/AddCallbackParametersCustom";
|
|
@@ -50,11 +50,7 @@ export function Callback<T extends ModCallback>(
|
|
|
50
50
|
// First, prepare the arguments for the `Mod.AddCallback` method.
|
|
51
51
|
const methodName = propertyKey as keyof Class;
|
|
52
52
|
const method = target[methodName] as AddCallbackParameters[T][0];
|
|
53
|
-
const
|
|
54
|
-
modCallback,
|
|
55
|
-
method,
|
|
56
|
-
...optionalArgs,
|
|
57
|
-
] as unknown as AddCallbackParameters[T];
|
|
53
|
+
const callbackTuple = [modCallback, method, optionalArgs];
|
|
58
54
|
|
|
59
55
|
// Since the decorator runs prior to instantiation, we only have access to get and set static
|
|
60
56
|
// properties, which are located on the "constructor" table. Thus, we store the callback
|
|
@@ -70,12 +66,14 @@ export function Callback<T extends ModCallback>(
|
|
|
70
66
|
);
|
|
71
67
|
}
|
|
72
68
|
|
|
73
|
-
if (!constructor.has(
|
|
74
|
-
constructor.set(
|
|
69
|
+
if (!constructor.has(MOD_FEATURE_CALLBACKS_KEY)) {
|
|
70
|
+
constructor.set(MOD_FEATURE_CALLBACKS_KEY, []);
|
|
75
71
|
}
|
|
76
72
|
|
|
77
|
-
const callbackTuples = constructor.get(
|
|
78
|
-
|
|
73
|
+
const callbackTuples = constructor.get(
|
|
74
|
+
MOD_FEATURE_CALLBACKS_KEY,
|
|
75
|
+
) as unknown[];
|
|
76
|
+
callbackTuples.push(callbackTuple);
|
|
79
77
|
};
|
|
80
78
|
}
|
|
81
79
|
|
|
@@ -101,11 +99,7 @@ export function CallbackCustom<T extends ModCallbackCustom>(
|
|
|
101
99
|
// First, prepare the arguments for the `Mod.AddCallbackCustom` method.
|
|
102
100
|
const methodName = propertyKey as keyof Class;
|
|
103
101
|
const method = target[methodName] as AddCallbackParametersCustom[T][0];
|
|
104
|
-
const
|
|
105
|
-
modCallbackCustom,
|
|
106
|
-
method,
|
|
107
|
-
...optionalArgs,
|
|
108
|
-
] as unknown as AddCallbackParametersCustom[T];
|
|
102
|
+
const callbackTuple: unknown[] = [modCallbackCustom, method, optionalArgs];
|
|
109
103
|
|
|
110
104
|
// Since the decorator runs prior to instantiation, we only have access to get and set static
|
|
111
105
|
// properties, which are located on the "constructor" table. Thus, we store the callback
|
|
@@ -121,13 +115,13 @@ export function CallbackCustom<T extends ModCallbackCustom>(
|
|
|
121
115
|
);
|
|
122
116
|
}
|
|
123
117
|
|
|
124
|
-
if (!constructor.has(
|
|
125
|
-
constructor.set(
|
|
118
|
+
if (!constructor.has(MOD_FEATURE_CUSTOM_CALLBACKS_KEY)) {
|
|
119
|
+
constructor.set(MOD_FEATURE_CUSTOM_CALLBACKS_KEY, []);
|
|
126
120
|
}
|
|
127
121
|
|
|
128
122
|
const callbackTuples = constructor.get(
|
|
129
|
-
|
|
123
|
+
MOD_FEATURE_CUSTOM_CALLBACKS_KEY,
|
|
130
124
|
) as unknown[];
|
|
131
|
-
callbackTuples.push(
|
|
125
|
+
callbackTuples.push(callbackTuple);
|
|
132
126
|
};
|
|
133
127
|
}
|
package/src/functions/logMisc.ts
CHANGED
|
@@ -31,8 +31,11 @@ import { isTable, isUserdata } from "./types";
|
|
|
31
31
|
import { printConsole } from "./utils";
|
|
32
32
|
import { vectorToString } from "./vector";
|
|
33
33
|
|
|
34
|
+
/** Helper function to enumerate all of the values in an array. */
|
|
34
35
|
export function logArray<T>(array: T[] | readonly T[]): void {
|
|
35
|
-
|
|
36
|
+
// We do not assume the given array has contiguous values in order to be more permissive about the
|
|
37
|
+
// kinds of arrays that will successfully log without a run-time error.
|
|
38
|
+
if (!isArray(array, false)) {
|
|
36
39
|
log("Tried to log an array, but the given object was not an array.");
|
|
37
40
|
return;
|
|
38
41
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ActiveSlot,
|
|
3
3
|
BombVariant,
|
|
4
|
+
ButtonAction,
|
|
4
5
|
CollectibleType,
|
|
5
6
|
DamageFlag,
|
|
6
7
|
DiceFloorSubType,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
EntityType,
|
|
10
11
|
FamiliarVariant,
|
|
11
12
|
GridEntityType,
|
|
13
|
+
InputHook,
|
|
12
14
|
ItemType,
|
|
13
15
|
KnifeVariant,
|
|
14
16
|
LaserVariant,
|
|
@@ -63,6 +65,28 @@ export interface AddCallbackParametersCustom {
|
|
|
63
65
|
character?: PlayerType,
|
|
64
66
|
];
|
|
65
67
|
|
|
68
|
+
[ModCallbackCustom.INPUT_ACTION_FILTER]: [
|
|
69
|
+
callback: (
|
|
70
|
+
entity: Entity | undefined,
|
|
71
|
+
inputHook: InputHook,
|
|
72
|
+
buttonAction: ButtonAction,
|
|
73
|
+
) => boolean | float | undefined,
|
|
74
|
+
inputHook?: InputHook,
|
|
75
|
+
buttonAction?: ButtonAction,
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
[ModCallbackCustom.INPUT_ACTION_PLAYER]: [
|
|
79
|
+
callback: (
|
|
80
|
+
player: EntityPlayer,
|
|
81
|
+
inputHook: InputHook,
|
|
82
|
+
buttonAction: ButtonAction,
|
|
83
|
+
) => boolean | float | undefined,
|
|
84
|
+
playerVariant?: PlayerVariant,
|
|
85
|
+
character?: PlayerType,
|
|
86
|
+
inputHook?: InputHook,
|
|
87
|
+
buttonAction?: ButtonAction,
|
|
88
|
+
];
|
|
89
|
+
|
|
66
90
|
[ModCallbackCustom.POST_AMBUSH_FINISHED]: [
|
|
67
91
|
callback: (ambushType: AmbushType) => void,
|
|
68
92
|
ambushType?: AmbushType,
|
package/src/types/ModUpgraded.ts
CHANGED
|
@@ -33,5 +33,5 @@ type ISCFeaturesToKeys<T extends readonly ISCFeature[]> = Omit<
|
|
|
33
33
|
* same private fields will cause a `never` type.
|
|
34
34
|
*/
|
|
35
35
|
type ISCFeatureTupleToClassTuple<T extends ISCFeature[]> = {
|
|
36
|
-
[
|
|
36
|
+
[Key in keyof T]: PublicInterface<ISCFeatureToClass[T[Key]]>;
|
|
37
37
|
};
|
|
@@ -1,21 +1,30 @@
|
|
|
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
6
|
/**
|
|
6
|
-
* A mapping of the callback enum to the associated callback
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* A mapping of the callback enum to the associated callback function and optional arguments. This
|
|
8
|
+
* is so that the respective callback functions can be added/removed on demand as subscribers get
|
|
9
|
+
* added/removed.
|
|
9
10
|
*/
|
|
10
11
|
export type CallbackTuple = {
|
|
11
|
-
[
|
|
12
|
+
[Key in ModCallback]: [
|
|
13
|
+
modCallback: Key,
|
|
14
|
+
callbackFunc: AddCallbackParameters[Key][0],
|
|
15
|
+
optionalArgs?: AllButFirst<AddCallbackParameters[Key]>,
|
|
16
|
+
];
|
|
12
17
|
}[ModCallback];
|
|
13
18
|
|
|
14
19
|
/**
|
|
15
|
-
* A mapping of the custom callback enum to the associated callback
|
|
16
|
-
*
|
|
17
|
-
*
|
|
20
|
+
* A mapping of the custom callback enum to the associated callback function and optional arguments.
|
|
21
|
+
* This is so that the respective callback functions can be added/removed on demand as subscribers
|
|
22
|
+
* get added/removed.
|
|
18
23
|
*/
|
|
19
24
|
export type CustomCallbackTuple = {
|
|
20
|
-
[
|
|
25
|
+
[Key in ModCallbackCustom]: [
|
|
26
|
+
modCallback: Key,
|
|
27
|
+
callbackFunc: AddCallbackParametersCustom[Key][0],
|
|
28
|
+
optionalArgs?: AllButFirst<AddCallbackParametersCustom[Key]>,
|
|
29
|
+
];
|
|
21
30
|
}[ModCallbackCustom];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AllButFirst.d.ts","sourceRoot":"","sources":["../../../../src/types/private/AllButFirst.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS;IACvD,OAAO;IACP,GAAG,MAAM,IAAI;CACd,GACG,IAAI,GACJ,OAAO,EAAE,CAAC"}
|