isaacscript-common 13.3.4 → 14.1.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 (668) hide show
  1. package/dist/index.d.ts +1644 -441
  2. package/dist/isaacscript-common.lua +19643 -16276
  3. package/dist/src/callbacks/customRevive.lua +10 -1
  4. package/dist/src/callbacks/postAmbush.d.ts.map +1 -1
  5. package/dist/src/callbacks/postAmbush.lua +7 -12
  6. package/dist/src/callbacks/postBombExploded.lua +3 -3
  7. package/dist/src/callbacks/postDoorRender.lua +2 -2
  8. package/dist/src/callbacks/postEffectStateChanged.lua +3 -3
  9. package/dist/src/callbacks/postFamiliarStateChanged.lua +3 -3
  10. package/dist/src/callbacks/postFlip.lua +1 -1
  11. package/dist/src/callbacks/postGridEntity.lua +2 -2
  12. package/dist/src/callbacks/postNPCStateChanged.lua +3 -3
  13. package/dist/src/callbacks/postPickupStateChanged.lua +3 -3
  14. package/dist/src/callbacks/postPlayerCollectible.d.ts.map +1 -1
  15. package/dist/src/callbacks/postPlayerCollectible.lua +5 -9
  16. package/dist/src/callbacks/postRoomClearChanged.d.ts.map +1 -1
  17. package/dist/src/callbacks/postRoomClearChanged.lua +3 -5
  18. package/dist/src/callbacks/reorderedCallbacks.lua +7 -7
  19. package/dist/src/callbacks/subscriptions/{postBoneExploded.d.ts → postBombExploded.d.ts} +1 -1
  20. package/dist/src/callbacks/subscriptions/{postBoneExploded.d.ts.map → postBombExploded.d.ts.map} +1 -1
  21. package/dist/src/callbacks/subscriptions/{postBoneExploded.lua → postBombExploded.lua} +0 -0
  22. package/dist/src/callbacks/subscriptions/postCollectibleEmpty.d.ts +1 -1
  23. package/dist/src/callbacks/subscriptions/postCollectibleEmpty.d.ts.map +1 -1
  24. package/dist/src/callbacks/subscriptions/postCollectibleInitFirst.d.ts +1 -1
  25. package/dist/src/callbacks/subscriptions/postCollectibleInitFirst.d.ts.map +1 -1
  26. package/dist/src/callbacks/subscriptions/postCursedTeleport.d.ts +4 -2
  27. package/dist/src/callbacks/subscriptions/postCursedTeleport.d.ts.map +1 -1
  28. package/dist/src/callbacks/subscriptions/postCursedTeleport.lua +13 -1
  29. package/dist/src/callbacks/subscriptions/postGridEntityBroken.d.ts +1 -1
  30. package/dist/src/callbacks/subscriptions/postGridEntityBroken.d.ts.map +1 -1
  31. package/dist/src/callbacks/subscriptions/postGridEntityBroken.lua +3 -3
  32. package/dist/src/callbacks/subscriptions/postGridEntityInit.d.ts +1 -1
  33. package/dist/src/callbacks/subscriptions/postGridEntityInit.d.ts.map +1 -1
  34. package/dist/src/callbacks/subscriptions/postGridEntityInit.lua +3 -3
  35. package/dist/src/callbacks/subscriptions/postGridEntityRemove.d.ts +3 -3
  36. package/dist/src/callbacks/subscriptions/postGridEntityRemove.d.ts.map +1 -1
  37. package/dist/src/callbacks/subscriptions/postGridEntityRemove.lua +4 -4
  38. package/dist/src/callbacks/subscriptions/postGridEntityRender.d.ts +1 -1
  39. package/dist/src/callbacks/subscriptions/postGridEntityRender.d.ts.map +1 -1
  40. package/dist/src/callbacks/subscriptions/postGridEntityRender.lua +3 -3
  41. package/dist/src/callbacks/subscriptions/postGridEntityStateChanged.d.ts +1 -1
  42. package/dist/src/callbacks/subscriptions/postGridEntityStateChanged.d.ts.map +1 -1
  43. package/dist/src/callbacks/subscriptions/postGridEntityStateChanged.lua +3 -3
  44. package/dist/src/callbacks/subscriptions/postGridEntityUpdate.d.ts +1 -1
  45. package/dist/src/callbacks/subscriptions/postGridEntityUpdate.d.ts.map +1 -1
  46. package/dist/src/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
  47. package/dist/src/callbacks/subscriptions/postHolyMantleRemoved.d.ts.map +1 -1
  48. package/dist/src/callbacks/subscriptions/postHolyMantleRemoved.lua +2 -2
  49. package/dist/src/callbacks/subscriptions/postPEffectUpdateReordered.d.ts.map +1 -1
  50. package/dist/src/callbacks/subscriptions/postPEffectUpdateReordered.lua +2 -2
  51. package/dist/src/callbacks/subscriptions/postRockRender.d.ts +1 -1
  52. package/dist/src/callbacks/subscriptions/postRockRender.d.ts.map +1 -1
  53. package/dist/src/callbacks/subscriptions/postRockRender.lua +3 -3
  54. package/dist/src/callbacks/subscriptions/postRockUpdate.d.ts +1 -1
  55. package/dist/src/callbacks/subscriptions/postRockUpdate.d.ts.map +1 -1
  56. package/dist/src/callbacks/subscriptions/postRockUpdate.lua +3 -3
  57. package/dist/src/callbacks/subscriptions/postSpikesRender.d.ts +1 -1
  58. package/dist/src/callbacks/subscriptions/postSpikesRender.d.ts.map +1 -1
  59. package/dist/src/callbacks/subscriptions/postSpikesRender.lua +3 -3
  60. package/dist/src/callbacks/subscriptions/postSpikesUpdate.d.ts +1 -1
  61. package/dist/src/callbacks/subscriptions/postSpikesUpdate.d.ts.map +1 -1
  62. package/dist/src/callbacks/subscriptions/postSpikesUpdate.lua +3 -3
  63. package/dist/src/callbacks/subscriptions/postTNTRender.d.ts +1 -1
  64. package/dist/src/callbacks/subscriptions/postTNTRender.d.ts.map +1 -1
  65. package/dist/src/callbacks/subscriptions/postTNTRender.lua +3 -3
  66. package/dist/src/callbacks/subscriptions/postTNTUpdate.d.ts +1 -1
  67. package/dist/src/callbacks/subscriptions/postTNTUpdate.d.ts.map +1 -1
  68. package/dist/src/callbacks/subscriptions/postTNTUpdate.lua +3 -3
  69. package/dist/src/callbacks.d.ts +106 -0
  70. package/dist/src/callbacks.d.ts.map +1 -0
  71. package/dist/src/callbacks.lua +176 -0
  72. package/dist/src/classes/DefaultMap.d.ts.map +1 -1
  73. package/dist/src/classes/ModFeature.d.ts +11 -0
  74. package/dist/src/classes/ModFeature.d.ts.map +1 -0
  75. package/dist/src/classes/ModFeature.lua +13 -0
  76. package/dist/src/classes/ModUpgraded.d.ts +49 -11
  77. package/dist/src/classes/ModUpgraded.d.ts.map +1 -1
  78. package/dist/src/classes/ModUpgraded.lua +118 -16
  79. package/dist/src/classes/callbacks/PostAmbushFinished.d.ts +12 -0
  80. package/dist/src/classes/callbacks/PostAmbushFinished.d.ts.map +1 -0
  81. package/dist/src/classes/callbacks/PostAmbushFinished.lua +37 -0
  82. package/dist/src/classes/callbacks/PostAmbushStarted.d.ts +12 -0
  83. package/dist/src/classes/callbacks/PostAmbushStarted.d.ts.map +1 -0
  84. package/dist/src/classes/callbacks/PostAmbushStarted.lua +37 -0
  85. package/dist/src/classes/callbacks/PostBombExploded.d.ts +7 -0
  86. package/dist/src/classes/callbacks/PostBombExploded.d.ts.map +1 -0
  87. package/dist/src/classes/callbacks/PostBombExploded.lua +24 -0
  88. package/dist/src/classes/callbacks/PostBombInitLate.d.ts +12 -0
  89. package/dist/src/classes/callbacks/PostBombInitLate.d.ts.map +1 -0
  90. package/dist/src/classes/callbacks/PostBombInitLate.lua +27 -0
  91. package/dist/src/classes/callbacks/PostBoneSwing.d.ts +14 -0
  92. package/dist/src/classes/callbacks/PostBoneSwing.d.ts.map +1 -0
  93. package/dist/src/classes/callbacks/PostBoneSwing.lua +43 -0
  94. package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts +17 -0
  95. package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -0
  96. package/dist/src/classes/callbacks/PostCollectibleEmpty.lua +47 -0
  97. package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts +13 -0
  98. package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts.map +1 -0
  99. package/dist/src/classes/callbacks/PostCollectibleInitFirst.lua +32 -0
  100. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts +20 -0
  101. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -0
  102. package/dist/src/classes/callbacks/PostCursedTeleport.lua +113 -0
  103. package/dist/src/classes/callbacks/PostCustomRevive.d.ts +6 -0
  104. package/dist/src/classes/callbacks/PostCustomRevive.d.ts.map +1 -0
  105. package/dist/src/classes/callbacks/PostCustomRevive.lua +17 -0
  106. package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts +15 -0
  107. package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -0
  108. package/dist/src/classes/callbacks/PostDiceRoomActivated.lua +44 -0
  109. package/dist/src/classes/callbacks/PostDoorRender.d.ts +7 -0
  110. package/dist/src/classes/callbacks/PostDoorRender.d.ts.map +1 -0
  111. package/dist/src/classes/callbacks/PostDoorRender.lua +24 -0
  112. package/dist/src/classes/callbacks/PostDoorUpdate.d.ts +7 -0
  113. package/dist/src/classes/callbacks/PostDoorUpdate.d.ts.map +1 -0
  114. package/dist/src/classes/callbacks/PostDoorUpdate.lua +24 -0
  115. package/dist/src/classes/callbacks/PostEffectInitLate.d.ts +12 -0
  116. package/dist/src/classes/callbacks/PostEffectInitLate.d.ts.map +1 -0
  117. package/dist/src/classes/callbacks/PostEffectInitLate.lua +27 -0
  118. package/dist/src/classes/callbacks/PostEffectStateChanged.d.ts +13 -0
  119. package/dist/src/classes/callbacks/PostEffectStateChanged.d.ts.map +1 -0
  120. package/dist/src/classes/callbacks/PostEffectStateChanged.lua +33 -0
  121. package/dist/src/classes/callbacks/PostEsauJr.d.ts +6 -0
  122. package/dist/src/classes/callbacks/PostEsauJr.d.ts.map +1 -0
  123. package/dist/src/classes/callbacks/PostEsauJr.lua +17 -0
  124. package/dist/src/classes/callbacks/PostFamiliarInitLate.d.ts +12 -0
  125. package/dist/src/classes/callbacks/PostFamiliarInitLate.d.ts.map +1 -0
  126. package/dist/src/classes/callbacks/PostFamiliarInitLate.lua +27 -0
  127. package/dist/src/classes/callbacks/PostFamiliarStateChanged.d.ts +13 -0
  128. package/dist/src/classes/callbacks/PostFamiliarStateChanged.d.ts.map +1 -0
  129. package/dist/src/classes/callbacks/PostFamiliarStateChanged.lua +33 -0
  130. package/dist/src/classes/callbacks/PostFirstEsauJr.d.ts +6 -0
  131. package/dist/src/classes/callbacks/PostFirstEsauJr.d.ts.map +1 -0
  132. package/dist/src/classes/callbacks/PostFirstEsauJr.lua +17 -0
  133. package/dist/src/classes/callbacks/PostFirstFlip.d.ts +6 -0
  134. package/dist/src/classes/callbacks/PostFirstFlip.d.ts.map +1 -0
  135. package/dist/src/classes/callbacks/PostFirstFlip.lua +17 -0
  136. package/dist/src/classes/callbacks/PostFlip.d.ts +6 -0
  137. package/dist/src/classes/callbacks/PostFlip.d.ts.map +1 -0
  138. package/dist/src/classes/callbacks/PostFlip.lua +17 -0
  139. package/dist/src/classes/callbacks/PostGameStartedReordered.d.ts +6 -0
  140. package/dist/src/classes/callbacks/PostGameStartedReordered.d.ts.map +1 -0
  141. package/dist/src/classes/callbacks/PostGameStartedReordered.lua +17 -0
  142. package/dist/src/classes/callbacks/PostGameStartedReorderedLast.d.ts +6 -0
  143. package/dist/src/classes/callbacks/PostGameStartedReorderedLast.d.ts.map +1 -0
  144. package/dist/src/classes/callbacks/PostGameStartedReorderedLast.lua +17 -0
  145. package/dist/src/classes/callbacks/PostGreedModeWave.d.ts +12 -0
  146. package/dist/src/classes/callbacks/PostGreedModeWave.d.ts.map +1 -0
  147. package/dist/src/classes/callbacks/PostGreedModeWave.lua +34 -0
  148. package/dist/src/classes/callbacks/PostGridEntityBroken.d.ts +6 -0
  149. package/dist/src/classes/callbacks/PostGridEntityBroken.d.ts.map +1 -0
  150. package/dist/src/classes/callbacks/PostGridEntityBroken.lua +17 -0
  151. package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts +9 -0
  152. package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts.map +1 -0
  153. package/dist/src/classes/callbacks/PostGridEntityCollision.lua +36 -0
  154. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.d.ts +6 -0
  155. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.d.ts.map +1 -0
  156. package/dist/src/classes/callbacks/PostGridEntityCustomBroken.lua +17 -0
  157. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts +9 -0
  158. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts.map +1 -0
  159. package/dist/src/classes/callbacks/PostGridEntityCustomCollision.lua +31 -0
  160. package/dist/src/classes/callbacks/PostGridEntityCustomInit.d.ts +6 -0
  161. package/dist/src/classes/callbacks/PostGridEntityCustomInit.d.ts.map +1 -0
  162. package/dist/src/classes/callbacks/PostGridEntityCustomInit.lua +17 -0
  163. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts +9 -0
  164. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.d.ts.map +1 -0
  165. package/dist/src/classes/callbacks/PostGridEntityCustomRemove.lua +25 -0
  166. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.d.ts +6 -0
  167. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.d.ts.map +1 -0
  168. package/dist/src/classes/callbacks/PostGridEntityCustomStateChanged.lua +17 -0
  169. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.d.ts +6 -0
  170. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.d.ts.map +1 -0
  171. package/dist/src/classes/callbacks/PostGridEntityCustomUpdate.lua +17 -0
  172. package/dist/src/classes/callbacks/PostGridEntityInit.d.ts +6 -0
  173. package/dist/src/classes/callbacks/PostGridEntityInit.d.ts.map +1 -0
  174. package/dist/src/classes/callbacks/PostGridEntityInit.lua +17 -0
  175. package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts +9 -0
  176. package/dist/src/classes/callbacks/PostGridEntityRemove.d.ts.map +1 -0
  177. package/dist/src/classes/callbacks/PostGridEntityRemove.lua +28 -0
  178. package/dist/src/classes/callbacks/PostGridEntityStateChanged.d.ts +6 -0
  179. package/dist/src/classes/callbacks/PostGridEntityStateChanged.d.ts.map +1 -0
  180. package/dist/src/classes/callbacks/PostGridEntityStateChanged.lua +17 -0
  181. package/dist/src/classes/callbacks/PostGridEntityUpdate.d.ts +6 -0
  182. package/dist/src/classes/callbacks/PostGridEntityUpdate.d.ts.map +1 -0
  183. package/dist/src/classes/callbacks/PostGridEntityUpdate.lua +17 -0
  184. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts +14 -0
  185. package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts.map +1 -0
  186. package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +35 -0
  187. package/dist/src/classes/callbacks/PostKnifeInitLate.d.ts +12 -0
  188. package/dist/src/classes/callbacks/PostKnifeInitLate.d.ts.map +1 -0
  189. package/dist/src/classes/callbacks/PostKnifeInitLate.lua +27 -0
  190. package/dist/src/classes/callbacks/PostNewLevelReordered.d.ts +6 -0
  191. package/dist/src/classes/callbacks/PostNewLevelReordered.d.ts.map +1 -0
  192. package/dist/src/classes/callbacks/PostNewLevelReordered.lua +17 -0
  193. package/dist/src/classes/callbacks/PostNewRoomEarly.d.ts +13 -0
  194. package/dist/src/classes/callbacks/PostNewRoomEarly.d.ts.map +1 -0
  195. package/dist/src/classes/callbacks/PostNewRoomEarly.lua +65 -0
  196. package/dist/src/classes/callbacks/PostNewRoomReordered.d.ts +6 -0
  197. package/dist/src/classes/callbacks/PostNewRoomReordered.d.ts.map +1 -0
  198. package/dist/src/classes/callbacks/PostNewRoomReordered.lua +17 -0
  199. package/dist/src/classes/callbacks/PostPEffectUpdateReordered.d.ts +6 -0
  200. package/dist/src/classes/callbacks/PostPEffectUpdateReordered.d.ts.map +1 -0
  201. package/dist/src/classes/callbacks/PostPEffectUpdateReordered.lua +17 -0
  202. package/dist/src/classes/callbacks/PostPitRender.d.ts +7 -0
  203. package/dist/src/classes/callbacks/PostPitRender.d.ts.map +1 -0
  204. package/dist/src/classes/callbacks/PostPitRender.lua +24 -0
  205. package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts +15 -0
  206. package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts.map +1 -0
  207. package/dist/src/classes/callbacks/PostPlayerFatalDamage.lua +87 -0
  208. package/dist/src/classes/callbacks/PostPlayerRenderReordered.d.ts +6 -0
  209. package/dist/src/classes/callbacks/PostPlayerRenderReordered.d.ts.map +1 -0
  210. package/dist/src/classes/callbacks/PostPlayerRenderReordered.lua +17 -0
  211. package/dist/src/classes/callbacks/PostPlayerUpdateReordered.d.ts +6 -0
  212. package/dist/src/classes/callbacks/PostPlayerUpdateReordered.d.ts.map +1 -0
  213. package/dist/src/classes/callbacks/PostPlayerUpdateReordered.lua +17 -0
  214. package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts +13 -0
  215. package/dist/src/classes/callbacks/PostRoomClearChanged.d.ts.map +1 -0
  216. package/dist/src/classes/callbacks/PostRoomClearChanged.lua +33 -0
  217. package/dist/src/classes/callbacks/PostSpikesRender.d.ts +7 -0
  218. package/dist/src/classes/callbacks/PostSpikesRender.d.ts.map +1 -0
  219. package/dist/src/classes/callbacks/PostSpikesRender.lua +24 -0
  220. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts +7 -0
  221. package/dist/src/classes/callbacks/PreBerserkDeath.d.ts.map +1 -0
  222. package/dist/src/classes/callbacks/PreBerserkDeath.lua +36 -0
  223. package/dist/src/classes/callbacks/PreCustomRevive.d.ts +6 -0
  224. package/dist/src/classes/callbacks/PreCustomRevive.d.ts.map +1 -0
  225. package/dist/src/classes/callbacks/PreCustomRevive.lua +17 -0
  226. package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.d.ts +10 -0
  227. package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.d.ts.map +1 -0
  228. package/dist/src/classes/callbacks/validation/CustomCallbackAmbush.lua +19 -0
  229. package/dist/src/classes/callbacks/validation/CustomCallbackBomb.d.ts +10 -0
  230. package/dist/src/classes/callbacks/validation/CustomCallbackBomb.d.ts.map +1 -0
  231. package/dist/src/classes/callbacks/validation/CustomCallbackBomb.lua +19 -0
  232. package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.d.ts +10 -0
  233. package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.d.ts.map +1 -0
  234. package/dist/src/classes/callbacks/validation/CustomCallbackCollectible.lua +19 -0
  235. package/dist/src/classes/callbacks/validation/CustomCallbackDoor.d.ts +10 -0
  236. package/dist/src/classes/callbacks/validation/CustomCallbackDoor.d.ts.map +1 -0
  237. package/dist/src/classes/callbacks/validation/CustomCallbackDoor.lua +20 -0
  238. package/dist/src/classes/callbacks/validation/CustomCallbackEffect.d.ts +11 -0
  239. package/dist/src/classes/callbacks/validation/CustomCallbackEffect.d.ts.map +1 -0
  240. package/dist/src/classes/callbacks/validation/CustomCallbackEffect.lua +19 -0
  241. package/dist/src/classes/callbacks/validation/CustomCallbackFamiliar.d.ts +11 -0
  242. package/dist/src/classes/callbacks/validation/CustomCallbackFamiliar.d.ts.map +1 -0
  243. package/dist/src/classes/callbacks/validation/CustomCallbackFamiliar.lua +19 -0
  244. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntity.d.ts +11 -0
  245. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntity.d.ts.map +1 -0
  246. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntity.lua +24 -0
  247. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.d.ts +10 -0
  248. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.d.ts.map +1 -0
  249. package/dist/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.lua +19 -0
  250. package/dist/src/classes/callbacks/validation/CustomCallbackKnife.d.ts +10 -0
  251. package/dist/src/classes/callbacks/validation/CustomCallbackKnife.d.ts.map +1 -0
  252. package/dist/src/classes/callbacks/validation/CustomCallbackKnife.lua +19 -0
  253. package/dist/src/classes/callbacks/validation/CustomCallbackPit.d.ts +10 -0
  254. package/dist/src/classes/callbacks/validation/CustomCallbackPit.d.ts.map +1 -0
  255. package/dist/src/classes/callbacks/validation/CustomCallbackPit.lua +20 -0
  256. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts +10 -0
  257. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.d.ts.map +1 -0
  258. package/dist/src/classes/callbacks/validation/CustomCallbackPlayer.lua +23 -0
  259. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.d.ts +11 -0
  260. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.d.ts.map +1 -0
  261. package/dist/src/classes/callbacks/validation/CustomCallbackRevive.lua +19 -0
  262. package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.d.ts +10 -0
  263. package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.d.ts.map +1 -0
  264. package/dist/src/classes/callbacks/validation/CustomCallbackSpikes.lua +20 -0
  265. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +134 -0
  266. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -0
  267. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +220 -0
  268. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts +39 -0
  269. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -0
  270. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +140 -0
  271. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts +19 -0
  272. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -0
  273. package/dist/src/classes/features/callbackLogic/EsauJrDetection.lua +52 -0
  274. package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts +16 -0
  275. package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts.map +1 -0
  276. package/dist/src/classes/features/callbackLogic/FlipDetection.lua +58 -0
  277. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts +27 -0
  278. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -0
  279. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +108 -0
  280. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts +19 -0
  281. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -0
  282. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.lua +69 -0
  283. package/dist/src/classes/features/callbackLogic/GridEntityDetection.d.ts +46 -0
  284. package/dist/src/classes/features/callbackLogic/GridEntityDetection.d.ts.map +1 -0
  285. package/dist/src/classes/features/callbackLogic/GridEntityDetection.lua +126 -0
  286. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts +24 -0
  287. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts.map +1 -0
  288. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.lua +72 -0
  289. package/dist/src/classes/features/other/RunInNFrames.d.ts +123 -0
  290. package/dist/src/classes/features/other/RunInNFrames.d.ts.map +1 -0
  291. package/dist/src/classes/features/other/RunInNFrames.lua +109 -0
  292. package/dist/src/classes/private/CustomCallback.d.ts +26 -0
  293. package/dist/src/classes/private/CustomCallback.d.ts.map +1 -0
  294. package/dist/src/classes/private/CustomCallback.lua +63 -0
  295. package/dist/src/classes/private/Feature.d.ts +19 -0
  296. package/dist/src/classes/private/Feature.d.ts.map +1 -0
  297. package/dist/src/classes/private/Feature.lua +16 -0
  298. package/dist/src/core/upgradeMod.d.ts +18 -1
  299. package/dist/src/core/upgradeMod.d.ts.map +1 -1
  300. package/dist/src/core/upgradeMod.lua +44 -9
  301. package/dist/src/decorators.d.ts +9 -0
  302. package/dist/src/decorators.d.ts.map +1 -0
  303. package/dist/src/decorators.lua +12 -0
  304. package/dist/src/enums/ISCFeature.d.ts +12 -0
  305. package/dist/src/enums/ISCFeature.d.ts.map +1 -0
  306. package/dist/src/enums/ISCFeature.lua +12 -0
  307. package/dist/src/enums/LadderSubTypeCustom.d.ts +17 -0
  308. package/dist/src/enums/LadderSubTypeCustom.d.ts.map +1 -0
  309. package/dist/src/enums/LadderSubTypeCustom.lua +19 -0
  310. package/dist/src/enums/ModCallbackCustom.d.ts +399 -327
  311. package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
  312. package/dist/src/enums/ModCallbackCustom.lua +85 -87
  313. package/dist/src/enums/ModCallbackCustom2.d.ts +53 -0
  314. package/dist/src/enums/ModCallbackCustom2.d.ts.map +1 -0
  315. package/dist/src/enums/ModCallbackCustom2.lua +102 -0
  316. package/dist/src/features/customGridEntity.d.ts.map +1 -1
  317. package/dist/src/features/customGridEntity.lua +6 -8
  318. package/dist/src/features/{setHotkey.d.ts → customHotkeys.d.ts} +1 -1
  319. package/dist/src/features/customHotkeys.d.ts.map +1 -0
  320. package/dist/src/features/{setHotkey.lua → customHotkeys.lua} +2 -2
  321. package/dist/src/features/customPickup.d.ts.map +1 -1
  322. package/dist/src/features/customPickup.lua +6 -2
  323. package/dist/src/features/customStage/backdrop.d.ts.map +1 -1
  324. package/dist/src/features/customStage/backdrop.lua +3 -1
  325. package/dist/src/features/customStage/shadows.d.ts.map +1 -1
  326. package/dist/src/features/customStage/shadows.lua +3 -1
  327. package/dist/src/features/customTrapdoor/init.lua +1 -7
  328. package/dist/src/features/customTrapdoor/touched.lua +1 -1
  329. package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
  330. package/dist/src/features/deployJSONRoom.lua +6 -8
  331. package/dist/src/features/firstLast.d.ts.map +1 -1
  332. package/dist/src/features/firstLast.lua +3 -3
  333. package/dist/src/features/saveDataManager/constants.d.ts +1 -1
  334. package/dist/src/features/saveDataManager/constants.d.ts.map +1 -1
  335. package/dist/src/features/saveDataManager/exports.d.ts +5 -0
  336. package/dist/src/features/saveDataManager/exports.d.ts.map +1 -1
  337. package/dist/src/features/saveDataManager/exports.lua +16 -0
  338. package/dist/src/features/saveDataManager/main.d.ts +8 -2
  339. package/dist/src/features/saveDataManager/main.d.ts.map +1 -1
  340. package/dist/src/features/saveDataManager/main.lua +3 -5
  341. package/dist/src/features/saveDataManager/save.lua +2 -3
  342. package/dist/src/features.d.ts +34 -0
  343. package/dist/src/features.d.ts.map +1 -0
  344. package/dist/src/features.lua +68 -0
  345. package/dist/src/functions/ambush.d.ts +6 -0
  346. package/dist/src/functions/ambush.d.ts.map +1 -1
  347. package/dist/src/functions/ambush.lua +31 -0
  348. package/dist/src/functions/characters.lua +3 -3
  349. package/dist/src/functions/charge.d.ts +30 -8
  350. package/dist/src/functions/charge.d.ts.map +1 -1
  351. package/dist/src/functions/charge.lua +38 -2
  352. package/dist/src/functions/chargeBar.d.ts +6 -0
  353. package/dist/src/functions/chargeBar.d.ts.map +1 -1
  354. package/dist/src/functions/chargeBar.lua +6 -0
  355. package/dist/src/functions/decorators.d.ts +19 -0
  356. package/dist/src/functions/decorators.d.ts.map +1 -0
  357. package/dist/src/functions/decorators.lua +32 -0
  358. package/dist/src/functions/flying.lua +4 -4
  359. package/dist/src/functions/gridEntities.lua +5 -5
  360. package/dist/src/functions/gridEntitiesSpecific.lua +12 -12
  361. package/dist/src/functions/itemPool.lua +2 -2
  362. package/dist/src/functions/minimap.d.ts +4 -0
  363. package/dist/src/functions/minimap.d.ts.map +1 -1
  364. package/dist/src/functions/minimap.lua +4 -0
  365. package/dist/src/functions/playerHealth.lua +6 -6
  366. package/dist/src/functions/playerIndex.lua +2 -2
  367. package/dist/src/functions/players.d.ts +14 -3
  368. package/dist/src/functions/players.d.ts.map +1 -1
  369. package/dist/src/functions/players.lua +35 -16
  370. package/dist/src/functions/pocketItems.lua +1 -1
  371. package/dist/src/functions/roomTransition.d.ts +3 -4
  372. package/dist/src/functions/roomTransition.d.ts.map +1 -1
  373. package/dist/src/functions/roomTransition.lua +4 -32
  374. package/dist/src/functions/rooms.d.ts +1 -1
  375. package/dist/src/functions/rooms.d.ts.map +1 -1
  376. package/dist/src/functions/rooms.lua +1 -1
  377. package/dist/src/functions/run.d.ts +5 -0
  378. package/dist/src/functions/run.d.ts.map +1 -1
  379. package/dist/src/functions/run.lua +6 -0
  380. package/dist/src/functions/spawnCollectible.d.ts +24 -5
  381. package/dist/src/functions/spawnCollectible.d.ts.map +1 -1
  382. package/dist/src/functions/spawnCollectible.lua +44 -4
  383. package/dist/src/functions/table.d.ts +2 -0
  384. package/dist/src/functions/table.d.ts.map +1 -1
  385. package/dist/src/functions/table.lua +7 -0
  386. package/dist/src/functions/trinkets.lua +1 -1
  387. package/dist/src/functions/tstlClass.d.ts +21 -9
  388. package/dist/src/functions/tstlClass.d.ts.map +1 -1
  389. package/dist/src/functions/tstlClass.lua +49 -24
  390. package/dist/src/functions/utils.d.ts +44 -2
  391. package/dist/src/functions/utils.d.ts.map +1 -1
  392. package/dist/src/functions/utils.lua +43 -2
  393. package/dist/src/index.d.ts +15 -2
  394. package/dist/src/index.d.ts.map +1 -1
  395. package/dist/src/index.lua +42 -10
  396. package/dist/src/initCustomCallbacks.d.ts.map +1 -1
  397. package/dist/src/initCustomCallbacks.lua +0 -3
  398. package/dist/src/initFeatures.lua +3 -3
  399. package/dist/src/interfaces/SaveData.d.ts.map +1 -1
  400. package/dist/src/interfaces/{private/TSTLClassMetatable.d.ts → TSTLClassMetatable.d.ts} +0 -0
  401. package/dist/src/interfaces/TSTLClassMetatable.d.ts.map +1 -0
  402. package/dist/src/interfaces/{private/TSTLClassMetatable.lua → TSTLClassMetatable.lua} +0 -0
  403. package/dist/src/interfaces/private/{AddCallbackParameterCustom.d.ts → AddCallbackParametersCustom.d.ts} +3 -5
  404. package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -0
  405. package/dist/src/interfaces/private/{AddCallbackParameterCustom.lua → AddCallbackParametersCustom.lua} +3 -0
  406. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts +201 -0
  407. package/dist/src/interfaces/private/AddCallbackParametersCustom2.d.ts.map +1 -0
  408. package/dist/src/interfaces/private/AddCallbackParametersCustom2.lua +7 -0
  409. package/dist/src/maps/characterNameToTypeMap.lua +12 -12
  410. package/dist/src/objects/callbackRegisterFunctions.d.ts +1 -1
  411. package/dist/src/objects/callbackRegisterFunctions.d.ts.map +1 -1
  412. package/dist/src/objects/callbackRegisterFunctions.lua +2 -5
  413. package/dist/src/objects/characterDamageMultipliers.lua +6 -6
  414. package/dist/src/objects/characterNames.lua +6 -6
  415. package/dist/src/objects/playerNamePNGFileNames.lua +6 -6
  416. package/dist/src/objects/playerPortraitPNGFileNames.lua +6 -6
  417. package/dist/src/sets/charactersThatStartWithAnActiveItemSet.lua +1 -1
  418. package/dist/src/sets/charactersWithFreeDevilDealsSet.d.ts.map +1 -1
  419. package/dist/src/sets/charactersWithFreeDevilDealsSet.lua +1 -1
  420. package/dist/src/sets/charactersWithNoRedHeartsSet.lua +3 -3
  421. package/dist/src/sets/charactersWithNoSoulHeartsSet.lua +2 -2
  422. package/dist/src/sets/lostStyleCharactersSet.lua +4 -4
  423. package/dist/src/types/AllButFirst.d.ts +5 -0
  424. package/dist/src/types/AllButFirst.d.ts.map +1 -0
  425. package/dist/src/types/AllButFirst.lua +2 -0
  426. package/dist/src/types/AllButLast.d.ts +2 -0
  427. package/dist/src/types/AllButLast.d.ts.map +1 -0
  428. package/dist/src/types/AllButLast.lua +2 -0
  429. package/dist/src/types/Constructor.d.ts +2 -0
  430. package/dist/src/types/Constructor.d.ts.map +1 -0
  431. package/dist/src/types/Constructor.lua +2 -0
  432. package/dist/src/types/FunctionTuple.d.ts +5 -0
  433. package/dist/src/types/FunctionTuple.d.ts.map +1 -0
  434. package/dist/src/types/FunctionTuple.lua +2 -0
  435. package/dist/src/types/HasAllEnumKeys.d.ts +26 -0
  436. package/dist/src/types/HasAllEnumKeys.d.ts.map +1 -0
  437. package/dist/src/types/HasAllEnumKeys.lua +2 -0
  438. package/dist/src/types/LowercaseKeys.d.ts +3 -0
  439. package/dist/src/types/LowercaseKeys.d.ts.map +1 -0
  440. package/dist/src/types/LowercaseKeys.lua +2 -0
  441. package/dist/src/types/StartsWithLowercase.d.ts +2 -0
  442. package/dist/src/types/StartsWithLowercase.d.ts.map +1 -0
  443. package/dist/src/types/StartsWithLowercase.lua +2 -0
  444. package/dist/src/types/StartsWithUppercase.d.ts +2 -0
  445. package/dist/src/types/StartsWithUppercase.d.ts.map +1 -0
  446. package/dist/src/types/StartsWithUppercase.lua +2 -0
  447. package/dist/src/types/UnionToIntersection.d.ts +3 -0
  448. package/dist/src/types/UnionToIntersection.d.ts.map +1 -0
  449. package/dist/src/types/UnionToIntersection.lua +2 -0
  450. package/dist/src/types/UppercaseKeys.d.ts +3 -0
  451. package/dist/src/types/UppercaseKeys.d.ts.map +1 -0
  452. package/dist/src/types/UppercaseKeys.lua +2 -0
  453. package/dist/src/types/private/AllButFirst.d.ts +5 -0
  454. package/dist/src/types/private/AllButFirst.d.ts.map +1 -0
  455. package/dist/src/types/private/AllButFirst.lua +2 -0
  456. package/dist/src/types/private/CallbackTuple.d.ts +20 -0
  457. package/dist/src/types/private/CallbackTuple.d.ts.map +1 -0
  458. package/dist/src/types/private/CallbackTuple.lua +2 -0
  459. package/dist/src/types/private/MatchingCallbackCustom.d.ts +16 -0
  460. package/dist/src/types/private/MatchingCallbackCustom.d.ts.map +1 -0
  461. package/dist/src/types/private/MatchingCallbackCustom.lua +2 -0
  462. package/package.json +2 -2
  463. package/src/callbacks/customRevive.ts +13 -1
  464. package/src/callbacks/postAmbush.ts +7 -14
  465. package/src/callbacks/postBombExploded.ts +1 -1
  466. package/src/callbacks/postBoneSwing.ts +2 -1
  467. package/src/callbacks/postCollectibleEmpty.ts +2 -0
  468. package/src/callbacks/postCollectibleInitFirst.ts +2 -0
  469. package/src/callbacks/postDoorRender.ts +2 -2
  470. package/src/callbacks/postEffectStateChanged.ts +3 -6
  471. package/src/callbacks/postFamiliarStateChanged.ts +3 -3
  472. package/src/callbacks/postFlip.ts +2 -2
  473. package/src/callbacks/postGridEntity.ts +3 -7
  474. package/src/callbacks/postNPCStateChanged.ts +3 -3
  475. package/src/callbacks/postNewRoomEarly.ts +1 -1
  476. package/src/callbacks/postPickupStateChanged.ts +3 -6
  477. package/src/callbacks/postPlayerCollectible.ts +8 -12
  478. package/src/callbacks/postRoomClearChanged.ts +3 -7
  479. package/src/callbacks/reorderedCallbacks.ts +6 -6
  480. package/src/callbacks/subscriptions/{postBoneExploded.ts → postBombExploded.ts} +0 -0
  481. package/src/callbacks/subscriptions/postCollectibleEmpty.ts +1 -1
  482. package/src/callbacks/subscriptions/postCollectibleInitFirst.ts +1 -1
  483. package/src/callbacks/subscriptions/postCursedTeleport.ts +24 -1
  484. package/src/callbacks/subscriptions/postGridEntityBroken.ts +4 -7
  485. package/src/callbacks/subscriptions/postGridEntityCollision.ts +4 -4
  486. package/src/callbacks/subscriptions/postGridEntityInit.ts +4 -7
  487. package/src/callbacks/subscriptions/postGridEntityRemove.ts +10 -9
  488. package/src/callbacks/subscriptions/postGridEntityRender.ts +4 -7
  489. package/src/callbacks/subscriptions/postGridEntityStateChanged.ts +4 -7
  490. package/src/callbacks/subscriptions/postGridEntityUpdate.ts +4 -7
  491. package/src/callbacks/subscriptions/postHolyMantleRemoved.ts +9 -2
  492. package/src/callbacks/subscriptions/postPEffectUpdateReordered.ts +9 -2
  493. package/src/callbacks/subscriptions/postRockRender.ts +6 -7
  494. package/src/callbacks/subscriptions/postRockUpdate.ts +6 -7
  495. package/src/callbacks/subscriptions/postSpikesRender.ts +4 -7
  496. package/src/callbacks/subscriptions/postSpikesUpdate.ts +4 -7
  497. package/src/callbacks/subscriptions/postTNTRender.ts +4 -7
  498. package/src/callbacks/subscriptions/postTNTUpdate.ts +4 -7
  499. package/src/callbacks.ts +134 -0
  500. package/src/classes/DefaultMap.ts +3 -3
  501. package/src/classes/ModFeature.ts +14 -0
  502. package/src/classes/ModUpgraded.ts +205 -45
  503. package/src/classes/callbacks/PostAmbushFinished.ts +39 -0
  504. package/src/classes/callbacks/PostAmbushStarted.ts +39 -0
  505. package/src/classes/callbacks/PostBombExploded.ts +21 -0
  506. package/src/classes/callbacks/PostBombInitLate.ts +28 -0
  507. package/src/classes/callbacks/PostBoneSwing.ts +61 -0
  508. package/src/classes/callbacks/PostCollectibleEmpty.ts +72 -0
  509. package/src/classes/callbacks/PostCollectibleInitFirst.ts +37 -0
  510. package/src/classes/callbacks/PostCursedTeleport.ts +186 -0
  511. package/src/classes/callbacks/PostCustomRevive.ts +11 -0
  512. package/src/classes/callbacks/PostDiceRoomActivated.ts +68 -0
  513. package/src/classes/callbacks/PostDoorRender.ts +19 -0
  514. package/src/classes/callbacks/PostDoorUpdate.ts +19 -0
  515. package/src/classes/callbacks/PostEffectInitLate.ts +28 -0
  516. package/src/classes/callbacks/PostEffectStateChanged.ts +35 -0
  517. package/src/classes/callbacks/PostEsauJr.ts +11 -0
  518. package/src/classes/callbacks/PostFamiliarInitLate.ts +28 -0
  519. package/src/classes/callbacks/PostFamiliarStateChanged.ts +35 -0
  520. package/src/classes/callbacks/PostFirstEsauJr.ts +11 -0
  521. package/src/classes/callbacks/PostFirstFlip.ts +11 -0
  522. package/src/classes/callbacks/PostFlip.ts +11 -0
  523. package/src/classes/callbacks/PostGameStartedReordered.ts +11 -0
  524. package/src/classes/callbacks/PostGameStartedReorderedLast.ts +11 -0
  525. package/src/classes/callbacks/PostGreedModeWave.ts +37 -0
  526. package/src/classes/callbacks/PostGridEntityBroken.ts +11 -0
  527. package/src/classes/callbacks/PostGridEntityCollision.ts +65 -0
  528. package/src/classes/callbacks/PostGridEntityCustomBroken.ts +11 -0
  529. package/src/classes/callbacks/PostGridEntityCustomCollision.ts +53 -0
  530. package/src/classes/callbacks/PostGridEntityCustomInit.ts +11 -0
  531. package/src/classes/callbacks/PostGridEntityCustomRemove.ts +32 -0
  532. package/src/classes/callbacks/PostGridEntityCustomStateChanged.ts +11 -0
  533. package/src/classes/callbacks/PostGridEntityCustomUpdate.ts +11 -0
  534. package/src/classes/callbacks/PostGridEntityInit.ts +11 -0
  535. package/src/classes/callbacks/PostGridEntityRemove.ts +39 -0
  536. package/src/classes/callbacks/PostGridEntityStateChanged.ts +11 -0
  537. package/src/classes/callbacks/PostGridEntityUpdate.ts +11 -0
  538. package/src/classes/callbacks/PostHolyMantleRemoved.ts +45 -0
  539. package/src/classes/callbacks/PostKnifeInitLate.ts +28 -0
  540. package/src/classes/callbacks/PostNewLevelReordered.ts +11 -0
  541. package/src/classes/callbacks/PostNewRoomEarly.ts +93 -0
  542. package/src/classes/callbacks/PostNewRoomReordered.ts +11 -0
  543. package/src/classes/callbacks/PostPEffectUpdateReordered.ts +11 -0
  544. package/src/classes/callbacks/PostPitRender.ts +21 -0
  545. package/src/classes/callbacks/PostPlayerFatalDamage.ts +127 -0
  546. package/src/classes/callbacks/PostPlayerRenderReordered.ts +11 -0
  547. package/src/classes/callbacks/PostPlayerUpdateReordered.ts +11 -0
  548. package/src/classes/callbacks/PostRoomClearChanged.ts +40 -0
  549. package/src/classes/callbacks/PostSpikesRender.ts +21 -0
  550. package/src/classes/callbacks/PreBerserkDeath.ts +42 -0
  551. package/src/classes/callbacks/PreCustomRevive.ts +11 -0
  552. package/src/classes/callbacks/validation/CustomCallbackAmbush.ts +28 -0
  553. package/src/classes/callbacks/validation/CustomCallbackBomb.ts +27 -0
  554. package/src/classes/callbacks/validation/CustomCallbackCollectible.ts +30 -0
  555. package/src/classes/callbacks/validation/CustomCallbackDoor.ts +28 -0
  556. package/src/classes/callbacks/validation/CustomCallbackEffect.ts +29 -0
  557. package/src/classes/callbacks/validation/CustomCallbackFamiliar.ts +30 -0
  558. package/src/classes/callbacks/validation/CustomCallbackGridEntity.ts +42 -0
  559. package/src/classes/callbacks/validation/CustomCallbackGridEntityCustom.ts +36 -0
  560. package/src/classes/callbacks/validation/CustomCallbackKnife.ts +27 -0
  561. package/src/classes/callbacks/validation/CustomCallbackPit.ts +28 -0
  562. package/src/classes/callbacks/validation/CustomCallbackPlayer.ts +47 -0
  563. package/src/classes/callbacks/validation/CustomCallbackRevive.ts +27 -0
  564. package/src/classes/callbacks/validation/CustomCallbackSpikes.ts +28 -0
  565. package/src/classes/features/callbackLogic/CustomGridEntities.ts +398 -0
  566. package/src/classes/features/callbackLogic/CustomRevive.ts +214 -0
  567. package/src/classes/features/callbackLogic/EsauJrDetection.ts +98 -0
  568. package/src/classes/features/callbackLogic/FlipDetection.ts +82 -0
  569. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +160 -0
  570. package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +90 -0
  571. package/src/classes/features/callbackLogic/GridEntityDetection.ts +231 -0
  572. package/src/classes/features/callbackLogic/PlayerReorderedCallbacks.ts +126 -0
  573. package/src/classes/features/other/RunInNFrames.ts +256 -0
  574. package/src/classes/private/CustomCallback.ts +82 -0
  575. package/src/classes/private/Feature.ts +24 -0
  576. package/src/core/upgradeMod.ts +77 -17
  577. package/src/decorators.ts +13 -0
  578. package/src/enums/ISCFeature.ts +47 -0
  579. package/src/enums/LadderSubTypeCustom.ts +17 -0
  580. package/src/enums/ModCallbackCustom.ts +314 -243
  581. package/src/enums/ModCallbackCustom2.ts +57 -0
  582. package/src/features/customGridEntity.ts +3 -7
  583. package/src/features/{setHotkey.ts → customHotkeys.ts} +2 -2
  584. package/src/features/customPickup.ts +4 -2
  585. package/src/features/customStage/backdrop.ts +2 -1
  586. package/src/features/customStage/shadows.ts +2 -1
  587. package/src/features/customTrapdoor/init.ts +0 -1
  588. package/src/features/customTrapdoor/touched.ts +1 -1
  589. package/src/features/deployJSONRoom.ts +3 -7
  590. package/src/features/extraConsoleCommands/listCommands.ts +1 -1
  591. package/src/features/firstLast.ts +3 -7
  592. package/src/features/saveDataManager/constants.ts +1 -1
  593. package/src/features/saveDataManager/exports.ts +27 -0
  594. package/src/features/saveDataManager/main.ts +30 -21
  595. package/src/features/saveDataManager/save.ts +2 -2
  596. package/src/features.ts +90 -0
  597. package/src/functions/ambush.ts +26 -1
  598. package/src/functions/characters.ts +3 -3
  599. package/src/functions/charge.ts +30 -8
  600. package/src/functions/chargeBar.ts +6 -0
  601. package/src/functions/decorators.ts +45 -0
  602. package/src/functions/flying.ts +4 -4
  603. package/src/functions/gridEntities.ts +5 -5
  604. package/src/functions/gridEntitiesSpecific.ts +12 -12
  605. package/src/functions/itemPool.ts +2 -2
  606. package/src/functions/minimap.ts +4 -0
  607. package/src/functions/playerHealth.ts +6 -6
  608. package/src/functions/playerIndex.ts +2 -2
  609. package/src/functions/players.ts +26 -7
  610. package/src/functions/pocketItems.ts +1 -1
  611. package/src/functions/roomTransition.ts +3 -27
  612. package/src/functions/rooms.ts +1 -1
  613. package/src/functions/run.ts +12 -0
  614. package/src/functions/spawnCollectible.ts +44 -4
  615. package/src/functions/table.ts +11 -0
  616. package/src/functions/trinkets.ts +1 -1
  617. package/src/functions/tstlClass.ts +48 -24
  618. package/src/functions/utils.ts +56 -2
  619. package/src/index.ts +15 -2
  620. package/src/initCustomCallbacks.ts +1 -2
  621. package/src/initFeatures.ts +2 -2
  622. package/src/interfaces/SaveData.ts +4 -2
  623. package/src/interfaces/{private/TSTLClassMetatable.ts → TSTLClassMetatable.ts} +0 -0
  624. package/src/interfaces/private/{AddCallbackParameterCustom.ts → AddCallbackParametersCustom.ts} +4 -23
  625. package/src/interfaces/private/AddCallbackParametersCustom2.ts +343 -0
  626. package/src/maps/characterNameToTypeMap.ts +12 -12
  627. package/src/objects/callbackRegisterFunctions.ts +2 -4
  628. package/src/objects/characterDamageMultipliers.ts +6 -6
  629. package/src/objects/characterNames.ts +6 -6
  630. package/src/objects/playerNamePNGFileNames.ts +6 -6
  631. package/src/objects/playerPortraitPNGFileNames.ts +6 -6
  632. package/src/sets/charactersThatStartWithAnActiveItemSet.ts +1 -1
  633. package/src/sets/charactersWithFreeDevilDealsSet.ts +1 -1
  634. package/src/sets/charactersWithNoRedHeartsSet.ts +3 -3
  635. package/src/sets/charactersWithNoSoulHeartsSet.ts +2 -2
  636. package/src/sets/lostStyleCharactersSet.ts +4 -4
  637. package/src/types/AllButFirst.ts +6 -0
  638. package/src/types/AllButLast.ts +3 -0
  639. package/src/types/Constructor.ts +2 -0
  640. package/src/types/FunctionTuple.ts +4 -0
  641. package/src/types/HasAllEnumKeys.ts +25 -0
  642. package/src/types/LowercaseKeys.ts +3 -0
  643. package/src/types/StartsWithLowercase.ts +3 -0
  644. package/src/types/StartsWithUppercase.ts +3 -0
  645. package/src/types/UnionToIntersection.ts +6 -0
  646. package/src/types/UppercaseKeys.ts +3 -0
  647. package/src/types/private/AllButFirst.ts +6 -0
  648. package/src/types/private/CallbackTuple.ts +21 -0
  649. package/src/types/private/MatchingCallbackCustom.ts +32 -0
  650. package/dist/src/callbacks/postCustomDoorEnter.d.ts +0 -6
  651. package/dist/src/callbacks/postCustomDoorEnter.d.ts.map +0 -1
  652. package/dist/src/callbacks/postCustomDoorEnter.lua +0 -199
  653. package/dist/src/callbacks/subscriptions/postCustomDoorEnter.d.ts +0 -9
  654. package/dist/src/callbacks/subscriptions/postCustomDoorEnter.d.ts.map +0 -1
  655. package/dist/src/callbacks/subscriptions/postCustomDoorEnter.lua +0 -29
  656. package/dist/src/classes/CustomCallback.d.ts +0 -8
  657. package/dist/src/classes/CustomCallback.d.ts.map +0 -1
  658. package/dist/src/classes/CustomCallback.lua +0 -28
  659. package/dist/src/features/customDoor.d.ts +0 -51
  660. package/dist/src/features/customDoor.d.ts.map +0 -1
  661. package/dist/src/features/customDoor.lua +0 -53
  662. package/dist/src/features/setHotkey.d.ts.map +0 -1
  663. package/dist/src/interfaces/private/AddCallbackParameterCustom.d.ts.map +0 -1
  664. package/dist/src/interfaces/private/TSTLClassMetatable.d.ts.map +0 -1
  665. package/src/callbacks/postCustomDoorEnter.ts +0 -250
  666. package/src/callbacks/subscriptions/postCustomDoorEnter.ts +0 -42
  667. package/src/classes/CustomCallback.ts +0 -23
  668. package/src/features/customDoor.ts +0 -66
