isaacscript-common 7.17.4 → 8.0.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 (403) hide show
  1. package/dist/callbacks/customRevive.d.ts +3 -0
  2. package/dist/callbacks/customRevive.d.ts.map +1 -0
  3. package/dist/callbacks/itemPickup.d.ts +3 -0
  4. package/dist/callbacks/itemPickup.d.ts.map +1 -0
  5. package/dist/callbacks/postAmbush.d.ts +3 -0
  6. package/dist/callbacks/postAmbush.d.ts.map +1 -0
  7. package/dist/callbacks/postBombExploded.d.ts +3 -0
  8. package/dist/callbacks/postBombExploded.d.ts.map +1 -0
  9. package/dist/callbacks/postBombInitLate.d.ts +3 -0
  10. package/dist/callbacks/postBombInitLate.d.ts.map +1 -0
  11. package/dist/callbacks/postBoneSwing.d.ts +3 -0
  12. package/dist/callbacks/postBoneSwing.d.ts.map +1 -0
  13. package/dist/callbacks/postCollectibleEmpty.d.ts +3 -0
  14. package/dist/callbacks/postCollectibleEmpty.d.ts.map +1 -0
  15. package/dist/callbacks/postCollectibleInitFirst.d.ts +3 -0
  16. package/dist/callbacks/postCollectibleInitFirst.d.ts.map +1 -0
  17. package/dist/callbacks/postCursedTeleport.d.ts +3 -0
  18. package/dist/callbacks/postCursedTeleport.d.ts.map +1 -0
  19. package/dist/callbacks/postCustomDoorEnter.d.ts +6 -0
  20. package/dist/callbacks/postCustomDoorEnter.d.ts.map +1 -0
  21. package/dist/callbacks/postDiceRoomActivated.d.ts +3 -0
  22. package/dist/callbacks/postDiceRoomActivated.d.ts.map +1 -0
  23. package/dist/callbacks/postDoorRender.d.ts +3 -0
  24. package/dist/callbacks/postDoorRender.d.ts.map +1 -0
  25. package/dist/callbacks/postDoorUpdate.d.ts +3 -0
  26. package/dist/callbacks/postDoorUpdate.d.ts.map +1 -0
  27. package/dist/callbacks/postEffectInitLate.d.ts +3 -0
  28. package/dist/callbacks/postEffectInitLate.d.ts.map +1 -0
  29. package/dist/callbacks/postEffectStateChanged.d.ts +3 -0
  30. package/dist/callbacks/postEffectStateChanged.d.ts.map +1 -0
  31. package/dist/callbacks/postEsauJr.d.ts +3 -0
  32. package/dist/callbacks/postEsauJr.d.ts.map +1 -0
  33. package/dist/callbacks/postFamiliarInitLate.d.ts +3 -0
  34. package/dist/callbacks/postFamiliarInitLate.d.ts.map +1 -0
  35. package/dist/callbacks/postFamiliarStateChanged.d.ts +3 -0
  36. package/dist/callbacks/postFamiliarStateChanged.d.ts.map +1 -0
  37. package/dist/callbacks/postFlip.d.ts +3 -0
  38. package/dist/callbacks/postFlip.d.ts.map +1 -0
  39. package/dist/callbacks/postGreedModeWave.d.ts +3 -0
  40. package/dist/callbacks/postGreedModeWave.d.ts.map +1 -0
  41. package/dist/callbacks/postGridEntity.d.ts +3 -0
  42. package/dist/callbacks/postGridEntity.d.ts.map +1 -0
  43. package/dist/callbacks/postGridEntityCollision.d.ts +3 -0
  44. package/dist/callbacks/postGridEntityCollision.d.ts.map +1 -0
  45. package/dist/callbacks/postGridEntityCustomCollision.d.ts +3 -0
  46. package/dist/callbacks/postGridEntityCustomCollision.d.ts.map +1 -0
  47. package/dist/callbacks/postGridEntityCustomRender.d.ts +3 -0
  48. package/dist/callbacks/postGridEntityCustomRender.d.ts.map +1 -0
  49. package/dist/callbacks/postGridEntityCustomUpdate.d.ts +3 -0
  50. package/dist/callbacks/postGridEntityCustomUpdate.d.ts.map +1 -0
  51. package/dist/callbacks/postGridEntityRender.d.ts +3 -0
  52. package/dist/callbacks/postGridEntityRender.d.ts.map +1 -0
  53. package/dist/callbacks/postHolyMantleRemoved.d.ts +3 -0
  54. package/dist/callbacks/postHolyMantleRemoved.d.ts.map +1 -0
  55. package/dist/callbacks/postItemDischarged.d.ts +3 -0
  56. package/dist/callbacks/postItemDischarged.d.ts.map +1 -0
  57. package/dist/callbacks/postKnifeInitLate.d.ts +3 -0
  58. package/dist/callbacks/postKnifeInitLate.d.ts.map +1 -0
  59. package/dist/callbacks/postLaserInitLate.d.ts +3 -0
  60. package/dist/callbacks/postLaserInitLate.d.ts.map +1 -0
  61. package/dist/callbacks/postNPCInitLate.d.ts +3 -0
  62. package/dist/callbacks/postNPCInitLate.d.ts.map +1 -0
  63. package/dist/callbacks/postNPCStateChanged.d.ts +3 -0
  64. package/dist/callbacks/postNPCStateChanged.d.ts.map +1 -0
  65. package/dist/callbacks/postNewRoomEarly.d.ts +3 -0
  66. package/dist/callbacks/postNewRoomEarly.d.ts.map +1 -0
  67. package/dist/callbacks/postPickupCollect.d.ts +3 -0
  68. package/dist/callbacks/postPickupCollect.d.ts.map +1 -0
  69. package/dist/callbacks/postPickupInitFirst.d.ts +3 -0
  70. package/dist/callbacks/postPickupInitFirst.d.ts.map +1 -0
  71. package/dist/callbacks/postPickupInitLate.d.ts +3 -0
  72. package/dist/callbacks/postPickupInitLate.d.ts.map +1 -0
  73. package/dist/callbacks/postPickupStateChanged.d.ts +3 -0
  74. package/dist/callbacks/postPickupStateChanged.d.ts.map +1 -0
  75. package/dist/callbacks/postPitRender.d.ts +3 -0
  76. package/dist/callbacks/postPitRender.d.ts.map +1 -0
  77. package/dist/callbacks/postPitUpdate.d.ts +3 -0
  78. package/dist/callbacks/postPitUpdate.d.ts.map +1 -0
  79. package/dist/callbacks/postPlayerChangeHealth.d.ts +3 -0
  80. package/dist/callbacks/postPlayerChangeHealth.d.ts.map +1 -0
  81. package/dist/callbacks/postPlayerChangeStat.d.ts +3 -0
  82. package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -0
  83. package/dist/callbacks/postPlayerChangeType.d.ts +3 -0
  84. package/dist/callbacks/postPlayerChangeType.d.ts.map +1 -0
  85. package/dist/callbacks/postPlayerCollectible.d.ts +3 -0
  86. package/dist/callbacks/postPlayerCollectible.d.ts.map +1 -0
  87. package/dist/callbacks/postPlayerFatalDamage.d.ts +3 -0
  88. package/dist/callbacks/postPlayerFatalDamage.d.ts.map +1 -0
  89. package/dist/callbacks/postPlayerInitFirst.d.ts +3 -0
  90. package/dist/callbacks/postPlayerInitFirst.d.ts.map +1 -0
  91. package/dist/callbacks/postPlayerInitLate.d.ts +3 -0
  92. package/dist/callbacks/postPlayerInitLate.d.ts.map +1 -0
  93. package/dist/callbacks/postPlayerReorderedCallbacks.d.ts +3 -0
  94. package/dist/callbacks/postPlayerReorderedCallbacks.d.ts.map +1 -0
  95. package/dist/callbacks/postPoopRender.d.ts +3 -0
  96. package/dist/callbacks/postPoopRender.d.ts.map +1 -0
  97. package/dist/callbacks/postPoopUpdate.d.ts +3 -0
  98. package/dist/callbacks/postPoopUpdate.d.ts.map +1 -0
  99. package/dist/callbacks/postPressurePlateRender.d.ts +3 -0
  100. package/dist/callbacks/postPressurePlateRender.d.ts.map +1 -0
  101. package/dist/callbacks/postPressurePlateUpdate.d.ts +3 -0
  102. package/dist/callbacks/postPressurePlateUpdate.d.ts.map +1 -0
  103. package/dist/callbacks/postProjectileInitLate.d.ts +3 -0
  104. package/dist/callbacks/postProjectileInitLate.d.ts.map +1 -0
  105. package/dist/callbacks/postPurchase.d.ts +3 -0
  106. package/dist/callbacks/postPurchase.d.ts.map +1 -0
  107. package/dist/callbacks/postRockRender.d.ts +3 -0
  108. package/dist/callbacks/postRockRender.d.ts.map +1 -0
  109. package/dist/callbacks/postRockUpdate.d.ts +3 -0
  110. package/dist/callbacks/postRockUpdate.d.ts.map +1 -0
  111. package/dist/callbacks/postRoomClearChanged.d.ts +3 -0
  112. package/dist/callbacks/postRoomClearChanged.d.ts.map +1 -0
  113. package/dist/callbacks/postSacrifice.d.ts +3 -0
  114. package/dist/callbacks/postSacrifice.d.ts.map +1 -0
  115. package/dist/callbacks/postSlotCollision.d.ts +3 -0
  116. package/dist/callbacks/postSlotCollision.d.ts.map +1 -0
  117. package/dist/callbacks/postSlotDestroyed.d.ts +3 -0
  118. package/dist/callbacks/postSlotDestroyed.d.ts.map +1 -0
  119. package/dist/callbacks/postSlotInitUpdate.d.ts +3 -0
  120. package/dist/callbacks/postSlotInitUpdate.d.ts.map +1 -0
  121. package/dist/callbacks/postSlotRender.d.ts +3 -0
  122. package/dist/callbacks/postSlotRender.d.ts.map +1 -0
  123. package/dist/callbacks/postSpikesRender.d.ts +3 -0
  124. package/dist/callbacks/postSpikesRender.d.ts.map +1 -0
  125. package/dist/callbacks/postSpikesUpdate.d.ts +3 -0
  126. package/dist/callbacks/postSpikesUpdate.d.ts.map +1 -0
  127. package/dist/callbacks/postTNTRender.d.ts +3 -0
  128. package/dist/callbacks/postTNTRender.d.ts.map +1 -0
  129. package/dist/callbacks/postTNTUpdate.d.ts +3 -0
  130. package/dist/callbacks/postTNTUpdate.d.ts.map +1 -0
  131. package/dist/callbacks/postTearInitLate.d.ts +3 -0
  132. package/dist/callbacks/postTearInitLate.d.ts.map +1 -0
  133. package/dist/callbacks/postTearInitVeryLate.d.ts +3 -0
  134. package/dist/callbacks/postTearInitVeryLate.d.ts.map +1 -0
  135. package/dist/callbacks/postTransformation.d.ts +3 -0
  136. package/dist/callbacks/postTransformation.d.ts.map +1 -0
  137. package/dist/callbacks/postTrinketBreak.d.ts +3 -0
  138. package/dist/callbacks/postTrinketBreak.d.ts.map +1 -0
  139. package/dist/callbacks/preBerserkDeath.d.ts +3 -0
  140. package/dist/callbacks/preBerserkDeath.d.ts.map +1 -0
  141. package/dist/callbacks/preNewLevel.d.ts +3 -0
  142. package/dist/callbacks/preNewLevel.d.ts.map +1 -0
  143. package/dist/callbacks/reorderedCallbacks.d.ts +6 -0
  144. package/dist/callbacks/reorderedCallbacks.d.ts.map +1 -0
  145. package/dist/callbacks/subscriptions/postAmbushFinished.d.ts +9 -0
  146. package/dist/callbacks/subscriptions/postAmbushFinished.d.ts.map +1 -0
  147. package/dist/callbacks/subscriptions/postAmbushStarted.d.ts +9 -0
  148. package/dist/callbacks/subscriptions/postAmbushStarted.d.ts.map +1 -0
  149. package/dist/callbacks/subscriptions/postBombInitLate.d.ts +9 -0
  150. package/dist/callbacks/subscriptions/postBombInitLate.d.ts.map +1 -0
  151. package/dist/callbacks/subscriptions/postBoneExploded.d.ts +9 -0
  152. package/dist/callbacks/subscriptions/postBoneExploded.d.ts.map +1 -0
  153. package/dist/callbacks/subscriptions/postBoneSwing.d.ts +8 -0
  154. package/dist/callbacks/subscriptions/postBoneSwing.d.ts.map +1 -0
  155. package/dist/callbacks/subscriptions/postCollectibleEmpty.d.ts +9 -0
  156. package/dist/callbacks/subscriptions/postCollectibleEmpty.d.ts.map +1 -0
  157. package/dist/callbacks/subscriptions/postCollectibleInitFirst.d.ts +9 -0
  158. package/dist/callbacks/subscriptions/postCollectibleInitFirst.d.ts.map +1 -0
  159. package/dist/callbacks/subscriptions/postCursedTeleport.d.ts +8 -0
  160. package/dist/callbacks/subscriptions/postCursedTeleport.d.ts.map +1 -0
  161. package/dist/callbacks/subscriptions/postCustomDoorEnter.d.ts +9 -0
  162. package/dist/callbacks/subscriptions/postCustomDoorEnter.d.ts.map +1 -0
  163. package/dist/callbacks/subscriptions/postCustomRevive.d.ts +10 -0
  164. package/dist/callbacks/subscriptions/postCustomRevive.d.ts.map +1 -0
  165. package/dist/callbacks/subscriptions/postDiceRoomActivated.d.ts +9 -0
  166. package/dist/callbacks/subscriptions/postDiceRoomActivated.d.ts.map +1 -0
  167. package/dist/callbacks/subscriptions/postDoorRender.d.ts +9 -0
  168. package/dist/callbacks/subscriptions/postDoorRender.d.ts.map +1 -0
  169. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +9 -0
  170. package/dist/callbacks/subscriptions/postDoorUpdate.d.ts.map +1 -0
  171. package/dist/callbacks/subscriptions/postEffectInitLate.d.ts +9 -0
  172. package/dist/callbacks/subscriptions/postEffectInitLate.d.ts.map +1 -0
  173. package/dist/callbacks/subscriptions/postEffectStateChanged.d.ts +9 -0
  174. package/dist/callbacks/subscriptions/postEffectStateChanged.d.ts.map +1 -0
  175. package/dist/callbacks/subscriptions/postEsauJr.d.ts +8 -0
  176. package/dist/callbacks/subscriptions/postEsauJr.d.ts.map +1 -0
  177. package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts +9 -0
  178. package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts.map +1 -0
  179. package/dist/callbacks/subscriptions/postFamiliarStateChanged.d.ts +9 -0
  180. package/dist/callbacks/subscriptions/postFamiliarStateChanged.d.ts.map +1 -0
  181. package/dist/callbacks/subscriptions/postFirstEsauJr.d.ts +8 -0
  182. package/dist/callbacks/subscriptions/postFirstEsauJr.d.ts.map +1 -0
  183. package/dist/callbacks/subscriptions/postFirstFlip.d.ts +8 -0
  184. package/dist/callbacks/subscriptions/postFirstFlip.d.ts.map +1 -0
  185. package/dist/callbacks/subscriptions/postFlip.d.ts +8 -0
  186. package/dist/callbacks/subscriptions/postFlip.d.ts.map +1 -0
  187. package/dist/callbacks/subscriptions/postGameStartedReordered.d.ts +7 -0
  188. package/dist/callbacks/subscriptions/postGameStartedReordered.d.ts.map +1 -0
  189. package/dist/callbacks/subscriptions/postGameStartedReorderedLast.d.ts +7 -0
  190. package/dist/callbacks/subscriptions/postGameStartedReorderedLast.d.ts.map +1 -0
  191. package/dist/callbacks/subscriptions/postGreedModeWave.d.ts +8 -0
  192. package/dist/callbacks/subscriptions/postGreedModeWave.d.ts.map +1 -0
  193. package/dist/callbacks/subscriptions/postGridEntityBroken.d.ts +10 -0
  194. package/dist/callbacks/subscriptions/postGridEntityBroken.d.ts.map +1 -0
  195. package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts +10 -0
  196. package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts.map +1 -0
  197. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts +9 -0
  198. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts.map +1 -0
  199. package/dist/callbacks/subscriptions/postGridEntityCustomCollision.d.ts +9 -0
  200. package/dist/callbacks/subscriptions/postGridEntityCustomCollision.d.ts.map +1 -0
  201. package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts +9 -0
  202. package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts.map +1 -0
  203. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts +9 -0
  204. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts.map +1 -0
  205. package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts +9 -0
  206. package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts.map +1 -0
  207. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts +9 -0
  208. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts.map +1 -0
  209. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts +9 -0
  210. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts.map +1 -0
  211. package/dist/callbacks/subscriptions/postGridEntityInit.d.ts +10 -0
  212. package/dist/callbacks/subscriptions/postGridEntityInit.d.ts.map +1 -0
  213. package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts +10 -0
  214. package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts.map +1 -0
  215. package/dist/callbacks/subscriptions/postGridEntityRender.d.ts +10 -0
  216. package/dist/callbacks/subscriptions/postGridEntityRender.d.ts.map +1 -0
  217. package/dist/callbacks/subscriptions/postGridEntityStateChanged.d.ts +10 -0
  218. package/dist/callbacks/subscriptions/postGridEntityStateChanged.d.ts.map +1 -0
  219. package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts +10 -0
  220. package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts.map +1 -0
  221. package/dist/callbacks/subscriptions/postHolyMantleRemoved.d.ts +10 -0
  222. package/dist/callbacks/subscriptions/postHolyMantleRemoved.d.ts.map +1 -0
  223. package/dist/callbacks/subscriptions/postItemDischarged.d.ts +9 -0
  224. package/dist/callbacks/subscriptions/postItemDischarged.d.ts.map +1 -0
  225. package/dist/callbacks/subscriptions/postItemPickup.d.ts +15 -0
  226. package/dist/callbacks/subscriptions/postItemPickup.d.ts.map +1 -0
  227. package/dist/callbacks/subscriptions/postKnifeInitLate.d.ts +9 -0
  228. package/dist/callbacks/subscriptions/postKnifeInitLate.d.ts.map +1 -0
  229. package/dist/callbacks/subscriptions/postLaserInitLate.d.ts +9 -0
  230. package/dist/callbacks/subscriptions/postLaserInitLate.d.ts.map +1 -0
  231. package/dist/callbacks/subscriptions/postNPCInitLate.d.ts +9 -0
  232. package/dist/callbacks/subscriptions/postNPCInitLate.d.ts.map +1 -0
  233. package/dist/callbacks/subscriptions/postNPCStateChanged.d.ts +10 -0
  234. package/dist/callbacks/subscriptions/postNPCStateChanged.d.ts.map +1 -0
  235. package/dist/callbacks/subscriptions/postNewLevelReordered.d.ts +5 -0
  236. package/dist/callbacks/subscriptions/postNewLevelReordered.d.ts.map +1 -0
  237. package/dist/callbacks/subscriptions/postNewRoomEarly.d.ts +5 -0
  238. package/dist/callbacks/subscriptions/postNewRoomEarly.d.ts.map +1 -0
  239. package/dist/callbacks/subscriptions/postNewRoomReordered.d.ts +5 -0
  240. package/dist/callbacks/subscriptions/postNewRoomReordered.d.ts.map +1 -0
  241. package/dist/callbacks/subscriptions/postPEffectUpdateReordered.d.ts +10 -0
  242. package/dist/callbacks/subscriptions/postPEffectUpdateReordered.d.ts.map +1 -0
  243. package/dist/callbacks/subscriptions/postPickupCollect.d.ts +9 -0
  244. package/dist/callbacks/subscriptions/postPickupCollect.d.ts.map +1 -0
  245. package/dist/callbacks/subscriptions/postPickupInitFirst.d.ts +9 -0
  246. package/dist/callbacks/subscriptions/postPickupInitFirst.d.ts.map +1 -0
  247. package/dist/callbacks/subscriptions/postPickupInitLate.d.ts +9 -0
  248. package/dist/callbacks/subscriptions/postPickupInitLate.d.ts.map +1 -0
  249. package/dist/callbacks/subscriptions/postPickupStateChanged.d.ts +9 -0
  250. package/dist/callbacks/subscriptions/postPickupStateChanged.d.ts.map +1 -0
  251. package/dist/callbacks/subscriptions/postPitRender.d.ts +9 -0
  252. package/dist/callbacks/subscriptions/postPitRender.d.ts.map +1 -0
  253. package/dist/callbacks/subscriptions/postPitUpdate.d.ts +9 -0
  254. package/dist/callbacks/subscriptions/postPitUpdate.d.ts.map +1 -0
  255. package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +11 -0
  256. package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts.map +1 -0
  257. package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts +13 -0
  258. package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts.map +1 -0
  259. package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +9 -0
  260. package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts.map +1 -0
  261. package/dist/callbacks/subscriptions/postPlayerCollectibleAdded.d.ts +9 -0
  262. package/dist/callbacks/subscriptions/postPlayerCollectibleAdded.d.ts.map +1 -0
  263. package/dist/callbacks/subscriptions/postPlayerCollectibleRemoved.d.ts +9 -0
  264. package/dist/callbacks/subscriptions/postPlayerCollectibleRemoved.d.ts.map +1 -0
  265. package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +10 -0
  266. package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts.map +1 -0
  267. package/dist/callbacks/subscriptions/postPlayerInitFirst.d.ts +10 -0
  268. package/dist/callbacks/subscriptions/postPlayerInitFirst.d.ts.map +1 -0
  269. package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts +10 -0
  270. package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts.map +1 -0
  271. package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts +10 -0
  272. package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts.map +1 -0
  273. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +10 -0
  274. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts.map +1 -0
  275. package/dist/callbacks/subscriptions/postPoopRender.d.ts +9 -0
  276. package/dist/callbacks/subscriptions/postPoopRender.d.ts.map +1 -0
  277. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +9 -0
  278. package/dist/callbacks/subscriptions/postPoopUpdate.d.ts.map +1 -0
  279. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +9 -0
  280. package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts.map +1 -0
  281. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +9 -0
  282. package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts.map +1 -0
  283. package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts +9 -0
  284. package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts.map +1 -0
  285. package/dist/callbacks/subscriptions/postPurchase.d.ts +10 -0
  286. package/dist/callbacks/subscriptions/postPurchase.d.ts.map +1 -0
  287. package/dist/callbacks/subscriptions/postRockRender.d.ts +10 -0
  288. package/dist/callbacks/subscriptions/postRockRender.d.ts.map +1 -0
  289. package/dist/callbacks/subscriptions/postRockUpdate.d.ts +10 -0
  290. package/dist/callbacks/subscriptions/postRockUpdate.d.ts.map +1 -0
  291. package/dist/callbacks/subscriptions/postRoomClearChanged.d.ts +8 -0
  292. package/dist/callbacks/subscriptions/postRoomClearChanged.d.ts.map +1 -0
  293. package/dist/callbacks/subscriptions/postSacrifice.d.ts +10 -0
  294. package/dist/callbacks/subscriptions/postSacrifice.d.ts.map +1 -0
  295. package/dist/callbacks/subscriptions/postSlotAnimationChanged.d.ts +9 -0
  296. package/dist/callbacks/subscriptions/postSlotAnimationChanged.d.ts.map +1 -0
  297. package/dist/callbacks/subscriptions/postSlotCollision.d.ts +9 -0
  298. package/dist/callbacks/subscriptions/postSlotCollision.d.ts.map +1 -0
  299. package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts +11 -0
  300. package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts.map +1 -0
  301. package/dist/callbacks/subscriptions/postSlotInit.d.ts +9 -0
  302. package/dist/callbacks/subscriptions/postSlotInit.d.ts.map +1 -0
  303. package/dist/callbacks/subscriptions/postSlotRender.d.ts +9 -0
  304. package/dist/callbacks/subscriptions/postSlotRender.d.ts.map +1 -0
  305. package/dist/callbacks/subscriptions/postSlotUpdate.d.ts +9 -0
  306. package/dist/callbacks/subscriptions/postSlotUpdate.d.ts.map +1 -0
  307. package/dist/callbacks/subscriptions/postSpikesRender.d.ts +10 -0
  308. package/dist/callbacks/subscriptions/postSpikesRender.d.ts.map +1 -0
  309. package/dist/callbacks/subscriptions/postSpikesUpdate.d.ts +10 -0
  310. package/dist/callbacks/subscriptions/postSpikesUpdate.d.ts.map +1 -0
  311. package/dist/callbacks/subscriptions/postTNTRender.d.ts +10 -0
  312. package/dist/callbacks/subscriptions/postTNTRender.d.ts.map +1 -0
  313. package/dist/callbacks/subscriptions/postTNTUpdate.d.ts +10 -0
  314. package/dist/callbacks/subscriptions/postTNTUpdate.d.ts.map +1 -0
  315. package/dist/callbacks/subscriptions/postTearInitLate.d.ts +9 -0
  316. package/dist/callbacks/subscriptions/postTearInitLate.d.ts.map +1 -0
  317. package/dist/callbacks/subscriptions/postTearInitVeryLate.d.ts +9 -0
  318. package/dist/callbacks/subscriptions/postTearInitVeryLate.d.ts.map +1 -0
  319. package/dist/callbacks/subscriptions/postTransformation.d.ts +9 -0
  320. package/dist/callbacks/subscriptions/postTransformation.d.ts.map +1 -0
  321. package/dist/callbacks/subscriptions/postTrinketBreak.d.ts +9 -0
  322. package/dist/callbacks/subscriptions/postTrinketBreak.d.ts.map +1 -0
  323. package/dist/callbacks/subscriptions/preBerserkDeath.d.ts +10 -0
  324. package/dist/callbacks/subscriptions/preBerserkDeath.d.ts.map +1 -0
  325. package/dist/callbacks/subscriptions/preCustomRevive.d.ts +10 -0
  326. package/dist/callbacks/subscriptions/preCustomRevive.d.ts.map +1 -0
  327. package/dist/callbacks/subscriptions/preItemPickup.d.ts +15 -0
  328. package/dist/callbacks/subscriptions/preItemPickup.d.ts.map +1 -0
  329. package/dist/callbacks/subscriptions/preNewLevel.d.ts +8 -0
  330. package/dist/callbacks/subscriptions/preNewLevel.d.ts.map +1 -0
  331. package/dist/core/constantsFirstLast.d.ts +10 -85
  332. package/dist/core/constantsFirstLast.d.ts.map +1 -1
  333. package/dist/core/constantsFirstLast.lua +10 -90
  334. package/dist/enums/ModCallbackCustom.d.ts +21 -0
  335. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  336. package/dist/features/characterStats.lua +2 -2
  337. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  338. package/dist/features/extraConsoleCommands/listCommands.lua +9 -5
  339. package/dist/features/firstLast.d.ts +190 -0
  340. package/dist/features/firstLast.d.ts.map +1 -0
  341. package/dist/features/firstLast.lua +341 -0
  342. package/dist/functions/array.d.ts +1 -9
  343. package/dist/functions/array.d.ts.map +1 -1
  344. package/dist/functions/array.lua +0 -6
  345. package/dist/functions/cards.d.ts +0 -8
  346. package/dist/functions/cards.d.ts.map +1 -1
  347. package/dist/functions/cards.lua +9 -24
  348. package/dist/functions/{cacheFlag.d.ts → collectibleCacheFlag.d.ts} +8 -8
  349. package/dist/functions/collectibleCacheFlag.d.ts.map +1 -0
  350. package/dist/functions/{cacheFlag.lua → collectibleCacheFlag.lua} +12 -13
  351. package/dist/functions/collectibleSet.d.ts +18 -0
  352. package/dist/functions/collectibleSet.d.ts.map +1 -1
  353. package/dist/functions/collectibleSet.lua +29 -9
  354. package/dist/functions/collectibles.d.ts +0 -13
  355. package/dist/functions/collectibles.d.ts.map +1 -1
  356. package/dist/functions/collectibles.lua +0 -18
  357. package/dist/functions/flying.lua +2 -2
  358. package/dist/functions/pills.d.ts +0 -10
  359. package/dist/functions/pills.d.ts.map +1 -1
  360. package/dist/functions/pills.lua +0 -15
  361. package/dist/functions/players.lua +1 -1
  362. package/dist/functions/random.d.ts.map +1 -1
  363. package/dist/functions/random.lua +2 -0
  364. package/dist/functions/run.d.ts +5 -0
  365. package/dist/functions/run.d.ts.map +1 -1
  366. package/dist/functions/run.lua +13 -0
  367. package/dist/functions/stats.d.ts +9 -0
  368. package/dist/functions/stats.d.ts.map +1 -0
  369. package/dist/functions/stats.lua +11 -0
  370. package/dist/functions/trinketCacheFlag.d.ts +9 -1
  371. package/dist/functions/trinketCacheFlag.d.ts.map +1 -1
  372. package/dist/functions/trinketCacheFlag.lua +28 -10
  373. package/dist/functions/trinketSet.d.ts +18 -0
  374. package/dist/functions/trinketSet.d.ts.map +1 -1
  375. package/dist/functions/trinketSet.lua +29 -9
  376. package/dist/functions/trinkets.d.ts +1 -10
  377. package/dist/functions/trinkets.d.ts.map +1 -1
  378. package/dist/functions/trinkets.lua +0 -24
  379. package/dist/index.d.ts +11569 -175
  380. package/dist/index.d.ts.map +1 -1
  381. package/dist/index.lua +158 -128
  382. package/package.json +1 -1
  383. package/src/core/constantsFirstLast.ts +12 -125
  384. package/src/enums/ModCallbackCustom.ts +21 -0
  385. package/src/features/characterStats.ts +1 -1
  386. package/src/features/extraConsoleCommands/listCommands.ts +8 -5
  387. package/src/features/firstLast.ts +429 -0
  388. package/src/functions/array.ts +1 -9
  389. package/src/functions/cards.ts +5 -28
  390. package/src/functions/{cacheFlag.ts → collectibleCacheFlag.ts} +13 -16
  391. package/src/functions/collectibleSet.ts +28 -21
  392. package/src/functions/collectibles.ts +0 -22
  393. package/src/functions/flying.ts +1 -1
  394. package/src/functions/pills.ts +0 -22
  395. package/src/functions/players.ts +2 -2
  396. package/src/functions/random.ts +3 -0
  397. package/src/functions/run.ts +23 -1
  398. package/src/functions/stats.ts +12 -0
  399. package/src/functions/trinketCacheFlag.ts +29 -7
  400. package/src/functions/trinketSet.ts +28 -21
  401. package/src/functions/trinkets.ts +0 -34
  402. package/src/index.ts +26 -62
  403. package/dist/functions/cacheFlag.d.ts.map +0 -1
