isaacscript-common 14.1.3 → 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.
Files changed (487) hide show
  1. package/dist/index.d.ts +919 -141
  2. package/dist/isaacscript-common.lua +4752 -1790
  3. package/dist/src/callbacks.d.ts +102 -20
  4. package/dist/src/callbacks.d.ts.map +1 -1
  5. package/dist/src/callbacks.lua +124 -1
  6. package/dist/src/classes/ModFeature.d.ts.map +1 -1
  7. package/dist/src/classes/ModFeature.lua +22 -1
  8. package/dist/src/classes/ModUpgraded.d.ts +10 -5
  9. package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
  10. package/dist/src/classes/ModUpgraded.lua +30 -11
  11. package/dist/src/classes/callbacks/PostCustomRevive.d.ts +5 -2
  12. package/dist/src/classes/callbacks/PostCustomRevive.d.ts.map +1 -1
  13. package/dist/src/classes/callbacks/PostCustomRevive.lua +12 -4
  14. package/dist/src/classes/callbacks/PostGridEntityBroken.lua +1 -1
  15. package/dist/src/classes/callbacks/PostGridEntityCollision.lua +1 -1
  16. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.lua +1 -1
  17. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.lua +1 -1
  18. package/dist/src/classes/callbacks/PostGridEntityCustomInit.lua +1 -1
  19. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.lua +1 -1
  20. package/dist/src/classes/callbacks/PostGridEntityCustomRender.d.ts +6 -0
  21. package/dist/src/classes/callbacks/PostGridEntityCustomRender.d.ts.map +1 -0
  22. package/dist/src/classes/callbacks/PostGridEntityCustomRender.lua +17 -0
  23. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.lua +1 -1
  24. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.lua +1 -1
  25. package/dist/src/classes/callbacks/PostGridEntityInit.lua +1 -1
  26. package/dist/src/classes/callbacks/PostGridEntityRemove.lua +1 -1
  27. package/dist/src/classes/callbacks/PostGridEntityRender.d.ts +6 -0
  28. package/dist/src/classes/callbacks/PostGridEntityRender.d.ts.map +1 -0
  29. package/dist/src/classes/callbacks/PostGridEntityRender.lua +17 -0
  30. package/dist/src/classes/callbacks/PostGridEntityStateChanged.lua +1 -1
  31. package/dist/src/classes/callbacks/PostGridEntityUpdate.lua +1 -1
  32. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts +1 -1
  33. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts.map +1 -1
  34. package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +3 -4
  35. package/dist/src/classes/callbacks/PostItemDischarge.d.ts +43 -0
  36. package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -0
  37. package/dist/src/classes/callbacks/PostItemDischarge.lua +113 -0
  38. package/dist/src/classes/callbacks/PostItemPickup.d.ts +6 -0
  39. package/dist/src/classes/callbacks/PostItemPickup.d.ts.map +1 -0
  40. package/dist/src/classes/callbacks/PostItemPickup.lua +17 -0
  41. package/dist/src/classes/callbacks/PostLaserInitLate.d.ts +12 -0
  42. package/dist/src/classes/callbacks/PostLaserInitLate.d.ts.map +1 -0
  43. package/dist/src/classes/callbacks/PostLaserInitLate.lua +27 -0
  44. package/dist/src/classes/callbacks/PostNPCInitLate.d.ts +12 -0
  45. package/dist/src/classes/callbacks/PostNPCInitLate.d.ts.map +1 -0
  46. package/dist/src/classes/callbacks/PostNPCInitLate.lua +27 -0
  47. package/dist/src/classes/callbacks/PostNPCStateChanged.d.ts +14 -0
  48. package/dist/src/classes/callbacks/PostNPCStateChanged.d.ts.map +1 -0
  49. package/dist/src/classes/callbacks/PostNPCStateChanged.lua +33 -0
  50. package/dist/src/classes/callbacks/PostPickupCollect.d.ts +12 -0
  51. package/dist/src/classes/callbacks/PostPickupCollect.d.ts.map +1 -0
  52. package/dist/src/classes/callbacks/PostPickupCollect.lua +35 -0
  53. package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts +12 -0
  54. package/dist/src/classes/callbacks/PostPickupInitFirst.d.ts.map +1 -0
  55. package/dist/src/classes/callbacks/PostPickupInitFirst.lua +32 -0
  56. package/dist/src/classes/callbacks/PostPickupInitLate.d.ts +12 -0
  57. package/dist/src/classes/callbacks/PostPickupInitLate.d.ts.map +1 -0
  58. package/dist/src/classes/callbacks/PostPickupInitLate.lua +27 -0
  59. package/dist/src/classes/callbacks/PostPickupStateChanged.d.ts +13 -0
  60. package/dist/src/classes/callbacks/PostPickupStateChanged.d.ts.map +1 -0
  61. package/dist/src/classes/callbacks/PostPickupStateChanged.lua +33 -0
  62. package/dist/src/classes/callbacks/PostPitUpdate.d.ts +7 -0
  63. package/dist/src/classes/callbacks/PostPitUpdate.d.ts.map +1 -0
  64. package/dist/src/classes/callbacks/PostPitUpdate.lua +24 -0
  65. package/dist/src/classes/callbacks/PostPlayerChangeHealth.d.ts +15 -0
  66. package/dist/src/classes/callbacks/PostPlayerChangeHealth.d.ts.map +1 -0
  67. package/dist/src/classes/callbacks/PostPlayerChangeHealth.lua +52 -0
  68. package/dist/src/classes/callbacks/PostPlayerChangeStat.d.ts +16 -0
  69. package/dist/src/classes/callbacks/PostPlayerChangeStat.d.ts.map +1 -0
  70. package/dist/src/classes/callbacks/PostPlayerChangeStat.lua +94 -0
  71. package/dist/src/classes/callbacks/PostPlayerChangeType.d.ts +15 -0
  72. package/dist/src/classes/callbacks/PostPlayerChangeType.d.ts.map +1 -0
  73. package/dist/src/classes/callbacks/PostPlayerChangeType.lua +37 -0
  74. package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.d.ts +6 -0
  75. package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.d.ts.map +1 -0
  76. package/dist/src/classes/callbacks/PostPlayerCollectibleAdded.lua +17 -0
  77. package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.d.ts +6 -0
  78. package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.d.ts.map +1 -0
  79. package/dist/src/classes/callbacks/PostPlayerCollectibleRemoved.lua +17 -0
  80. package/dist/src/classes/callbacks/PostPlayerInitFirst.d.ts +8 -0
  81. package/dist/src/classes/callbacks/PostPlayerInitFirst.d.ts.map +1 -0
  82. package/dist/src/classes/callbacks/PostPlayerInitFirst.lua +39 -0
  83. package/dist/src/classes/callbacks/PostPlayerInitLate.d.ts +13 -0
  84. package/dist/src/classes/callbacks/PostPlayerInitLate.d.ts.map +1 -0
  85. package/dist/src/classes/callbacks/PostPlayerInitLate.lua +29 -0
  86. package/dist/src/classes/callbacks/PostPoopRender.d.ts +7 -0
  87. package/dist/src/classes/callbacks/PostPoopRender.d.ts.map +1 -0
  88. package/dist/src/classes/callbacks/PostPoopRender.lua +24 -0
  89. package/dist/src/classes/callbacks/PostPoopUpdate.d.ts +7 -0
  90. package/dist/src/classes/callbacks/PostPoopUpdate.d.ts.map +1 -0
  91. package/dist/src/classes/callbacks/PostPoopUpdate.lua +24 -0
  92. package/dist/src/classes/callbacks/PostPressurePlateRender.d.ts +7 -0
  93. package/dist/src/classes/callbacks/PostPressurePlateRender.d.ts.map +1 -0
  94. package/dist/src/classes/callbacks/PostPressurePlateRender.lua +24 -0
  95. package/dist/src/classes/callbacks/PostPressurePlateUpdate.d.ts +7 -0
  96. package/dist/src/classes/callbacks/PostPressurePlateUpdate.d.ts.map +1 -0
  97. package/dist/src/classes/callbacks/PostPressurePlateUpdate.lua +24 -0
  98. package/dist/src/classes/callbacks/PostProjectileInitLate.d.ts +12 -0
  99. package/dist/src/classes/callbacks/PostProjectileInitLate.d.ts.map +1 -0
  100. package/dist/src/classes/callbacks/PostProjectileInitLate.lua +27 -0
  101. package/dist/src/classes/callbacks/PostPurchase.d.ts +18 -0
  102. package/dist/src/classes/callbacks/PostPurchase.d.ts.map +1 -0
  103. package/dist/src/classes/callbacks/PostPurchase.lua +56 -0
  104. package/dist/src/classes/callbacks/PostRockRender.d.ts +7 -0
  105. package/dist/src/classes/callbacks/PostRockRender.d.ts.map +1 -0
  106. package/dist/src/classes/callbacks/PostRockRender.lua +24 -0
  107. package/dist/src/classes/callbacks/PostRockUpdate.d.ts +7 -0
  108. package/dist/src/classes/callbacks/PostRockUpdate.d.ts.map +1 -0
  109. package/dist/src/classes/callbacks/PostRockUpdate.lua +24 -0
  110. package/dist/src/classes/callbacks/PostSacrifice.d.ts +15 -0
  111. package/dist/src/classes/callbacks/PostSacrifice.d.ts.map +1 -0
  112. package/dist/src/classes/callbacks/PostSacrifice.lua +52 -0
  113. package/dist/src/classes/callbacks/PostSlotAnimationChanged.d.ts +6 -0
  114. package/dist/src/classes/callbacks/PostSlotAnimationChanged.d.ts.map +1 -0
  115. package/dist/src/classes/callbacks/PostSlotAnimationChanged.lua +17 -0
  116. package/dist/src/classes/callbacks/PostSlotCollision.d.ts +7 -0
  117. package/dist/src/classes/callbacks/PostSlotCollision.d.ts.map +1 -0
  118. package/dist/src/classes/callbacks/PostSlotCollision.lua +25 -0
  119. package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts +14 -0
  120. package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -0
  121. package/dist/src/classes/callbacks/PostSlotDestroyed.lua +65 -0
  122. package/dist/src/classes/callbacks/PostSlotInit.d.ts +6 -0
  123. package/dist/src/classes/callbacks/PostSlotInit.d.ts.map +1 -0
  124. package/dist/src/classes/callbacks/PostSlotInit.lua +17 -0
  125. package/dist/src/classes/callbacks/PostSlotRender.d.ts +6 -0
  126. package/dist/src/classes/callbacks/PostSlotRender.d.ts.map +1 -0
  127. package/dist/src/classes/callbacks/PostSlotRender.lua +17 -0
  128. package/dist/src/classes/callbacks/PostSlotUpdate.d.ts +6 -0
  129. package/dist/src/classes/callbacks/PostSlotUpdate.d.ts.map +1 -0
  130. package/dist/src/classes/callbacks/PostSlotUpdate.lua +17 -0
  131. package/dist/src/classes/callbacks/PostSpikesUpdate.d.ts +7 -0
  132. package/dist/src/classes/callbacks/PostSpikesUpdate.d.ts.map +1 -0
  133. package/dist/src/classes/callbacks/PostSpikesUpdate.lua +24 -0
  134. package/dist/src/classes/callbacks/PostTNTRender.d.ts +7 -0
  135. package/dist/src/classes/callbacks/PostTNTRender.d.ts.map +1 -0
  136. package/dist/src/classes/callbacks/PostTNTRender.lua +24 -0
  137. package/dist/src/classes/callbacks/PostTNTUpdate.d.ts +7 -0
  138. package/dist/src/classes/callbacks/PostTNTUpdate.d.ts.map +1 -0
  139. package/dist/src/classes/callbacks/PostTNTUpdate.lua +24 -0
  140. package/dist/src/classes/callbacks/PostTearInitLate.d.ts +12 -0
  141. package/dist/src/classes/callbacks/PostTearInitLate.d.ts.map +1 -0
  142. package/dist/src/classes/callbacks/PostTearInitLate.lua +27 -0
  143. package/dist/src/classes/callbacks/PostTearInitVeryLate.d.ts +12 -0
  144. package/dist/src/classes/callbacks/PostTearInitVeryLate.d.ts.map +1 -0
  145. package/dist/src/classes/callbacks/PostTearInitVeryLate.lua +30 -0
  146. package/dist/src/classes/callbacks/PostTransformation.d.ts +18 -0
  147. package/dist/src/classes/callbacks/PostTransformation.d.ts.map +1 -0
  148. package/dist/src/classes/callbacks/PostTransformation.lua +53 -0
  149. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts +1 -1
  150. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts.map +1 -1
  151. package/dist/src/classes/callbacks/PreBerserkDeath.lua +3 -4
  152. package/dist/src/classes/callbacks/PreItemPickup.d.ts +6 -0
  153. package/dist/src/classes/callbacks/PreItemPickup.d.ts.map +1 -0
  154. package/dist/src/classes/callbacks/PreItemPickup.lua +17 -0
  155. package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.d.ts +10 -0
  156. package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.d.ts.map +1 -0
  157. package/dist/src/classes/callbacks/validation/CustomCallbackCollectibleType.lua +19 -0
  158. package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.d.ts +11 -0
  159. package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.d.ts.map +1 -0
  160. package/dist/src/classes/callbacks/validation/CustomCallbackItemPickup.lua +22 -0
  161. package/dist/src/classes/callbacks/validation/CustomCallbackLaser.d.ts +10 -0
  162. package/dist/src/classes/callbacks/validation/CustomCallbackLaser.d.ts.map +1 -0
  163. package/dist/src/classes/callbacks/validation/CustomCallbackLaser.lua +19 -0
  164. package/dist/src/classes/callbacks/validation/{CustomCallbackRevive.d.ts → CustomCallbackNPC.d.ts} +4 -4
  165. package/dist/src/classes/callbacks/validation/CustomCallbackNPC.d.ts.map +1 -0
  166. package/dist/src/classes/callbacks/validation/CustomCallbackNPC.lua +22 -0
  167. package/dist/src/classes/callbacks/validation/CustomCallbackPickup.d.ts +12 -0
  168. package/dist/src/classes/callbacks/validation/CustomCallbackPickup.d.ts.map +1 -0
  169. package/dist/src/classes/callbacks/validation/CustomCallbackPickup.lua +22 -0
  170. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts +5 -2
  171. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts.map +1 -1
  172. package/dist/src/classes/callbacks/validation/CustomCallbackPoop.d.ts +10 -0
  173. package/dist/src/classes/callbacks/validation/CustomCallbackPoop.d.ts.map +1 -0
  174. package/dist/src/classes/callbacks/validation/CustomCallbackPoop.lua +20 -0
  175. package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.d.ts +10 -0
  176. package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.d.ts.map +1 -0
  177. package/dist/src/classes/callbacks/validation/CustomCallbackPressurePlate.lua +20 -0
  178. package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.d.ts +10 -0
  179. package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.d.ts.map +1 -0
  180. package/dist/src/classes/callbacks/validation/CustomCallbackProjectile.lua +19 -0
  181. package/dist/src/classes/callbacks/validation/CustomCallbackRock.d.ts +10 -0
  182. package/dist/src/classes/callbacks/validation/CustomCallbackRock.d.ts.map +1 -0
  183. package/dist/src/classes/callbacks/validation/CustomCallbackRock.lua +20 -0
  184. package/dist/src/classes/callbacks/validation/CustomCallbackSlot.d.ts +12 -0
  185. package/dist/src/classes/callbacks/validation/CustomCallbackSlot.d.ts.map +1 -0
  186. package/dist/src/classes/callbacks/validation/CustomCallbackSlot.lua +19 -0
  187. package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.lua +4 -4
  188. package/dist/src/classes/callbacks/validation/CustomCallbackTNT.d.ts +10 -0
  189. package/dist/src/classes/callbacks/validation/CustomCallbackTNT.d.ts.map +1 -0
  190. package/dist/src/classes/callbacks/validation/CustomCallbackTNT.lua +20 -0
  191. package/dist/src/classes/callbacks/validation/CustomCallbackTear.d.ts +10 -0
  192. package/dist/src/classes/callbacks/validation/CustomCallbackTear.d.ts.map +1 -0
  193. package/dist/src/classes/callbacks/validation/CustomCallbackTear.lua +19 -0
  194. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +1 -1
  195. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
  196. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +27 -30
  197. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts +2 -2
  198. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -1
  199. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +6 -6
  200. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
  201. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  202. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +3 -18
  203. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -1
  204. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts +12 -0
  205. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts.map +1 -0
  206. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.lua +33 -0
  207. package/dist/src/classes/features/callbackLogic/{GridEntityDetection.d.ts → GridEntityUpdateDetection.d.ts} +3 -3
  208. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -0
  209. package/dist/src/classes/features/callbackLogic/{GridEntityDetection.lua → GridEntityUpdateDetection.lua} +11 -14
  210. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts +20 -0
  211. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -0
  212. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.lua +60 -0
  213. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +47 -0
  214. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -0
  215. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +154 -0
  216. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts +18 -0
  217. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts.map +1 -0
  218. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.lua +51 -0
  219. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts +17 -0
  220. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts.map +1 -0
  221. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.lua +45 -0
  222. package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -1
  223. package/dist/src/classes/features/other/RunInNFrames.lua +9 -0
  224. package/dist/src/classes/features/other/SaveDataManager.d.ts +215 -0
  225. package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -0
  226. package/dist/src/classes/features/other/SaveDataManager.lua +190 -0
  227. package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.d.ts +6 -0
  228. package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.d.ts.map +1 -0
  229. package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.lua +98 -0
  230. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.d.ts +6 -0
  231. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.d.ts.map +1 -0
  232. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.lua +81 -0
  233. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.d.ts +7 -0
  234. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.d.ts.map +1 -0
  235. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +69 -0
  236. package/dist/src/classes/features/other/saveDataManager/saveToDisk.d.ts +5 -0
  237. package/dist/src/classes/features/other/saveDataManager/saveToDisk.d.ts.map +1 -0
  238. package/dist/src/classes/features/other/saveDataManager/saveToDisk.lua +46 -0
  239. package/dist/src/classes/private/CustomCallback.d.ts +2 -3
  240. package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
  241. package/dist/src/classes/private/CustomCallback.lua +2 -5
  242. package/dist/src/classes/private/Feature.d.ts +1 -0
  243. package/dist/src/classes/private/Feature.d.ts.map +1 -1
  244. package/dist/src/classes/private/Feature.lua +1 -0
  245. package/dist/src/core/upgradeMod.d.ts.map +1 -1
  246. package/dist/src/decorators.d.ts +1 -1
  247. package/dist/src/decorators.d.ts.map +1 -1
  248. package/dist/src/decorators.lua +6 -8
  249. package/dist/src/enums/ISCFeature.d.ts +15 -9
  250. package/dist/src/enums/ISCFeature.d.ts.map +1 -1
  251. package/dist/src/enums/ISCFeature.lua +30 -9
  252. package/dist/src/enums/ModCallbackCustom.d.ts +34 -20
  253. package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
  254. package/dist/src/enums/ModCallbackCustom2.d.ts +61 -20
  255. package/dist/src/enums/ModCallbackCustom2.d.ts.map +1 -1
  256. package/dist/src/enums/ModCallbackCustom2.lua +102 -20
  257. package/dist/src/enums/{private/SerializationBrand.d.ts → SerializationBrand.d.ts} +6 -1
  258. package/dist/src/enums/SerializationBrand.d.ts.map +1 -0
  259. package/dist/src/enums/{private/SerializationBrand.lua → SerializationBrand.lua} +1 -0
  260. package/dist/src/features/customItemPool.d.ts +52 -0
  261. package/dist/src/features/customItemPool.d.ts.map +1 -0
  262. package/dist/src/features/customItemPool.lua +111 -0
  263. package/dist/src/features/deployJSONRoom.d.ts +6 -4
  264. package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
  265. package/dist/src/features/deployJSONRoom.lua +6 -4
  266. package/dist/src/features/fadeInRemover.d.ts.map +1 -1
  267. package/dist/src/features/fadeInRemover.lua +4 -16
  268. package/dist/src/features/saveDataManager/exports.d.ts +14 -4
  269. package/dist/src/features/saveDataManager/exports.d.ts.map +1 -1
  270. package/dist/src/features/saveDataManager/exports.lua +38 -0
  271. package/dist/src/features/saveDataManager/load.d.ts +2 -1
  272. package/dist/src/features/saveDataManager/load.d.ts.map +1 -1
  273. package/dist/src/features/saveDataManager/load.lua +10 -4
  274. package/dist/src/features/saveDataManager/main.d.ts.map +1 -1
  275. package/dist/src/features/saveDataManager/main.lua +12 -5
  276. package/dist/src/features/saveDataManager/maps.d.ts +14 -0
  277. package/dist/src/features/saveDataManager/maps.d.ts.map +1 -1
  278. package/dist/src/features/saveDataManager/maps.lua +7 -0
  279. package/dist/src/features.d.ts +31 -12
  280. package/dist/src/features.d.ts.map +1 -1
  281. package/dist/src/features.lua +24 -6
  282. package/dist/src/functions/array.d.ts.map +1 -1
  283. package/dist/src/functions/array.lua +4 -5
  284. package/dist/src/functions/bitSet128.d.ts +2 -2
  285. package/dist/src/functions/bitSet128.lua +3 -3
  286. package/dist/src/functions/color.d.ts +2 -2
  287. package/dist/src/functions/color.lua +3 -3
  288. package/dist/src/functions/decorators.d.ts +21 -0
  289. package/dist/src/functions/decorators.d.ts.map +1 -1
  290. package/dist/src/functions/deepCopy.d.ts +11 -4
  291. package/dist/src/functions/deepCopy.d.ts.map +1 -1
  292. package/dist/src/functions/deepCopy.lua +84 -32
  293. package/dist/src/functions/deepCopyTests.lua +1 -1
  294. package/dist/src/functions/initArray.d.ts +4 -4
  295. package/dist/src/functions/initArray.d.ts.map +1 -1
  296. package/dist/src/functions/initArray.lua +6 -12
  297. package/dist/src/functions/jsonRoom.d.ts +11 -0
  298. package/dist/src/functions/jsonRoom.d.ts.map +1 -1
  299. package/dist/src/functions/jsonRoom.lua +11 -0
  300. package/dist/src/functions/kColor.d.ts +2 -2
  301. package/dist/src/functions/kColor.lua +3 -3
  302. package/dist/src/functions/merge.d.ts +40 -0
  303. package/dist/src/functions/merge.d.ts.map +1 -0
  304. package/dist/src/{features/saveDataManager → functions}/merge.lua +84 -37
  305. package/dist/src/functions/mergeTests.d.ts +1 -2
  306. package/dist/src/functions/mergeTests.d.ts.map +1 -1
  307. package/dist/src/functions/mergeTests.lua +3 -4
  308. package/dist/src/functions/rng.d.ts +2 -2
  309. package/dist/src/functions/rng.lua +3 -3
  310. package/dist/src/functions/serialization.d.ts.map +1 -1
  311. package/dist/src/functions/serialization.lua +22 -0
  312. package/dist/src/functions/tstlClass.d.ts +0 -10
  313. package/dist/src/functions/tstlClass.d.ts.map +1 -1
  314. package/dist/src/functions/tstlClass.lua +2 -42
  315. package/dist/src/functions/vector.d.ts +2 -2
  316. package/dist/src/functions/vector.lua +3 -3
  317. package/dist/src/functions/weighted.d.ts +12 -1
  318. package/dist/src/functions/weighted.d.ts.map +1 -1
  319. package/dist/src/functions/weighted.lua +27 -10
  320. package/dist/src/index.d.ts +5 -0
  321. package/dist/src/index.d.ts.map +1 -1
  322. package/dist/src/index.lua +24 -0
  323. package/dist/src/interfaces/SaveData.d.ts +3 -7
  324. package/dist/src/interfaces/SaveData.d.ts.map +1 -1
  325. package/dist/src/interfaces/SaveData.lua +0 -11
  326. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts +195 -2
  327. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts.map +1 -1
  328. package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts +1 -1
  329. package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
  330. package/dist/src/objects/isaacAPIClassTypeToBrand.lua +1 -1
  331. package/dist/src/types/AnyClass.d.ts +2 -0
  332. package/dist/src/types/AnyClass.d.ts.map +1 -0
  333. package/dist/src/types/AnyClass.lua +2 -0
  334. package/dist/src/types/AnyFunction.d.ts +6 -0
  335. package/dist/src/types/AnyFunction.d.ts.map +1 -0
  336. package/dist/src/types/AnyFunction.lua +2 -0
  337. package/dist/src/types/FunctionTuple.d.ts +2 -4
  338. package/dist/src/types/FunctionTuple.d.ts.map +1 -1
  339. package/dist/src/types/HasFunction.d.ts +5 -0
  340. package/dist/src/types/HasFunction.d.ts.map +1 -0
  341. package/dist/src/types/HasFunction.lua +2 -0
  342. package/package.json +1 -1
  343. package/src/callbacks.ts +88 -5
  344. package/src/classes/ModFeature.ts +31 -1
  345. package/src/classes/ModUpgraded.ts +49 -21
  346. package/src/classes/callbacks/PostCustomRevive.ts +22 -2
  347. package/src/classes/callbacks/PostGridEntityBroken.ts +1 -1
  348. package/src/classes/callbacks/PostGridEntityCollision.ts +1 -1
  349. package/src/classes/callbacks/PostGridEntityCustomBroken.ts +1 -1
  350. package/src/classes/callbacks/PostGridEntityCustomCollision.ts +1 -1
  351. package/src/classes/callbacks/PostGridEntityCustomInit.ts +1 -1
  352. package/src/classes/callbacks/PostGridEntityCustomRemove.ts +1 -1
  353. package/src/classes/callbacks/PostGridEntityCustomRender.ts +11 -0
  354. package/src/classes/callbacks/PostGridEntityCustomStateChanged.ts +1 -1
  355. package/src/classes/callbacks/PostGridEntityCustomUpdate.ts +1 -1
  356. package/src/classes/callbacks/PostGridEntityInit.ts +1 -1
  357. package/src/classes/callbacks/PostGridEntityRemove.ts +1 -1
  358. package/src/classes/callbacks/PostGridEntityRender.ts +11 -0
  359. package/src/classes/callbacks/PostGridEntityStateChanged.ts +1 -1
  360. package/src/classes/callbacks/PostGridEntityUpdate.ts +1 -1
  361. package/src/classes/callbacks/PostHolyMantleRemoved.ts +5 -8
  362. package/src/classes/callbacks/PostItemDischarge.ts +181 -0
  363. package/src/classes/callbacks/PostItemPickup.ts +11 -0
  364. package/src/classes/callbacks/PostLaserInitLate.ts +28 -0
  365. package/src/classes/callbacks/PostNPCInitLate.ts +28 -0
  366. package/src/classes/callbacks/PostNPCStateChanged.ts +37 -0
  367. package/src/classes/callbacks/PostPickupCollect.ts +37 -0
  368. package/src/classes/callbacks/PostPickupInitFirst.ts +34 -0
  369. package/src/classes/callbacks/PostPickupInitLate.ts +28 -0
  370. package/src/classes/callbacks/PostPickupStateChanged.ts +35 -0
  371. package/src/classes/callbacks/PostPitUpdate.ts +21 -0
  372. package/src/classes/callbacks/PostPlayerChangeHealth.ts +57 -0
  373. package/src/classes/callbacks/PostPlayerChangeStat.ts +102 -0
  374. package/src/classes/callbacks/PostPlayerChangeType.ts +44 -0
  375. package/src/classes/callbacks/PostPlayerCollectibleAdded.ts +11 -0
  376. package/src/classes/callbacks/PostPlayerCollectibleRemoved.ts +11 -0
  377. package/src/classes/callbacks/PostPlayerInitFirst.ts +44 -0
  378. package/src/classes/callbacks/PostPlayerInitLate.ts +32 -0
  379. package/src/classes/callbacks/PostPoopRender.ts +21 -0
  380. package/src/classes/callbacks/PostPoopUpdate.ts +21 -0
  381. package/src/classes/callbacks/PostPressurePlateRender.ts +21 -0
  382. package/src/classes/callbacks/PostPressurePlateUpdate.ts +21 -0
  383. package/src/classes/callbacks/PostProjectileInitLate.ts +28 -0
  384. package/src/classes/callbacks/PostPurchase.ts +87 -0
  385. package/src/classes/callbacks/PostRockRender.ts +21 -0
  386. package/src/classes/callbacks/PostRockUpdate.ts +21 -0
  387. package/src/classes/callbacks/PostSacrifice.ts +89 -0
  388. package/src/classes/callbacks/PostSlotAnimationChanged.ts +11 -0
  389. package/src/classes/callbacks/PostSlotCollision.ts +26 -0
  390. package/src/classes/callbacks/PostSlotDestroyed.ts +79 -0
  391. package/src/classes/callbacks/PostSlotInit.ts +11 -0
  392. package/src/classes/callbacks/PostSlotRender.ts +11 -0
  393. package/src/classes/callbacks/PostSlotUpdate.ts +11 -0
  394. package/src/classes/callbacks/PostSpikesUpdate.ts +21 -0
  395. package/src/classes/callbacks/PostTNTRender.ts +21 -0
  396. package/src/classes/callbacks/PostTNTUpdate.ts +21 -0
  397. package/src/classes/callbacks/PostTearInitLate.ts +28 -0
  398. package/src/classes/callbacks/PostTearInitVeryLate.ts +33 -0
  399. package/src/classes/callbacks/PostTransformation.ts +71 -0
  400. package/src/classes/callbacks/PreBerserkDeath.ts +5 -8
  401. package/src/classes/callbacks/PreItemPickup.ts +11 -0
  402. package/src/classes/callbacks/validation/CustomCallbackCollectibleType.ts +32 -0
  403. package/src/classes/callbacks/validation/CustomCallbackItemPickup.ts +48 -0
  404. package/src/classes/callbacks/validation/CustomCallbackLaser.ts +27 -0
  405. package/src/classes/callbacks/validation/CustomCallbackNPC.ts +34 -0
  406. package/src/classes/callbacks/validation/CustomCallbackPickup.ts +41 -0
  407. package/src/classes/callbacks/validation/CustomCallbackPlayer.ts +25 -2
  408. package/src/classes/callbacks/validation/CustomCallbackPoop.ts +28 -0
  409. package/src/classes/callbacks/validation/CustomCallbackPressurePlate.ts +31 -0
  410. package/src/classes/callbacks/validation/CustomCallbackProjectile.ts +28 -0
  411. package/src/classes/callbacks/validation/CustomCallbackRock.ts +30 -0
  412. package/src/classes/callbacks/validation/CustomCallbackSlot.ts +37 -0
  413. package/src/classes/callbacks/validation/CustomCallbackSpikes.ts +4 -4
  414. package/src/classes/callbacks/validation/CustomCallbackTNT.ts +28 -0
  415. package/src/classes/callbacks/validation/CustomCallbackTear.ts +27 -0
  416. package/src/classes/features/callbackLogic/CustomGridEntities.ts +32 -36
  417. package/src/classes/features/callbackLogic/CustomRevive.ts +14 -21
  418. package/src/classes/features/callbackLogic/EsauJrDetection.ts +0 -4
  419. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +7 -9
  420. package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +0 -4
  421. package/src/classes/features/callbackLogic/GridEntityRenderDetection.ts +42 -0
  422. package/src/classes/features/callbackLogic/{GridEntityDetection.ts → GridEntityUpdateDetection.ts} +4 -20
  423. package/src/classes/features/callbackLogic/ItemPickupDetection.ts +91 -0
  424. package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +245 -0
  425. package/src/classes/features/callbackLogic/SlotRenderDetection.ts +64 -0
  426. package/src/classes/features/callbackLogic/SlotUpdateDetection.ts +57 -0
  427. package/src/classes/features/other/RunInNFrames.ts +7 -0
  428. package/src/classes/features/other/SaveDataManager.ts +492 -0
  429. package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +138 -0
  430. package/src/classes/features/other/saveDataManager/loadFromDisk.ts +99 -0
  431. package/src/classes/features/other/saveDataManager/restoreDefaults.ts +116 -0
  432. package/src/classes/features/other/saveDataManager/saveToDisk.ts +70 -0
  433. package/src/classes/private/CustomCallback.ts +2 -6
  434. package/src/classes/private/Feature.ts +1 -0
  435. package/src/core/upgradeMod.ts +2 -4
  436. package/src/decorators.ts +17 -19
  437. package/src/enums/ISCFeature.ts +44 -39
  438. package/src/enums/ModCallbackCustom.ts +34 -20
  439. package/src/enums/ModCallbackCustom2.ts +53 -5
  440. package/src/enums/{private/SerializationBrand.ts → SerializationBrand.ts} +8 -2
  441. package/src/features/customItemPool.ts +133 -0
  442. package/src/features/deployJSONRoom.ts +6 -4
  443. package/src/features/fadeInRemover.ts +4 -22
  444. package/src/features/saveDataManager/exports.ts +62 -3
  445. package/src/features/saveDataManager/load.ts +4 -1
  446. package/src/features/saveDataManager/main.ts +5 -3
  447. package/src/features/saveDataManager/maps.ts +16 -0
  448. package/src/features.ts +39 -4
  449. package/src/functions/array.ts +8 -9
  450. package/src/functions/bitSet128.ts +3 -3
  451. package/src/functions/color.ts +3 -3
  452. package/src/functions/decorators.ts +22 -0
  453. package/src/functions/deepCopy.ts +83 -17
  454. package/src/functions/deepCopyTests.ts +1 -1
  455. package/src/functions/initArray.ts +6 -11
  456. package/src/functions/jsonRoom.ts +11 -0
  457. package/src/functions/kColor.ts +3 -3
  458. package/src/{features/saveDataManager → functions}/merge.ts +79 -45
  459. package/src/functions/mergeTests.ts +2 -3
  460. package/src/functions/rng.ts +3 -3
  461. package/src/functions/serialization.ts +25 -1
  462. package/src/functions/table.ts +1 -1
  463. package/src/functions/tstlClass.ts +3 -57
  464. package/src/functions/vector.ts +3 -3
  465. package/src/functions/weighted.ts +28 -11
  466. package/src/index.ts +5 -0
  467. package/src/interfaces/SaveData.ts +3 -34
  468. package/src/interfaces/private/AddCallbackParametersCustom2.ts +298 -7
  469. package/src/objects/isaacAPIClassTypeToBrand.ts +1 -1
  470. package/src/types/AnyClass.ts +1 -0
  471. package/src/types/AnyFunction.ts +5 -0
  472. package/src/types/FunctionTuple.ts +3 -4
  473. package/src/types/HasFunction.ts +7 -0
  474. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.d.ts.map +0 -1
  475. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.lua +0 -19
  476. package/dist/src/classes/features/callbackLogic/GridEntityDetection.d.ts.map +0 -1
  477. package/dist/src/enums/private/SerializationBrand.d.ts.map +0 -1
  478. package/dist/src/features/saveDataManager/merge.d.ts +0 -26
  479. package/dist/src/features/saveDataManager/merge.d.ts.map +0 -1
  480. package/dist/src/features/saveDataManager/serializationBrands.d.ts +0 -2
  481. package/dist/src/features/saveDataManager/serializationBrands.d.ts.map +0 -1
  482. package/dist/src/features/saveDataManager/serializationBrands.lua +0 -19
  483. package/dist/src/indexLua.d.ts +0 -199
  484. package/dist/src/indexLua.d.ts.map +0 -1
  485. package/dist/src/indexLua.lua +0 -1354
  486. package/src/classes/callbacks/validation/CustomCallbackRevive.ts +0 -27
  487. package/src/features/saveDataManager/serializationBrands.ts +0 -16