package/dist/index.d.ts CHANGED
@@ -88,7 +88,6 @@ declare interface AddCallbackParametersCustom {
88
88
  [ModCallbackCustom.POST_COLLECTIBLE_EMPTY]: PostCollectibleEmptyRegisterParameters;
89
89
  [ModCallbackCustom.POST_COLLECTIBLE_INIT_FIRST]: PostCollectibleInitFirstRegisterParameters;
90
90
  [ModCallbackCustom.POST_CURSED_TELEPORT]: PostCursedTeleportRegisterParameters;
91
- [ModCallbackCustom.POST_CUSTOM_DOOR_ENTER]: PostCustomDoorEnterRegisterParameters;
92
91
  [ModCallbackCustom.POST_CUSTOM_REVIVE]: PostCustomReviveRegisterParameters;
93
92
  [ModCallbackCustom.POST_DICE_ROOM_ACTIVATED]: PostDiceRoomActivatedRegisterParameters;
94
93
  [ModCallbackCustom.POST_DOOR_RENDER]: PostDoorRenderRegisterParameters;
@@ -133,7 +132,6 @@ declare interface AddCallbackParametersCustom {
133
132
  [ModCallbackCustom.POST_PICKUP_INIT_FIRST]: PostPickupInitFirstRegisterParameters;
134
133
  [ModCallbackCustom.POST_PICKUP_INIT_LATE]: PostPickupInitLateRegisterParameters;
135
134
  [ModCallbackCustom.POST_PICKUP_STATE_CHANGED]: PostPickupStateChangedRegisterParameters;
136
- [ModCallbackCustom.POST_PIT_RENDER]: PostPitRenderRegisterParameters;
137
135
  [ModCallbackCustom.POST_PIT_UPDATE]: PostPitUpdateRegisterParameters;
138
136
  [ModCallbackCustom.POST_PLAYER_CHANGE_HEALTH]: PostPlayerChangeHealthRegisterParameters;
139
137
  [ModCallbackCustom.POST_PLAYER_CHANGE_STAT]: PostPlayerChangeStatRegisterParameters;
@@ -145,6 +143,7 @@ declare interface AddCallbackParametersCustom {
145
143
  [ModCallbackCustom.POST_PLAYER_INIT_LATE]: PostPlayerInitLateRegisterParameters;
146
144
  [ModCallbackCustom.POST_PLAYER_RENDER_REORDERED]: PostPlayerRenderReorderedRegisterParameters;
147
145
  [ModCallbackCustom.POST_PLAYER_UPDATE_REORDERED]: PostPlayerUpdateReorderedRegisterParameters;
146
+ [ModCallbackCustom.POST_PIT_RENDER]: PostPitRenderRegisterParameters;
148
147
  [ModCallbackCustom.POST_POOP_RENDER]: PostPoopRenderRegisterParameters;
149
148
  [ModCallbackCustom.POST_POOP_UPDATE]: PostPoopUpdateRegisterParameters;
150
149
  [ModCallbackCustom.POST_PRESSURE_PLATE_RENDER]: PostPressurePlateRenderRegisterParameters;
@@ -176,6 +175,204 @@ declare interface AddCallbackParametersCustom {
176
175
  [ModCallbackCustom.PRE_NEW_LEVEL]: PreNewLevelRegisterParameters;
177
176
  }
178
177
 
178
+ declare interface AddCallbackParametersCustom2 {
179
+ [ModCallbackCustom2.POST_AMBUSH_FINISHED]: [
180
+ callback: (ambushType: AmbushType) => void,
181
+ ambushType?: AmbushType
182
+ ];
183
+ [ModCallbackCustom2.POST_AMBUSH_STARTED]: [
184
+ callback: (ambushType: AmbushType) => void,
185
+ ambushType?: AmbushType
186
+ ];
187
+ [ModCallbackCustom2.POST_BOMB_EXPLODED]: [
188
+ callback: (bomb: EntityBomb) => void,
189
+ bombVariant?: BombVariant
190
+ ];
191
+ [ModCallbackCustom2.POST_BOMB_INIT_LATE]: [
192
+ callback: (bomb: EntityBomb) => void,
193
+ bombVariant?: BombVariant
194
+ ];
195
+ [ModCallbackCustom2.POST_BONE_SWING]: [
196
+ callback: (knife: EntityKnife) => void
197
+ ];
198
+ [ModCallbackCustom2.POST_COLLECTIBLE_EMPTY]: [
199
+ callback: (collectible: EntityPickupCollectible, oldCollectibleType: CollectibleType) => void,
200
+ collectibleType?: CollectibleType
201
+ ];
202
+ [ModCallbackCustom2.POST_COLLECTIBLE_INIT_FIRST]: [
203
+ callback: (collectible: EntityPickupCollectible) => void,
204
+ collectibleType?: CollectibleType
205
+ ];
206
+ [ModCallbackCustom2.POST_CURSED_TELEPORT]: [
207
+ callback: (player: EntityPlayer) => void,
208
+ playerVariant?: PlayerVariant,
209
+ character?: PlayerType
210
+ ];
211
+ [ModCallbackCustom2.POST_CUSTOM_REVIVE]: [
212
+ callback: (player: EntityPlayer, revivalType: int) => void,
213
+ revivalType?: int
214
+ ];
215
+ [ModCallbackCustom2.POST_DICE_ROOM_ACTIVATED]: [
216
+ callback: (player: EntityPlayer, diceFloorSubType: DiceFloorSubType) => void,
217
+ diceFloorSubType?: DiceFloorSubType
218
+ ];
219
+ [ModCallbackCustom2.POST_DOOR_RENDER]: [
220
+ callback: (door: GridEntityDoor) => void,
221
+ doorVariant?: DoorVariant
222
+ ];
223
+ [ModCallbackCustom2.POST_DOOR_UPDATE]: [
224
+ callback: (door: GridEntityDoor) => void,
225
+ doorVariant?: DoorVariant
226
+ ];
227
+ [ModCallbackCustom2.POST_EFFECT_INIT_LATE]: [
228
+ callback: (effect: EntityEffect) => void,
229
+ effectVariant?: EffectVariant
230
+ ];
231
+ [ModCallbackCustom2.POST_EFFECT_STATE_CHANGED]: [
232
+ callback: (effect: EntityEffect, previousState: int, currentState: int) => void,
233
+ effectVariant?: EffectVariant
234
+ ];
235
+ [ModCallbackCustom2.POST_ESAU_JR]: [callback: (player: EntityPlayer) => void];
236
+ [ModCallbackCustom2.POST_FAMILIAR_INIT_LATE]: [
237
+ callback: (familiar: EntityFamiliar) => void,
238
+ familiarVariant?: FamiliarVariant
239
+ ];
240
+ [ModCallbackCustom2.POST_FAMILIAR_STATE_CHANGED]: [
241
+ callback: (familiar: EntityFamiliar, previousState: int, currentState: int) => void,
242
+ familiarVariant?: FamiliarVariant
243
+ ];
244
+ [ModCallbackCustom2.POST_FIRST_ESAU_JR]: [
245
+ callback: (player: EntityPlayer) => void
246
+ ];
247
+ [ModCallbackCustom2.POST_FIRST_FLIP]: [
248
+ callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
249
+ ];
250
+ [ModCallbackCustom2.POST_FLIP]: [
251
+ callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
252
+ ];
253
+ [ModCallbackCustom2.POST_GAME_STARTED_REORDERED]: [
254
+ callback: (isContinued: boolean) => void
255
+ ];
256
+ [ModCallbackCustom2.POST_GAME_STARTED_REORDERED_LAST]: [
257
+ callback: (isContinued: boolean) => void
258
+ ];
259
+ [ModCallbackCustom2.POST_GREED_MODE_WAVE]: [
260
+ callback: (oldWave: int, newWave: int) => void
261
+ ];
262
+ [ModCallbackCustom2.POST_GRID_ENTITY_BROKEN]: [
263
+ callback: (gridEntity: GridEntity) => void,
264
+ gridEntityType?: GridEntityType,
265
+ variant?: int
266
+ ];
267
+ [ModCallbackCustom2.POST_GRID_ENTITY_COLLISION]: [
268
+ callback: (gridEntity: GridEntity, entity: Entity) => void,
269
+ gridEntityType?: GridEntityType,
270
+ gridEntityVariant?: int,
271
+ entityType?: EntityType,
272
+ entityVariant?: int
273
+ ];
274
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_BROKEN]: [
275
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
276
+ gridEntityTypeCustom?: GridEntityType
277
+ ];
278
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_COLLISION]: [
279
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity) => void,
280
+ gridEntityTypeCustom?: GridEntityType,
281
+ entityType?: EntityType,
282
+ entityVariant?: int
283
+ ];
284
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_INIT]: [
285
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
286
+ gridEntityTypeCustom?: GridEntityType
287
+ ];
288
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_REMOVE]: [
289
+ callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
290
+ gridEntityTypeCustom?: GridEntityType
291
+ ];
292
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED]: [
293
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void,
294
+ gridEntityTypeCustom?: GridEntityType
295
+ ];
296
+ [ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_UPDATE]: [
297
+ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
298
+ gridEntityTypeCustom?: GridEntityType
299
+ ];
300
+ [ModCallbackCustom2.POST_GRID_ENTITY_INIT]: [
301
+ callback: (gridEntity: GridEntity) => void,
302
+ gridEntityType?: GridEntityType,
303
+ variant?: int
304
+ ];
305
+ [ModCallbackCustom2.POST_GRID_ENTITY_REMOVE]: [
306
+ callback: (gridIndex: int, gridEntityType: GridEntityType, variant: int) => void,
307
+ gridEntityType?: GridEntityType,
308
+ variant?: int
309
+ ];
310
+ [ModCallbackCustom2.POST_GRID_ENTITY_STATE_CHANGED]: [
311
+ callback: (gridEntity: GridEntity, oldState: int, newState: int) => void,
312
+ gridEntityType?: GridEntityType,
313
+ variant?: int
314
+ ];
315
+ [ModCallbackCustom2.POST_GRID_ENTITY_UPDATE]: [
316
+ callback: (gridEntity: GridEntity) => void,
317
+ gridEntityType?: GridEntityType,
318
+ variant?: int
319
+ ];
320
+ [ModCallbackCustom2.POST_HOLY_MANTLE_REMOVED]: [
321
+ callback: (player: EntityPlayer, oldNumHolyMantles: int, newNumHolyMantles: int) => void,
322
+ playerVariant?: PlayerVariant,
323
+ character?: PlayerType
324
+ ];
325
+ [ModCallbackCustom2.POST_NEW_LEVEL_REORDERED]: [callback: () => void];
326
+ [ModCallbackCustom2.POST_KNIFE_INIT_LATE]: [
327
+ callback: (knife: EntityKnife) => void,
328
+ knifeVariant?: KnifeVariant
329
+ ];
330
+ [ModCallbackCustom2.POST_NEW_ROOM_EARLY]: [callback: () => void];
331
+ [ModCallbackCustom2.POST_NEW_ROOM_REORDERED]: [callback: () => void];
332
+ [ModCallbackCustom2.POST_PEFFECT_UPDATE_REORDERED]: [
333
+ callback: (player: EntityPlayer) => void,
334
+ playerVariant?: PlayerVariant,
335
+ character?: PlayerType
336
+ ];
337
+ [ModCallbackCustom2.POST_PIT_RENDER]: [
338
+ callback: (pit: GridEntityPit) => void,
339
+ pitVariant?: PitVariant
340
+ ];
341
+ [ModCallbackCustom2.POST_PLAYER_FATAL_DAMAGE]: [
342
+ callback: (player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined,
343
+ playerVariant?: PlayerVariant,
344
+ character?: PlayerType
345
+ ];
346
+ [ModCallbackCustom2.POST_PLAYER_RENDER_REORDERED]: [
347
+ callback: (player: EntityPlayer) => void,
348
+ playerVariant?: PlayerVariant,
349
+ character?: PlayerType
350
+ ];
351
+ [ModCallbackCustom2.POST_PLAYER_UPDATE_REORDERED]: [
352
+ callback: (player: EntityPlayer) => void,
353
+ playerVariant?: PlayerVariant,
354
+ character?: PlayerType
355
+ ];
356
+ [ModCallbackCustom2.POST_ROOM_CLEAR_CHANGED]: [
357
+ callback: (roomClear: boolean) => void,
358
+ roomClear?: boolean
359
+ ];
360
+ [ModCallbackCustom2.POST_SPIKES_RENDER]: [
361
+ callback: (spikes: GridEntitySpikes) => void,
362
+ variant?: int
363
+ ];
364
+ [ModCallbackCustom2.PRE_BERSERK_DEATH]: [
365
+ callback: (player: EntityPlayer) => void,
366
+ playerVariant?: PlayerVariant,
367
+ character?: PlayerType
368
+ ];
369
+ [ModCallbackCustom2.PRE_CUSTOM_REVIVE]: [
370
+ callback: (player: EntityPlayer) => int | undefined,
371
+ playerVariant?: PlayerVariant,
372
+ character?: PlayerType
373
+ ];
374
+ }
375
+
179
376
  /**
180
377
  * Helper function to add a charge to the player's active item. Will flash the HUD and play the
181
378
  * appropriate sound effect, depending on whether the charge is partially full or completely full.
@@ -188,14 +385,14 @@ declare interface AddCallbackParametersCustom {
188
385
  * - AAA Battery
189
386
  *
190
387
  * @param player The player to grant the charges to.
191
- * @param activeSlot The slot to grant the charges to.
388
+ * @param activeSlot Optional. The slot to grant the charges to. Default is `ActiveSlot.PRIMARY`.
192
389
  * @param numCharges Optional. The amount of charges to grant. Default is 1.
193
390
  * @param playSoundEffect Optional. Whether to play a charge-related sound effect. Default is true.
194
391
  * @returns The amount of charges that were actually granted. For example, if the active item was
195
392
  * only one away from a full charge, but the `numCharges` provided to this function was 2,
196
393
  * then this function would return 1.
197
394
  */
