isaacscript-common 18.3.0 → 18.3.2

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 (352) hide show
  1. package/dist/index.d.ts +29 -20
  2. package/dist/isaacscript-common.lua +329 -319
  3. package/dist/src/classes/ModFeature.d.ts +2 -2
  4. package/dist/src/classes/ModFeature.d.ts.map +1 -1
  5. package/dist/src/classes/ModFeature.lua +18 -17
  6. package/dist/src/classes/ModUpgradedBase.d.ts.map +1 -1
  7. package/dist/src/classes/ModUpgradedBase.lua +10 -10
  8. package/dist/src/classes/callbacks/EntityTakeDmgFilter.lua +1 -1
  9. package/dist/src/classes/callbacks/EntityTakeDmgPlayer.d.ts.map +1 -1
  10. package/dist/src/classes/callbacks/EntityTakeDmgPlayer.lua +1 -1
  11. package/dist/src/classes/callbacks/InputActionFilter.lua +1 -1
  12. package/dist/src/classes/callbacks/InputActionPlayer.lua +1 -1
  13. package/dist/src/classes/callbacks/PostAmbushFinished.lua +1 -1
  14. package/dist/src/classes/callbacks/PostAmbushStarted.lua +1 -1
  15. package/dist/src/classes/callbacks/PostBombExploded.lua +1 -1
  16. package/dist/src/classes/callbacks/PostBombInitLate.lua +1 -1
  17. package/dist/src/classes/callbacks/PostBoneSwing.lua +1 -1
  18. package/dist/src/classes/callbacks/PostCollectibleEmpty.d.ts.map +1 -1
  19. package/dist/src/classes/callbacks/PostCollectibleEmpty.lua +1 -1
  20. package/dist/src/classes/callbacks/PostCollectibleInitFirst.d.ts.map +1 -1
  21. package/dist/src/classes/callbacks/PostCollectibleInitFirst.lua +1 -1
  22. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts +2 -2
  23. package/dist/src/classes/callbacks/PostCursedTeleport.d.ts.map +1 -1
  24. package/dist/src/classes/callbacks/PostCursedTeleport.lua +19 -21
  25. package/dist/src/classes/callbacks/PostDiceRoomActivated.d.ts.map +1 -1
  26. package/dist/src/classes/callbacks/PostDiceRoomActivated.lua +1 -1
  27. package/dist/src/classes/callbacks/PostDoorRender.lua +1 -1
  28. package/dist/src/classes/callbacks/PostDoorUpdate.lua +1 -1
  29. package/dist/src/classes/callbacks/PostEffectInitLate.lua +1 -1
  30. package/dist/src/classes/callbacks/PostEffectStateChanged.lua +1 -1
  31. package/dist/src/classes/callbacks/PostFamiliarInitLate.lua +1 -1
  32. package/dist/src/classes/callbacks/PostFamiliarStateChanged.lua +1 -1
  33. package/dist/src/classes/callbacks/PostGreedModeWave.lua +1 -1
  34. package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +1 -1
  35. package/dist/src/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
  36. package/dist/src/classes/callbacks/PostItemDischarge.lua +2 -2
  37. package/dist/src/classes/callbacks/PostKnifeInitLate.lua +1 -1
  38. package/dist/src/classes/callbacks/PostLaserInitLate.lua +1 -1
  39. package/dist/src/classes/callbacks/PostNPCDeathFilter.lua +1 -1
  40. package/dist/src/classes/callbacks/PostNPCInitFilter.lua +1 -1
  41. package/dist/src/classes/callbacks/PostNPCInitLate.lua +1 -1
  42. package/dist/src/classes/callbacks/PostNPCRenderFilter.lua +1 -1
  43. package/dist/src/classes/callbacks/PostNPCStateChanged.lua +1 -1
  44. package/dist/src/classes/callbacks/PostNPCUpdateFilter.lua +1 -1
  45. package/dist/src/classes/callbacks/PostNewRoomEarly.lua +1 -1
  46. package/dist/src/classes/callbacks/PostPickupCollect.lua +1 -1
  47. package/dist/src/classes/callbacks/PostPickupInitFirst.lua +1 -1
  48. package/dist/src/classes/callbacks/PostPickupInitLate.lua +1 -1
  49. package/dist/src/classes/callbacks/PostPickupStateChanged.lua +1 -1
  50. package/dist/src/classes/callbacks/PostPitRender.lua +1 -1
  51. package/dist/src/classes/callbacks/PostPitUpdate.lua +1 -1
  52. package/dist/src/classes/callbacks/PostPlayerChangeHealth.lua +1 -1
  53. package/dist/src/classes/callbacks/PostPlayerChangeStat.lua +1 -1
  54. package/dist/src/classes/callbacks/PostPlayerChangeType.lua +1 -1
  55. package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts +1 -1
  56. package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts.map +1 -1
  57. package/dist/src/classes/callbacks/PostPlayerFatalDamage.lua +19 -21
  58. package/dist/src/classes/callbacks/PostPlayerInitFirst.lua +1 -1
  59. package/dist/src/classes/callbacks/PostPlayerInitLate.lua +1 -1
  60. package/dist/src/classes/callbacks/PostPoopRender.lua +1 -1
  61. package/dist/src/classes/callbacks/PostPoopUpdate.lua +1 -1
  62. package/dist/src/classes/callbacks/PostPressurePlateRender.lua +1 -1
  63. package/dist/src/classes/callbacks/PostPressurePlateUpdate.lua +1 -1
  64. package/dist/src/classes/callbacks/PostProjectileInitLate.lua +1 -1
  65. package/dist/src/classes/callbacks/PostPurchase.lua +1 -1
  66. package/dist/src/classes/callbacks/PostRockRender.lua +1 -1
  67. package/dist/src/classes/callbacks/PostRockUpdate.lua +1 -1
  68. package/dist/src/classes/callbacks/PostRoomClearChanged.lua +2 -2
  69. package/dist/src/classes/callbacks/PostSacrifice.d.ts.map +1 -1
  70. package/dist/src/classes/callbacks/PostSacrifice.lua +4 -8
  71. package/dist/src/classes/callbacks/PostSlotCollision.lua +1 -1
  72. package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -1
  73. package/dist/src/classes/callbacks/PostSlotDestroyed.lua +2 -2
  74. package/dist/src/classes/callbacks/PostSpikesRender.lua +1 -1
  75. package/dist/src/classes/callbacks/PostSpikesUpdate.lua +1 -1
  76. package/dist/src/classes/callbacks/PostTNTRender.lua +1 -1
  77. package/dist/src/classes/callbacks/PostTNTUpdate.lua +1 -1
  78. package/dist/src/classes/callbacks/PostTearInitLate.lua +1 -1
  79. package/dist/src/classes/callbacks/PostTearInitVeryLate.lua +1 -1
  80. package/dist/src/classes/callbacks/PostTransformation.lua +1 -1
  81. package/dist/src/classes/callbacks/PostTrinketBreak.d.ts.map +1 -1
  82. package/dist/src/classes/callbacks/PostTrinketBreak.lua +5 -11
  83. package/dist/src/classes/callbacks/PreBerserkDeath.lua +1 -1
  84. package/dist/src/classes/callbacks/PreGetPedestal.d.ts.map +1 -1
  85. package/dist/src/classes/callbacks/PreGetPedestal.lua +1 -1
  86. package/dist/src/classes/callbacks/PreNPCCollisionFilter.lua +1 -1
  87. package/dist/src/classes/callbacks/PreNPCUpdateFilter.lua +1 -1
  88. package/dist/src/classes/callbacks/PreNewLevel.lua +1 -1
  89. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
  90. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +2 -2
  91. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts +2 -2
  92. package/dist/src/classes/features/callbackLogic/CustomRevive.d.ts.map +1 -1
  93. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +5 -5
  94. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
  95. package/dist/src/classes/features/callbackLogic/EsauJrDetection.lua +1 -1
  96. package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts.map +1 -1
  97. package/dist/src/classes/features/callbackLogic/FlipDetection.lua +1 -1
  98. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  99. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +1 -1
  100. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -1
  101. package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.lua +1 -1
  102. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.d.ts.map +1 -1
  103. package/dist/src/classes/features/callbackLogic/GridEntityRenderDetection.lua +1 -1
  104. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.d.ts.map +1 -1
  105. package/dist/src/classes/features/callbackLogic/GridEntityUpdateDetection.lua +2 -2
  106. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts +1 -1
  107. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -1
  108. package/dist/src/classes/features/callbackLogic/ItemPickupDetection.lua +4 -3
  109. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +8 -3
  110. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -1
  111. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +16 -21
  112. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.d.ts.map +1 -1
  113. package/dist/src/classes/features/callbackLogic/PlayerReorderedCallbacks.lua +2 -2
  114. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts.map +1 -1
  115. package/dist/src/classes/features/callbackLogic/SlotRenderDetection.lua +1 -1
  116. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.d.ts.map +1 -1
  117. package/dist/src/classes/features/callbackLogic/SlotUpdateDetection.lua +2 -2
  118. package/dist/src/classes/features/other/CharacterHealthConversion.d.ts.map +1 -1
  119. package/dist/src/classes/features/other/CharacterHealthConversion.lua +2 -2
  120. package/dist/src/classes/features/other/CharacterStats.lua +1 -1
  121. package/dist/src/classes/features/other/CollectibleItemPoolType.d.ts.map +1 -1
  122. package/dist/src/classes/features/other/CollectibleItemPoolType.lua +1 -1
  123. package/dist/src/classes/features/other/CustomHotkeys.lua +1 -1
  124. package/dist/src/classes/features/other/CustomItemPools.lua +1 -1
  125. package/dist/src/classes/features/other/CustomPickups.d.ts.map +1 -1
  126. package/dist/src/classes/features/other/CustomPickups.lua +1 -1
  127. package/dist/src/classes/features/other/CustomStages.d.ts.map +1 -1
  128. package/dist/src/classes/features/other/CustomStages.lua +2 -2
  129. package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
  130. package/dist/src/classes/features/other/CustomTrapdoors.lua +2 -2
  131. package/dist/src/classes/features/other/DisableAllSound.lua +1 -1
  132. package/dist/src/classes/features/other/DisableInputs.d.ts.map +1 -1
  133. package/dist/src/classes/features/other/DisableInputs.lua +1 -1
  134. package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts +1 -1
  135. package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
  136. package/dist/src/classes/features/other/ExtraConsoleCommands.lua +17 -16
  137. package/dist/src/classes/features/other/FadeInRemover.lua +1 -1
  138. package/dist/src/classes/features/other/FastReset.lua +1 -1
  139. package/dist/src/classes/features/other/ModdedElementDetection.lua +1 -1
  140. package/dist/src/classes/features/other/NoSirenSteal.d.ts.map +1 -1
  141. package/dist/src/classes/features/other/NoSirenSteal.lua +1 -1
  142. package/dist/src/classes/features/other/Pause.d.ts.map +1 -1
  143. package/dist/src/classes/features/other/Pause.lua +1 -1
  144. package/dist/src/classes/features/other/PersistentEntities.lua +2 -2
  145. package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
  146. package/dist/src/classes/features/other/PickupIndexCreation.lua +1 -1
  147. package/dist/src/classes/features/other/PlayerInventory.lua +1 -1
  148. package/dist/src/classes/features/other/PonyDetection.lua +1 -1
  149. package/dist/src/classes/features/other/PressInput.d.ts.map +1 -1
  150. package/dist/src/classes/features/other/PressInput.lua +1 -1
  151. package/dist/src/classes/features/other/PreventChildEntities.lua +1 -1
  152. package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
  153. package/dist/src/classes/features/other/PreventCollectibleRotation.lua +1 -1
  154. package/dist/src/classes/features/other/PreventGridEntityRespawn.d.ts.map +1 -1
  155. package/dist/src/classes/features/other/PreventGridEntityRespawn.lua +2 -2
  156. package/dist/src/classes/features/other/RoomClearFrame.lua +1 -1
  157. package/dist/src/classes/features/other/RoomHistory.lua +1 -1
  158. package/dist/src/classes/features/other/RunInNFrames.lua +1 -1
  159. package/dist/src/classes/features/other/RunNextRoom.lua +1 -1
  160. package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
  161. package/dist/src/classes/features/other/SaveDataManager.lua +2 -2
  162. package/dist/src/classes/features/other/StageHistory.d.ts.map +1 -1
  163. package/dist/src/classes/features/other/StageHistory.lua +1 -1
  164. package/dist/src/classes/features/other/TaintedLazarusPlayers.lua +1 -1
  165. package/dist/src/classes/features/other/debugDisplay/DebugDisplayBomb.lua +1 -1
  166. package/dist/src/classes/features/other/debugDisplay/DebugDisplayDoor.lua +1 -1
  167. package/dist/src/classes/features/other/debugDisplay/DebugDisplayEffect.lua +1 -1
  168. package/dist/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.lua +1 -1
  169. package/dist/src/classes/features/other/debugDisplay/DebugDisplayKnife.lua +1 -1
  170. package/dist/src/classes/features/other/debugDisplay/DebugDisplayLaser.lua +1 -1
  171. package/dist/src/classes/features/other/debugDisplay/DebugDisplayNPC.lua +1 -1
  172. package/dist/src/classes/features/other/debugDisplay/DebugDisplayPickup.lua +1 -1
  173. package/dist/src/classes/features/other/debugDisplay/DebugDisplayPit.lua +1 -1
  174. package/dist/src/classes/features/other/debugDisplay/DebugDisplayPlayer.lua +1 -1
  175. package/dist/src/classes/features/other/debugDisplay/DebugDisplayPoop.lua +1 -1
  176. package/dist/src/classes/features/other/debugDisplay/DebugDisplayPressurePlate.lua +1 -1
  177. package/dist/src/classes/features/other/debugDisplay/DebugDisplayProjectile.lua +1 -1
  178. package/dist/src/classes/features/other/debugDisplay/DebugDisplayRock.lua +1 -1
  179. package/dist/src/classes/features/other/debugDisplay/DebugDisplaySlot.lua +1 -1
  180. package/dist/src/classes/features/other/debugDisplay/DebugDisplaySpikes.lua +1 -1
  181. package/dist/src/classes/features/other/debugDisplay/DebugDisplayTNT.lua +1 -1
  182. package/dist/src/classes/features/other/debugDisplay/DebugDisplayTear.lua +1 -1
  183. package/dist/src/classes/private/CustomCallback.d.ts +2 -2
  184. package/dist/src/classes/private/CustomCallback.d.ts.map +1 -1
  185. package/dist/src/classes/private/CustomCallback.lua +7 -10
  186. package/dist/src/functions/array.d.ts +5 -1
  187. package/dist/src/functions/array.d.ts.map +1 -1
  188. package/dist/src/functions/array.lua +17 -8
  189. package/dist/src/functions/decorators.d.ts.map +1 -1
  190. package/dist/src/functions/decorators.lua +12 -22
  191. package/dist/src/functions/direction.d.ts +3 -1
  192. package/dist/src/functions/direction.d.ts.map +1 -1
  193. package/dist/src/functions/direction.lua +10 -0
  194. package/dist/src/functions/logMisc.d.ts +1 -0
  195. package/dist/src/functions/logMisc.d.ts.map +1 -1
  196. package/dist/src/functions/logMisc.lua +2 -1
  197. package/dist/src/objects/directionToMoveAction.d.ts +9 -0
  198. package/dist/src/objects/directionToMoveAction.d.ts.map +1 -0
  199. package/dist/src/objects/directionToMoveAction.lua +12 -0
  200. package/dist/src/objects/directionToShootAction.d.ts +9 -0
  201. package/dist/src/objects/directionToShootAction.d.ts.map +1 -0
  202. package/dist/src/objects/directionToShootAction.lua +12 -0
  203. package/dist/src/types/ModUpgraded.d.ts +1 -1
  204. package/dist/src/types/ModUpgraded.d.ts.map +1 -1
  205. package/dist/src/types/private/CallbackTuple.d.ts +17 -8
  206. package/dist/src/types/private/CallbackTuple.d.ts.map +1 -1
  207. package/package.json +1 -1
  208. package/src/classes/ModFeature.ts +43 -21
  209. package/src/classes/ModUpgradedBase.ts +18 -10
  210. package/src/classes/callbacks/EntityTakeDmgFilter.ts +1 -1
  211. package/src/classes/callbacks/EntityTakeDmgPlayer.ts +2 -1
  212. package/src/classes/callbacks/InputActionFilter.ts +1 -1
  213. package/src/classes/callbacks/InputActionPlayer.ts +1 -1
  214. package/src/classes/callbacks/PostAmbushFinished.ts +1 -1
  215. package/src/classes/callbacks/PostAmbushStarted.ts +1 -1
  216. package/src/classes/callbacks/PostBombExploded.ts +1 -1
  217. package/src/classes/callbacks/PostBombInitLate.ts +1 -1
  218. package/src/classes/callbacks/PostBoneSwing.ts +1 -1
  219. package/src/classes/callbacks/PostCollectibleEmpty.ts +2 -1
  220. package/src/classes/callbacks/PostCollectibleInitFirst.ts +2 -1
  221. package/src/classes/callbacks/PostCursedTeleport.ts +52 -60
  222. package/src/classes/callbacks/PostDiceRoomActivated.ts +2 -1
  223. package/src/classes/callbacks/PostDoorRender.ts +1 -1
  224. package/src/classes/callbacks/PostDoorUpdate.ts +1 -1
  225. package/src/classes/callbacks/PostEffectInitLate.ts +1 -1
  226. package/src/classes/callbacks/PostEffectStateChanged.ts +1 -1
  227. package/src/classes/callbacks/PostFamiliarInitLate.ts +1 -1
  228. package/src/classes/callbacks/PostFamiliarStateChanged.ts +1 -1
  229. package/src/classes/callbacks/PostGreedModeWave.ts +1 -1
  230. package/src/classes/callbacks/PostHolyMantleRemoved.ts +1 -1
  231. package/src/classes/callbacks/PostItemDischarge.ts +3 -2
  232. package/src/classes/callbacks/PostKnifeInitLate.ts +1 -1
  233. package/src/classes/callbacks/PostLaserInitLate.ts +1 -1
  234. package/src/classes/callbacks/PostNPCDeathFilter.ts +1 -1
  235. package/src/classes/callbacks/PostNPCInitFilter.ts +1 -1
  236. package/src/classes/callbacks/PostNPCInitLate.ts +1 -1
  237. package/src/classes/callbacks/PostNPCRenderFilter.ts +1 -1
  238. package/src/classes/callbacks/PostNPCStateChanged.ts +1 -1
  239. package/src/classes/callbacks/PostNPCUpdateFilter.ts +1 -1
  240. package/src/classes/callbacks/PostNewRoomEarly.ts +2 -2
  241. package/src/classes/callbacks/PostPickupCollect.ts +1 -1
  242. package/src/classes/callbacks/PostPickupInitFirst.ts +1 -1
  243. package/src/classes/callbacks/PostPickupInitLate.ts +1 -1
  244. package/src/classes/callbacks/PostPickupStateChanged.ts +1 -1
  245. package/src/classes/callbacks/PostPitRender.ts +1 -1
  246. package/src/classes/callbacks/PostPitUpdate.ts +1 -1
  247. package/src/classes/callbacks/PostPlayerChangeHealth.ts +1 -1
  248. package/src/classes/callbacks/PostPlayerChangeStat.ts +1 -1
  249. package/src/classes/callbacks/PostPlayerChangeType.ts +1 -1
  250. package/src/classes/callbacks/PostPlayerFatalDamage.ts +39 -48
  251. package/src/classes/callbacks/PostPlayerInitFirst.ts +2 -2
  252. package/src/classes/callbacks/PostPlayerInitLate.ts +1 -1
  253. package/src/classes/callbacks/PostPoopRender.ts +1 -1
  254. package/src/classes/callbacks/PostPoopUpdate.ts +1 -1
  255. package/src/classes/callbacks/PostPressurePlateRender.ts +1 -1
  256. package/src/classes/callbacks/PostPressurePlateUpdate.ts +1 -1
  257. package/src/classes/callbacks/PostProjectileInitLate.ts +1 -1
  258. package/src/classes/callbacks/PostPurchase.ts +1 -1
  259. package/src/classes/callbacks/PostRockRender.ts +1 -1
  260. package/src/classes/callbacks/PostRockUpdate.ts +1 -1
  261. package/src/classes/callbacks/PostRoomClearChanged.ts +2 -2
  262. package/src/classes/callbacks/PostSacrifice.ts +5 -20
  263. package/src/classes/callbacks/PostSlotCollision.ts +1 -1
  264. package/src/classes/callbacks/PostSlotDestroyed.ts +3 -2
  265. package/src/classes/callbacks/PostSpikesRender.ts +1 -1
  266. package/src/classes/callbacks/PostSpikesUpdate.ts +1 -1
  267. package/src/classes/callbacks/PostTNTRender.ts +1 -1
  268. package/src/classes/callbacks/PostTNTUpdate.ts +1 -1
  269. package/src/classes/callbacks/PostTearInitLate.ts +1 -1
  270. package/src/classes/callbacks/PostTearInitVeryLate.ts +1 -1
  271. package/src/classes/callbacks/PostTransformation.ts +1 -1
  272. package/src/classes/callbacks/PostTrinketBreak.ts +4 -18
  273. package/src/classes/callbacks/PreBerserkDeath.ts +1 -1
  274. package/src/classes/callbacks/PreGetPedestal.ts +2 -1
  275. package/src/classes/callbacks/PreNPCCollisionFilter.ts +1 -1
  276. package/src/classes/callbacks/PreNPCUpdateFilter.ts +1 -1
  277. package/src/classes/callbacks/PreNewLevel.ts +1 -1
  278. package/src/classes/features/callbackLogic/CustomGridEntities.ts +5 -3
  279. package/src/classes/features/callbackLogic/CustomRevive.ts +19 -18
  280. package/src/classes/features/callbackLogic/EsauJrDetection.ts +6 -2
  281. package/src/classes/features/callbackLogic/FlipDetection.ts +2 -1
  282. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +13 -5
  283. package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +2 -1
  284. package/src/classes/features/callbackLogic/GridEntityRenderDetection.ts +2 -1
  285. package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +3 -2
  286. package/src/classes/features/callbackLogic/ItemPickupDetection.ts +8 -5
  287. package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +67 -71
  288. package/src/classes/features/callbackLogic/PlayerReorderedCallbacks.ts +10 -5
  289. package/src/classes/features/callbackLogic/SlotRenderDetection.ts +2 -1
  290. package/src/classes/features/callbackLogic/SlotUpdateDetection.ts +3 -2
  291. package/src/classes/features/other/CharacterHealthConversion.ts +3 -2
  292. package/src/classes/features/other/CharacterStats.ts +1 -1
  293. package/src/classes/features/other/CollectibleItemPoolType.ts +2 -1
  294. package/src/classes/features/other/CustomHotkeys.ts +1 -1
  295. package/src/classes/features/other/CustomItemPools.ts +1 -1
  296. package/src/classes/features/other/CustomPickups.ts +3 -2
  297. package/src/classes/features/other/CustomStages.ts +7 -6
  298. package/src/classes/features/other/CustomTrapdoors.ts +4 -6
  299. package/src/classes/features/other/DisableAllSound.ts +1 -1
  300. package/src/classes/features/other/DisableInputs.ts +6 -3
  301. package/src/classes/features/other/ExtraConsoleCommands.ts +32 -31
  302. package/src/classes/features/other/FadeInRemover.ts +1 -1
  303. package/src/classes/features/other/FastReset.ts +1 -1
  304. package/src/classes/features/other/ModdedElementDetection.ts +1 -1
  305. package/src/classes/features/other/NoSirenSteal.ts +2 -1
  306. package/src/classes/features/other/Pause.ts +3 -2
  307. package/src/classes/features/other/PersistentEntities.ts +2 -2
  308. package/src/classes/features/other/PickupIndexCreation.ts +3 -2
  309. package/src/classes/features/other/PlayerInventory.ts +2 -2
  310. package/src/classes/features/other/PonyDetection.ts +1 -1
  311. package/src/classes/features/other/PressInput.ts +2 -1
  312. package/src/classes/features/other/PreventChildEntities.ts +1 -1
  313. package/src/classes/features/other/PreventCollectibleRotation.ts +4 -2
  314. package/src/classes/features/other/PreventGridEntityRespawn.ts +3 -2
  315. package/src/classes/features/other/RoomClearFrame.ts +1 -1
  316. package/src/classes/features/other/RoomHistory.ts +1 -1
  317. package/src/classes/features/other/RunInNFrames.ts +2 -2
  318. package/src/classes/features/other/RunNextRoom.ts +1 -1
  319. package/src/classes/features/other/SaveDataManager.ts +6 -5
  320. package/src/classes/features/other/StageHistory.ts +1 -4
  321. package/src/classes/features/other/TaintedLazarusPlayers.ts +1 -1
  322. package/src/classes/features/other/debugDisplay/DebugDisplayBomb.ts +1 -1
  323. package/src/classes/features/other/debugDisplay/DebugDisplayDoor.ts +1 -1
  324. package/src/classes/features/other/debugDisplay/DebugDisplayEffect.ts +1 -1
  325. package/src/classes/features/other/debugDisplay/DebugDisplayFamiliar.ts +1 -1
  326. package/src/classes/features/other/debugDisplay/DebugDisplayKnife.ts +1 -1
  327. package/src/classes/features/other/debugDisplay/DebugDisplayLaser.ts +1 -1
  328. package/src/classes/features/other/debugDisplay/DebugDisplayNPC.ts +1 -1
  329. package/src/classes/features/other/debugDisplay/DebugDisplayPickup.ts +1 -1
  330. package/src/classes/features/other/debugDisplay/DebugDisplayPit.ts +1 -1
  331. package/src/classes/features/other/debugDisplay/DebugDisplayPlayer.ts +1 -1
  332. package/src/classes/features/other/debugDisplay/DebugDisplayPoop.ts +1 -1
  333. package/src/classes/features/other/debugDisplay/DebugDisplayPressurePlate.ts +1 -1
  334. package/src/classes/features/other/debugDisplay/DebugDisplayProjectile.ts +1 -1
  335. package/src/classes/features/other/debugDisplay/DebugDisplayRock.ts +1 -1
  336. package/src/classes/features/other/debugDisplay/DebugDisplaySlot.ts +1 -1
  337. package/src/classes/features/other/debugDisplay/DebugDisplaySpikes.ts +1 -1
  338. package/src/classes/features/other/debugDisplay/DebugDisplayTNT.ts +1 -1
  339. package/src/classes/features/other/debugDisplay/DebugDisplayTear.ts +1 -1
  340. package/src/classes/private/CustomCallback.ts +19 -15
  341. package/src/functions/array.ts +14 -5
  342. package/src/functions/decorators.ts +14 -20
  343. package/src/functions/direction.ts +15 -1
  344. package/src/functions/logMisc.ts +4 -1
  345. package/src/objects/directionToMoveAction.ts +10 -0
  346. package/src/objects/directionToShootAction.ts +10 -0
  347. package/src/types/ModUpgraded.ts +1 -1
  348. package/src/types/private/CallbackTuple.ts +17 -8
  349. package/dist/src/types/private/AllButFirst.d.ts +0 -5
  350. package/dist/src/types/private/AllButFirst.d.ts.map +0 -1
  351. package/dist/src/types/private/AllButFirst.lua +0 -2
  352. package/src/types/private/AllButFirst.ts +0 -6