package/dist/index.d.ts CHANGED
@@ -293,6 +293,10 @@ declare interface AddCallbackParametersCustom2 {
293
293
  callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
294
294
  gridEntityTypeCustom?: GridEntityType
295
295
  ];
296
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_RENDER]: [
297
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
298
+ gridEntityTypeCustom?: GridEntityType
299
+ ];
296
300
  [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED]: [
297
301
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void,
298
302
  gridEntityTypeCustom?: GridEntityType
@@ -311,6 +315,11 @@ declare interface AddCallbackParametersCustom2 {
311
315
  gridEntityType?: GridEntityType,
312
316
  variant?: int
313
317
  ];
318
+ [ModCallbackCustom2.POST_GRID_ENTITY_RENDER]: [
319
+ callback: (gridEntity: GridEntity) => void,
320
+ gridEntityType?: GridEntityType,
321
+ variant?: int
322
+ ];
314
323
  [ModCallbackCustom2.POST_GRID_ENTITY_STATE_CHANGED]: [
315
324
  callback: (gridEntity: GridEntity, oldState: int, newState: int) => void,
316
325
  gridEntityType?: GridEntityType,
@@ -326,27 +335,110 @@ declare interface AddCallbackParametersCustom2 {
326
335
  playerVariant?: PlayerVariant,
327
336
  character?: PlayerType
328
337
  ];
329
- [ModCallbackCustom2.POST_NEW_LEVEL_REORDERED]: [callback: () => void];
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
+ ];
330
351
  [ModCallbackCustom2.POST_KNIFE_INIT_LATE]: [
331
352
  callback: (knife: EntityKnife) => void,
332
353
  knifeVariant?: KnifeVariant
333
354
  ];
355
+ [ModCallbackCustom2.POST_LASER_INIT_LATE]: [
356
+ callback: (laser: EntityLaser) => void,
357
+ laserVariant?: LaserVariant
358
+ ];
359
+ [ModCallbackCustom2.POST_NEW_LEVEL_REORDERED]: [callback: () => void];
334
360
  [ModCallbackCustom2.POST_NEW_ROOM_EARLY]: [callback: () => void];
335
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
+ ];
336
372
  [ModCallbackCustom2.POST_PEFFECT_UPDATE_REORDERED]: [
337
373
  callback: (player: EntityPlayer) => void,
338
374
  playerVariant?: PlayerVariant,
339
375
  character?: PlayerType
340
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
+ ];
341
397
  [ModCallbackCustom2.POST_PIT_RENDER]: [
342
398
  callback: (pit: GridEntityPit) => void,
343
399
  pitVariant?: PitVariant
344
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
+ ];
345
427
  [ModCallbackCustom2.POST_PLAYER_FATAL_DAMAGE]: [
346
428
  callback: (player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined,
347
429
  playerVariant?: PlayerVariant,
348
430
  character?: PlayerType
349
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
+ ];
350
442
  [ModCallbackCustom2.POST_PLAYER_RENDER_REORDERED]: [
351
443
  callback: (player: EntityPlayer) => void,
352
444
  playerVariant?: PlayerVariant,
@@ -357,14 +449,101 @@ declare interface AddCallbackParametersCustom2 {
357
449
  playerVariant?: PlayerVariant,
358
450
  character?: PlayerType
359
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
+ ];
360
485
  [ModCallbackCustom2.POST_ROOM_CLEAR_CHANGED]: [
361
486
  callback: (roomClear: boolean) => void,
362
487
  roomClear?: boolean
363
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
+ ];
364
519
  [ModCallbackCustom2.POST_SPIKES_RENDER]: [
365
520
  callback: (spikes: GridEntitySpikes) => void,
366
521
  variant?: int
367
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
+ ];
368
547
  [ModCallbackCustom2.PRE_BERSERK_DEATH]: [
369
548
  callback: (player: EntityPlayer) => void,
370
549
  playerVariant?: PlayerVariant,
@@ -375,6 +554,15 @@ declare interface AddCallbackParametersCustom2 {
375
554
  playerVariant?: PlayerVariant,
376
555
  character?: PlayerType
377
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
+ ];
378
566
  }
379
567
 
380
568
  /**
@@ -564,6 +752,8 @@ export declare enum AmbushType {
564
752
  */
565
753
  export declare function angleToDirection(angleDegrees: int): Direction;
566
754
 
755
+ declare type AnyClass = new (...args: readonly unknown[]) => unknown;
756
+
567
757
  /**
568
758
  * A type union that matches `Entity`, `EntityBomb`, `EntityEffect`, and so on.
569
759
  *
@@ -573,6 +763,12 @@ export declare type AnyEntity = Entity | EntityBomb | EntityEffect | EntityFamil
573
763
 
574
764
  export declare function anyEntityCloserThan(entities: Entity[], position: Vector, distance: int): boolean;
575
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
+
576
772
  /**
577
773
  * A type union that matches `GridEntity`, `GridEntityDoor`, `GridEntityPit`, and so on.
578
774
  *
@@ -844,13 +1040,17 @@ export declare function Callback<T extends ModCallback>(modCallback: T, ...optio
844
1040
  */
845
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;
846
1042
 
1043
+ declare type CallbackSignatureCollectibleType = (player: EntityPlayer, collectibleType: CollectibleType) => void;
1044
+
847
1045
  declare type CallbackSignatureGridEntity = ((gridEntity: GridEntity) => void) | ((gridEntity: GridEntity, oldState: int, newState: int) => void);
848
1046
 
849
1047
  declare type CallbackSignatureGridEntityCustom = ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void) | ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void);