@@ -353,6 +353,9 @@ export enum ModCallbackCustom {
353
353
  * the broken state for the respective grid entity type. (For example, this will fire for a
354
354
  * `GridEntityType.ROCK` (2) when its state changes to `RockState.BROKEN` (2).)
355
355
  *
356
+ * For grid entities created with `spawnCustomGridEntity`, use the
357
+ * `POST_GRID_ENTITY_CUSTOM_BROKEN` callback instead.
358
+ *
356
359
  * When registering the callback, takes an optional second argument that will make the callback
357
360
  * only fire if it matches the `GridEntityType` provided.
358
361
  *
@@ -367,6 +370,9 @@ export enum ModCallbackCustom {
367
370
  * this, the callback will not continue to fire. It will only fire again once the entity moves out
368
371
  * of range and then moves back into range.)
369
372
  *
373
+ * For grid entities created with `spawnCustomGridEntity`, use the
374
+ * `POST_GRID_ENTITY_CUSTOM_COLLISION` callback instead.
375
+ *
370
376
  * When registering the callback, takes an optional second argument that will make the callback
371
377
  * only fire if it matches the `GridEntityType` provided.
372
378
  *
@@ -502,6 +508,9 @@ export enum ModCallbackCustom {
502
508
  * - in the `POST_UPDATE` callback (if the entity appeared mid-way through the room, like when the
503
509
  * trapdoor appears after defeating It Lives!)
504
510
  *
511
+ * For grid entities created with `spawnCustomGridEntity`, use the `POST_GRID_ENTITY_CUSTOM_INIT`
512
+ * callback instead.
513
+ *
505
514
  * When registering the callback, takes an optional second argument that will make the callback
506
515
  * only fire if it matches the `GridEntityType` provided.
507
516
  *
@@ -519,6 +528,9 @@ export enum ModCallbackCustom {
519
528
  *
520
529
  * This will fire when a Polty/Kineti picks up a grid entity.
521
530
  *
531
+ * For grid entities created with `spawnCustomGridEntity`, use the
532
+ * `POST_GRID_ENTITY_CUSTOM_REMOVE` callback instead.
533
+ *
522
534
  * When registering the callback, takes an optional second argument that will make the callback
523
535
  * only fire if it matches the `GridEntityType` provided.
524
536
  *
@@ -539,6 +551,9 @@ export enum ModCallbackCustom {
539
551
  * - When registering the callback, takes an optional third argument that will make the callback
540
552
  * only fire if it matches the variant provided.
541
553
  *
554
+ * For grid entities created with `spawnCustomGridEntity`, use the
555
+ * `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
556
+ *
542
557
  * ```ts
543
558
  * function postGridEntityRender(gridEntity: GridEntity): void {}
544
559
  * ```
@@ -552,6 +567,9 @@ export enum ModCallbackCustom {
552
567
  * When registering the callback, takes an optional second argument that will make the callback
553
568
  * only fire if it matches the `GridEntityType` provided.
554
569
  *
570
+ * For grid entities created with `spawnCustomGridEntity`, use the
571
+ * `POST_GRID_ENTITY_CUSTOM_STATE_CHANGED` callback instead.
572
+ *
555
573
  * ```ts
556
574
  * function postGridEntityStateChanged(
557
575
  * gridEntity: GridEntity,
@@ -570,6 +588,9 @@ export enum ModCallbackCustom {
570
588
  * - When registering the callback, takes an optional third argument that will make the callback
571
589
  * only fire if it matches the variant provided.
572
590
  *
591
+ * For grid entities created with `spawnCustomGridEntity`, use the
592
+ * `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
593
+ *
573
594
  * ```ts
574
595
  * function postGridEntityUpdate(gridEntity: GridEntity): void {}
575
596
  * ```
@@ -10,8 +10,8 @@ import {
10
10
  PlayerType,
11
11
  } from "isaac-typescript-definitions";
12
12
  import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
13
- import { getDefaultPlayerStat } from "../functions/cacheFlag";
14
13
  import { addStat } from "../functions/players";
14
+ import { getDefaultPlayerStat } from "../functions/stats";
15
15
 
16
16
  const FEATURE_NAME = "characterStats";
17
17
 
@@ -47,8 +47,6 @@ import {
47
47
  FIRST_PILL_EFFECT,
48
48
  FIRST_ROOM_TYPE,
49
49
  FIRST_STAGE,
50
- LAST_CARD,
51
- LAST_PILL_EFFECT,
52
50
  LAST_ROOM_TYPE,
53
51
  LAST_STAGE,
54
52
  LAST_VANILLA_CHARACTER,
@@ -95,6 +93,7 @@ import { CARD_MAP } from "../../maps/cardMap";
95
93
  import { CHARACTER_MAP } from "../../maps/characterMap";
96
94
  import { PILL_EFFECT_MAP } from "../../maps/pillEffectMap";
97
95
  import { ROOM_TYPE_MAP } from "../../maps/roomTypeMap";
96
+ import { getLastCard, getLastPillEffect } from "../firstLast";
98
97
  import {
99
98
  addHeart,
100
99
  devilAngel,
@@ -337,7 +336,8 @@ export function card(params: string): void {
337
336
 
338
337
  cardNum = match[1];
339
338
  } else {
340
- if (num < FIRST_CARD || num > LAST_CARD) {
339
+ const lastCard = getLastCard();
340
+ if (num < FIRST_CARD || num > lastCard) {
341
341
  printConsole(`Invalid card sub-type: ${num}`);
342
342
  return;
343
343
  }
@@ -352,10 +352,12 @@ export function card(params: string): void {
352
352
 
353
353
  /** Spawns every card on the ground, starting at the top-left-most tile. */
354
354
  export function cards(): void {
355
+ const lastCard = getLastCard();
356
+
355
357
  let cardType = 1;
356
358
  for (let y = 0; y <= 6; y++) {
357
359
  for (let x = 0; x <= 12; x++) {
358
- if (asCard(cardType) === LAST_CARD) {
360
+ if (asCard(cardType) === lastCard) {
359
361
  return;
360
362
  }
361
363
 
@@ -876,7 +878,8 @@ export function pill(params: string): void {
876
878
 
877
879
  pillEffect = match[1];
878
880
  } else {
879
- if (num < FIRST_PILL_EFFECT || num > LAST_PILL_EFFECT) {
881
+ const lastPillEffect = getLastPillEffect();
882
+ if (num < FIRST_PILL_EFFECT || num > lastPillEffect) {
880
883
  printConsole(`Invalid pill effect ID: ${num}`);
881
884
  return;
882
885
  }
@@ -0,0 +1,429 @@
1
+ import {
2
+ Card,
3
+ CollectibleType,
4
+ PillEffect,
5
+ TrinketType,
6
+ } from "isaac-typescript-definitions";
7
+ import { ModUpgraded } from "../classes/ModUpgraded";
8
+ import { itemConfig } from "../core/cachedClasses";
9
+ import {
10
+ FIRST_CARD,
11
+ FIRST_PILL_EFFECT,
12
+ FIRST_TRINKET_TYPE,
13
+ LAST_VANILLA_CARD,
14
+ LAST_VANILLA_COLLECTIBLE_TYPE,
15
+ LAST_VANILLA_PILL_EFFECT,
16
+ LAST_VANILLA_TRINKET_TYPE,
17
+ NUM_VANILLA_CARDS,
18
+ NUM_VANILLA_COLLECTIBLE_TYPES,
19
+ NUM_VANILLA_PILL_EFFECTS,
20
+ NUM_VANILLA_TRINKET_TYPES,
21
+ } from "../core/constantsFirstLast";
22
+ import { ModCallbackCustom } from "../enums/ModCallbackCustom";
23
+ import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
24
+ import {
25
+ asCard,
26
+ asCollectibleType,
27
+ asNumber,
28
+ asPillEffect,
29
+ asTrinketType,
30
+ } from "../functions/types";
31
+ import { irange } from "../functions/utils";
32
+
33
+ const FEATURE_NAME = "firstLast";
34
+
35
+ let atLeastOneCallbackFired = false;
36
+
37
+ /** @internal */
38
+ export function firstLastInit(mod: ModUpgraded): void {
39
+ mod.AddCallbackCustom(
40
+ ModCallbackCustom.POST_NEW_ROOM_EARLY,
41
+ postNewRoomEarly,
42
+ );
43
+ }
44
+
45
+ // ModCallbackCustom.POST_NEW_ROOM_EARLY
46
+ function postNewRoomEarly() {
47
+ atLeastOneCallbackFired = true;
48
+ }
49
+
50
+ function errorIfNoCallbacksFired(constantType: string) {
51
+ if (!atLeastOneCallbackFired) {
52
+ error(
53
+ `Failed to retrieve a ${constantType} constant. Since not all mods have been loaded yet, any constants of this type will be inaccurate. Thus, you must wait until at least one callback fires before retrieving these types of constants.`,
54
+ );
55
+ }
56
+ }
57
+
58
+ // ------------
59
+ // Collectibles
60
+ // ------------
61
+
62
+ /**
63
+ * Returns the first modded collectible type, or undefined if there are no modded collectibles.
64
+ *
65
+ * This function can only be called if at least one callback has been executed. This is because not
66
+ * all collectibles will necessarily be present when a mod first loads (due to mod load order).
67
+ */
68
+ export function getFirstModdedCollectibleType(): CollectibleType | undefined {
69
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
70
+ errorIfNoCallbacksFired("collectible");
71
+
72
+ const firstModdedCollectibleType = asCollectibleType(
73
+ asNumber(LAST_VANILLA_COLLECTIBLE_TYPE) + 1,
74
+ );
75
+ const itemConfigItem = itemConfig.GetCollectible(firstModdedCollectibleType);
76
+ return itemConfigItem === undefined ? undefined : firstModdedCollectibleType;
77
+ }
78
+
79
+ /**
80
+ * Will change depending on how many modded collectibles there are.
81
+ *
82
+ * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
83
+ * 666. We subtract one to account for `CollectibleType.NULL`.)
84
+ *
85
+ * This function can only be called if at least one callback has been executed. This is because not
86
+ * all collectibles will necessarily be present when a mod first loads (due to mod load order).
87
+ */
88
+ export function getLastCollectibleType(): CollectibleType {
89
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
90
+ errorIfNoCallbacksFired("collectible");
91
+
92
+ return itemConfig.GetCollectibles().Size - 1;
93
+ }
94
+
95
+ /**
96
+ * Helper function to get an array that represents the all modded collectible types.
97
+ *
98
+ * This function is only useful when building collectible type objects. For most purposes, you
99
+ * should use the `getModdedCollectibleSet` helper function instead.
100
+ *
101
+ * Returns an empty array if there are no modded collectible types.
102
+ *
103
+ * (This function is named differently from the `getVanillaCollectibleTypeRange` function because
104
+ * all modded collectible types are contiguous. Thus, each value represents a real
105
+ * `CollectibleType`.)
106
+ *
107
+ * This function can only be called if at least one callback has been executed. This is because not
108
+ * all collectibles will necessarily be present when a mod first loads (due to mod load order).
109
+ */
110
+ export function getModdedCollectibleTypes(): CollectibleType[] {
111
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
112
+ errorIfNoCallbacksFired("collectible");
113
+
114
+ const firstModdedCollectibleType = getFirstModdedCollectibleType();
115
+ if (firstModdedCollectibleType === undefined) {
116
+ return [];
117
+ }
118
+
119
+ const lastCollectibleType = getLastCollectibleType();
120
+ return irange(firstModdedCollectibleType, lastCollectibleType);
121
+ }
122
+
123
+ /**
124
+ * This function can only be called if at least one callback has been executed. This is because not
125
+ * all collectibles will necessarily be present when a mod first loads (due to mod load order).
126
+ */
127
+ export function getNumCollectibleTypes(): int {
128
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
129
+ errorIfNoCallbacksFired("collectible");
130
+
131
+ const numModdedCollectibleTypes = getNumModdedCollectibleTypes();
132
+ return NUM_VANILLA_COLLECTIBLE_TYPES + numModdedCollectibleTypes;
133
+ }
134
+
135
+ /**
136
+ * Unlike vanilla collectible types, modded collectible types are always contiguous.
137
+ *
138
+ * This function can only be called if at least one callback has been executed. This is because not
139
+ * all collectibles will necessarily be present when a mod first loads (due to mod load order).
140
+ */
141
+ export function getNumModdedCollectibleTypes(): int {
142
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
143
+ errorIfNoCallbacksFired("collectible");
144
+
145
+ const lastCollectibleType = getLastCollectibleType();
146
+ return lastCollectibleType - LAST_VANILLA_COLLECTIBLE_TYPE;
147
+ }
148
+
149
+ // --------
150
+ // Trinkets
151
+ // --------
152
+
153
+ /**
154
+ * Returns the first modded trinket type, or undefined if there are no modded trinkets.
155
+ *
156
+ * This function can only be called if at least one callback has been executed. This is because not
157
+ * all trinkets will necessarily be present when a mod first loads (due to mod load order).
158
+ */
159
+ export function getFirstModdedTrinketType(): TrinketType | undefined {
160
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
161
+ errorIfNoCallbacksFired("trinket");
162
+
163
+ const firstModdedTrinketType = asTrinketType(
164
+ asNumber(LAST_VANILLA_TRINKET_TYPE) + 1,
165
+ );
166
+ const itemConfigItem = itemConfig.GetTrinket(firstModdedTrinketType);
167
+ return itemConfigItem === undefined ? undefined : firstModdedTrinketType;
168
+ }
169
+
170
+ /**
171
+ * Will change depending on how many modded cards there are.
172
+ *
173
+ * This is equal to the number of trinket types, since all trinket types are contiguous (unlike
174
+ * collectibles).
175
+ *
176
+ * This function can only be called if at least one callback has been executed. This is because not
177
+ * all trinkets will necessarily be present when a mod first loads (due to mod load order).
178
+ */
179
+ export function getLastTrinketType(): TrinketType {
180
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
181
+ errorIfNoCallbacksFired("trinket");
182
+
183
+ const numTrinketTypes = getNumTrinketTypes();
184
+ return asTrinketType(numTrinketTypes);
185
+ }
186
+
187
+ /**
188
+ * Helper function to get an array that represents every modded trinket type.
189
+ *
190
+ * Returns an empty array if there are no modded trinket types.
191
+ *
192
+ * This function can only be called if at least one callback has been executed. This is because not
193
+ * all trinkets will necessarily be present when a mod first loads (due to mod load order).
194
+ */
195
+ export function getModdedTrinketTypes(): TrinketType[] {
196
+ const firstModdedTrinketType = getFirstModdedTrinketType();
197
+ if (firstModdedTrinketType === undefined) {
198
+ return [];
199
+ }
200
+
201
+ const lastTrinketType = getLastTrinketType();
202
+ return irange(firstModdedTrinketType, lastTrinketType);
203
+ }
204
+
205
+ /**
206
+ * Will change depending on how many modded cards there are.
207
+ *
208
+ * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
209
+ * `TrinketType.NULL`.)
210
+ *
211
+ * This function can only be called if at least one callback has been executed. This is because not
212
+ * all trinkets will necessarily be present when a mod first loads (due to mod load order).
213
+ */
214
+ export function getNumTrinketTypes(): int {
215
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
216
+ errorIfNoCallbacksFired("trinket");
217
+
218
+ return itemConfig.GetTrinkets().Size - 1;
219
+ }
220
+
221
+ /**
222
+ * This function can only be called if at least one callback has been executed. This is because not
223
+ * all trinkets will necessarily be present when a mod first loads (due to mod load order).
224
+ */
225
+ export function getNumModdedTrinketTypes(): int {
226
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
227
+ errorIfNoCallbacksFired("trinket");
228
+
229
+ const numTrinketTypes = getNumTrinketTypes();
230
+ return numTrinketTypes - NUM_VANILLA_TRINKET_TYPES;
231
+ }
232
+
233
+ /**
234
+ * Helper function to get an array that contains every trinket type.
235
+ *
236
+ * This function can only be called if at least one callback has been executed. This is because not
237
+ * all trinkets will necessarily be present when a mod first loads (due to mod load order).
238
+ */
239
+ export function getTrinketTypes(): TrinketType[] {
240
+ const lastTrinketType = getLastTrinketType();
241
+ return irange(FIRST_TRINKET_TYPE, lastTrinketType);
242
+ }
243
+
244
+ // -----
245
+ // Cards
246
+ // -----
247
+
248
+ /**
249
+ * Helper function to get an array with every valid card sub-type. This includes modded cards.
250
+ *
251
+ * This function can only be called if at least one callback has been executed. This is because not
252
+ * all cards will necessarily be present when a mod first loads (due to mod load order).
253
+ */
254
+ export function getAllCards(): Card[] {
255
+ const lastCard = getLastCard();
256
+ return irange(FIRST_CARD, lastCard);
257
+ }
258
+
259
+ /**
260
+ * Returns the first modded card sub-type, or undefined if there are no modded cards.
261
+ *
262
+ * This function can only be called if at least one callback has been executed. This is because not
263
+ * all cards will necessarily be present when a mod first loads (due to mod load order).
264
+ */
265
+ export function getFirstModdedCard(): Card | undefined {
266
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
267
+ errorIfNoCallbacksFired("card");
268
+
269
+ const firstModdedCard = asCard(asNumber(LAST_VANILLA_CARD) + 1);
270
+ const itemConfigCard = itemConfig.GetCard(firstModdedCard);
271
+ return itemConfigCard === undefined ? undefined : firstModdedCard;
272
+ }
273
+
274
+ /**
275
+ * Will change depending on how many modded cards there are.
276
+ *
277
+ * This is equal to the number of cards, since all card sub-types are contiguous (unlike
278
+ * collectibles).
279
+ *
280
+ * This function can only be called if at least one callback has been executed. This is because not
281
+ * all cards will necessarily be present when a mod first loads (due to mod load order).
282
+ */
283
+ export function getLastCard(): Card {
284
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
285
+ errorIfNoCallbacksFired("card");
286
+
287
+ const numCards = getNumCards();
288
+ return asCard(numCards);
289
+ }
290
+
291
+ /**
292
+ * Helper function to get an array with every modded card sub-type.
293
+ *
294
+ * Returns an empty array if there are no modded cards.
295
+ *
296
+ * This function can only be called if at least one callback has been executed. This is because not
297
+ * all cards will necessarily be present when a mod first loads (due to mod load order).
298
+ */
299
+ export function getModdedCards(): Card[] {
300
+ const firstModdedCard = getFirstModdedCard();
301
+ if (firstModdedCard === undefined) {
302
+ return [];
303
+ }
304
+
305
+ const lastCard = getLastCard();
306
+ return irange(firstModdedCard, lastCard);
307
+ }
308
+
309
+ /**
310
+ * Will change depending on how many modded cards there are.
311
+ *
312
+ * Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
313
+ *
314
+ * This function can only be called if at least one callback has been executed. This is because not
315
+ * all cards will necessarily be present when a mod first loads (due to mod load order).
316
+ */
317
+ export function getNumCards(): int {
318
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
319
+ errorIfNoCallbacksFired("card");
320
+
321
+ return itemConfig.GetCards().Size - 1;
322
+ }
323
+
324
+ /**
325
+ * This function can only be called if at least one callback has been executed. This is because not
326
+ * all trinkets will necessarily be present when a mod first loads (due to mod load order).
327
+ */
328
+ export function getNumModdedCards(): int {
329
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
330
+ errorIfNoCallbacksFired("card");
331
+
332
+ const numCards = getNumCards();
333
+ return numCards - NUM_VANILLA_CARDS;
334
+ }
335
+
336
+ // ------------
337
+ // Pill Effects
338
+ // ------------
339
+
340
+ /**
341
+ * Helper function to get an array with every valid pill effect. This includes modded pill effects.
342
+ *
343
+ * This function can only be called if at least one callback has been executed. This is because not
344
+ * all pill effects will necessarily be present when a mod first loads (due to mod load order).
345
+ */
346
+ export function getAllPillEffects(): PillEffect[] {
347
+ const lastPillEffect = getLastPillEffect();
348
+ return irange(FIRST_PILL_EFFECT, lastPillEffect);
349
+ }
350
+
351
+ /**
352
+ * Returns the first modded pill effect, or undefined if there are no modded pill effects.
353
+ *
354
+ * This function can only be called if at least one callback has been executed. This is because not
355
+ * all pill effects will necessarily be present when a mod first loads (due to mod load order).
356
+ */
357
+ export function getFirstModdedPillEffect(): PillEffect | undefined {
358
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
359
+ errorIfNoCallbacksFired("pill");
360
+
361
+ const firstModdedPillEffect = asPillEffect(
362
+ asNumber(LAST_VANILLA_PILL_EFFECT) + 1,
363
+ );
364
+ const itemConfigPillEffect = itemConfig.GetPillEffect(firstModdedPillEffect);
365
+ return itemConfigPillEffect === undefined ? undefined : firstModdedPillEffect;
366
+ }
367
+
368
+ /**
369
+ * Will change depending on how many modded pill effects there are.
370
+ *
371
+ * This is equal to the number of pill effects, since all pill effects are contiguous (unlike
372
+ * collectibles).
373
+ *
374
+ * This function can only be called if at least one callback has been executed. This is because not
375
+ * all pill effects will necessarily be present when a mod first loads (due to mod load order).
376
+ */
377
+ export function getLastPillEffect(): PillEffect {
378
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
379
+ errorIfNoCallbacksFired("pill");
380
+
381
+ const numPillEffects = getNumPillEffects();
382
+ return asPillEffect(numPillEffects);
383
+ }
384
+
385
+ /**
386
+ * Helper function to get an array with every modded pill effect.
387
+ *
388
+ * Returns an empty array if there are no modded pill effects.
389
+ *
390
+ * This function can only be called if at least one callback has been executed. This is because not
391
+ * all pill effects will necessarily be present when a mod first loads (due to mod load order).
392
+ */
393
+ export function getModdedPillEffects(): PillEffect[] {
394
+ const firstModdedPillEffect = getFirstModdedPillEffect();
395
+ if (firstModdedPillEffect === undefined) {
396
+ return [];
397
+ }
398
+
399
+ const lastPillEffect = getLastPillEffect();
400
+ return irange(firstModdedPillEffect, lastPillEffect);
401
+ }
402
+
403
+ /**
404
+ * Will change depending on how many modded pill effects there are.
405
+ *
406
+ * Equal to `itemConfig.GetPillEffects().Size`. (We do not have to subtract one, because the first
407
+ * pill effect has an ID of 0 and there is no `PillEffect.NULL`.)
408
+ *
409
+ * This function can only be called if at least one callback has been executed. This is because not
410
+ * all pill effects will necessarily be present when a mod first loads (due to mod load order).
411
+ */
412
+ export function getNumPillEffects(): int {
413
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
414
+ errorIfNoCallbacksFired("pill");
415
+
416
+ return itemConfig.GetPillEffects().Size;
417
+ }
418
+
419
+ /**
420
+ * This function can only be called if at least one callback has been executed. This is because not
421
+ * all pill effects will necessarily be present when a mod first loads (due to mod load order).
422
+ */
423
+ export function getNumModdedPillEffects(): int {
424
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
425
+ errorIfNoCallbacksFired("pill");
426
+
427
+ const numPillEffects = getNumPillEffects();
428
+ return numPillEffects - NUM_VANILLA_PILL_EFFECTS;
429
+ }
@@ -399,15 +399,7 @@ export function getRandomArrayIndex<T>(
399
399
  return getRandomInt(0, array.length - 1, seedOrRNG, exceptions);
400
400
  }
401
401
 
402
- /**
403
- * Initializes an array with all elements containing the specified default value.
404
- *
405
- * For example:
406
- *
407
- * ```ts
408
- * const playerTransformations = initArray(false, PlayerForm.NUM_PLAYER_FORMS - 1);
409
- * ```
410
- */
402
+ /** Initializes an array with all elements containing the specified default value. */
411
403
  export function initArray<T>(defaultValue: T, size: int): T[] {
412
404
  const array: T[] = [];
413
405
  repeat(size, () => {
@@ -1,11 +1,6 @@
1
1
  import { Card, ItemConfigCardType } from "isaac-typescript-definitions";
2
2
  import { itemConfig } from "../core/cachedClasses";
3
- import {
4
- FIRST_CARD,
5
- FIRST_MODDED_CARD,
6
- LAST_CARD,
7
- MAX_VANILLA_CARD,
8
- } from "../core/constantsFirstLast";
3
+ import { FIRST_CARD, LAST_VANILLA_CARD } from "../core/constantsFirstLast";
9
4
  import {
10
5
  CARD_DESCRIPTIONS,
11
6
  DEFAULT_CARD_DESCRIPTION,
@@ -28,14 +23,14 @@ const CARD_TYPE_TO_CARDS_MAP = new Map<ItemConfigCardType, Set<Card>>();
28
23
  */
29
24
  const CARD_SET = new Set<Card>();
30
25
 
31
- function initCardObjects() {
26
+ function lazyInitCardMapsSets() {
32
27
  // The card type to cards map should be valid for every card type, so we initialize it with empty
33
28
  // sets.
34
29
  for (const cardType of getEnumValues(ItemConfigCardType)) {
35
30
  CARD_TYPE_TO_CARDS_MAP.set(cardType, new Set<Card>());
36
31
  }
37
32
 
38
- for (const card of getAllCards()) {
33
+ for (const card of getVanillaCards()) {
39
34
  const cardType = getCardType(card);
40
35
  const cardTypeSet = CARD_TYPE_TO_CARDS_MAP.get(cardType);
41
36
  if (cardTypeSet === undefined) {
@@ -57,11 +52,6 @@ function initCardObjects() {
57
52
  addSetsToSet(CARD_SET, cards);
58
53
  }
59
54
 
60
- /** Helper function to get an array with every valid card sub-type. This includes modded cards. */
61
- export function getAllCards(): Card[] {
62
- return irange(FIRST_CARD, LAST_CARD);
63
- }
64
-
65
55
  /**
66
56
  * Helper function to get a card description from a Card enum value.
67
57
  *
@@ -131,7 +121,7 @@ export function getCardType(card: Card): ItemConfigCardType {
131
121
  */
132
122
  export function getCardsOfType(...cardTypes: ItemConfigCardType[]): Set<Card> {
133
123
  if (CARD_TYPE_TO_CARDS_MAP.size === 0) {
134
- initCardObjects();
124
+ lazyInitCardMapsSets();
135
125
  }
136
126
 
137
127
  const matchingCards = new Set<Card>();
@@ -149,19 +139,6 @@ export function getCardsOfType(...cardTypes: ItemConfigCardType[]): Set<Card> {
149
139
  return matchingCards;
150
140
  }
151
141
 
152
- /**
153
- * Helper function to get an array with every modded card sub-type.
154
- *
155
- * Returns an empty array if there are no modded cards.
156
- */
157
- export function getModdedCards(): Card[] {
158
- if (MAX_VANILLA_CARD === LAST_CARD) {
159
- return [];
160
- }
161
-
162
- return irange(FIRST_MODDED_CARD, LAST_CARD);
163
- }
164
-
165
142
  /**
166
143
  * Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.).
167
144
  *
@@ -216,7 +193,7 @@ export function getRandomRune(
216
193
 
217
194
  /** Helper function to get an array with every valid vanilla card sub-type. */
218
195
  export function getVanillaCards(): Card[] {
219
- return irange(FIRST_CARD, MAX_VANILLA_CARD);
196
+ return irange(FIRST_CARD, LAST_VANILLA_CARD);
220
197
  }
221
198
 
222
199
  /**