198
- export declare function addCharge(player: EntityPlayer, activeSlot: ActiveSlot, numCharges?: number, playSoundEffect?: boolean): int;
395
+ export declare function addCharge(player: EntityPlayer, activeSlot?: ActiveSlot, numCharges?: number, playSoundEffect?: boolean): int;
199
396
 
200
397
  export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
201
398
 
@@ -284,18 +481,21 @@ export declare function addRoomClearCharges(bigRoomDoubleCharge?: boolean): void
284
481
  * - Not charging active items with `chargetype="special"`
285
482
  *
286
483
  * @param player The player to grant the charges to.
287
- * @param activeSlot The active item slot to grant the charges to.
484
+ * @param activeSlot Optional. The active item slot to grant the charges to. Default is
485
+ * `ActiveSlot.PRIMARY`.
288
486
  * @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
289
487
  * room for the purposes of calculating how much charge to grant. Default
290
488
  * is true.
291
489
  * @param playSoundEffect Optional. Whether to play a charge-related sound effect. Default is true.
292
490
  */
293
- export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot: ActiveSlot, bigRoomDoubleCharge?: boolean, playSoundEffect?: boolean): void;
491
+ export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot?: ActiveSlot, bigRoomDoubleCharge?: boolean, playSoundEffect?: boolean): void;
294
492
 
295
493
  /**
296
494
  * Helper function to add a `DisplayFlag` to a particular room's minimap display flags (e.g. whether
297
495
  * or not it is visible and so on).
298
496
  *
497
+ * This function automatically accounts for whether or not MinimapAPI is being used.
498
+ *
299
499
  * @param roomGridIndex Set to undefined to use the current room index.
300
500
  * @param displayFlag The `DisplayFlag` to set. (See the `DisplayFlag` enum.)
301
501
  * @param updateVisibility Optional. Whether to call the `Level.UpdateVisibility` method in order to
@@ -333,6 +533,18 @@ export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
333
533
  readonly __displayFlagBrand: symbol;
334
534
  }>;
335
535
 
536
+ export declare type AllButFirst<T extends unknown[]> = T extends [
537
+ unknown,
538
+ ...infer Tail
539
+ ] ? Tail : unknown[];
540
+
541
+ declare type AllButFirst_2<T extends unknown[]> = T extends [
542
+ unknown,
543
+ ...infer Tail
544
+ ] ? Tail : unknown[];
545
+
546
+ export declare type AllButLast<T extends unknown[]> = T extends [...infer Head, unknown] ? Head : unknown[];
547
+
336
548
  /** This is used by the `POST_AMBUSH_STARTED` and `POST_AMBUSH_FINISHED` custom callbacks. */
337
549
  export declare enum AmbushType {
338
550
  CHALLENGE_ROOM = 0,
@@ -612,6 +824,37 @@ export declare function calculateStageType(stage: LevelStage): StageType;
612
824
  */
613
825
  export declare function calculateStageTypeRepentance(stage: LevelStage): StageType;
614
826
 
827
+ /**
828
+ * A decorator function that signifies that the decorated class method should be automatically
829
+ * registered with `Mod.AddCallback`.
830
+ */
831
+ export declare function Callback<T extends ModCallback>(modCallback: T, ...optionalArgs: AllButFirst<AddCallbackParameters[T]>): <Class extends ModFeature, Fn extends AddCallbackParameters[T][0]>(target: Class, propertyKey: string, _descriptor: TypedPropertyDescriptor<Fn>) => void;
832
+
833
+ /**
834
+ * A decorator function that signifies that the decorated class method should be automatically
835
+ * registered with `ModUpgraded.AddCallbackCustom`.
836
+ */
837
+ export declare function CallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, ...optionalArgs: AllButFirst<AddCallbackParametersCustom2[T]>): <Class extends {
838
+ mod: ModUpgraded;
839
+ }>(target: Class, propertyKey: string) => void;
840
+
841
+ declare type CallbackSignatureGridEntity = ((gridEntity: GridEntity) => void) | ((gridEntity: GridEntity, oldState: int, newState: int) => void);
842
+
843
+ declare type CallbackSignatureGridEntityCustom = ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void) | ((gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void);
844
+
845
+ declare type CallbackSignaturePlayer = ((player: EntityPlayer) => void) | ((player: EntityPlayer) => int | undefined) | ((player: EntityPlayer, amount: float, damageFlags: BitFlags<DamageFlag>, source: EntityRef, countdownFrames: int) => boolean | undefined);
846
+
847
+ declare type CallbackSignatureRevive = (player: EntityPlayer, revivalType: int) => void;
848
+
849
+ /**
850
+ * A mapping of the callback enum to the associated callback functions (and optional arguments).
851
+ * This is so that the respective callback functions can be added/removed on demand as subscribers
852
+ * get added/removed.
853
+ */
854
+ declare type CallbackTuple = {
855
+ [K in ModCallback]: [K, AddCallbackParameters[K]];
856
+ }[ModCallback];
857
+
615
858
  /**
616
859
  * Helper function to see if the provided player can pick up an eternal heart. (If a player already
617
860
  * has an eternal heart and full heart containers, they are not able to pick up any additional
@@ -887,6 +1130,8 @@ export declare function combineArrays<T>(...arrays: Array<T[] | readonly T[]>):
887
1130
  */
888
1131
  export declare function combineSets<T>(...sets: Array<Set<T> | ReadonlySet<T>>): Set<T>;
889
1132
 
1133
+ export declare type Constructor = new (...args: any[]) => {};
1134
+
890
1135
  /**
891
1136
  * Helper function to get the enum name for the specified `Controller` value. Note that this will
892
1137
  * trim off the "BUTTON_" prefix.
@@ -1016,6 +1261,215 @@ export declare const CUSTOM_FLOOR_STAGE: LevelStage;
1016
1261
  */
1017
1262
  export declare const CUSTOM_FLOOR_STAGE_TYPE = StageType.WRATH_OF_THE_LAMB;
1018
1263
 
1264
+ /**
1265
+ * The base class for a custom callback. Individual custom callbacks (and validation callbacks) will
1266
+ * extend from this class.
1267
+ */
1268
+ declare abstract class CustomCallback<T extends ModCallbackCustom2> extends Feature {
1269
+ private subscriptions;
1270
+ hasSubscriptions(): boolean;
1271
+ add(...args: AddCallbackParametersCustom2[T]): void;
1272
+ /**
1273
+ * If the submitted function does not match any of the existing subscriptions, this method will do
1274
+ * nothing.
1275
+ */
1276
+ remove(callback: AddCallbackParametersCustom2[T][0]): void;
1277
+ fire: (...fireArgs: FireArgs<T>) => ReturnType<AddCallbackParametersCustom2[T][0]>;
1278
+ /**
1279
+ * This method needs to be overwritten for any callback that has optional filtration arguments.
1280
+ */
1281
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1282
+ }
1283
+
1284
+ declare class CustomCallbackGridEntity<T extends ModCallbackCustomGridEntity> extends CustomCallback<T> {
1285
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1286
+ }
1287
+
1288
+ declare class CustomCallbackGridEntityCustom<T extends ModCallbackCustomGridEntityCustom> extends CustomCallback<T> {
1289
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1290
+ }
1291
+
1292
+ declare class CustomCallbackPlayer<T extends ModCallbackCustomPlayer> extends CustomCallback<T> {
1293
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1294
+ }
1295
+
1296
+ declare class CustomCallbackRevive<T extends ModCallbackCustomRevive> extends CustomCallback<T> {
1297
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
1298
+ }
1299
+
1300
+ /**
1301
+ * A mapping of the custom callback enum to the associated callback functions (and optional
1302
+ * arguments). This is so that the respective callback functions can be added/removed on demand as
1303
+ * subscribers get added/removed.
1304
+ */
1305
+ declare type CustomCallbackTuple = {
1306
+ [K in ModCallbackCustom2]: [K, AddCallbackParametersCustom2[K]];
1307
+ }[ModCallbackCustom2];
1308
+
1309
+ declare class CustomGridEntities extends Feature {
1310
+ v: {
1311
+ level: {
1312
+ /** Indexed by room list index and grid index. */
1313
+ customGridEntities: DefaultMap<number, Map<number, GridEntityCustomData>, []>;
1314
+ };
1315
+ room: {
1316
+ genericPropPtrHashes: Set<PtrHash>;
1317
+ manuallyUsingShovel: boolean;
1318
+ };
1319
+ };
1320
+ private runInNFrames;
1321
+ constructor(runInNFrames: RunInNFrames);
1322
+ private preUseItemWeNeedToGoDeeper;
1323
+ private postNewRoomReordered;
1324
+ /**
1325
+ * Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
1326
+ * will reappear if the player leaves and re-enters the room. (It will be manually respawned in
1327
+ * the `POST_NEW_ROOM` callback.)
1328
+ *
1329
+ * Custom grid entities are built on top of real grid entities. You can use any existing grid
1330
+ * entity type as a base. For example, if you want to create a custom rock that would be breakable
1331
+ * like a normal rock, then you should specify `GridEntityType.ROCK` as the base grid entity type.
1332
+ *
1333
+ * Once a custom grid entity is spawned, you can take advantage of the custom grid callbacks such
1334
+ * as `POST_GRID_ENTITY_CUSTOM_UPDATE`. Note that the "normal" grid entities callbacks will not
1335
+ * fire for custom entities. For example, if you had a custom grid entity based on
1336
+ * `GridEntityType.ROCK`, and you also had a subscription to the `POST_GRID_ENTITY_UPDATE`
1337
+ * callback, the callback would only fire for normal rocks and not the custom entity.
1338
+ *
1339
+ * Custom grid entities are an IsaacScript feature because the vanilla game does not support any
1340
+ * custom grid entities.
1341
+ *
1342
+ * For example, this would be code to create a custom rock called a "Silver Rock" that produces a
1343
+ * dime when destroyed:
1344
+ *
1345
+ * ```ts
1346
+ * // This is local to the mod and can safely overlap with the values of `GridEntityType`.
1347
+ * const GridEntityTypeCustom = {
1348
+ * SILVER_ROCK: 0 as GridEntityType,
1349
+ * } as const;
1350
+ *
1351
+ * // This is copied from "gfx/grid/grid_rock.anm2" with some tweaks to make it look special.
1352
+ * const SILVER_ROCK_ANM2_PATH = "gfx/grid/grid_rock_silver.anm2";
1353
+ *
1354
+ * export function silverRockInit(mod: ModUpgraded): void {
1355
+ * mod.AddCallbackCustom(
1356
+ * ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN,
1357
+ * postGridEntityCustomBrokenSilverRock,
1358
+ * GridEntityTypeCustom.SILVER_ROCK,
1359
+ * );
1360
+ * }
1361
+ *
1362
+ * function postGridEntityCustomBrokenSilverRock(gridEntity: GridEntity) {
1363
+ * spawnCoin(CoinSubType.DIME, gridEntity.Position);
1364
+ * }
1365
+ *
1366
+ * export function spawnSilverRock(mod: ModUpgraded, gridIndex: int): GridEntity {
1367
+ * return mod.spawnCustomGridEntity(
1368
+ * GridEntityTypeCustom.SILVER_ROCK,
1369
+ * gridIndex,
1370
+ * undefined,
1371
+ * SILVER_ROCK_ANM2_PATH,
1372
+ * undefined,
1373
+ * GridEntityType.ROCK,
1374
+ * );
1375
+ * }
1376
+ * ```
1377
+ *
1378
+ * @param gridEntityTypeCustom An integer that identifies what kind of grid entity you are
1379
+ * creating. It should correspond to a local enum value created in
1380
+ * your mod. The integer can be any unique value and will not
1381
+ * correspond to the actual grid entity type used. (This integer is
1382
+ * used in the various custom grid entity callbacks.)
1383
+ * @param gridIndexOrPosition The grid index or position in the room that you want to spawn the
1384
+ * grid entity at. If a position is specified, the closest grid index
1385
+ * will be used.
1386
+ * @param gridCollisionClass Optional. The collision class that you want the custom grid entity to
1387
+ * have. If not specified, the grid collision class from the base grid
1388
+ * entity will be used.
1389
+ * @param anm2Path Optional. The path to the ANM2 file to use for the sprite. If not specified,
1390
+ * the normal sprite from the base grid entity will be used.
1391
+ * @param defaultAnimation Optional. The name of the animation to play after the sprite is
1392
+ * initialized and after the player re-enters a room with this grid entity
1393
+ * in it. If not specified, the default animation in the anm2 will be
1394
+ * used.
1395
+ * @param baseGridEntityType Optional. The type of the grid entity to use as a "base" for this
1396
+ * custom grid entity. Default is `GridEntityType.DECORATION`.
1397
+ * @param baseGridEntityVariant Optional. The variant of the grid entity to use as a "base" for
1398
+ * this custom grid entity. Default is 0.
1399
+ */
1400
+ spawnCustomGridEntity(gridEntityTypeCustom: GridEntityType, gridIndexOrPosition: int | Vector, gridCollisionClass?: GridCollisionClass, anm2Path?: string, defaultAnimation?: string, baseGridEntityType?: GridEntityType, baseGridEntityVariant?: number): GridEntity;
1401
+ /**
1402
+ * Helper function to remove a custom grid entity created by the `spawnCustomGrid` function.
1403
+ *
1404
+ * @param gridIndexOrPositionOrGridEntity You can specify the custom grid entity to remove by
1405
+ * providing the grid index, the room position, or the grid entity
1406
+ * itself.
1407
+ * @param updateRoom Optional. Whether or not to update the room after the grid entity is removed.
1408
+ * Default is true. This is generally a good idea because if the room is not
1409
+ * updated, you will be unable to spawn another grid entity on the same tile
1410
+ * until a frame has passed. However, doing this is expensive, since it involves
1411
+ * a call to `Isaac.GetRoomEntities`, so set it to false if you need to run this
1412
+ * function multiple times.
1413
+ * @returns The grid entity that was removed. Returns undefined if no grid entity was found at the
1414
+ * given location or if the given grid entity was not a custom grid entity.
1415
+ */
1416
+ removeCustomGridEntity(gridIndexOrPositionOrGridEntity: int | Vector | GridEntity, updateRoom?: boolean): GridEntity | undefined;
1417
+ /**
1418
+ * Helper function to get the custom grid entities in the current room. Returns an array of tuples
1419
+ * containing the raw decoration grid entity and the associated entity data.
1420
+ */
1421
+ getCustomGridEntities(): Array<[
1422
+ gridEntity: GridEntity,
1423
+ data: GridEntityCustomData
1424
+ ]>;
1425
+ /**
1426
+ * Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
1427
+ * undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
1428
+ * entity on the provided grid index.
1429
+ */
1430
+ getCustomGridEntityType(gridEntityOrGridIndex: GridEntity | int): GridEntityType | undefined;
1431
+ /**
1432
+ * Helper function to check if a `GridEntity` is a custom grid entity or if a grid index has a
1433
+ * custom grid entity.
1434
+ */
1435
+ isCustomGridEntity(gridEntityOrGridIndex: GridEntity | int): boolean;
1436
+ }
1437
+
1438
+ declare class CustomRevive extends Feature {
1439
+ v: {
1440
+ run: {
1441
+ state: CustomReviveState;
1442
+ revivalType: number | null;
1443
+ dyingPlayerIndex: PlayerIndex | null;
1444
+ };
1445
+ };
1446
+ private preCustomRevive;
1447
+ private postCustomRevive;
1448
+ constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive);
1449
+ private postRender;
1450
+ private postNewRoomReordered;
1451
+ private postPEffectUpdateReordered;
1452
+ private checkWaitingForItemAnimation;
1453
+ private postPlayerFatalDamage;
1454
+ private preBerserkDeath;
1455
+ /**
1456
+ * The player is about to die, which will immediately delete the save data for the run. To prevent
1457
+ * this from happening, we grant the 1-Up item.
1458
+ */
1459
+ private playerIsAboutToDie;
1460
+ private logStateChanged;
1461
+ }
1462
+
1463
+ declare enum CustomReviveState {
1464
+ DISABLED = 0,
1465
+ /**
1466
+ * We can't immediately jump to waiting for an item animation because it is possible for a player
1467
+ * to be holding an item above their head as they are dying (e.g. with Razor Blade).
1468
+ */
1469
+ WAITING_FOR_ROOM_TRANSITION = 1,
1470
+ WAITING_FOR_ITEM_ANIMATION = 2
1471
+ }
1472
+
1019
1473
  /**
1020
1474
  * An object that represents a possible boss for a custom stage. This can be for a vanilla boss or a
1021
1475
  * custom boss.
@@ -2146,6 +2600,21 @@ declare type ErrorCustomClassNotSerializable = "Error: Custom classes with one o
2146
2600
 
2147
2601
  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";
2148
2602
 
2603
+ declare class EsauJrDetection extends Feature {
2604
+ v: {
2605
+ run: {
2606
+ usedEsauJrFrame: number | null;
2607
+ usedEsauJrControllerIndex: ControllerIndex | null;
2608
+ usedEsauJrAtLeastOnce: boolean;
2609
+ };
2610
+ };
2611
+ private postEsauJr;
2612
+ private postFirstEsauJr;
2613
+ constructor(postEsauJr: PostEsauJr, postFirstEsauJr: PostFirstEsauJr);
2614
+ private postUpdate;
2615
+ private useItemEsauJr;
2616
+ }
2617
+
2149
2618
  /**
2150
2619
  * These are a collection of functions for non-TypeScript users so that they can access some of
2151
2620
  * useful methods offered on the `Array` class in the JavaScript standard library.
@@ -2169,6 +2638,22 @@ export declare function every<T>(array: T[], func: (value: T, index: number, arr
2169
2638
  */
2170
2639
  export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
2171
2640
 
2641
+ /**
2642
+ * The IsaacScript standard library contains many optional features, such as the ability to create
2643
+ * custom pickups. All features are optional and are only initialized when needed. This class
2644
+ * contains elements to facilitate that.
2645
+ *
2646
+ * Additionally, all custom callbacks extend from this class.
2647
+ */
2648
+ declare class Feature {
2649
+ initialized: boolean;
2650
+ v?: SaveData;
2651
+ featuresUsed?: ISCFeature[];
2652
+ callbacksUsed?: CallbackTuple[];
2653
+ customCallbacksUsed?: CustomCallbackTuple[];
2654
+ exportedMethods: string[];
2655
+ }
2656
+
2172
2657
  export declare function fillLevelWithRedRooms(): void;
2173
2658
 
2174
2659
  /**
@@ -2201,6 +2686,8 @@ export declare function find<T>(array: T[], func: (value: T, index: number, arra
2201
2686
  */
2202
2687
  export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector;
2203
2688
 
2689
+ declare type FireArgs<T extends ModCallbackCustom2> = Parameters<AddCallbackParametersCustom2[T][0]>;
2690
+
2204
2691
  /**
2205
2692
  * Helper function to make an NPC fire one or more projectiles. Returns the fired projectile(s).
2206
2693
  *
@@ -2265,6 +2752,19 @@ export declare const FIRST_STAGE = LevelStage.BASEMENT_1;
2265
2752
  /** Equal to `TrinketType.SWALLOWED_PENNY`. */
2266
2753
  export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
2267
2754
 
2755
+ declare class FlipDetection extends Feature {
2756
+ v: {
2757
+ run: {
2758
+ /** We don't consider the case of a multiplayer game with more than one Tainted Lazarus. */
2759
+ usedFlipAtLeastOnce: boolean;
2760
+ };
2761
+ };
2762
+ private postFlip;
2763
+ private postFirstFlip;
2764
+ constructor(postFlip: PostFlip, postFirstFlip: PostFirstFlip);
2765
+ private useItemFlip;
2766
+ }
2767
+
2268
2768
  /**
2269
2769
  * An object containing all 7 vanilla fonts that are pre-loaded and ready to use.
2270
2770
  *
@@ -2318,6 +2818,11 @@ export declare function forgottenSwitch(): void;
2318
2818
 
2319
2819
  declare type FunctionIsNotSerializable = "Error: Functions are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#functions-are-not-serializable";
2320
2820
 
2821
+ export declare type FunctionTuple = [
2822
+ name: string,
2823
+ func: (...args: unknown[]) => unknown
2824
+ ];
2825
+
2321
2826
  /**
2322
2827
  * A cached version of the class returned from the `Game()` constructor.
2323
2828
  *
@@ -2331,6 +2836,27 @@ export declare const game: Game;
2331
2836
  /** Game frames are what is returned by the `Game.GetFrameCount` method. */
2332
2837
  export declare const GAME_FRAMES_PER_SECOND = 30;
2333
2838
 
2839
+ declare class GameReorderedCallbacks extends Feature {
2840
+ private currentStage;
2841
+ private currentStageType;
2842
+ private usedGlowingHourGlass;
2843
+ private forceNewLevel;
2844
+ private forceNewRoom;
2845
+ private postGameStartedReordered;
2846
+ private postNewLevelReordered;
2847
+ private postNewRoomReordered;
2848
+ private postGameStartedReorderedLast;
2849
+ constructor(postGameStartedReordered: PostGameStartedReordered, postNewLevelReordered: PostNewLevelReordered, postNewRoomReordered: PostNewRoomReordered, postGameStartedReorderedLast: PostGameStartedReorderedLast);
2850
+ private useItemGlowingHourGlass;
2851
+ private postGameStarted;
2852
+ private postNewLevel;
2853
+ private postNewRoom;
2854
+ private recordCurrentStage;
2855
+ forceNewLevelCallback(): void;
2856
+ forceNewRoomCallback(): void;
2857
+ reorderedCallbacksSetStage(stage: LevelStage, stageType: StageType): void;
2858
+ }
2859
+
2334
2860
  /**
2335
2861
  * Helper function to find the active slot that the player has the corresponding collectible type
2336
2862
  * in. Returns undefined if the player does not have the collectible in any active slot.
@@ -2470,6 +2996,12 @@ export declare function getAllPlayers(): EntityPlayer[];
2470
2996
  /** Helper function to get the room safe grid index for every room on the entire floor. */
2471
2997
  export declare function getAllRoomGridIndexes(): int[];
2472
2998
 
2999
+ /**
3000
+ * Helper function to get the corresponding ambush type for the current room. Returns undefined if
3001
+ * the current room does not correspond to any particular ambush type.
3002
+ */
3003
+ export declare function getAmbushType(): AmbushType | undefined;
3004
+
2473
3005
  export declare function getAngelRoomDoor(): GridEntityDoor | undefined;
2474
3006
 
2475
3007
  export declare function getAngleDifference(angle1: float, angle2: float): float;
@@ -2657,8 +3189,11 @@ export declare function getCharacters(): PlayerType[];
2657
3189
  * This function accounts for The Battery. For example, if the player has 2/6 charges on a D6, this
2658
3190
  * function will return 10 (because there are 4 charges remaining on the base charge and 6 charges
2659
3191
  * remaining on The Battery charge).
3192
+ *
3193
+ * @param player The player to get the charges from.
3194
+ * @param activeSlot Optional. The slot to get the charges from. Default is `ActiveSlot.PRIMARY`.
2660
3195
  */
2661
- export declare function getChargesAwayFromMax(player: EntityPlayer, activeSlot: ActiveSlot): int;
3196
+ export declare function getChargesAwayFromMax(player: EntityPlayer, activeSlot?: ActiveSlot): int;
2662
3197
 
2663
3198
  /**
2664
3199
  * Helper function to get an array of equidistant points on the circumference around a circle.
@@ -4155,6 +4690,12 @@ export declare function getPlayerFromEntity(entity: Entity): EntityPlayer | unde
4155
4690
  */
4156
4691
  export declare function getPlayerFromIndex(playerIndex: PlayerIndex): EntityPlayer | undefined;
4157
4692
 
4693
+ /**
4694
+ * Helper function to get an `EntityPlayer` object from an `EntityPtr`. Returns undefined if the
4695
+ * entity has gone out of scope or if the associated entity is not a player.
4696
+ */
4697
+ export declare function getPlayerFromPtr(entityPtr: EntityPtr): EntityPlayer | undefined;
4698
+
4158
4699
  /**
4159
4700
  * Helper function to get an object representing the player's health. You can use this in
4160
4701
  * combination with the `setPlayerHealth` function to restore the player's health back to a certain
@@ -5237,8 +5778,11 @@ export declare function getTopLeftWallGridIndex(): int;
5237
5778
  * Helper function to get the combined normal charge and the battery charge for the player's active
5238
5779
  * item. This is useful because you have to add these two values together when setting the active
5239
5780
  * charge.
5781
+ *
5782
+ * @param player The player to get the charges from.
5783
+ * @param activeSlot Optional. The slot to get the charges from. Default is `ActiveSlot.PRIMARY`.
5240
5784
  */
5241
- export declare function getTotalCharge(player: EntityPlayer, activeSlot: ActiveSlot): int;
5785
+ export declare function getTotalCharge(player: EntityPlayer, activeSlot?: ActiveSlot): int;
5242
5786
 
