isaacscript-common 2.3.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) 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/postPickupInitLate.lua +2 -0
  30. package/callbacks/postPickupStateChanged.lua +2 -0
  31. package/callbacks/postPitRender.lua +2 -0
  32. package/callbacks/postPitUpdate.lua +2 -0
  33. package/callbacks/postPlayerChangeHealth.lua +2 -0
  34. package/callbacks/postPlayerChangeType.lua +2 -0
  35. package/callbacks/postPlayerFatalDamage.lua +2 -0
  36. package/callbacks/postPlayerInitLate.lua +2 -0
  37. package/callbacks/postPlayerReordered.lua +2 -0
  38. package/callbacks/postPoopRender.lua +2 -0
  39. package/callbacks/postPoopUpdate.lua +2 -0
  40. package/callbacks/postPressurePlateRender.lua +2 -0
  41. package/callbacks/postPressurePlateUpdate.lua +2 -0
  42. package/callbacks/postProjectileInitLate.lua +2 -0
  43. package/callbacks/postPurchase.lua +2 -0
  44. package/callbacks/postRockRender.lua +2 -0
  45. package/callbacks/postRockUpdate.lua +2 -0
  46. package/callbacks/postRoomClearChanged.lua +2 -0
  47. package/callbacks/postSacrifice.lua +2 -0
  48. package/callbacks/postSlotDestroyed.d.ts +1 -0
  49. package/callbacks/postSlotDestroyed.lua +66 -0
  50. package/callbacks/postSlotInitUpdate.lua +2 -0
  51. package/callbacks/postSlotRender.lua +5 -21
  52. package/callbacks/postSpikesRender.lua +2 -0
  53. package/callbacks/postSpikesUpdate.lua +2 -0
  54. package/callbacks/postTNTRender.lua +2 -0
  55. package/callbacks/postTNTUpdate.lua +2 -0
  56. package/callbacks/postTearInitLate.lua +2 -0
  57. package/callbacks/postTearInitVeryLate.lua +2 -0
  58. package/callbacks/postTransformation.lua +2 -0
  59. package/callbacks/postTrinketBreak.lua +2 -0
  60. package/callbacks/preBerserkDeath.lua +2 -0
  61. package/callbacks/preNewLevel.lua +2 -0
  62. package/callbacks/reorderedCallbacks.lua +16 -0
  63. package/callbacks/subscriptions/postBombInitLate.lua +6 -0
  64. package/callbacks/subscriptions/postBoneSwing.lua +6 -0
  65. package/callbacks/subscriptions/postCollectibleInitFirst.lua +6 -0
  66. package/callbacks/subscriptions/postCursedTeleport.lua +6 -0
  67. package/callbacks/subscriptions/postCustomDoorEnter.lua +6 -0
  68. package/callbacks/subscriptions/postCustomRevive.d.ts +1 -0
  69. package/callbacks/subscriptions/postCustomRevive.lua +6 -0
  70. package/callbacks/subscriptions/postDoorRender.d.ts +1 -0
  71. package/callbacks/subscriptions/postDoorRender.lua +6 -0
  72. package/callbacks/subscriptions/postDoorUpdate.d.ts +1 -0
  73. package/callbacks/subscriptions/postDoorUpdate.lua +6 -0
  74. package/callbacks/subscriptions/postEffectInitLate.lua +6 -0
  75. package/callbacks/subscriptions/postEffectStateChanged.lua +6 -0
  76. package/callbacks/subscriptions/postEsauJr.lua +6 -0
  77. package/callbacks/subscriptions/postFamiliarInitLate.lua +6 -0
  78. package/callbacks/subscriptions/postFamiliarStateChanged.lua +6 -0
  79. package/callbacks/subscriptions/postFirstEsauJr.lua +6 -0
  80. package/callbacks/subscriptions/postFirstFlip.lua +6 -0
  81. package/callbacks/subscriptions/postFlip.lua +6 -0
  82. package/callbacks/subscriptions/postGameStartedReordered.lua +6 -0
  83. package/callbacks/subscriptions/postGreedModeWave.lua +6 -0
  84. package/callbacks/subscriptions/postGridEntityBroken.lua +6 -0
  85. package/callbacks/subscriptions/postGridEntityCollision.lua +6 -0
  86. package/callbacks/subscriptions/postGridEntityInit.lua +6 -0
  87. package/callbacks/subscriptions/postGridEntityRemove.lua +6 -0
  88. package/callbacks/subscriptions/postGridEntityRender.lua +6 -0
  89. package/callbacks/subscriptions/postGridEntityStateChanged.lua +6 -0
  90. package/callbacks/subscriptions/postGridEntityUpdate.lua +6 -0
  91. package/callbacks/subscriptions/postHolyMantleRemoved.lua +6 -0
  92. package/callbacks/subscriptions/postItemDischarged.lua +6 -0
  93. package/callbacks/subscriptions/postItemPickup.lua +6 -0
  94. package/callbacks/subscriptions/postKnifeInitLate.lua +6 -0
  95. package/callbacks/subscriptions/postLaserInitLate.lua +6 -0
  96. package/callbacks/subscriptions/postNPCInitLate.lua +6 -0
  97. package/callbacks/subscriptions/postNPCStateChanged.lua +6 -0
  98. package/callbacks/subscriptions/postNewLevelReordered.lua +6 -0
  99. package/callbacks/subscriptions/postNewRoomEarly.lua +6 -0
  100. package/callbacks/subscriptions/postNewRoomReordered.lua +6 -0
  101. package/callbacks/subscriptions/postPEffectUpdateReordered.lua +6 -0
  102. package/callbacks/subscriptions/postPickupCollect.d.ts +1 -0
  103. package/callbacks/subscriptions/postPickupCollect.lua +6 -0
  104. package/callbacks/subscriptions/postPickupInitLate.lua +6 -0
  105. package/callbacks/subscriptions/postPickupStateChanged.d.ts +1 -0
  106. package/callbacks/subscriptions/postPickupStateChanged.lua +6 -0
  107. package/callbacks/subscriptions/postPitRender.d.ts +1 -0
  108. package/callbacks/subscriptions/postPitRender.lua +6 -0
  109. package/callbacks/subscriptions/postPitUpdate.d.ts +1 -0
  110. package/callbacks/subscriptions/postPitUpdate.lua +6 -0
  111. package/callbacks/subscriptions/postPlayerChangeHealth.lua +6 -0
  112. package/callbacks/subscriptions/postPlayerChangeType.lua +6 -0
  113. package/callbacks/subscriptions/postPlayerFatalDamage.lua +6 -0
  114. package/callbacks/subscriptions/postPlayerInitLate.lua +6 -0
  115. package/callbacks/subscriptions/postPlayerInitReordered.lua +6 -0
  116. package/callbacks/subscriptions/postPlayerRenderReordered.lua +6 -0
  117. package/callbacks/subscriptions/postPlayerUpdateReordered.lua +6 -0
  118. package/callbacks/subscriptions/postPoopRender.d.ts +1 -0
  119. package/callbacks/subscriptions/postPoopRender.lua +6 -0
  120. package/callbacks/subscriptions/postPoopUpdate.d.ts +1 -0
  121. package/callbacks/subscriptions/postPoopUpdate.lua +6 -0
  122. package/callbacks/subscriptions/postPressurePlateRender.d.ts +1 -0
  123. package/callbacks/subscriptions/postPressurePlateRender.lua +6 -0
  124. package/callbacks/subscriptions/postPressurePlateUpdate.d.ts +1 -0
  125. package/callbacks/subscriptions/postPressurePlateUpdate.lua +6 -0
  126. package/callbacks/subscriptions/postProjectileInitLate.lua +6 -0
  127. package/callbacks/subscriptions/postPurchase.lua +6 -0
  128. package/callbacks/subscriptions/postRockRender.d.ts +1 -0
  129. package/callbacks/subscriptions/postRockRender.lua +6 -0
  130. package/callbacks/subscriptions/postRockUpdate.d.ts +1 -0
  131. package/callbacks/subscriptions/postRockUpdate.lua +6 -0
  132. package/callbacks/subscriptions/postRoomClearChanged.lua +6 -0
  133. package/callbacks/subscriptions/postSacrifice.lua +6 -0
  134. package/callbacks/subscriptions/postSlotAnimationChanged.lua +6 -0
  135. package/callbacks/subscriptions/postSlotDestroyed.lua +6 -0
  136. package/callbacks/subscriptions/postSlotInit.lua +6 -0
  137. package/callbacks/subscriptions/postSlotRender.lua +6 -0
  138. package/callbacks/subscriptions/postSlotUpdate.lua +6 -0
  139. package/callbacks/subscriptions/postSpikesRender.d.ts +1 -0
  140. package/callbacks/subscriptions/postSpikesRender.lua +6 -0
  141. package/callbacks/subscriptions/postSpikesUpdate.d.ts +1 -0
  142. package/callbacks/subscriptions/postSpikesUpdate.lua +6 -0
  143. package/callbacks/subscriptions/postTNTRender.d.ts +1 -0
  144. package/callbacks/subscriptions/postTNTRender.lua +6 -0
  145. package/callbacks/subscriptions/postTNTUpdate.d.ts +1 -0
  146. package/callbacks/subscriptions/postTNTUpdate.lua +6 -0
  147. package/callbacks/subscriptions/postTearInitLate.lua +6 -0
  148. package/callbacks/subscriptions/postTearInitVeryLate.lua +6 -0
  149. package/callbacks/subscriptions/postTransformation.lua +6 -0
  150. package/callbacks/subscriptions/postTrinketBreak.lua +6 -0
  151. package/callbacks/subscriptions/preBerserkDeath.lua +6 -0
  152. package/callbacks/subscriptions/preCustomRevive.lua +6 -0
  153. package/callbacks/subscriptions/preItemPickup.lua +6 -0
  154. package/callbacks/subscriptions/preNewLevel.lua +6 -0
  155. package/classes/DefaultMap.d.ts +70 -39
  156. package/classes/DefaultMap.lua +94 -43
  157. package/classes/ModUpgraded.d.ts +3 -3
  158. package/classes/ModUpgraded.lua +5 -0
  159. package/constants.lua +41 -0
  160. package/constantsFirstLast.lua +63 -0
  161. package/enums/HealthType.lua +3 -0
  162. package/enums/ModCallbackCustom.d.ts +1 -1
  163. package/enums/ModCallbackCustom.lua +6 -0
  164. package/enums/private/CopyableIsaacAPIClassType.lua +1 -0
  165. package/enums/private/SerializationBrand.lua +5 -0
  166. package/features/characterHealthConversion.lua +6 -0
  167. package/features/characterStats.lua +17 -0
  168. package/features/debugDisplay/exports.d.ts +17 -0
  169. package/features/debugDisplay/exports.lua +90 -0
  170. package/features/debugDisplay/v.d.ts +17 -0
  171. package/features/deployJSONRoom.d.ts +1 -0
  172. package/features/deployJSONRoom.lua +56 -0
  173. package/features/disableInputs.lua +45 -0
  174. package/features/disableSound.lua +14 -0
  175. package/features/extraConsoleCommands/commandsDisplay.lua +90 -0
  176. package/features/extraConsoleCommands/init.lua +16 -0
  177. package/features/extraConsoleCommands/listCommands.lua +172 -0
  178. package/features/fadeInRemover.lua +10 -0
  179. package/features/fastReset.lua +10 -0
  180. package/features/forgottenSwitch.lua +4 -0
  181. package/features/getCollectibleItemPoolType.lua +5 -0
  182. package/features/playerInventory.lua +18 -0
  183. package/features/ponyDetection.lua +4 -0
  184. package/features/preventCollectibleRotation.lua +9 -0
  185. package/features/runInNFrames.lua +50 -0
  186. package/features/saveDataManager/constants.lua +1 -0
  187. package/features/saveDataManager/exports.lua +115 -0
  188. package/features/saveDataManager/load.lua +12 -8
  189. package/features/saveDataManager/main.lua +16 -3
  190. package/features/saveDataManager/maps.lua +3 -0
  191. package/features/saveDataManager/merge.lua +53 -21
  192. package/features/saveDataManager/save.lua +12 -7
  193. package/features/sirenHelpers.lua +13 -0
  194. package/features/taintedLazarusPlayers.lua +11 -0
  195. package/featuresInitialized.lua +6 -0
  196. package/functions/array.d.ts +2 -0
  197. package/functions/array.lua +85 -0
  198. package/functions/benchmark.lua +6 -0
  199. package/functions/boss.lua +35 -0
  200. package/functions/cacheFlag.lua +4 -0
  201. package/functions/cards.lua +60 -0
  202. package/functions/challenges.lua +1 -0
  203. package/functions/character.lua +23 -0
  204. package/functions/charge.lua +39 -0
  205. package/functions/chargeBar.d.ts +1 -0
  206. package/functions/chargeBar.lua +4 -0
  207. package/functions/collectibleCacheFlag.lua +15 -0
  208. package/functions/collectibleSet.lua +3 -0
  209. package/functions/collectibleTag.lua +9 -0
  210. package/functions/collectibles.d.ts +6 -1
  211. package/functions/collectibles.lua +146 -2
  212. package/functions/color.lua +18 -0
  213. package/functions/debug.lua +18 -0
  214. package/functions/deepCopy.lua +60 -26
  215. package/functions/deepCopyTests.lua +8 -5
  216. package/functions/direction.d.ts +1 -0
  217. package/functions/direction.lua +22 -0
  218. package/functions/doors.d.ts +1 -0
  219. package/functions/doors.lua +58 -0
  220. package/functions/entity.d.ts +4 -4
  221. package/functions/entity.lua +94 -6
  222. package/functions/entitySpecific.d.ts +20 -20
  223. package/functions/entitySpecific.lua +182 -0
  224. package/functions/entityTypes.d.ts +1 -1
  225. package/functions/entityTypes.lua +1 -0
  226. package/functions/enums.d.ts +2 -0
  227. package/functions/enums.lua +62 -0
  228. package/functions/familiars.lua +52 -0
  229. package/functions/flag.lua +77 -0
  230. package/functions/flying.lua +10 -0
  231. package/functions/globals.lua +8 -10
  232. package/functions/gridEntity.lua +105 -0
  233. package/functions/gridEntitySpecific.d.ts +5 -0
  234. package/functions/gridEntitySpecific.lua +8 -0
  235. package/functions/input.lua +11 -0
  236. package/functions/isaacAPIClass.d.ts +4 -4
  237. package/functions/isaacAPIClass.lua +15 -3
  238. package/functions/jsonHelpers.lua +11 -0
  239. package/functions/jsonRoom.d.ts +2 -0
  240. package/functions/jsonRoom.lua +5 -0
  241. package/functions/kColor.lua +9 -0
  242. package/functions/language.lua +5 -0
  243. package/functions/log.lua +31 -3
  244. package/functions/map.lua +18 -0
  245. package/functions/math.lua +26 -0
  246. package/functions/npc.lua +24 -0
  247. package/functions/pickupVariants.d.ts +11 -11
  248. package/functions/pickupVariants.lua +11 -0
  249. package/functions/pickups.d.ts +9 -9
  250. package/functions/pickups.lua +67 -0
  251. package/functions/pills.lua +45 -0
  252. package/functions/player.lua +166 -0
  253. package/functions/playerDataStructures.lua +65 -0
  254. package/functions/playerHealth.d.ts +1 -0
  255. package/functions/playerHealth.lua +10 -0
  256. package/functions/playerIndex.d.ts +2 -0
  257. package/functions/playerIndex.lua +47 -0
  258. package/functions/pocketItems.lua +18 -0
  259. package/functions/positionVelocity.d.ts +3 -0
  260. package/functions/positionVelocity.lua +46 -0
  261. package/functions/random.d.ts +2 -0
  262. package/functions/random.lua +32 -0
  263. package/functions/revive.d.ts +2 -0
  264. package/functions/revive.lua +15 -0
  265. package/functions/rng.d.ts +1 -0
  266. package/functions/rng.lua +19 -0
  267. package/functions/roomData.lua +68 -0
  268. package/functions/roomGrid.lua +21 -0
  269. package/functions/roomShape.lua +22 -0
  270. package/functions/rooms.lua +100 -0
  271. package/functions/run.lua +5 -0
  272. package/functions/seeds.lua +4 -0
  273. package/functions/serialization.lua +6 -2
  274. package/functions/set.d.ts +1 -0
  275. package/functions/set.lua +22 -0
  276. package/functions/spawnCollectible.lua +24 -0
  277. package/functions/sprite.d.ts +2 -0
  278. package/functions/sprite.lua +25 -0
  279. package/functions/stage.lua +16 -0
  280. package/functions/string.lua +6 -0
  281. package/functions/table.d.ts +12 -0
  282. package/functions/table.lua +53 -0
  283. package/functions/tears.d.ts +1 -0
  284. package/functions/tears.lua +12 -0
  285. package/functions/transformations.lua +18 -0
  286. package/functions/trinketCacheFlag.lua +3 -0
  287. package/functions/trinketGive.lua +24 -0
  288. package/functions/trinkets.lua +52 -0
  289. package/functions/tstlClass.d.ts +34 -0
  290. package/functions/tstlClass.lua +63 -9
  291. package/functions/ui.d.ts +2 -0
  292. package/functions/ui.lua +16 -0
  293. package/functions/utils.d.ts +16 -0
  294. package/functions/utils.lua +108 -0
  295. package/functions/vector.lua +13 -16
  296. package/index.d.ts +1 -0
  297. package/initCustomCallbacks.lua +3 -0
  298. package/interfaces/ChargeBarSprites.d.ts +1 -0
  299. package/interfaces/private/TSTLClassMetatable.d.ts +2 -0
  300. package/lualib_bundle.lua +21 -34
  301. package/maps/cardMap.lua +1 -0
  302. package/maps/characterMap.lua +1 -0
  303. package/maps/defaultPlayerStatMap.lua +1 -0
  304. package/maps/gridEntityXMLMap.lua +2 -0
  305. package/maps/pillEffectMap.lua +1 -0
  306. package/maps/roomShapeToTopLeftWallGridIndexMap.lua +2 -0
  307. package/maps/roomTypeMap.lua +1 -0
  308. package/objects/LRoomShapeToRectangles.lua +2 -0
  309. package/objects/colors.lua +4 -0
  310. package/objects/oppositeDoorSlots.d.ts +4 -0
  311. package/objects/oppositeDoorSlots.lua +15 -0
  312. package/objects/roomShapeBounds.lua +2 -0
  313. package/objects/roomShapeLayoutSizes.lua +4 -0
  314. package/objects/roomShapeToBottomRightPosition.lua +2 -0
  315. package/objects/roomShapeToDoorSlotsToGridIndexDelta.lua +2 -0
  316. package/objects/roomShapeToTopLeftPosition.lua +2 -0
  317. package/objects/roomShapeVolumes.lua +3 -0
  318. package/package.json +2 -2
  319. package/patchErrorFunctions.lua +8 -0
  320. package/sets/bossSets.lua +23 -0
  321. package/sets/charactersWithNoRedHeartsSet.lua +2 -0
  322. package/sets/charactersWithNoSoulHeartsSet.lua +2 -0
  323. package/sets/lostStyleCharactersSet.lua +2 -0
  324. package/types/AnyEntity.d.ts +10 -0
  325. package/types/PickingUpItem.lua +7 -0
  326. package/upgradeMod.d.ts +4 -4
  327. package/upgradeMod.lua +18 -0
