isaacscript-common 2.3.2 → 3.1.1

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 (337) hide show
  1. package/cachedClasses.d.ts +6 -4
  2. package/cachedClasses.lua +24 -0
  3. package/callbacks/customRevive.lua +2 -0
  4. package/callbacks/itemPickup.lua +2 -0
  5. package/callbacks/postBombInitLate.lua +2 -0
  6. package/callbacks/postBoneSwing.lua +2 -0
  7. package/callbacks/postCollectibleInitFirst.lua +2 -0
  8. package/callbacks/postCursedTeleport.lua +2 -0
  9. package/callbacks/postCustomDoorEnter.lua +44 -0
  10. package/callbacks/postDoorRender.lua +2 -0
  11. package/callbacks/postDoorUpdate.lua +2 -0
  12. package/callbacks/postEffectInitLate.lua +2 -0
  13. package/callbacks/postEffectStateChanged.lua +2 -0
  14. package/callbacks/postEsauJr.lua +2 -0
  15. package/callbacks/postFamiliarInitLate.lua +2 -0
  16. package/callbacks/postFamiliarStateChanged.lua +2 -0
  17. package/callbacks/postFlip.lua +2 -0
  18. package/callbacks/postGreedModeWave.lua +2 -0
  19. package/callbacks/postGridEntity.lua +2 -0
  20. package/callbacks/postGridEntityCollision.lua +2 -0
  21. package/callbacks/postGridEntityRender.lua +2 -0
  22. package/callbacks/postHolyMantleRemoved.lua +2 -0
  23. package/callbacks/postKnifeInitLate.lua +2 -0
  24. package/callbacks/postLaserInitLate.lua +2 -0
  25. package/callbacks/postNPCInitLate.lua +2 -0
  26. package/callbacks/postNPCStateChanged.lua +2 -0
  27. package/callbacks/postNewRoomEarly.lua +2 -0
  28. package/callbacks/postPickupCollect.lua +2 -0
  29. package/callbacks/postPickupInitFirst.d.ts +1 -0
  30. package/callbacks/postPickupInitFirst.lua +55 -0
  31. package/callbacks/postPickupInitLate.lua +2 -0
  32. package/callbacks/postPickupStateChanged.lua +2 -0
  33. package/callbacks/postPitRender.lua +2 -0
  34. package/callbacks/postPitUpdate.lua +2 -0
  35. package/callbacks/postPlayerChangeHealth.lua +2 -0
  36. package/callbacks/postPlayerChangeType.lua +2 -0
  37. package/callbacks/postPlayerFatalDamage.lua +2 -0
  38. package/callbacks/postPlayerInitLate.lua +2 -0
  39. package/callbacks/postPlayerReordered.lua +2 -0
  40. package/callbacks/postPoopRender.lua +2 -0
  41. package/callbacks/postPoopUpdate.lua +2 -0
  42. package/callbacks/postPressurePlateRender.lua +2 -0
  43. package/callbacks/postPressurePlateUpdate.lua +2 -0
  44. package/callbacks/postProjectileInitLate.lua +2 -0
  45. package/callbacks/postPurchase.lua +2 -0
  46. package/callbacks/postRockRender.lua +2 -0
  47. package/callbacks/postRockUpdate.lua +2 -0
  48. package/callbacks/postRoomClearChanged.lua +2 -0
  49. package/callbacks/postSacrifice.lua +2 -0
  50. package/callbacks/postSlotDestroyed.d.ts +1 -0
  51. package/callbacks/postSlotDestroyed.lua +66 -0
  52. package/callbacks/postSlotInitUpdate.lua +2 -0
  53. package/callbacks/postSlotRender.lua +5 -21
  54. package/callbacks/postSpikesRender.lua +2 -0
  55. package/callbacks/postSpikesUpdate.lua +2 -0
  56. package/callbacks/postTNTRender.lua +2 -0
  57. package/callbacks/postTNTUpdate.lua +2 -0
  58. package/callbacks/postTearInitLate.lua +2 -0
  59. package/callbacks/postTearInitVeryLate.lua +2 -0
  60. package/callbacks/postTransformation.lua +2 -0
  61. package/callbacks/postTrinketBreak.lua +2 -0
  62. package/callbacks/preBerserkDeath.lua +2 -0
  63. package/callbacks/preNewLevel.lua +2 -0
  64. package/callbacks/reorderedCallbacks.lua +16 -0
  65. package/callbacks/subscriptions/postBombInitLate.lua +6 -0
  66. package/callbacks/subscriptions/postBoneSwing.lua +6 -0
  67. package/callbacks/subscriptions/postCollectibleInitFirst.lua +6 -0
  68. package/callbacks/subscriptions/postCursedTeleport.lua +6 -0
  69. package/callbacks/subscriptions/postCustomDoorEnter.lua +6 -0
  70. package/callbacks/subscriptions/postCustomRevive.d.ts +1 -0
  71. package/callbacks/subscriptions/postCustomRevive.lua +6 -0
  72. package/callbacks/subscriptions/postDoorRender.d.ts +1 -0
  73. package/callbacks/subscriptions/postDoorRender.lua +6 -0
  74. package/callbacks/subscriptions/postDoorUpdate.d.ts +1 -0
  75. package/callbacks/subscriptions/postDoorUpdate.lua +6 -0
  76. package/callbacks/subscriptions/postEffectInitLate.lua +6 -0
  77. package/callbacks/subscriptions/postEffectStateChanged.lua +6 -0
  78. package/callbacks/subscriptions/postEsauJr.lua +6 -0
  79. package/callbacks/subscriptions/postFamiliarInitLate.lua +6 -0
  80. package/callbacks/subscriptions/postFamiliarStateChanged.lua +6 -0
  81. package/callbacks/subscriptions/postFirstEsauJr.lua +6 -0
  82. package/callbacks/subscriptions/postFirstFlip.lua +6 -0
  83. package/callbacks/subscriptions/postFlip.lua +6 -0
  84. package/callbacks/subscriptions/postGameStartedReordered.lua +6 -0
  85. package/callbacks/subscriptions/postGreedModeWave.lua +6 -0
  86. package/callbacks/subscriptions/postGridEntityBroken.lua +6 -0
  87. package/callbacks/subscriptions/postGridEntityCollision.lua +6 -0
  88. package/callbacks/subscriptions/postGridEntityInit.lua +6 -0
  89. package/callbacks/subscriptions/postGridEntityRemove.lua +6 -0
  90. package/callbacks/subscriptions/postGridEntityRender.lua +6 -0
  91. package/callbacks/subscriptions/postGridEntityStateChanged.lua +6 -0
  92. package/callbacks/subscriptions/postGridEntityUpdate.lua +6 -0
  93. package/callbacks/subscriptions/postHolyMantleRemoved.lua +6 -0
  94. package/callbacks/subscriptions/postItemDischarged.lua +6 -0
  95. package/callbacks/subscriptions/postItemPickup.lua +6 -0
  96. package/callbacks/subscriptions/postKnifeInitLate.lua +6 -0
  97. package/callbacks/subscriptions/postLaserInitLate.lua +6 -0
  98. package/callbacks/subscriptions/postNPCInitLate.lua +6 -0
  99. package/callbacks/subscriptions/postNPCStateChanged.lua +6 -0
  100. package/callbacks/subscriptions/postNewLevelReordered.lua +6 -0
  101. package/callbacks/subscriptions/postNewRoomEarly.lua +6 -0
  102. package/callbacks/subscriptions/postNewRoomReordered.lua +6 -0
  103. package/callbacks/subscriptions/postPEffectUpdateReordered.lua +6 -0
  104. package/callbacks/subscriptions/postPickupCollect.d.ts +1 -0
  105. package/callbacks/subscriptions/postPickupCollect.lua +6 -0
  106. package/callbacks/subscriptions/postPickupInitFirst.d.ts +3 -0
  107. package/callbacks/subscriptions/postPickupInitFirst.lua +29 -0
  108. package/callbacks/subscriptions/postPickupInitLate.lua +6 -0
  109. package/callbacks/subscriptions/postPickupStateChanged.d.ts +1 -0
  110. package/callbacks/subscriptions/postPickupStateChanged.lua +6 -0
  111. package/callbacks/subscriptions/postPitRender.d.ts +1 -0
  112. package/callbacks/subscriptions/postPitRender.lua +6 -0
  113. package/callbacks/subscriptions/postPitUpdate.d.ts +1 -0
  114. package/callbacks/subscriptions/postPitUpdate.lua +6 -0
  115. package/callbacks/subscriptions/postPlayerChangeHealth.lua +6 -0
  116. package/callbacks/subscriptions/postPlayerChangeType.lua +6 -0
  117. package/callbacks/subscriptions/postPlayerFatalDamage.lua +6 -0
  118. package/callbacks/subscriptions/postPlayerInitLate.lua +6 -0
  119. package/callbacks/subscriptions/postPlayerInitReordered.lua +6 -0
  120. package/callbacks/subscriptions/postPlayerRenderReordered.lua +6 -0
  121. package/callbacks/subscriptions/postPlayerUpdateReordered.lua +6 -0
  122. package/callbacks/subscriptions/postPoopRender.d.ts +1 -0
  123. package/callbacks/subscriptions/postPoopRender.lua +6 -0
  124. package/callbacks/subscriptions/postPoopUpdate.d.ts +1 -0
  125. package/callbacks/subscriptions/postPoopUpdate.lua +6 -0
  126. package/callbacks/subscriptions/postPressurePlateRender.d.ts +1 -0
  127. package/callbacks/subscriptions/postPressurePlateRender.lua +6 -0
  128. package/callbacks/subscriptions/postPressurePlateUpdate.d.ts +1 -0
  129. package/callbacks/subscriptions/postPressurePlateUpdate.lua +6 -0
  130. package/callbacks/subscriptions/postProjectileInitLate.lua +6 -0
  131. package/callbacks/subscriptions/postPurchase.lua +6 -0
  132. package/callbacks/subscriptions/postRockRender.d.ts +1 -0
  133. package/callbacks/subscriptions/postRockRender.lua +6 -0
  134. package/callbacks/subscriptions/postRockUpdate.d.ts +1 -0
  135. package/callbacks/subscriptions/postRockUpdate.lua +6 -0
  136. package/callbacks/subscriptions/postRoomClearChanged.lua +6 -0
  137. package/callbacks/subscriptions/postSacrifice.lua +6 -0
  138. package/callbacks/subscriptions/postSlotAnimationChanged.lua +6 -0
  139. package/callbacks/subscriptions/postSlotDestroyed.lua +6 -0
  140. package/callbacks/subscriptions/postSlotInit.lua +6 -0
  141. package/callbacks/subscriptions/postSlotRender.lua +6 -0
  142. package/callbacks/subscriptions/postSlotUpdate.lua +6 -0
  143. package/callbacks/subscriptions/postSpikesRender.d.ts +1 -0
  144. package/callbacks/subscriptions/postSpikesRender.lua +6 -0
  145. package/callbacks/subscriptions/postSpikesUpdate.d.ts +1 -0
  146. package/callbacks/subscriptions/postSpikesUpdate.lua +6 -0
  147. package/callbacks/subscriptions/postTNTRender.d.ts +1 -0
  148. package/callbacks/subscriptions/postTNTRender.lua +6 -0
  149. package/callbacks/subscriptions/postTNTUpdate.d.ts +1 -0
  150. package/callbacks/subscriptions/postTNTUpdate.lua +6 -0
  151. package/callbacks/subscriptions/postTearInitLate.lua +6 -0
  152. package/callbacks/subscriptions/postTearInitVeryLate.lua +6 -0
  153. package/callbacks/subscriptions/postTransformation.lua +6 -0
  154. package/callbacks/subscriptions/postTrinketBreak.lua +6 -0
  155. package/callbacks/subscriptions/preBerserkDeath.lua +6 -0
  156. package/callbacks/subscriptions/preCustomRevive.lua +6 -0
  157. package/callbacks/subscriptions/preItemPickup.lua +6 -0
  158. package/callbacks/subscriptions/preNewLevel.lua +6 -0
  159. package/classes/DefaultMap.d.ts +70 -39
  160. package/classes/DefaultMap.lua +94 -43
  161. package/classes/ModUpgraded.d.ts +3 -3
  162. package/classes/ModUpgraded.lua +5 -0
  163. package/constants.lua +41 -0
  164. package/constantsFirstLast.lua +63 -0
  165. package/enums/HealthType.lua +3 -0
  166. package/enums/ModCallbackCustom.d.ts +62 -40
  167. package/enums/ModCallbackCustom.lua +46 -38
  168. package/enums/private/CopyableIsaacAPIClassType.lua +1 -0
  169. package/enums/private/SerializationBrand.lua +5 -0
  170. package/features/characterHealthConversion.lua +6 -0
  171. package/features/characterStats.lua +17 -0
  172. package/features/debugDisplay/exports.d.ts +17 -0
  173. package/features/debugDisplay/exports.lua +90 -0
  174. package/features/debugDisplay/v.d.ts +17 -0
  175. package/features/deployJSONRoom.d.ts +1 -0
  176. package/features/deployJSONRoom.lua +56 -0
  177. package/features/disableInputs.lua +45 -0
  178. package/features/disableSound.lua +14 -0
  179. package/features/extraConsoleCommands/commandsDisplay.lua +90 -0
  180. package/features/extraConsoleCommands/init.lua +16 -0
  181. package/features/extraConsoleCommands/listCommands.lua +172 -0
  182. package/features/fadeInRemover.lua +10 -0
  183. package/features/fastReset.lua +10 -0
  184. package/features/forgottenSwitch.lua +4 -0
  185. package/features/getCollectibleItemPoolType.lua +5 -0
  186. package/features/playerInventory.lua +18 -0
  187. package/features/ponyDetection.lua +4 -0
  188. package/features/preventCollectibleRotation.lua +9 -0
  189. package/features/runInNFrames.lua +50 -0
  190. package/features/saveDataManager/constants.lua +1 -0
  191. package/features/saveDataManager/exports.lua +115 -0
  192. package/features/saveDataManager/load.lua +12 -8
  193. package/features/saveDataManager/main.lua +16 -3
  194. package/features/saveDataManager/maps.lua +3 -0
  195. package/features/saveDataManager/merge.lua +53 -21
  196. package/features/saveDataManager/save.lua +12 -7
  197. package/features/sirenHelpers.lua +13 -0
  198. package/features/taintedLazarusPlayers.lua +11 -0
  199. package/featuresInitialized.lua +6 -0
  200. package/functions/array.d.ts +2 -0
  201. package/functions/array.lua +85 -0
  202. package/functions/benchmark.lua +6 -0
  203. package/functions/bombs.d.ts +3 -0
  204. package/functions/bombs.lua +12 -0
  205. package/functions/boss.lua +35 -0
  206. package/functions/cacheFlag.lua +4 -0
  207. package/functions/cards.lua +60 -0
  208. package/functions/challenges.lua +1 -0
  209. package/functions/character.lua +23 -0
  210. package/functions/charge.lua +39 -0
  211. package/functions/chargeBar.d.ts +1 -0
  212. package/functions/chargeBar.lua +4 -0
  213. package/functions/collectibleCacheFlag.lua +15 -0
  214. package/functions/collectibleSet.lua +3 -0
  215. package/functions/collectibleTag.lua +9 -0
  216. package/functions/collectibles.d.ts +13 -8
  217. package/functions/collectibles.lua +147 -3
  218. package/functions/color.lua +18 -0
  219. package/functions/debug.lua +18 -0
  220. package/functions/deepCopy.lua +60 -26
  221. package/functions/deepCopyTests.lua +8 -5
  222. package/functions/direction.d.ts +8 -0
  223. package/functions/direction.lua +27 -0
  224. package/functions/doors.d.ts +1 -0
  225. package/functions/doors.lua +58 -0
  226. package/functions/entity.d.ts +4 -4
  227. package/functions/entity.lua +94 -6
  228. package/functions/entitySpecific.d.ts +20 -20
  229. package/functions/entitySpecific.lua +182 -0
  230. package/functions/entityTypes.d.ts +1 -1
  231. package/functions/entityTypes.lua +1 -0
  232. package/functions/enums.d.ts +2 -0
  233. package/functions/enums.lua +62 -0
  234. package/functions/familiars.lua +52 -0
  235. package/functions/flag.lua +77 -0
  236. package/functions/flying.lua +10 -0
  237. package/functions/globals.lua +8 -10
  238. package/functions/gridEntity.lua +105 -0
  239. package/functions/gridEntitySpecific.d.ts +5 -0
  240. package/functions/gridEntitySpecific.lua +8 -0
  241. package/functions/input.lua +11 -0
  242. package/functions/isaacAPIClass.d.ts +4 -4
  243. package/functions/isaacAPIClass.lua +15 -3
  244. package/functions/jsonHelpers.lua +11 -0
  245. package/functions/jsonRoom.d.ts +2 -0
  246. package/functions/jsonRoom.lua +5 -0
  247. package/functions/kColor.lua +9 -0
  248. package/functions/language.lua +5 -0
  249. package/functions/log.lua +31 -3
  250. package/functions/map.lua +18 -0
  251. package/functions/math.lua +26 -0
  252. package/functions/npc.lua +24 -0
  253. package/functions/pickupVariants.d.ts +11 -11
  254. package/functions/pickupVariants.lua +11 -0
  255. package/functions/pickups.d.ts +9 -9
  256. package/functions/pickups.lua +67 -0
  257. package/functions/pills.lua +45 -0
  258. package/functions/player.d.ts +7 -0
  259. package/functions/player.lua +210 -9
  260. package/functions/playerDataStructures.lua +65 -0
  261. package/functions/playerHealth.d.ts +3 -0
  262. package/functions/playerHealth.lua +92 -63
  263. package/functions/playerIndex.d.ts +2 -0
  264. package/functions/playerIndex.lua +47 -0
  265. package/functions/pocketItems.lua +18 -0
  266. package/functions/positionVelocity.d.ts +3 -0
  267. package/functions/positionVelocity.lua +46 -0
  268. package/functions/random.d.ts +2 -0
  269. package/functions/random.lua +32 -0
  270. package/functions/revive.d.ts +2 -0
  271. package/functions/revive.lua +15 -0
  272. package/functions/rng.d.ts +1 -0
  273. package/functions/rng.lua +19 -0
  274. package/functions/roomData.lua +68 -0
  275. package/functions/roomGrid.lua +21 -0
  276. package/functions/roomShape.lua +22 -0
  277. package/functions/rooms.lua +100 -0
  278. package/functions/run.lua +5 -0
  279. package/functions/seeds.lua +4 -0
  280. package/functions/serialization.lua +6 -2
  281. package/functions/set.d.ts +1 -0
  282. package/functions/set.lua +22 -0
  283. package/functions/spawnCollectible.lua +24 -0
  284. package/functions/sprite.d.ts +2 -0
  285. package/functions/sprite.lua +25 -0
  286. package/functions/stage.lua +16 -0
  287. package/functions/string.lua +6 -0
  288. package/functions/table.d.ts +12 -0
  289. package/functions/table.lua +53 -0
  290. package/functions/tears.d.ts +1 -0
  291. package/functions/tears.lua +12 -0
  292. package/functions/transformations.lua +18 -0
  293. package/functions/trinketCacheFlag.lua +3 -0
  294. package/functions/trinketGive.lua +24 -0
  295. package/functions/trinkets.lua +52 -0
  296. package/functions/tstlClass.d.ts +34 -0
  297. package/functions/tstlClass.lua +63 -9
  298. package/functions/ui.d.ts +2 -0
  299. package/functions/ui.lua +16 -0
  300. package/functions/utils.d.ts +16 -0
  301. package/functions/utils.lua +108 -0
  302. package/functions/vector.lua +13 -16
  303. package/index.d.ts +1 -0
  304. package/index.lua +8 -0
  305. package/initCustomCallbacks.lua +6 -0
  306. package/interfaces/AddCallbackParameterCustom.d.ts +2 -0
  307. package/interfaces/ChargeBarSprites.d.ts +1 -0
  308. package/interfaces/private/TSTLClassMetatable.d.ts +2 -0
  309. package/lualib_bundle.lua +21 -34
  310. package/maps/cardMap.lua +1 -0
  311. package/maps/characterMap.lua +1 -0
  312. package/maps/defaultPlayerStatMap.lua +1 -0
  313. package/maps/gridEntityXMLMap.lua +2 -0
  314. package/maps/pillEffectMap.lua +1 -0
  315. package/maps/roomShapeToTopLeftWallGridIndexMap.lua +2 -0
  316. package/maps/roomTypeMap.lua +1 -0
  317. package/objects/LRoomShapeToRectangles.lua +2 -0
  318. package/objects/callbackRegisterFunctions.lua +3 -0
  319. package/objects/colors.lua +4 -0
  320. package/objects/oppositeDoorSlots.d.ts +4 -0
  321. package/objects/oppositeDoorSlots.lua +15 -0
  322. package/objects/roomShapeBounds.lua +2 -0
  323. package/objects/roomShapeLayoutSizes.lua +4 -0
  324. package/objects/roomShapeToBottomRightPosition.lua +2 -0
  325. package/objects/roomShapeToDoorSlotsToGridIndexDelta.lua +2 -0
  326. package/objects/roomShapeToTopLeftPosition.lua +2 -0
  327. package/objects/roomShapeVolumes.lua +3 -0
  328. package/package.json +2 -2
  329. package/patchErrorFunctions.lua +8 -0
  330. package/sets/bossSets.lua +23 -0
  331. package/sets/charactersWithNoRedHeartsSet.lua +2 -0
  332. package/sets/charactersWithNoSoulHeartsSet.lua +2 -0
  333. package/sets/lostStyleCharactersSet.lua +2 -0
  334. package/types/AnyEntity.d.ts +10 -0
  335. package/types/PickingUpItem.lua +7 -0
  336. package/upgradeMod.d.ts +4 -4
  337. package/upgradeMod.lua +18 -0