5243
5787
  /**
5244
5788
  * Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
@@ -5360,14 +5904,24 @@ export declare function getTrinketsForCacheFlag(cacheFlag: CacheFlag): ReadonlyS
5360
5904
  export declare function getTrinketTypes(): TrinketType[];
5361
5905
 
5362
5906
  /**
5363
- * Helper function to get the name of a TypeScriptToLua class. TSTL classes are Lua tables created
5364
- * with the `__TS__Class` Lua function from the TSTL lualib. Their name is contained within
5365
- * "constructor.name" metatable key.
5907
+ * Helper function to get the constructor from an instantiated TypeScriptToLua class, which is
5908
+ * located on the metatable.
5909
+ *
5910
+ * Returns undefined if passed a non-table or if the provided table does not have a metatable.
5911
+ */
5912
+ export declare function getTSTLClassConstructor(object: unknown): TSTLClassMetatable["constructor"] | undefined;
5913
+
5914
+ export declare function getTSTLClassMethods(object: unknown): FunctionTuple[];
5915
+
5916
+ /**
5917
+ * Helper function to get the name of a TypeScriptToLua class from the instantiated class object.
5918
+ *
5919
+ * TSTL classes are Lua tables created with the `__TS__Class` Lua function from the TSTL lualib.
5920
+ * Their name is contained within "constructor.name" metatable key.
5366
5921
  *
5367
5922
  * For example, a `Map` class is has a name of "Map".
5368
5923
  *
5369
- * Returns undefined if the object is not a table or if the aforementioned metatable key does not
5370
- * exist.
5924
+ * Returns undefined if passed a non-table or if the provided table does not have a metatable.
5371
5925
  */
5372
5926
  export declare function getTSTLClassName(object: unknown): string | undefined;
5373
5927
 
@@ -5455,6 +6009,20 @@ export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
5455
6009
  */
5456
6010
  export declare function gridCoordinatesToWorldPosition(x: int, y: int): Vector;
5457
6011
 
6012
+ declare class GridEntityCollisionDetection extends Feature {
6013
+ v: {
6014
+ room: {
6015
+ /** Indexed by grid entity pointer hash. */
6016
+ collidingEntitiesMap: DefaultMap<PtrHash, Set<PtrHash>, []>;
6017
+ };
6018
+ };
6019
+ private postGridEntityCollision;
6020
+ private postGridEntityCustomCollision;
6021
+ private customGridEntities;
6022
+ constructor(postGridEntityCollision: PostGridEntityCollision, postGridEntityCustomCollision: PostGridEntityCustomCollision, customGridEntities: CustomGridEntities);
6023
+ private postUpdate;
6024
+ }
6025
+
5458
6026
  /**
5459
6027
  * This is meta-data that describes a custom grid entity.
5460
6028
  *
@@ -5474,6 +6042,39 @@ export declare interface GridEntityCustomData {
5474
6042
  defaultAnimation?: string;
5475
6043
  }
5476
6044
 
6045
+ declare class GridEntityDetection extends Feature {
6046
+ v: {
6047
+ room: {
6048
+ /** Indexed by grid index. */
6049
+ initializedGridEntities: Map<number, GridEntityTuple>;
6050
+ };
6051
+ };
6052
+ private postGridEntityInit;
6053
+ private postGridEntityCustomInit;
6054
+ private postGridEntityUpdate;
6055
+ private postGridEntityCustomUpdate;
6056
+ private postGridEntityRemove;
6057
+ private postGridEntityCustomRemove;
6058
+ private postGridEntityStateChanged;
6059
+ private postGridEntityCustomStateChanged;
6060
+ private postGridEntityBroken;
6061
+ private postGridEntityCustomBroken;
6062
+ private customGridEntities;
6063
+ constructor(postGridEntityInit: PostGridEntityInit, postGridEntityCustomInit: PostGridEntityCustomInit, postGridEntityUpdate: PostGridEntityUpdate, postGridEntityCustomUpdate: PostGridEntityCustomUpdate, postGridEntityRemove: PostGridEntityRemove, postGridEntityCustomRemove: PostGridEntityCustomRemove, postGridEntityStateChanged: PostGridEntityStateChanged, postGridEntityCustomStateChanged: PostGridEntityCustomStateChanged, postGridEntityBroken: PostGridEntityBroken, postGridEntityCustomBroken: PostGridEntityCustomBroken, customGridEntities: CustomGridEntities);
6064
+ private postUpdate;
6065
+ private checkGridEntitiesRemoved;
6066
+ private checkGridEntityStateChanged;
6067
+ private checkNewGridEntity;
6068
+ private updateTupleInMap;
6069
+ private postNewRoomReordered;
6070
+ }
6071
+
6072
+ declare type GridEntityTuple = [
6073
+ gridEntityType: GridEntityType,
6074
+ variant: int,
6075
+ state: int
6076
+ ];
6077
+
5477
6078
  /**
5478
6079
  * Helper function to convert a grid index to a grid position.
5479
6080
  *
@@ -5489,6 +6090,32 @@ export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomS
5489
6090
  */
5490
6091
  export declare function gridPositionToWorldPosition(gridPosition: Vector): Vector;
5491
6092
 
6093
+ /**
6094
+ * A helper type to ensure that an object contains a key for every enum member. Use this with `as
6095
+ * const` and `satisfies` to prevent narrowing the type of the object.
6096
+ *
6097
+ * For example:
6098
+ *
6099
+ * ```ts
6100
+ * enum MyEnum {
6101
+ * Value1,
6102
+ * Value2,
6103
+ * Value3,
6104
+ * }
6105
+ *
6106
+ * const MyEnumToString = {
6107
+ * [MyEnum.Value1]: "foo",
6108
+ * [MyEnum.Value2]: "bar",
6109
+ * [MyEnum.Value3]: "baz",
6110
+ * } as const satisfies HasAllEnumKeys<MyEnum>;
6111
+ *
6112
+ * const value = MyEnumToString[MyEnum.Value2];
6113
+ * ```
6114
+ */
6115
+ export declare type HasAllEnumKeys<T extends string | number> = {
6116
+ readonly [key in T]: unknown;
6117
+ };
6118
+
5492
6119
  /**
5493
6120
  * Helper function to see if a particular entity has armor. In this context, armor refers to the
5494
6121
  * damage scaling mechanic. For example, Ultra Greed has armor, but a Gaper does not.
@@ -5712,33 +6339,6 @@ export declare function inHomeCloset(): boolean;
5712
6339
  */
5713
6340
  export declare function initArray<T>(defaultValue: T, size: int): T[];
5714
6341
 
5715
- /**
5716
- * `isaacscript-common` provides custom doors that can be spawned where any wall segment is. If you
5717
- * use this feature, you must first call this initialization function at the beginning of your mod.
5718
- *
5719
- * Each kind of custom door that you create must have an entry in the "content/entities2.xml" file,
5720
- * like so:
5721
- *
5722
- * ```xml
5723
- * <entity id="1000" name="Foo Custom Door" anm2path="grid/door_foo.anm2" />
5724
- * ```
5725
- *
5726
- * (Custom door entities must have an id of "1000", which corresponds to an effect. If you do not
5727
- * specify the variant, then the game will automatically assign it.)
5728
- *
5729
- * Next, pass the variant into this function:
5730
- *
5731
- * ```ts
5732
- * const modVanilla = RegisterMod("My Mod", 1);
5733
- * const mod = upgradeMod(modVanilla);
5734
- * const fooEffectVariant = Isaac.GetEntityVariantByName("Foo Custom Door");
5735
- * initCustomDoor(mod, fooEffectVariant);
5736
- * ```
5737
- *
5738
- * Also see the `spawnCustomDoor` function.
5739
- */
5740
- export declare function initCustomDoor(mod: ModUpgraded, effectVariant: EffectVariant): void;
5741
-
5742
6342
  /** Helper function to determine if the current room shape is one of the four L room shapes. */
5743
6343
  export declare function inLRoom(): boolean;
5744
6344
 
@@ -5794,6 +6394,17 @@ export declare function inSecretShop(): boolean;
5794
6394
  */
5795
6395
  export declare function inStartingRoom(): boolean;
5796
6396
 
6397
+ /**
6398
+ * Used for `setInterval` functions.
6399
+ *
6400
+ * The return value is whether or not to continue the function from firing.
6401
+ */
6402
+ declare type IntervalFunctionTuple = [
6403
+ frameCountToFire: int,
6404
+ func: () => boolean,
6405
+ numIntervalFrames: int
6406
+ ];
6407
+
5797
6408
  /**
5798
6409
  * Helper function to return an array of integers with the specified range, inclusive on both ends.
5799
6410
  * (The "i" stands for inclusive.)
@@ -5842,9 +6453,22 @@ export declare function isActionTriggeredOnAnyInput(buttonAction: ButtonAction):
5842
6453
  /** Returns true if the item type in the item config is equal to `ItemType.ITEM_ACTIVE`. */
5843
6454
  export declare function isActiveCollectible(collectibleType: CollectibleType): boolean;
5844
6455
 
5845
- export declare function isActiveSlotDoubleCharged(player: EntityPlayer, activeSlot: ActiveSlot): boolean;
6456
+ /**
6457
+ * Helper function to check if a player's active item is "double charged", meaning that it has both
6458
+ * a full normal charge and a full charge from The Battery.
6459
+ *
6460
+ * @param player The player to check.
6461
+ * @param activeSlot Optional. The slot to check. Default is `ActiveSlot.PRIMARY`.
6462
+ */
6463
+ export declare function isActiveSlotDoubleCharged(player: EntityPlayer, activeSlot?: ActiveSlot): boolean;
5846
6464
 
5847
- export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot: ActiveSlot): boolean;
6465
+ /**
6466
+ * Helper function to check if the active slot of a particular player is empty.
6467
+ *
6468
+ * @param player The player to check.
6469
+ * @param activeSlot Optional. The active slot to check. Default is `ActiveSlot.PRIMARY`.
6470
+ */
6471
+ export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot?: ActiveSlot): boolean;
5848
6472
 
5849
6473
  /**
5850
6474
  * Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
@@ -5940,6 +6564,30 @@ export declare function isCardPickup(pickup: EntityPickup): pickup is EntityPick
5940
6564
  /** Returns whether or not the given card type matches the specified item config card type. */
5941
6565
  export declare function isCardType(cardType: CardType, itemConfigCardType: ItemConfigCardType): boolean;
5942
6566
 
6567
+ export declare enum ISCFeature {
6568
+ CUSTOM_REVIVE = "CustomRevive",
6569
+ ESAU_JR_DETECTION = "EsauJrDetection",
6570
+ FLIP_DETECTION = "FlipDetection",
6571
+ GRID_ENTITY_COLLISION_DETECTION = "GridEntityCollisionDetection",
6572
+ GRID_ENTITY_DETECTION = "GridEntityDetection",
6573
+ GAME_REORDERED_CALLBACKS = "GameReorderedCallbacks",
6574
+ PLAYER_REORDERED_CALLBACKS = "PlayerReorderedCallbacks",
6575
+ CUSTOM_GRID_ENTITIES = "CustomGridEntities",
6576
+ RUN_IN_N_FRAMES = "runInNFrames"
6577
+ }
6578
+
6579
+ declare interface ISCFeatureToClass {
6580
+ [ISCFeature.CUSTOM_REVIVE]: CustomRevive;
6581
+ [ISCFeature.ESAU_JR_DETECTION]: EsauJrDetection;
6582
+ [ISCFeature.FLIP_DETECTION]: FlipDetection;
6583
+ [ISCFeature.GRID_ENTITY_COLLISION_DETECTION]: GridEntityCollisionDetection;
6584
+ [ISCFeature.GRID_ENTITY_DETECTION]: GridEntityDetection;
6585
+ [ISCFeature.GAME_REORDERED_CALLBACKS]: GameReorderedCallbacks;
6586
+ [ISCFeature.PLAYER_REORDERED_CALLBACKS]: PlayerReorderedCallbacks;
6587
+ [ISCFeature.CUSTOM_GRID_ENTITIES]: CustomGridEntities;
6588
+ [ISCFeature.RUN_IN_N_FRAMES]: RunInNFrames;
6589
+ }
6590
+
5943
6591
  /**
5944
6592
  * Helper function to check if a player is a specific character (i.e. `PlayerType`).
5945
6593
  *
@@ -6179,6 +6827,12 @@ export declare function isGlitchedCollectible(pickup: EntityPickup): boolean;
6179
6827
 
6180
6828
  export declare function isGoldenTrinketType(trinketType: TrinketType): boolean;
6181
6829
 
6830
+ /**
6831
+ * Helper function to check if the difficulty of the current run is equal to `Difficulty.GREED` or
6832
+ * `Difficulty.GREEDIER`.
6833
+ */
6834
+ export declare function isGreedMode(): boolean;
6835
+
6182
6836
  /** Helper function to detect if a variable is of type `GridEntity`. */
6183
6837
  export declare function isGridEntity(variable: unknown): variable is GridEntity;
6184
6838
 
@@ -6408,8 +7062,13 @@ export declare function isRedHeart(pickup: EntityPickup): boolean;
6408
7062
  export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
6409
7063
 
6410
7064
  /**
6411
- * Since this is a UI element, we do not want to draw it in water reflections. `renderOffset` will
6412
- * be a non-zero value in reflections.
7065
+ * Helper function to see if the current render callback is rendering a water reflection.
7066
+ *
7067
+ * When the player is in a room with water, things will be rendered twice: once for the normal
7068
+ * rendering, and once for the reflecting rendering. Thus, any mod code in a render callback will
7069
+ * run twice per frame in these situations, which may be unexpected or cause bugs.
7070
+ *
7071
+ * This function is typically used to early return from a render function if it returns true.
6413
7072
  */
6414
7073
  export declare function isReflectionRender(): boolean;
6415
7074
 
@@ -6548,6 +7207,9 @@ export declare function isSuitCard(cardType: CardType): boolean;
6548
7207
 
6549
7208
  export declare function isTable(variable: unknown): variable is LuaMap<AnyNotNil, unknown>;
6550
7209
 
7210
+ /** Helper function to check if a Lua table has 0 keys. */
7211
+ export declare function isTableEmpty(luaMap: LuaMap<AnyNotNil, unknown>): boolean;
7212
+
6551
7213
  /** Helper function for detecting if a player is one of the Tainted characters. */
6552
7214
  export declare function isTainted(player: EntityPlayer): boolean;
6553
7215
 
@@ -6603,16 +7265,18 @@ export declare function isTrinket(pickup: EntityPickup): pickup is EntityPickupT
6603
7265
  /**
6604
7266
  * Helper function to determine if a given object is a TypeScriptToLua `Map`.
6605
7267
  *
6606
- * It is not reliable to use the `instanceof` operator to determine this because each Lua module has
6607
- * their own copies of the entire lualib and thus their own instantiated version of a `Map`.
7268
+ * It is not reliable to use the `instanceof` operator to determine this because each Lua module
7269
+ * might have their own copy of the entire lualib and thus their own instantiated version of a
7270
+ * `Map`.
6608
7271
  */
6609
7272
  export declare function isTSTLMap(object: unknown): object is Map<AnyNotNil, unknown>;
6610
7273
 
6611
7274
  /**
6612
7275
  * Helper function to determine if a given object is a TypeScriptToLua `Set`.
6613
7276
  *
6614
- * It is not reliable to use the `instanceof` operator to determine this because each Lua module has
6615
- * their own copies of the entire lualib and thus their own instantiated version of a `Set`.
7277
+ * It is not reliable to use the `instanceof` operator to determine this because each Lua module
7278
+ * might have their own copy of the entire lualib and thus their own instantiated version of a
7279
+ * `Set`.
6616
7280
  */
6617
7281
  export declare function isTSTLSet(object: unknown): object is Set<AnyNotNil>;
6618
7282
 
@@ -6858,6 +7522,25 @@ export declare function kColorEquals(kColor1: KColor, kColor2: KColor): boolean;
6858
7522
  */
6859
7523
  export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined;
6860
7524
 
7525
+ declare type KeysToScrubFromModClass = keyof Feature | LowercaseKeys<ModUpgraded>;
7526
+
7527
+ /**
7528
+ * For `EntityType.EFFECT` (1000), `EffectVariant.LADDER` (8).
7529
+ *
7530
+ * Note that vanilla ladders only use a sub-type of 0. The `isaacscript-common` library uses ladders
7531
+ * to represent custom objects, since they are non-interacting and will not automatically despawn
7532
+ * after time passes, unlike most other effects.
7533
+ *
7534
+ * This enum tracks the kinds of custom objects that are represented by vanilla ladders. We start
7535
+ * assigning sub-types after 100 as to not interfere with any possible modded ladder variants.
7536
+ */
7537
+ export declare enum LadderSubTypeCustom {
7538
+ LADDER = 0,
7539
+ CUSTOM_BACKDROP = 101,
7540
+ CUSTOM_SHADOW = 102,
7541
+ CUSTOM_PICKUP = 103
7542
+ }
7543
+
6861
7544
  /**
6862
7545
  * Equal to `PillColor.HORSE_WHITE_YELLOW`.
6863
7546
  *
@@ -7058,6 +7741,8 @@ export declare function logUserdata(userdata: unknown): void;
7058
7741
 
7059
7742
  export declare function logVector(vector: Vector, round?: boolean): void;
7060
7743
 
7744
+ export declare type LowercaseKeys<T> = StartsWithLowercase<keyof T>;
7745
+
7061
7746
  /**
7062
7747
  * Helper function for non-TypeScript users to convert all of the elements in an array to something
7063
7748
  * else.
@@ -7122,6 +7807,20 @@ export declare function mapSetHash<V>(map: Map<PtrHash, V>, entity: Entity, valu
7122
7807
  */
7123
7808
  export declare function mapSetPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer, value: V): void;
7124
7809
 
7810
+ /**
7811
+ * A helper type used to get the matching `ModCallbackCustom` enum values that match the provided
7812
+ * callback function signature.
7813
+ *
7814
+ * "T extends T" is necessary because of distributive conditional types:
7815
+ * https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
7816
+ *
7817
+ * "extends Parameters<FuncSignature>" is necessary because "() => void" will match "(arg1: number)
7818
+ * => void", since in JavaScript, functions ignore extra arguments.
7819
+ *
7820
+ * "extends ReturnType<FuncSignature>" is necessary because "() => void" will match "() => number".
7821
+ */
7822
+ declare type MatchingCallbackCustom<FuncSignature extends (...args: any[]) => unknown, T extends ModCallbackCustom2 = ModCallbackCustom2> = T extends T ? AddCallbackParametersCustom2[T][0] extends FuncSignature ? Parameters<AddCallbackParametersCustom2[T][0]> extends Parameters<FuncSignature> ? ReturnType<AddCallbackParametersCustom2[T][0]> extends ReturnType<FuncSignature> ? T : never : never : never : never;
7823
+
7125
7824
  /**
7126
7825
  * The floor is represented by a 13x13 grid. Room indexes start at 0. The first row is represented
7127
7826
  * by grid indexes from 0 to 12. The second row is represented by grid indexes from 13 to 25, and so
@@ -7182,8 +7881,9 @@ export declare enum ModCallbackCustom {
7182
7881
  * Fires from the `POST_UPDATE` callback when a Challenge Room or Boss Rush is started.
7183
7882
  * Specifically, this happens on the first frame that `Room.IsAmbushDone` is true.
7184
7883
  *
7185
- * When registering the callback, takes an optional second argument that will make the callback
7186
- * only fire if for the `AmbushType` provided.
7884
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
7885
+ * an optional third argument that will make the callback only fire if it matches the `AmbushType`
7886
+ * provided.
7187
7887
  *
7188
7888
  * ```ts
7189
7889
  * function postAmbushFinished(ambushType: AmbushType): void {}
@@ -7194,8 +7894,9 @@ export declare enum ModCallbackCustom {
7194
7894
  * Fires from the `POST_UPDATE` callback when a Challenge Room or Boss Rush is completed.
7195
7895
  * Specifically, this happens on the first frame that `Room.IsAmbushActive` is true.
7196
7896
  *
7197
- * When registering the callback, takes an optional second argument that will make the callback
7198
- * only fire if for the `AmbushType` provided.
7897
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
7898
+ * an optional third argument that will make the callback only fire if it matches the `AmbushType`
7899
+ * provided.
7199
7900
  *
7200
7901
  * ```ts
7201
7902
  * function postAmbushStarted(ambushType: AmbushType): void {}
@@ -7205,8 +7906,9 @@ export declare enum ModCallbackCustom {
7205
7906
  /**
7206
7907
  * Fires on the `POST_BOMB_UPDATE` callback that it explodes.
7207
7908
  *
7208
- * When registering the callback, takes an optional second argument that will make the callback
7209
- * only fire if the bomb variant matches the `BombVariant` provided.
7909
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
7910
+ * an optional third argument that will make the callback only fire if it matches the
7911
+ * `BombVariant` provided.
7210
7912
  *
7211
7913
  * ```ts
7212
7914
  * function postBombDetonated(bomb: EntityBomb): void {}
@@ -7219,8 +7921,9 @@ export declare enum ModCallbackCustom {
7219
7921
  * This callback is useful because many attributes cannot be set or retrieved properly in the
7220
7922
  * normal `POST_BOMB_INIT` callback.
7221
7923
  *
7222
- * When registering the callback, takes an optional second argument that will make the callback
7223
- * only fire if the bomb variant matches the `BombVariant` provided.
7924
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
7925
+ * an optional third argument that will make the callback only fire if it matches the
7926
+ * `BombVariant` provided.
7224
7927
  *
7225
7928
  * ```ts
7226
7929
  * function postBombInitLate(bomb: EntityBomb): void {}
@@ -7239,8 +7942,9 @@ export declare enum ModCallbackCustom {
7239
7942
  * Fires from the `POST_PICKUP_UPDATE` callback when a collectible goes from a non-zero sub-type
7240
7943
  * to `CollectibleType.NULL` (i.e. an "empty" pedestal).
7241
7944
  *
7242
- * When registering the callback, takes an optional second argument that will make the callback
7243
- * only fire if the collectible type changed from the `CollectibleType` provided.
7945
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
7946
+ * an optional third argument that will make the callback only fire if the pedestal changed from
7947
+ * the `CollectibleType` provided.
7244
7948
  *
7245
7949
  * ```ts
7246
7950
  * function postCollectibleEmpty(
@@ -7259,11 +7963,12 @@ export declare enum ModCallbackCustom {
7259
7963
  * upon re-entering the room. Additionally, when playing as Tainted Isaac, the `POST_PICKUP_INIT`
7260
7964
  * callback will fire every time the item shifts.
7261
7965
  *
7262
- * When registering the callback, takes an optional second argument that will make the callback
7263
- * only fire if the collectible type matches the `CollectibleType` provided.
7966
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
7967
+ * an optional third argument that will make the callback only fire if it matches the
7968
+ * `CollectibleType` provided.
7264
7969
  *
7265
7970
  * ```ts
7266
- * function postCollectibleInitLate(collectible: EntityPickup): void {}
7971
+ * function postCollectibleInitLate(collectible: EntityPickupCollectible): void {}
7267
7972
  * ```
7268
7973
  */
7269
7974
  POST_COLLECTIBLE_INIT_FIRST = 6,
