isaacscript-common 14.1.2 → 14.2.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.d.ts +954 -158
- package/dist/isaacscript-common.lua +4099 -1066
- package/dist/src/callbacks.d.ts +102 -20
- package/dist/src/callbacks.d.ts.map +1 -1
- package/dist/src/callbacks.lua +124 -1
- package/dist/src/classes/ModFeature.d.ts +16 -4
- package/dist/src/classes/ModFeature.d.ts.map +1 -1
- package/dist/src/classes/ModFeature.lua +67 -4
- package/dist/src/classes/ModUpgraded.d.ts +10 -10
- package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
- package/dist/src/classes/ModUpgraded.lua +35 -16
- package/dist/src/classes/callbacks/PostCustomRevive.d.ts +5 -2
- package/dist/src/classes/callbacks/PostCustomRevive.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostCustomRevive.lua +12 -4
- package/dist/src/classes/callbacks/PostGridEntityBroken.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCollision.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomBroken.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomCollision.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomInit.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomRemove.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomRender.d.ts +6 -0
- package/dist/src/classes/callbacks/PostGridEntityCustomRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostGridEntityCustomRender.lua +17 -0
- package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityInit.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityRemove.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityRender.d.ts +6 -0
- package/dist/src/classes/callbacks/PostGridEntityRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostGridEntityRender.lua +17 -0
- package/dist/src/classes/callbacks/PostGridEntityStateChanged.lua +1 -1
- package/dist/src/classes/callbacks/PostGridEntityUpdate.lua +1 -1
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts +1 -1
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +3 -4
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts +43 -0
- package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostItemDischarge.lua +113 -0
- package/dist/src/classes/callbacks/PostItemPickup.d.ts +6 -0
- package/dist/src/classes/callbacks/PostItemPickup.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostItemPickup.lua +17 -0
- package/dist/src/classes/callbacks/PostLaserInitLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostLaserInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostLaserInitLate.lua +27 -0
- package/dist/src/classes/callbacks/PostNPCInitLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostNPCInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostNPCInitLate.lua +27 -0
- package/dist/src/classes/callbacks/PostNPCStateChanged.d.ts +14 -0
- package/dist/src/classes/callbacks/PostNPCStateChanged.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostNPCStateChanged.lua +33 -0
- package/dist/src/classes/callbacks/PostPickupCollect.d.ts +12 -0
- package/dist/src/classes/callbacks/PostPickupCollect.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPickupCollect.lua +35 -0
- package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts +12 -0
- package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPickupInitFirst.lua +32 -0
- package/dist/src/classes/callbacks/PostPickupInitLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostPickupInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPickupInitLate.lua +27 -0
- package/dist/src/classes/callbacks/PostPickupStateChanged.d.ts +13 -0
- package/dist/src/classes/callbacks/PostPickupStateChanged.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPickupStateChanged.lua +33 -0
- package/dist/src/classes/callbacks/PostPitUpdate.d.ts +7 -0
- package/dist/src/classes/callbacks/PostPitUpdate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPitUpdate.lua +24 -0
- package/dist/src/classes/callbacks/PostPlayerChangeHealth.d.ts +15 -0
- package/dist/src/classes/callbacks/PostPlayerChangeHealth.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPlayerChangeHealth.lua +52 -0
- package/dist/src/classes/callbacks/PostPlayerChangeStat.d.ts +16 -0
- package/dist/src/classes/callbacks/PostPlayerChangeStat.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPlayerChangeStat.lua +94 -0
- package/dist/src/classes/callbacks/PostPlayerChangeType.d.ts +15 -0
- package/dist/src/classes/callbacks/PostPlayerChangeType.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPlayerChangeType.lua +37 -0
- package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.d.ts +6 -0
- package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.lua +17 -0
- package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.d.ts +6 -0
- package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.lua +17 -0
- package/dist/src/classes/callbacks/PostPlayerInitFirst.d.ts +8 -0
- package/dist/src/classes/callbacks/PostPlayerInitFirst.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPlayerInitFirst.lua +39 -0
- package/dist/src/classes/callbacks/PostPlayerInitLate.d.ts +13 -0
- package/dist/src/classes/callbacks/PostPlayerInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPlayerInitLate.lua +29 -0
- package/dist/src/classes/callbacks/PostPoopRender.d.ts +7 -0
- package/dist/src/classes/callbacks/PostPoopRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPoopRender.lua +24 -0
- package/dist/src/classes/callbacks/PostPoopUpdate.d.ts +7 -0
- package/dist/src/classes/callbacks/PostPoopUpdate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPoopUpdate.lua +24 -0
- package/dist/src/classes/callbacks/PostPressurePlateRender.d.ts +7 -0
- package/dist/src/classes/callbacks/PostPressurePlateRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPressurePlateRender.lua +24 -0
- package/dist/src/classes/callbacks/PostPressurePlateUpdate.d.ts +7 -0
- package/dist/src/classes/callbacks/PostPressurePlateUpdate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPressurePlateUpdate.lua +24 -0
- package/dist/src/classes/callbacks/PostProjectileInitLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostProjectileInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostProjectileInitLate.lua +27 -0
- package/dist/src/classes/callbacks/PostPurchase.d.ts +18 -0
- package/dist/src/classes/callbacks/PostPurchase.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostPurchase.lua +56 -0
- package/dist/src/classes/callbacks/PostRockRender.d.ts +7 -0
- package/dist/src/classes/callbacks/PostRockRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostRockRender.lua +24 -0
- package/dist/src/classes/callbacks/PostRockUpdate.d.ts +7 -0
- package/dist/src/classes/callbacks/PostRockUpdate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostRockUpdate.lua +24 -0
- package/dist/src/classes/callbacks/PostSacrifice.d.ts +15 -0
- package/dist/src/classes/callbacks/PostSacrifice.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSacrifice.lua +52 -0
- package/dist/src/classes/callbacks/PostSlotAnimationChanged.d.ts +6 -0
- package/dist/src/classes/callbacks/PostSlotAnimationChanged.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSlotAnimationChanged.lua +17 -0
- package/dist/src/classes/callbacks/PostSlotCollision.d.ts +7 -0
- package/dist/src/classes/callbacks/PostSlotCollision.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSlotCollision.lua +25 -0
- package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts +14 -0
- package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSlotDestroyed.lua +65 -0
- package/dist/src/classes/callbacks/PostSlotInit.d.ts +6 -0
- package/dist/src/classes/callbacks/PostSlotInit.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSlotInit.lua +17 -0
- package/dist/src/classes/callbacks/PostSlotRender.d.ts +6 -0
- package/dist/src/classes/callbacks/PostSlotRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSlotRender.lua +17 -0
- package/dist/src/classes/callbacks/PostSlotUpdate.d.ts +6 -0
- package/dist/src/classes/callbacks/PostSlotUpdate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSlotUpdate.lua +17 -0
- package/dist/src/classes/callbacks/PostSpikesUpdate.d.ts +7 -0
- package/dist/src/classes/callbacks/PostSpikesUpdate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostSpikesUpdate.lua +24 -0
- package/dist/src/classes/callbacks/PostTNTRender.d.ts +7 -0
- package/dist/src/classes/callbacks/PostTNTRender.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostTNTRender.lua +24 -0
- package/dist/src/classes/callbacks/PostTNTUpdate.d.ts +7 -0
- package/dist/src/classes/callbacks/PostTNTUpdate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostTNTUpdate.lua +24 -0
- package/dist/src/classes/callbacks/PostTearInitLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostTearInitLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostTearInitLate.lua +27 -0
- package/dist/src/classes/callbacks/PostTearInitVeryLate.d.ts +12 -0
- package/dist/src/classes/callbacks/PostTearInitVeryLate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostTearInitVeryLate.lua +30 -0
- package/dist/src/classes/callbacks/PostTransformation.d.ts +18 -0
- package/dist/src/classes/callbacks/PostTransformation.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PostTransformation.lua +53 -0
- package/dist/src/classes/callbacks/PreBerserkDeath.d.ts +1 -1
- package/dist/src/classes/callbacks/PreBerserkDeath.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PreBerserkDeath.lua +3 -4
- package/dist/src/classes/callbacks/PreItemPickup.d.ts +6 -0
- package/dist/src/classes/callbacks/PreItemPickup.d.ts.map +1 -0
- package/dist/src/classes/callbacks/PreItemPickup.lua +17 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.lua +19 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.d.ts +11 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.lua +22 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackLaser.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackLaser.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackLaser.lua +19 -0
- package/dist/src/classes/callbacks/validation/{CustomCallbackRevive.d.ts → CustomCallbackNPC.d.ts} +4 -4
- package/dist/src/classes/callbacks/validation/CustomCallbackNPC.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackNPC.lua +22 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPickup.d.ts +12 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPickup.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPickup.lua +22 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts +5 -2
- package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts.map +1 -1
- package/dist/src/classes/callbacks/validation/CustomCallbackPoop.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPoop.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPoop.lua +20 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.lua +20 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.lua +19 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackRock.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackRock.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackRock.lua +20 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackSlot.d.ts +12 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackSlot.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackSlot.lua +19 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.lua +4 -4
- package/dist/src/classes/callbacks/validation/CustomCallbackTNT.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackTNT.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackTNT.lua +20 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackTear.d.ts +10 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackTear.d.ts.map +1 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackTear.lua +19 -0
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +27 -30
- 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 +6 -6
- package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +3 -18
- package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts +12 -0
- package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.lua +33 -0
- package/dist/src/classes/features/callbackLogic/{GridEntityDetection.d.ts → GridEntityUpdateDetection.d.ts} +3 -3
- package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/{GridEntityDetection.lua → GridEntityUpdateDetection.lua} +11 -14
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts +20 -0
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.lua +60 -0
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +47 -0
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +154 -0
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts +18 -0
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.lua +51 -0
- package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts +17 -0
- package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts.map +1 -0
- package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.lua +45 -0
- package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -1
- package/dist/src/classes/features/other/RunInNFrames.lua +9 -0
- package/dist/src/classes/features/other/SaveDataManager.d.ts +215 -0
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -0
- package/dist/src/classes/features/other/SaveDataManager.lua +190 -0
- package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.d.ts +6 -0
- package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.d.ts.map +1 -0
- package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.lua +98 -0
- package/dist/src/classes/features/other/saveDataManager/loadFromDisk.d.ts +6 -0
- package/dist/src/classes/features/other/saveDataManager/loadFromDisk.d.ts.map +1 -0
- package/dist/src/classes/features/other/saveDataManager/loadFromDisk.lua +81 -0
- package/dist/src/classes/features/other/saveDataManager/restoreDefaults.d.ts +7 -0
- package/dist/src/classes/features/other/saveDataManager/restoreDefaults.d.ts.map +1 -0
- package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +69 -0
- package/dist/src/classes/features/other/saveDataManager/saveToDisk.d.ts +5 -0
- package/dist/src/classes/features/other/saveDataManager/saveToDisk.d.ts.map +1 -0
- package/dist/src/classes/features/other/saveDataManager/saveToDisk.lua +46 -0
- package/dist/src/classes/private/CustomCallback.d.ts +2 -3
- package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
- package/dist/src/classes/private/CustomCallback.lua +2 -5
- package/dist/src/classes/private/Feature.d.ts +1 -0
- package/dist/src/classes/private/Feature.d.ts.map +1 -1
- package/dist/src/classes/private/Feature.lua +1 -0
- package/dist/src/core/upgradeMod.d.ts +2 -5
- package/dist/src/core/upgradeMod.d.ts.map +1 -1
- package/dist/src/decorators.d.ts +1 -1
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.lua +6 -8
- package/dist/src/enums/ISCFeature.d.ts +15 -9
- package/dist/src/enums/ISCFeature.d.ts.map +1 -1
- package/dist/src/enums/ISCFeature.lua +30 -9
- package/dist/src/enums/ModCallbackCustom.d.ts +34 -20
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/enums/ModCallbackCustom2.d.ts +61 -20
- package/dist/src/enums/ModCallbackCustom2.d.ts.map +1 -1
- package/dist/src/enums/ModCallbackCustom2.lua +102 -20
- package/dist/src/enums/{private/SerializationBrand.d.ts → SerializationBrand.d.ts} +6 -1
- package/dist/src/enums/SerializationBrand.d.ts.map +1 -0
- package/dist/src/enums/{private/SerializationBrand.lua → SerializationBrand.lua} +1 -0
- package/dist/src/features/customItemPool.d.ts +52 -0
- package/dist/src/features/customItemPool.d.ts.map +1 -0
- package/dist/src/features/customItemPool.lua +111 -0
- package/dist/src/features/deployJSONRoom.d.ts +6 -4
- package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/src/features/deployJSONRoom.lua +6 -4
- package/dist/src/features/fadeInRemover.d.ts.map +1 -1
- package/dist/src/features/fadeInRemover.lua +4 -16
- package/dist/src/features/saveDataManager/exports.d.ts +14 -4
- package/dist/src/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/exports.lua +38 -0
- package/dist/src/features/saveDataManager/load.d.ts +2 -1
- package/dist/src/features/saveDataManager/load.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/load.lua +10 -4
- package/dist/src/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/main.lua +12 -5
- package/dist/src/features/saveDataManager/maps.d.ts +14 -0
- package/dist/src/features/saveDataManager/maps.d.ts.map +1 -1
- package/dist/src/features/saveDataManager/maps.lua +7 -0
- package/dist/src/features.d.ts +31 -12
- package/dist/src/features.d.ts.map +1 -1
- package/dist/src/features.lua +24 -6
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/array.lua +4 -5
- package/dist/src/functions/bitSet128.d.ts +2 -2
- package/dist/src/functions/bitSet128.lua +3 -3
- package/dist/src/functions/color.d.ts +2 -2
- package/dist/src/functions/color.lua +3 -3
- package/dist/src/functions/decorators.d.ts +28 -6
- package/dist/src/functions/decorators.d.ts.map +1 -1
- package/dist/src/functions/decorators.lua +24 -5
- package/dist/src/functions/deepCopy.d.ts +11 -4
- package/dist/src/functions/deepCopy.d.ts.map +1 -1
- package/dist/src/functions/deepCopy.lua +84 -32
- package/dist/src/functions/deepCopyTests.lua +1 -1
- package/dist/src/functions/initArray.d.ts +4 -4
- package/dist/src/functions/initArray.d.ts.map +1 -1
- package/dist/src/functions/initArray.lua +6 -12
- package/dist/src/functions/jsonRoom.d.ts +11 -0
- package/dist/src/functions/jsonRoom.d.ts.map +1 -1
- package/dist/src/functions/jsonRoom.lua +11 -0
- package/dist/src/functions/kColor.d.ts +2 -2
- package/dist/src/functions/kColor.lua +3 -3
- package/dist/src/functions/logMisc.d.ts +9 -2
- package/dist/src/functions/logMisc.d.ts.map +1 -1
- package/dist/src/functions/logMisc.lua +32 -2
- package/dist/src/functions/merge.d.ts +40 -0
- package/dist/src/functions/merge.d.ts.map +1 -0
- package/dist/src/{features/saveDataManager → functions}/merge.lua +84 -37
- package/dist/src/functions/mergeTests.d.ts +1 -2
- package/dist/src/functions/mergeTests.d.ts.map +1 -1
- package/dist/src/functions/mergeTests.lua +3 -4
- package/dist/src/functions/rng.d.ts +2 -2
- package/dist/src/functions/rng.lua +3 -3
- package/dist/src/functions/serialization.d.ts.map +1 -1
- package/dist/src/functions/serialization.lua +22 -0
- package/dist/src/functions/tstlClass.d.ts +0 -10
- package/dist/src/functions/tstlClass.d.ts.map +1 -1
- package/dist/src/functions/tstlClass.lua +2 -42
- package/dist/src/functions/vector.d.ts +2 -2
- package/dist/src/functions/vector.lua +3 -3
- package/dist/src/functions/weighted.d.ts +12 -1
- package/dist/src/functions/weighted.d.ts.map +1 -1
- package/dist/src/functions/weighted.lua +27 -10
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +24 -0
- package/dist/src/interfaces/SaveData.d.ts +3 -7
- package/dist/src/interfaces/SaveData.d.ts.map +1 -1
- package/dist/src/interfaces/SaveData.lua +0 -11
- package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts +195 -2
- package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.lua +1 -1
- package/dist/src/types/AnyClass.d.ts +2 -0
- package/dist/src/types/AnyClass.d.ts.map +1 -0
- package/dist/src/types/AnyClass.lua +2 -0
- package/dist/src/types/AnyFunction.d.ts +6 -0
- package/dist/src/types/AnyFunction.d.ts.map +1 -0
- package/dist/src/types/AnyFunction.lua +2 -0
- package/dist/src/types/FunctionTuple.d.ts +2 -4
- package/dist/src/types/FunctionTuple.d.ts.map +1 -1
- package/dist/src/types/HasFunction.d.ts +5 -0
- package/dist/src/types/HasFunction.d.ts.map +1 -0
- package/dist/src/types/HasFunction.lua +2 -0
- package/package.json +1 -1
- package/src/callbacks.ts +88 -5
- package/src/classes/ModFeature.ts +96 -6
- package/src/classes/ModUpgraded.ts +57 -32
- package/src/classes/callbacks/PostCustomRevive.ts +22 -2
- package/src/classes/callbacks/PostGridEntityBroken.ts +1 -1
- package/src/classes/callbacks/PostGridEntityCollision.ts +1 -1
- package/src/classes/callbacks/PostGridEntityCustomBroken.ts +1 -1
- package/src/classes/callbacks/PostGridEntityCustomCollision.ts +1 -1
- package/src/classes/callbacks/PostGridEntityCustomInit.ts +1 -1
- package/src/classes/callbacks/PostGridEntityCustomRemove.ts +1 -1
- package/src/classes/callbacks/PostGridEntityCustomRender.ts +11 -0
- package/src/classes/callbacks/PostGridEntityCustomStateChanged.ts +1 -1
- package/src/classes/callbacks/PostGridEntityCustomUpdate.ts +1 -1
- package/src/classes/callbacks/PostGridEntityInit.ts +1 -1
- package/src/classes/callbacks/PostGridEntityRemove.ts +1 -1
- package/src/classes/callbacks/PostGridEntityRender.ts +11 -0
- package/src/classes/callbacks/PostGridEntityStateChanged.ts +1 -1
- package/src/classes/callbacks/PostGridEntityUpdate.ts +1 -1
- package/src/classes/callbacks/PostHolyMantleRemoved.ts +5 -8
- package/src/classes/callbacks/PostItemDischarge.ts +181 -0
- package/src/classes/callbacks/PostItemPickup.ts +11 -0
- package/src/classes/callbacks/PostLaserInitLate.ts +28 -0
- package/src/classes/callbacks/PostNPCInitLate.ts +28 -0
- package/src/classes/callbacks/PostNPCStateChanged.ts +37 -0
- package/src/classes/callbacks/PostPickupCollect.ts +37 -0
- package/src/classes/callbacks/PostPickupInitFirst.ts +34 -0
- package/src/classes/callbacks/PostPickupInitLate.ts +28 -0
- package/src/classes/callbacks/PostPickupStateChanged.ts +35 -0
- package/src/classes/callbacks/PostPitUpdate.ts +21 -0
- package/src/classes/callbacks/PostPlayerChangeHealth.ts +57 -0
- package/src/classes/callbacks/PostPlayerChangeStat.ts +102 -0
- package/src/classes/callbacks/PostPlayerChangeType.ts +44 -0
- package/src/classes/callbacks/PostPlayerCollectibleAdded.ts +11 -0
- package/src/classes/callbacks/PostPlayerCollectibleRemoved.ts +11 -0
- package/src/classes/callbacks/PostPlayerInitFirst.ts +44 -0
- package/src/classes/callbacks/PostPlayerInitLate.ts +32 -0
- package/src/classes/callbacks/PostPoopRender.ts +21 -0
- package/src/classes/callbacks/PostPoopUpdate.ts +21 -0
- package/src/classes/callbacks/PostPressurePlateRender.ts +21 -0
- package/src/classes/callbacks/PostPressurePlateUpdate.ts +21 -0
- package/src/classes/callbacks/PostProjectileInitLate.ts +28 -0
- package/src/classes/callbacks/PostPurchase.ts +87 -0
- package/src/classes/callbacks/PostRockRender.ts +21 -0
- package/src/classes/callbacks/PostRockUpdate.ts +21 -0
- package/src/classes/callbacks/PostSacrifice.ts +89 -0
- package/src/classes/callbacks/PostSlotAnimationChanged.ts +11 -0
- package/src/classes/callbacks/PostSlotCollision.ts +26 -0
- package/src/classes/callbacks/PostSlotDestroyed.ts +79 -0
- package/src/classes/callbacks/PostSlotInit.ts +11 -0
- package/src/classes/callbacks/PostSlotRender.ts +11 -0
- package/src/classes/callbacks/PostSlotUpdate.ts +11 -0
- package/src/classes/callbacks/PostSpikesUpdate.ts +21 -0
- package/src/classes/callbacks/PostTNTRender.ts +21 -0
- package/src/classes/callbacks/PostTNTUpdate.ts +21 -0
- package/src/classes/callbacks/PostTearInitLate.ts +28 -0
- package/src/classes/callbacks/PostTearInitVeryLate.ts +33 -0
- package/src/classes/callbacks/PostTransformation.ts +71 -0
- package/src/classes/callbacks/PreBerserkDeath.ts +5 -8
- package/src/classes/callbacks/PreItemPickup.ts +11 -0
- package/src/classes/callbacks/validation/CustomCallbackCollectibleType.ts +32 -0
- package/src/classes/callbacks/validation/CustomCallbackItemPickup.ts +48 -0
- package/src/classes/callbacks/validation/CustomCallbackLaser.ts +27 -0
- package/src/classes/callbacks/validation/CustomCallbackNPC.ts +34 -0
- package/src/classes/callbacks/validation/CustomCallbackPickup.ts +41 -0
- package/src/classes/callbacks/validation/CustomCallbackPlayer.ts +25 -2
- package/src/classes/callbacks/validation/CustomCallbackPoop.ts +28 -0
- package/src/classes/callbacks/validation/CustomCallbackPressurePlate.ts +31 -0
- package/src/classes/callbacks/validation/CustomCallbackProjectile.ts +28 -0
- package/src/classes/callbacks/validation/CustomCallbackRock.ts +30 -0
- package/src/classes/callbacks/validation/CustomCallbackSlot.ts +37 -0
- package/src/classes/callbacks/validation/CustomCallbackSpikes.ts +4 -4
- package/src/classes/callbacks/validation/CustomCallbackTNT.ts +28 -0
- package/src/classes/callbacks/validation/CustomCallbackTear.ts +27 -0
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +32 -36
- package/src/classes/features/callbackLogic/CustomRevive.ts +14 -21
- package/src/classes/features/callbackLogic/EsauJrDetection.ts +0 -4
- package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +7 -9
- package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +0 -4
- package/src/classes/features/callbackLogic/GridEntityRenderDetection.ts +42 -0
- package/src/classes/features/callbackLogic/{GridEntityDetection.ts → GridEntityUpdateDetection.ts} +4 -20
- package/src/classes/features/callbackLogic/ItemPickupDetection.ts +91 -0
- package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +245 -0
- package/src/classes/features/callbackLogic/SlotRenderDetection.ts +64 -0
- package/src/classes/features/callbackLogic/SlotUpdateDetection.ts +57 -0
- package/src/classes/features/other/RunInNFrames.ts +7 -0
- package/src/classes/features/other/SaveDataManager.ts +492 -0
- package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +138 -0
- package/src/classes/features/other/saveDataManager/loadFromDisk.ts +99 -0
- package/src/classes/features/other/saveDataManager/restoreDefaults.ts +116 -0
- package/src/classes/features/other/saveDataManager/saveToDisk.ts +70 -0
- package/src/classes/private/CustomCallback.ts +2 -6
- package/src/classes/private/Feature.ts +1 -0
- package/src/core/upgradeMod.ts +6 -13
- package/src/decorators.ts +17 -16
- package/src/enums/ISCFeature.ts +44 -39
- package/src/enums/ModCallbackCustom.ts +34 -20
- package/src/enums/ModCallbackCustom2.ts +53 -5
- package/src/enums/{private/SerializationBrand.ts → SerializationBrand.ts} +8 -2
- package/src/features/customItemPool.ts +133 -0
- package/src/features/deployJSONRoom.ts +6 -4
- package/src/features/fadeInRemover.ts +4 -22
- package/src/features/saveDataManager/exports.ts +62 -3
- package/src/features/saveDataManager/load.ts +4 -1
- package/src/features/saveDataManager/main.ts +5 -3
- package/src/features/saveDataManager/maps.ts +16 -0
- package/src/features.ts +39 -4
- package/src/functions/array.ts +8 -9
- package/src/functions/bitSet128.ts +3 -3
- package/src/functions/color.ts +3 -3
- package/src/functions/decorators.ts +83 -12
- package/src/functions/deepCopy.ts +83 -17
- package/src/functions/deepCopyTests.ts +1 -1
- package/src/functions/initArray.ts +6 -11
- package/src/functions/jsonRoom.ts +11 -0
- package/src/functions/kColor.ts +3 -3
- package/src/functions/logMisc.ts +28 -2
- package/src/{features/saveDataManager → functions}/merge.ts +79 -45
- package/src/functions/mergeTests.ts +2 -3
- package/src/functions/rng.ts +3 -3
- package/src/functions/serialization.ts +25 -1
- package/src/functions/table.ts +1 -1
- package/src/functions/tstlClass.ts +3 -57
- package/src/functions/vector.ts +3 -3
- package/src/functions/weighted.ts +28 -11
- package/src/index.ts +5 -0
- package/src/interfaces/SaveData.ts +3 -34
- package/src/interfaces/private/AddCallbackParametersCustom2.ts +298 -7
- package/src/objects/isaacAPIClassTypeToBrand.ts +1 -1
- package/src/types/AnyClass.ts +1 -0
- package/src/types/AnyFunction.ts +5 -0
- package/src/types/FunctionTuple.ts +3 -4
- package/src/types/HasFunction.ts +7 -0
- package/dist/src/classes/callbacks/validation/CustomCallbackRevive.d.ts.map +0 -1
- package/dist/src/classes/callbacks/validation/CustomCallbackRevive.lua +0 -19
- package/dist/src/classes/features/callbackLogic/GridEntityDetection.d.ts.map +0 -1
- package/dist/src/enums/private/SerializationBrand.d.ts.map +0 -1
- package/dist/src/features/saveDataManager/merge.d.ts +0 -26
- package/dist/src/features/saveDataManager/merge.d.ts.map +0 -1
- package/dist/src/features/saveDataManager/serializationBrands.d.ts +0 -2
- package/dist/src/features/saveDataManager/serializationBrands.d.ts.map +0 -1
- package/dist/src/features/saveDataManager/serializationBrands.lua +0 -19
- package/dist/src/indexLua.d.ts +0 -199
- package/dist/src/indexLua.d.ts.map +0 -1
- package/dist/src/indexLua.lua +0 -1354
- package/src/classes/callbacks/validation/CustomCallbackRevive.ts +0 -27
- package/src/features/saveDataManager/serializationBrands.ts +0 -16
package/dist/index.d.ts
CHANGED
|
@@ -79,6 +79,10 @@ import { TrapdoorVariant } from 'isaac-typescript-definitions';
|
|
|
79
79
|
import { TrinketType } from 'isaac-typescript-definitions';
|
|
80
80
|
import { UseFlag } from 'isaac-typescript-definitions';
|
|
81
81
|
|
|
82
|
+
export declare const ADD_CALLBACK_ARGS_KEY = "__addCallbackArgs";
|
|
83
|
+
|
|
84
|
+
export declare const ADD_CALLBACK_CUSTOM_ARGS_KEY = "__addCallbackCustomArgs";
|
|
85
|
+
|
|
82
86
|
declare interface AddCallbackParametersCustom {
|
|
83
87
|
[ModCallbackCustom.POST_AMBUSH_FINISHED]: PostAmbushFinishedRegisterParameters;
|
|
84
88
|
[ModCallbackCustom.POST_AMBUSH_STARTED]: PostAmbushStartedRegisterParameters;
|
|
@@ -289,6 +293,10 @@ declare interface AddCallbackParametersCustom2 {
|
|
|
289
293
|
callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
|
|
290
294
|
gridEntityTypeCustom?: GridEntityType
|
|
291
295
|
];
|
|
296
|
+
[ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_RENDER]: [
|
|
297
|
+
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
|
|
298
|
+
gridEntityTypeCustom?: GridEntityType
|
|
299
|
+
];
|
|
292
300
|
[ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED]: [
|
|
293
301
|
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void,
|
|
294
302
|
gridEntityTypeCustom?: GridEntityType
|
|
@@ -307,6 +315,11 @@ declare interface AddCallbackParametersCustom2 {
|
|
|
307
315
|
gridEntityType?: GridEntityType,
|
|
308
316
|
variant?: int
|
|
309
317
|
];
|
|
318
|
+
[ModCallbackCustom2.POST_GRID_ENTITY_RENDER]: [
|
|
319
|
+
callback: (gridEntity: GridEntity) => void,
|
|
320
|
+
gridEntityType?: GridEntityType,
|
|
321
|
+
variant?: int
|
|
322
|
+
];
|
|
310
323
|
[ModCallbackCustom2.POST_GRID_ENTITY_STATE_CHANGED]: [
|
|
311
324
|
callback: (gridEntity: GridEntity, oldState: int, newState: int) => void,
|
|
312
325
|
gridEntityType?: GridEntityType,
|
|
@@ -322,27 +335,110 @@ declare interface AddCallbackParametersCustom2 {
|
|
|
322
335
|
playerVariant?: PlayerVariant,
|
|
323
336
|
character?: PlayerType
|
|
324
337
|
];
|
|
325
|
-
[ModCallbackCustom2.
|
|
338
|
+
[ModCallbackCustom2.POST_ITEM_DISCHARGE]: [
|
|
339
|
+
callback: (player: EntityPlayer, collectibleType: CollectibleType, activeSlot: ActiveSlot) => void,
|
|
340
|
+
collectibleType?: CollectibleType
|
|
341
|
+
];
|
|
342
|
+
[ModCallbackCustom2.POST_ITEM_PICKUP]: [callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => void] | [
|
|
343
|
+
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void,
|
|
344
|
+
itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
|
|
345
|
+
collectibleType?: CollectibleType
|
|
346
|
+
] | [
|
|
347
|
+
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemTrinket) => void,
|
|
348
|
+
itemType: ItemType.TRINKET,
|
|
349
|
+
trinketType?: TrinketType
|
|
350
|
+
];
|
|
326
351
|
[ModCallbackCustom2.POST_KNIFE_INIT_LATE]: [
|
|
327
352
|
callback: (knife: EntityKnife) => void,
|
|
328
353
|
knifeVariant?: KnifeVariant
|
|
329
354
|
];
|
|
355
|
+
[ModCallbackCustom2.POST_LASER_INIT_LATE]: [
|
|
356
|
+
callback: (laser: EntityLaser) => void,
|
|
357
|
+
laserVariant?: LaserVariant
|
|
358
|
+
];
|
|
359
|
+
[ModCallbackCustom2.POST_NEW_LEVEL_REORDERED]: [callback: () => void];
|
|
330
360
|
[ModCallbackCustom2.POST_NEW_ROOM_EARLY]: [callback: () => void];
|
|
331
361
|
[ModCallbackCustom2.POST_NEW_ROOM_REORDERED]: [callback: () => void];
|
|
362
|
+
[ModCallbackCustom2.POST_NPC_INIT_LATE]: [
|
|
363
|
+
callback: (npc: EntityNPC) => void,
|
|
364
|
+
entityType?: EntityType,
|
|
365
|
+
variant?: int
|
|
366
|
+
];
|
|
367
|
+
[ModCallbackCustom2.POST_NPC_STATE_CHANGED]: [
|
|
368
|
+
callback: (npc: EntityNPC, previousState: int, currentState: int) => void,
|
|
369
|
+
entityType?: EntityType,
|
|
370
|
+
variant?: int
|
|
371
|
+
];
|
|
332
372
|
[ModCallbackCustom2.POST_PEFFECT_UPDATE_REORDERED]: [
|
|
333
373
|
callback: (player: EntityPlayer) => void,
|
|
334
374
|
playerVariant?: PlayerVariant,
|
|
335
375
|
character?: PlayerType
|
|
336
376
|
];
|
|
377
|
+
[ModCallbackCustom2.POST_PICKUP_COLLECT]: [
|
|
378
|
+
callback: (pickup: EntityPickup, player: EntityPlayer) => void,
|
|
379
|
+
pickupVariant?: PickupVariant,
|
|
380
|
+
subType?: int
|
|
381
|
+
];
|
|
382
|
+
[ModCallbackCustom2.POST_PICKUP_INIT_FIRST]: [
|
|
383
|
+
callback: (pickup: EntityPickup) => void,
|
|
384
|
+
pickupVariant?: PickupVariant,
|
|
385
|
+
subType?: int
|
|
386
|
+
];
|
|
387
|
+
[ModCallbackCustom2.POST_PICKUP_INIT_LATE]: [
|
|
388
|
+
callback: (pickup: EntityPickup) => void,
|
|
389
|
+
pickupVariant?: PickupVariant,
|
|
390
|
+
subType?: int
|
|
391
|
+
];
|
|
392
|
+
[ModCallbackCustom2.POST_PICKUP_STATE_CHANGED]: [
|
|
393
|
+
callback: (pickup: EntityPickup, previousState: int, currentState: int) => void,
|
|
394
|
+
pickupVariant?: PickupVariant,
|
|
395
|
+
subType?: int
|
|
396
|
+
];
|
|
337
397
|
[ModCallbackCustom2.POST_PIT_RENDER]: [
|
|
338
398
|
callback: (pit: GridEntityPit) => void,
|
|
339
399
|
pitVariant?: PitVariant
|
|
340
400
|
];
|
|
401
|
+
[ModCallbackCustom2.POST_PIT_UPDATE]: [
|
|
402
|
+
callback: (pit: GridEntityPit) => void,
|
|
403
|
+
pitVariant?: PitVariant
|
|
404
|
+
];
|
|
405
|
+
[ModCallbackCustom2.POST_PLAYER_CHANGE_HEALTH]: [
|
|
406
|
+
callback: (player: EntityPlayer, healthType: HealthType, difference: int, oldValue: int, newValue: int) => void,
|
|
407
|
+
playerVariant?: PlayerVariant,
|
|
408
|
+
character?: PlayerType
|
|
409
|
+
];
|
|
410
|
+
[ModCallbackCustom2.POST_PLAYER_CHANGE_STAT]: [
|
|
411
|
+
callback: <T extends StatType>(player: EntityPlayer, statType: StatType, difference: int, oldValue: StatTypeType[T], newValue: StatTypeType[T]) => void,
|
|
412
|
+
playerVariant?: PlayerVariant,
|
|
413
|
+
character?: PlayerType
|
|
414
|
+
];
|
|
415
|
+
[ModCallbackCustom2.POST_PLAYER_CHANGE_TYPE]: [
|
|
416
|
+
callback: (player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerType) => void,
|
|
417
|
+
playerVariant?: PlayerVariant
|
|
418
|
+
];
|
|
419
|
+
[ModCallbackCustom2.POST_PLAYER_COLLECTIBLE_ADDED]: [
|
|
420
|
+
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
|
|
421
|
+
collectibleType?: CollectibleType
|
|
422
|
+
];
|
|
423
|
+
[ModCallbackCustom2.POST_PLAYER_COLLECTIBLE_REMOVED]: [
|
|
424
|
+
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
|
|
425
|
+
collectibleType?: CollectibleType
|
|
426
|
+
];
|
|
341
427
|
[ModCallbackCustom2.POST_PLAYER_FATAL_DAMAGE]: [
|
|
342
428
|
callback: (player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined,
|
|
343
429
|
playerVariant?: PlayerVariant,
|
|
344
430
|
character?: PlayerType
|
|
345
431
|
];
|
|
432
|
+
[ModCallbackCustom2.POST_PLAYER_INIT_FIRST]: [
|
|
433
|
+
callback: (player: EntityPlayer) => void,
|
|
434
|
+
playerVariant?: PlayerVariant,
|
|
435
|
+
character?: PlayerType
|
|
436
|
+
];
|
|
437
|
+
[ModCallbackCustom2.POST_PLAYER_INIT_LATE]: [
|
|
438
|
+
callback: (player: EntityPlayer) => void,
|
|
439
|
+
playerVariant?: PlayerVariant,
|
|
440
|
+
character?: PlayerType
|
|
441
|
+
];
|
|
346
442
|
[ModCallbackCustom2.POST_PLAYER_RENDER_REORDERED]: [
|
|
347
443
|
callback: (player: EntityPlayer) => void,
|
|
348
444
|
playerVariant?: PlayerVariant,
|
|
@@ -353,14 +449,101 @@ declare interface AddCallbackParametersCustom2 {
|
|
|
353
449
|
playerVariant?: PlayerVariant,
|
|
354
450
|
character?: PlayerType
|
|
355
451
|
];
|
|
452
|
+
[ModCallbackCustom2.POST_POOP_RENDER]: [
|
|
453
|
+
callback: (poop: GridEntityPoop) => void,
|
|
454
|
+
poopVariant?: PoopGridEntityVariant
|
|
455
|
+
];
|
|
456
|
+
[ModCallbackCustom2.POST_POOP_UPDATE]: [
|
|
457
|
+
callback: (poop: GridEntityPoop) => void,
|
|
458
|
+
poopVariant?: PoopGridEntityVariant
|
|
459
|
+
];
|
|
460
|
+
[ModCallbackCustom2.POST_PRESSURE_PLATE_RENDER]: [
|
|
461
|
+
callback: (pressurePlate: GridEntityPressurePlate) => void,
|
|
462
|
+
pressurePlateVariant?: PressurePlateVariant
|
|
463
|
+
];
|
|
464
|
+
[ModCallbackCustom2.POST_PRESSURE_PLATE_UPDATE]: [
|
|
465
|
+
callback: (pressurePlate: GridEntityPressurePlate) => void,
|
|
466
|
+
pressurePlateVariant?: PressurePlateVariant
|
|
467
|
+
];
|
|
468
|
+
[ModCallbackCustom2.POST_PROJECTILE_INIT_LATE]: [
|
|
469
|
+
callback: (projectile: EntityProjectile) => void,
|
|
470
|
+
projectileVariant?: ProjectileVariant
|
|
471
|
+
];
|
|
472
|
+
[ModCallbackCustom2.POST_PURCHASE]: [
|
|
473
|
+
callback: (player: EntityPlayer, pickup: EntityPickup) => void,
|
|
474
|
+
pickupVariant?: PickupVariant,
|
|
475
|
+
pickupSubType?: int
|
|
476
|
+
];
|
|
477
|
+
[ModCallbackCustom2.POST_ROCK_RENDER]: [
|
|
478
|
+
callback: (rock: GridEntityRock) => void,
|
|
479
|
+
variant?: int
|
|
480
|
+
];
|
|
481
|
+
[ModCallbackCustom2.POST_ROCK_UPDATE]: [
|
|
482
|
+
callback: (rock: GridEntityRock) => void,
|
|
483
|
+
variant?: int
|
|
484
|
+
];
|
|
356
485
|
[ModCallbackCustom2.POST_ROOM_CLEAR_CHANGED]: [
|
|
357
486
|
callback: (roomClear: boolean) => void,
|
|
358
487
|
roomClear?: boolean
|
|
359
488
|
];
|
|
489
|
+
[ModCallbackCustom2.POST_SACRIFICE]: [
|
|
490
|
+
callback: (player: EntityPlayer, numSacrifices: int) => void,
|
|
491
|
+
playerVariant?: PlayerVariant,
|
|
492
|
+
character?: PlayerType
|
|
493
|
+
];
|
|
494
|
+
[ModCallbackCustom2.POST_SLOT_ANIMATION_CHANGED]: [
|
|
495
|
+
callback: (slot: EntitySlot, previousAnimation: string, currentAnimation: string) => void,
|
|
496
|
+
slotVariant?: SlotVariant
|
|
497
|
+
];
|
|
498
|
+
[ModCallbackCustom2.POST_SLOT_COLLISION]: [
|
|
499
|
+
callback: (slot: EntitySlot, player: EntityPlayer) => void,
|
|
500
|
+
slotVariant?: SlotVariant
|
|
501
|
+
];
|
|
502
|
+
[ModCallbackCustom2.POST_SLOT_DESTROYED]: [
|
|
503
|
+
callback: (slot: EntitySlot, slotDestructionType: SlotDestructionType) => void,
|
|
504
|
+
slotVariant?: SlotVariant,
|
|
505
|
+
slotDestructionType?: SlotDestructionType
|
|
506
|
+
];
|
|
507
|
+
[ModCallbackCustom2.POST_SLOT_INIT]: [
|
|
508
|
+
callback: (slot: EntitySlot) => void,
|
|
509
|
+
slotVariant?: SlotVariant
|
|
510
|
+
];
|
|
511
|
+
[ModCallbackCustom2.POST_SLOT_RENDER]: [
|
|
512
|
+
callback: (slot: EntitySlot) => void,
|
|
513
|
+
slotVariant?: SlotVariant
|
|
514
|
+
];
|
|
515
|
+
[ModCallbackCustom2.POST_SLOT_UPDATE]: [
|
|
516
|
+
callback: (slot: EntitySlot) => void,
|
|
517
|
+
slotVariant?: SlotVariant
|
|
518
|
+
];
|
|
360
519
|
[ModCallbackCustom2.POST_SPIKES_RENDER]: [
|
|
361
520
|
callback: (spikes: GridEntitySpikes) => void,
|
|
362
521
|
variant?: int
|
|
363
522
|
];
|
|
523
|
+
[ModCallbackCustom2.POST_SPIKES_UPDATE]: [
|
|
524
|
+
callback: (spikes: GridEntitySpikes) => void,
|
|
525
|
+
variant?: int
|
|
526
|
+
];
|
|
527
|
+
[ModCallbackCustom2.POST_TEAR_INIT_LATE]: [
|
|
528
|
+
callback: (tear: EntityTear) => void,
|
|
529
|
+
tearVariant?: TearVariant
|
|
530
|
+
];
|
|
531
|
+
[ModCallbackCustom2.POST_TEAR_INIT_VERY_LATE]: [
|
|
532
|
+
callback: (tear: EntityTear) => void,
|
|
533
|
+
tearVariant?: TearVariant
|
|
534
|
+
];
|
|
535
|
+
[ModCallbackCustom2.POST_TNT_RENDER]: [
|
|
536
|
+
callback: (tnt: GridEntityTNT) => void,
|
|
537
|
+
variant?: int
|
|
538
|
+
];
|
|
539
|
+
[ModCallbackCustom2.POST_TNT_UPDATE]: [
|
|
540
|
+
callback: (tnt: GridEntityTNT) => void,
|
|
541
|
+
variant?: int
|
|
542
|
+
];
|
|
543
|
+
[ModCallbackCustom2.POST_TRANSFORMATION]: [
|
|
544
|
+
callback: (player: EntityPlayer, playerForm: PlayerForm, hasForm: boolean) => void,
|
|
545
|
+
playerForm?: PlayerForm
|
|
546
|
+
];
|
|
364
547
|
[ModCallbackCustom2.PRE_BERSERK_DEATH]: [
|
|
365
548
|
callback: (player: EntityPlayer) => void,
|
|
366
549
|
playerVariant?: PlayerVariant,
|
|
@@ -371,6 +554,15 @@ declare interface AddCallbackParametersCustom2 {
|
|
|
371
554
|
playerVariant?: PlayerVariant,
|
|
372
555
|
character?: PlayerType
|
|
373
556
|
];
|
|
557
|
+
[ModCallbackCustom2.PRE_ITEM_PICKUP]: [callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => void] | [
|
|
558
|
+
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void,
|
|
559
|
+
itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
|
|
560
|
+
collectibleType?: CollectibleType
|
|
561
|
+
] | [
|
|
562
|
+
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemTrinket) => void,
|
|
563
|
+
itemType: ItemType.TRINKET,
|
|
564
|
+
trinketType?: TrinketType
|
|
565
|
+
];
|
|
374
566
|
}
|
|
375
567
|
|
|
376
568
|
/**
|
|
@@ -560,6 +752,8 @@ export declare enum AmbushType {
|
|
|
560
752
|
*/
|
|
561
753
|
export declare function angleToDirection(angleDegrees: int): Direction;
|
|
562
754
|
|
|
755
|
+
declare type AnyClass = new (...args: readonly unknown[]) => unknown;
|
|
756
|
+
|
|
563
757
|
/**
|
|
564
758
|
* A type union that matches `Entity`, `EntityBomb`, `EntityEffect`, and so on.
|
|
565
759
|
*
|
|
@@ -569,6 +763,12 @@ export declare type AnyEntity = Entity | EntityBomb | EntityEffect | EntityFamil
|
|
|
569
763
|
|
|
570
764
|
export declare function anyEntityCloserThan(entities: Entity[], position: Vector, distance: int): boolean;
|
|
571
765
|
|
|
766
|
+
/**
|
|
767
|
+
* Helper type to represent any function. This is safer than using the built-in `Function` type, as
|
|
768
|
+
* it does not completely turn off all type safety.
|
|
769
|
+
*/
|
|
770
|
+
export declare type AnyFunction = (...args: unknown[]) => unknown;
|
|
771
|
+
|
|
572
772
|
/**
|
|
573
773
|
* A type union that matches `GridEntity`, `GridEntityDoor`, `GridEntityPit`, and so on.
|
|
574
774
|
*
|
|
@@ -827,24 +1027,30 @@ export declare function calculateStageTypeRepentance(stage: LevelStage): StageTy
|
|
|
827
1027
|
/**
|
|
828
1028
|
* A decorator function that signifies that the decorated class method should be automatically
|
|
829
1029
|
* registered with `Mod.AddCallback`.
|
|
1030
|
+
*
|
|
1031
|
+
* @ignore
|
|
830
1032
|
*/
|
|
831
1033
|
export declare function Callback<T extends ModCallback>(modCallback: T, ...optionalArgs: AllButFirst<AddCallbackParameters[T]>): <Class extends ModFeature, Fn extends AddCallbackParameters[T][0]>(target: Class, propertyKey: string, _descriptor: TypedPropertyDescriptor<Fn>) => void;
|
|
832
1034
|
|
|
833
1035
|
/**
|
|
834
1036
|
* A decorator function that signifies that the decorated class method should be automatically
|
|
835
1037
|
* registered with `ModUpgraded.AddCallbackCustom`.
|
|
1038
|
+
*
|
|
1039
|
+
* @ignore
|
|
836
1040
|
*/
|
|
837
|
-
export declare function CallbackCustom<T extends
|
|
838
|
-
|
|
839
|
-
|
|
1041
|
+
export declare function CallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...optionalArgs: AllButFirst<AddCallbackParametersCustom[T]>): <Class extends ModFeature, Fn extends AddCallbackParametersCustom[T][0]>(target: Class, propertyKey: string, _descriptor: TypedPropertyDescriptor<Fn>) => void;
|
|
1042
|
+
|
|
1043
|
+
declare type CallbackSignatureCollectibleType = (player: EntityPlayer, collectibleType: CollectibleType) => void;
|
|
840
1044
|
|
|
841
1045
|
declare type CallbackSignatureGridEntity = ((gridEntity: GridEntity) => void) | ((gridEntity: GridEntity, oldState: int, newState: int) => void);
|
|
842
1046
|
|
|
843
1047
|
declare type CallbackSignatureGridEntityCustom = ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void) | ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void);
|
|
844
1048
|
|
|
845
|
-
declare type
|
|
1049
|
+
declare type CallbackSignatureItemPickup = ((player: EntityPlayer, pickingUpItem: PickingUpItem) => void) | ((player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void) | ((player: EntityPlayer, pickingUpItem: PickingUpItemTrinket) => void);
|
|
846
1050
|
|
|
847
|
-
declare type
|
|
1051
|
+
declare type CallbackSignaturePlayer = ((player: EntityPlayer) => void) | ((player: EntityPlayer) => int | undefined) | ((player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerType) => void) | ((player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined) | ((player: EntityPlayer, healthType: HealthType, difference: int, oldValue: int, newValue: int) => void) | (<T extends StatType>(player: EntityPlayer, statType: StatType, difference: int, oldValue: StatTypeType[T], newValue: StatTypeType[T]) => void);
|
|
1052
|
+
|
|
1053
|
+
declare type CallbackSignatureSlot = ((slot: EntitySlot) => void) | ((slot: EntitySlot, slotDestructionType: SlotDestructionType) => void) | ((slot: EntitySlot, player: EntityPlayer) => void) | ((slot: EntitySlot, previousAnimation: string, currentAnimation: string) => void);
|
|
848
1054
|
|
|
849
1055
|
/**
|
|
850
1056
|
* A mapping of the callback enum to the associated callback functions (and optional arguments).
|
|
@@ -1267,13 +1473,12 @@ export declare const CUSTOM_FLOOR_STAGE_TYPE = StageType.WRATH_OF_THE_LAMB;
|
|
|
1267
1473
|
*/
|
|
1268
1474
|
declare abstract class CustomCallback<T extends ModCallbackCustom2> extends Feature {
|
|
1269
1475
|
private subscriptions;
|
|
1270
|
-
|
|
1271
|
-
add(...args: AddCallbackParametersCustom2[T]): void;
|
|
1476
|
+
addSubscriber(...args: AddCallbackParametersCustom2[T]): void;
|
|
1272
1477
|
/**
|
|
1273
1478
|
* If the submitted function does not match any of the existing subscriptions, this method will do
|
|
1274
1479
|
* nothing.
|
|
1275
1480
|
*/
|
|
1276
|
-
|
|
1481
|
+
removeSubscriber(callback: AddCallbackParametersCustom2[T][0]): void;
|
|
1277
1482
|
fire: (...fireArgs: FireArgs<T>) => ReturnType<AddCallbackParametersCustom2[T][0]>;
|
|
1278
1483
|
/**
|
|
1279
1484
|
* This method needs to be overwritten for any callback that has optional filtration arguments.
|
|
@@ -1281,6 +1486,10 @@ declare abstract class CustomCallback<T extends ModCallbackCustom2> extends Feat
|
|
|
1281
1486
|
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
1282
1487
|
}
|
|
1283
1488
|
|
|
1489
|
+
declare class CustomCallbackCollectibleType<T extends ModCallbackCustomCollectibleType> extends CustomCallback<T> {
|
|
1490
|
+
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1284
1493
|
declare class CustomCallbackGridEntity<T extends ModCallbackCustomGridEntity> extends CustomCallback<T> {
|
|
1285
1494
|
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
1286
1495
|
}
|
|
@@ -1289,11 +1498,15 @@ declare class CustomCallbackGridEntityCustom<T extends ModCallbackCustomGridEnti
|
|
|
1289
1498
|
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
1290
1499
|
}
|
|
1291
1500
|
|
|
1501
|
+
declare class CustomCallbackItemPickup<T extends ModCallbackCustomItemPickup> extends CustomCallback<T> {
|
|
1502
|
+
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1292
1505
|
declare class CustomCallbackPlayer<T extends ModCallbackCustomPlayer> extends CustomCallback<T> {
|
|
1293
1506
|
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
1294
1507
|
}
|
|
1295
1508
|
|
|
1296
|
-
declare class
|
|
1509
|
+
declare class CustomCallbackSlot<T extends ModCallbackCustomSlot> extends CustomCallback<T> {
|
|
1297
1510
|
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
1298
1511
|
}
|
|
1299
1512
|
|
|
@@ -1319,8 +1532,8 @@ declare class CustomGridEntities extends Feature {
|
|
|
1319
1532
|
};
|
|
1320
1533
|
private runInNFrames;
|
|
1321
1534
|
constructor(runInNFrames: RunInNFrames);
|
|
1535
|
+
private postNewRoom;
|
|
1322
1536
|
private preUseItemWeNeedToGoDeeper;
|
|
1323
|
-
private postNewRoomReordered;
|
|
1324
1537
|
/**
|
|
1325
1538
|
* Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
|
|
1326
1539
|
* will reappear if the player leaves and re-enters the room. (It will be manually respawned in
|
|
@@ -1447,9 +1660,9 @@ declare class CustomRevive extends Feature {
|
|
|
1447
1660
|
private postCustomRevive;
|
|
1448
1661
|
constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive);
|
|
1449
1662
|
private postRender;
|
|
1450
|
-
private
|
|
1451
|
-
private postPEffectUpdateReordered;
|
|
1663
|
+
private postPEffectUpdate;
|
|
1452
1664
|
private checkWaitingForItemAnimation;
|
|
1665
|
+
private postNewRoom;
|
|
1453
1666
|
private postPlayerFatalDamage;
|
|
1454
1667
|
private preBerserkDeath;
|
|
1455
1668
|
/**
|
|
@@ -2005,14 +2218,19 @@ export declare interface CustomStageTSConfig {
|
|
|
2005
2218
|
* @param serializationType Optional. Has 3 possible values. Can copy objects as-is, or can
|
|
2006
2219
|
* serialize objects to Lua tables, or can deserialize Lua tables to
|
|
2007
2220
|
* objects. Default is `SerializationType.NONE`.
|
|
2008
|
-
* @param traversalDescription Optional. Used to track the current key that we are operating on
|
|
2009
|
-
* Default is an empty string.
|
|
2221
|
+
* @param traversalDescription Optional. Used to track the current key that we are operating on for
|
|
2222
|
+
* debugging purposes. Default is an empty string.
|
|
2223
|
+
* @param classConstructors Optional. A Lua table that maps the name of a user-defined TSTL class to
|
|
2224
|
+
* its corresponding constructor. If the `deepCopy` function finds any
|
|
2225
|
+
* user-defined TSTL classes when recursively iterating through the given
|
|
2226
|
+
* object, it will use this map to instantiate a new class. Default is an
|
|
2227
|
+
* empty Lua table.
|
|
2010
2228
|
* @param insideMap Optional. Tracks whether or not the deep copy function is in the process of
|
|
2011
2229
|
* recursively copying a TSTL Map. Default is false.
|
|
2012
2230
|
*/
|
|
2013
|
-
export declare function deepCopy<T>(value: T, serializationType?: SerializationType.NONE, traversalDescription?: string, insideMap?: boolean): T;
|
|
2231
|
+
export declare function deepCopy<T>(value: T, serializationType?: SerializationType.NONE, traversalDescription?: string, classConstructors?: LuaMap<string, AnyClass>, insideMap?: boolean): T;
|
|
2014
2232
|
|
|
2015
|
-
export declare function deepCopy(value: unknown, serializationType: SerializationType, traversalDescription?: string, insideMap?: boolean): unknown;
|
|
2233
|
+
export declare function deepCopy(value: unknown, serializationType: SerializationType, traversalDescription?: string, classConstructors?: LuaMap<string, AnyClass>, insideMap?: boolean): unknown;
|
|
2016
2234
|
|
|
2017
2235
|
export declare const DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2;
|
|
2018
2236
|
|
|
@@ -2183,8 +2401,9 @@ export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: A
|
|
|
2183
2401
|
* Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
2184
2402
|
* all of the entries and grid entities in the provided JSON room.
|
|
2185
2403
|
*
|
|
2186
|
-
* You can create JSON rooms by using the
|
|
2187
|
-
*
|
|
2404
|
+
* A JSON room is simply an XML file converted to JSON. You can create JSON rooms by using the
|
|
2405
|
+
* Basement Renovator room editor to create an XML file, and then convert it to JSON using the
|
|
2406
|
+
* `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json my-rooms.xml`).
|
|
2188
2407
|
*
|
|
2189
2408
|
* This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
2190
2409
|
*
|
|
@@ -2213,8 +2432,9 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
|
|
|
2213
2432
|
* Specifically, this will clear the current room of all entities and grid entities, and then spawn
|
|
2214
2433
|
* all of the entries and grid entities in one of the provided JSON rooms.
|
|
2215
2434
|
*
|
|
2216
|
-
* You can create JSON rooms by using the
|
|
2217
|
-
*
|
|
2435
|
+
* A JSON room is simply an XML file converted to JSON. You can create JSON rooms by using the
|
|
2436
|
+
* Basement Renovator room editor to create an XML file, and then convert it to JSON using the
|
|
2437
|
+
* `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json my-rooms.xml`).
|
|
2218
2438
|
*
|
|
2219
2439
|
* This function is meant to be used in the `POST_NEW_ROOM` callback.
|
|
2220
2440
|
*
|
|
@@ -2596,8 +2816,6 @@ export declare function enableFastReset(): void;
|
|
|
2596
2816
|
*/
|
|
2597
2817
|
export declare function eRange(start: int, end?: int, increment?: number): int[];
|
|
2598
2818
|
|
|
2599
|
-
declare type ErrorCustomClassNotSerializable = "Error: Custom classes with one or more methods are not serializable when inside of an array, map, or set. For more information, see: https://isaacscript.github.io/main/gotchas#custom-classes-are-not-serializable";
|
|
2600
|
-
|
|
2601
2819
|
declare type ErrorIsaacAPIClassIsNotSerializable = "Error: Isaac API classes (such as e.g. `Entity` or `RoomConfig`) are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#isaac-api-classes-are-not-serializable";
|
|
2602
2820
|
|
|
2603
2821
|
declare class EsauJrDetection extends Feature {
|
|
@@ -2647,6 +2865,7 @@ export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args)
|
|
|
2647
2865
|
*/
|
|
2648
2866
|
declare class Feature {
|
|
2649
2867
|
initialized: boolean;
|
|
2868
|
+
numConsumers: number;
|
|
2650
2869
|
v?: SaveData;
|
|
2651
2870
|
featuresUsed?: ISCFeature[];
|
|
2652
2871
|
callbacksUsed?: CallbackTuple[];
|
|
@@ -2817,10 +3036,7 @@ export declare function forgottenSwitch(): void;
|
|
|
2817
3036
|
|
|
2818
3037
|
declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
|
|
2819
3038
|
|
|
2820
|
-
export declare type FunctionTuple = [
|
|
2821
|
-
name: string,
|
|
2822
|
-
func: (...args: unknown[]) => unknown
|
|
2823
|
-
];
|
|
3039
|
+
export declare type FunctionTuple = [name: string, func: AnyFunction];
|
|
2824
3040
|
|
|
2825
3041
|
/**
|
|
2826
3042
|
* A cached version of the class returned from the `Game()` constructor.
|
|
@@ -3511,6 +3727,24 @@ data: GridEntityCustomData
|
|
|
3511
3727
|
*/
|
|
3512
3728
|
export declare function getCustomGridEntityType(gridEntityOrGridIndex: GridEntity | int): GridEntityType | undefined;
|
|
3513
3729
|
|
|
3730
|
+
/**
|
|
3731
|
+
* Helper function to get a new collectible from a custom item pool created with the
|
|
3732
|
+
* `registerCustomItemPool` function. This function has the same format as the
|
|
3733
|
+
* `ItemPool.GetCollectible` method.
|
|
3734
|
+
*
|
|
3735
|
+
* By default, a collectible will not be removed from the pool once it is selected, unless the
|
|
3736
|
+
* `decrease` argument is set to true (similar to how a vanilla item pool works).
|
|
3737
|
+
*
|
|
3738
|
+
* @param itemPoolTypeCustom An integer representing the custom item pool to use.
|
|
3739
|
+
* @param decrease Optional. Whether or not to remove the selected collectible from the item pool.
|
|
3740
|
+
* Default is true.
|
|
3741
|
+
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
3742
|
+
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
3743
|
+
* @param defaultItem Optional. The collectible to return if the item pool is depleted. Default is
|
|
3744
|
+
* `CollectibleType.NULL`.
|
|
3745
|
+
*/
|
|
3746
|
+
export declare function getCustomItemPoolCollectible(itemPoolTypeCustom: ItemPoolType, decrease?: boolean, seedOrRNG?: Seed | RNG, defaultItem?: CollectibleType): CollectibleType;
|
|
3747
|
+
|
|
3514
3748
|
/**
|
|
3515
3749
|
* Helper function to get a set containing all of the global variable names that are contained
|
|
3516
3750
|
* within the Isaac environment by default.
|
|
@@ -4007,12 +4241,16 @@ export declare function getItemConfigCardType(cardType: CardType): ItemConfigCar
|
|
|
4007
4241
|
/**
|
|
4008
4242
|
* Helper function to calculate what the resulting `BitFlags<DoorSlotFlag>` value would be for a
|
|
4009
4243
|
* given JSON room.
|
|
4244
|
+
*
|
|
4245
|
+
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
|
|
4010
4246
|
*/
|
|
4011
4247
|
export declare function getJSONRoomDoorSlotFlags(jsonRoom: JSONRoom): BitFlags<DoorSlotFlag>;
|
|
4012
4248
|
|
|
4013
4249
|
/**
|
|
4014
4250
|
* Helper function to find a specific room from an array of JSON rooms.
|
|
4015
4251
|
*
|
|
4252
|
+
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
|
|
4253
|
+
*
|
|
4016
4254
|
* @param jsonRooms The array of rooms to search through.
|
|
4017
4255
|
* @param variant The room variant to select. (The room variant can be thought of as the ID of the
|
|
4018
4256
|
* room.)
|
|
@@ -4022,6 +4260,8 @@ export declare function getJSONRoomOfVariant(jsonRooms: JSONRoom[] | readonly JS
|
|
|
4022
4260
|
/**
|
|
4023
4261
|
* Helper function to find all of the JSON rooms that match the sub-type provided.
|
|
4024
4262
|
*
|
|
4263
|
+
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
|
|
4264
|
+
*
|
|
4025
4265
|
* @param jsonRooms The array of rooms to search through.
|
|
4026
4266
|
* @param subType The sub-type to match.
|
|
4027
4267
|
*/
|
|
@@ -5063,9 +5303,20 @@ export declare function getRandomEnumValue<T>(transpiledEnum: T, seedOrRNG?: See
|
|
|
5063
5303
|
*/
|
|
5064
5304
|
export declare function getRandomFloat(min: int, max: int, seedOrRNG?: Seed | RNG): float;
|
|
5065
5305
|
|
|
5066
|
-
/**
|
|
5306
|
+
/**
|
|
5307
|
+
* Get a random value from a `WeightedArray`. (A `WeightedArray` is an array of tuples, where the
|
|
5308
|
+
* first element in the tuple is a value, and the second element in the tuple is a float
|
|
5309
|
+
* corresponding to the value's weight.)
|
|
5310
|
+
*/
|
|
5067
5311
|
export declare function getRandomFromWeightedArray<T>(weightedArray: WeightedArray<T>, seedOrRNG?: Seed | RNG): T;
|
|
5068
5312
|
|
|
5313
|
+
/**
|
|
5314
|
+
* Get a random index from a `WeightedArray`. (A `WeightedArray` is an array of tuples, where the
|
|
5315
|
+
* first element in the tuple is a value, and the second element in the tuple is a float
|
|
5316
|
+
* corresponding to the value's weight.)
|
|
5317
|
+
*/
|
|
5318
|
+
export declare function getRandomIndexFromWeightedArray<T>(weightedArray: WeightedArray<T>, seedOrRNG?: Seed | RNG): int;
|
|
5319
|
+
|
|
5069
5320
|
/**
|
|
5070
5321
|
* This returns a random integer between min and max. It is inclusive on both ends.
|
|
5071
5322
|
*
|
|
@@ -5092,6 +5343,9 @@ export declare function getRandomInt(min: int, max: int, seedOrRNG?: Seed | RNG,
|
|
|
5092
5343
|
/**
|
|
5093
5344
|
* Helper function to get a random JSON entity from an array of JSON entities.
|
|
5094
5345
|
*
|
|
5346
|
+
* (A JSON entity is an entity inside of a JSON room. A JSON room is an XML file converted to JSON
|
|
5347
|
+
* so that it can be directly imported into your mod.)
|
|
5348
|
+
*
|
|
5095
5349
|
* Note that this function does not simply choose a random element in the provided array; it will
|
|
5096
5350
|
* properly account for each room weight using the algorithm from:
|
|
5097
5351
|
* https://stackoverflow.com/questions/1761626/weighted-random-numbers
|
|
@@ -5107,6 +5361,8 @@ export declare function getRandomJSONEntity(jsonEntities: JSONEntity[], seedOrRN
|
|
|
5107
5361
|
/**
|
|
5108
5362
|
* Helper function to get a random JSON room from an array of JSON rooms.
|
|
5109
5363
|
*
|
|
5364
|
+
* (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
|
|
5365
|
+
*
|
|
5110
5366
|
* Note that this function does not simply choose a random element in the provided array; it will
|
|
5111
5367
|
* properly account for each room weight using the algorithm from:
|
|
5112
5368
|
* https://stackoverflow.com/questions/1761626/weighted-random-numbers
|
|
@@ -6039,7 +6295,21 @@ export declare interface GridEntityCustomData {
|
|
|
6039
6295
|
defaultAnimation?: string;
|
|
6040
6296
|
}
|
|
6041
6297
|
|
|
6042
|
-
declare class
|
|
6298
|
+
declare class GridEntityRenderDetection extends Feature {
|
|
6299
|
+
private postGridEntityRender;
|
|
6300
|
+
private postGridEntityCustomRender;
|
|
6301
|
+
private customGridEntities;
|
|
6302
|
+
constructor(postGridEntityRender: PostGridEntityRender, postGridEntityCustomRender: PostGridEntityCustomRender, customGridEntities: CustomGridEntities);
|
|
6303
|
+
private postRender;
|
|
6304
|
+
}
|
|
6305
|
+
|
|
6306
|
+
declare type GridEntityTuple = [
|
|
6307
|
+
gridEntityType: GridEntityType,
|
|
6308
|
+
variant: int,
|
|
6309
|
+
state: int
|
|
6310
|
+
];
|
|
6311
|
+
|
|
6312
|
+
declare class GridEntityUpdateDetection extends Feature {
|
|
6043
6313
|
v: {
|
|
6044
6314
|
room: {
|
|
6045
6315
|
/** Indexed by grid index. */
|
|
@@ -6063,15 +6333,9 @@ declare class GridEntityDetection extends Feature {
|
|
|
6063
6333
|
private checkGridEntityStateChanged;
|
|
6064
6334
|
private checkNewGridEntity;
|
|
6065
6335
|
private updateTupleInMap;
|
|
6066
|
-
private
|
|
6336
|
+
private postNewRoom;
|
|
6067
6337
|
}
|
|
6068
6338
|
|
|
6069
|
-
declare type GridEntityTuple = [
|
|
6070
|
-
gridEntityType: GridEntityType,
|
|
6071
|
-
variant: int,
|
|
6072
|
-
state: int
|
|
6073
|
-
];
|
|
6074
|
-
|
|
6075
6339
|
/**
|
|
6076
6340
|
* Helper function to convert a grid index to a grid position.
|
|
6077
6341
|
*
|
|
@@ -6147,13 +6411,14 @@ export declare function hasFlyingTemporaryEffect(player: EntityPlayer): boolean;
|
|
|
6147
6411
|
|
|
6148
6412
|
export declare function hasFlyingTransformation(player: EntityPlayer): boolean;
|
|
6149
6413
|
|
|
6150
|
-
/**
|
|
6151
|
-
export declare
|
|
6152
|
-
|
|
6153
|
-
declare type HasMethods<T> = {} extends {
|
|
6414
|
+
/** Helper type to check if an object or class has one or more functions/methods. */
|
|
6415
|
+
export declare type HasFunction<T> = Record<string, unknown> extends {
|
|
6154
6416
|
[K in keyof T as T[K] extends Function ? K : never]-?: 1;
|
|
6155
6417
|
} ? never : T;
|
|
6156
6418
|
|
|
6419
|
+
/** After touching a white fire, a player will turn into The Lost until they clear a room. */
|
|
6420
|
+
export declare function hasLostCurse(player: EntityPlayer): boolean;
|
|
6421
|
+
|
|
6157
6422
|
/**
|
|
6158
6423
|
* Returns whether or not the player can hold an additional active item, beyond what they are
|
|
6159
6424
|
* currently carrying. This takes the Schoolbag into account.
|
|
@@ -6322,10 +6587,10 @@ export declare function inHomeCloset(): boolean;
|
|
|
6322
6587
|
/**
|
|
6323
6588
|
* Initializes an array with all of the elements containing the specified default value.
|
|
6324
6589
|
*
|
|
6325
|
-
*
|
|
6326
|
-
*
|
|
6327
|
-
*
|
|
6328
|
-
*
|
|
6590
|
+
* The provided default value will be copied with the `deepCopy` function before adding it to the
|
|
6591
|
+
* new array. Thus, you can initialize an array of arrays, or an array of maps, and so on. (If the
|
|
6592
|
+
* `deepCopy` function was not used, then all of the array elements would just be references to the
|
|
6593
|
+
* same underlying data structure.)
|
|
6329
6594
|
*
|
|
6330
6595
|
* For example:
|
|
6331
6596
|
*
|
|
@@ -6562,15 +6827,21 @@ export declare function isCardPickup(pickup: EntityPickup): pickup is EntityPick
|
|
|
6562
6827
|
export declare function isCardType(cardType: CardType, itemConfigCardType: ItemConfigCardType): boolean;
|
|
6563
6828
|
|
|
6564
6829
|
export declare enum ISCFeature {
|
|
6565
|
-
CUSTOM_REVIVE =
|
|
6566
|
-
ESAU_JR_DETECTION =
|
|
6567
|
-
FLIP_DETECTION =
|
|
6568
|
-
GRID_ENTITY_COLLISION_DETECTION =
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6830
|
+
CUSTOM_REVIVE = 0,
|
|
6831
|
+
ESAU_JR_DETECTION = 1,
|
|
6832
|
+
FLIP_DETECTION = 2,
|
|
6833
|
+
GRID_ENTITY_COLLISION_DETECTION = 3,
|
|
6834
|
+
GRID_ENTITY_RENDER_DETECTION = 4,
|
|
6835
|
+
GRID_ENTITY_UPDATE_DETECTION = 5,
|
|
6836
|
+
GAME_REORDERED_CALLBACKS = 6,
|
|
6837
|
+
ITEM_PICKUP_DETECTION = 7,
|
|
6838
|
+
PLAYER_COLLECTIBLE_DETECTION = 8,
|
|
6839
|
+
PLAYER_REORDERED_CALLBACKS = 9,
|
|
6840
|
+
SLOT_RENDER_DETECTION = 10,
|
|
6841
|
+
SLOT_UPDATE_DETECTION = 11,
|
|
6842
|
+
CUSTOM_GRID_ENTITIES = 12,
|
|
6843
|
+
RUN_IN_N_FRAMES = 13,
|
|
6844
|
+
SAVE_DATA_MANAGER = 14
|
|
6574
6845
|
}
|
|
6575
6846
|
|
|
6576
6847
|
declare interface ISCFeatureToClass {
|
|
@@ -6578,11 +6849,17 @@ declare interface ISCFeatureToClass {
|
|
|
6578
6849
|
[ISCFeature.ESAU_JR_DETECTION]: EsauJrDetection;
|
|
6579
6850
|
[ISCFeature.FLIP_DETECTION]: FlipDetection;
|
|
6580
6851
|
[ISCFeature.GRID_ENTITY_COLLISION_DETECTION]: GridEntityCollisionDetection;
|
|
6581
|
-
[ISCFeature.
|
|
6852
|
+
[ISCFeature.GRID_ENTITY_RENDER_DETECTION]: GridEntityRenderDetection;
|
|
6853
|
+
[ISCFeature.GRID_ENTITY_UPDATE_DETECTION]: GridEntityUpdateDetection;
|
|
6582
6854
|
[ISCFeature.GAME_REORDERED_CALLBACKS]: GameReorderedCallbacks;
|
|
6855
|
+
[ISCFeature.ITEM_PICKUP_DETECTION]: ItemPickupDetection;
|
|
6856
|
+
[ISCFeature.PLAYER_COLLECTIBLE_DETECTION]: PlayerCollectibleDetection;
|
|
6583
6857
|
[ISCFeature.PLAYER_REORDERED_CALLBACKS]: PlayerReorderedCallbacks;
|
|
6858
|
+
[ISCFeature.SLOT_RENDER_DETECTION]: SlotRenderDetection;
|
|
6859
|
+
[ISCFeature.SLOT_UPDATE_DETECTION]: SlotUpdateDetection;
|
|
6584
6860
|
[ISCFeature.CUSTOM_GRID_ENTITIES]: CustomGridEntities;
|
|
6585
6861
|
[ISCFeature.RUN_IN_N_FRAMES]: RunInNFrames;
|
|
6862
|
+
[ISCFeature.SAVE_DATA_MANAGER]: SaveDataManager;
|
|
6586
6863
|
}
|
|
6587
6864
|
|
|
6588
6865
|
/**
|
|
@@ -6872,12 +7149,6 @@ export declare function isIsaacAPIClass(object: unknown): object is IsaacAPIClas
|
|
|
6872
7149
|
|
|
6873
7150
|
export declare function isIsaacAPIClassOfType(object: unknown, classType: string): boolean;
|
|
6874
7151
|
|
|
6875
|
-
/**
|
|
6876
|
-
* Returns whether or not this is a class that is provided by the `isaacscript-common` library, such
|
|
6877
|
-
* as a `DefaultMap`.
|
|
6878
|
-
*/
|
|
6879
|
-
export declare function isIsaacScriptCommonClass(object: unknown): boolean;
|
|
6880
|
-
|
|
6881
7152
|
/**
|
|
6882
7153
|
* Helper function for detecting when a player is Jacob or Esau. This will only match the
|
|
6883
7154
|
* non-tainted versions of these characters.
|
|
@@ -7128,14 +7399,14 @@ export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
|
|
|
7128
7399
|
export declare function isSelfDamage(damageFlags: DamageFlag | BitFlags<DamageFlag>): boolean;
|
|
7129
7400
|
|
|
7130
7401
|
/**
|
|
7131
|
-
* Used to determine is the given table is a serialized `BitSet128` object created by the
|
|
7132
|
-
*
|
|
7402
|
+
* Used to determine is the given table is a serialized `BitSet128` object created by the `deepCopy`
|
|
7403
|
+
* function.
|
|
7133
7404
|
*/
|
|
7134
7405
|
export declare function isSerializedBitSet128(object: unknown): object is SerializedBitSet128;
|
|
7135
7406
|
|
|
7136
7407
|
/**
|
|
7137
|
-
* Used to determine is the given table is a serialized `Color` object created by the
|
|
7138
|
-
*
|
|
7408
|
+
* Used to determine is the given table is a serialized `Color` object created by the `deepCopy`
|
|
7409
|
+
* function.
|
|
7139
7410
|
*/
|
|
7140
7411
|
export declare function isSerializedColor(object: unknown): object is SerializedColor;
|
|
7141
7412
|
|
|
@@ -7148,20 +7419,20 @@ export declare function isSerializedColor(object: unknown): object is Serialized
|
|
|
7148
7419
|
export declare function isSerializedIsaacAPIClass(object: unknown): object is SerializedIsaacAPIClass;
|
|
7149
7420
|
|
|
7150
7421
|
/**
|
|
7151
|
-
* Used to determine is the given table is a serialized `KColor` object created by the
|
|
7152
|
-
*
|
|
7422
|
+
* Used to determine is the given table is a serialized `KColor` object created by the `deepCopy`
|
|
7423
|
+
* function.
|
|
7153
7424
|
*/
|
|
7154
7425
|
export declare function isSerializedKColor(object: unknown): object is SerializedKColor;
|
|
7155
7426
|
|
|
7156
7427
|
/**
|
|
7157
|
-
* Used to determine is the given table is a serialized `RNG` object created by the
|
|
7158
|
-
*
|
|
7428
|
+
* Used to determine is the given table is a serialized `RNG` object created by the `deepCopy`
|
|
7429
|
+
* function.
|
|
7159
7430
|
*/
|
|
7160
7431
|
export declare function isSerializedRNG(object: unknown): object is SerializedRNG;
|
|
7161
7432
|
|
|
7162
7433
|
/**
|
|
7163
|
-
* Used to determine is the given table is a serialized `Vector` object created by the
|
|
7164
|
-
*
|
|
7434
|
+
* Used to determine is the given table is a serialized `Vector` object created by the `deepCopy`
|
|
7435
|
+
* function.
|
|
7165
7436
|
*/
|
|
7166
7437
|
export declare function isSerializedVector(object: unknown): object is SerializedVector;
|
|
7167
7438
|
|
|
@@ -7310,12 +7581,6 @@ export declare function isVanillaPlayer(player: EntityPlayer): boolean;
|
|
|
7310
7581
|
|
|
7311
7582
|
export declare function isVanillaTrinketType(trinketType: TrinketType): boolean;
|
|
7312
7583
|
|
|
7313
|
-
/**
|
|
7314
|
-
* Returns whether or not this is a class that is provided as part of the TypeScriptToLua
|
|
7315
|
-
* transpiler, such as a `Map` or a `Set`.
|
|
7316
|
-
*/
|
|
7317
|
-
export declare function isVanillaTSTLClass(object: unknown): boolean;
|
|
7318
|
-
|
|
7319
7584
|
/**
|
|
7320
7585
|
* Helper function to determine if a given grid index should have a wall generated by the vanilla
|
|
7321
7586
|
* game. This is useful as a mechanism to distinguish between real walls and custom walls spawned by
|
|
@@ -7339,6 +7604,20 @@ export declare function isVector(object: unknown): object is Vector;
|
|
|
7339
7604
|
*/
|
|
7340
7605
|
export declare const itemConfig: ItemConfig;
|
|
7341
7606
|
|
|
7607
|
+
declare class ItemPickupDetection extends Feature {
|
|
7608
|
+
v: {
|
|
7609
|
+
run: {
|
|
7610
|
+
playersPickingUpItemMap: DefaultMap<PlayerIndex, PickingUpItem, []>;
|
|
7611
|
+
};
|
|
7612
|
+
};
|
|
7613
|
+
private postItemPickup;
|
|
7614
|
+
private preItemPickup;
|
|
7615
|
+
constructor(postItemPickup: PostItemPickup, preItemPickup: PreItemPickup);
|
|
7616
|
+
private postPEffectUpdate;
|
|
7617
|
+
private queueEmpty;
|
|
7618
|
+
private queueNotEmpty;
|
|
7619
|
+
}
|
|
7620
|
+
|
|
7342
7621
|
/**
|
|
7343
7622
|
* Helper function to iterate over a table deterministically. This is useful because by default, the
|
|
7344
7623
|
* `pairs` function will return the keys of a Lua table in a random order.
|
|
@@ -7519,8 +7798,6 @@ export declare function kColorEquals(kColor1: KColor, kColor2: KColor): boolean;
|
|
|
7519
7798
|
*/
|
|
7520
7799
|
export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined;
|
|
7521
7800
|
|
|
7522
|
-
declare type KeysToScrubFromModClass = keyof Feature | LowercaseKeys<ModUpgraded>;
|
|
7523
|
-
|
|
7524
7801
|
/**
|
|
7525
7802
|
* For `EntityType.EFFECT` (1000), `EffectVariant.LADDER` (8).
|
|
7526
7803
|
*
|
|
@@ -7710,8 +7987,8 @@ export declare function logSet(set: Set<AnyNotNil> | ReadonlySet<AnyNotNil>): vo
|
|
|
7710
7987
|
export declare function logSounds(): void;
|
|
7711
7988
|
|
|
7712
7989
|
/**
|
|
7713
|
-
* Helper function for logging every key and value of a table. This is a deep log; the function
|
|
7714
|
-
* recursively call itself if it counters a table within a table.
|
|
7990
|
+
* Helper function for logging every key and value of a Lua table. This is a deep log; the function
|
|
7991
|
+
* will recursively call itself if it counters a table within a table.
|
|
7715
7992
|
*
|
|
7716
7993
|
* This function will only work on tables that have string keys (because it logs the keys in order,
|
|
7717
7994
|
* instead of randomly). It will throw a run-time error if it encounters a non-string key.
|
|
@@ -7724,6 +8001,14 @@ export declare function logTable(luaTable: unknown, parentTables?: number): void
|
|
|
7724
8001
|
*/
|
|
7725
8002
|
export declare function logTableDifferences<K extends AnyNotNil, V>(table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
|
|
7726
8003
|
|
|
8004
|
+
/**
|
|
8005
|
+
* Helper function to log the keys of a Lua table. This is not a deep log; only the keys of the
|
|
8006
|
+
* top-most table will be logged.
|
|
8007
|
+
*
|
|
8008
|
+
* This function is useful for tables that have recursive references.
|
|
8009
|
+
*/
|
|
8010
|
+
export declare function logTableKeys(luaTable: unknown): void;
|
|
8011
|
+
|
|
7727
8012
|
/** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
|
|
7728
8013
|
export declare function logTearFlags(flags: TearFlag | BitFlags<TearFlag>): void;
|
|
7729
8014
|
|
|
@@ -7857,6 +8142,44 @@ export declare const MAX_SPEED_STAT = 2;
|
|
|
7857
8142
|
/** Corresponds to the maximum value for `EntityPlayer.SamsonBerserkCharge`. */
|
|
7858
8143
|
export declare const MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000;
|
|
7859
8144
|
|
|
8145
|
+
/**
|
|
8146
|
+
* `merge` takes the values from a new table and recursively merges them into an old object (while
|
|
8147
|
+
* performing appropriate deserialization).
|
|
8148
|
+
*
|
|
8149
|
+
* This function is used to merge incoming data from the "save#.dat" file into a mod's variables.
|
|
8150
|
+
* Merging is useful instead of blowing away a table entirely because mod code often relies on the
|
|
8151
|
+
* local table/object references.
|
|
8152
|
+
*
|
|
8153
|
+
* This function always assumes that the new table is serialized data and will attempt to perform
|
|
8154
|
+
* deserialization on the objects within. In other words, unlike the `deepCopy` function, the
|
|
8155
|
+
* `merge` function will always operates in the mode of `SerializationType.DESERIALIZE`. For the
|
|
8156
|
+
* types of objects that will be deserialized, see the documentation for the `deepCopy` function.
|
|
8157
|
+
*
|
|
8158
|
+
* This function does not iterate over the old object, like you would naively expect. This is
|
|
8159
|
+
* because it is common for a variable to have a type of `something | null`. If this is the case,
|
|
8160
|
+
* the key would not appear when iterating over the old object (because a value of null transpiles
|
|
8161
|
+
* to nil, which means the table key does not exist). Thus, we must instead iterate over the new
|
|
8162
|
+
* object and copy the values backwards. The consequence of this is that `merge` can copy over old
|
|
8163
|
+
* variables that are no longer used in the code, or copy over old variables of a different type,
|
|
8164
|
+
* which can cause run-time errors. In such cases, users will have to manually delete their save
|
|
8165
|
+
* data.
|
|
8166
|
+
*
|
|
8167
|
+
* @param oldObject The old object to merge the values into. This can be either a Lua table, a TSTL
|
|
8168
|
+
* map, or a TSTL set.
|
|
8169
|
+
* @param newTable The new table to merge the values from. This must be a Lua table that represents
|
|
8170
|
+
* serialized data. In other words, it should be created with the `deepCopy`
|
|
8171
|
+
* function using `SerializationType.SERIALIZE`.
|
|
8172
|
+
* @param traversalDescription Used to track the current key that we are operating on for debugging
|
|
8173
|
+
* purposes. Use a name that corresponds to the name of the merging
|
|
8174
|
+
* table.
|
|
8175
|
+
* @param classConstructors Optional. A Lua table that maps the name of a user-defined TSTL class to
|
|
8176
|
+
* its corresponding constructor. If the `deepCopy` function finds any
|
|
8177
|
+
* user-defined TSTL classes when recursively iterating through the given
|
|
8178
|
+
* object, it will use this map to instantiate a new class. Default is an
|
|
8179
|
+
* empty Lua table.
|
|
8180
|
+
*/
|
|
8181
|
+
export declare function merge(oldObject: LuaMap<AnyNotNil, unknown> | Map<AnyNotNil, unknown> | Set<AnyNotNil>, newTable: LuaMap<AnyNotNil, unknown>, traversalDescription: string, classConstructors?: LuaMap<string, AnyClass>): void;
|
|
8182
|
+
|
|
7860
8183
|
/** If you set `EntityPlayer.ShotSpeed` lower than this value, it will have no effect. */
|
|
7861
8184
|
export declare const MIN_PLAYER_SHOT_SPEED_STAT = 0.6;
|
|
7862
8185
|
|
|
@@ -8607,9 +8930,11 @@ export declare enum ModCallbackCustom {
|
|
|
8607
8930
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
8608
8931
|
* normal `POST_NPC_INIT` callback.
|
|
8609
8932
|
*
|
|
8610
|
-
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method
|
|
8611
|
-
* an optional third argument that will make the callback only fire if it
|
|
8612
|
-
* provided.
|
|
8933
|
+
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
|
|
8934
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
8935
|
+
* matches the `EntityType` provided.
|
|
8936
|
+
* - You can provide an optional fourth argument that will make the callback only fire if it
|
|
8937
|
+
* matches the variant provided.
|
|
8613
8938
|
*
|
|
8614
8939
|
* ```ts
|
|
8615
8940
|
* function postNPCInitLate(npc: EntityNPC): void {}
|
|
@@ -8665,9 +8990,11 @@ export declare enum ModCallbackCustom {
|
|
|
8665
8990
|
*
|
|
8666
8991
|
* Use this callback to know when a pickup is added to the player's inventory or health.
|
|
8667
8992
|
*
|
|
8668
|
-
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method
|
|
8669
|
-
* an optional third argument that will make the callback only fire if it
|
|
8670
|
-
* `PickupVariant` provided.
|
|
8993
|
+
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
|
|
8994
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
8995
|
+
* matches the `PickupVariant` provided.
|
|
8996
|
+
* - You can provide an optional fourth argument that will make the callback only fire if it
|
|
8997
|
+
* matches the sub-type provided.
|
|
8671
8998
|
*
|
|
8672
8999
|
* ```ts
|
|
8673
9000
|
* function postPickupCollect(pickup: EntityPickup, player: EntityPlayer): void {}
|
|
@@ -8681,9 +9008,11 @@ export declare enum ModCallbackCustom {
|
|
|
8681
9008
|
* This callback is useful because pickups will despawn upon leaving the room and respawn upon
|
|
8682
9009
|
* re-entering the room.
|
|
8683
9010
|
*
|
|
8684
|
-
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method
|
|
8685
|
-
* an optional third argument that will make the callback only fire if it
|
|
8686
|
-
* `PickupVariant` provided.
|
|
9011
|
+
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
|
|
9012
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
9013
|
+
* matches the `PickupVariant` provided.
|
|
9014
|
+
* - You can provide an optional fourth argument that will make the callback only fire if it
|
|
9015
|
+
* matches the sub-type provided.
|
|
8687
9016
|
*
|
|
8688
9017
|
* ```ts
|
|
8689
9018
|
* function postPickupInitFirst(pickup: EntityPickup): void {}
|
|
@@ -8696,9 +9025,11 @@ export declare enum ModCallbackCustom {
|
|
|
8696
9025
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
8697
9026
|
* normal `POST_PICKUP_INIT` callback.
|
|
8698
9027
|
*
|
|
8699
|
-
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method
|
|
8700
|
-
* an optional third argument that will make the callback only fire if it
|
|
8701
|
-
* `PickupVariant` provided.
|
|
9028
|
+
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
|
|
9029
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
9030
|
+
* matches the `PickupVariant` provided.
|
|
9031
|
+
* - You can provide an optional fourth argument that will make the callback only fire if it
|
|
9032
|
+
* matches the sub-type provided.
|
|
8702
9033
|
*
|
|
8703
9034
|
* ```ts
|
|
8704
9035
|
* function postPickupInitLate(pickup: EntityPickup): void {}
|
|
@@ -8709,9 +9040,11 @@ export declare enum ModCallbackCustom {
|
|
|
8709
9040
|
* Fires from the `POST_PICKUP_UPDATE` callback when a pickup's state has changed from what it was
|
|
8710
9041
|
* on the previous frame. (In this context, "state" refers to the `EntityPickup.State` field.)
|
|
8711
9042
|
*
|
|
8712
|
-
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method
|
|
8713
|
-
* an optional third argument that will make the callback only fire if it
|
|
8714
|
-
* `PickupVariant` provided.
|
|
9043
|
+
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
|
|
9044
|
+
* - You can provide an optional third argument that will make the callback only fire if it
|
|
9045
|
+
* matches the `PickupVariant` provided.
|
|
9046
|
+
* - You can provide an optional fourth argument that will make the callback only fire if it
|
|
9047
|
+
* matches the sub-type provided.
|
|
8715
9048
|
*
|
|
8716
9049
|
* ```ts
|
|
8717
9050
|
* function postPickupStateChanged(
|
|
@@ -8787,13 +9120,13 @@ export declare enum ModCallbackCustom {
|
|
|
8787
9120
|
* matches the `PlayerType` provided.
|
|
8788
9121
|
*
|
|
8789
9122
|
* ```ts
|
|
8790
|
-
* function postPlayerChangeStat(
|
|
9123
|
+
* function postPlayerChangeStat<T extends StatType>(
|
|
8791
9124
|
* player: EntityPlayer,
|
|
8792
|
-
* statType:
|
|
9125
|
+
* statType: T,
|
|
8793
9126
|
* difference: int,
|
|
8794
|
-
* oldValue:
|
|
8795
|
-
* newValue:
|
|
8796
|
-
* )
|
|
9127
|
+
* oldValue: StatTypeType[T],
|
|
9128
|
+
* newValue: StatTypeType[T],
|
|
9129
|
+
* ) => void {}
|
|
8797
9130
|
* ```
|
|
8798
9131
|
*/
|
|
8799
9132
|
POST_PLAYER_CHANGE_STAT = 55,
|
|
@@ -9068,6 +9401,10 @@ export declare enum ModCallbackCustom {
|
|
|
9068
9401
|
* Fires from the `POST_UPDATE` callback when the clear state of a room changes (as according to
|
|
9069
9402
|
* the `Room.IsClear` method).
|
|
9070
9403
|
*
|
|
9404
|
+
* For example, this callback fires when you defeat all the enemies in a room (clear --> not
|
|
9405
|
+
* clear) or when you bomb an angel statue (not clear --> clear). This callback does not fire when
|
|
9406
|
+
* you travel between a cleared room and an uncleared room.
|
|
9407
|
+
*
|
|
9071
9408
|
* When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
|
|
9072
9409
|
* an optional third argument that will make the callback only fire if the room clear state
|
|
9073
9410
|
* matches the boolean provided.
|
|
@@ -9416,43 +9753,98 @@ export declare enum ModCallbackCustom2 {
|
|
|
9416
9753
|
POST_GRID_ENTITY_CUSTOM_COLLISION = 26,
|
|
9417
9754
|
POST_GRID_ENTITY_CUSTOM_INIT = 27,
|
|
9418
9755
|
POST_GRID_ENTITY_CUSTOM_REMOVE = 28,
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9756
|
+
POST_GRID_ENTITY_CUSTOM_RENDER = 29,
|
|
9757
|
+
POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 30,
|
|
9758
|
+
POST_GRID_ENTITY_CUSTOM_UPDATE = 31,
|
|
9759
|
+
POST_GRID_ENTITY_INIT = 32,
|
|
9760
|
+
POST_GRID_ENTITY_REMOVE = 33,
|
|
9761
|
+
POST_GRID_ENTITY_RENDER = 34,
|
|
9762
|
+
POST_GRID_ENTITY_STATE_CHANGED = 35,
|
|
9763
|
+
POST_GRID_ENTITY_UPDATE = 36,
|
|
9764
|
+
POST_HOLY_MANTLE_REMOVED = 37,
|
|
9765
|
+
POST_ITEM_DISCHARGE = 38,
|
|
9766
|
+
POST_ITEM_PICKUP = 39,
|
|
9767
|
+
POST_KNIFE_INIT_LATE = 40,
|
|
9768
|
+
POST_LASER_INIT_LATE = 41,
|
|
9769
|
+
POST_NEW_LEVEL_REORDERED = 42,
|
|
9770
|
+
POST_NEW_ROOM_EARLY = 43,
|
|
9771
|
+
POST_NEW_ROOM_REORDERED = 44,
|
|
9772
|
+
POST_NPC_INIT_LATE = 45,
|
|
9773
|
+
POST_NPC_STATE_CHANGED = 46,
|
|
9774
|
+
POST_PEFFECT_UPDATE_REORDERED = 47,
|
|
9775
|
+
POST_PICKUP_COLLECT = 48,
|
|
9776
|
+
POST_PICKUP_INIT_FIRST = 49,
|
|
9777
|
+
POST_PICKUP_INIT_LATE = 50,
|
|
9778
|
+
POST_PICKUP_STATE_CHANGED = 51,
|
|
9779
|
+
POST_PIT_RENDER = 52,
|
|
9780
|
+
POST_PIT_UPDATE = 53,
|
|
9781
|
+
POST_PLAYER_CHANGE_HEALTH = 54,
|
|
9782
|
+
POST_PLAYER_CHANGE_STAT = 55,
|
|
9783
|
+
POST_PLAYER_CHANGE_TYPE = 56,
|
|
9784
|
+
POST_PLAYER_COLLECTIBLE_ADDED = 57,
|
|
9785
|
+
POST_PLAYER_COLLECTIBLE_REMOVED = 58,
|
|
9786
|
+
POST_PLAYER_FATAL_DAMAGE = 59,
|
|
9787
|
+
POST_PLAYER_INIT_FIRST = 60,
|
|
9788
|
+
POST_PLAYER_INIT_LATE = 61,
|
|
9789
|
+
POST_PLAYER_RENDER_REORDERED = 62,
|
|
9790
|
+
POST_PLAYER_UPDATE_REORDERED = 63,
|
|
9791
|
+
POST_POOP_RENDER = 64,
|
|
9792
|
+
POST_POOP_UPDATE = 65,
|
|
9793
|
+
POST_PRESSURE_PLATE_RENDER = 66,
|
|
9794
|
+
POST_PRESSURE_PLATE_UPDATE = 67,
|
|
9795
|
+
POST_PROJECTILE_INIT_LATE = 68,
|
|
9796
|
+
POST_PURCHASE = 69,
|
|
9797
|
+
POST_ROCK_RENDER = 70,
|
|
9798
|
+
POST_ROCK_UPDATE = 71,
|
|
9799
|
+
POST_ROOM_CLEAR_CHANGED = 72,
|
|
9800
|
+
POST_SACRIFICE = 73,
|
|
9801
|
+
POST_SLOT_ANIMATION_CHANGED = 74,
|
|
9802
|
+
POST_SLOT_COLLISION = 75,
|
|
9803
|
+
POST_SLOT_DESTROYED = 76,
|
|
9804
|
+
POST_SLOT_INIT = 77,
|
|
9805
|
+
POST_SLOT_RENDER = 78,
|
|
9806
|
+
POST_SLOT_UPDATE = 79,
|
|
9807
|
+
POST_SPIKES_RENDER = 80,
|
|
9808
|
+
POST_SPIKES_UPDATE = 81,
|
|
9809
|
+
POST_TEAR_INIT_LATE = 82,
|
|
9810
|
+
POST_TEAR_INIT_VERY_LATE = 83,
|
|
9811
|
+
POST_TNT_RENDER = 84,
|
|
9812
|
+
POST_TNT_UPDATE = 85,
|
|
9813
|
+
POST_TRANSFORMATION = 86,
|
|
9814
|
+
PRE_BERSERK_DEATH = 87,
|
|
9815
|
+
PRE_CUSTOM_REVIVE = 88,
|
|
9816
|
+
PRE_ITEM_PICKUP = 89
|
|
9439
9817
|
}
|
|
9440
9818
|
|
|
9819
|
+
declare type ModCallbackCustomCollectibleType = MatchingCallbackCustom<CallbackSignatureCollectibleType>;
|
|
9820
|
+
|
|
9441
9821
|
declare type ModCallbackCustomGridEntity = MatchingCallbackCustom<CallbackSignatureGridEntity>;
|
|
9442
9822
|
|
|
9443
9823
|
declare type ModCallbackCustomGridEntityCustom = MatchingCallbackCustom<CallbackSignatureGridEntityCustom>;
|
|
9444
9824
|
|
|
9825
|
+
declare type ModCallbackCustomItemPickup = MatchingCallbackCustom<CallbackSignatureItemPickup>;
|
|
9826
|
+
|
|
9445
9827
|
declare type ModCallbackCustomPlayer = MatchingCallbackCustom<CallbackSignaturePlayer>;
|
|
9446
9828
|
|
|
9447
|
-
declare type
|
|
9829
|
+
declare type ModCallbackCustomSlot = MatchingCallbackCustom<CallbackSignatureSlot>;
|
|
9448
9830
|
|
|
9449
9831
|
/**
|
|
9450
|
-
* A helper class for
|
|
9451
|
-
*
|
|
9452
|
-
*
|
|
9832
|
+
* A helper class for mods that wants to represent their individual features as classes. Extend your
|
|
9833
|
+
* mod features from this class in order to enable the `@Callback` and `@CustomCallback` decorators
|
|
9834
|
+
* that automatically subscribe to callbacks.
|
|
9835
|
+
*
|
|
9836
|
+
* For example:
|
|
9837
|
+
*
|
|
9838
|
+
* ```ts
|
|
9839
|
+
* export class MyFeature extends ModFeature {
|
|
9840
|
+
* @Callback(ModCallback.POST_GAME_STARTED)
|
|
9841
|
+
* postGameStarted(isContinued: boolean): void {
|
|
9842
|
+
* Isaac.DebugString(`Callback fired: POST_GAME_STARTED`);
|
|
9843
|
+
* }
|
|
9844
|
+
* }
|
|
9845
|
+
* ```
|
|
9453
9846
|
*/
|
|
9454
9847
|
export declare class ModFeature {
|
|
9455
|
-
private mod;
|
|
9456
9848
|
constructor(mod: ModUpgraded);
|
|
9457
9849
|
}
|
|
9458
9850
|
|
|
@@ -9464,10 +9856,6 @@ export declare class ModFeature {
|
|
|
9464
9856
|
* To upgrade your mod, use the `upgradeMod` helper function.
|
|
9465
9857
|
*/
|
|
9466
9858
|
export declare class ModUpgraded implements Mod {
|
|
9467
|
-
/**
|
|
9468
|
-
* The `RegisterMod` function stores the name of the mod on the mod object for some reason. (It is
|
|
9469
|
-
* never used or referenced.)
|
|
9470
|
-
*/
|
|
9471
9859
|
Name: string;
|
|
9472
9860
|
/** We store a copy of the original mod object so that we can re-implement its functions. */
|
|
9473
9861
|
private mod;
|
|
@@ -9517,23 +9905,28 @@ export declare class ModUpgraded implements Mod {
|
|
|
9517
9905
|
*/
|
|
9518
9906
|
RemoveCallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, callback: AddCallbackParametersCustom2[T][0]): void;
|
|
9519
9907
|
/**
|
|
9520
|
-
* This
|
|
9521
|
-
*
|
|
9908
|
+
* This is used to initialize both custom callbacks and "extra features".
|
|
9909
|
+
*
|
|
9910
|
+
* This mirrors the `uninitFeature` method.
|
|
9522
9911
|
*/
|
|
9523
|
-
initOptionalFeature(feature: ISCFeature): FunctionTuple[];
|
|
9524
|
-
/** This is used to initialize both custom callbacks and "extra features". */
|
|
9525
9912
|
private initFeature;
|
|
9913
|
+
/**
|
|
9914
|
+
* This is used to uninitialize both custom callbacks and "extra features".
|
|
9915
|
+
*
|
|
9916
|
+
* This mirrors the `initFeature` method.
|
|
9917
|
+
*/
|
|
9526
9918
|
private uninitFeature;
|
|
9919
|
+
/** Returns the names of the exported class methods from the features that were added. */
|
|
9920
|
+
private initOptionalFeature;
|
|
9527
9921
|
}
|
|
9528
9922
|
|
|
9529
9923
|
/**
|
|
9530
9924
|
* By specifying one or more optional features, end-users will get a version of `ModUpgraded` that
|
|
9531
9925
|
* has extra methods corresponding to the features.
|
|
9532
9926
|
*
|
|
9533
|
-
* We have to explicitly account for the empty array case, since `never` will
|
|
9534
|
-
* union.
|
|
9927
|
+
* We have to explicitly account for the empty array case, since the `never` will mess up the union.
|
|
9535
9928
|
*/
|
|
9536
|
-
declare type ModUpgradedWithFeatures<T extends ISCFeature> = [T] extends [never] ? ModUpgraded :
|
|
9929
|
+
declare type ModUpgradedWithFeatures<T extends ISCFeature> = [T] extends [never] ? ModUpgraded : ModUpgraded & Omit<UnionToIntersection<ISCFeatureToClass[T]>, keyof Feature>;
|
|
9537
9930
|
|
|
9538
9931
|
/**
|
|
9539
9932
|
* Helper function to move all of the players to where they would normally go when arriving at a new
|
|
@@ -9820,6 +10213,46 @@ export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?:
|
|
|
9820
10213
|
*/
|
|
9821
10214
|
export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
|
|
9822
10215
|
|
|
10216
|
+
declare class PlayerCollectibleDetection extends Feature {
|
|
10217
|
+
v: {
|
|
10218
|
+
run: {
|
|
10219
|
+
playersCollectibleCount: DefaultMap<PlayerIndex, number, []>;
|
|
10220
|
+
playersCollectibleMap: DefaultMap<PlayerIndex, Map<CollectibleType, number>, []>;
|
|
10221
|
+
playersActiveItemMap: DefaultMap<PlayerIndex, Map<ActiveSlot, CollectibleType>, []>;
|
|
10222
|
+
};
|
|
10223
|
+
};
|
|
10224
|
+
private postPlayerCollectibleAdded;
|
|
10225
|
+
private postPlayerCollectibleRemoved;
|
|
10226
|
+
private runInNFrames;
|
|
10227
|
+
constructor(postPlayerCollectibleAdded: PostPlayerCollectibleAdded, postPlayerCollectibleRemoved: PostPlayerCollectibleRemoved, runInNFrames: RunInNFrames);
|
|
10228
|
+
/**
|
|
10229
|
+
* This is called when the collectible count changes and in situations where the entire build is
|
|
10230
|
+
* rerolled.
|
|
10231
|
+
*
|
|
10232
|
+
* Since getting a new player collectible map is expensive, we want to only run this function when
|
|
10233
|
+
* necessary, and not on e.g. every frame. Unfortunately, this has the side effect of missing out
|
|
10234
|
+
* on collectible changes from mods that add and remove a collectible on the same frame.
|
|
10235
|
+
*
|
|
10236
|
+
* @param player The player to update.
|
|
10237
|
+
* @param numCollectiblesChanged Pass undefined for situations where the entire build was
|
|
10238
|
+
* rerolled.
|
|
10239
|
+
*/
|
|
10240
|
+
private updateCollectibleMapAndFire;
|
|
10241
|
+
private useItemD4;
|
|
10242
|
+
private postPEffectUpdate;
|
|
10243
|
+
/**
|
|
10244
|
+
* Checking for collectible count will work to detect when a player swaps their active item for
|
|
10245
|
+
* another active item. This is because the collectible count will decrement by 1 when the item is
|
|
10246
|
+
* swapped onto the pedestal and the hold animation begins, and increment by 1 when the item is
|
|
10247
|
+
* dequeued and the hold animation ends.
|
|
10248
|
+
*
|
|
10249
|
+
* However, we also want to explicitly check for the case where a mod swaps in a custom active
|
|
10250
|
+
* collectible on the same frame, since doing so is cheap.
|
|
10251
|
+
*/
|
|
10252
|
+
private checkActiveItemsChanged;
|
|
10253
|
+
private entityTakeDmgPlayer;
|
|
10254
|
+
}
|
|
10255
|
+
|
|
9823
10256
|
export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
|
|
9824
10257
|
|
|
9825
10258
|
export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
|
|
@@ -9957,8 +10390,9 @@ playerVariant?: PlayerVariant,
|
|
|
9957
10390
|
character?: PlayerType
|
|
9958
10391
|
];
|
|
9959
10392
|
|
|
9960
|
-
declare class PostCustomRevive extends
|
|
10393
|
+
declare class PostCustomRevive extends CustomCallback<ModCallbackCustom2.POST_CUSTOM_REVIVE> {
|
|
9961
10394
|
constructor();
|
|
10395
|
+
protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
|
|
9962
10396
|
}
|
|
9963
10397
|
|
|
9964
10398
|
declare type PostCustomReviveRegisterParameters = [
|
|
@@ -10063,9 +10497,9 @@ gridEntityType?: GridEntityType,
|
|
|
10063
10497
|
variant?: int
|
|
10064
10498
|
];
|
|
10065
10499
|
|
|
10066
|
-
declare class PostGridEntityCollision extends CustomCallback<
|
|
10500
|
+
declare class PostGridEntityCollision extends CustomCallback<T_2> {
|
|
10067
10501
|
constructor();
|
|
10068
|
-
protected shouldFire(fireArgs: FireArgs<
|
|
10502
|
+
protected shouldFire(fireArgs: FireArgs<T_2>, optionalArgs: OptionalArgs<T_2>): boolean;
|
|
10069
10503
|
}
|
|
10070
10504
|
|
|
10071
10505
|
declare type PostGridEntityCollisionRegisterParameters = [
|
|
@@ -10085,9 +10519,9 @@ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void
|
|
|
10085
10519
|
gridEntityTypeCustom?: GridEntityType
|
|
10086
10520
|
];
|
|
10087
10521
|
|
|
10088
|
-
declare class PostGridEntityCustomCollision extends CustomCallback<
|
|
10522
|
+
declare class PostGridEntityCustomCollision extends CustomCallback<T_3> {
|
|
10089
10523
|
constructor();
|
|
10090
|
-
protected shouldFire(fireArgs: FireArgs<
|
|
10524
|
+
protected shouldFire(fireArgs: FireArgs<T_3>, optionalArgs: OptionalArgs<T_3>): boolean;
|
|
10091
10525
|
}
|
|
10092
10526
|
|
|
10093
10527
|
declare type PostGridEntityCustomCollisionRegisterParameters = [
|
|
@@ -10106,9 +10540,9 @@ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void
|
|
|
10106
10540
|
gridEntityTypeCustom?: GridEntityType
|
|
10107
10541
|
];
|
|
10108
10542
|
|
|
10109
|
-
declare class PostGridEntityCustomRemove extends CustomCallback<
|
|
10543
|
+
declare class PostGridEntityCustomRemove extends CustomCallback<T_5> {
|
|
10110
10544
|
constructor();
|
|
10111
|
-
protected shouldFire(fireArgs: FireArgs<
|
|
10545
|
+
protected shouldFire(fireArgs: FireArgs<T_5>, optionalArgs: OptionalArgs<T_5>): boolean;
|
|
10112
10546
|
}
|
|
10113
10547
|
|
|
10114
10548
|
declare type PostGridEntityCustomRemoveRegisterParameters = [
|
|
@@ -10116,6 +10550,10 @@ callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
|
|
|
10116
10550
|
gridEntityTypeCustom?: GridEntityType
|
|
10117
10551
|
];
|
|
10118
10552
|
|
|
10553
|
+
declare class PostGridEntityCustomRender extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_RENDER> {
|
|
10554
|
+
constructor();
|
|
10555
|
+
}
|
|
10556
|
+
|
|
10119
10557
|
declare type PostGridEntityCustomRenderRegisterParameters = [
|
|
10120
10558
|
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
|
|
10121
10559
|
gridEntityTypeCustom?: GridEntityType
|
|
@@ -10149,9 +10587,9 @@ gridEntityType?: GridEntityType,
|
|
|
10149
10587
|
variant?: int
|
|
10150
10588
|
];
|
|
10151
10589
|
|
|
10152
|
-
declare class PostGridEntityRemove extends CustomCallback<
|
|
10590
|
+
declare class PostGridEntityRemove extends CustomCallback<T_4> {
|
|
10153
10591
|
constructor();
|
|
10154
|
-
protected shouldFire(fireArgs: FireArgs<
|
|
10592
|
+
protected shouldFire(fireArgs: FireArgs<T_4>, optionalArgs: OptionalArgs<T_4>): boolean;
|
|
10155
10593
|
}
|
|
10156
10594
|
|
|
10157
10595
|
declare type PostGridEntityRemoveRegisterParameters = [
|
|
@@ -10160,6 +10598,10 @@ gridEntityType?: GridEntityType,
|
|
|
10160
10598
|
variant?: int
|
|
10161
10599
|
];
|
|
10162
10600
|
|
|
10601
|
+
declare class PostGridEntityRender extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_RENDER> {
|
|
10602
|
+
constructor();
|
|
10603
|
+
}
|
|
10604
|
+
|
|
10163
10605
|
declare type PostGridEntityRenderRegisterParameters = [
|
|
10164
10606
|
callback: (gridEntity: GridEntity) => void,
|
|
10165
10607
|
gridEntityType?: GridEntityType,
|
|
@@ -10197,6 +10639,10 @@ callback: (player: EntityPlayer, collectibleType: CollectibleType, activeSlot: A
|
|
|
10197
10639
|
collectibleType?: CollectibleType
|
|
10198
10640
|
];
|
|
10199
10641
|
|
|
10642
|
+
declare class PostItemPickup extends CustomCallbackItemPickup<ModCallbackCustom2.POST_ITEM_PICKUP> {
|
|
10643
|
+
constructor();
|
|
10644
|
+
}
|
|
10645
|
+
|
|
10200
10646
|
declare type PostItemPickupRegisterParameters = [callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => void] | [
|
|
10201
10647
|
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void,
|
|
10202
10648
|
itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
|
|
@@ -10299,11 +10745,19 @@ callback: (player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerT
|
|
|
10299
10745
|
playerVariant?: PlayerVariant
|
|
10300
10746
|
];
|
|
10301
10747
|
|
|
10748
|
+
declare class PostPlayerCollectibleAdded extends CustomCallbackCollectibleType<ModCallbackCustom2.POST_PLAYER_COLLECTIBLE_ADDED> {
|
|
10749
|
+
constructor();
|
|
10750
|
+
}
|
|
10751
|
+
|
|
10302
10752
|
declare type PostPlayerCollectibleAddedRegisterParameters = [
|
|
10303
10753
|
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
|
|
10304
10754
|
collectibleType?: CollectibleType
|
|
10305
10755
|
];
|
|
10306
10756
|
|
|
10757
|
+
declare class PostPlayerCollectibleRemoved extends CustomCallbackCollectibleType<ModCallbackCustom2.POST_PLAYER_COLLECTIBLE_REMOVED> {
|
|
10758
|
+
constructor();
|
|
10759
|
+
}
|
|
10760
|
+
|
|
10307
10761
|
declare type PostPlayerCollectibleRemovedRegisterParameters = [
|
|
10308
10762
|
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
|
|
10309
10763
|
collectibleType?: CollectibleType
|
|
@@ -10399,6 +10853,10 @@ playerVariant?: PlayerVariant,
|
|
|
10399
10853
|
character?: PlayerType
|
|
10400
10854
|
];
|
|
10401
10855
|
|
|
10856
|
+
declare class PostSlotAnimationChanged extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_ANIMATION_CHANGED> {
|
|
10857
|
+
constructor();
|
|
10858
|
+
}
|
|
10859
|
+
|
|
10402
10860
|
declare type PostSlotAnimationChangedRegisterParameters = [
|
|
10403
10861
|
callback: (slot: EntitySlot, previousAnimation: string, currentAnimation: string) => void,
|
|
10404
10862
|
slotVariant?: SlotVariant
|
|
@@ -10415,16 +10873,28 @@ slotVariant?: SlotVariant,
|
|
|
10415
10873
|
slotDestructionType?: SlotDestructionType
|
|
10416
10874
|
];
|
|
10417
10875
|
|
|
10876
|
+
declare class PostSlotInit extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_INIT> {
|
|
10877
|
+
constructor();
|
|
10878
|
+
}
|
|
10879
|
+
|
|
10418
10880
|
declare type PostSlotInitRegisterParameters = [
|
|
10419
10881
|
callback: (slot: EntitySlot) => void,
|
|
10420
10882
|
slotVariant?: SlotVariant
|
|
10421
10883
|
];
|
|
10422
10884
|
|
|
10885
|
+
declare class PostSlotRender extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_RENDER> {
|
|
10886
|
+
constructor();
|
|
10887
|
+
}
|
|
10888
|
+
|
|
10423
10889
|
declare type PostSlotRenderRegisterParameters = [
|
|
10424
10890
|
callback: (slot: EntitySlot) => void,
|
|
10425
10891
|
slotVariant?: SlotVariant
|
|
10426
10892
|
];
|
|
10427
10893
|
|
|
10894
|
+
declare class PostSlotUpdate extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_UPDATE> {
|
|
10895
|
+
constructor();
|
|
10896
|
+
}
|
|
10897
|
+
|
|
10428
10898
|
declare type PostSlotUpdateRegisterParameters = [
|
|
10429
10899
|
callback: (slot: EntitySlot) => void,
|
|
10430
10900
|
slotVariant?: SlotVariant
|
|
@@ -10492,6 +10962,10 @@ playerVariant?: PlayerVariant,
|
|
|
10492
10962
|
character?: PlayerType
|
|
10493
10963
|
];
|
|
10494
10964
|
|
|
10965
|
+
declare class PreItemPickup extends CustomCallbackItemPickup<ModCallbackCustom2.PRE_ITEM_PICKUP> {
|
|
10966
|
+
constructor();
|
|
10967
|
+
}
|
|
10968
|
+
|
|
10495
10969
|
declare type PreItemPickupRegisterParameters = [callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => void] | [
|
|
10496
10970
|
callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void,
|
|
10497
10971
|
itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
|
|
@@ -10589,6 +11063,39 @@ export declare function registerCharacterHealthConversion(playerType: PlayerType
|
|
|
10589
11063
|
*/
|
|
10590
11064
|
export declare function registerCharacterStats(playerType: PlayerType, statMap: Map<CacheFlag, number> | ReadonlyMap<CacheFlag, number>): void;
|
|
10591
11065
|
|
|
11066
|
+
/**
|
|
11067
|
+
* Helper function to register a custom item pool. Use this function once when your mod first loads
|
|
11068
|
+
* to declare the items that you want to be in the item pools. Then, in the middle of a run, you can
|
|
11069
|
+
* use `getCustomItemPoolCollectible`.
|
|
11070
|
+
*
|
|
11071
|
+
* For example:
|
|
11072
|
+
*
|
|
11073
|
+
* ```ts
|
|
11074
|
+
* const ItemPoolTypeCustom = {
|
|
11075
|
+
* FOO = 0 as ItemPoolType,
|
|
11076
|
+
* } as const;
|
|
11077
|
+
*
|
|
11078
|
+
* const FOO_ITEM_POOL = [
|
|
11079
|
+
* [CollectibleType.SAD_ONION, 1],
|
|
11080
|
+
* [CollectibleType.INNER_EYE, 0.5],
|
|
11081
|
+
* ];
|
|
11082
|
+
*
|
|
11083
|
+
* registerCustomItemPool(ItemPoolTypeCustom.FOO, FOO_ITEM_POOL);
|
|
11084
|
+
* ```
|
|
11085
|
+
*
|
|
11086
|
+
* Note that custom item pools do not currently support partial weight decrementation on sight.
|
|
11087
|
+
*
|
|
11088
|
+
* @param itemPoolTypeCustom An integer that identifies what kind of item pool you are creating. It
|
|
11089
|
+
* should correspond to a local enum value created in your mod. The
|
|
11090
|
+
* integer can be any unique value and can safely overlap with the vanilla
|
|
11091
|
+
* item pool type values.
|
|
11092
|
+
* @param collectibles An array of weighted collectible tuples that represent the item pool that you
|
|
11093
|
+
* are creating. The first element in he tuple is the `CollectibleType`, and the
|
|
11094
|
+
* second element in the tuple is the float that represents the weight of the
|
|
11095
|
+
* collectible.
|
|
11096
|
+
*/
|
|
11097
|
+
export declare function registerCustomItemPool(itemPoolTypeCustom: ItemPoolType, collectibles: WeightedArray<CollectibleType>): void;
|
|
11098
|
+
|
|
10592
11099
|
/**
|
|
10593
11100
|
* Helper function to register a custom pickup with the IsaacScript standard library. Use this
|
|
10594
11101
|
* feature for custom pickups that are intended to be picked up by the player, like bombs and keys.
|
|
@@ -11523,8 +12030,7 @@ export declare function runInNGameFrames(func: () => void, gameFrames: int): voi
|
|
|
11523
12030
|
export declare function runInNRenderFrames(func: () => void, renderFrames: int): void;
|
|
11524
12031
|
|
|
11525
12032
|
/**
|
|
11526
|
-
* Run the suite of tests that prove that the "merge" function works properly.
|
|
11527
|
-
* exported but is used internally in the save data manager.)
|
|
12033
|
+
* Run the suite of tests that prove that the "merge" function works properly.
|
|
11528
12034
|
*
|
|
11529
12035
|
* This function is only useful if you are troubleshooting the save data manager.
|
|
11530
12036
|
*/
|
|
@@ -11574,7 +12080,7 @@ export declare function runNextRenderFrame(func: () => void): void;
|
|
|
11574
12080
|
* This is the format of the object that you give to the save data manager. It will contains all of
|
|
11575
12081
|
* the variables for the particular mod feature.
|
|
11576
12082
|
*
|
|
11577
|
-
* Depending on which object keys you use, the variables will be
|
|
12083
|
+
* Depending on which object keys you use, the variables will automatically be reset at certain
|
|
11578
12084
|
* times and automatically saved to disk.
|
|
11579
12085
|
*
|
|
11580
12086
|
* Each sub-object of save data has a string as a key and arbitrary data as a value. However, the
|
|
@@ -11609,6 +12115,216 @@ export declare enum SaveDataKey {
|
|
|
11609
12115
|
ROOM = "room"
|
|
11610
12116
|
}
|
|
11611
12117
|
|
|
12118
|
+
declare class SaveDataManager extends Feature {
|
|
12119
|
+
/**
|
|
12120
|
+
* We store a local reference to the mod object so that we can access the corresponding methods
|
|
12121
|
+
* that read and write to the "save#.dat" file.
|
|
12122
|
+
*/
|
|
12123
|
+
private mod;
|
|
12124
|
+
/**
|
|
12125
|
+
* The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
|
|
12126
|
+
* Maps for the master map so that we can access the variables via the in-game console when
|
|
12127
|
+
* debugging. (TSTL Maps don't expose the map keys as normal keys.)
|
|
12128
|
+
*/
|
|
12129
|
+
private saveDataMap;
|
|
12130
|
+
/**
|
|
12131
|
+
* When mod feature data is initialized, we copy the initial values into a separate map so that we
|
|
12132
|
+
* can restore them later on.
|
|
12133
|
+
*/
|
|
12134
|
+
private saveDataDefaultsMap;
|
|
12135
|
+
/**
|
|
12136
|
+
* Each mod feature can optionally provide a function that can control whether or not the save
|
|
12137
|
+
* data is written to disk.
|
|
12138
|
+
*/
|
|
12139
|
+
private saveDataConditionalFuncMap;
|
|
12140
|
+
/**
|
|
12141
|
+
* We backup some save data keys on every new room for the purposes of restoring it when Glowing
|
|
12142
|
+
* Hour Glass is used.
|
|
12143
|
+
*
|
|
12144
|
+
* Note that the save data is backed up in serialized form so that we can use the `merge` function
|
|
12145
|
+
* to restore it.
|
|
12146
|
+
*/
|
|
12147
|
+
private saveDataGlowingHourGlassMap;
|
|
12148
|
+
/**
|
|
12149
|
+
* End-users can register their classes with the save data manager for proper serialization when
|
|
12150
|
+
* contained in nested maps, sets, and arrays.
|
|
12151
|
+
*/
|
|
12152
|
+
private classConstructors;
|
|
12153
|
+
private loadedDataOnThisRun;
|
|
12154
|
+
private restoreGlowingHourGlassDataOnNextRoom;
|
|
12155
|
+
constructor(mod: Mod);
|
|
12156
|
+
private postUseItemGlowingHourGlass;
|
|
12157
|
+
private postPlayerInit;
|
|
12158
|
+
private preGameExit;
|
|
12159
|
+
private postNewLevel;
|
|
12160
|
+
private postNewRoomEarly;
|
|
12161
|
+
/**
|
|
12162
|
+
* This is the entry point to the save data manager, a system which provides two major features:
|
|
12163
|
+
*
|
|
12164
|
+
* 1. automatic resetting of variables on a new run, on a new level, or on a new room (as desired)
|
|
12165
|
+
* 2. automatic saving and loading of all tracked data to the "save#.dat" file
|
|
12166
|
+
*
|
|
12167
|
+
* You feed this function with an object containing your variables, and then it will automatically
|
|
12168
|
+
* manage them for you. (See below for an example.)
|
|
12169
|
+
*
|
|
12170
|
+
* The save data manager is meant to be called once for each feature of your mod. In other words,
|
|
12171
|
+
* you should not put all of the data for your mod on the same object. Instead, scope your
|
|
12172
|
+
* variables locally to a single file that contains a mod feature, and then call this function to
|
|
12173
|
+
* register them. For example:
|
|
12174
|
+
*
|
|
12175
|
+
* ```ts
|
|
12176
|
+
* // In file: feature1.ts
|
|
12177
|
+
* import { saveDataManager } from "isaacscript-common";
|
|
12178
|
+
*
|
|
12179
|
+
* // Declare local variables for this file or feature.
|
|
12180
|
+
* const v = {
|
|
12181
|
+
* // These variables are never reset; manage them yourself at will.
|
|
12182
|
+
* persistent: {
|
|
12183
|
+
* foo1: 0,
|
|
12184
|
+
* },
|
|
12185
|
+
*
|
|
12186
|
+
* // These variables are reset at the beginning of every run.
|
|
12187
|
+
* run: {
|
|
12188
|
+
* foo2: 0,
|
|
12189
|
+
* },
|
|
12190
|
+
*
|
|
12191
|
+
* // These variables are reset at the beginning of every level.
|
|
12192
|
+
* level: {
|
|
12193
|
+
* foo3: 0,
|
|
12194
|
+
* },
|
|
12195
|
+
*
|
|
12196
|
+
* // These variables are reset at the beginning of every room.
|
|
12197
|
+
* room: {
|
|
12198
|
+
* foo4: 0,
|
|
12199
|
+
* },
|
|
12200
|
+
* };
|
|
12201
|
+
* // Every child object is optional; only create the ones that you need.
|
|
12202
|
+
*
|
|
12203
|
+
* // Register the variables with the save data manager. (We need to provide a string key that
|
|
12204
|
+
* // matches the name of this file.)
|
|
12205
|
+
* function feature1Init() {
|
|
12206
|
+
* saveDataManager("feature1", v);
|
|
12207
|
+
* }
|
|
12208
|
+
*
|
|
12209
|
+
* // Elsewhere in the file, use your variables.
|
|
12210
|
+
* function feature1Function() {
|
|
12211
|
+
* if (v.run.foo1 > 0) {
|
|
12212
|
+
* // Insert code here.
|
|
12213
|
+
* }
|
|
12214
|
+
* }
|
|
12215
|
+
* ```
|
|
12216
|
+
*
|
|
12217
|
+
* - Save data is loaded from disk in the `POST_PLAYER_INIT` callback (i.e. the first callback
|
|
12218
|
+
* that can possibly run).
|
|
12219
|
+
* - Save data is recorded to disk in the `PRE_GAME_EXIT` callback.
|
|
12220
|
+
*
|
|
12221
|
+
* You can use many different variable types on your variable object, but not everything is
|
|
12222
|
+
* supported. For the specific things that are supported, see the documentation for the `deepCopy`
|
|
12223
|
+
* helper function.
|
|
12224
|
+
*
|
|
12225
|
+
* Note that before using the save data manager, you must call the `upgradeMod` function. (Upgrade
|
|
12226
|
+
* your mod before registering any of your own callbacks so that the save data manager will run
|
|
12227
|
+
* before any of your code does.)
|
|
12228
|
+
*
|
|
12229
|
+
* If you want the save data manager to load data before the `POST_PLAYER_INIT` callback (i.e. in
|
|
12230
|
+
* the main menu), then you should explicitly call the `saveDataManagerLoad` function. (The save
|
|
12231
|
+
* data manager cannot do this on its own because it cannot know when your mod features are
|
|
12232
|
+
* finished initializing.)
|
|
12233
|
+
*
|
|
12234
|
+
* Some features may have variables that need to be automatically reset per run/level, but not
|
|
12235
|
+
* saved to disk on game exit. (For example, if they contain functions or other non-serializable
|
|
12236
|
+
* data.) For these cases, set the second argument to `false`.
|
|
12237
|
+
*
|
|
12238
|
+
* Note that when the player uses Glowing Hour Glass, the save data manager will automatically
|
|
12239
|
+
* restore any variables on a "run" or "level" object with a backup that was created when the room
|
|
12240
|
+
* was entered. Thus, you should not have to explicitly program support for Glowing Hour Glass
|
|
12241
|
+
* into your mod features that use the save data manager. If this is undesired for your specific
|
|
12242
|
+
* use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
|
|
12243
|
+
*
|
|
12244
|
+
* @param key The name of the file or feature that is submitting data to be managed by the save
|
|
12245
|
+
* data manager. The save data manager will throw an error if the key is already
|
|
12246
|
+
* registered.
|
|
12247
|
+
* @param v An object that corresponds to the `SaveData` interface. The object is conventionally
|
|
12248
|
+
* called "v" for brevity. ("v" is short for "local variables").
|
|
12249
|
+
* @param conditionalFunc Optional. A function to run to check if this save data should be written
|
|
12250
|
+
* to disk. Default is `() => true`, meaning that this save data will
|
|
12251
|
+
* always be written to disk. Use a conditional function for the situations
|
|
12252
|
+
* when the local variables are for a feature that the end-user can
|
|
12253
|
+
* disable. (If the feature is disabled, then there would be no point in
|
|
12254
|
+
* writing any of the variables to the "save#.dat" file.) You can also
|
|
12255
|
+
* specify `false` to this argument in order to completely disable saving
|
|
12256
|
+
* data. (Specifying `false` will allow you to use non-serializable objects
|
|
12257
|
+
* in your save data, such as `EntityPtr`.
|
|
12258
|
+
*/
|
|
12259
|
+
saveDataManager<Persistent, Run, Level>(key: string, // This is the overload for the standard case with serializable data.
|
|
12260
|
+
v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
|
|
12261
|
+
saveDataManager(key: string, // This is the overload for the case when saving data is disabled.
|
|
12262
|
+
v: SaveData, conditionalFunc: false): void;
|
|
12263
|
+
/**
|
|
12264
|
+
* Recursively traverses an object, collecting all of the class constructors that it encounters.
|
|
12265
|
+
*/
|
|
12266
|
+
private storeClassConstructorsFromObject;
|
|
12267
|
+
/**
|
|
12268
|
+
* The save data manager will automatically load variables from disk at the appropriate times
|
|
12269
|
+
* (i.e. when a new run is started). Use this function to explicitly force the save data manager
|
|
12270
|
+
* to load all of its variables from disk immediately.
|
|
12271
|
+
*
|
|
12272
|
+
* Obviously, doing this will overwrite the current data, so using this function can potentially
|
|
12273
|
+
* result in lost state.
|
|
12274
|
+
*/
|
|
12275
|
+
saveDataManagerLoad(): void;
|
|
12276
|
+
/**
|
|
12277
|
+
* The save data manager will automatically save variables to disk at the appropriate times (i.e.
|
|
12278
|
+
* when the run is exited). Use this function to explicitly force the save data manager to write
|
|
12279
|
+
* all of its variables to disk immediately.
|
|
12280
|
+
*/
|
|
12281
|
+
saveDataManagerSave(): void;
|
|
12282
|
+
/**
|
|
12283
|
+
* Sets the global variable of "g" equal to all of the save data variables for this mod.
|
|
12284
|
+
*
|
|
12285
|
+
* This can make debugging easier, as you can access the variables from the game's debug console.
|
|
12286
|
+
* e.g. `l print(g.feature1.run.foo)`
|
|
12287
|
+
*/
|
|
12288
|
+
saveDataManagerSetGlobal(): void;
|
|
12289
|
+
/**
|
|
12290
|
+
* By default, the save data manager will not be able to serialize/deserialize classes that are
|
|
12291
|
+
* nested inside of maps, sets, and arrays, because it does not have access to the corresponding
|
|
12292
|
+
* class constructor. If you want to use nested classes in this way, then use this function to
|
|
12293
|
+
* register the class constructor with the save data manager. Once registered, the save data
|
|
12294
|
+
* manager will automatically run the constructor when deserializing (in addition to copying over
|
|
12295
|
+
* the data fields).
|
|
12296
|
+
*
|
|
12297
|
+
* This function is variadic, which means you can pass as many classes as you want to register.
|
|
12298
|
+
*/
|
|
12299
|
+
saveDataManagerRegisterClass(...tstlClasses: AnyClass[]): void;
|
|
12300
|
+
/**
|
|
12301
|
+
* Removes a previously registered key from the save data manager. This is the opposite of the
|
|
12302
|
+
* "saveDataManager" method.
|
|
12303
|
+
*/
|
|
12304
|
+
saveDataManagerRemove(key: string): void;
|
|
12305
|
+
/**
|
|
12306
|
+
* The save data manager will automatically reset variables at the appropriate times, like when a
|
|
12307
|
+
* player enters a new room. Use this function to explicitly force the save data manager to reset
|
|
12308
|
+
* a specific variable group.
|
|
12309
|
+
*
|
|
12310
|
+
* For example:
|
|
12311
|
+
*
|
|
12312
|
+
* ```ts
|
|
12313
|
+
* const v = {
|
|
12314
|
+
* room: {
|
|
12315
|
+
* foo: 123,
|
|
12316
|
+
* },
|
|
12317
|
+
* };
|
|
12318
|
+
*
|
|
12319
|
+
* mod.saveDataManager("file1", v);
|
|
12320
|
+
*
|
|
12321
|
+
* // Then, later on, to explicit reset all of the "room" variables:
|
|
12322
|
+
* mod.saveDataManagerReset("file1", "room");
|
|
12323
|
+
* ```
|
|
12324
|
+
*/
|
|
12325
|
+
saveDataManagerReset(key: string, childObjectKey: SaveDataKey): void;
|
|
12326
|
+
}
|
|
12327
|
+
|
|
11612
12328
|
/**
|
|
11613
12329
|
* This is the entry point to the save data manager, a system which provides two major features:
|
|
11614
12330
|
*
|
|
@@ -11705,11 +12421,9 @@ export declare enum SaveDataKey {
|
|
|
11705
12421
|
* will allow you to use non-serializable objects in your save data, such as
|
|
11706
12422
|
* `EntityPtr`.
|
|
11707
12423
|
*/
|
|
11708
|
-
export declare function saveDataManager<Persistent, Run, Level>(key: string,
|
|
11709
|
-
v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
|
|
12424
|
+
export declare function saveDataManager<Persistent, Run, Level>(key: string, v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
|
|
11710
12425
|
|
|
11711
|
-
export declare function saveDataManager(key: string,
|
|
11712
|
-
v: SaveData, conditionalFunc: false): void;
|
|
12426
|
+
export declare function saveDataManager(key: string, v: SaveData, conditionalFunc: false): void;
|
|
11713
12427
|
|
|
11714
12428
|
/**
|
|
11715
12429
|
* The save data manager will automatically load variables from disk at the appropriate times (i.e.
|
|
@@ -11721,6 +12435,18 @@ v: SaveData, conditionalFunc: false): void;
|
|
|
11721
12435
|
*/
|
|
11722
12436
|
export declare function saveDataManagerLoad(): void;
|
|
11723
12437
|
|
|
12438
|
+
/**
|
|
12439
|
+
* By default, the save data manager will not be able to serialize classes that are nested inside of
|
|
12440
|
+
* maps, sets, and arrays, because it does not have access to the corresponding class constructor.
|
|
12441
|
+
* If you want to use nested classes in this way, then use this function to register a class
|
|
12442
|
+
* constructor with the save data manager. If the save data manager finds a registered class of the
|
|
12443
|
+
* same name when deserializing, it will automatically run the registered constructor (in addition
|
|
12444
|
+
* to copying over the data fields).
|
|
12445
|
+
*
|
|
12446
|
+
* This function is variadic, which means you can pass as many classes as you want to register.
|
|
12447
|
+
*/
|
|
12448
|
+
export declare function saveDataManagerRegisterClass(...tstlClasses: AnyClass[]): void;
|
|
12449
|
+
|
|
11724
12450
|
/**
|
|
11725
12451
|
* Removes a previously registered key from the save data manager. This is the opposite of the
|
|
11726
12452
|
* "saveDataManager" function.
|
|
@@ -11781,9 +12507,9 @@ declare type SerializableArray<T> = Array<SerializableInsideArrayOrMap<T>>;
|
|
|
11781
12507
|
|
|
11782
12508
|
/**
|
|
11783
12509
|
* This is mostly copied from the `Serializable` type. The difference is that we want to disallow
|
|
11784
|
-
*
|
|
12510
|
+
* functions inside of containers.
|
|
11785
12511
|
*/
|
|
11786
|
-
declare type SerializableInsideArrayOrMap<T> = T extends SerializablePrimitive ? T : T extends CopyableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : T extends
|
|
12512
|
+
declare type SerializableInsideArrayOrMap<T> = T extends SerializablePrimitive ? T : T extends CopyableIsaacAPIClass ? T : T extends IsaacAPIClass ? ErrorIsaacAPIClassIsNotSerializable : T extends Array<infer U> ? SerializableArray<U> : T extends ReadonlyArray<infer U> ? SerializableReadonlyArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends ReadonlyMap<infer K, infer V> ? SerializableReadonlyMap<K, V> : T extends Set<infer V> ? SerializableSet<V> : T extends ReadonlySet<infer V> ? SerializableReadonlySet<V> : T extends Function ? FunctionIsNotSerializable : SerializableObject<T>;
|
|
11787
12513
|
|
|
11788
12514
|
declare type SerializableMap<K, V> = Map<SerializableInsideArrayOrMap<K>, SerializableInsideArrayOrMap<V>>;
|
|
11789
12515
|
|
|
@@ -11801,6 +12527,46 @@ declare type SerializableReadonlySet<T> = ReadonlySet<SerializableInsideArrayOrM
|
|
|
11801
12527
|
|
|
11802
12528
|
declare type SerializableSet<T> = Set<SerializableInsideArrayOrMap<T>>;
|
|
11803
12529
|
|
|
12530
|
+
/**
|
|
12531
|
+
* During serialization, we write an arbitrary string key to the object with a value of an empty
|
|
12532
|
+
* string. This is used during deserialization to instantiate the correct type of object.
|
|
12533
|
+
*
|
|
12534
|
+
* Note that we do not bother branding TSTL classes because we have no way to run the proper
|
|
12535
|
+
* constructor during deserialization.
|
|
12536
|
+
*/
|
|
12537
|
+
export declare enum SerializationBrand {
|
|
12538
|
+
DEFAULT_MAP = "__TSTL_DEFAULT_MAP",
|
|
12539
|
+
MAP = "__TSTL_MAP",
|
|
12540
|
+
SET = "__TSTL_SET",
|
|
12541
|
+
BIT_SET_128 = "__BIT_SET_128",
|
|
12542
|
+
COLOR = "__COLOR",
|
|
12543
|
+
K_COLOR = "__K_COLOR",
|
|
12544
|
+
RNG = "__RNG",
|
|
12545
|
+
VECTOR = "__VECTOR",
|
|
12546
|
+
/**
|
|
12547
|
+
* This is set to the value that represents the default value (instead of an empty string like the
|
|
12548
|
+
* other brands are).
|
|
12549
|
+
*/
|
|
12550
|
+
DEFAULT_MAP_VALUE = "__TSTL_DEFAULT_MAP_VALUE",
|
|
12551
|
+
/**
|
|
12552
|
+
* The JSON library is unable to distinguish between a maps with number keys and an array. It will
|
|
12553
|
+
* assume that both of these are an array. Thus, in the case of a map with number keys, it will
|
|
12554
|
+
* insert null in every empty spot, leading to crashes.
|
|
12555
|
+
*
|
|
12556
|
+
* For example, a map with keys of 5 and 10 would be converted to the following array: `[null,
|
|
12557
|
+
* null, null, null, "myValueForKey5", null, null, null, null, "myValueForKey10"]`
|
|
12558
|
+
*
|
|
12559
|
+
* The deep copier works around this by converting number keys to strings. It inserts this brand
|
|
12560
|
+
* to keep track of the mutation.
|
|
12561
|
+
*/
|
|
12562
|
+
OBJECT_WITH_NUMBER_KEYS = "__TSTL_OBJECT_WITH_NUMBER_KEYS",
|
|
12563
|
+
/**
|
|
12564
|
+
* This brand represents a user-defined class other than a `DefaultMap`, `Map`, or `Set`. It will
|
|
12565
|
+
* have a string value that corresponds to the name of the class.
|
|
12566
|
+
*/
|
|
12567
|
+
TSTL_CLASS = "__TSTL_CLASS"
|
|
12568
|
+
}
|
|
12569
|
+
|
|
11804
12570
|
/** This is used with the `deepCopy` and `merge` functions. */
|
|
11805
12571
|
export declare enum SerializationType {
|
|
11806
12572
|
NONE = 0,
|
|
@@ -12467,6 +13233,34 @@ export declare enum SlotDestructionType {
|
|
|
12467
13233
|
COLLECTIBLE_PAYOUT = 1
|
|
12468
13234
|
}
|
|
12469
13235
|
|
|
13236
|
+
declare class SlotRenderDetection extends Feature {
|
|
13237
|
+
v: {
|
|
13238
|
+
room: {
|
|
13239
|
+
slotAnimations: DefaultMap<PtrHash, string, [slot: Entity]>;
|
|
13240
|
+
brokenSlots: Set<PtrHash>;
|
|
13241
|
+
};
|
|
13242
|
+
};
|
|
13243
|
+
private postSlotRender;
|
|
13244
|
+
private postSlotAnimationChanged;
|
|
13245
|
+
constructor(postSlotRender: PostSlotRender, postSlotAnimationChanged: PostSlotAnimationChanged);
|
|
13246
|
+
private postRender;
|
|
13247
|
+
private checkSlotAnimationChanged;
|
|
13248
|
+
}
|
|
13249
|
+
|
|
13250
|
+
declare class SlotUpdateDetection extends Feature {
|
|
13251
|
+
v: {
|
|
13252
|
+
room: {
|
|
13253
|
+
initializedSlots: Set<PtrHash>;
|
|
13254
|
+
};
|
|
13255
|
+
};
|
|
13256
|
+
private postSlotInit;
|
|
13257
|
+
private postSlotUpdate;
|
|
13258
|
+
constructor(postSlotInit: PostSlotInit, postSlotUpdate: PostSlotUpdate);
|
|
13259
|
+
private postUpdate;
|
|
13260
|
+
private postNewRoomReordered;
|
|
13261
|
+
private checkNewEntity;
|
|
13262
|
+
}
|
|
13263
|
+
|
|
12470
13264
|
/**
|
|
12471
13265
|
* Helper function to smelt a trinket. Before smelting, this function will automatically remove the
|
|
12472
13266
|
* trinkets that the player is holding, if any, and then give them back after the new trinket is
|
|
@@ -13095,13 +13889,15 @@ export declare function sumSet(set: Set<number> | ReadonlySet<number>): number;
|
|
|
13095
13889
|
*/
|
|
13096
13890
|
export declare function swapArrayElements<T>(array: T[], i: number, j: number): void;
|
|
13097
13891
|
|
|
13098
|
-
declare type T = ModCallbackCustom2.
|
|
13892
|
+
declare type T = ModCallbackCustom2.POST_CUSTOM_REVIVE;
|
|
13893
|
+
|
|
13894
|
+
declare type T_2 = ModCallbackCustom2.POST_GRID_ENTITY_COLLISION;
|
|
13099
13895
|
|
|
13100
|
-
declare type
|
|
13896
|
+
declare type T_3 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_COLLISION;
|
|
13101
13897
|
|
|
13102
|
-
declare type
|
|
13898
|
+
declare type T_4 = ModCallbackCustom2.POST_GRID_ENTITY_REMOVE;
|
|
13103
13899
|
|
|
13104
|
-
declare type
|
|
13900
|
+
declare type T_5 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_REMOVE;
|
|
13105
13901
|
|
|
13106
13902
|
/**
|
|
13107
13903
|
* Helper function to check if a Lua table has all of the provided keys.
|