@@ -405,8 +405,15 @@ export function getRandomArrayIndex<T>(
405
405
  *
406
406
  * - the table contains all numerical indexes that are contiguous, starting at 1
407
407
  * - the table has no keys (i.e. an "empty" table)
408
+ *
409
+ * @param object The object to analyze.
410
+ * @param ensureContiguousValues Optional. Whether or not the Lua table has to have all contiguous
411
+ * keys in order to be considered an array. Default is true.
408
412
  */
409
- export function isArray(object: unknown): object is unknown[] {
413
+ export function isArray(
414
+ object: unknown,
415
+ ensureContiguousValues = true,
416
+ ): object is unknown[] {
410
417
  if (!isTable(object)) {
411
418
  return false;
412
419
  }
@@ -431,10 +438,12 @@ export function isArray(object: unknown): object is unknown[] {
431
438
  }
432
439
 
433
440
  // Fourth, check for non-contiguous elements. (Lua tables start at an index of 1.)
434
- for (let i = 1; i <= keys.length; i++) {
435
- const element = object.get(i);
436
- if (element === undefined) {
437
- return false;
441
+ if (ensureContiguousValues) {
442
+ for (let i = 1; i <= keys.length; i++) {
443
+ const element = object.get(i);
444
+ if (element === undefined) {
445
+ return false;
446
+ }
438
447
  }
439
448
  }
440
449
 
@@ -22,9 +22,9 @@
22
22
 
23
23
  import { ModCallback } from "isaac-typescript-definitions";
24
24
  import {
25
- ADD_CALLBACK_ARGS_KEY,
26
- ADD_CALLBACK_CUSTOM_ARGS_KEY,
27
25
  ModFeature,
26
+ MOD_FEATURE_CALLBACKS_KEY,
27
+ MOD_FEATURE_CUSTOM_CALLBACKS_KEY,
28
28
  } from "../classes/ModFeature";
29
29
  import { ModCallbackCustom } from "../enums/ModCallbackCustom";
30
30
  import { AddCallbackParametersCustom } from "../interfaces/private/AddCallbackParametersCustom";
@@ -50,11 +50,7 @@ export function Callback<T extends ModCallback>(
50
50
  // First, prepare the arguments for the `Mod.AddCallback` method.
51
51
  const methodName = propertyKey as keyof Class;
52
52
  const method = target[methodName] as AddCallbackParameters[T][0];
53
- const addCallbackArgs = [
54
- modCallback,
55
- method,
56
- ...optionalArgs,
57
- ] as unknown as AddCallbackParameters[T];
53
+ const callbackTuple = [modCallback, method, optionalArgs];
58
54
 
59
55
  // Since the decorator runs prior to instantiation, we only have access to get and set static
60
56
  // properties, which are located on the "constructor" table. Thus, we store the callback
@@ -70,12 +66,14 @@ export function Callback<T extends ModCallback>(
70
66
  );
71
67
  }
72
68
 
73
- if (!constructor.has(ADD_CALLBACK_ARGS_KEY)) {
74
- constructor.set(ADD_CALLBACK_ARGS_KEY, []);
69
+ if (!constructor.has(MOD_FEATURE_CALLBACKS_KEY)) {
70
+ constructor.set(MOD_FEATURE_CALLBACKS_KEY, []);
75
71
  }
76
72
 
77
- const callbackTuples = constructor.get(ADD_CALLBACK_ARGS_KEY) as unknown[];
78
- callbackTuples.push(addCallbackArgs);
73
+ const callbackTuples = constructor.get(
74
+ MOD_FEATURE_CALLBACKS_KEY,
75
+ ) as unknown[];
76
+ callbackTuples.push(callbackTuple);
79
77
  };
80
78
  }
81
79
 
@@ -101,11 +99,7 @@ export function CallbackCustom<T extends ModCallbackCustom>(
101
99
  // First, prepare the arguments for the `Mod.AddCallbackCustom` method.
102
100
  const methodName = propertyKey as keyof Class;
103
101
  const method = target[methodName] as AddCallbackParametersCustom[T][0];
104
- const addCallbackArgs = [
105
- modCallbackCustom,
106
- method,
107
- ...optionalArgs,
108
- ] as unknown as AddCallbackParametersCustom[T];
102
+ const callbackTuple: unknown[] = [modCallbackCustom, method, optionalArgs];
109
103
 
110
104
  // Since the decorator runs prior to instantiation, we only have access to get and set static
111
105
  // properties, which are located on the "constructor" table. Thus, we store the callback
@@ -121,13 +115,13 @@ export function CallbackCustom<T extends ModCallbackCustom>(
121
115
  );
122
116
  }
123
117
 
124
- if (!constructor.has(ADD_CALLBACK_CUSTOM_ARGS_KEY)) {
125
- constructor.set(ADD_CALLBACK_CUSTOM_ARGS_KEY, []);
118
+ if (!constructor.has(MOD_FEATURE_CUSTOM_CALLBACKS_KEY)) {
119
+ constructor.set(MOD_FEATURE_CUSTOM_CALLBACKS_KEY, []);
126
120
  }
127
121
 
128
122
  const callbackTuples = constructor.get(
129
- ADD_CALLBACK_CUSTOM_ARGS_KEY,
123
+ MOD_FEATURE_CUSTOM_CALLBACKS_KEY,
130
124
  ) as unknown[];
131
- callbackTuples.push(addCallbackArgs);
125
+ callbackTuples.push(callbackTuple);
132
126
  };
133
127
  }
@@ -1,6 +1,8 @@
1
- import { Direction } from "isaac-typescript-definitions";
1
+ import { ButtonAction, Direction } from "isaac-typescript-definitions";
2
2
  import { DIRECTION_NAMES } from "../objects/directionNames";
3
3
  import { DIRECTION_TO_DEGREES } from "../objects/directionToDegrees";
4
+ import { DIRECTION_TO_MOVE_ACTION } from "../objects/directionToMoveAction";
5
+ import { DIRECTION_TO_SHOOT_ACTION } from "../objects/directionToShootAction";
4
6
  import { DIRECTION_TO_VECTOR } from "../objects/directionToVector";
5
7
 
6
8
  /**
@@ -40,6 +42,18 @@ export function directionToDegrees(direction: Direction): int {
40
42
  return DIRECTION_TO_DEGREES[direction];
41
43
  }
42
44
 
45
+ export function directionToMoveAction(
46
+ direction: Direction,
47
+ ): ButtonAction | undefined {
48
+ return DIRECTION_TO_MOVE_ACTION[direction];
49
+ }
50
+
51
+ export function directionToShootAction(
52
+ direction: Direction,
53
+ ): ButtonAction | undefined {
54
+ return DIRECTION_TO_SHOOT_ACTION[direction];
55
+ }
56
+
43
57
  export function directionToVector(direction: Direction): Readonly<Vector> {
44
58
  return DIRECTION_TO_VECTOR[direction];
45
59
  }
@@ -31,8 +31,11 @@ import { isTable, isUserdata } from "./types";
31
31
  import { printConsole } from "./utils";
32
32
  import { vectorToString } from "./vector";
33
33
 
34
+ /** Helper function to enumerate all of the values in an array. */
34
35
  export function logArray<T>(array: T[] | readonly T[]): void {
35
- if (!isArray(array)) {
36
+ // We do not assume the given array has contiguous values in order to be more permissive about the
37
+ // kinds of arrays that will successfully log without a run-time error.
38
+ if (!isArray(array, false)) {
36
39
  log("Tried to log an array, but the given object was not an array.");
37
40
  return;
38
41
  }
@@ -0,0 +1,10 @@
1
+ import { ButtonAction, Direction } from "isaac-typescript-definitions";
2
+ import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
3
+
4
+ export const DIRECTION_TO_MOVE_ACTION = {
5
+ [Direction.NO_DIRECTION]: undefined, // -1
6
+ [Direction.LEFT]: ButtonAction.LEFT, // 0
7
+ [Direction.UP]: ButtonAction.UP, // 1
8
+ [Direction.RIGHT]: ButtonAction.RIGHT, // 2
9
+ [Direction.DOWN]: ButtonAction.DOWN, // 3
10
+ } as const satisfies HasAllEnumKeys<Direction, ButtonAction | undefined>;
@@ -0,0 +1,10 @@
1
+ import { ButtonAction, Direction } from "isaac-typescript-definitions";
2
+ import { HasAllEnumKeys } from "../types/HasAllEnumKeys";
3
+
4
+ export const DIRECTION_TO_SHOOT_ACTION = {
5
+ [Direction.NO_DIRECTION]: undefined, // -1
6
+ [Direction.LEFT]: ButtonAction.SHOOT_LEFT, // 0
7
+ [Direction.UP]: ButtonAction.SHOOT_UP, // 1
8
+ [Direction.RIGHT]: ButtonAction.SHOOT_RIGHT, // 2
9
+ [Direction.DOWN]: ButtonAction.SHOOT_DOWN, // 3
10
+ } as const satisfies HasAllEnumKeys<Direction, ButtonAction | undefined>;
@@ -33,5 +33,5 @@ type ISCFeaturesToKeys<T extends readonly ISCFeature[]> = Omit<
33
33
  * same private fields will cause a `never` type.
34
34
  */
35
35
  type ISCFeatureTupleToClassTuple<T extends ISCFeature[]> = {
36
- [K in keyof T]: PublicInterface<ISCFeatureToClass[T[K]]>;
36
+ [Key in keyof T]: PublicInterface<ISCFeatureToClass[T[Key]]>;
37
37
  };
@@ -1,21 +1,30 @@
1
1
  import { ModCallback } from "isaac-typescript-definitions";
2
2
  import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
3
  import { AddCallbackParametersCustom } from "../../interfaces/private/AddCallbackParametersCustom";
4
+ import { AllButFirst } from "../AllButFirst";
4
5
 
5
6
  /**
6
- * A mapping of the callback enum to the associated callback functions (and optional arguments).
7
- * This is so that the respective callback functions can be added/removed on demand as subscribers
8
- * get added/removed.
7
+ * A mapping of the callback enum to the associated callback function and optional arguments. This
8
+ * is so that the respective callback functions can be added/removed on demand as subscribers get
9
+ * added/removed.
9
10
  */
10
11
  export type CallbackTuple = {
11
- [K in ModCallback]: [K, AddCallbackParameters[K]];
12
+ [Key in ModCallback]: [
13
+ modCallback: Key,
14
+ callbackFunc: AddCallbackParameters[Key][0],
15
+ optionalArgs?: AllButFirst<AddCallbackParameters[Key]>,
16
+ ];
12
17
  }[ModCallback];
13
18
 
14
19
  /**
15
- * A mapping of the custom callback enum to the associated callback functions (and optional
16
- * arguments). This is so that the respective callback functions can be added/removed on demand as
17
- * subscribers get added/removed.
20
+ * A mapping of the custom callback enum to the associated callback function and optional arguments.
21
+ * This is so that the respective callback functions can be added/removed on demand as subscribers
22
+ * get added/removed.
18
23
  */
19
24
  export type CustomCallbackTuple = {
20
- [K in ModCallbackCustom]: [K, AddCallbackParametersCustom[K]];
25
+ [Key in ModCallbackCustom]: [
26
+ modCallback: Key,
27
+ callbackFunc: AddCallbackParametersCustom[Key][0],
28
+ optionalArgs?: AllButFirst<AddCallbackParametersCustom[Key]>,
29
+ ];
21
30
  }[ModCallbackCustom];
@@ -1,5 +0,0 @@
1
- export type AllButFirst<T extends unknown[]> = T extends [
2
- unknown,
3
- ...infer Tail
4
- ] ? Tail : unknown[];
5
- //# sourceMappingURL=AllButFirst.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AllButFirst.d.ts","sourceRoot":"","sources":["../../../../src/types/private/AllButFirst.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS;IACvD,OAAO;IACP,GAAG,MAAM,IAAI;CACd,GACG,IAAI,GACJ,OAAO,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- local ____exports = {}
2
- return ____exports
@@ -1,6 +0,0 @@
1
- export type AllButFirst<T extends unknown[]> = T extends [
2
- unknown,
3
- ...infer Tail,
4
- ]
5
- ? Tail
6
- : unknown[];