@@ -7272,28 +7977,17 @@ export declare enum ModCallbackCustom {
7272
7977
  * begins playing after a player triggers a Cursed Eye teleport or a Cursed Skull teleport. (Both
7273
7978
  * of these have the same effect in causing Isaac to be teleported to a random room.)
7274
7979
  *
7980
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
7981
+ * - You can provide an optional third argument that will make the callback only fire if it
7982
+ * matches the `PlayerVariant` provided.
7983
+ * - You can provide an optional fourth argument that will make the callback only fire if it
7984
+ * matches the `PlayerType` provided.
7985
+ *
7275
7986
  * ```ts
7276
7987
  * function postCursedTeleport(player: EntityPlayer): void {}
7277
7988
  * ```
7278
7989
  */
7279
7990
  POST_CURSED_TELEPORT = 7,
7280
- /**
7281
- * Fires from the `POST_PEFFECT_UPDATE` callback when a player enters the loading zone of a custom
7282
- * door created with the `spawnCustomDoor` helper function.
7283
- *
7284
- * When registering the callback, takes an optional second argument that will make the callback
7285
- * only fire if it matches the `DoorVariant` provided.
7286
- *
7287
- * ```ts
7288
- * function postCustomDoorEnter(
7289
- * player: EntityPlayer,
7290
- * effectVariant: int,
7291
- * doorSlot: DoorSlot,
7292
- * direction: Direction,
7293
- * ): void {}
7294
- * ```
7295
- */
7296
- POST_CUSTOM_DOOR_ENTER = 8,
7297
7991
  /**
7298
7992
  * Fires from the `POST_PLAYER_UPDATE` callback after the player has finished the death animation,
7299
7993
  * has teleported to the previous room, and is ready to play the animation for the modded revival
@@ -7303,20 +7997,22 @@ export declare enum ModCallbackCustom {
7303
7997
  * `player.AnimateCollectible(CollectibleTypeCustom.COLLECTIBLE_MY_REVIVAL_ITEM);`, otherwise the
7304
7998
  * animation for a 1-Up will play.
7305
7999
  *
7306
- * When registering the callback, takes an optional second argument that will make the callback
7307
- * only fire if the revival type matches the one provided.
8000
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8001
+ * an optional third argument that will make the callback only fire if the revival type matches
8002
+ * the one provided.
7308
8003
  *
7309
8004
  * ```ts
7310
8005
  * function postCustomRevive(player: EntityPlayer, revivalType: int): void {}
7311
8006
  * ```
7312
8007
  */
7313
- POST_CUSTOM_REVIVE = 9,
8008
+ POST_CUSTOM_REVIVE = 8,
7314
8009
  /**
7315
8010
  * Fires from the `EFFECT_POST_UPDATE` callback after a player has entered the range of a Dice
7316
8011
  * Room floor.
7317
8012
  *
7318
- * When registering the callback, takes an optional second argument that will make the callback
7319
- * only fire if the `DiceFloorSubType` type matches the one provided.
8013
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8014
+ * an optional third argument that will make the callback only fire if it matches the
8015
+ * `DiceFloorSubType` provided.
7320
8016
  *
7321
8017
  * ```ts
7322
8018
  * function postDiceRoomActivated(
@@ -7325,49 +8021,53 @@ export declare enum ModCallbackCustom {
7325
8021
  * ): void {}
7326
8022
  * ```
7327
8023
  */
7328
- POST_DICE_ROOM_ACTIVATED = 10,
8024
+ POST_DICE_ROOM_ACTIVATED = 9,
7329
8025
  /**
7330
8026
  * Fires from the `POST_RENDER` callback on every frame that a door exists.
7331
8027
  *
7332
- * When registering the callback, takes an optional second argument that will make the callback
7333
- * only fire if it matches the variant provided.
8028
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8029
+ * an optional third argument that will make the callback only fire if it matches the variant
8030
+ * provided.
7334
8031
  *
7335
8032
  * ```ts
7336
8033
  * function postDoorRender(door: GridEntityDoor): void {}
7337
8034
  * ```
7338
8035
  */
7339
- POST_DOOR_RENDER = 11,
8036
+ POST_DOOR_RENDER = 10,
7340
8037
  /**
7341
8038
  * Fires from the `POST_UPDATE` callback on every frame that a door exists.
7342
8039
  *
7343
- * When registering the callback, takes an optional second argument that will make the callback
7344
- * only fire if it matches the variant provided.
8040
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8041
+ * an optional third argument that will make the callback only fire if it matches the variant
8042
+ * provided.
7345
8043
  *
7346
8044
  * ```ts
7347
8045
  * function postDoorUpdate(door: GridEntityDoor): void {}
7348
8046
  * ```
7349
8047
  */
7350
- POST_DOOR_UPDATE = 12,
8048
+ POST_DOOR_UPDATE = 11,
7351
8049
  /**
7352
8050
  * Fires on the first `POST_EFFECT_UPDATE` frame for each effect.
7353
8051
  *
7354
8052
  * This callback is useful because many attributes cannot be set or retrieved properly in the
7355
8053
  * normal `POST_EFFECT_INIT` callback.
7356
8054
  *
7357
- * When registering the callback, takes an optional second argument that will make the callback
7358
- * only fire if the effect variant matches the `EffectVariant` provided.
8055
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8056
+ * an optional third argument that will make the callback only fire if it matches the
8057
+ * `EffectVariant` provided.
7359
8058
  *
7360
8059
  * ```ts
7361
8060
  * function postEffectInitLate(effect: EntityEffect): void {}
7362
8061
  * ```
7363
8062
  */
7364
- POST_EFFECT_INIT_LATE = 13,
8063
+ POST_EFFECT_INIT_LATE = 12,
7365
8064
  /**
7366
8065
  * Fires from the `POST_EFFECT_UPDATE` callback when an effect's state has changed from what it
7367
8066
  * was on the previous frame. (In this context, "state" refers to the `EntityEffect.State` field.)
7368
8067
  *
7369
- * When registering the callback, takes an optional second argument that will make the callback
7370
- * only fire if it matches the `EffectVariant` provided.
8068
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8069
+ * an optional third argument that will make the callback only fire if it matches the
8070
+ * `EffectVariant` provided.
7371
8071
  *
7372
8072
  * ```ts
7373
8073
  * function postEffectStateChanged(
@@ -7377,7 +8077,7 @@ export declare enum ModCallbackCustom {
7377
8077
  * ): void {}
7378
8078
  * ```
7379
8079
  */
7380
- POST_EFFECT_STATE_CHANGED = 14,
8080
+ POST_EFFECT_STATE_CHANGED = 13,
7381
8081
  /**
7382
8082
  * Fires one `POST_UPDATE` frame after the player has used the Esau Jr. item. (The player is not
7383
8083
  * updated to the new character until a game frame has passed.)
@@ -7386,28 +8086,30 @@ export declare enum ModCallbackCustom {
7386
8086
  * function postEsauJr(player: EntityPlayer): void {}
7387
8087
  * ```
7388
8088
  */
7389
- POST_ESAU_JR = 15,
8089
+ POST_ESAU_JR = 14,
7390
8090
  /**
7391
8091
  * Fires on the first `FAMILIAR_UPDATE` frame for each familiar.
7392
8092
  *
7393
8093
  * This callback is useful because many attributes cannot be set or retrieved properly in the
7394
8094
  * normal `POST_TEAR_INIT` callback.
7395
8095
  *
7396
- * When registering the callback, takes an optional second argument that will make the callback
7397
- * only fire if the familiar variant matches the `FamiliarVariant` provided.
8096
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8097
+ * an optional third argument that will make the callback only fire if it matches the
8098
+ * `FamiliarVariant` provided.
7398
8099
  *
7399
8100
  * ```ts
7400
8101
  * function postFamiliarInitLate(familiar: EntityFamiliar): void {}
7401
8102
  * ```
7402
8103
  */
7403
- POST_FAMILIAR_INIT_LATE = 16,
8104
+ POST_FAMILIAR_INIT_LATE = 15,
7404
8105
  /**
7405
8106
  * Fires from the `POST_FAMILIAR_UPDATE` callback when a familiar's state has changed from what it
7406
8107
  * was on the previous frame. (In this context, "state" refers to the `EntityFamiliar.State`
7407
8108
  * field.)
7408
8109
  *
7409
- * When registering the callback, takes an optional second argument that will make the callback
7410
- * only fire if it matches the `FamiliarVariant` provided.
8110
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8111
+ * an optional third argument that will make the callback only fire if it matches the
8112
+ * `FamiliarVariant` provided.
7411
8113
  *
7412
8114
  * ```ts
7413
8115
  * function postFamiliarStateChanged(
@@ -7417,7 +8119,7 @@ export declare enum ModCallbackCustom {
7417
8119
  * ): void {}
7418
8120
  * ```
7419
8121
  */
7420
- POST_FAMILIAR_STATE_CHANGED = 17,
8122
+ POST_FAMILIAR_STATE_CHANGED = 16,
7421
8123
  /**
7422
8124
  * Fires one `POST_UPDATE` frame after the player has first used the Esau Jr. item. (The player is
7423
8125
  * not updated to the new character until a game frame has passed.)
@@ -7429,7 +8131,7 @@ export declare enum ModCallbackCustom {
7429
8131
  * function postFirstEsauJr(player: EntityPlayer): void {}
7430
8132
  * ```
7431
8133
  */
7432
- POST_FIRST_ESAU_JR = 18,
8134
+ POST_FIRST_ESAU_JR = 17,
7433
8135
  /**
7434
8136
  * Fires after the player has used the Flip item for the first time. Unlike the vanilla `USE_ITEM`
7435
8137
  * callback, this callback will return the player object for the new Lazarus (not the one who used
@@ -7442,7 +8144,7 @@ export declare enum ModCallbackCustom {
7442
8144
  * function postFirstFlip(newLazarus: EntityPlayer, oldLazarus: EntityPlayer): void {}
7443
8145
  * ```
7444
8146
  */
7445
- POST_FIRST_FLIP = 19,
8147
+ POST_FIRST_FLIP = 18,
7446
8148
  /**
7447
8149
  * Fires after the player has used the Flip item. Unlike the vanilla `USE_ITEM` callback, this
7448
8150
  * callback will return the player object for the new Lazarus (not the one who used the Flip
@@ -7455,7 +8157,7 @@ export declare enum ModCallbackCustom {
7455
8157
  * function postFlip(newLazarus: EntityPlayer, oldLazarus: EntityPlayer): void {}
7456
8158
  * ```
7457
8159
  */
7458
- POST_FLIP = 20,
8160
+ POST_FLIP = 19,
7459
8161
  /**
7460
8162
  * Similar to the vanilla callback of the same name, but fires in the correct order with respect
7461
8163
  * to the `POST_NEW_LEVEL` and the `POST_NEW_ROOM` callbacks:
@@ -7466,7 +8168,7 @@ export declare enum ModCallbackCustom {
7466
8168
  * function postGameStartedReordered(isContinued: boolean): void {}
7467
8169
  * ```
7468
8170
  */
7469
- POST_GAME_STARTED_REORDERED = 21,
8171
+ POST_GAME_STARTED_REORDERED = 20,
7470
8172
  /**
7471
8173
  * Similar to the `POST_GAME_STARTED_REORDERED` callback, but fires after all of the subscribed
7472
8174
  * callbacks have finished firing. Thus, you can use this callback to do perform things after a
@@ -7477,7 +8179,7 @@ export declare enum ModCallbackCustom {
7477
8179
  * function postGameStartedReorderedLast(isContinued: boolean): void {}
7478
8180
  * ```
7479
8181
  */
7480
- POST_GAME_STARTED_REORDERED_LAST = 22,
8182
+ POST_GAME_STARTED_REORDERED_LAST = 21,
7481
8183
  /**
7482
8184
  * Fires from the `POST_UPDATE` callback when the Greed Mode wave increases.
7483
8185
  *
@@ -7485,7 +8187,7 @@ export declare enum ModCallbackCustom {
7485
8187
  * function postGreedModeWave(oldWave: int, newWave: int): void {}
7486
8188
  * ```
7487
8189
  */
7488
- POST_GREED_MODE_WAVE = 23,
8190
+ POST_GREED_MODE_WAVE = 22,
7489
8191
  /**
7490
8192
  * Fires from the `POST_UPDATE` callback when a grid entity changes to a state that corresponds to
7491
8193
  * the broken state for the respective grid entity type. (For example, this will fire for a
@@ -7494,16 +8196,17 @@ export declare enum ModCallbackCustom {
7494
8196
  * For grid entities created with `spawnCustomGridEntity`, use the
7495
8197
  * `POST_GRID_ENTITY_CUSTOM_BROKEN` callback instead.
7496
8198
  *
7497
- * - When registering the callback, takes an optional second argument that will make the callback
7498
- * only fire if it matches the `GridEntityType` provided.
7499
- * - When registering the callback, takes an optional third argument that will make the callback
7500
- * only fire if it matches the variant provided.
8199
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8200
+ * - You can provide an optional third argument that will make the callback only fire if it
8201
+ * matches the `GridEntityType` provided.
8202
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8203
+ * matches the variant provided.
7501
8204
  *
7502
8205
  * ```ts
7503
8206
  * function postGridEntityBroken(gridEntity: GridEntity): void {}
7504
8207
  * ```
7505
8208
  */
7506
- POST_GRID_ENTITY_BROKEN = 24,
8209
+ POST_GRID_ENTITY_BROKEN = 23,
7507
8210
  /**
7508
8211
  * Fires from the `POST_UPDATE` callback when a new entity collides with a grid entity. (After
7509
8212
  * this, the callback will not continue to fire. It will only fire again once the entity moves out
@@ -7512,14 +8215,15 @@ export declare enum ModCallbackCustom {
7512
8215
  * For grid entities created with `spawnCustomGridEntity`, use the
7513
8216
  * `POST_GRID_ENTITY_CUSTOM_COLLISION` callback instead.
7514
8217
  *
7515
- * - When registering the callback, takes an optional second argument that will make the callback
7516
- * only fire if it matches the `GridEntityType` provided.
7517
- * - When registering the callback, takes an optional third argument that will make the callback
7518
- * only fire if it matches the variant provided (for the grid entity).
7519
- * - When registering the callback, takes an optional fourth argument that will make the callback
7520
- * only fire if the colliding entity matches the `EntityType` provided.
7521
- * - When registering the callback, takes an optional fifth argument that will make the callback
7522
- * only fire if the colliding entity matches the variant provided.
8218
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8219
+ * - You can provide an optional third argument that will make the callback only fire if it
8220
+ * matches the `GridEntityType` provided.
8221
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8222
+ * matches the variant provided (for the grid entity).
8223
+ * - You can provide an optional fifth argument that will make the callback only fire if the
8224
+ * colliding entity matches the `EntityType` provided.
8225
+ * - You can provide an optional sixth argument that will make the callback only fire if the
8226
+ * colliding entity matches the variant provided.
7523
8227
  *
7524
8228
  * ```ts
7525
8229
  * function postGridEntityCollision(
@@ -7528,14 +8232,15 @@ export declare enum ModCallbackCustom {
7528
8232
  * ): void {}
7529
8233
  * ```
7530
8234
  */
7531
- POST_GRID_ENTITY_COLLISION = 25,
8235
+ POST_GRID_ENTITY_COLLISION = 24,
7532
8236
  /**
7533
8237
  * The same as the `POST_GRID_ENTITY_BROKEN` callback, but only fires for grid entities created
7534
8238
  * with the `spawnCustomGridEntity` helper function.
7535
8239
  *
7536
- * When registering the callback, takes an optional second argument that will make the callback
7537
- * only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
7538
- * variants, so there is no need for an optional third argument to filter by variant.)
8240
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8241
+ * an optional third argument that will make the callback only fire if it matches the custom
8242
+ * `GridEntityType` provided. (Custom grid entities do not have variants, so there is no need for
8243
+ * an optional argument to filter by variant.)
7539
8244
  *
7540
8245
  * ```ts
7541
8246
  * function postGridEntityCustomBroken(
@@ -7544,18 +8249,19 @@ export declare enum ModCallbackCustom {
7544
8249
  * ): void {}
7545
8250
  * ```
7546
8251
  */
7547
- POST_GRID_ENTITY_CUSTOM_BROKEN = 26,
8252
+ POST_GRID_ENTITY_CUSTOM_BROKEN = 25,
7548
8253
  /**
7549
8254
  * The same as the `POST_GRID_ENTITY_COLLISION` callback, but only fires for grid entities created
7550
8255
  * with the `spawnCustomGridEntity` helper function.
7551
8256
  *
7552
- * - When registering the callback, takes an optional second argument that will make the callback
7553
- * only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
7554
- * variants, so there is no need for an optional third argument to filter by variant.)
7555
- * - When registering the callback, takes an optional third argument that will make the callback
7556
- * only fire if the the colliding entity matches the `EntityType` provided.
7557
- * - When registering the callback, takes an optional fourth argument that will make the callback
7558
- * only fire if the the colliding entity matches the variant provided.
8257
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8258
+ * - You can provide an optional third argument that will make the callback only fire if it
8259
+ * matches the custom `GridEntityType` provided. (Custom grid entities do not have variants, so
8260
+ * there is no need for an optional argument to filter by variant.)
8261
+ * - You can provide an optional fourth argument that will make the callback only fire if the
8262
+ * colliding entity matches the `EntityType` provided.
8263
+ * - You can provide an optional fifth argument that will make the callback only fire if the
8264
+ * colliding entity matches the variant provided.
7559
8265
  *
7560
8266
  * ```ts
7561
8267
  * function postGridEntityCustomCollision(
@@ -7565,14 +8271,15 @@ export declare enum ModCallbackCustom {
7565
8271
  * ): void {}
7566
8272
  * ```
7567
8273
  */
7568
- POST_GRID_ENTITY_CUSTOM_COLLISION = 27,
8274
+ POST_GRID_ENTITY_CUSTOM_COLLISION = 26,
7569
8275
  /**
7570
8276
  * The same as the `POST_GRID_ENTITY_INIT` callback, but only fires for grid entities created with
7571
8277
  * the `spawnCustomGridEntity` helper function.
7572
8278
  *
7573
- * When registering the callback, takes an optional second argument that will make the callback
7574
- * only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
7575
- * variants, so there is no need for an optional third argument to filter by variant.)
8279
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8280
+ * an optional third argument that will make the callback only fire if it matches the custom
8281
+ * `GridEntityType` provided. (Custom grid entities do not have variants, so there is no need for
8282
+ * an optional argument to filter by variant.)
7576
8283
  *
7577
8284
  * ```ts
7578
8285
  * function postGridEntityCustomInit(
@@ -7581,14 +8288,15 @@ export declare enum ModCallbackCustom {
7581
8288
  * ): void {}
7582
8289
  * ```
7583
8290
  */
7584
- POST_GRID_ENTITY_CUSTOM_INIT = 28,
8291
+ POST_GRID_ENTITY_CUSTOM_INIT = 27,
7585
8292
  /**
7586
8293
  * The same as the `POST_GRID_ENTITY_REMOVE` callback, but only fires for grid entities created
7587
8294
  * with the `spawnCustomGridEntity` helper function.
7588
8295
  *
7589
- * When registering the callback, takes an optional second argument that will make the callback
7590
- * only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
7591
- * variants, so there is no need for an optional third argument to filter by variant.)
8296
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8297
+ * an optional third argument that will make the callback only fire if it matches the custom
8298
+ * `GridEntityType` provided. (Custom grid entities do not have variants, so there is no need for
8299
+ * an optional argument to filter by variant.)
7592
8300
  *
7593
8301
  * ```ts
7594
8302
  * function postGridEntityCustomRemove(
@@ -7597,14 +8305,15 @@ export declare enum ModCallbackCustom {
7597
8305
  * ): void {}
7598
8306
  * ```
7599
8307
  */
7600
- POST_GRID_ENTITY_CUSTOM_REMOVE = 29,
8308
+ POST_GRID_ENTITY_CUSTOM_REMOVE = 28,
7601
8309
  /**
7602
8310
  * The same as the `POST_GRID_ENTITY_RENDER` callback, but only fires for grid entities created
7603
8311
  * with the `spawnCustomGridEntity` helper function.
7604
8312
  *
7605
- * When registering the callback, takes an optional second argument that will make the callback
7606
- * only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
7607
- * variants, so there is no need for an optional third argument to filter by variant.)
8313
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8314
+ * an optional third argument that will make the callback only fire if it matches the custom
8315
+ * `GridEntityType` provided. (Custom grid entities do not have variants, so there is no need for
8316
+ * an optional argument to filter by variant.)
7608
8317
  *
7609
8318
  * ```ts
7610
8319
  * function postGridEntityCustomRender(
@@ -7613,14 +8322,15 @@ export declare enum ModCallbackCustom {
7613
8322
  * ): void {}
7614
8323
  * ```
7615
8324
  */
7616
- POST_GRID_ENTITY_CUSTOM_RENDER = 30,
8325
+ POST_GRID_ENTITY_CUSTOM_RENDER = 29,
7617
8326
  /**
7618
8327
  * The same as the `POST_GRID_ENTITY_STATE_CHANGED` callback, but only fires for grid entities
7619
8328
  * created with the `spawnCustomGridEntity` helper function.
7620
8329
  *
7621
- * When registering the callback, takes an optional second argument that will make the callback
7622
- * only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
7623
- * variants, so there is no need for an optional third argument to filter by variant.)
8330
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8331
+ * an optional third argument that will make the callback only fire if it matches the custom
8332
+ * `GridEntityType` provided. (Custom grid entities do not have variants, so there is no need for
8333
+ * an optional argument to filter by variant.)
7624
8334
  *
7625
8335
  * ```ts
7626
8336
  * function postGridEntityCustomStateChanged(
@@ -7631,14 +8341,15 @@ export declare enum ModCallbackCustom {
7631
8341
  * ): void {}
7632
8342
  * ```
7633
8343
  */
7634
- POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 31,
8344
+ POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 30,
7635
8345
  /**
7636
8346
  * The same as the `POST_GRID_ENTITY_UPDATE` callback, but only fires for grid entities created
7637
8347
  * with the `spawnCustomGridEntity` helper function.
7638
8348
  *
7639
- * When registering the callback, takes an optional second argument that will make the callback
7640
- * only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
7641
- * variants, so there is no need for an optional third argument to filter by variant.)
8349
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8350
+ * an optional third argument that will make the callback only fire if it matches the custom
8351
+ * `GridEntityType` provided. (Custom grid entities do not have variants, so there is no need for
8352
+ * an optional argument to filter by variant.)
7642
8353
  *
7643
8354
  * ```ts
7644
8355
  * function postGridEntityCustomUpdate(
@@ -7647,7 +8358,7 @@ export declare enum ModCallbackCustom {
7647
8358
  * ): void {}
7648
8359
  * ```
7649
8360
  */
7650
- POST_GRID_ENTITY_CUSTOM_UPDATE = 32,
8361
+ POST_GRID_ENTITY_CUSTOM_UPDATE = 31,
7651
8362
  /**
7652
8363
  * Fires when a new grid entity is initialized. Specifically, this is either:
7653
8364
  *
@@ -7659,16 +8370,17 @@ export declare enum ModCallbackCustom {
7659
8370
  * For grid entities created with `spawnCustomGridEntity`, use the `POST_GRID_ENTITY_CUSTOM_INIT`
7660
8371
  * callback instead.
7661
8372
  *
7662
- * - When registering the callback, takes an optional second argument that will make the callback
7663
- * only fire if it matches the `GridEntityType` provided.
7664
- * - When registering the callback, takes an optional third argument that will make the callback
7665
- * only fire if it matches the variant provided.
8373
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8374
+ * - You can provide an optional third argument that will make the callback only fire if it
8375
+ * matches the `GridEntityType` provided.
8376
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8377
+ * matches the variant provided.
7666
8378
  *
7667
8379
  * ```ts
7668
8380
  * function postGridEntityInit(gridEntity: GridEntity): void {}
7669
8381
  * ```
7670
8382
  */
7671
- POST_GRID_ENTITY_INIT = 33,
8383
+ POST_GRID_ENTITY_INIT = 32,
7672
8384
  /**
7673
8385
  * Fires from the `POST_UPDATE` callback when a new grid entity is removed. Specifically, this on
7674
8386
  * the frame after it no longer exists (where it did exist a frame ago).
@@ -7680,10 +8392,11 @@ export declare enum ModCallbackCustom {
7680
8392
  * For grid entities created with `spawnCustomGridEntity`, use the
7681
8393
  * `POST_GRID_ENTITY_CUSTOM_REMOVE` callback instead.
7682
8394
  *
7683
- * - When registering the callback, takes an optional second argument that will make the callback
7684
- * only fire if it matches the `GridEntityType` provided.
7685
- * - When registering the callback, takes an optional third argument that will make the callback
7686
- * only fire if it matches the variant provided.
8395
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8396
+ * - You can provide an optional third argument that will make the callback only fire if it
8397
+ * matches the `GridEntityType` provided.
8398
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8399
+ * matches the variant provided.
7687
8400
  *
7688
8401
  * ```ts
7689
8402
  * function postGridEntityRemove(
@@ -7692,23 +8405,24 @@ export declare enum ModCallbackCustom {
7692
8405
  * ): void {}
7693
8406
  * ```
7694
8407
  */
7695
- POST_GRID_ENTITY_REMOVE = 34,
8408
+ POST_GRID_ENTITY_REMOVE = 33,
7696
8409
  /**
7697
8410
  * Fires from the `POST_RENDER` callback on every frame that a grid entity exists.
7698
8411
  *
7699
8412
  * For grid entities created with `spawnCustomGridEntity`, use the
7700
8413
  * `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
7701
8414
  *
7702
- * - When registering the callback, takes an optional second argument that will make the callback
7703
- * only fire if it matches the `GridEntityType` provided.
7704
- * - When registering the callback, takes an optional third argument that will make the callback
7705
- * only fire if it matches the variant provided.
8415
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8416
+ * - You can provide an optional third argument that will make the callback only fire if it
8417
+ * matches the `GridEntityType` provided.
8418
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8419
+ * matches the variant provided.
7706
8420
  *
7707
8421
  * ```ts
7708
8422
  * function postGridEntityRender(gridEntity: GridEntity): void {}
7709
8423
  * ```
7710
8424
  */
7711
- POST_GRID_ENTITY_RENDER = 35,
8425
+ POST_GRID_ENTITY_RENDER = 34,
7712
8426
  /**
7713
8427
  * Fires from the `POST_UPDATE` callback when a grid entity changes its state. (In this context,
7714
8428
  * "state" refers to the `GridEntity.State` field.)
@@ -7716,10 +8430,11 @@ export declare enum ModCallbackCustom {
7716
8430
  * For grid entities created with `spawnCustomGridEntity`, use the
7717
8431
  * `POST_GRID_ENTITY_CUSTOM_STATE_CHANGED` callback instead.
7718
8432
  *
7719
- * - When registering the callback, takes an optional second argument that will make the callback
7720
- * only fire if it matches the `GridEntityType` provided.
7721
- * - When registering the callback, takes an optional third argument that will make the callback
7722
- * only fire if it matches the variant provided.
8433
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8434
+ * - You can provide an optional third argument that will make the callback only fire if it
8435
+ * matches the `GridEntityType` provided.
8436
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8437
+ * matches the variant provided.
7723
8438
  *
7724
8439
  * ```ts
7725
8440
  * function postGridEntityStateChanged(
@@ -7729,23 +8444,24 @@ export declare enum ModCallbackCustom {
7729
8444
  * ): void {}
7730
8445
  * ```
7731
8446
  */
7732
- POST_GRID_ENTITY_STATE_CHANGED = 36,
8447
+ POST_GRID_ENTITY_STATE_CHANGED = 35,
7733
8448
  /**
7734
8449
  * Fires from the `POST_UPDATE` callback on every frame that a grid entity exists.
7735
8450
  *
7736
8451
  * For grid entities created with `spawnCustomGridEntity`, use the
7737
8452
  * `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
7738
8453
  *
7739
- * - When registering the callback, takes an optional second argument that will make the callback
7740
- * only fire if it matches the `GridEntityType` provided.
7741
- * - When registering the callback, takes an optional third argument that will make the callback
7742
- * only fire if it matches the variant provided.
8454
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8455
+ * - You can provide an optional third argument that will make the callback only fire if it
8456
+ * matches the `GridEntityType` provided.
8457
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8458
+ * matches the variant provided.
7743
8459
  *
7744
8460
  * ```ts
7745
8461
  * function postGridEntityUpdate(gridEntity: GridEntity): void {}
7746
8462
  * ```
7747
8463
  */
7748
- POST_GRID_ENTITY_UPDATE = 37,
8464
+ POST_GRID_ENTITY_UPDATE = 36,
7749
8465
  /**
7750
8466
  * Fires from the `POST_PEFFECT_UPDATE` callback when the player loses a Holy Mantle temporary
7751
8467
  * collectible effect.
@@ -7754,10 +8470,11 @@ export declare enum ModCallbackCustom {
7754
8470
  * from an enemy. Normally, you would accomplish this via the `ENTITY_TAKE_DMG` callback, but that
7755
8471
  * callback never fires if the player has a Holy Mantle shield.
7756
8472
  *
7757
- * - When registering the callback, takes an optional second argument that will make the callback
7758
- * only fire if the player matches the `PlayerVariant` provided.
7759
- * - When registering the callback, takes an optional third argument that will make the callback
7760
- * only fire if the player matches the `PlayerType` provided.
8473
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8474
+ * - You can provide an optional third argument that will make the callback only fire if it
8475
+ * matches the `PlayerVariant` provided.
8476
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8477
+ * matches the `PlayerType` provided.
7761
8478
  *
7762
8479
  * ```ts
7763
8480
  * function postPlayerInitReordered(
@@ -7767,7 +8484,7 @@ export declare enum ModCallbackCustom {
7767
8484
  * ): void {}
7768
8485
  * ```
7769
8486
  */
7770
- POST_HOLY_MANTLE_REMOVED = 38,
8487
+ POST_HOLY_MANTLE_REMOVED = 37,
7771
8488
  /**
7772
8489
  * Fires from `POST_PEFFECT_UPDATE` callback when the player loses charge on their active
7773
8490
  * collectible item, implying that the item was just used.
@@ -7778,8 +8495,9 @@ export declare enum ModCallbackCustom {
7778
8495
  * Note that this callback will not fire if the active item is both discharged and swapped for
7779
8496
  * another item / discharged on the same frame, like in the case of Alabaster Box.
7780
8497
  *
7781
- * When registering the callback, takes an optional second argument that will make the callback
7782
- * only fire if it matches the `CollectibleType` provided.
8498
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8499
+ * an optional third argument that will make the callback only fire if it matches the
8500
+ * `CollectibleType` provided.
7783
8501
  *
7784
8502
  * ```ts
7785
8503
  * function postItemDischarge(
@@ -7789,7 +8507,7 @@ export declare enum ModCallbackCustom {
7789
8507
  * ): void {}
7790
8508
  * ```
7791
8509
  */
7792
- POST_ITEM_DISCHARGE = 39,
8510
+ POST_ITEM_DISCHARGE = 38,
7793
8511
  /**
7794
8512
  * Fires from the `POST_PEFFECT_UPDATE` callback when an item is no longer queued (i.e. when the
7795
8513
  * animation of the player holding the item above their head is finished and the item is actually
@@ -7797,10 +8515,11 @@ export declare enum ModCallbackCustom {
7797
8515
  *
7798
8516
  * Note that this callback will only fire once per Forgotten/Soul pair.
7799
8517
  *
7800
- * - When registering the callback, takes an optional second argument that will make the callback
7801
- * only fire if it matches the `ItemType` provided.
7802
- * - When registering the callback, takes an optional third argument that will make the callback
7803
- * only fire if the `CollectibleType` or the `TrinketType` matches the sub-type provided.
8518
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8519
+ * - You can provide an optional third argument that will make the callback only fire if it
8520
+ * matches the `ItemType` provided.
8521
+ * - You can provide an optional fourth argument that will make the callback only fire if the
8522
+ * sub-type matches the `CollectibleType` or the `TrinketType` provided.
7804
8523
  *
7805
8524
  * ```ts
7806
8525
  * function postItemPickup(
@@ -7809,35 +8528,37 @@ export declare enum ModCallbackCustom {
7809
8528
  * ): void {}
7810
8529
  * ```
7811
8530
  */
7812
- POST_ITEM_PICKUP = 40,
8531
+ POST_ITEM_PICKUP = 39,
7813
8532
  /**
7814
8533
  * Fires on the first `POST_KNIFE_UPDATE` frame for each knife.
7815
8534
  *
7816
8535
  * This callback is useful because many attributes cannot be set or retrieved properly in the
7817
8536
  * normal `POST_KNIFE_INIT` callback.
7818
8537
  *
7819
- * When registering the callback, takes an optional second argument that will make the callback
7820
- * only fire if the knife variant matches the `KnifeVariant` provided.
8538
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8539
+ * an optional third argument that will make the callback only fire if it matches the
8540
+ * `KnifeVariant` provided.
7821
8541
  *
7822
8542
  * ```ts
7823
8543
  * function postKnifeInitLate(knife: EntityKnife): void {}
7824
8544
  * ```
7825
8545
  */
7826
- POST_KNIFE_INIT_LATE = 41,
8546
+ POST_KNIFE_INIT_LATE = 40,
7827
8547
  /**
7828
8548
  * Fires on the first `POST_LASER_UPDATE` frame for each laser.
7829
8549
  *
7830
8550
  * This callback is useful because many attributes cannot be set or retrieved properly in the
7831
8551
  * normal `POST_LASER_INIT` callback.
7832
8552
  *
7833
- * When registering the callback, takes an optional second argument that will make the callback
7834
- * only fire if the laser variant matches the `LaserVariant` provided.
8553
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8554
+ * an optional third argument that will make the callback only fire if it matches the
8555
+ * `LaserVariant` provided.
7835
8556
  *
7836
8557
  * ```ts
7837
8558
  * function postLaserInitLate(laser: EntityLaser): void {}
7838
8559
  * ```
7839
8560
  */
7840
- POST_LASER_INIT_LATE = 42,
8561
+ POST_LASER_INIT_LATE = 41,
7841
8562
  /**
7842
8563
  * The same as the vanilla callback of the same name, but fires in the correct order with respect
7843
8564
  * to the `POST_GAME_STARTED` and the `POST_NEW_ROOM` callbacks:
@@ -7854,7 +8575,7 @@ export declare enum ModCallbackCustom {
7854
8575
  * function postNewLevelReordered(): void {}
7855
8576
  * ```
7856
8577
  */
7857
- POST_NEW_LEVEL_REORDERED = 43,
8578
+ POST_NEW_LEVEL_REORDERED = 42,
7858
8579
  /**
7859
8580
  * Fires on the first `POST_NEW_ROOM` or `PRE_ENTITY_SPAWN` callback where being in a new room is
7860
8581
  * detected. This is useful because the vanilla `POST_NEW_ROOM` callback fires only after entities
@@ -7865,7 +8586,7 @@ export declare enum ModCallbackCustom {
7865
8586
  * function postNewRoomEarly(): void {}
7866
8587
  * ```
7867
8588
  */
7868
- POST_NEW_ROOM_EARLY = 44,
8589
+ POST_NEW_ROOM_EARLY = 43,
7869
8590
  /**
7870
8591
  * The same as the vanilla callback of the same name, but fires in the correct order with respect
7871
8592
  * to the `POST_GAME_STARTED` and the `POST_NEW_LEVEL` callbacks:
@@ -7882,29 +8603,31 @@ export declare enum ModCallbackCustom {
7882
8603
  * function postNewRoomReordered(): void {}
7883
8604
  * ```
7884
8605
  */
7885
- POST_NEW_ROOM_REORDERED = 45,
8606
+ POST_NEW_ROOM_REORDERED = 44,
7886
8607
  /**
7887
8608
  * Fires on the first `NPC_UPDATE` frame for each NPC.
7888
8609
  *
7889
8610
  * This callback is useful because many attributes cannot be set or retrieved properly in the
7890
8611
  * normal `POST_NPC_INIT` callback.
7891
8612
  *
7892
- * When registering the callback, takes an optional second argument that will make the callback
7893
- * only fire if the NPC's entity type matches the entity type provided.
8613
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8614
+ * an optional third argument that will make the callback only fire if it matches the `EntityType`
8615
+ * provided.
7894
8616
  *
7895
8617
  * ```ts
7896
8618
  * function postNPCInitLate(npc: EntityNPC): void {}
7897
8619
  * ```
7898
8620
  */
7899
- POST_NPC_INIT_LATE = 46,
8621
+ POST_NPC_INIT_LATE = 45,
7900
8622
  /**
7901
8623
  * Fires from the `POST_NPC_UPDATE` callback when an NPC's state has changed from what it was on
7902
8624
  * the previous frame. (In this context, "state" refers to the `EntityNPC.State` field.)
7903
8625
  *
7904
- * - When registering the callback, takes an optional second argument that will make the callback
7905
- * only fire if it matches the `EntityType` provided.
7906
- * - When registering the callback, takes an optional third argument that will make the callback
7907
- * only fire if it matches the variant provided.
8626
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8627
+ * - You can provide an optional third argument that will make the callback only fire if it
8628
+ * matches the `EntityType` provided.
8629
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8630
+ * matches the variant provided.
7908
8631
  *
7909
8632
  * ```ts
7910
8633
  * function postNPCStateChanged(
@@ -7914,7 +8637,7 @@ export declare enum ModCallbackCustom {
7914
8637
  * ): void {}
7915
8638
  * ```
7916
8639
  */
7917
- POST_NPC_STATE_CHANGED = 47,
8640
+ POST_NPC_STATE_CHANGED = 46,
7918
8641
  /**
7919
8642
  * Similar to the vanilla callback of the same name, but fires after the
7920
8643
  * `POST_GAME_STARTED_REORDERED` callback fires (if the player is being updated on the 0th game
@@ -7929,29 +8652,31 @@ export declare enum ModCallbackCustom {
7929
8652
  * callback. For example, since the level is not generated yet, you will not be able to access
7930
8653
  * any rooms.
7931
8654
  *
7932
- * - When registering the callback, takes an optional second argument that will make the callback
7933
- * only fire if the player matches the `PlayerVariant` provided.
7934
- * - When registering the callback, takes an optional third argument that will make the callback
7935
- * only fire if the player matches the `PlayerType` provided.
8655
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8656
+ * - You can provide an optional third argument that will make the callback only fire if it
8657
+ * matches the `PlayerVariant` provided.
8658
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8659
+ * matches the `PlayerType` provided.
7936
8660
  *
7937
8661
  * ```ts
7938
8662
  * function postPEffectUpdateReordered(player: EntityPlayer): void {}
7939
8663
  * ```
7940
8664
  */
7941
- POST_PEFFECT_UPDATE_REORDERED = 48,
8665
+ POST_PEFFECT_UPDATE_REORDERED = 47,
7942
8666
  /**
7943
8667
  * Fires on the first `POST_RENDER` frame that a pickup plays the "Collect" animation.
7944
8668
  *
7945
8669
  * Use this callback to know when a pickup is added to the player's inventory or health.
7946
8670
  *
7947
- * When registering the callback, takes an optional second argument that will make the callback
7948
- * only fire if the pickup variant matches the `PickupVariant` provided.
8671
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8672
+ * an optional third argument that will make the callback only fire if it matches the
8673
+ * `PickupVariant` provided.
7949
8674
  *
7950
8675
  * ```ts
7951
8676
  * function postPickupCollect(pickup: EntityPickup, player: EntityPlayer): void {}
7952
8677
  * ```
7953
8678
  */
7954
- POST_PICKUP_COLLECT = 49,
8679
+ POST_PICKUP_COLLECT = 48,
7955
8680
  /**
7956
8681
  * Fires from the `POST_PICKUP_INIT` callback on the first time that a player has seen the
7957
8682
  * respective pickup on the run.
@@ -7959,34 +8684,37 @@ export declare enum ModCallbackCustom {
7959
8684
  * This callback is useful because pickups will despawn upon leaving the room and respawn upon
7960
8685
  * re-entering the room.
7961
8686
  *
7962
- * When registering the callback, takes an optional second argument that will make the callback
7963
- * only fire if the collectible type matches the `PickupVariant` provided.
8687
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8688
+ * an optional third argument that will make the callback only fire if it matches the
8689
+ * `PickupVariant` provided.
7964
8690
  *
7965
8691
  * ```ts
7966
8692
  * function postPickupInitFirst(pickup: EntityPickup): void {}
7967
8693
  * ```
7968
8694
  */
7969
- POST_PICKUP_INIT_FIRST = 50,
8695
+ POST_PICKUP_INIT_FIRST = 49,
7970
8696
  /**
7971
8697
  * Fires on the first `POST_PICKUP_UPDATE` frame for each pickup.
7972
8698
  *
7973
8699
  * This callback is useful because many attributes cannot be set or retrieved properly in the
7974
8700
  * normal `POST_PICKUP_INIT` callback.
7975
8701
  *
7976
- * When registering the callback, takes an optional second argument that will make the callback
7977
- * only fire if the pickup variant matches the `PickupVariant` provided.
8702
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8703
+ * an optional third argument that will make the callback only fire if it matches the
8704
+ * `PickupVariant` provided.
7978
8705
  *
7979
8706
  * ```ts
7980
8707
  * function postPickupInitLate(pickup: EntityPickup): void {}
7981
8708
  * ```
7982
8709
  */
7983
- POST_PICKUP_INIT_LATE = 51,
8710
+ POST_PICKUP_INIT_LATE = 50,
7984
8711
  /**
7985
8712
  * Fires from the `POST_PICKUP_UPDATE` callback when a pickup's state has changed from what it was
7986
8713
  * on the previous frame. (In this context, "state" refers to the `EntityPickup.State` field.)
7987
8714
  *
7988
- * When registering the callback, takes an optional second argument that will make the callback
7989
- * only fire if it matches the `PickupVariant` provided.
8715
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8716
+ * an optional third argument that will make the callback only fire if it matches the
8717
+ * `PickupVariant` provided.
7990
8718
  *
7991
8719
  * ```ts
7992
8720
  * function postPickupStateChanged(
@@ -7996,37 +8724,40 @@ export declare enum ModCallbackCustom {
7996
8724
  * ): void {}
7997
8725
  * ```
7998
8726
  */
7999
- POST_PICKUP_STATE_CHANGED = 52,
8727
+ POST_PICKUP_STATE_CHANGED = 51,
8000
8728
  /**
8001
8729
  * Fires from the `POST_RENDER` callback on every frame that a pit exists.
8002
8730
  *
8003
- * When registering the callback, takes an optional second argument that will make the callback
8004
- * only fire if it matches the variant provided.
8731
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8732
+ * an optional third argument that will make the callback only fire if it matches the variant
8733
+ * provided.
8005
8734
  *
8006
8735
  * ```ts
8007
8736
  * function postPitRender(pit: GridEntityPit): void {}
8008
8737
  * ```
8009
8738
  */
8010
- POST_PIT_RENDER = 53,
8739
+ POST_PIT_RENDER = 52,
8011
8740
  /**
8012
8741
  * Fires from the `POST_UPDATE` callback on every frame that a pit exists.
8013
8742
  *
8014
- * When registering the callback, takes an optional second argument that will make the callback
8015
- * only fire if it matches the variant provided.
8743
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8744
+ * an optional third argument that will make the callback only fire if it matches the variant
8745
+ * provided.
8016
8746
  *
8017
8747
  * ```ts
8018
8748
  * function postPitUpdate(pit: GridEntityPit): void {}
8019
8749
  * ```
8020
8750
  */
8021
- POST_PIT_UPDATE = 54,
8751
+ POST_PIT_UPDATE = 53,
8022
8752
  /**
8023
8753
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player's health (i.e. hearts) is different
8024
8754
  * than what it was on the previous frame. For more information, see the `PlayerHealth` enum.
8025
8755
  *
8026
- * - When registering the callback, takes an optional second argument that will make the callback
8027
- * only fire if the player matches the `PlayerVariant` provided.
8028
- * - When registering the callback, takes an optional third argument that will make the callback
8029
- * only fire if the player matches the `PlayerType` provided.
8756
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8757
+ * - You can provide an optional third argument that will make the callback only fire if it
8758
+ * matches the `PlayerVariant` provided.
8759
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8760
+ * matches the `PlayerType` provided.
8030
8761
  *
8031
8762
  * ```ts
8032
8763
  * function postPlayerChangeHealth(
@@ -8038,7 +8769,7 @@ export declare enum ModCallbackCustom {
8038
8769
  * ): void {}
8039
8770
  * ```
8040
8771
  */
8041
- POST_PLAYER_CHANGE_HEALTH = 55,
8772
+ POST_PLAYER_CHANGE_HEALTH = 54,
8042
8773
  /**
8043
8774
  * Fires from the `POST_PEFFECT_UPDATE` callback when one of the player's stats change from what
8044
8775
  * they were on the previous frame.
@@ -8052,10 +8783,11 @@ export declare enum ModCallbackCustom {
8052
8783
  * numbers. (For these cases, you should examine the `oldValue` and `newValue` arguments
8053
8784
  * accordingly.)
8054
8785
  *
8055
- * - When registering the callback, takes an optional second argument that will make the callback
8056
- * only fire if the player matches the `PlayerVariant` provided.
8057
- * - When registering the callback, takes an optional third argument that will make the callback
8058
- * only fire if the player matches the `PlayerType` provided.
8786
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8787
+ * - You can provide an optional third argument that will make the callback only fire if it
8788
+ * matches the `PlayerVariant` provided.
8789
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8790
+ * matches the `PlayerType` provided.
8059
8791
  *
8060
8792
  * ```ts
8061
8793
  * function postPlayerChangeStat(
@@ -8067,7 +8799,7 @@ export declare enum ModCallbackCustom {
8067
8799
  * ): void {}
8068
8800
  * ```
8069
8801
  */
8070
- POST_PLAYER_CHANGE_STAT = 56,
8802
+ POST_PLAYER_CHANGE_STAT = 55,
8071
8803
  /**
8072
8804
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player entity changes its player type
8073
8805
  * (i.e. character) from what it was on the previous frame. For example, it will fire after using
@@ -8077,6 +8809,10 @@ export declare enum ModCallbackCustom {
8077
8809
  * those items cause separate player entities to be created. Use the `POST_FLIP` and
8078
8810
  * `POST_ESAU_JR` callbacks to handle those situations.
8079
8811
  *
8812
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8813
+ * an optional third argument that will make the callback only fire if it matches the
8814
+ * `PlayerVariant` provided.
8815
+ *
8080
8816
  * ```ts
8081
8817
  * function postPlayerChangeType(
8082
8818
  * player: EntityPlayer,
@@ -8085,14 +8821,15 @@ export declare enum ModCallbackCustom {
8085
8821
  * ): void {}
8086
8822
  * ```
8087
8823
  */
8088
- POST_PLAYER_CHANGE_TYPE = 57,
8824
+ POST_PLAYER_CHANGE_TYPE = 56,
8089
8825
  /**
8090
8826
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is higher than
8091
8827
  * what it was on the previous frame, or when the active items change, or when the build is
8092
8828
  * rerolled.
8093
8829
  *
8094
- * When registering the callback, takes an optional second argument that will make the callback
8095
- * only fire if the collectible matches the `CollectibleType` provided.
8830
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8831
+ * an optional third argument that will make the callback only fire if the collectible matches the
8832
+ * `CollectibleType` provided.
8096
8833
  *
8097
8834
  * ```ts
8098
8835
  * function postPlayerCollectibleAdded(
@@ -8101,14 +8838,15 @@ export declare enum ModCallbackCustom {
8101
8838
  * ): void {}
8102
8839
  * ```
8103
8840
  */
8104
- POST_PLAYER_COLLECTIBLE_ADDED = 58,
8841
+ POST_PLAYER_COLLECTIBLE_ADDED = 57,
8105
8842
  /**
8106
8843
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is lower than
8107
8844
  * what it was on the previous frame, or when the active items change, or when the build is
8108
8845
  * rerolled.
8109
8846
  *
8110
- * When registering the callback, takes an optional second argument that will make the callback
8111
- * only fire if the collectible matches the `CollectibleType` provided.
8847
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8848
+ * an optional third argument that will make the callback only fire if the collectible matches the
8849
+ * `CollectibleType` provided.
8112
8850
  *
8113
8851
  * ```ts
8114
8852
  * function postPlayerCollectibleRemoved(
@@ -8117,7 +8855,7 @@ export declare enum ModCallbackCustom {
8117
8855
  * ): void {}
8118
8856
  * ```
8119
8857
  */
8120
- POST_PLAYER_COLLECTIBLE_REMOVED = 59,
8858
+ POST_PLAYER_COLLECTIBLE_REMOVED = 58,
8121
8859
  /**
8122
8860
  * Fires from the `ENTITY_TAKE_DMG` callback when a player takes fatal damage. Return false to
8123
8861
  * prevent the fatal damage.
@@ -8125,16 +8863,17 @@ export declare enum ModCallbackCustom {
8125
8863
  * Note that this function does properly take into account Guppy's Collar, Broken Ankh, Spirit
8126
8864
  * Shackles, and Mysterious Paper. It also takes into account using The Bible on Satan.
8127
8865
  *
8128
- * - When registering the callback, takes an optional second argument that will make the callback
8129
- * only fire if the player matches the `PlayerVariant` provided.
8130
- * - When registering the callback, takes an optional third argument that will make the callback
8131
- * only fire if the player matches the `PlayerType` provided.
8866
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8867
+ * - You can provide an optional third argument that will make the callback only fire if it
8868
+ * matches the `PlayerVariant` provided.
8869
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8870
+ * matches the `PlayerType` provided.
8132
8871
  *
8133
8872
  * ```ts
8134
8873
  * function postPlayerFatalDamage(player: EntityPlayer): boolean | undefined {}
8135
8874
  * ```
8136
8875
  */
8137
- POST_PLAYER_FATAL_DAMAGE = 60,
8876
+ POST_PLAYER_FATAL_DAMAGE = 59,
8138
8877
  /**
8139
8878
  * Fires on the first `POST_PEFFECT_UPDATE_REORDERED` frame for each player, similar to the
8140
8879
  * `POST_PLAYER_INIT_LATE` callback, with two changes:
@@ -8146,16 +8885,17 @@ export declare enum ModCallbackCustom {
8146
8885
  * character their starting items for the run. (You do not want to use the vanilla
8147
8886
  * `POST_PLAYER_INIT` callback for this because it fires when a run is continued.)
8148
8887
  *
8149
- * - When registering the callback, takes an optional second argument that will make the callback
8150
- * only fire if the player matches the `PlayerVariant` provided.
8151
- * - When registering the callback, takes an optional third argument that will make the callback
8152
- * only fire if the player matches the `PlayerType` provided.
8888
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8889
+ * - You can provide an optional third argument that will make the callback only fire if it
8890
+ * matches the `PlayerVariant` provided.
8891
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8892
+ * matches the `PlayerType` provided.
8153
8893
  *
8154
8894
  * ```ts
8155
8895
  * function postPlayerInitFirst(player: EntityPlayer): void {}
8156
8896
  * ```
8157
8897
  */
8158
- POST_PLAYER_INIT_FIRST = 61,
8898
+ POST_PLAYER_INIT_FIRST = 60,
8159
8899
  /**
8160
8900
  * Fires on the first `POST_PEFFECT_UPDATE_REORDERED` frame for each player.
8161
8901
  *
@@ -8165,16 +8905,17 @@ export declare enum ModCallbackCustom {
8165
8905
  * For initializing a player with custom items and so forth, use the `POST_PLAYER_INIT_FIRST`
8166
8906
  * callback instead to handle the case of a Genesis room.
8167
8907
  *
8168
- * - When registering the callback, takes an optional second argument that will make the callback
8169
- * only fire if the player matches the `PlayerVariant` provided.
8170
- * - When registering the callback, takes an optional third argument that will make the callback
8171
- * only fire if the player matches the `PlayerType` provided.
8908
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8909
+ * - You can provide an optional third argument that will make the callback only fire if it
8910
+ * matches the `PlayerVariant` provided.
8911
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8912
+ * matches the `PlayerType` provided.
8172
8913
  *
8173
8914
  * ```ts
8174
8915
  * function postPlayerInitLate(pickup: EntityPickup): void {}
8175
8916
  * ```
8176
8917
  */
8177
- POST_PLAYER_INIT_LATE = 62,
8918
+ POST_PLAYER_INIT_LATE = 61,
8178
8919
  /**
8179
8920
  * Similar to the vanilla callback of the same name, but fires after the `POST_GAME_STARTED`
8180
8921
  * callback fires (if the player is spawning on the 0th game frame of the run).
@@ -8188,16 +8929,17 @@ export declare enum ModCallbackCustom {
8188
8929
  * callback. For example, since the level is not generated yet, you will not be able to access
8189
8930
  * any rooms.
8190
8931
  *
8191
- * - When registering the callback, takes an optional second argument that will make the callback
8192
- * only fire if the player matches the `PlayerVariant` provided.
8193
- * - When registering the callback, takes an optional third argument that will make the callback
8194
- * only fire if the player matches the `PlayerType` provided.
8932
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8933
+ * - You can provide an optional third argument that will make the callback only fire if it
8934
+ * matches the `PlayerVariant` provided.
8935
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8936
+ * matches the `PlayerType` provided.
8195
8937
  *
8196
8938
  * ```ts
8197
8939
  * function postPlayerRenderReordered(player: EntityPlayer): void {}
8198
8940
  * ```
8199
8941
  */
8200
- POST_PLAYER_RENDER_REORDERED = 63,
8942
+ POST_PLAYER_RENDER_REORDERED = 62,
8201
8943
  /**
8202
8944
  * Similar to the vanilla callback of the same name, but fires after the
8203
8945
  * `POST_GAME_STARTED_REORDERED` callback fires (if the player is being updated on the 0th game
@@ -8212,147 +8954,159 @@ export declare enum ModCallbackCustom {
8212
8954
  * callback. For example, since the level is not generated yet, you will not be able to access
8213
8955
  * any rooms.
8214
8956
  *
8215
- * - When registering the callback, takes an optional second argument that will make the callback
8216
- * only fire if the player matches the `PlayerVariant` provided.
8217
- * - When registering the callback, takes an optional third argument that will make the callback
8218
- * only fire if the player matches the `PlayerType` provided.
8957
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
8958
+ * - You can provide an optional third argument that will make the callback only fire if it
8959
+ * matches the `PlayerVariant` provided.
8960
+ * - You can provide an optional fourth argument that will make the callback only fire if it
8961
+ * matches the `PlayerType` provided.
8219
8962
  *
8220
8963
  * ```ts
8221
8964
  * function postPlayerUpdateReordered(player: EntityPlayer): void {}
8222
8965
  * ```
8223
8966
  */
8224
- POST_PLAYER_UPDATE_REORDERED = 64,
8967
+ POST_PLAYER_UPDATE_REORDERED = 63,
8225
8968
  /**
8226
8969
  * Fires from the `POST_RENDER` callback on every frame that a poop exists.
8227
8970
  *
8228
- * When registering the callback, takes an optional second argument that will make the callback
8229
- * only fire if it matches the variant provided.
8971
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8972
+ * an optional third argument that will make the callback only fire if it matches the variant
8973
+ * provided.
8230
8974
  *
8231
8975
  * ```ts
8232
8976
  * function postPoopRender(poop: GridEntityPoop): void {}
8233
8977
  * ```
8234
8978
  */
8235
- POST_POOP_RENDER = 65,
8979
+ POST_POOP_RENDER = 64,
8236
8980
  /**
8237
8981
  * Fires from the `POST_UPDATE` callback on every frame that a poop exists.
8238
8982
  *
8239
- * When registering the callback, takes an optional second argument that will make the callback
8240
- * only fire if it matches the variant provided.
8983
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8984
+ * an optional third argument that will make the callback only fire if it matches the variant
8985
+ * provided.
8241
8986
  *
8242
8987
  * ```ts
8243
8988
  * function postPoopUpdate(poop: GridEntityPoop): void {}
8244
8989
  * ```
8245
8990
  */
8246
- POST_POOP_UPDATE = 66,
8991
+ POST_POOP_UPDATE = 65,
8247
8992
  /**
8248
8993
  * Fires from the `POST_RENDER` callback on every frame that a pressure plate exists.
8249
8994
  *
8250
- * When registering the callback, takes an optional second argument that will make the callback
8251
- * only fire if it matches the variant provided.
8995
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
8996
+ * an optional third argument that will make the callback only fire if it matches the variant
8997
+ * provided.
8252
8998
  *
8253
8999
  * ```ts
8254
9000
  * function postPressurePlateRender(pressurePlate: GridEntityPressurePlate): void {}
8255
9001
  * ```
8256
9002
  */
8257
- POST_PRESSURE_PLATE_RENDER = 67,
9003
+ POST_PRESSURE_PLATE_RENDER = 66,
8258
9004
  /**
8259
9005
  * Fires from the `POST_UPDATE` callback on every frame that a pressure plate exists.
8260
9006
  *
8261
- * When registering the callback, takes an optional second argument that will make the callback
8262
- * only fire if it matches the variant provided.
9007
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9008
+ * an optional third argument that will make the callback only fire if it matches the variant
9009
+ * provided.
8263
9010
  *
8264
9011
  * ```ts
8265
9012
  * function postPressurePlateUpdate(pressurePlate: GridEntityPressurePlate): void {}
8266
9013
  * ```
8267
9014
  */
8268
- POST_PRESSURE_PLATE_UPDATE = 68,
9015
+ POST_PRESSURE_PLATE_UPDATE = 67,
8269
9016
  /**
8270
9017
  * Fires on the first `POST_PROJECTILE_UPDATE` frame for each projectile.
8271
9018
  *
8272
9019
  * This callback is useful because many attributes cannot be set or retrieved properly in the
8273
9020
  * normal `POST_PROJECTILE_INIT` callback.
8274
9021
  *
8275
- * When registering the callback, takes an optional second argument that will make the callback
8276
- * only fire if the projectile variant matches the `ProjectileVariant` provided.
9022
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9023
+ * an optional third argument that will make the callback only fire if matches the
9024
+ * `ProjectileVariant` provided.
8277
9025
  *
8278
9026
  * ```ts
8279
9027
  * function postProjectileInitLate(projectile: EntityProjectile): void {}
8280
9028
  * ```
8281
9029
  */
8282
- POST_PROJECTILE_INIT_LATE = 69,
9030
+ POST_PROJECTILE_INIT_LATE = 68,
8283
9031
  /**
8284
9032
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player first picks up a new item. The
8285
9033
  * pickup returned in the callback is assumed to be the first pickup that no longer exists.
8286
9034
  *
8287
- * - When registering the callback, takes an optional second argument that will make the callback
8288
- * only fire if it matches the `PickupVariant` provided.
8289
- * - When registering the callback, takes an optional third argument that will make the callback
8290
- * only fire if it matches the sub-type provided.
9035
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9036
+ * - You can provide an optional third argument that will make the callback only fire if it
9037
+ * matches the `PickupVariant` provided.
9038
+ * - You can provide an optional fourth argument that will make the callback only fire if it
9039
+ * matches the sub-type provided.
8291
9040
  *
8292
9041
  * ```ts
8293
9042
  * function postPurchase(player: EntityPlayer, pickup: EntityPickup): void {}
8294
9043
  * ```
8295
9044
  */
8296
- POST_PURCHASE = 70,
9045
+ POST_PURCHASE = 69,
8297
9046
  /**
8298
9047
  * Fires from the `POST_RENDER` callback on every frame that a rock exists.
8299
9048
  *
8300
- * When registering the callback, takes an optional second argument that will make the callback
8301
- * only fire if it matches the variant provided.
9049
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9050
+ * an optional third argument that will make the callback only fire if it matches the variant
9051
+ * provided.
8302
9052
  *
8303
9053
  * ```ts
8304
9054
  * function postRockRender(rock: GridEntityRock): void {}
8305
9055
  * ```
8306
9056
  */
8307
- POST_ROCK_RENDER = 71,
9057
+ POST_ROCK_RENDER = 70,
8308
9058
  /**
8309
9059
  * Fires from the `POST_UPDATE` callback on every frame that a rock exists.
8310
9060
  *
8311
- * When registering the callback, takes an optional second argument that will make the callback
8312
- * only fire if it matches the variant provided.
9061
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9062
+ * an optional third argument that will make the callback only fire if it matches the variant
9063
+ * provided.
8313
9064
  *
8314
9065
  * ```ts
8315
9066
  * function postRockUpdate(rock: GridEntityRock): void {}
8316
9067
  * ```
8317
9068
  */
8318
- POST_ROCK_UPDATE = 72,
9069
+ POST_ROCK_UPDATE = 71,
8319
9070
  /**
8320
9071
  * Fires from the `POST_UPDATE` callback when the clear state of a room changes (as according to
8321
9072
  * the `Room.IsClear` method).
8322
9073
  *
8323
- * When registering the callback, takes an optional second argument that will make the callback
8324
- * only fire if the room clear state matches the boolean provided.
9074
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9075
+ * an optional third argument that will make the callback only fire if the room clear state
9076
+ * matches the boolean provided.
8325
9077
  *
8326
9078
  * ```ts
8327
9079
  * function postRoomClearChanged(roomClear: boolean): void {}
8328
9080
  * ```
8329
9081
  */
8330
- POST_ROOM_CLEAR_CHANGED = 73,
9082
+ POST_ROOM_CLEAR_CHANGED = 72,
8331
9083
  /**
8332
9084
  * Fires from the `ENTITY_TAKE_DMG` callback when a player takes damage from spikes in a Sacrifice
8333
9085
  * Room.
8334
9086
  *
8335
- * - When registering the callback, takes an optional second argument that will make the callback
8336
- * only fire if the player matches the `PlayerVariant` provided.
8337
- * - When registering the callback, takes an optional third argument that will make the callback
8338
- * only fire if the player matches the `PlayerType` provided.
9087
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9088
+ * - You can provide an optional third argument that will make the callback only fire if it
9089
+ * matches the `PlayerVariant` provided.
9090
+ * - You can provide an optional fourth argument that will make the callback only fire if it
9091
+ * matches the `PlayerType` provided.
8339
9092
  *
8340
9093
  * ```ts
8341
9094
  * function postSacrifice(player: EntityPlayer, numSacrifices: int): void {}
8342
9095
  * ```
8343
9096
  */
8344
- POST_SACRIFICE = 74,
9097
+ POST_SACRIFICE = 73,
8345
9098
  /**
8346
9099
  * Fires from the `POST_RENDER` callback when a slot entity's animation changes.
8347
9100
  *
8348
- * When registering the callback, takes an optional second argument that will make the callback
8349
- * only fire if it matches the `SlotVariant` provided.
9101
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9102
+ * an optional third argument that will make the callback only fire if it matches the
9103
+ * `SlotVariant` provided.
8350
9104
  *
8351
9105
  * ```ts
8352
9106
  * function postSlotAnimationChanged(slot: Entity): void {}
8353
9107
  * ```
8354
9108
  */
8355
- POST_SLOT_ANIMATION_CHANGED = 75,
9109
+ POST_SLOT_ANIMATION_CHANGED = 74,
8356
9110
  /**
8357
9111
  * Fires from the `PRE_PLAYER_COLLISION` callback when when a player collides with a slot entity.
8358
9112
  * (It will not fire if any other type of entity collides with the slot entity.)
@@ -8361,9 +9115,10 @@ export declare enum ModCallbackCustom {
8361
9115
  * colliding with it on every frame. Thus, you should only perform actions in this callback under
8362
9116
  * certain conditions, like if the slot entity is playing the "Idle" animation, and so on.
8363
9117
  *
8364
- * When registering the callback, takes an optional second argument that will make the callback
8365
- * only fire if it matches the `SlotVariant` provided. (There is no need for any additional
8366
- * arguments, since only players will cause this callback to fire.)
9118
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9119
+ * an optional third argument that will make the callback only fire if it matches the
9120
+ * `SlotVariant` provided. (Only players will cause this callback to fire, so there is no need for
9121
+ * an optional argument to filter by `EntityType`.)
8367
9122
  *
8368
9123
  * ```ts
8369
9124
  * function postSlotCollision(
@@ -8372,21 +9127,22 @@ export declare enum ModCallbackCustom {
8372
9127
  * ): void {}
8373
9128
  * ```
8374
9129
  */
8375
- POST_SLOT_COLLISION = 76,
9130
+ POST_SLOT_COLLISION = 75,
8376
9131
  /**
8377
9132
  * Fires from the `POST_RENDER` callback when a slot plays the animation that indicates that it
8378
9133
  * has broken.
8379
9134
  *
8380
- * - When registering the callback, takes an optional second argument that will make the callback
8381
- * only fire if it matches the `SlotVariant` provided.
8382
- * - When registering the callback, takes an optional third argument that will make the callback
8383
- * only fire if the destruction type matches the `SlotDestructionType` provided.
9135
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9136
+ * - You can provide an optional third argument that will make the callback only fire if it
9137
+ * matches the `SlotVariant` provided.
9138
+ * - You can provide an optional fourth argument that will make the callback only fire if it
9139
+ * matches the `SlotDestructionType` provided.
8384
9140
  *
8385
9141
  * ```ts
8386
9142
  * function postSlotDestroyed(slot: Entity, slotDestructionType: SlotDestructionType): void {}
8387
9143
  * ```
8388
9144
  */
8389
- POST_SLOT_DESTROYED = 77,
9145
+ POST_SLOT_DESTROYED = 76,
8390
9146
  /**
8391
9147
  * Fires when a new slot entity is initialized. Specifically, this is either:
8392
9148
  *
@@ -8395,58 +9151,63 @@ export declare enum ModCallbackCustom {
8395
9151
  * - in the `POST_UPDATE` callback (if the entity appeared mid-way through the room, like when a
8396
9152
  * Wheel of Fortune card is used)
8397
9153
  *
8398
- * When registering the callback, takes an optional second argument that will make the callback
8399
- * only fire if it matches the `SlotVariant` provided.
9154
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9155
+ * an optional third argument that will make the callback only fire if it matches the
9156
+ * `SlotVariant` provided.
8400
9157
  *
8401
9158
  * ```ts
8402
9159
  * function postSlotInit(slot: Entity): void {}
8403
9160
  * ```
8404
9161
  */
8405
- POST_SLOT_INIT = 78,
9162
+ POST_SLOT_INIT = 77,
8406
9163
  /**
8407
9164
  * Fires from the `POST_RENDER` callback on every frame that a slot entity exists.
8408
9165
  *
8409
- * When registering the callback, takes an optional second argument that will make the callback
8410
- * only fire if it matches the `SlotVariant` provided.
9166
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9167
+ * an optional third argument that will make the callback only fire if it matches the
9168
+ * `SlotVariant` provided.
8411
9169
  *
8412
9170
  * ```ts
8413
9171
  * function postSlotRender(slot: Entity): void {}
8414
9172
  * ```
8415
9173
  */
8416
- POST_SLOT_RENDER = 79,
9174
+ POST_SLOT_RENDER = 78,
8417
9175
  /**
8418
9176
  * Fires from the `POST_UPDATE` callback on every frame that a slot entity exists.
8419
9177
  *
8420
- * When registering the callback, takes an optional second argument that will make the callback
8421
- * only fire if it matches the `SlotVariant` provided.
9178
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9179
+ * an optional third argument that will make the callback only fire if it matches the
9180
+ * `SlotVariant` provided.
8422
9181
  *
8423
9182
  * ```ts
8424
9183
  * function postSlotUpdate(slot: Entity): void {}
8425
9184
  * ```
8426
9185
  */
8427
- POST_SLOT_UPDATE = 80,
9186
+ POST_SLOT_UPDATE = 79,
8428
9187
  /**
8429
9188
  * Fires from the `POST_RENDER` callback on every frame that spikes exist.
8430
9189
  *
8431
- * When registering the callback, takes an optional second argument that will make the callback
8432
- * only fire if it matches the variant provided.
9190
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9191
+ * an optional third argument that will make the callback only fire if it matches the variant
9192
+ * provided.
8433
9193
  *
8434
9194
  * ```ts
8435
9195
  * function postSpikesRender(spikes: GridEntitySpikes): void {}
8436
9196
  * ```
8437
9197
  */
8438
- POST_SPIKES_RENDER = 81,
9198
+ POST_SPIKES_RENDER = 80,
8439
9199
  /**
8440
9200
  * Fires from the `POST_UPDATE` callback on every frame that spikes exist.
8441
9201
  *
8442
- * When registering the callback, takes an optional second argument that will make the callback
8443
- * only fire if it matches the variant provided.
9202
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9203
+ * an optional third argument that will make the callback only fire if it matches the variant
9204
+ * provided.
8444
9205
  *
8445
9206
  * ```ts
8446
9207
  * function postSpikesUpdate(spikes: GridEntitySpikes): void {}
8447
9208
  * ```
8448
9209
  */
8449
- POST_SPIKES_UPDATE = 82,
9210
+ POST_SPIKES_UPDATE = 81,
8450
9211
  /**
8451
9212
  * Fires on the first `POST_TEAR_UPDATE` frame for each tear (which is when
8452
9213
  * `EntityTear.FrameCount` is equal to 0).
@@ -8454,58 +9215,63 @@ export declare enum ModCallbackCustom {
8454
9215
  * This callback is useful because many attributes cannot be set or retrieved properly in the
8455
9216
  * normal `POST_TEAR_INIT` callback.
8456
9217
  *
8457
- * When registering the callback, takes an optional second argument that will make the callback
8458
- * only fire if the tear variant matches the `TearVariant` provided.
9218
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9219
+ * an optional third argument that will make the callback only fire if it matches the
9220
+ * `TearVariant` provided.
8459
9221
  *
8460
9222
  * ```ts
8461
9223
  * function postTearInitLate(tear: EntityTear): void {}
8462
9224
  * ```
8463
9225
  */
8464
- POST_TEAR_INIT_LATE = 83,
9226
+ POST_TEAR_INIT_LATE = 82,
8465
9227
  /**
8466
9228
  * Fires on the second `POST_TEAR_UPDATE` frame for each tear (which is when
8467
9229
  * `EntityTear.FrameCount` is equal to 1).
8468
9230
  *
8469
9231
  * This callback is useful because Incubus tears are not distinguishable until the second frame.
8470
9232
  *
8471
- * When registering the callback, takes an optional second argument that will make the callback
8472
- * only fire if the tear variant matches the `TearVariant` provided.
9233
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9234
+ * an optional third argument that will make the callback only fire if it matches the
9235
+ * `TearVariant` provided.
8473
9236
  *
8474
9237
  * ```ts
8475
9238
  * function postTearInitVeryLate(tear: EntityTear): void {}
8476
9239
  * ```
8477
9240
  */
8478
- POST_TEAR_INIT_VERY_LATE = 84,
9241
+ POST_TEAR_INIT_VERY_LATE = 83,
8479
9242
  /**
8480
9243
  * Fires from the `POST_RENDER` callback on every frame that a TNT exists.
8481
9244
  *
8482
- * When registering the callback, takes an optional second argument that will make the callback
8483
- * only fire if it matches the variant provided.
9245
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9246
+ * an optional third argument that will make the callback only fire if it matches the variant
9247
+ * provided.
8484
9248
  *
8485
9249
  * ```ts
8486
9250
  * function postTNTRender(tnt: GridEntityTNT): void {}
8487
9251
  * ```
8488
9252
  */
8489
- POST_TNT_RENDER = 85,
9253
+ POST_TNT_RENDER = 84,
8490
9254
  /**
8491
9255
  * Fires from the `POST_UPDATE` callback on every frame that a TNT exists.
8492
9256
  *
8493
- * When registering the callback, takes an optional second argument that will make the callback
8494
- * only fire if it matches the variant provided.
9257
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9258
+ * an optional third argument that will make the callback only fire if it matches the variant
9259
+ * provided.
8495
9260
  *
8496
9261
  * ```ts
8497
9262
  * function postTNTUpdate(tnt: GridEntityTNT): void {}
8498
9263
  * ```
8499
9264
  */
8500
- POST_TNT_UPDATE = 86,
9265
+ POST_TNT_UPDATE = 85,
8501
9266
  /**
8502
9267
  * Fires from the `POST_PEFFECT_UPDATE` callback when a player gains or loses a new
8503
9268
  * transformation.
8504
9269
  *
8505
9270
  * Note that this callback will only fire once per Forgotten/Soul pair.
8506
9271
  *
8507
- * When registering the callback, takes an optional second argument that will make the callback
8508
- * only fire if it matches the `PlayerForm` provided.
9272
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9273
+ * an optional third argument that will make the callback only fire if it matches the `PlayerForm`
9274
+ * provided.
8509
9275
  *
8510
9276
  * ```ts
8511
9277
  * function postTransformation(
@@ -8515,12 +9281,13 @@ export declare enum ModCallbackCustom {
8515
9281
  * ): void {}
8516
9282
  * ```
8517
9283
  */
8518
- POST_TRANSFORMATION = 87,
9284
+ POST_TRANSFORMATION = 86,
8519
9285
  /**
8520
9286
  * Fires from `ENTITY_TAKE_DMG` callback when a Wishbone or a Walnut breaks.
8521
9287
  *
8522
- * When registering the callback, takes an optional second argument that will make the callback
8523
- * only fire if it matches the `TrinketType` provided.
9288
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method, you can provide
9289
+ * an optional third argument that will make the callback only fire if it matches the
9290
+ * `TrinketType` provided.
8524
9291
  *
8525
9292
  * ```ts
8526
9293
  * function postTrinketBreak(
@@ -8529,22 +9296,23 @@ export declare enum ModCallbackCustom {
8529
9296
  * ): void {}
8530
9297
  * ```
8531
9298
  */
8532
- POST_TRINKET_BREAK = 88,
9299
+ POST_TRINKET_BREAK = 87,
8533
9300
  /**
8534
9301
  * Fires from the `POST_PEFFECT_UPDATE` callback on the frame before a Berserk effect ends when
8535
9302
  * the player is predicted to die (e.g. they currently have no health left or they took damage in
8536
9303
  * a "Lost" form).
8537
9304
  *
8538
- * - When registering the callback, takes an optional second argument that will make the callback
8539
- * only fire if the player matches the `PlayerVariant` provided.
8540
- * - When registering the callback, takes an optional third argument that will make the callback
8541
- * only fire if the player matches the `PlayerType` provided.
9305
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9306
+ * - You can provide an optional third argument that will make the callback only fire if it
9307
+ * matches the `PlayerVariant` provided.
9308
+ * - You can provide an optional fourth argument that will make the callback only fire if it
9309
+ * matches the `PlayerType` provided.
8542
9310
  *
8543
9311
  * ```ts
8544
9312
  * function preBerserkDeath(player: EntityPlayer): void {}
8545
9313
  * ```
8546
9314
  */
8547
- PRE_BERSERK_DEATH = 89,
9315
+ PRE_BERSERK_DEATH = 88,
8548
9316
  /**
8549
9317
  * Fires from the `POST_PLAYER_FATAL_DAMAGE` callback when a player is about to die. If you want
8550
9318
  * to initiate a custom revival, return an integer that corresponds to the item or type of revival
@@ -8553,16 +9321,17 @@ export declare enum ModCallbackCustom {
8553
9321
  * This callback is useful because reviving the player after the game things that player should
8554
9322
  * have died will result in the save data for the run getting deleted.
8555
9323
  *
8556
- * - When registering the callback, takes an optional second argument that will make the callback
8557
- * only fire if the player matches the `PlayerVariant` provided.
8558
- * - When registering the callback, takes an optional third argument that will make the callback
8559
- * only fire if the player matches the `PlayerType` provided.
9324
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9325
+ * - You can provide an optional third argument that will make the callback only fire if it
9326
+ * matches the `PlayerVariant` provided.
9327
+ * - You can provide an optional fourth argument that will make the callback only fire if it
9328
+ * matches the `PlayerType` provided.
8560
9329
  *
8561
9330
  * ```ts
8562
9331
  * function preCustomRevive(player: EntityPlayer): int | undefined {}
8563
9332
  * ```
8564
9333
  */
8565
- PRE_CUSTOM_REVIVE = 90,
9334
+ PRE_CUSTOM_REVIVE = 89,
8566
9335
  /**
8567
9336
  * Fires from the `PRE_PICKUP_COLLISION` callback when a player touches a collectible pedestal and
8568
9337
  * meets all of the conditions to pick it up.
@@ -8572,26 +9341,28 @@ export declare enum ModCallbackCustom {
8572
9341
  * note that this callback will continue to fire for every frame that the player touches the
8573
9342
  * pedestal, so you would need to continue returning false.)
8574
9343
  *
8575
- * - When registering the callback, takes an optional second argument that will make the callback
8576
- * only fire if the player matches the `PlayerVariant` provided.
8577
- * - When registering the callback, takes an optional third argument that will make the callback
8578
- * only fire if the player matches the `PlayerType` provided.
9344
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9345
+ * - You can provide an optional third argument that will make the callback only fire if it
9346
+ * matches the `PlayerVariant` provided.
9347
+ * - You can provide an optional fourth argument that will make the callback only fire if it
9348
+ * matches the `PlayerType` provided.
8579
9349
  *
8580
9350
  * ```ts
8581
9351
  * function preGetPedestal(player: EntityPlayer, collectible: EntityPickupCollectible): void {}
8582
9352
  * ```
8583
9353
  */
8584
- PRE_GET_PEDESTAL = 91,
9354
+ PRE_GET_PEDESTAL = 90,
8585
9355
  /**
8586
9356
  * Fires from the `POST_PEFFECT_UPDATE` callback when an item becomes queued (i.e. when the player
8587
9357
  * begins to hold the item above their head).
8588
9358
  *
8589
9359
  * Note that this callback will only fire once per Forgotten/Soul pair.
8590
9360
  *
8591
- * - When registering the callback, takes an optional second argument that will make the callback
8592
- * only fire if it matches the `ItemType` provided.
8593
- * - When registering the callback, takes an optional third argument that will make the callback
8594
- * only fire if the `CollectibleType` or the `TrinketType` matches the ID provided.
9361
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
9362
+ * - You can provide an optional third argument that will make the callback only fire if it
9363
+ * matches the `ItemType` provided.
9364
+ * - You can provide an optional fourth argument that will make the callback only fire if the
9365
+ * sub-type matches the `CollectibleType` or the `TrinketType` provided.
8595
9366
  *
8596
9367
  * ```ts
8597
9368
  * function preItemPickup(
@@ -8600,7 +9371,7 @@ export declare enum ModCallbackCustom {
8600
9371
  * ): void {}
8601
9372
  * ```
8602
9373
  */
8603
- PRE_ITEM_PICKUP = 92,
9374
+ PRE_ITEM_PICKUP = 91,
8604
9375
  /**
8605
9376
  * Fires on the `POST_RENDER` frame before the player is taken to a new floor. Only fires when a
8606
9377
  * player jumps into a trapdoor or enters a heaven door (beam of light). Does not fire on the
@@ -8614,7 +9385,78 @@ export declare enum ModCallbackCustom {
8614
9385
  * function preNewLevel(player: EntityPlayer): void {}
8615
9386
  * ```
8616
9387
  */
8617
- PRE_NEW_LEVEL = 93
9388
+ PRE_NEW_LEVEL = 92
9389
+ }
9390
+
9391
+ /** TODO */
9392
+ export declare enum ModCallbackCustom2 {
9393
+ POST_AMBUSH_FINISHED = 0,
9394
+ POST_AMBUSH_STARTED = 1,
9395
+ POST_BOMB_EXPLODED = 2,
9396
+ POST_BOMB_INIT_LATE = 3,
9397
+ POST_BONE_SWING = 4,
9398
+ POST_COLLECTIBLE_EMPTY = 5,
9399
+ POST_COLLECTIBLE_INIT_FIRST = 6,
9400
+ POST_CURSED_TELEPORT = 7,
9401
+ POST_CUSTOM_REVIVE = 8,
9402
+ POST_DICE_ROOM_ACTIVATED = 9,
9403
+ POST_DOOR_RENDER = 10,
9404
+ POST_DOOR_UPDATE = 11,
9405
+ POST_EFFECT_INIT_LATE = 12,
9406
+ POST_EFFECT_STATE_CHANGED = 13,
9407
+ POST_ESAU_JR = 14,
9408
+ POST_FAMILIAR_INIT_LATE = 15,
9409
+ POST_FAMILIAR_STATE_CHANGED = 16,
9410
+ POST_FIRST_ESAU_JR = 17,
9411
+ POST_FIRST_FLIP = 18,
9412
+ POST_FLIP = 19,
9413
+ POST_GAME_STARTED_REORDERED = 20,
9414
+ POST_GAME_STARTED_REORDERED_LAST = 21,
9415
+ POST_GREED_MODE_WAVE = 22,
9416
+ POST_GRID_ENTITY_BROKEN = 23,
9417
+ POST_GRID_ENTITY_COLLISION = 24,
9418
+ POST_GRID_ENTITY_CUSTOM_BROKEN = 25,
9419
+ POST_GRID_ENTITY_CUSTOM_COLLISION = 26,
9420
+ POST_GRID_ENTITY_CUSTOM_INIT = 27,
9421
+ POST_GRID_ENTITY_CUSTOM_REMOVE = 28,
9422
+ POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 29,
9423
+ POST_GRID_ENTITY_CUSTOM_UPDATE = 30,
9424
+ POST_GRID_ENTITY_INIT = 31,
9425
+ POST_GRID_ENTITY_REMOVE = 32,
9426
+ POST_GRID_ENTITY_STATE_CHANGED = 33,
9427
+ POST_GRID_ENTITY_UPDATE = 34,
9428
+ POST_HOLY_MANTLE_REMOVED = 35,
9429
+ POST_KNIFE_INIT_LATE = 36,
9430
+ POST_NEW_LEVEL_REORDERED = 37,
9431
+ POST_NEW_ROOM_EARLY = 38,
9432
+ POST_NEW_ROOM_REORDERED = 39,
9433
+ POST_PEFFECT_UPDATE_REORDERED = 40,
9434
+ POST_PIT_RENDER = 41,
9435
+ POST_PLAYER_FATAL_DAMAGE = 42,
9436
+ POST_PLAYER_RENDER_REORDERED = 43,
9437
+ POST_PLAYER_UPDATE_REORDERED = 44,
9438
+ POST_ROOM_CLEAR_CHANGED = 45,
9439
+ POST_SPIKES_RENDER = 46,
9440
+ PRE_BERSERK_DEATH = 47,
9441
+ PRE_CUSTOM_REVIVE = 48
9442
+ }
9443
+
9444
+ declare type ModCallbackCustomGridEntity = MatchingCallbackCustom<CallbackSignatureGridEntity>;
9445
+
9446
+ declare type ModCallbackCustomGridEntityCustom = MatchingCallbackCustom<CallbackSignatureGridEntityCustom>;
9447
+
9448
+ declare type ModCallbackCustomPlayer = MatchingCallbackCustom<CallbackSignaturePlayer>;
9449
+
9450
+ declare type ModCallbackCustomRevive = MatchingCallbackCustom<CallbackSignatureRevive>;
9451
+
9452
+ /**
9453
+ * A helper class for a mod that wants to represent its individual features as classes. This is
9454
+ * useful if you are using decorators to represent class methods that should be automatically
9455
+ * subscribed to callbacks.
9456
+ */
9457
+ export declare class ModFeature {
9458
+ private mod;
9459
+ constructor(mod: ModUpgraded);
8618
9460
  }