@@ -1,10 +1,12 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ /// <reference types="isaac-typescript-definitions" />
3
+ /// <reference types="isaac-typescript-definitions" />
2
4
  /**
3
5
  * A cached version of the class returned from the `Game()` constructor.
4
6
  *
5
7
  * Use this instead of invoking the constructor again for a miniscule performance increase.
6
8
  *
7
- * Caching the results of a this constructor is safe, but caching other classes (like `Level` or
9
+ * Caching the results of this constructor is safe, but caching other classes (like `Level` or
8
10
  * `Room`) is not safe and can lead to the game crashing in certain situations.
9
11
  */
10
12
  export declare const game: Game;
@@ -13,7 +15,7 @@ export declare const game: Game;
13
15
  *
14
16
  * Use this instead of invoking the constructor again for a miniscule performance increase.
15
17
  *
16
- * Caching the results of a this constructor is safe, but caching other classes (like `Level` or
18
+ * Caching the results of this constructor is safe, but caching other classes (like `Level` or
17
19
  * `Room`) is not safe and can lead to the game crashing in certain situations.
18
20
  */
19
21
  export declare const itemConfig: import("isaac-typescript-definitions/types/ItemConfig").ItemConfig;
@@ -22,7 +24,7 @@ export declare const itemConfig: import("isaac-typescript-definitions/types/Item
22
24
  *
23
25
  * Use this instead of invoking the constructor again for a miniscule performance increase.
24
26
  *
25
- * Caching the results of a this constructor is safe, but caching other classes (like `Level` or
27
+ * Caching the results of this constructor is safe, but caching other classes (like `Level` or
26
28
  * `Room`) is not safe and can lead to the game crashing in certain situations.
27
29
  */
28
30
  export declare const musicManager: MusicManager;
@@ -31,7 +33,7 @@ export declare const musicManager: MusicManager;
31
33
  *
32
34
  * Use this instead of invoking the constructor again for a miniscule performance increase.
33
35
  *
34
- * Caching the results of a this constructor is safe, but caching other classes (like `Level` or
36
+ * Caching the results of this constructor is safe, but caching other classes (like `Level` or
35
37
  * `Room`) is not safe and can lead to the game crashing in certain situations.
36
38
  */
37
39
  export declare const sfxManager: SFXManager;
package/cachedClasses.lua CHANGED
@@ -1,6 +1,30 @@
1
1
  local ____exports = {}
2
+ --- A cached version of the class returned from the `Game()` constructor.
3
+ --
4
+ -- Use this instead of invoking the constructor again for a miniscule performance increase.
5
+ --
6
+ -- Caching the results of this constructor is safe, but caching other classes (like `Level` or
7
+ -- `Room`) is not safe and can lead to the game crashing in certain situations.
2
8
  ____exports.game = Game()
9
+ --- A cached version of the class returned from the `Isaac.GetItemConfig()` constructor.
10
+ --
11
+ -- Use this instead of invoking the constructor again for a miniscule performance increase.
12
+ --
13
+ -- Caching the results of this constructor is safe, but caching other classes (like `Level` or
14
+ -- `Room`) is not safe and can lead to the game crashing in certain situations.
3
15
  ____exports.itemConfig = Isaac.GetItemConfig()
16
+ --- A cached version of the class returned from the `MusicManager()` constructor.
17
+ --
18
+ -- Use this instead of invoking the constructor again for a miniscule performance increase.
19
+ --
20
+ -- Caching the results of this constructor is safe, but caching other classes (like `Level` or
21
+ -- `Room`) is not safe and can lead to the game crashing in certain situations.
4
22
  ____exports.musicManager = MusicManager()
23
+ --- A cached version of the class returned from the `SFXManager()` constructor.
24
+ --
25
+ -- Use this instead of invoking the constructor again for a miniscule performance increase.
26
+ --
27
+ -- Caching the results of this constructor is safe, but caching other classes (like `Level` or
28
+ -- `Room`) is not safe and can lead to the game crashing in certain situations.
5
29
  ____exports.sfxManager = SFXManager()
6
30
  return ____exports
@@ -134,6 +134,8 @@ CustomReviveState[CustomReviveState.WAITING_FOR_ROOM_TRANSITION] = "WAITING_FOR_
134
134
  CustomReviveState.WAITING_FOR_ITEM_ANIMATION = 2
135
135
  CustomReviveState[CustomReviveState.WAITING_FOR_ITEM_ANIMATION] = "WAITING_FOR_ITEM_ANIMATION"
136
136
  v = {run = {state = CustomReviveState.DISABLED, revivalType = nil, dyingPlayerIndex = nil}}
137
+ ---
138
+ -- @internal
137
139
  function ____exports.customReviveCallbacksInit(self, mod)
138
140
  saveDataManager(nil, "customRevive", v, hasSubscriptions)
139
141
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
@@ -57,6 +57,8 @@ v = {run = {playersPickingUpItemMap = __TS__New(
57
57
  DefaultMap,
58
58
  function() return newPickingUpItem(nil) end
59
59
  )}}
60
+ ---
61
+ -- @internal
60
62
  function ____exports.itemPickupCallbacksInit(self, mod)
61
63
  saveDataManager(nil, "itemPickup", v, hasSubscriptions)
62
64
  mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -24,6 +24,8 @@ function postBombUpdate(self, bomb)
24
24
  end
25
25
  end
26
26
  v = {room = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postBombInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postBombInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_BOMB_UPDATE, postBombUpdate)
@@ -41,6 +41,8 @@ function boneClubAnimationChanged(self, boneClub, animation)
41
41
  end
42
42
  BONE_SWING_ANIMATIONS = __TS__New(Set, {"Swing", "Swing2", "Spin"})
43
43
  v = {room = {boneClubAnimations = __TS__New(Map)}}
44
+ ---
45
+ -- @internal
44
46
  function ____exports.postBoneSwingCallbackInit(self, mod)
45
47
  saveDataManager(nil, "postBoneSwing", v, hasSubscriptions)
46
48
  mod:AddCallback(ModCallback.POST_KNIFE_RENDER, postKnifeRender)
@@ -25,6 +25,8 @@ function postPickupInitCollectible(self, collectible)
25
25
  postCollectibleInitFirstFire(nil, collectible)
26
26
  end
27
27
  v = {run = {seenCollectibles = __TS__New(Set)}}
28
+ ---
29
+ -- @internal
28
30
  function ____exports.postCollectibleInitFirstCallbackInit(self, mod)
29
31
  saveDataManager(nil, "postCollectibleInitFirst", v, hasSubscriptions)
30
32
  mod:AddCallback(ModCallback.POST_PICKUP_INIT, postPickupInitCollectible, PickupVariant.COLLECTIBLE)
@@ -111,6 +111,8 @@ v = {
111
111
  run = {playersDamageFrameMap = __TS__New(Map)},
112
112
  level = {numSacrifices = 0}
113
113
  }
114
+ ---
115
+ -- @internal
114
116
  function ____exports.postCursedTeleportCallbackInit(self, mod)
115
117
  saveDataManager(nil, "postCursedTeleport", v, hasSubscriptions)
116
118
  mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.PLAYER)
@@ -155,9 +155,34 @@ v = {room = {
155
155
  customDoors = __TS__New(Map),
156
156
  customDoorSlots = __TS__New(Set)
157
157
  }}
158
+ ---
159
+ -- @internal
158
160
  function ____exports.postCustomDoorEnterCallbackInit(self)
159
161
  saveDataManager(nil, "postCustomDoorEnter", v, hasSubscriptions)
160
162
  end
163
+ --- `isaacscript-common` provides custom doors that can be spawned where any wall segment is. If you
164
+ -- use this feature, you must first call this initialization function at the beginning of your mod.
165
+ --
166
+ -- Each kind of custom door that you create must have an entry in the "content/entities2.xml" file,
167
+ -- like so:
168
+ --
169
+ -- ```xml
170
+ -- <entity id="1000" name="Foo Custom Door" anm2path="grid/door_foo.anm2" />
171
+ -- ```
172
+ --
173
+ -- (Custom door entities must have an id of "1000", which corresponds to an effect. If you do not
174
+ -- specify the variant, then the game will automatically assign it.)
175
+ --
176
+ -- Next, pass the variant into this function:
177
+ --
178
+ -- ```ts
179
+ -- const modVanilla = RegisterMod("My Mod", 1);
180
+ -- const mod = upgradeMod(modVanilla);
181
+ -- const fooEffectVariant = Isaac.GetEntityVariantByName("Foo Custom Door");
182
+ -- initCustomDoor(mod, fooEffectVariant);
183
+ -- ```
184
+ --
185
+ -- Also see the `spawnCustomDoor` function.
161
186
  function ____exports.initCustomDoor(self, mod, effectVariant)
162
187
  initializedEffectVariants:add(effectVariant)
163
188
  mod:AddCallback(ModCallback.POST_EFFECT_UPDATE, postEffectUpdaterCustomEntity, effectVariant)
@@ -169,6 +194,25 @@ function ____exports.initCustomDoor(self, mod, effectVariant)
169
194
  end
170
195
  )
171
196
  end
197
+ --- Helper function to spawn a custom door. This is intended to be called from the `POST_NEW_ROOM`
198
+ -- callback when the player enters a room that should have a custom door. (You could also call it
199
+ -- from another callback if you want the door to appear e.g. after clearing all enemies.)
200
+ --
201
+ -- Like other entities, the door is not persistent, so you must spawn it every time when re-entering
202
+ -- the room.
203
+ --
204
+ -- Handle when a player enters the door by hooking the custom `POST_CUSTOM_DOOR_ENTER` callback.
205
+ --
206
+ -- The custom door is an `EntityEffect`. You can manually open or close the door by modifying its
207
+ -- state. (The values to use correspond to the `DoorState` enum.)
208
+ --
209
+ -- This function will throw a runtime error if:
210
+ -- - the door slot already has a vanilla door
211
+ -- - the door slot already has a custom door
212
+ -- - the tile at the door slot does not have a wall
213
+ --
214
+ -- Before using this function, you must first initialize the effect/door variant with the
215
+ -- `initCustomDoor` function.
172
216
  function ____exports.spawnCustomDoor(self, effectVariant, doorSlot)
173
217
  if not initializedEffectVariants:has(effectVariant) then
174
218
  error("In order to spawn custom doors, you must first initialize them with the \"initCustomDoor\" function at the beginning of your mod.")
@@ -18,6 +18,8 @@ function postRender(self)
18
18
  postDoorRenderFire(nil, doors)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postDoorRenderInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
23
25
  end
@@ -18,6 +18,8 @@ function postUpdate(self)
18
18
  postDoorUpdateFire(nil, doors)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postDoorUpdateInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
23
25
  end
@@ -24,6 +24,8 @@ function postEffectUpdate(self, effect)
24
24
  end
25
25
  end
26
26
  v = {room = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postEffectInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postEffectInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_EFFECT_UPDATE, postEffectUpdate)
@@ -30,6 +30,8 @@ v = {run = {effectStateMap = __TS__New(
30
30
  DefaultMap,
31
31
  function(____, state) return state end
32
32
  )}}
33
+ ---
34
+ -- @internal
33
35
  function ____exports.postEffectStateChangedCallbackInit(self, mod)
34
36
  saveDataManager(nil, "postEffectStateChanged", v, hasSubscriptions)
35
37
  mod:AddCallback(ModCallback.POST_EFFECT_UPDATE, postEffectUpdate)
@@ -59,6 +59,8 @@ function useItemEsauJr(self, _collectibleType, _rng, player, _useFlags, _activeS
59
59
  v.run.usedEsauJrControllerIndex = player.ControllerIndex
60
60
  end
61
61
  v = {run = {usedEsauJrFrame = nil, usedEsauJrControllerIndex = nil, usedEsauJrAtLeastOnce = false}}
62
+ ---
63
+ -- @internal
62
64
  function ____exports.postEsauJrCallbacksInit(self, mod)
63
65
  saveDataManager(nil, "postEsauJr", v, hasSubscriptions)
64
66
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
@@ -24,6 +24,8 @@ function postFamiliarUpdate(self, familiar)
24
24
  end
25
25
  end
26
26
  v = {run = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postFamiliarInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postFamiliarInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_FAMILIAR_UPDATE, postFamiliarUpdate)
@@ -30,6 +30,8 @@ v = {run = {familiarStateMap = __TS__New(
30
30
  DefaultMap,
31
31
  function(____, state) return state end
32
32
  )}}
33
+ ---
34
+ -- @internal
33
35
  function ____exports.postFamiliarStateChangedCallbackInit(self, mod)
34
36
  saveDataManager(nil, "postFamiliarStateChanged", v, hasSubscriptions)
35
37
  mod:AddCallback(ModCallback.POST_FAMILIAR_UPDATE, postFamiliarUpdate)
@@ -54,6 +54,8 @@ function getNewLazarus(self, oldLazarus)
54
54
  )
55
55
  end
56
56
  v = {run = {usedFlipAtLeastOnce = false}}
57
+ ---
58
+ -- @internal
57
59
  function ____exports.postFlipCallbacksInit(self, mod)
58
60
  saveDataManager(nil, "postFlip", v, hasSubscriptions)
59
61
  mod:AddCallback(ModCallback.POST_USE_ITEM, useItemFlip, CollectibleType.FLIP)
@@ -25,6 +25,8 @@ function postUpdate(self)
25
25
  end
26
26
  end
27
27
  v = {run = {currentGreedWave = 0}}
28
+ ---
29
+ -- @internal
28
30
  function ____exports.postGreedModeWaveCallbackInit(self, mod)
29
31
  saveDataManager(nil, "postModeGreedWave", v, hasSubscriptions)
30
32
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
@@ -97,6 +97,8 @@ function postNewRoom(self)
97
97
  end
98
98
  end
99
99
  v = {room = {initializedGridEntities = __TS__New(Map)}}
100
+ ---
101
+ -- @internal
100
102
  function ____exports.postGridEntityCallbacksInit(self, mod)
101
103
  saveDataManager(nil, "postGridEntity", v, hasSubscriptions)
102
104
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
@@ -58,6 +58,8 @@ v = {room = {collidingEntitiesMap = __TS__New(
58
58
  DefaultMap,
59
59
  function() return __TS__New(Set) end
60
60
  )}}
61
+ ---
62
+ -- @internal
61
63
  function ____exports.postGridEntityCollisionInit(self, mod)
62
64
  saveDataManager(nil, "postGridEntityCollision", v, hasSubscriptions)
63
65
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
@@ -18,6 +18,8 @@ function postRender(self)
18
18
  postGridEntityRenderFire(nil, gridEntity)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postGridEntityRenderInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
23
25
  end
@@ -32,6 +32,8 @@ function postPEffectUpdateReordered(self, player)
32
32
  end
33
33
  end
34
34
  v = {run = {playersHolyMantleMap = __TS__New(DefaultMap, 0)}}
35
+ ---
36
+ -- @internal
35
37
  function ____exports.postHolyMantleRemovedCallbackInit(self, mod)
36
38
  saveDataManager(nil, "postHolyMantleRemoved", v, hasSubscriptions)
37
39
  mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -24,6 +24,8 @@ function postKnifeUpdate(self, knife)
24
24
  end
25
25
  end
26
26
  v = {room = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postKnifeInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postKnifeInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_KNIFE_UPDATE, postKnifeUpdate)
@@ -24,6 +24,8 @@ function postLaserUpdate(self, laser)
24
24
  end
25
25
  end
26
26
  v = {room = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postLaserInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postLaserInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_LASER_UPDATE, postLaserUpdate)
@@ -24,6 +24,8 @@ function postNPCUpdate(self, npc)
24
24
  end
25
25
  end
26
26
  v = {room = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postNPCInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postNPCInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_NPC_UPDATE, postNPCUpdate)
@@ -30,6 +30,8 @@ v = {run = {npcStateMap = __TS__New(
30
30
  DefaultMap,
31
31
  function(____, state) return state end
32
32
  )}}
33
+ ---
34
+ -- @internal
33
35
  function ____exports.postNPCStateChangedCallbackInit(self, mod)
34
36
  saveDataManager(nil, "postNPCStateChanged", v, hasSubscriptions)
35
37
  mod:AddCallback(ModCallback.POST_NPC_UPDATE, postNPCUpdate)
@@ -58,6 +58,8 @@ function checkRoomChanged(self)
58
58
  end
59
59
  currentRoomTopLeftWallPtrHash = nil
60
60
  currentRoomTopLeftWallPtrHash2 = nil
61
+ ---
62
+ -- @internal
61
63
  function ____exports.postNewRoomEarlyCallbackInit(self, mod)
62
64
  mod:AddCallback(ModCallback.POST_NEW_ROOM, postNewRoom)
63
65
  mod:AddCallback(ModCallback.PRE_ENTITY_SPAWN, preEntitySpawn)
@@ -32,6 +32,8 @@ function postPickupRender(self, pickup)
32
32
  end
33
33
  end
34
34
  v = {room = {firedSet = __TS__New(Set)}}
35
+ ---
36
+ -- @internal
35
37
  function ____exports.postPickupCollectCallbackInit(self, mod)
36
38
  saveDataManager(nil, "postPickupCollect", v, hasSubscriptions)
37
39
  mod:AddCallback(ModCallback.POST_PICKUP_RENDER, postPickupRender)
@@ -24,6 +24,8 @@ function postPickupUpdate(self, pickup)
24
24
  end
25
25
  end
26
26
  v = {room = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postPickupInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postPickupInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_PICKUP_UPDATE, postPickupUpdate)
@@ -30,6 +30,8 @@ v = {run = {pickupStateMap = __TS__New(
30
30
  DefaultMap,
31
31
  function(____, state) return state end
32
32
  )}}
33
+ ---
34
+ -- @internal
33
35
  function ____exports.postPickupStateChangedCallbackInit(self, mod)
34
36
  saveDataManager(nil, "postPickupStateChanged", v, hasSubscriptions)
35
37
  mod:AddCallback(ModCallback.POST_PICKUP_UPDATE, postPickupUpdate)
@@ -18,6 +18,8 @@ function postRender(self)
18
18
  postPitRenderFire(nil, pit)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postPitRenderInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
23
25
  end
@@ -18,6 +18,8 @@ function postUpdate(self)
18
18
  postPitUpdateFire(nil, pit)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postPitUpdateInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
23
25
  end
@@ -43,6 +43,8 @@ v = {run = {playersHealthMap = __TS__New(
43
43
  DefaultMap,
44
44
  function() return __TS__New(Map) end
45
45
  )}}
46
+ ---
47
+ -- @internal
46
48
  function ____exports.postPlayerChangeHealthCallbackInit(self, mod)
47
49
  saveDataManager(nil, "postPlayerChangeHealth", v, hasSubscriptions)
48
50
  mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -32,6 +32,8 @@ v = {run = {playersCharacterMap = __TS__New(
32
32
  DefaultMap,
33
33
  function(____, character) return character end
34
34
  )}}
35
+ ---
36
+ -- @internal
35
37
  function ____exports.postPlayerChangeTypeCallbackInit(self, mod)
36
38
  saveDataManager(nil, "postPlayerChangeType", v, hasSubscriptions)
37
39
  mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -64,6 +64,8 @@ function entityTakeDmgPlayer(self, tookDamage, damageAmount, damageFlags, damage
64
64
  return nil
65
65
  end
66
66
  v = {run = {playersLastDamageGameFrame = __TS__New(Map)}}
67
+ ---
68
+ -- @internal
67
69
  function ____exports.postPlayerFatalDamageCallbackInit(self, mod)
68
70
  saveDataManager(nil, "postPlayerFatalDamage", v)
69
71
  mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.PLAYER)
@@ -26,6 +26,8 @@ function postPlayerUpdate(self, player)
26
26
  end
27
27
  end
28
28
  v = {run = {playersFiredSet = __TS__New(Set)}}
29
+ ---
30
+ -- @internal
29
31
  function ____exports.postPlayerInitLateCallbackInit(self, mod)
30
32
  saveDataManager(nil, "postPlayerInitLate", v, hasSubscriptions)
31
33
  mod:AddCallback(ModCallback.POST_PLAYER_UPDATE, postPlayerUpdate)
@@ -101,6 +101,8 @@ v = {run = {
101
101
  postPlayerUpdateQueue = {},
102
102
  postPlayerRenderQueue = {}
103
103
  }}
104
+ ---
105
+ -- @internal
104
106
  function ____exports.postPlayerReorderedCallbacksInit(self, mod)
105
107
  saveDataManager(nil, "postPlayerReordered", v, hasSubscriptions)
106
108
  mod:AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate)
@@ -18,6 +18,8 @@ function postRender(self)
18
18
  postPoopRenderFire(nil, poop)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postPoopRenderInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
23
25
  end
@@ -18,6 +18,8 @@ function postUpdate(self)
18
18
  postPoopUpdateFire(nil, poop)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postPoopUpdateInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
23
25
  end
@@ -18,6 +18,8 @@ function postRender(self)
18
18
  postPressurePlateRenderFire(nil, pressurePlate)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postPressurePlateRenderInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
23
25
  end
@@ -18,6 +18,8 @@ function postUpdate(self)
18
18
  postPressurePlateUpdateFire(nil, pressurePlate)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postPressurePlateUpdateInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
23
25
  end
@@ -24,6 +24,8 @@ function postProjectileUpdate(self, projectile)
24
24
  end
25
25
  end
26
26
  v = {room = {firedSet = __TS__New(Set)}}
27
+ ---
28
+ -- @internal
27
29
  function ____exports.postProjectileInitLateCallbackInit(self, mod)
28
30
  saveDataManager(nil, "postProjectileInitLate", v, hasSubscriptions)
29
31
  mod:AddCallback(ModCallback.POST_PROJECTILE_UPDATE, postProjectileUpdate)
@@ -42,6 +42,8 @@ function playerPickedUpNewItem(self, player)
42
42
  end
43
43
  end
44
44
  v = {room = {playersHoldingItemOnLastFrameMap = __TS__New(DefaultMap, false)}}
45
+ ---
46
+ -- @internal
45
47
  function ____exports.postPurchaseCallbackInit(self, mod)
46
48
  saveDataManager(nil, "postPurchase", v, hasSubscriptions)
47
49
  mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -18,6 +18,8 @@ function postRender(self)
18
18
  postRockRenderFire(nil, rock)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postRockRenderInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
23
25
  end
@@ -18,6 +18,8 @@ function postUpdate(self)
18
18
  postRockUpdateFire(nil, rock)
19
19
  end
20
20
  end
21
+ ---
22
+ -- @internal
21
23
  function ____exports.postRockUpdateInit(self, mod)
22
24
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
23
25
  end
@@ -32,6 +32,8 @@ function postNewRoom(self)
32
32
  v.room.cleared = roomClear
33
33
  end
34
34
  v = {room = {cleared = false}}
35
+ ---
36
+ -- @internal
35
37
  function ____exports.postRoomClearChangedCallbackInit(self, mod)
36
38
  saveDataManager(nil, "postRoomClearChanged", v, hasSubscriptions)
37
39
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
@@ -35,6 +35,8 @@ function entityTakeDmgPlayer(self, tookDamage, _damageAmount, damageFlags, _dama
35
35
  end
36
36
  end
37
37
  v = {level = {numSacrifices = 0}}
38
+ ---
39
+ -- @internal
38
40
  function ____exports.postSacrificeCallbackInit(self, mod)
39
41
  saveDataManager(nil, "postSacrifice", v, hasSubscriptions)
40
42
  mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.PLAYER)
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,66 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Set = ____lualib.Set
3
+ local __TS__New = ____lualib.__TS__New
4
+ local Map = ____lualib.Map
5
+ local ____exports = {}
6
+ local hasSubscriptions, postEntityRemove, postSlotAnimationChanged, BROKEN_ANIMATIONS, PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL, v
7
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
+ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
9
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
10
+ local ____cachedClasses = require("cachedClasses")
11
+ local game = ____cachedClasses.game
12
+ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
13
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
14
+ local ____exports = require("features.saveDataManager.exports")
15
+ local saveDataManager = ____exports.saveDataManager
16
+ local ____postSlotDestroyed = require("callbacks.subscriptions.postSlotDestroyed")
17
+ local postSlotDestroyedFire = ____postSlotDestroyed.postSlotDestroyedFire
18
+ local postSlotDestroyedHasSubscriptions = ____postSlotDestroyed.postSlotDestroyedHasSubscriptions
19
+ function hasSubscriptions(self)
20
+ return postSlotDestroyedHasSubscriptions(nil)
21
+ end
22
+ function postEntityRemove(self, entity)
23
+ local slot = entity
24
+ local ptrHash = GetPtrHash(slot)
25
+ local gameFrameCount = game:GetFrameCount()
26
+ local prizeFrame = v.room.slotPrizeAnimationGameFrame:get(ptrHash)
27
+ if prizeFrame == nil then
28
+ return
29
+ end
30
+ if prizeFrame + PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL == gameFrameCount then
31
+ postSlotDestroyedFire(nil, slot)
32
+ end
33
+ end
34
+ function postSlotAnimationChanged(self, slot)
35
+ local ptrHash = GetPtrHash(slot)
36
+ local gameFrameCount = game:GetFrameCount()
37
+ local alreadyBroken = v.room.brokenSlots:has(ptrHash)
38
+ if alreadyBroken then
39
+ return
40
+ end
41
+ local sprite = slot:GetSprite()
42
+ local animation = sprite:GetAnimation()
43
+ if BROKEN_ANIMATIONS:has(animation) then
44
+ v.room.brokenSlots:add(ptrHash)
45
+ postSlotDestroyedFire(nil, slot)
46
+ end
47
+ if animation == "Prize" then
48
+ v.room.slotPrizeAnimationGameFrame:set(ptrHash, gameFrameCount)
49
+ else
50
+ v.room.slotPrizeAnimationGameFrame:delete(ptrHash)
51
+ end
52
+ end
53
+ BROKEN_ANIMATIONS = __TS__New(Set, {"Broken", "Death"})
54
+ PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL = 3
55
+ v = {room = {
56
+ brokenSlots = __TS__New(Set),
57
+ slotPrizeAnimationGameFrame = __TS__New(Map)
58
+ }}
59
+ ---
60
+ -- @internal
61
+ function ____exports.postSlotDestroyedCallbacksInit(self, mod)
62
+ saveDataManager(nil, "postSlotDestroyed", v, hasSubscriptions)
63
+ mod:AddCallback(ModCallback.POST_ENTITY_REMOVE, postEntityRemove, EntityType.SLOT)
64
+ mod:AddCallbackCustom(ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED, postSlotAnimationChanged)
65
+ end
66
+ return ____exports