850
1048
 
851
- declare type CallbackSignaturePlayer = ((player: EntityPlayer) => void) | ((player: EntityPlayer) => int | undefined) | ((player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined);
1049
+ declare type CallbackSignatureItemPickup = ((player: EntityPlayer, pickingUpItem: PickingUpItem) => void) | ((player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void) | ((player: EntityPlayer, pickingUpItem: PickingUpItemTrinket) => void);
1050
+
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);
852
1052
 
853
- declare type CallbackSignatureRevive = (player: EntityPlayer, revivalType: int) => void;
1053
+ declare type CallbackSignatureSlot = ((slot: EntitySlot) => void) | ((slot: EntitySlot, slotDestructionType: SlotDestructionType) => void) | ((slot: EntitySlot, player: EntityPlayer) => void) | ((slot: EntitySlot, previousAnimation: string, currentAnimation: string) => void);
854
1054
 
855
1055
  /**
856
1056
  * A mapping of the callback enum to the associated callback functions (and optional arguments).
@@ -1273,13 +1473,12 @@ export declare const CUSTOM_FLOOR_STAGE_TYPE = StageType.WRATH_OF_THE_LAMB;
1273
1473
  */
1274
1474
  declare abstract class CustomCallback<T extends ModCallbackCustom2> extends Feature {
1275
1475
  private subscriptions;
1276
- hasSubscriptions(): boolean;
1277
- add(...args: AddCallbackParametersCustom2[T]): void;
1476
+ addSubscriber(...args: AddCallbackParametersCustom2[T]): void;
1278
1477
  /**
1279
1478
  * If the submitted function does not match any of the existing subscriptions, this method will do
1280
1479
  * nothing.
1281
1480
  */
1282
- remove(callback: AddCallbackParametersCustom2[T][0]): void;
1481
+ removeSubscriber(callback: AddCallbackParametersCustom2[T][0]): void;
1283
1482
  fire: (...fireArgs: FireArgs<T>) => ReturnType<AddCallbackParametersCustom2[T][0]>;
1284
1483
  /**
1285
1484
  * This method needs to be overwritten for any callback that has optional filtration arguments.
@@ -1287,6 +1486,10 @@ declare abstract class CustomCallback<T extends ModCallbackCustom2> extends Feat
1287
1486
  protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1288
1487
  }
1289
1488
 
1489
+ declare class CustomCallbackCollectibleType<T extends ModCallbackCustomCollectibleType> extends CustomCallback<T> {
1490
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1491
+ }
1492
+
1290
1493
  declare class CustomCallbackGridEntity<T extends ModCallbackCustomGridEntity> extends CustomCallback<T> {
1291
1494
  protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1292
1495
  }
@@ -1295,11 +1498,15 @@ declare class CustomCallbackGridEntityCustom<T extends ModCallbackCustomGridEnti
1295
1498
  protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1296
1499
  }
1297
1500
 
1501
+ declare class CustomCallbackItemPickup<T extends ModCallbackCustomItemPickup> extends CustomCallback<T> {
1502
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1503
+ }
1504
+
1298
1505
  declare class CustomCallbackPlayer<T extends ModCallbackCustomPlayer> extends CustomCallback<T> {
1299
1506
  protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1300
1507
  }
1301
1508
 
1302
- declare class CustomCallbackRevive<T extends ModCallbackCustomRevive> extends CustomCallback<T> {
1509
+ declare class CustomCallbackSlot<T extends ModCallbackCustomSlot> extends CustomCallback<T> {
1303
1510
  protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1304
1511
  }
1305
1512
 
@@ -1325,8 +1532,8 @@ declare class CustomGridEntities extends Feature {
1325
1532
  };
1326
1533
  private runInNFrames;
1327
1534
  constructor(runInNFrames: RunInNFrames);
1535
+ private postNewRoom;
1328
1536
  private preUseItemWeNeedToGoDeeper;
1329
- private postNewRoomReordered;
1330
1537
  /**
1331
1538
  * Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
1332
1539
  * will reappear if the player leaves and re-enters the room. (It will be manually respawned in
@@ -1453,9 +1660,9 @@ declare class CustomRevive extends Feature {
1453
1660
  private postCustomRevive;
1454
1661
  constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive);
1455
1662
  private postRender;
1456
- private postNewRoomReordered;
1457
- private postPEffectUpdateReordered;
1663
+ private postPEffectUpdate;
1458
1664
  private checkWaitingForItemAnimation;
1665
+ private postNewRoom;
1459
1666
  private postPlayerFatalDamage;
1460
1667
  private preBerserkDeath;
1461
1668
  /**
@@ -2011,14 +2218,19 @@ export declare interface CustomStageTSConfig {
2011
2218
  * @param serializationType Optional. Has 3 possible values. Can copy objects as-is, or can
2012
2219
  * serialize objects to Lua tables, or can deserialize Lua tables to
2013
2220
  * objects. Default is `SerializationType.NONE`.
2014
- * @param traversalDescription Optional. Used to track the current key that we are operating on.
2015
- * 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.
2016
2228
  * @param insideMap Optional. Tracks whether or not the deep copy function is in the process of
2017
2229
  * recursively copying a TSTL Map. Default is false.
2018
2230
  */
2019
- 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;
2020
2232
 
2021
- 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;
2022
2234
 
2023
2235
  export declare const DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2;
2024
2236
 
@@ -2189,8 +2401,9 @@ export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: A
2189
2401
  * Specifically, this will clear the current room of all entities and grid entities, and then spawn
2190
2402
  * all of the entries and grid entities in the provided JSON room.
2191
2403
  *
2192
- * You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
2193
- * my-rooms.xml`).
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`).
2194
2407
  *
2195
2408
  * This function is meant to be used in the `POST_NEW_ROOM` callback.
2196
2409
  *
@@ -2219,8 +2432,9 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
2219
2432
  * Specifically, this will clear the current room of all entities and grid entities, and then spawn
2220
2433
  * all of the entries and grid entities in one of the provided JSON rooms.
2221
2434
  *
2222
- * You can create JSON rooms by using the `convert-xml-to-json` tool (e.g. `npx convert-xml-to-json
2223
- * my-rooms.xml`).
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`).
2224
2438
  *
2225
2439
  * This function is meant to be used in the `POST_NEW_ROOM` callback.
2226
2440
  *
@@ -2602,8 +2816,6 @@ export declare function enableFastReset(): void;
2602
2816
  */
2603
2817
  export declare function eRange(start: int, end?: int, increment?: number): int[];
2604
2818
 
2605
- 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";
2606
-
2607
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";
2608
2820
 
2609
2821
  declare class EsauJrDetection extends Feature {
@@ -2653,6 +2865,7 @@ export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args)
2653
2865
  */
2654
2866
  declare class Feature {
2655
2867
  initialized: boolean;
2868
+ numConsumers: number;
2656
2869
  v?: SaveData;
2657
2870
  featuresUsed?: ISCFeature[];
2658
2871
  callbacksUsed?: CallbackTuple[];
@@ -2823,10 +3036,7 @@ export declare function forgottenSwitch(): void;
2823
3036
 
2824
3037
  declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
2825
3038
 
2826
- export declare type FunctionTuple = [
2827
- name: string,
2828
- func: (...args: unknown[]) => unknown
2829
- ];
3039
+ export declare type FunctionTuple = [name: string, func: AnyFunction];
2830
3040
 
2831
3041
  /**
2832
3042
  * A cached version of the class returned from the `Game()` constructor.
@@ -3517,6 +3727,24 @@ data: GridEntityCustomData
3517
3727
  */
3518
3728
  export declare function getCustomGridEntityType(gridEntityOrGridIndex: GridEntity | int): GridEntityType | undefined;
3519
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
+
3520
3748
  /**
3521
3749
  * Helper function to get a set containing all of the global variable names that are contained
3522
3750
  * within the Isaac environment by default.
@@ -4013,12 +4241,16 @@ export declare function getItemConfigCardType(cardType: CardType): ItemConfigCar
4013
4241
  /**
4014
4242
  * Helper function to calculate what the resulting `BitFlags<DoorSlotFlag>` value would be for a
4015
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.)
4016
4246
  */
4017
4247
  export declare function getJSONRoomDoorSlotFlags(jsonRoom: JSONRoom): BitFlags<DoorSlotFlag>;
4018
4248
 
4019
4249
  /**
4020
4250
  * Helper function to find a specific room from an array of JSON rooms.
4021
4251
  *
4252
+ * (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
4253
+ *
4022
4254
  * @param jsonRooms The array of rooms to search through.
4023
4255
  * @param variant The room variant to select. (The room variant can be thought of as the ID of the
4024
4256
  * room.)
@@ -4028,6 +4260,8 @@ export declare function getJSONRoomOfVariant(jsonRooms: JSONRoom[] | readonly JS
4028
4260
  /**
4029
4261
  * Helper function to find all of the JSON rooms that match the sub-type provided.
4030
4262
  *
4263
+ * (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
4264
+ *
4031
4265
  * @param jsonRooms The array of rooms to search through.
4032
4266
  * @param subType The sub-type to match.
4033
4267
  */
@@ -5069,9 +5303,20 @@ export declare function getRandomEnumValue<T>(transpiledEnum: T, seedOrRNG?: See
5069
5303
  */
5070
5304
  export declare function getRandomFloat(min: int, max: int, seedOrRNG?: Seed | RNG): float;
5071
5305
 
5072
- /** Get a random value from a `WeightedArray`. (The second element in the array is the weight.) */
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
+ */
5073
5311
  export declare function getRandomFromWeightedArray<T>(weightedArray: WeightedArray<T>, seedOrRNG?: Seed | RNG): T;
5074
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
+
5075
5320
  /**
5076
5321
  * This returns a random integer between min and max. It is inclusive on both ends.
5077
5322
  *
@@ -5098,6 +5343,9 @@ export declare function getRandomInt(min: int, max: int, seedOrRNG?: Seed | RNG,
5098
5343
  /**
5099
5344
  * Helper function to get a random JSON entity from an array of JSON entities.
5100
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
+ *
5101
5349
  * Note that this function does not simply choose a random element in the provided array; it will
5102
5350
  * properly account for each room weight using the algorithm from:
5103
5351
  * https://stackoverflow.com/questions/1761626/weighted-random-numbers
@@ -5113,6 +5361,8 @@ export declare function getRandomJSONEntity(jsonEntities: JSONEntity[], seedOrRN
5113
5361
  /**
5114
5362
  * Helper function to get a random JSON room from an array of JSON rooms.
5115
5363
  *
5364
+ * (A JSON room is an XML file converted to JSON so that it can be directly imported into your mod.)
5365
+ *
5116
5366
  * Note that this function does not simply choose a random element in the provided array; it will
5117
5367
  * properly account for each room weight using the algorithm from:
5118
5368
  * https://stackoverflow.com/questions/1761626/weighted-random-numbers
@@ -6045,7 +6295,21 @@ export declare interface GridEntityCustomData {
6045
6295
  defaultAnimation?: string;
6046
6296
  }
6047
6297
 
6048
- declare class GridEntityDetection extends Feature {
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 {
6049
6313
  v: {
6050
6314
  room: {
6051
6315
  /** Indexed by grid index. */
@@ -6069,15 +6333,9 @@ declare class GridEntityDetection extends Feature {
6069
6333
  private checkGridEntityStateChanged;
6070
6334
  private checkNewGridEntity;
6071
6335
  private updateTupleInMap;
6072
- private postNewRoomReordered;
6336
+ private postNewRoom;
6073
6337
  }
6074
6338
 
6075
- declare type GridEntityTuple = [
6076
- gridEntityType: GridEntityType,
6077
- variant: int,
6078
- state: int
6079
- ];
6080
-
6081
6339
  /**
6082
6340
  * Helper function to convert a grid index to a grid position.
6083
6341
  *
@@ -6153,13 +6411,14 @@ export declare function hasFlyingTemporaryEffect(player: EntityPlayer): boolean;
6153
6411
 
6154
6412
  export declare function hasFlyingTransformation(player: EntityPlayer): boolean;
6155
6413
 
6156
- /** After touching a white fire, a player will turn into The Lost until they clear a room. */
6157
- export declare function hasLostCurse(player: EntityPlayer): boolean;
6158
-
6159
- 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 {
6160
6416
  [K in keyof T as T[K] extends Function ? K : never]-?: 1;
6161
6417
  } ? never : T;
6162
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
+
6163
6422
  /**
6164
6423
  * Returns whether or not the player can hold an additional active item, beyond what they are
6165
6424
  * currently carrying. This takes the Schoolbag into account.
@@ -6328,10 +6587,10 @@ export declare function inHomeCloset(): boolean;
6328
6587
  /**
6329
6588
  * Initializes an array with all of the elements containing the specified default value.
6330
6589
  *
6331
- * If the provided default value is not a boolean, number, or string, then it will be copied with
6332
- * the `deepCopy` function before adding it to the new array. In this way, you can initialize an
6333
- * array of arrays, or an array of maps, and so on. (If the `deepCopy` function was not used, then
6334
- * all of the array elements would just be references to the same underlying data structure.)
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.)
6335
6594
  *
6336
6595
  * For example:
6337
6596
  *
@@ -6568,15 +6827,21 @@ export declare function isCardPickup(pickup: EntityPickup): pickup is EntityPick
6568
6827
  export declare function isCardType(cardType: CardType, itemConfigCardType: ItemConfigCardType): boolean;
6569
6828
 
6570
6829
  export declare enum ISCFeature {
6571
- CUSTOM_REVIVE = "CustomRevive",
6572
- ESAU_JR_DETECTION = "EsauJrDetection",
6573
- FLIP_DETECTION = "FlipDetection",
6574
- GRID_ENTITY_COLLISION_DETECTION = "GridEntityCollisionDetection",
6575
- GRID_ENTITY_DETECTION = "GridEntityDetection",
6576
- GAME_REORDERED_CALLBACKS = "GameReorderedCallbacks",
6577
- PLAYER_REORDERED_CALLBACKS = "PlayerReorderedCallbacks",
6578
- CUSTOM_GRID_ENTITIES = "CustomGridEntities",
6579
- RUN_IN_N_FRAMES = "runInNFrames"
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
6580
6845
  }
6581
6846
 
6582
6847
  declare interface ISCFeatureToClass {
@@ -6584,11 +6849,17 @@ declare interface ISCFeatureToClass {
6584
6849
  [ISCFeature.ESAU_JR_DETECTION]: EsauJrDetection;
6585
6850
  [ISCFeature.FLIP_DETECTION]: FlipDetection;
6586
6851
  [ISCFeature.GRID_ENTITY_COLLISION_DETECTION]: GridEntityCollisionDetection;
6587
- [ISCFeature.GRID_ENTITY_DETECTION]: GridEntityDetection;
6852
+ [ISCFeature.GRID_ENTITY_RENDER_DETECTION]: GridEntityRenderDetection;
6853
+ [ISCFeature.GRID_ENTITY_UPDATE_DETECTION]: GridEntityUpdateDetection;
6588
6854
  [ISCFeature.GAME_REORDERED_CALLBACKS]: GameReorderedCallbacks;
6855
+ [ISCFeature.ITEM_PICKUP_DETECTION]: ItemPickupDetection;
6856
+ [ISCFeature.PLAYER_COLLECTIBLE_DETECTION]: PlayerCollectibleDetection;
6589
6857
  [ISCFeature.PLAYER_REORDERED_CALLBACKS]: PlayerReorderedCallbacks;
6858
+ [ISCFeature.SLOT_RENDER_DETECTION]: SlotRenderDetection;
6859
+ [ISCFeature.SLOT_UPDATE_DETECTION]: SlotUpdateDetection;
6590
6860
  [ISCFeature.CUSTOM_GRID_ENTITIES]: CustomGridEntities;
6591
6861
  [ISCFeature.RUN_IN_N_FRAMES]: RunInNFrames;
6862
+ [ISCFeature.SAVE_DATA_MANAGER]: SaveDataManager;
6592
6863
  }
6593
6864
 
6594
6865
  /**
@@ -6878,12 +7149,6 @@ export declare function isIsaacAPIClass(object: unknown): object is IsaacAPIClas
6878
7149
 
6879
7150
  export declare function isIsaacAPIClassOfType(object: unknown, classType: string): boolean;
6880
7151
 
6881
- /**
6882
- * Returns whether or not this is a class that is provided by the `isaacscript-common` library, such
6883
- * as a `DefaultMap`.
6884
- */
6885
- export declare function isIsaacScriptCommonClass(object: unknown): boolean;
6886
-
6887
7152
  /**
6888
7153
  * Helper function for detecting when a player is Jacob or Esau. This will only match the
6889
7154
  * non-tainted versions of these characters.
@@ -7134,14 +7399,14 @@ export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
7134
7399
  export declare function isSelfDamage(damageFlags: DamageFlag | BitFlags<DamageFlag>): boolean;
7135
7400
 
7136
7401
  /**
7137
- * Used to determine is the given table is a serialized `BitSet128` object created by the save data
7138
- * manager and/or the `deepCopy` function.
7402
+ * Used to determine is the given table is a serialized `BitSet128` object created by the `deepCopy`
7403
+ * function.
7139
7404
  */
7140
7405
  export declare function isSerializedBitSet128(object: unknown): object is SerializedBitSet128;
7141
7406
 
7142
7407
  /**
7143
- * Used to determine is the given table is a serialized `Color` object created by the save data
7144
- * manager and/or the `deepCopy` function.
7408
+ * Used to determine is the given table is a serialized `Color` object created by the `deepCopy`
7409
+ * function.
7145
7410
  */
7146
7411
  export declare function isSerializedColor(object: unknown): object is SerializedColor;
7147
7412
 
@@ -7154,20 +7419,20 @@ export declare function isSerializedColor(object: unknown): object is Serialized
7154
7419
  export declare function isSerializedIsaacAPIClass(object: unknown): object is SerializedIsaacAPIClass;
7155
7420
 
7156
7421
  /**
7157
- * Used to determine is the given table is a serialized `KColor` object created by the save data
7158
- * manager and/or the `deepCopy` function.
7422
+ * Used to determine is the given table is a serialized `KColor` object created by the `deepCopy`
7423
+ * function.
7159
7424
  */
7160
7425
  export declare function isSerializedKColor(object: unknown): object is SerializedKColor;
7161
7426
 
7162
7427
  /**
7163
- * Used to determine is the given table is a serialized `RNG` object created by the save data
7164
- * manager and/or the `deepCopy` function.
7428
+ * Used to determine is the given table is a serialized `RNG` object created by the `deepCopy`
7429
+ * function.
7165
7430
  */
7166
7431
  export declare function isSerializedRNG(object: unknown): object is SerializedRNG;
7167
7432
 
7168
7433
  /**
7169
- * Used to determine is the given table is a serialized `Vector` object created by the save data
7170
- * manager and/or the `deepCopy` function.
7434
+ * Used to determine is the given table is a serialized `Vector` object created by the `deepCopy`
7435
+ * function.
7171
7436
  */
7172
7437
  export declare function isSerializedVector(object: unknown): object is SerializedVector;
7173
7438
 
@@ -7316,12 +7581,6 @@ export declare function isVanillaPlayer(player: EntityPlayer): boolean;
7316
7581
 
7317
7582
  export declare function isVanillaTrinketType(trinketType: TrinketType): boolean;
7318
7583
 
7319
- /**
7320
- * Returns whether or not this is a class that is provided as part of the TypeScriptToLua
7321
- * transpiler, such as a `Map` or a `Set`.
7322
- */
7323
- export declare function isVanillaTSTLClass(object: unknown): boolean;
7324
-
7325
7584
  /**
7326
7585
  * Helper function to determine if a given grid index should have a wall generated by the vanilla
7327
7586
  * game. This is useful as a mechanism to distinguish between real walls and custom walls spawned by
@@ -7345,6 +7604,20 @@ export declare function isVector(object: unknown): object is Vector;
7345
7604
  */
7346
7605
  export declare const itemConfig: ItemConfig;
7347
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
+
7348
7621
  /**
7349
7622
  * Helper function to iterate over a table deterministically. This is useful because by default, the
7350
7623
  * `pairs` function will return the keys of a Lua table in a random order.
@@ -7869,6 +8142,44 @@ export declare const MAX_SPEED_STAT = 2;
7869
8142
  /** Corresponds to the maximum value for `EntityPlayer.SamsonBerserkCharge`. */
7870
8143
  export declare const MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000;
7871
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
+
7872
8183
  /** If you set `EntityPlayer.ShotSpeed` lower than this value, it will have no effect. */
7873
8184
  export declare const MIN_PLAYER_SHOT_SPEED_STAT = 0.6;
7874
8185
 
@@ -8619,9 +8930,11 @@ export declare enum ModCallbackCustom {
8619
8930
  * This callback is useful because many attributes cannot be set or retrieved properly in the
8620
8931
  * normal `POST_NPC_INIT` callback.
8621
8932
  *
8622
- * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8623
- * an optional third argument that will make the callback only fire if it matches the `EntityType`
8624
- * 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.
8625
8938
  *
8626
8939
  * ```ts
8627
8940
  * function postNPCInitLate(npc: EntityNPC): void {}
@@ -8677,9 +8990,11 @@ export declare enum ModCallbackCustom {
8677
8990
  *
8678
8991
  * Use this callback to know when a pickup is added to the player's inventory or health.
8679
8992
  *
8680
- * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8681
- * an optional third argument that will make the callback only fire if it matches the
8682
- * `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.
8683
8998
  *
8684
8999
  * ```ts
8685
9000
  * function postPickupCollect(pickup: EntityPickup, player: EntityPlayer): void {}
@@ -8693,9 +9008,11 @@ export declare enum ModCallbackCustom {
8693
9008
  * This callback is useful because pickups will despawn upon leaving the room and respawn upon
8694
9009
  * re-entering the room.
8695
9010
  *
8696
- * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8697
- * an optional third argument that will make the callback only fire if it matches the
8698
- * `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.
8699
9016
  *
8700
9017
  * ```ts
8701
9018
  * function postPickupInitFirst(pickup: EntityPickup): void {}
@@ -8708,9 +9025,11 @@ export declare enum ModCallbackCustom {
8708
9025
  * This callback is useful because many attributes cannot be set or retrieved properly in the
8709
9026
  * normal `POST_PICKUP_INIT` callback.
8710
9027
  *
8711
- * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8712
- * an optional third argument that will make the callback only fire if it matches the
8713
- * `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.
8714
9033
  *
8715
9034
  * ```ts
8716
9035
  * function postPickupInitLate(pickup: EntityPickup): void {}
@@ -8721,9 +9040,11 @@ export declare enum ModCallbackCustom {
8721
9040
  * Fires from the `POST_PICKUP_UPDATE` callback when a pickup's state has changed from what it was
8722
9041
  * on the previous frame. (In this context, "state" refers to the `EntityPickup.State` field.)
8723
9042
  *
8724
- * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8725
- * an optional third argument that will make the callback only fire if it matches the
8726
- * `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.
8727
9048
  *
8728
9049
  * ```ts
8729
9050
  * function postPickupStateChanged(
@@ -8799,13 +9120,13 @@ export declare enum ModCallbackCustom {
8799
9120
  * matches the `PlayerType` provided.
8800
9121
  *
8801
9122
  * ```ts
8802
- * function postPlayerChangeStat(
9123
+ * function postPlayerChangeStat<T extends StatType>(
8803
9124
  * player: EntityPlayer,
8804
- * statType: StatType,
9125
+ * statType: T,
8805
9126
  * difference: int,
8806
- * oldValue: number | boolean | BitFlags<TearFlag> | Color | Vector,
8807
- * newValue: number | boolean | BitFlags<TearFlag> | Color | Vector,
8808
- * ): void {}
9127
+ * oldValue: StatTypeType[T],
9128
+ * newValue: StatTypeType[T],
9129
+ * ) => void {}
8809
9130
  * ```
8810
9131
  */
8811
9132
  POST_PLAYER_CHANGE_STAT = 55,
@@ -9080,6 +9401,10 @@ export declare enum ModCallbackCustom {
9080
9401
  * Fires from the `POST_UPDATE` callback when the clear state of a room changes (as according to
9081
9402
  * the `Room.IsClear` method).
9082
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
+ *
9083
9408
  * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9084
9409
  * an optional third argument that will make the callback only fire if the room clear state
9085
9410
  * matches the boolean provided.
@@ -9428,35 +9753,80 @@ export declare enum ModCallbackCustom2 {
9428
9753
  POST_GRID_ENTITY_CUSTOM_COLLISION = 26,
9429
9754
  POST_GRID_ENTITY_CUSTOM_INIT = 27,
9430
9755
  POST_GRID_ENTITY_CUSTOM_REMOVE = 28,
9431
- POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 29,
9432
- POST_GRID_ENTITY_CUSTOM_UPDATE = 30,
9433
- POST_GRID_ENTITY_INIT = 31,
9434
- POST_GRID_ENTITY_REMOVE = 32,
9435
- POST_GRID_ENTITY_STATE_CHANGED = 33,
9436
- POST_GRID_ENTITY_UPDATE = 34,
9437
- POST_HOLY_MANTLE_REMOVED = 35,
9438
- POST_KNIFE_INIT_LATE = 36,
9439
- POST_NEW_LEVEL_REORDERED = 37,
9440
- POST_NEW_ROOM_EARLY = 38,
9441
- POST_NEW_ROOM_REORDERED = 39,
9442
- POST_PEFFECT_UPDATE_REORDERED = 40,
9443
- POST_PIT_RENDER = 41,
9444
- POST_PLAYER_FATAL_DAMAGE = 42,
9445
- POST_PLAYER_RENDER_REORDERED = 43,
9446
- POST_PLAYER_UPDATE_REORDERED = 44,
9447
- POST_ROOM_CLEAR_CHANGED = 45,
9448
- POST_SPIKES_RENDER = 46,
9449
- PRE_BERSERK_DEATH = 47,
9450
- PRE_CUSTOM_REVIVE = 48
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
9451
9817
  }
9452
9818
 
9819
+ declare type ModCallbackCustomCollectibleType = MatchingCallbackCustom<CallbackSignatureCollectibleType>;
9820
+
9453
9821
  declare type ModCallbackCustomGridEntity = MatchingCallbackCustom<CallbackSignatureGridEntity>;
9454
9822
 
9455
9823
  declare type ModCallbackCustomGridEntityCustom = MatchingCallbackCustom<CallbackSignatureGridEntityCustom>;
9456
9824
 
9825
+ declare type ModCallbackCustomItemPickup = MatchingCallbackCustom<CallbackSignatureItemPickup>;
9826
+
9457
9827
  declare type ModCallbackCustomPlayer = MatchingCallbackCustom<CallbackSignaturePlayer>;
9458
9828
 
9459
- declare type ModCallbackCustomRevive = MatchingCallbackCustom<CallbackSignatureRevive>;
9829
+ declare type ModCallbackCustomSlot = MatchingCallbackCustom<CallbackSignatureSlot>;
9460
9830
 
9461
9831
  /**
9462
9832
  * A helper class for mods that wants to represent their individual features as classes. Extend your
@@ -9486,10 +9856,6 @@ export declare class ModFeature {
9486
9856
  * To upgrade your mod, use the `upgradeMod` helper function.
9487
9857
  */
9488
9858
  export declare class ModUpgraded implements Mod {
9489
- /**
9490
- * The `RegisterMod` function stores the name of the mod on the mod object for some reason. (It is
9491
- * never used or referenced.)
9492
- */
9493
9859
  Name: string;
9494
9860
  /** We store a copy of the original mod object so that we can re-implement its functions. */
9495
9861
  private mod;
@@ -9538,8 +9904,17 @@ export declare class ModUpgraded implements Mod {
9538
9904
  * conditions of how you registered the callback, it will be removed.
9539
9905
  */
9540
9906
  RemoveCallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, callback: AddCallbackParametersCustom2[T][0]): void;
9541
- /** This is used to initialize both custom callbacks and "extra features". */
9907
+ /**
9908
+ * This is used to initialize both custom callbacks and "extra features".
9909
+ *
9910
+ * This mirrors the `uninitFeature` method.
9911
+ */
9542
9912
  private initFeature;
9913
+ /**
9914
+ * This is used to uninitialize both custom callbacks and "extra features".
9915
+ *
9916
+ * This mirrors the `initFeature` method.
9917
+ */
9543
9918
  private uninitFeature;
9544
9919
  /** Returns the names of the exported class methods from the features that were added. */
9545
9920
  private initOptionalFeature;
@@ -9838,6 +10213,46 @@ export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?:
9838
10213
  */
9839
10214
  export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
9840
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
+
9841
10256
  export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
9842
10257
 
9843
10258
  export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
@@ -9975,8 +10390,9 @@ playerVariant?: PlayerVariant,
9975
10390
  character?: PlayerType
9976
10391
  ];
9977
10392
 
9978
- declare class PostCustomRevive extends CustomCallbackRevive<ModCallbackCustom2.POST_CUSTOM_REVIVE> {
10393
+ declare class PostCustomRevive extends CustomCallback<ModCallbackCustom2.POST_CUSTOM_REVIVE> {
9979
10394
  constructor();
10395
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
9980
10396
  }
9981
10397
 
9982
10398
  declare type PostCustomReviveRegisterParameters = [
@@ -10081,9 +10497,9 @@ gridEntityType?: GridEntityType,
10081
10497
  variant?: int
10082
10498
  ];
10083
10499
 
10084
- declare class PostGridEntityCollision extends CustomCallback<T> {
10500
+ declare class PostGridEntityCollision extends CustomCallback<T_2> {
10085
10501
  constructor();
10086
- protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
10502
+ protected shouldFire(fireArgs: FireArgs<T_2>, optionalArgs: OptionalArgs<T_2>): boolean;
10087
10503
  }
10088
10504
 
10089
10505
  declare type PostGridEntityCollisionRegisterParameters = [
@@ -10103,9 +10519,9 @@ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void
10103
10519
  gridEntityTypeCustom?: GridEntityType
10104
10520
  ];
10105
10521
 
10106
- declare class PostGridEntityCustomCollision extends CustomCallback<T_2> {
10522
+ declare class PostGridEntityCustomCollision extends CustomCallback<T_3> {
10107
10523
  constructor();
10108
- protected shouldFire(fireArgs: FireArgs<T_2>, optionalArgs: OptionalArgs<T_2>): boolean;
10524
+ protected shouldFire(fireArgs: FireArgs<T_3>, optionalArgs: OptionalArgs<T_3>): boolean;
10109
10525
  }
10110
10526
 
10111
10527
  declare type PostGridEntityCustomCollisionRegisterParameters = [
@@ -10124,9 +10540,9 @@ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void
10124
10540
  gridEntityTypeCustom?: GridEntityType
10125
10541
  ];
10126
10542
 
10127
- declare class PostGridEntityCustomRemove extends CustomCallback<T_4> {
10543
+ declare class PostGridEntityCustomRemove extends CustomCallback<T_5> {
10128
10544
  constructor();
10129
- protected shouldFire(fireArgs: FireArgs<T_4>, optionalArgs: OptionalArgs<T_4>): boolean;
10545
+ protected shouldFire(fireArgs: FireArgs<T_5>, optionalArgs: OptionalArgs<T_5>): boolean;
10130
10546
  }
10131
10547
 
10132
10548
  declare type PostGridEntityCustomRemoveRegisterParameters = [
@@ -10134,6 +10550,10 @@ callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
10134
10550
  gridEntityTypeCustom?: GridEntityType
10135
10551
  ];
10136
10552
 
10553
+ declare class PostGridEntityCustomRender extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_RENDER> {
10554
+ constructor();
10555
+ }
10556
+
10137
10557
  declare type PostGridEntityCustomRenderRegisterParameters = [
10138
10558
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
10139
10559
  gridEntityTypeCustom?: GridEntityType
@@ -10167,9 +10587,9 @@ gridEntityType?: GridEntityType,
10167
10587
  variant?: int
10168
10588
  ];
10169
10589
 
10170
- declare class PostGridEntityRemove extends CustomCallback<T_3> {
10590
+ declare class PostGridEntityRemove extends CustomCallback<T_4> {
10171
10591
  constructor();
10172
- protected shouldFire(fireArgs: FireArgs<T_3>, optionalArgs: OptionalArgs<T_3>): boolean;
10592
+ protected shouldFire(fireArgs: FireArgs<T_4>, optionalArgs: OptionalArgs<T_4>): boolean;
10173
10593
  }
10174
10594
 
10175
10595
  declare type PostGridEntityRemoveRegisterParameters = [
@@ -10178,6 +10598,10 @@ gridEntityType?: GridEntityType,
10178
10598
  variant?: int
10179
10599
  ];
10180
10600
 
10601
+ declare class PostGridEntityRender extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_RENDER> {
10602
+ constructor();
10603
+ }
10604
+
10181
10605
  declare type PostGridEntityRenderRegisterParameters = [
10182
10606
  callback: (gridEntity: GridEntity) => void,
10183
10607
  gridEntityType?: GridEntityType,
@@ -10215,6 +10639,10 @@ callback: (player: EntityPlayer, collectibleType: CollectibleType, activeSlot: A
10215
10639
  collectibleType?: CollectibleType
10216
10640
  ];
10217
10641
 
10642
+ declare class PostItemPickup extends CustomCallbackItemPickup<ModCallbackCustom2.POST_ITEM_PICKUP> {
10643
+ constructor();
10644
+ }
10645
+
10218
10646
  declare type PostItemPickupRegisterParameters = [callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => void] | [
10219
10647
  callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void,
10220
10648
  itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
@@ -10317,11 +10745,19 @@ callback: (player: EntityPlayer, oldCharacter: PlayerType, newCharacter: PlayerT
10317
10745
  playerVariant?: PlayerVariant
10318
10746
  ];
10319
10747
 
10748
+ declare class PostPlayerCollectibleAdded extends CustomCallbackCollectibleType<ModCallbackCustom2.POST_PLAYER_COLLECTIBLE_ADDED> {
10749
+ constructor();
10750
+ }
10751
+
10320
10752
  declare type PostPlayerCollectibleAddedRegisterParameters = [
10321
10753
  callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
10322
10754
  collectibleType?: CollectibleType
10323
10755
  ];
10324
10756
 
10757
+ declare class PostPlayerCollectibleRemoved extends CustomCallbackCollectibleType<ModCallbackCustom2.POST_PLAYER_COLLECTIBLE_REMOVED> {
10758
+ constructor();
10759
+ }
10760
+
10325
10761
  declare type PostPlayerCollectibleRemovedRegisterParameters = [
10326
10762
  callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
10327
10763
  collectibleType?: CollectibleType
@@ -10417,6 +10853,10 @@ playerVariant?: PlayerVariant,
10417
10853
  character?: PlayerType
10418
10854
  ];
10419
10855
 
10856
+ declare class PostSlotAnimationChanged extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_ANIMATION_CHANGED> {
10857
+ constructor();
10858
+ }
10859
+
10420
10860
  declare type PostSlotAnimationChangedRegisterParameters = [
10421
10861
  callback: (slot: EntitySlot, previousAnimation: string, currentAnimation: string) => void,
10422
10862
  slotVariant?: SlotVariant
@@ -10433,16 +10873,28 @@ slotVariant?: SlotVariant,
10433
10873
  slotDestructionType?: SlotDestructionType
10434
10874
  ];
10435
10875
 
10876
+ declare class PostSlotInit extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_INIT> {
10877
+ constructor();
10878
+ }
10879
+
10436
10880
  declare type PostSlotInitRegisterParameters = [
10437
10881
  callback: (slot: EntitySlot) => void,
10438
10882
  slotVariant?: SlotVariant
10439
10883
  ];
10440
10884
 
10885
+ declare class PostSlotRender extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_RENDER> {
10886
+ constructor();
10887
+ }
10888
+
10441
10889
  declare type PostSlotRenderRegisterParameters = [
10442
10890
  callback: (slot: EntitySlot) => void,
10443
10891
  slotVariant?: SlotVariant
10444
10892
  ];
10445
10893
 
10894
+ declare class PostSlotUpdate extends CustomCallbackSlot<ModCallbackCustom2.POST_SLOT_UPDATE> {
10895
+ constructor();
10896
+ }
10897
+
10446
10898
  declare type PostSlotUpdateRegisterParameters = [
10447
10899
  callback: (slot: EntitySlot) => void,
10448
10900
  slotVariant?: SlotVariant
@@ -10510,6 +10962,10 @@ playerVariant?: PlayerVariant,
10510
10962
  character?: PlayerType
10511
10963
  ];
10512
10964
 
10965
+ declare class PreItemPickup extends CustomCallbackItemPickup<ModCallbackCustom2.PRE_ITEM_PICKUP> {
10966
+ constructor();
10967
+ }
10968
+
10513
10969
  declare type PreItemPickupRegisterParameters = [callback: (player: EntityPlayer, pickingUpItem: PickingUpItem) => void] | [
10514
10970
  callback: (player: EntityPlayer, pickingUpItem: PickingUpItemCollectible) => void,
10515
10971
  itemType: ItemType.PASSIVE | ItemType.ACTIVE | ItemType.FAMILIAR,
@@ -10607,6 +11063,39 @@ export declare function registerCharacterHealthConversion(playerType: PlayerType
10607
11063
  */
10608
11064
  export declare function registerCharacterStats(playerType: PlayerType, statMap: Map<CacheFlag, number> | ReadonlyMap<CacheFlag, number>): void;
10609
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
+
10610
11099
  /**
10611
11100
  * Helper function to register a custom pickup with the IsaacScript standard library. Use this
10612
11101
  * feature for custom pickups that are intended to be picked up by the player, like bombs and keys.
@@ -11541,8 +12030,7 @@ export declare function runInNGameFrames(func: () => void, gameFrames: int): voi
11541
12030
  export declare function runInNRenderFrames(func: () => void, renderFrames: int): void;
11542
12031
 
11543
12032
  /**
11544
- * Run the suite of tests that prove that the "merge" function works properly. (This function is not
11545
- * exported but is used internally in the save data manager.)
12033
+ * Run the suite of tests that prove that the "merge" function works properly.
11546
12034
  *
11547
12035
  * This function is only useful if you are troubleshooting the save data manager.
11548
12036
  */
@@ -11592,7 +12080,7 @@ export declare function runNextRenderFrame(func: () => void): void;
11592
12080
  * This is the format of the object that you give to the save data manager. It will contains all of
11593
12081
  * the variables for the particular mod feature.
11594
12082
  *
11595
- * Depending on which object keys you use, the variables will be automatically reset at certain
12083
+ * Depending on which object keys you use, the variables will automatically be reset at certain
11596
12084
  * times and automatically saved to disk.
11597
12085
  *
11598
12086
  * Each sub-object of save data has a string as a key and arbitrary data as a value. However, the
@@ -11627,6 +12115,216 @@ export declare enum SaveDataKey {
11627
12115
  ROOM = "room"
11628
12116
  }
11629
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
+
11630
12328
  /**
11631
12329
  * This is the entry point to the save data manager, a system which provides two major features:
11632
12330
  *
@@ -11723,11 +12421,9 @@ export declare enum SaveDataKey {
11723
12421
  * will allow you to use non-serializable objects in your save data, such as
11724
12422
  * `EntityPtr`.
11725
12423
  */
11726
- export declare function saveDataManager<Persistent, Run, Level>(key: string, // This is the overload for the standard case with serializable data.
11727
- 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;
11728
12425
 
11729
- export declare function saveDataManager(key: string, // This is the overload for the case when saving data is disabled.
11730
- v: SaveData, conditionalFunc: false): void;
12426
+ export declare function saveDataManager(key: string, v: SaveData, conditionalFunc: false): void;
11731
12427
 
11732
12428
  /**
11733
12429
  * The save data manager will automatically load variables from disk at the appropriate times (i.e.
@@ -11739,6 +12435,18 @@ v: SaveData, conditionalFunc: false): void;
11739
12435
  */
11740
12436
  export declare function saveDataManagerLoad(): void;
11741
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
+
11742
12450
  /**
11743
12451
  * Removes a previously registered key from the save data manager. This is the opposite of the
11744
12452
  * "saveDataManager" function.
@@ -11799,9 +12507,9 @@ declare type SerializableArray<T> = Array<SerializableInsideArrayOrMap<T>>;
11799
12507
 
11800
12508
  /**
11801
12509
  * This is mostly copied from the `Serializable` type. The difference is that we want to disallow
11802
- * classes with methods.
12510
+ * functions inside of containers.
11803
12511
  */
11804
- 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 HasMethods<T> ? ErrorCustomClassNotSerializable : T extends Function ? FunctionIsNotSerializable : SerializableObject<T>;
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>;
11805
12513
 
11806
12514
  declare type SerializableMap<K, V> = Map<SerializableInsideArrayOrMap<K>, SerializableInsideArrayOrMap<V>>;
11807
12515
 
@@ -11819,6 +12527,46 @@ declare type SerializableReadonlySet<T> = ReadonlySet<SerializableInsideArrayOrM
11819
12527
 
11820
12528
  declare type SerializableSet<T> = Set<SerializableInsideArrayOrMap<T>>;
11821
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
+
11822
12570
  /** This is used with the `deepCopy` and `merge` functions. */
11823
12571
  export declare enum SerializationType {
11824
12572
  NONE = 0,
@@ -12485,6 +13233,34 @@ export declare enum SlotDestructionType {
12485
13233
  COLLECTIBLE_PAYOUT = 1
12486
13234
  }
12487
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
+
12488
13264
  /**
12489
13265
  * Helper function to smelt a trinket. Before smelting, this function will automatically remove the
12490
13266
  * trinkets that the player is holding, if any, and then give them back after the new trinket is
@@ -13113,13 +13889,15 @@ export declare function sumSet(set: Set<number> | ReadonlySet<number>): number;
13113
13889
  */
13114
13890
  export declare function swapArrayElements<T>(array: T[], i: number, j: number): void;
13115
13891
 
13116
- declare type T = ModCallbackCustom2.POST_GRID_ENTITY_COLLISION;
13892
+ declare type T = ModCallbackCustom2.POST_CUSTOM_REVIVE;
13893
+
13894
+ declare type T_2 = ModCallbackCustom2.POST_GRID_ENTITY_COLLISION;
13117
13895
 
13118
- declare type T_2 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_COLLISION;
13896
+ declare type T_3 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_COLLISION;
13119
13897
 
13120
- declare type T_3 = ModCallbackCustom2.POST_GRID_ENTITY_REMOVE;
13898
+ declare type T_4 = ModCallbackCustom2.POST_GRID_ENTITY_REMOVE;
13121
13899
 
13122
- declare type T_4 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_REMOVE;
13900
+ declare type T_5 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_REMOVE;
13123
13901
 
13124
13902
  /**
13125
13903
  * Helper function to check if a Lua table has all of the provided keys.