8619
9461
 
8620
9462
  /**
@@ -8626,33 +9468,76 @@ export declare enum ModCallbackCustom {
8626
9468
  */
8627
9469
  export declare class ModUpgraded implements Mod {
8628
9470
  /**
8629
- * The vanilla mod object stores the name of the mod for some reason. (It is never used or
8630
- * referenced.
9471
+ * The `RegisterMod` function stores the name of the mod on the mod object for some reason. (It is
9472
+ * never used or referenced.)
8631
9473
  */
8632
9474
  Name: string;
8633
9475
  /** We store a copy of the original mod object so that we can re-implement its functions. */
8634
- Mod: Mod;
8635
- Debug: boolean;
8636
- TimeThreshold: float | undefined;
9476
+ private mod;
9477
+ private debug;
9478
+ private timeThreshold;
9479
+ private callbacks;
8637
9480
  constructor(mod: Mod, debug: boolean, timeThreshold?: float);
9481
+ /**
9482
+ * Registers a function to be executed when an in-game event happens. For example, the
9483
+ * `ModCallback.POST_UPDATE` event corresponds to being executed once at the end of every game
9484
+ * logic frame.
9485
+ */
8638
9486
  AddCallback<T extends ModCallback>(modCallback: T, ...args: AddCallbackParameters[T]): void;
9487
+ /** Returns whether or not a corresponding "save#.dat" file exists for the current mod. */
8639
9488
  HasData(): boolean;
9489
+ /**
9490
+ * Returns a string containing all of the data inside of the corresponding "save#.dat" file for
9491
+ * this mod.
9492
+ */
8640
9493
  LoadData(): string;
8641
9494
  /**
8642
- * This method does not care about the tertiary argument. Regardless of the conditions of how you
8643
- * registered the callback, it will be removed.
9495
+ * Unregisters a function that was previously registered with the `AddCallback` method.
9496
+ *
9497
+ * This method does not care about the tertiary argument. In other words, regardless of the
9498
+ * conditions of how you registered the callback, it will be removed.
8644
9499
  */
8645
9500
  RemoveCallback<T extends ModCallback>(modCallback: T, callback: AddCallbackParameters[T][0]): void;
9501
+ /** Deletes the corresponding "save#.dat" file for this mod, if it exists. */
8646
9502
  RemoveData(): void;
9503
+ /**
9504
+ * Creates or updates the corresponding "save#.dat" file for this mod with the provided string.
9505
+ */
8647
9506
  SaveData(data: string): void;
9507
+ /**
9508
+ * Registers a function to be executed when an in-game event happens. This method is specifically
9509
+ * for events that are provided by the IsaacScript standard library. For example, the
9510
+ * `ModCallbackCustom.POST_BOMB_EXPLODE` event corresponds to when a bomb explodes.
9511
+ */
8648
9512
  AddCallbackCustom<T extends ModCallbackCustom>(modCallbackCustom: T, ...args: AddCallbackParametersCustom[T]): void;
9513
+ /** Adds a callback in the new callback system format. This method is only temporary. */
9514
+ AddCallbackCustom2<T extends ModCallbackCustom2>(modCallbackCustom: T, ...args: AddCallbackParametersCustom2[T]): void;
9515
+ /**
9516
+ * Unregisters a function that was previously registered with the `AddCallbackCustom` method.
9517
+ *
9518
+ * This method does not care about the tertiary argument. In other words, regardless of the
9519
+ * conditions of how you registered the callback, it will be removed.
9520
+ */
9521
+ RemoveCallbackCustom<T extends ModCallbackCustom2>(modCallbackCustom: T, callback: AddCallbackParametersCustom2[T][0]): void;
8649
9522
  /**
8650
- * This method does not care about the tertiary argument. Regardless of the conditions of how you
8651
- * registered the callback, it will be removed.
9523
+ * This method should only be used by the `upgradeMod` function. Returns the class methods from
9524
+ * the features that were added.
8652
9525
  */
8653
- RemoveCallbackCustom<T extends ModCallbackCustom>(modCallback: T, callback: AddCallbackParametersCustom[T][0]): void;
9526
+ initOptionalFeature(feature: ISCFeature): FunctionTuple[];
9527
+ /** This is used to initialize both custom callbacks and "extra features". */
9528
+ private initFeature;
9529
+ private uninitFeature;
8654
9530
  }