@@ -4,6 +4,8 @@ local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
4
4
  local ____constants = require("constants")
5
5
  local VectorZero = ____constants.VectorZero
6
6
  local TWO_BY_TWO_BOTTOM_RIGHT = Vector(25, 13)
7
+ --- "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
8
+ -- wall would be at "Vector(-1, -1)".)
7
9
  ____exports.L_ROOM_SHAPE_TO_RECTANGLES = {
8
10
  [RoomShape.LTL] = {
9
11
  Vector(13, 0),
@@ -73,6 +73,8 @@ local ____postPEffectUpdateReordered = require("callbacks.subscriptions.postPEff
73
73
  local postPEffectUpdateReorderedRegister = ____postPEffectUpdateReordered.postPEffectUpdateReorderedRegister
74
74
  local ____postPickupCollect = require("callbacks.subscriptions.postPickupCollect")
75
75
  local postPickupCollectRegister = ____postPickupCollect.postPickupCollectRegister
76
+ local ____postPickupInitFirst = require("callbacks.subscriptions.postPickupInitFirst")
77
+ local postPickupInitFirstRegister = ____postPickupInitFirst.postPickupInitFirstRegister
76
78
  local ____postPickupInitLate = require("callbacks.subscriptions.postPickupInitLate")
77
79
  local postPickupInitLateRegister = ____postPickupInitLate.postPickupInitLateRegister
78
80
  local ____postPickupStateChanged = require("callbacks.subscriptions.postPickupStateChanged")
@@ -189,6 +191,7 @@ ____exports.CALLBACK_REGISTER_FUNCTIONS = {
189
191
  [ModCallbackCustom.POST_NPC_STATE_CHANGED] = postNPCStateChangedRegister,
190
192
  [ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED] = postPEffectUpdateReorderedRegister,
191
193
  [ModCallbackCustom.POST_PICKUP_COLLECT] = postPickupCollectRegister,
194
+ [ModCallbackCustom.POST_PICKUP_INIT_FIRST] = postPickupInitFirstRegister,
192
195
  [ModCallbackCustom.POST_PICKUP_INIT_LATE] = postPickupInitLateRegister,
193
196
  [ModCallbackCustom.POST_PICKUP_STATE_CHANGED] = postPickupStateChangedRegister,
194
197
  [ModCallbackCustom.POST_PIT_RENDER] = postPitRenderRegister,
@@ -1,4 +1,8 @@
1
1
  local ____exports = {}
2
+ --- A collection of common colors that can be reused.
3
+ --
4
+ -- Note that if you want to further modify these colors, you should copy them first with the
5
+ -- `copyColor` function.
2
6
  ____exports.COLORS = {
3
7
  Black = Color(1, 1, 1),
4
8
  Red = Color(1, 0, 0),
@@ -0,0 +1,4 @@
1
+ import { DoorSlot } from "isaac-typescript-definitions";
2
+ export declare const OPPOSITE_DOOR_SLOTS: {
3
+ readonly [key in DoorSlot]: DoorSlot | undefined;
4
+ };
@@ -0,0 +1,15 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
4
+ ____exports.OPPOSITE_DOOR_SLOTS = {
5
+ [DoorSlot.NO_DOOR_SLOT] = nil,
6
+ [DoorSlot.LEFT_0] = DoorSlot.RIGHT_0,
7
+ [DoorSlot.UP_0] = DoorSlot.DOWN_0,
8
+ [DoorSlot.RIGHT_0] = DoorSlot.LEFT_0,
9
+ [DoorSlot.LEFT_1] = DoorSlot.RIGHT_1,
10
+ [DoorSlot.DOWN_0] = DoorSlot.UP_0,
11
+ [DoorSlot.UP_1] = DoorSlot.DOWN_1,
12
+ [DoorSlot.RIGHT_1] = DoorSlot.LEFT_1,
13
+ [DoorSlot.DOWN_1] = DoorSlot.UP_1
14
+ }
15
+ return ____exports
@@ -7,6 +7,8 @@ local NARROW_CONTENTS_WIDTH = ____roomShapeVolumes.NARROW_CONTENTS_WIDTH
7
7
  local ONE_BY_ONE_CONTENTS_HEIGHT = ____roomShapeVolumes.ONE_BY_ONE_CONTENTS_HEIGHT
8
8
  local ONE_BY_ONE_CONTENTS_WIDTH = ____roomShapeVolumes.ONE_BY_ONE_CONTENTS_WIDTH
9
9
  local TWO_BY_TWO_BOUNDS = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, ONE_BY_ONE_CONTENTS_HEIGHT * 2)
10
+ --- The size of a room shape's contents. This does not include the tiles that the walls are on. L
11
+ -- rooms use the same bounds as a 2x2 room.
10
12
  ____exports.ROOM_SHAPE_BOUNDS = {
11
13
  [RoomShape.SHAPE_1x1] = Vector(ONE_BY_ONE_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT),
12
14
  [RoomShape.IH] = Vector(ONE_BY_ONE_CONTENTS_WIDTH, NARROW_CONTENTS_HEIGHT),
@@ -8,6 +8,10 @@ local ONE_BY_ONE_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH, ONE_BY_ONE_CONT
8
8
  local TWO_BY_ONE_VERTICAL_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT * 2)
9
9
  local TWO_BY_ONE_HORIZONTAL_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, ONE_BY_ONE_CONTENTS_HEIGHT)
10
10
  local TWO_BY_TWO_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, ONE_BY_ONE_CONTENTS_HEIGHT * 2)
11
+ --- The dimensions of a room shape's layout. This is NOT the size of the room's actual contents! For
12
+ -- that, use `ROOM_SHAPE_BOUNDS`.
13
+ --
14
+ -- For example, a horizontal narrow room has a layout size of equal to that of a 1x1 room.
11
15
  ____exports.ROOM_SHAPE_LAYOUT_SIZES = {
12
16
  [RoomShape.SHAPE_1x1] = ONE_BY_ONE_LAYOUT_SIZE,
13
17
  [RoomShape.IH] = ONE_BY_ONE_LAYOUT_SIZE,
@@ -3,6 +3,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
3
3
  local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
4
4
  local TWO_BY_TWO_BOTTOM_RIGHT_POSITION = Vector(25, 13)
5
5
  local ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION = Vector(12, 13)
6
+ --- "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
7
+ -- wall would be at "Vector(-1, -1)".)
6
8
  ____exports.ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION = {
7
9
  [RoomShape.SHAPE_1x1] = Vector(12, 6),
8
10
  [RoomShape.IH] = Vector(12, 4),
@@ -11,6 +11,8 @@ local LEFT = -1
11
11
  local UP = -LEVEL_GRID_ROW_WIDTH
12
12
  local RIGHT = 1
13
13
  local DOWN = LEVEL_GRID_ROW_WIDTH
14
+ --- Deltas are considered to be from the safe grid index of the room (i.e. the top left corner, or
15
+ -- top right corner in the case of `RoomShape.LTL`).
14
16
  ____exports.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = {
15
17
  [RoomShape.SHAPE_1x1] = __TS__New(Map, {{DoorSlot.LEFT_0, LEFT}, {DoorSlot.UP_0, UP}, {DoorSlot.RIGHT_0, RIGHT}, {DoorSlot.DOWN_0, DOWN}}),
16
18
  [RoomShape.IH] = __TS__New(Map, {{DoorSlot.LEFT_0, LEFT}, {DoorSlot.RIGHT_0, RIGHT}}),
@@ -5,6 +5,8 @@ local ____constants = require("constants")
5
5
  local VectorZero = ____constants.VectorZero
6
6
  local NARROW_HORIZONTAL_TOP_LEFT_POSITION = Vector(0, 2)
7
7
  local NARROW_VERTICAL_TOP_LEFT_POSITION = Vector(4, 0)
8
+ --- "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
9
+ -- wall would be at "Vector(-1, -1)".)
8
10
  ____exports.ROOM_SHAPE_TO_TOP_LEFT_POSITION = {
9
11
  [RoomShape.SHAPE_1x1] = VectorZero,
10
12
  [RoomShape.IH] = NARROW_HORIZONTAL_TOP_LEFT_POSITION,
@@ -10,6 +10,9 @@ local NARROW_HORIZONTAL_VOLUME = ____exports.ONE_BY_ONE_CONTENTS_WIDTH * ____exp
10
10
  local NARROW_VERTICAL_VOLUME = ____exports.NARROW_CONTENTS_WIDTH * ____exports.ONE_BY_ONE_CONTENTS_HEIGHT
11
11
  local ONE_BY_TWO_VOLUME = ONE_BY_ONE_VOLUME * 2
12
12
  local L_ROOM_VOLUME = ONE_BY_ONE_VOLUME * 3
13
+ --- Volume is the amount of tiles that are inside the room shape.
14
+ --
15
+ -- (This cannot be directly calculated from the bounds since L rooms are a special case.)
13
16
  ____exports.ROOM_SHAPE_VOLUMES = {
14
17
  [RoomShape.SHAPE_1x1] = ONE_BY_ONE_VOLUME,
15
18
  [RoomShape.IH] = NARROW_HORIZONTAL_VOLUME,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "2.3.2",
3
+ "version": "3.1.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "index",
23
23
  "types": "index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^2.0.54"
25
+ "isaac-typescript-definitions": "^2.0.55"
26
26
  }
27
27
  }
@@ -36,6 +36,14 @@ function removeLinesContaining(self, msg, containsMsg)
36
36
  end
37
37
  LINE_SEPARATOR = "\n"
38
38
  USELESS_TRACEBACK_MESSAGES = {"in upvalue 'getTraceback'", "in function 'sandbox.GetTraceback'", "in function 'error'"}
39
+ --- In Lua, the `error` function will tell you the line number of the error, but not give you a full
40
+ -- traceback of the parent functions, which is unlike how JavaScript works. This function monkey
41
+ -- patches the `error` function to add this functionality.
42
+ --
43
+ -- Traceback functionality can only be added if the "--luadebug" flag is turned on, so this function
44
+ -- does nothing if the "--luadebug" flag is disabled.
45
+ --
46
+ -- @internal
39
47
  function ____exports.patchErrorFunction(self)
40
48
  if not isLuaDebugEnabled(nil) then
41
49
  return
package/sets/bossSets.lua CHANGED
@@ -37,6 +37,7 @@ local SatanVariant = ____isaac_2Dtypescript_2Ddefinitions.SatanVariant
37
37
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
38
38
  local WarVariant = ____isaac_2Dtypescript_2Ddefinitions.WarVariant
39
39
  local WidowVariant = ____isaac_2Dtypescript_2Ddefinitions.WidowVariant
40
+ --- Contains just the bosses in Basement (not e.g. Burning Basement).
40
41
  local BASEMENT_BOSSES_SET = __TS__New(
41
42
  Set,
42
43
  {
@@ -56,6 +57,7 @@ local BASEMENT_BOSSES_SET = __TS__New(
56
57
  tostring(EntityType.BABY_PLUM) .. ".0"
57
58
  }
58
59
  )
60
+ --- Contains just the bosses in Cellar (not e.g. Burning Basement).
59
61
  local CELLAR_BOSSES_SET = __TS__New(
60
62
  Set,
61
63
  {
@@ -72,6 +74,7 @@ local CELLAR_BOSSES_SET = __TS__New(
72
74
  tostring(EntityType.BABY_PLUM) .. ".0"
73
75
  }
74
76
  )
77
+ --- Contains just the bosses in Burning Basement (not e.g. Cellar).
75
78
  local BURNING_BASEMENT_BOSSES_SET = __TS__New(
76
79
  Set,
77
80
  {
@@ -92,6 +95,7 @@ local BURNING_BASEMENT_BOSSES_SET = __TS__New(
92
95
  tostring(EntityType.BABY_PLUM) .. ".0"
93
96
  }
94
97
  )
98
+ --- Contains just the bosses in Downpour (not e.g. Burning Basement).
95
99
  local DOWNPOUR_BOSSES_SET = __TS__New(
96
100
  Set,
97
101
  {
@@ -101,6 +105,7 @@ local DOWNPOUR_BOSSES_SET = __TS__New(
101
105
  tostring(EntityType.MIN_MIN) .. ".0"
102
106
  }
103
107
  )
108
+ --- Contains just the bosses in Dross (not e.g. Burning Basement).
104
109
  local DROSS_BOSSES_SET = __TS__New(
105
110
  Set,
106
111
  {
@@ -129,6 +134,7 @@ __TS__SparseArrayPush(
129
134
  ____array_0,
130
135
  __TS__Spread(DROSS_BOSSES_SET:values())
131
136
  )
137
+ --- The set of unique bosses for Basement, Cellar, and so on.
132
138
  local ALL_BASEMENT_BOSSES_SET = __TS__New(
133
139
  ____Set_1,
134
140
  {__TS__SparseArraySpread(____array_0)}
@@ -140,6 +146,7 @@ local BASEMENT_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(Map, {
140
146
  {StageType.REPENTANCE, DOWNPOUR_BOSSES_SET},
141
147
  {StageType.REPENTANCE_B, DROSS_BOSSES_SET}
142
148
  })
149
+ --- Contains just the bosses in Caves (not e.g. Flooded Caves).
143
150
  local CAVES_BOSSES_SET = __TS__New(
144
151
  Set,
145
152
  {
@@ -160,6 +167,7 @@ local CAVES_BOSSES_SET = __TS__New(
160
167
  tostring(EntityType.BUMBINO) .. ".0"
161
168
  }
162
169
  )
170
+ --- Contains just the bosses in Catacombs (not e.g. Flooded Caves).
163
171
  local CATACOMBS_BOSSES_SET = __TS__New(
164
172
  Set,
165
173
  {
@@ -181,6 +189,7 @@ local CATACOMBS_BOSSES_SET = __TS__New(
181
189
  tostring(EntityType.BUMBINO) .. ".0"
182
190
  }
183
191
  )
192
+ --- Contains just the bosses in Flooded Caves (not e.g. Catacombs).
184
193
  local FLOODED_CAVES_BOSSES_SET = __TS__New(
185
194
  Set,
186
195
  {
@@ -203,6 +212,7 @@ local FLOODED_CAVES_BOSSES_SET = __TS__New(
203
212
  tostring(EntityType.BUMBINO) .. ".0"
204
213
  }
205
214
  )
215
+ --- Contains just the bosses in Mines (not e.g. Flooded Caves).
206
216
  local MINES_BOSSES_SET = __TS__New(
207
217
  Set,
208
218
  {
@@ -212,6 +222,7 @@ local MINES_BOSSES_SET = __TS__New(
212
222
  tostring(EntityType.GIDEON) .. ".0"
213
223
  }
214
224
  )
225
+ --- Contains just the bosses in Ashpit (not e.g. Flooded Caves).
215
226
  local ASHPIT_BOSSES_SET = __TS__New(
216
227
  Set,
217
228
  {
@@ -240,6 +251,7 @@ __TS__SparseArrayPush(
240
251
  ____array_2,
241
252
  __TS__Spread(ASHPIT_BOSSES_SET:values())
242
253
  )
254
+ --- The set of unique bosses for Caves, Catacombs, and so on.
243
255
  local ALL_CAVES_BOSSES_SET = __TS__New(
244
256
  ____Set_3,
245
257
  {__TS__SparseArraySpread(____array_2)}
@@ -251,6 +263,7 @@ local CAVES_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(Map, {
251
263
  {StageType.REPENTANCE, MINES_BOSSES_SET},
252
264
  {StageType.REPENTANCE_B, ASHPIT_BOSSES_SET}
253
265
  })
266
+ --- Contains just the bosses in Depths (not e.g. Dank Depths).
254
267
  local DEPTHS_BOSSES_SET = __TS__New(
255
268
  Set,
256
269
  {
@@ -268,6 +281,7 @@ local DEPTHS_BOSSES_SET = __TS__New(
268
281
  tostring(EntityType.REAP_CREEP) .. ".0"
269
282
  }
270
283
  )
284
+ --- Contains just the bosses in Necropolis (not e.g. Dank Depths).
271
285
  local NECROPOLIS_BOSSES_SET = __TS__New(
272
286
  Set,
273
287
  {
@@ -284,6 +298,7 @@ local NECROPOLIS_BOSSES_SET = __TS__New(
284
298
  tostring(EntityType.SISTERS_VIS) .. ".0"
285
299
  }
286
300
  )
301
+ --- Contains just the bosses in Dank Depths (not e.g. Necropolis).
287
302
  local DANK_DEPTHS_BOSSES_SET = __TS__New(
288
303
  Set,
289
304
  {
@@ -301,6 +316,7 @@ local DANK_DEPTHS_BOSSES_SET = __TS__New(
301
316
  tostring(EntityType.REAP_CREEP) .. ".0"
302
317
  }
303
318
  )
319
+ --- Contains just the bosses in Mausoleum (not e.g. Dank Depths).
304
320
  local MAUSOLEUM_BOSSES_SET = __TS__New(
305
321
  Set,
306
322
  {
@@ -309,6 +325,7 @@ local MAUSOLEUM_BOSSES_SET = __TS__New(
309
325
  tostring(EntityType.HERETIC) .. ".0"
310
326
  }
311
327
  )
328
+ --- Contains just the bosses in Gehenna (not e.g. Dank Depths).
312
329
  local GEHENNA_BOSSES_SET = __TS__New(
313
330
  Set,
314
331
  {
@@ -335,6 +352,7 @@ __TS__SparseArrayPush(
335
352
  ____array_4,
336
353
  __TS__Spread(GEHENNA_BOSSES_SET:values())
337
354
  )
355
+ --- The set of unique bosses for Depths, Necropolis, and so on.
338
356
  local ALL_DEPTHS_BOSSES_SET = __TS__New(
339
357
  ____Set_5,
340
358
  {__TS__SparseArraySpread(____array_4)}
@@ -346,6 +364,7 @@ local DEPTHS_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(Map, {
346
364
  {StageType.REPENTANCE, MAUSOLEUM_BOSSES_SET},
347
365
  {StageType.REPENTANCE_B, GEHENNA_BOSSES_SET}
348
366
  })
367
+ --- Contains just the bosses in Womb (not e.g. Scarred Womb).
349
368
  local WOMB_BOSSES_SET = __TS__New(
350
369
  Set,
351
370
  {
@@ -363,6 +382,7 @@ local WOMB_BOSSES_SET = __TS__New(
363
382
  tostring(EntityType.MATRIARCH) .. ".0"
364
383
  }
365
384
  )
385
+ --- Contains just the bosses in Utero (not e.g. Scarred Womb).
366
386
  local UTERO_BOSSES_SET = __TS__New(
367
387
  Set,
368
388
  {
@@ -379,6 +399,7 @@ local UTERO_BOSSES_SET = __TS__New(
379
399
  tostring(EntityType.HEADLESS_HORSEMAN) .. ".0"
380
400
  }
381
401
  )
402
+ --- Contains just the bosses in Scarred Womb (not e.g. Utero).
382
403
  local SCARRED_WOMB_BOSSES_SET = __TS__New(
383
404
  Set,
384
405
  {
@@ -397,6 +418,7 @@ local SCARRED_WOMB_BOSSES_SET = __TS__New(
397
418
  tostring(EntityType.MATRIARCH) .. ".0"
398
419
  }
399
420
  )
421
+ --- Contains just the bosses in Corpse (not e.g. Scarred Womb).
400
422
  local CORPSE_BOSSES_SET = __TS__New(
401
423
  Set,
402
424
  {
@@ -424,6 +446,7 @@ __TS__SparseArrayPush(
424
446
  ____array_6,
425
447
  __TS__Spread(GEHENNA_BOSSES_SET:values())
426
448
  )
449
+ --- The set of unique bosses for Depths, Necropolis, and so on.
427
450
  local ALL_WOMB_BOSSES_SET = __TS__New(
428
451
  ____Set_7,
429
452
  {__TS__SparseArraySpread(____array_6)}
@@ -4,6 +4,8 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
7
+ --- The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
8
+ -- Baby). This includes The Lost and Tainted Lost. This does not include Keeper or Tainted Keeper.
7
9
  ____exports.CHARACTERS_WITH_NO_RED_HEARTS_SET = __TS__New(Set, {
8
10
  PlayerType.BLUE_BABY,
9
11
  PlayerType.THE_LOST,
@@ -4,6 +4,8 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
7
+ --- The set of characters where soul hearts will be automatically stripped away (e.g. Bethany). This
8
+ -- includes The Lost and Tainted Lost.
7
9
  ____exports.CHARACTERS_WITH_NO_SOUL_HEARTS_SET = __TS__New(Set, {
8
10
  PlayerType.THE_LOST,
9
11
  PlayerType.KEEPER,
@@ -4,6 +4,8 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
7
+ --- This is the set of characters that look like The Lost and play the "LostDeath" animation when
8
+ -- they die.
7
9
  ____exports.LOST_STYLE_CHARACTERS_SET = __TS__New(Set, {
8
10
  PlayerType.THE_LOST,
9
11
  PlayerType.THE_SOUL,
@@ -1,2 +1,12 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ /// <reference types="isaac-typescript-definitions" />
3
+ /// <reference types="isaac-typescript-definitions" />
4
+ /// <reference types="isaac-typescript-definitions" />
5
+ /// <reference types="isaac-typescript-definitions" />
6
+ /// <reference types="isaac-typescript-definitions" />
7
+ /// <reference types="isaac-typescript-definitions" />
8
+ /// <reference types="isaac-typescript-definitions" />
9
+ /// <reference types="isaac-typescript-definitions" />
10
+ /// <reference types="isaac-typescript-definitions" />
11
+ /// <reference types="isaac-typescript-definitions" />
2
12
  export declare type AnyEntity = Entity | EntityBomb | EntityEffect | EntityFamiliar | EntityKnife | EntityLaser | EntityNPC | EntityPickup | EntityPlayer | EntityProjectile | EntityTear;
@@ -7,20 +7,27 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
7
7
  local ItemType = ____isaac_2Dtypescript_2Ddefinitions.ItemType
8
8
  local DEFAULT_ITEM_TYPE = ItemType.NULL
9
9
  local DEFAULT_SUB_TYPE = CollectibleType.NULL
10
+ ---
11
+ -- @internal
10
12
  function ____exports.newPickingUpItem(self)
11
13
  return {itemType = DEFAULT_ITEM_TYPE, subType = DEFAULT_SUB_TYPE}
12
14
  end
15
+ ---
16
+ -- @internal
13
17
  function ____exports.resetPickingUpItem(self, pickingUpItem)
14
18
  pickingUpItem.itemType = DEFAULT_ITEM_TYPE
15
19
  pickingUpItem.subType = DEFAULT_SUB_TYPE
16
20
  end
17
21
  local COLLECTIBLE_ITEM_TYPES = __TS__New(Set, {ItemType.PASSIVE, ItemType.ACTIVE, ItemType.FAMILIAR})
22
+ --- Helper function to narrow the type of `PickingUpItem`.
18
23
  function ____exports.pickingUpItemIsNull(self, pickingUpItem)
19
24
  return pickingUpItem.itemType == ItemType.NULL
20
25
  end
26
+ --- Helper function to narrow the type of `PickingUpItem`.
21
27
  function ____exports.pickingUpItemIsCollectible(self, pickingUpItem)
22
28
  return COLLECTIBLE_ITEM_TYPES:has(pickingUpItem.itemType)
23
29
  end
30
+ --- Helper function to narrow the type of `PickingUpItem`.
24
31
  function ____exports.pickingUpItemIsTrinket(self, pickingUpItem)
25
32
  return pickingUpItem.itemType == ItemType.TRINKET
26
33
  end
package/upgradeMod.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  import { ModUpgraded } from "./classes/ModUpgraded";
3
3
  /**
4
- * Use this function to enable the custom callbacks and other optional features provided by
5
- * `isaacscript-common`.
4
+ * Use this function to enable the {@link ModCallbackCustom custom callbacks} and other optional
5
+ * features provided by `isaacscript-common`.
6
6
  *
7
7
  * For example:
8
8
  *
@@ -10,10 +10,10 @@ import { ModUpgraded } from "./classes/ModUpgraded";
10
10
  * const modVanilla = RegisterMod("My Mod", 1);
11
11
  * const mod = upgradeMod(modVanilla);
12
12
  *
13
- * // Subscribe to vanilla callbacks
13
+ * // Subscribe to vanilla callbacks.
14
14
  * mod.AddCallback(ModCallback.POST_UPDATE, postUpdate);
15
15
  *
16
- * // Subscribe to custom callbacks
16
+ * // Subscribe to custom callbacks.
17
17
  * mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup);
18
18
  * ```
19
19
  *
package/upgradeMod.lua CHANGED
@@ -17,6 +17,24 @@ local initFeaturesMajor = ____initFeatures.initFeaturesMajor
17
17
  local initFeaturesMinor = ____initFeatures.initFeaturesMinor
18
18
  local ____patchErrorFunctions = require("patchErrorFunctions")
19
19
  local patchErrorFunction = ____patchErrorFunctions.patchErrorFunction
20
+ --- Use this function to enable the {@link ModCallbackCustomcustom callbacks} and other optional
21
+ -- features provided by `isaacscript-common`.
22
+ --
23
+ -- For example:
24
+ --
25
+ -- ```ts
26
+ -- const modVanilla = RegisterMod("My Mod", 1);
27
+ -- const mod = upgradeMod(modVanilla);
28
+ --
29
+ -- // Subscribe to vanilla callbacks.
30
+ -- mod.AddCallback(ModCallback.POST_UPDATE, postUpdate);
31
+ --
32
+ -- // Subscribe to custom callbacks.
33
+ -- mod.AddCallbackCustom(ModCallbackCustom.POST_ITEM_PICKUP, postItemPickup);
34
+ -- ```
35
+ --
36
+ -- @param modVanilla The mod object returned by the `RegisterMod` function.
37
+ -- @returns The upgraded mod object.
20
38
  function ____exports.upgradeMod(self, modVanilla)
21
39
  patchErrorFunction(nil)
22
40
  local mod = __TS__New(ModUpgraded, modVanilla)