8655
9531
 
9532
+ /**
9533
+ * By specifying one or more optional features, end-users will get a version of `ModUpgraded` that
9534
+ * has extra methods corresponding to the features.
9535
+ *
9536
+ * We have to explicitly account for the empty array case, since `never` will cause mess up the
9537
+ * union.
9538
+ */
9539
+ declare type ModUpgradedWithFeatures<T extends ISCFeature> = [T] extends [never] ? ModUpgraded : Omit<ModUpgraded & UnionToIntersection<ISCFeatureToClass[T]>, KeysToScrubFromModClass>;
9540
+
8656
9541
  /**
8657
9542
  * Helper function to move all of the players to where they would normally go when arriving at a new
8658
9543
  * floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top
@@ -8689,6 +9574,9 @@ export declare const NEW_RUN_PLAYER_STARTING_POSITION: Vector;
8689
9574
  /**
8690
9575
  * Constructor for a `ChargeBarSprites` object. For more information, see the `renderChargeBar`
8691
9576
  * helper function.
9577
+ *
9578
+ * Note that this is for the vertical charge bar that represents the number of charges that an
9579
+ * active item has, not the circular charge bar that shows e.g. the charge rate of Brimstone.
8692
9580
  */
8693
9581
  export declare function newChargeBarSprites(maxCharges: int): ChargeBarSprites;
8694
9582
 
@@ -8698,6 +9586,16 @@ export declare function newChargeBarSprites(maxCharges: int): ChargeBarSprites;
8698
9586
  */
8699
9587
  export declare function newCollectibleSprite(collectibleType: CollectibleType): Sprite;
8700
9588
 
9589
+ /**
9590
+ * Helper function for creating objects that represent a mapping of an enum value to some other
9591
+ * value in a type-safe way.
9592
+ *
9593
+ * This function will ensure that the provided object has a key for each value in the enum.
9594
+ *
9595
+ * After the `satisfies` operator is released in TypeScript 4.9, this function should be deleted.
9596
+ */
9597
+ export declare function newObjectWithEnumKeys<Enum extends number | string, T extends Record<Enum, unknown>>(theEnum: Record<string, Enum>, obj: T): T;
9598
+
8701
9599
  export declare function newPickingUpItem(): PickingUpItem;
8702
9600
 
8703
9601
  /** Returns a `PlayerHealth` object with all zeros. */
@@ -8828,6 +9726,8 @@ export declare function openAllDoors(): void;
8828
9726
  */
8829
9727
  export declare function openDoorFast(door: GridEntityDoor): void;
8830
9728
 
9729
+ declare type OptionalArgs<T extends ModCallbackCustom2> = AllButFirst_2<AddCallbackParametersCustom2[T]>;
9730
+
8831
9731
  /**
8832
9732
  * Helper function to parse a string that contains an entity type, a variant, and a sub-type,
8833
9733
  * separated by periods.
@@ -8905,7 +9805,15 @@ export declare type PickupIndex = int & {
8905
9805
  /** Maps pill effect names to the values of the `PillEffect` enum. */
8906
9806
  export declare const PILL_NAME_TO_EFFECT_MAP: ReadonlyMap<string, PillEffect>;
8907
9807
 
8908
- export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot: ActiveSlot): void;
9808
+ /**
9809
+ * Helper function to play the appropriate sound effect for a player after getting one or more
9810
+ * charges on their active item. (There is a different sound depending on whether the item is fully
9811
+ * charged or not.)
9812
+ *
9813
+ * @param player The player to play the sound effect for.
9814
+ * @param activeSlot Optional. The slot that was just charged. Default is `ActiveSlot.PRIMARY`.
9815
+ */
9816
+ export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?: ActiveSlot): void;
8909
9817
 
8910
9818
  /**
8911
9819
  * Helper function to add one or more collectibles to a player.
@@ -8970,6 +9878,25 @@ export declare type PlayerIndex = int & {
8970
9878
  readonly __playerIndexBrand: symbol;
8971
9879
  };
8972
9880
 
9881
+ declare class PlayerReorderedCallbacks extends Feature {
9882
+ v: {
9883
+ run: {
9884
+ postGameStartedFiredOnThisRun: boolean;
9885
+ postPEffectUpdateQueue: PlayerIndex[];
9886
+ postPlayerUpdateQueue: PlayerIndex[];
9887
+ postPlayerRenderQueue: PlayerIndex[];
9888
+ };
9889
+ };
9890
+ private postPEffectUpdateReordered;
9891
+ private postPlayerRenderReordered;
9892
+ private postPlayerUpdateReordered;
9893
+ constructor(postPEffectUpdateReordered: PostPEffectUpdateReordered, postPlayerRenderReordered: PostPlayerRenderReordered, postPlayerUpdateReordered: PostPlayerUpdateReordered);
9894
+ private postPEffectUpdate;
9895
+ private postPlayerUpdate;
9896
+ private postPlayerRender;
9897
+ private postGameStartedReorderedLast;
9898
+ }
9899
+
8973
9900
  /** This is used by the `getPocketItems` and related helper functions. */
8974
9901
  export declare interface PocketItemDescription {
8975
9902
  slot: PocketItemSlot;
@@ -9018,23 +9945,24 @@ callback: (boneClub: EntityKnife) => void
9018
9945
  ];
9019
9946
 
9020
9947
  declare type PostCollectibleEmptyRegisterParameters = [
9021
- callback: (collectible: EntityPickup, oldCollectibleType: CollectibleType) => void,
9948
+ callback: (collectible: EntityPickupCollectible, oldCollectibleType: CollectibleType) => void,
9022
9949
  collectibleType?: CollectibleType
9023
9950
  ];
9024
9951
 
9025
9952
  declare type PostCollectibleInitFirstRegisterParameters = [
9026
- callback: (collectible: EntityPickup) => void,
9953
+ callback: (collectible: EntityPickupCollectible) => void,
9027
9954
  collectibleType?: CollectibleType
9028
9955
  ];
9029
9956
 
9030
9957
  declare type PostCursedTeleportRegisterParameters = [
9031
- callback: (player: EntityPlayer) => void
9958
+ callback: (player: EntityPlayer) => void,
9959
+ playerVariant?: PlayerVariant,
9960
+ character?: PlayerType
9032
9961
  ];
9033
9962
 
9034
- declare type PostCustomDoorEnterRegisterParameters = [
9035
- callback: (player: EntityPlayer, effectVariant: int, doorSlot: DoorSlot, direction: Direction) => void,
9036
- effectVariant?: int
9037
- ];
9963
+ declare class PostCustomRevive extends CustomCallbackRevive<ModCallbackCustom2.POST_CUSTOM_REVIVE> {
9964
+ constructor();
9965
+ }
9038
9966
 
9039
9967
  declare type PostCustomReviveRegisterParameters = [
9040
9968
  callback: (player: EntityPlayer, revivalType: int) => void,
@@ -9066,6 +9994,10 @@ callback: (effect: EntityEffect, previousState: int, currentState: int) => void,
9066
9994
  effectVariant?: EffectVariant
9067
9995
  ];
9068
9996
 
9997
+ declare class PostEsauJr extends CustomCallback<ModCallbackCustom2.POST_ESAU_JR> {
9998
+ constructor();
9999
+ }
10000
+
9069
10001
  declare type PostEsauJrRegisterParameters = [
9070
10002
  callback: (player: EntityPlayer) => void
9071
10003
  ];
@@ -9080,18 +10012,38 @@ callback: (familiar: EntityFamiliar, previousState: int, currentState: int) => v
9080
10012
  familiarVariant?: FamiliarVariant
9081
10013
  ];
9082
10014
 
10015
+ declare class PostFirstEsauJr extends CustomCallback<ModCallbackCustom2.POST_FIRST_ESAU_JR> {
10016
+ constructor();
10017
+ }
10018
+
9083
10019
  declare type PostFirstEsauJrRegisterParameters = [
9084
10020
  callback: (player: EntityPlayer) => void
9085
10021
  ];
9086
10022
 
10023
+ declare class PostFirstFlip extends CustomCallback<ModCallbackCustom2.POST_FIRST_FLIP> {
10024
+ constructor();
10025
+ }
10026
+
9087
10027
  declare type PostFirstFlipRegisterParameters = [
9088
10028
  callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
9089
10029
  ];
9090
10030
 
10031
+ declare class PostFlip extends CustomCallback<ModCallbackCustom2.POST_FLIP> {
10032
+ constructor();
10033
+ }
10034
+
9091
10035
  declare type PostFlipRegisterParameters = [
9092
10036
  callback: (newLazarus: EntityPlayer, oldLazarus: EntityPlayer) => void
9093
10037
  ];
9094
10038
 
10039
+ declare class PostGameStartedReordered extends CustomCallback<ModCallbackCustom2.POST_GAME_STARTED_REORDERED> {
10040
+ constructor();
10041
+ }
10042
+
10043
+ declare class PostGameStartedReorderedLast extends CustomCallback<ModCallbackCustom2.POST_GAME_STARTED_REORDERED> {
10044
+ constructor();
10045
+ }
10046
+
9095
10047
  declare type PostGameStartedReorderedLastRegisterParameters = [
9096
10048
  callback: (isContinued: boolean) => void
9097
10049
  ];
@@ -9104,12 +10056,21 @@ declare type PostGreedModeWaveRegisterParameters = [
9104
10056
  callback: (oldWave: int, newWave: int) => void
9105
10057
  ];
9106
10058
 
10059
+ declare class PostGridEntityBroken extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_BROKEN> {
10060
+ constructor();
10061
+ }
10062
+
9107
10063
  declare type PostGridEntityBrokenRegisterParameters = [
9108
10064
  callback: (gridEntity: GridEntity) => void,
9109
10065
  gridEntityType?: GridEntityType,
9110
- gridEntityVariant?: int
10066
+ variant?: int
9111
10067
  ];
9112
10068
 
10069
+ declare class PostGridEntityCollision extends CustomCallback<T> {
10070
+ constructor();
10071
+ protected shouldFire(fireArgs: FireArgs<T>, optionalArgs: OptionalArgs<T>): boolean;
10072
+ }
10073
+
9113
10074
  declare type PostGridEntityCollisionRegisterParameters = [
9114
10075
  callback: (gridEntity: GridEntity, entity: Entity) => void,
9115
10076
  gridEntityType?: GridEntityType,
@@ -9118,11 +10079,20 @@ entityType?: EntityType,
9118
10079
  entityVariant?: int
9119
10080
  ];
9120
10081
 
10082
+ declare class PostGridEntityCustomBroken extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_BROKEN> {
10083
+ constructor();
10084
+ }
10085
+
9121
10086
  declare type PostGridEntityCustomBrokenRegisterParameters = [
9122
10087
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
9123
10088
  gridEntityTypeCustom?: GridEntityType
9124
10089
  ];
9125
10090
 
10091
+ declare class PostGridEntityCustomCollision extends CustomCallback<T_2> {
10092
+ constructor();
10093
+ protected shouldFire(fireArgs: FireArgs<T_2>, optionalArgs: OptionalArgs<T_2>): boolean;
10094
+ }
10095
+
9126
10096
  declare type PostGridEntityCustomCollisionRegisterParameters = [
9127
10097
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity) => void,
9128
10098
  gridEntityTypeCustom?: GridEntityType,
@@ -9130,11 +10100,20 @@ entityType?: EntityType,
9130
10100
  entityVariant?: int
9131
10101
  ];
9132
10102
 
10103
+ declare class PostGridEntityCustomInit extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_INIT> {
10104
+ constructor();
10105
+ }
10106
+
9133
10107
  declare type PostGridEntityCustomInitRegisterParameters = [
9134
10108
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
9135
10109
  gridEntityTypeCustom?: GridEntityType
9136
10110
  ];
9137
10111
 
10112
+ declare class PostGridEntityCustomRemove extends CustomCallback<T_4> {
10113
+ constructor();
10114
+ protected shouldFire(fireArgs: FireArgs<T_4>, optionalArgs: OptionalArgs<T_4>): boolean;
10115
+ }
10116
+
9138
10117
  declare type PostGridEntityCustomRemoveRegisterParameters = [
9139
10118
  callback: (gridIndex: int, gridEntityTypeCustom: GridEntityType) => void,
9140
10119
  gridEntityTypeCustom?: GridEntityType
@@ -9145,44 +10124,69 @@ callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void
9145
10124
  gridEntityTypeCustom?: GridEntityType
9146
10125
  ];
9147
10126
 
10127
+ declare class PostGridEntityCustomStateChanged extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED> {
10128
+ constructor();
10129
+ }
10130
+
9148
10131
  declare type PostGridEntityCustomStateChangedRegisterParameters = [
9149
10132
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, oldState: int, newState: int) => void,
9150
10133
  gridEntityTypeCustom?: GridEntityType
9151
10134
  ];
9152
10135
 
10136
+ declare class PostGridEntityCustomUpdate extends CustomCallbackGridEntityCustom<ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_UPDATE> {
10137
+ constructor();
10138
+ }
10139
+
9153
10140
  declare type PostGridEntityCustomUpdateRegisterParameters = [
9154
10141
  callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType) => void,
9155
10142
  gridEntityTypeCustom?: GridEntityType
9156
10143
  ];
9157
10144
 
10145
+ declare class PostGridEntityInit extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_INIT> {
10146
+ constructor();
10147
+ }
10148
+
9158
10149
  declare type PostGridEntityInitRegisterParameters = [
9159
10150
  callback: (gridEntity: GridEntity) => void,
9160
10151
  gridEntityType?: GridEntityType,
9161
- gridEntityVariant?: int
10152
+ variant?: int
9162
10153
  ];
9163
10154
 
10155
+ declare class PostGridEntityRemove extends CustomCallback<T_3> {
10156
+ constructor();
10157
+ protected shouldFire(fireArgs: FireArgs<T_3>, optionalArgs: OptionalArgs<T_3>): boolean;
10158
+ }
10159
+
9164
10160
  declare type PostGridEntityRemoveRegisterParameters = [
9165
- callback: (gridIndex: int, gridEntityType: GridEntityType) => void,
10161
+ callback: (gridIndex: int, gridEntityType: GridEntityType, variant: int) => void,
9166
10162
  gridEntityType?: GridEntityType,
9167
- gridEntityVariant?: int
10163
+ variant?: int
9168
10164
  ];
9169
10165
 
9170
10166
  declare type PostGridEntityRenderRegisterParameters = [
9171
10167
  callback: (gridEntity: GridEntity) => void,
9172
10168
  gridEntityType?: GridEntityType,
9173
- gridEntityVariant?: int
10169
+ variant?: int
9174
10170
  ];
9175
10171
 
10172
+ declare class PostGridEntityStateChanged extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_STATE_CHANGED> {
10173
+ constructor();
10174
+ }
10175
+
9176
10176
  declare type PostGridEntityStateChangedRegisterParameters = [
9177
10177
  callback: (gridEntity: GridEntity, oldState: int, newState: int) => void,
9178
10178
  gridEntityType?: GridEntityType,
9179
- gridEntityVariant?: int
10179
+ variant?: int
9180
10180
  ];
9181
10181
 
10182
+ declare class PostGridEntityUpdate extends CustomCallbackGridEntity<ModCallbackCustom2.POST_GRID_ENTITY_UPDATE> {
10183
+ constructor();
10184
+ }
10185
+
9182
10186
  declare type PostGridEntityUpdateRegisterParameters = [
9183
10187
  callback: (gridEntity: GridEntity) => void,
9184
10188
  gridEntityType?: GridEntityType,
9185
- gridEntityVariant?: int
10189
+ variant?: int
9186
10190
  ];
9187
10191
 
9188
10192
  declare type PostHolyMantleRemovedRegisterParameters = [
@@ -9216,10 +10220,18 @@ callback: (laser: EntityLaser) => void,
9216
10220
  laserVariant?: LaserVariant
9217
10221
  ];
9218
10222
 
10223
+ declare class PostNewLevelReordered extends CustomCallback<ModCallbackCustom2.POST_NEW_LEVEL_REORDERED> {
10224
+ constructor();
10225
+ }
10226
+
9219
10227
  declare type PostNewLevelReorderedRegisterParameters = [callback: () => void];
9220
10228
 
9221
10229
  declare type PostNewRoomEarlyRegisterParameters = [callback: () => void];
9222
10230
 
10231
+ declare class PostNewRoomReordered extends CustomCallback<ModCallbackCustom2.POST_NEW_ROOM_REORDERED> {
10232
+ constructor();
10233
+ }
10234
+
9223
10235
  declare type PostNewRoomReorderedRegisterParameters = [callback: () => void];
9224
10236
 
9225
10237
  declare type PostNPCInitLateRegisterParameters = [
@@ -9233,6 +10245,10 @@ entityType?: EntityType,
9233
10245
  variant?: int
9234
10246
  ];
9235
10247
 
10248
+ declare class PostPEffectUpdateReordered extends CustomCallbackPlayer<ModCallbackCustom2.POST_PEFFECT_UPDATE_REORDERED> {
10249
+ constructor();
10250
+ }
10251
+
9236
10252
  declare type PostPEffectUpdateReorderedRegisterParameters = [
9237
10253
  callback: (player: EntityPlayer) => void,
9238
10254
  playerVariant?: PlayerVariant,
@@ -9314,12 +10330,20 @@ playerVariant?: PlayerVariant,
9314
10330
  character?: PlayerType
9315
10331
  ];
9316
10332
 
10333
+ declare class PostPlayerRenderReordered extends CustomCallbackPlayer<ModCallbackCustom2.POST_PLAYER_RENDER_REORDERED> {
10334
+ constructor();
10335
+ }
10336
+
9317
10337
  declare type PostPlayerRenderReorderedRegisterParameters = [
9318
10338
  callback: (player: EntityPlayer) => void,
9319
10339
  playerVariant?: PlayerVariant,
9320
10340
  character?: PlayerType
9321
10341
  ];
9322
10342
 
10343
+ declare class PostPlayerUpdateReordered extends CustomCallbackPlayer<ModCallbackCustom2.POST_PLAYER_UPDATE_REORDERED> {
10344
+ constructor();
10345
+ }
10346
+
9323
10347
  declare type PostPlayerUpdateReorderedRegisterParameters = [
9324
10348
  callback: (player: EntityPlayer) => void,
9325
10349
  playerVariant?: PlayerVariant,
@@ -9359,12 +10383,12 @@ pickupSubType?: int
9359
10383
 
9360
10384
  declare type PostRockRenderRegisterParameters = [
9361
10385
  callback: (rock: GridEntityRock) => void,
9362
- gridEntityVariant?: int
10386
+ variant?: int
9363
10387
  ];
9364
10388
 
9365
10389
  declare type PostRockUpdateRegisterParameters = [
9366
10390
  callback: (rock: GridEntityRock) => void,
9367
- gridEntityVariant?: int
10391
+ variant?: int
9368
10392
  ];
9369
10393
 
9370
10394
  declare type PostRoomClearChangedRegisterParameters = [
@@ -9411,12 +10435,12 @@ slotVariant?: SlotVariant
9411
10435
 
9412
10436
  declare type PostSpikesRenderRegisterParameters = [
9413
10437
  callback: (spikes: GridEntitySpikes) => void,
9414
- gridEntityVariant?: int
10438
+ variant?: int
9415
10439
  ];
9416
10440
 
9417
10441
  declare type PostSpikesUpdateRegisterParameters = [
9418
10442
  callback: (spikes: GridEntitySpikes) => void,
9419
- gridEntityVariant?: int
10443
+ variant?: int
9420
10444
  ];
9421
10445
 
9422
10446
  declare type PostTearInitLateRegisterParameters = [
@@ -9431,12 +10455,12 @@ tearVariant?: TearVariant
9431
10455
 
9432
10456
  declare type PostTNTRenderRegisterParameters = [
9433
10457
  callback: (tnt: GridEntityTNT) => void,
9434
- gridEntityVariant?: int
10458
+ variant?: int
9435
10459
  ];
9436
10460
 
9437
10461
  declare type PostTNTUpdateRegisterParameters = [
9438
10462
  callback: (tnt: GridEntityTNT) => void,
9439
- gridEntityVariant?: int
10463
+ variant?: int
9440
10464
  ];
9441
10465
 
9442
10466
  declare type PostTransformationRegisterParameters = [
@@ -9455,6 +10479,10 @@ playerVariant?: PlayerVariant,
9455
10479
  character?: PlayerType
9456
10480
  ];
9457
10481
 
10482
+ declare class PreCustomRevive extends CustomCallbackPlayer<ModCallbackCustom2.PRE_CUSTOM_REVIVE> {
10483
+ constructor();
10484
+ }
10485
+
9458
10486
  declare type PreCustomReviveRegisterParameters = [
9459
10487
  callback: (player: EntityPlayer) => int | undefined,
9460
10488
  playerVariant?: PlayerVariant,
@@ -9534,6 +10562,9 @@ export declare function printConsole(msg: string): void;
9534
10562
  /** Helper function to print whether something was enabled or disabled to the in-game console. */
9535
10563
  export declare function printEnabled(enabled: boolean, description: string): void;
9536
10564
 
10565
+ /** Used for `runInNFrames` functions. */
10566
+ declare type QueuedFunctionTuple = [frameCountToFire: int, func: () => void];
10567
+
9537
10568
  /**
9538
10569
  * Helper function to make a character that has the same health mechanic as Blue Baby (red heart
9539
10570
  * containers --> soul hearts) or Dark Judas (red heart containers --> black hearts).
@@ -10207,6 +11238,9 @@ export declare const RENDER_FRAMES_PER_SECOND = 60;
10207
11238
  /**
10208
11239
  * Helper function to render a charge bar on the screen. First, call the `newChargeBarSprites`
10209
11240
  * function to initialize the sprites, and then call this function on every render frame.
11241
+ *
11242
+ * Note that this is for the vertical charge bar that represents the number of charges that an
11243
+ * active item has, not the circular charge bar that shows e.g. the charge rate of Brimstone.
10210
11244
  */
10211
11245
  export declare function renderChargeBar(sprites: ChargeBarSprites, position: Vector, normalCharges: int, batteryCharges: int): void;
10212
11246
 
@@ -10359,6 +11393,114 @@ export declare function round(num: float, numDecimalPlaces?: number): float;
10359
11393
  */
10360
11394
  export declare function runDeepCopyTests(): void;
10361
11395
 
11396
+ declare class RunInNFrames extends Feature {
11397
+ v: {
11398
+ run: {
11399
+ queuedGameFunctionTuples: QueuedFunctionTuple[];
11400
+ queuedRenderFunctionTuples: QueuedFunctionTuple[];
11401
+ intervalGameFunctionTuples: IntervalFunctionTuple[];
11402
+ intervalRenderFunctionTuples: IntervalFunctionTuple[];
11403
+ };
11404
+ };
11405
+ constructor();
11406
+ private postUpdate;
11407
+ private postRender;
11408
+ /**
11409
+ * Supply a function to run N game frames from now in the `POST_UPDATE` callback.
11410
+ *
11411
+ * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
11412
+ * similar way.
11413
+ *
11414
+ * Note that this function will not handle saving and quitting. If a player saving and quitting
11415
+ * before the deferred function fires would cause a bug in your mod, then you should handle
11416
+ * deferred functions manually using serializable data.
11417
+ */
11418
+ runInNGameFrames(func: () => void, gameFrames: int): void;
11419
+ /**
11420
+ * Supply a function to run N render frames from now in the `POST_RENDER` callback.
11421
+ *
11422
+ * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
11423
+ * similar way.
11424
+ *
11425
+ * Note that this function will not handle saving and quitting. If a player saving and quitting
11426
+ * before the deferred function fires would cause a bug in your mod, then you should handle
11427
+ * deferred functions manually using serializable data.
11428
+ */
11429
+ runInNRenderFrames(func: () => void, renderFrames: int): void;
11430
+ /**
11431
+ * Supply a function to run on the next `POST_UPDATE` callback.
11432
+ *
11433
+ * For example:
11434
+ *
11435
+ * ```ts
11436
+ * const NUM_EXPLODER_EXPLOSIONS = 5;
11437
+ *
11438
+ * function useItemExploder(player: EntityPlayer) {
11439
+ * playSound("exploderBegin");
11440
+ * explode(player, NUM_EXPLODER_EXPLOSIONS);
11441
+ * }
11442
+ *
11443
+ * function explode(player: EntityPlayer, numFramesLeft: int) {
11444
+ * Isaac.Explode(player, undefined, 1);
11445
+ * numFramesLeft -= 1;
11446
+ * if (numFramesLeft === 0) {
11447
+ * runNextFrame(() => {
11448
+ * explode(player, numFramesLeft);
11449
+ * });
11450
+ * }
11451
+ * }
11452
+ * ```
11453
+ *
11454
+ * Note that this function will not handle saving and quitting. If a player saving and quitting
11455
+ * before the deferred function fires would cause a bug in your mod, then you should handle
11456
+ * deferred functions manually using serializable data.
11457
+ */
11458
+ runNextGameFrame(func: () => void): void;
11459
+ /**
11460
+ * Supply a function to run on the next `POST_RENDER` callback.
11461
+ *
11462
+ * For a usage example, see the documentation for the `runNextGameFrame`, which is used in a
11463
+ * similar way.
11464
+ *
11465
+ * Note that this function will not handle saving and quitting.
11466
+ */
11467
+ runNextRenderFrame(func: () => void): void;
11468
+ /**
11469
+ * Supply a function to be repeatedly run on an interval of N game frames in the `POST_UPDATE`
11470
+ * callback. The function will continue to be fired until `false` is returned from the function.
11471
+ *
11472
+ * This is similar to the `setInterval` vanilla JavaScript function, except there is no
11473
+ * corresponding `clearInterval` function. (Instead, the return value from the supplied function
11474
+ * is used to stop the interval.)
11475
+ *
11476
+ * Note that this function will not handle saving and quitting. You must manually restart any
11477
+ * intervals if the player saves and quits in the middle of a run.
11478
+ *
11479
+ * @param func The function to repeatedly run on an interval.
11480
+ * @param gameFrames The amount of game frames to wait between each run.
11481
+ * @param runImmediately Whether or not to execute the function right now before waiting for the
11482
+ * interval.
11483
+ */
11484
+ setIntervalGameFrames(func: () => boolean, gameFrames: int, runImmediately: boolean): void;
11485
+ /**
11486
+ * Supply a function to be repeatedly run on an interval of N render frames in the `POST_RENDER`
11487
+ * callback. The function will continue to be fired until `false` is returned from the function.
11488
+ *
11489
+ * This is similar to the `setInterval` vanilla JavaScript function, except there is no
11490
+ * corresponding `clearInterval` function. (Instead, the return value from the supplied function
11491
+ * is used to stop the interval.)
11492
+ *
11493
+ * Note that this function will not handle saving and quitting. You must manually restart any
11494
+ * intervals if the player saves and quits in the middle of a run.
11495
+ *
11496
+ * @param func The function to repeatedly run on an interval.
11497
+ * @param renderFrames The amount of game frames to wait between each run.
11498
+ * @param runImmediately Whether or not to execute the function right now before waiting for the
11499
+ * interval.
11500
+ */
11501
+ setIntervalRenderFrames(func: () => boolean, renderFrames: int, runImmediately: boolean): void;
11502
+ }
11503
+
10362
11504
  /**
10363
11505
  * Supply a function to run N game frames from now in the `POST_UPDATE` callback.
10364
11506
  *
@@ -10582,6 +11724,12 @@ v: SaveData, conditionalFunc: false): void;
10582
11724
  */
10583
11725
  export declare function saveDataManagerLoad(): void;
10584
11726
 
11727
+ /**
11728
+ * Removes a previously registered key from the save data manager. This is the opposite of the
11729
+ * "saveDataManager" function.
11730
+ */
11731
+ export declare function saveDataManagerRemove(key: string): void;
11732
+
10585
11733
  /**
10586
11734
  * The save data manager will automatically reset variables at the appropriate times (i.e. when a
10587
11735
  * player enters a new room). Use this function to explicitly force the save data manager to reset a
@@ -10745,12 +11893,12 @@ export declare function serializeVector(vector: Vector): SerializedVector;
10745
11893
  *
10746
11894
  * @param player The player to give the item to.
10747
11895
  * @param collectibleType The collectible type of the item to give.
10748
- * @param activeSlot The slot to set.
11896
+ * @param activeSlot Optional. The slot to set. Default is `ActiveSlot.PRIMARY`.
10749
11897
  * @param charge Optional. The argument of charges to set. If not specified, the item will be set
10750
11898
  * with maximum charges.
10751
11899
  * @param keepInPools Optional. Whether or not to remove the item from pools. Default is false.
10752
11900
  */
10753
- export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot: ActiveSlot, charge?: int, keepInPools?: boolean): void;
11901
+ export declare function setActiveItem(player: EntityPlayer, collectibleType: CollectibleType, activeSlot?: ActiveSlot, charge?: int, keepInPools?: boolean): void;
10754
11902
 
10755
11903
  /**
10756
11904
  * Helper function to add one or more elements to a set at once without having to repeatedly call
@@ -10778,7 +11926,7 @@ export declare function setAllRNGToSeed(object: unknown, seed: Seed): void;
10778
11926
  */
10779
11927
  export declare function setAllRNGToStartSeed(object: unknown): void;
10780
11928
 
10781
- /** Helper function to set the backdrop of the current room. */
11929
+ /** Helper function to set the backdrop (i.e. background) of the current room. */
10782
11930
  export declare function setBackdrop(backdropType: BackdropType): void;
10783
11931
 
10784
11932
  /**
@@ -10892,6 +12040,8 @@ export declare function setDeletePlayer(set: Set<PlayerIndex>, player: EntityPla
10892
12040
  * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
10893
12041
  * the changes will be immediately visible.
10894
12042
  *
12043
+ * This function automatically accounts for whether or not MinimapAPI is being used.
12044
+ *
10895
12045
  * @param displayFlagsMap A map of the display flags that is indexed by the room's safe grid index.
10896
12046
  */
10897
12047
  export declare function setDisplayFlags(displayFlagsMap: Map<int, BitFlags<DisplayFlag>>): void;
@@ -11430,10 +12580,11 @@ export declare function spawnCoin(coinSubType: CoinSubType, position: Vector, ve
11430
12580
  export declare function spawnCoinWithSeed(coinSubType: CoinSubType, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityPickupCoin;
11431
12581
 
11432
12582
  /**
11433
- * Helper function to spawn a collectible. Use this instead of the `Game.Spawn` method because it
11434
- * handles the cases of Tainted Keeper collectibles costing coins and preventing quest items from
11435
- * being rotated by Tainted Isaac's rotation mechanic. (Rotation prevention will only occur in
11436
- * upgraded mods.)
12583
+ * Helper function to spawn a collectible.
12584
+ *
12585
+ * Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
12586
+ * collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
12587
+ * rotation mechanic. (Rotation prevention will only occur in upgraded mods.)
11437
12588
  *
11438
12589
  * @param collectibleType The collectible type to spawn.
11439
12590
  * @param position The position to spawn the collectible at.
@@ -11447,35 +12598,31 @@ export declare function spawnCoinWithSeed(coinSubType: CoinSubType, position: Ve
11447
12598
  */
11448
12599
  export declare function spawnCollectible(collectibleType: CollectibleType, position: Vector, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
11449
12600
 
12601
+ /**
12602
+ * Helper function to spawn a collectible from a specific item pool.
12603
+ *
12604
+ * Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
12605
+ * collectibles costing coins and preventing quest items from being rotated by Tainted Isaac's
12606
+ * rotation mechanic. (Rotation prevention will only occur in upgraded mods.)
12607
+ *
12608
+ * @param itemPoolType The item pool to draw the collectible type from.
12609
+ * @param position The position to spawn the collectible at.
12610
+ * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
12611
+ * `RNG.Next` method will be called. Default is `getRandomSeed()`.
12612
+ * @param options Optional. Set to true to make the collectible a "There's Options" style
12613
+ * collectible. Default is false.
12614
+ * @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
12615
+ * Tainted Keeper. Default is false.
12616
+ * @param spawner Optional.
12617
+ */
12618
+ export declare function spawnCollectibleFromPool(itemPoolType: ItemPoolType, position: Vector, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
12619
+
11450
12620
  /** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18). */
11451
12621
  export declare function spawnCrawlSpace(gridIndexOrPosition: int | Vector): GridEntity | undefined;
11452
12622
 
11453
12623
  /** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18) with a specific variant. */
11454
12624
  export declare function spawnCrawlSpaceWithVariant(crawlSpaceVariant: CrawlSpaceVariant, gridIndexOrPosition: int | Vector): GridEntity | undefined;
11455
12625
 
11456
- /**
11457
- * Helper function to spawn a custom door. This is intended to be called from the `POST_NEW_ROOM`
11458
- * callback when the player enters a room that should have a custom door. (You could also call it
11459
- * from another callback if you want the door to appear e.g. after clearing all enemies.)
11460
- *
11461
- * Like other entities, the door is not persistent, so you must spawn it every time when re-entering
11462
- * the room.
11463
- *
11464
- * Handle when a player enters the door by hooking the custom `POST_CUSTOM_DOOR_ENTER` callback.
11465
- *
11466
- * The custom door is an `EntityEffect`. You can manually open or close the door by modifying its
11467
- * state. (The values to use correspond to the `DoorState` enum.)
11468
- *
11469
- * This function will throw a run-time error if:
11470
- * - the door slot already has a vanilla door
11471
- * - the door slot already has a custom door
11472
- * - the tile at the door slot does not have a wall
11473
- *
11474
- * Before using this function, you must first initialize the effect/door variant with the
11475
- * `initCustomDoor` function.
11476
- */
11477
- export declare function spawnCustomDoor(effectVariant: EffectVariant, doorSlot: DoorSlot): EntityEffect;
11478
-
11479
12626
  /**
11480
12627
  * Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
11481
12628
  * will reappear if the player leaves and re-enters the room. (It will be manually respawned in the
@@ -11881,6 +13028,10 @@ export declare function stageTypeToLetter(stageType: StageType): string;
11881
13028
  */
11882
13029
  export declare function startAmbush(): void;
11883
13030
 
13031
+ export declare type StartsWithLowercase<S> = S extends string ? Extract<S, Uncapitalize<S>> : never;
13032
+
13033
+ export declare type StartsWithUppercase<S> = S extends string ? Extract<S, Capitalize<S>> : never;
13034
+
11884
13035
  /** This represents the kinds of stats that a player can have. */
11885
13036
  export declare enum StatType {
11886
13037
  /** Corresponds to `CacheFlag.DAMAGE` (1 << 0) and `EntityPlayer.Damage`. */
@@ -11947,6 +13098,14 @@ export declare function sumSet(set: Set<number> | ReadonlySet<number>): number;
11947
13098
  */
11948
13099
  export declare function swapArrayElements<T>(array: T[], i: number, j: number): void;
11949
13100
 
13101
+ declare type T = ModCallbackCustom2.POST_GRID_ENTITY_COLLISION;
13102
+
13103
+ declare type T_2 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_COLLISION;
13104
+
13105
+ declare type T_3 = ModCallbackCustom2.POST_GRID_ENTITY_REMOVE;
13106
+
13107
+ declare type T_4 = ModCallbackCustom2.POST_GRID_ENTITY_CUSTOM_REMOVE;
13108
+
11950
13109
  /**
11951
13110
  * Helper function to check if a Lua table has all of the provided keys.
11952
13111
  *
@@ -11968,15 +13127,14 @@ export declare function tanh(x: number): number;
11968
13127
  * Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
11969
13128
  * - you do not forget to set the `Level.LeaveDoor` field
11970
13129
  * - to prevent crashing on invalid room grid indexes
11971
- * - to automatically handle Curse of the Maze
13130
+ *
13131
+ * Note that if the current floor has Curse of the Maze, it may redirect the intended teleport.
11972
13132
  *
11973
13133
  * @param roomGridIndex The room grid index of the destination room.
11974
13134
  * @param direction Optional. Default is `Direction.NO_DIRECTION`.
11975
13135
  * @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
11976
- * @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
11977
- * to false, then this function may not go to the provided room grid index.
11978
13136
  */
11979
- export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim, force?: boolean): void;
13137
+ export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim): void;
11980
13138
 
11981
13139
  /** For `GridEntityType.TELEPORTER` (23). */
11982
13140
  export declare const TELEPORTER_ACTIVATION_DISTANCE: number;
@@ -12217,6 +13375,15 @@ export declare type TSTLClass = LuaMap<AnyNotNil, unknown> & {
12217
13375
  readonly __tstlClassBrand: symbol;
12218
13376
  };
12219
13377
 
13378
+ declare interface TSTLClassMetatable {
13379
+ ____constructor: () => void;
13380
+ __index: unknown;
13381
+ constructor: {
13382
+ name: string;
13383
+ prototype: LuaMetatable<LuaMap<AnyNotNil, unknown>>;
13384
+ };
13385
+ }
13386
+
12220
13387
  /**
12221
13388
  * Helper function to sort a two-dimensional array by the first element.
12222
13389
  *
@@ -12238,6 +13405,9 @@ export declare function twoDimensionalSort<T>(array1: T[], array2: T[]): -1 | 0
12238
13405
  */
12239
13406
  export declare const UI_HEART_WIDTH = 12;
12240
13407
 
13408
+ /** A helper type to convert a union to an intersection. */
13409
+ declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract<I, U> : never;
13410
+
12241
13411
  /** Helper function to put things back to normal after the `pause` function was used. */
12242
13412
  export declare function unpause(): void;
12243
13413
 
@@ -12275,6 +13445,8 @@ export declare function unsetHotkey(keyboard: Keyboard): void;
12275
13445
  * ```
12276
13446
  *
12277
13447
  * @param modVanilla The mod object returned by the `RegisterMod` function.
13448
+ * @param features Optional. An array containing the optional standard library features that you
13449
+ * want to enable, if any. Default is an empty array.
12278
13450
  * @param debug Optional. Whether to log additional output when a callback is fired. Default is
12279
13451
  * false.
12280
13452
  * @param timeThreshold Optional. If provided, will only log callbacks that take longer than the
@@ -12282,7 +13454,9 @@ export declare function unsetHotkey(keyboard: Keyboard): void;
12282
13454
  * or milliseconds (if the "--luadebug" launch flag is turned off).
12283
13455
  * @returns The upgraded mod object.
12284
13456
  */
12285
- export declare function upgradeMod(modVanilla: Mod, debug?: boolean, timeThreshold?: float): ModUpgraded;
13457
+ export declare function upgradeMod<T extends ISCFeature = never>(modVanilla: Mod, features?: T[], debug?: boolean, timeThreshold?: float): ModUpgradedWithFeatures<T>;
13458
+
13459
+ export declare type UppercaseKeys<T> = StartsWithUppercase<keyof T>;
12286
13460
 
12287
13461
  /**
12288
13462
  * Helper function to use an active item without showing an animation, keeping the item, or adding
@@ -12314,6 +13488,35 @@ export declare function validateCustomEnum(transpiledEnumName: string, transpile
12314
13488
  */
12315
13489
  export declare function validateEnumContiguous<T>(transpiledEnumName: string, transpiledEnum: T): void;
12316
13490
 
13491
+ /**
13492
+ * Helper function to validate that an interface contains all of the keys of an enum. You must
13493
+ * specify both generic parameters in order for this to work properly (i.e. the interface and then
13494
+ * the enum).
13495
+ *
13496
+ * For example:
13497
+ *
13498
+ * ```ts
13499
+ * enum MyEnum {
13500
+ * Value1,
13501
+ * Value2,
13502
+ * Value3,
13503
+ * }
13504
+ *
13505
+ * interface MyEnumToType {
13506
+ * [MyEnum.Value1]: boolean;
13507
+ * [MyEnum.Value2]: number;
13508
+ * [MyEnum.Value3]: string;
13509
+ * }
13510
+ *
13511
+ * validateInterfaceMatchesEnum<MyEnumToType, MyEnum>();
13512
+ * ```
13513
+ *
13514
+ * This function is only meant to be used with interfaces (i.e. types that will not exist at
13515
+ * run-time). If you are generating an object that will contain all of the keys of an enum, use the
13516
+ * `newObjectWithEnumKeys` helper function instead.
13517
+ */
13518
+ export declare function validateInterfaceMatchesEnum<T extends Record<Enum, unknown>, Enum extends string | number>(): void;
13519
+
12317
13520
  export declare function vectorEquals(vector1: Vector, vector2: Vector): boolean;
12318
13521
 
12319
13522
  /**