isaacscript-common 7.1.0 → 7.2.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 (255) hide show
  1. package/dist/callbacks/itemPickup.d.ts.map +1 -1
  2. package/dist/callbacks/itemPickup.lua +3 -1
  3. package/dist/callbacks/postCustomDoorEnter.d.ts.map +1 -1
  4. package/dist/callbacks/postCustomDoorEnter.lua +14 -11
  5. package/dist/callbacks/postDiceRoomActivated.d.ts.map +1 -1
  6. package/dist/callbacks/postDiceRoomActivated.lua +5 -4
  7. package/dist/callbacks/postItemDischarged.lua +2 -1
  8. package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -1
  9. package/dist/callbacks/postPlayerChangeStat.lua +44 -15
  10. package/dist/callbacks/postSlotDestroyed.lua +3 -3
  11. package/dist/classes/DefaultMap.d.ts +5 -5
  12. package/dist/classes/DefaultMap.d.ts.map +1 -1
  13. package/dist/core/constants.d.ts +2 -2
  14. package/dist/core/constants.d.ts.map +1 -1
  15. package/dist/core/constants.lua +3 -1
  16. package/dist/core/constantsFirstLast.d.ts +2 -0
  17. package/dist/core/constantsFirstLast.d.ts.map +1 -1
  18. package/dist/core/constantsFirstLast.lua +36 -9
  19. package/dist/enums/AmbushType.d.ts +1 -0
  20. package/dist/enums/AmbushType.d.ts.map +1 -1
  21. package/dist/enums/AmbushType.lua +1 -0
  22. package/dist/enums/CornerType.d.ts +1 -0
  23. package/dist/enums/CornerType.d.ts.map +1 -1
  24. package/dist/enums/CornerType.lua +1 -0
  25. package/dist/enums/PocketItemType.d.ts +1 -0
  26. package/dist/enums/PocketItemType.d.ts.map +1 -1
  27. package/dist/enums/PocketItemType.lua +1 -0
  28. package/dist/enums/RockAltType.d.ts +1 -0
  29. package/dist/enums/RockAltType.d.ts.map +1 -1
  30. package/dist/enums/RockAltType.lua +1 -0
  31. package/dist/enums/SaveDataKey.d.ts +11 -0
  32. package/dist/enums/SaveDataKey.d.ts.map +1 -0
  33. package/dist/enums/{private/SaveDataKey.lua → SaveDataKey.lua} +2 -0
  34. package/dist/enums/SerializationType.d.ts +1 -0
  35. package/dist/enums/SerializationType.d.ts.map +1 -1
  36. package/dist/enums/SerializationType.lua +1 -0
  37. package/dist/enums/SlotDestructionType.d.ts +1 -0
  38. package/dist/enums/SlotDestructionType.d.ts.map +1 -1
  39. package/dist/enums/SlotDestructionType.lua +1 -0
  40. package/dist/enums/StatType.d.ts +1 -3
  41. package/dist/enums/StatType.d.ts.map +1 -1
  42. package/dist/enums/StatType.lua +0 -2
  43. package/dist/enums/index.d.ts +1 -0
  44. package/dist/enums/index.d.ts.map +1 -1
  45. package/dist/enums/index.lua +8 -0
  46. package/dist/features/customGridEntity.d.ts.map +1 -1
  47. package/dist/features/customGridEntity.lua +3 -1
  48. package/dist/features/customStage/backdrop.d.ts +1 -1
  49. package/dist/features/customStage/backdrop.d.ts.map +1 -1
  50. package/dist/features/customStage/backdrop.lua +5 -3
  51. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  52. package/dist/features/customStage/customStageGridEntities.lua +3 -1
  53. package/dist/features/customStage/exports.d.ts.map +1 -1
  54. package/dist/features/customStage/exports.lua +3 -1
  55. package/dist/features/customStage/init.lua +2 -2
  56. package/dist/features/customStage/shadows.d.ts.map +1 -1
  57. package/dist/features/customStage/shadows.lua +2 -1
  58. package/dist/features/deployJSONRoom.lua +13 -10
  59. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  60. package/dist/features/extraConsoleCommands/listCommands.lua +8 -2
  61. package/dist/features/saveDataManager/exports.d.ts +2 -1
  62. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  63. package/dist/features/saveDataManager/main.d.ts +1 -1
  64. package/dist/features/saveDataManager/main.d.ts.map +1 -1
  65. package/dist/features/saveDataManager/main.lua +1 -1
  66. package/dist/functions/bitSet128.d.ts.map +1 -1
  67. package/dist/functions/bosses.d.ts.map +1 -1
  68. package/dist/functions/bosses.lua +3 -1
  69. package/dist/functions/cacheFlag.d.ts +23 -1
  70. package/dist/functions/cacheFlag.d.ts.map +1 -1
  71. package/dist/functions/cacheFlag.lua +78 -0
  72. package/dist/functions/collectibles.d.ts.map +1 -1
  73. package/dist/functions/deepCopy.lua +2 -1
  74. package/dist/functions/doors.d.ts.map +1 -1
  75. package/dist/functions/doors.lua +3 -1
  76. package/dist/functions/entities.lua +2 -1
  77. package/dist/functions/flying.lua +2 -2
  78. package/dist/functions/gridEntities.lua +2 -1
  79. package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
  80. package/dist/functions/gridEntitiesSpecific.lua +5 -3
  81. package/dist/functions/index.d.ts +0 -1
  82. package/dist/functions/index.d.ts.map +1 -1
  83. package/dist/functions/index.lua +0 -8
  84. package/dist/functions/input.d.ts +5 -2
  85. package/dist/functions/input.d.ts.map +1 -1
  86. package/dist/functions/input.lua +11 -3
  87. package/dist/functions/kColor.d.ts.map +1 -1
  88. package/dist/functions/levelGrid.d.ts.map +1 -1
  89. package/dist/functions/levelGrid.lua +3 -1
  90. package/dist/functions/nextStage.d.ts.map +1 -1
  91. package/dist/functions/nextStage.lua +7 -5
  92. package/dist/functions/npcs.d.ts.map +1 -1
  93. package/dist/functions/npcs.lua +4 -2
  94. package/dist/functions/pills.d.ts.map +1 -1
  95. package/dist/functions/pills.lua +9 -3
  96. package/dist/functions/playerIndex.d.ts.map +1 -1
  97. package/dist/functions/playerIndex.lua +2 -1
  98. package/dist/functions/playerStats.d.ts.map +1 -1
  99. package/dist/functions/playerStats.lua +1 -2
  100. package/dist/functions/players.d.ts +1 -1
  101. package/dist/functions/players.d.ts.map +1 -1
  102. package/dist/functions/players.lua +13 -15
  103. package/dist/functions/pocketItems.d.ts.map +1 -1
  104. package/dist/functions/pocketItems.lua +3 -1
  105. package/dist/functions/rng.d.ts.map +1 -1
  106. package/dist/functions/rng.lua +3 -0
  107. package/dist/functions/rockAlt.d.ts.map +1 -1
  108. package/dist/functions/rockAlt.lua +11 -20
  109. package/dist/functions/rooms.d.ts +4 -4
  110. package/dist/functions/rooms.d.ts.map +1 -1
  111. package/dist/functions/rooms.lua +18 -16
  112. package/dist/functions/spawnCollectible.d.ts.map +1 -1
  113. package/dist/functions/stage.d.ts.map +1 -1
  114. package/dist/functions/stage.lua +8 -2
  115. package/dist/functions/trinkets.d.ts.map +1 -1
  116. package/dist/functions/trinkets.lua +4 -2
  117. package/dist/functions/types.d.ts +64 -0
  118. package/dist/functions/types.d.ts.map +1 -1
  119. package/dist/functions/types.lua +63 -0
  120. package/dist/functions/vector.d.ts.map +1 -1
  121. package/dist/interfaces/ChargeBarSprites.d.ts +1 -1
  122. package/dist/interfaces/Corner.d.ts +5 -0
  123. package/dist/interfaces/Corner.d.ts.map +1 -1
  124. package/dist/interfaces/CustomStageLua.d.ts +57 -0
  125. package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
  126. package/dist/interfaces/GridEntityCustomData.d.ts +6 -0
  127. package/dist/interfaces/GridEntityCustomData.d.ts.map +1 -1
  128. package/dist/interfaces/JSONRoomsFile.d.ts +7 -3
  129. package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
  130. package/dist/interfaces/PlayerHealth.d.ts +1 -1
  131. package/dist/interfaces/PlayerHealth.d.ts.map +1 -1
  132. package/dist/interfaces/PocketItemDescription.d.ts +1 -1
  133. package/dist/interfaces/PocketItemDescription.d.ts.map +1 -1
  134. package/dist/interfaces/RoomDescription.d.ts +1 -1
  135. package/dist/interfaces/RoomDescription.d.ts.map +1 -1
  136. package/dist/interfaces/StatTypeType.d.ts +4 -1
  137. package/dist/interfaces/StatTypeType.d.ts.map +1 -1
  138. package/dist/interfaces/TrinketSituation.d.ts +1 -1
  139. package/dist/interfaces/TrinketSituation.d.ts.map +1 -1
  140. package/dist/maps/keyboardToString.d.ts +4 -0
  141. package/dist/maps/keyboardToString.d.ts.map +1 -0
  142. package/dist/maps/keyboardToString.lua +73 -0
  143. package/dist/types/AnyEntity.d.ts +5 -0
  144. package/dist/types/AnyEntity.d.ts.map +1 -1
  145. package/dist/types/AnyGridEntity.d.ts +5 -0
  146. package/dist/types/AnyGridEntity.d.ts.map +1 -1
  147. package/dist/types/CollectibleIndex.d.ts +4 -3
  148. package/dist/types/CollectibleIndex.d.ts.map +1 -1
  149. package/dist/types/Immutable.d.ts +3 -1
  150. package/dist/types/Immutable.d.ts.map +1 -1
  151. package/dist/types/PickupIndex.d.ts +4 -2
  152. package/dist/types/PickupIndex.d.ts.map +1 -1
  153. package/dist/types/PlayerIndex.d.ts +3 -2
  154. package/dist/types/PlayerIndex.d.ts.map +1 -1
  155. package/dist/types/SerializedIsaacAPIClass.d.ts +6 -0
  156. package/dist/types/SerializedIsaacAPIClass.d.ts.map +1 -1
  157. package/dist/types/TSTLClass.d.ts +5 -0
  158. package/dist/types/TSTLClass.d.ts.map +1 -1
  159. package/dist/types/TrapdoorDestination.d.ts +3 -0
  160. package/dist/types/TrapdoorDestination.d.ts.map +1 -1
  161. package/package.json +2 -2
  162. package/src/callbacks/itemPickup.ts +5 -2
  163. package/src/callbacks/postCustomDoorEnter.ts +18 -11
  164. package/src/callbacks/postDiceRoomActivated.ts +7 -12
  165. package/src/callbacks/postItemDischarged.ts +3 -1
  166. package/src/callbacks/postPlayerChangeStat.ts +45 -3
  167. package/src/callbacks/postSlotDestroyed.ts +3 -2
  168. package/src/callbacks/reorderedCallbacks.ts +2 -2
  169. package/src/classes/DefaultMap.ts +8 -8
  170. package/src/core/constants.ts +3 -3
  171. package/src/core/constantsFirstLast.ts +29 -14
  172. package/src/enums/AmbushType.ts +1 -0
  173. package/src/enums/CornerType.ts +1 -0
  174. package/src/enums/PocketItemType.ts +1 -0
  175. package/src/enums/RockAltType.ts +1 -0
  176. package/src/enums/SaveDataKey.ts +10 -0
  177. package/src/enums/SerializationType.ts +1 -0
  178. package/src/enums/SlotDestructionType.ts +1 -0
  179. package/src/enums/StatType.ts +7 -7
  180. package/src/enums/index.ts +1 -0
  181. package/src/enums/indexTypeDoc.ts +1 -0
  182. package/src/features/customGridEntity.ts +2 -1
  183. package/src/features/customStage/backdrop.ts +5 -3
  184. package/src/features/customStage/customStageGridEntities.ts +2 -1
  185. package/src/features/customStage/exports.ts +5 -4
  186. package/src/features/customStage/init.ts +2 -2
  187. package/src/features/customStage/shadows.ts +2 -1
  188. package/src/features/deployJSONRoom.ts +14 -19
  189. package/src/features/extraConsoleCommands/listCommands.ts +3 -2
  190. package/src/features/fastReset.ts +1 -1
  191. package/src/features/indexTypeDoc.ts +2 -1
  192. package/src/features/saveDataManager/exports.ts +4 -4
  193. package/src/features/saveDataManager/main.ts +1 -1
  194. package/src/features/saveDataManager/save.ts +1 -1
  195. package/src/functions/bitSet128.ts +1 -5
  196. package/src/functions/bosses.ts +2 -1
  197. package/src/functions/cacheFlag.ts +90 -1
  198. package/src/functions/cards.ts +3 -3
  199. package/src/functions/collectibles.ts +2 -8
  200. package/src/functions/color.ts +1 -1
  201. package/src/functions/deepCopy.ts +2 -2
  202. package/src/functions/dimensions.ts +1 -1
  203. package/src/functions/doors.ts +2 -2
  204. package/src/functions/entities.ts +2 -2
  205. package/src/functions/flying.ts +1 -1
  206. package/src/functions/gridEntities.ts +2 -2
  207. package/src/functions/gridEntitiesSpecific.ts +4 -3
  208. package/src/functions/index.ts +0 -1
  209. package/src/functions/indexTypeDoc.ts +0 -1
  210. package/src/functions/input.ts +17 -4
  211. package/src/functions/jsonHelpers.ts +1 -1
  212. package/src/functions/kColor.ts +1 -5
  213. package/src/functions/levelGrid.ts +3 -2
  214. package/src/functions/nextStage.ts +6 -5
  215. package/src/functions/npcs.ts +3 -2
  216. package/src/functions/pills.ts +11 -9
  217. package/src/functions/playerIndex.ts +3 -1
  218. package/src/functions/playerStats.ts +0 -1
  219. package/src/functions/players.ts +5 -6
  220. package/src/functions/pocketItems.ts +4 -4
  221. package/src/functions/rng.ts +8 -5
  222. package/src/functions/rockAlt.ts +28 -13
  223. package/src/functions/rooms.ts +27 -26
  224. package/src/functions/spawnCollectible.ts +1 -2
  225. package/src/functions/stage.ts +3 -2
  226. package/src/functions/trinkets.ts +6 -5
  227. package/src/functions/types.ts +100 -0
  228. package/src/functions/vector.ts +1 -5
  229. package/src/interfaces/ChargeBarSprites.ts +1 -1
  230. package/src/interfaces/Corner.ts +5 -0
  231. package/src/interfaces/CustomStageLua.ts +66 -0
  232. package/src/interfaces/GridEntityCustomData.ts +6 -0
  233. package/src/interfaces/JSONRoomsFile.ts +7 -3
  234. package/src/interfaces/PlayerHealth.ts +1 -1
  235. package/src/interfaces/PocketItemDescription.ts +1 -1
  236. package/src/interfaces/RoomDescription.ts +1 -1
  237. package/src/interfaces/StatTypeType.ts +4 -1
  238. package/src/interfaces/TrinketSituation.ts +1 -1
  239. package/src/maps/keyboardToString.ts +77 -0
  240. package/src/types/AnyEntity.ts +5 -0
  241. package/src/types/AnyGridEntity.ts +5 -0
  242. package/src/types/CollectibleIndex.ts +4 -3
  243. package/src/types/Immutable.ts +3 -1
  244. package/src/types/PickupIndex.ts +4 -2
  245. package/src/types/PlayerIndex.ts +3 -2
  246. package/src/types/SerializedIsaacAPIClass.ts +6 -0
  247. package/src/types/TSTLClass.ts +5 -0
  248. package/src/types/TrapdoorDestination.ts +3 -0
  249. package/dist/enums/private/SaveDataKey.d.ts +0 -7
  250. package/dist/enums/private/SaveDataKey.d.ts.map +0 -1
  251. package/dist/functions/collectibleCacheFlag.d.ts +0 -24
  252. package/dist/functions/collectibleCacheFlag.d.ts.map +0 -1
  253. package/dist/functions/collectibleCacheFlag.lua +0 -80
  254. package/src/enums/private/SaveDataKey.ts +0 -6
  255. package/src/functions/collectibleCacheFlag.ts +0 -90
@@ -1,4 +1,10 @@
1
1
  import { GridCollisionClass, GridEntityType } from "isaac-typescript-definitions";
2
+ /**
3
+ * This is meta-data that describes a custom grid entity.
4
+ *
5
+ * (One of the extra features that the standard library offers is the ability to spawn custom grid
6
+ * entities with the `spawnCustomGridEntity` helper function.)
7
+ */
2
8
  export interface GridEntityCustomData {
3
9
  /**
4
10
  * This is not a real `GridEntityType`; rather it is an arbitrary integer selected by end-user
@@ -1 +1 @@
1
- {"version":3,"file":"GridEntityCustomData.d.ts","sourceRoot":"","sources":["../../src/interfaces/GridEntityCustomData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,CAAC;IAErC,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
1
+ {"version":3,"file":"GridEntityCustomData.d.ts","sourceRoot":"","sources":["../../src/interfaces/GridEntityCustomData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,CAAC;IAErC,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
@@ -1,13 +1,17 @@
1
1
  /**
2
- * Custom rooms are created with the Basement Renovator program, which outputs XML files and STB
3
- * files. A `JSONRoomsFile` object is simply an XML file converted to JSON. (It is useful to have
4
- * the room data in JSON format so that it can be directly consumed by TypeScript programs.)
2
+ * The standard library has the feature to deploy a new room on-the-fly with the `deployJSONRoom`
3
+ * helper function. It requires a `JSONRoomsFile` as an argument, which is simply an XML file
4
+ * converted to JSON. (You create XML room files using the Basement Renovator program.)
5
5
  *
6
6
  * You can convert your XML files using the following command:
7
7
  *
8
8
  * ```sh
9
9
  * npx convert-xml-to-json foo.xml foo.json
10
10
  * ```
11
+ *
12
+ * Note that the custom stages feature of the standard library uses real XML/STB files, not JSON
13
+ * rooms, so you would only need to do this if you are using the `deployJSONRoom` command
14
+ * specifically.
11
15
  */
12
16
  export interface JSONRoomsFile {
13
17
  rooms: JSONRooms;
@@ -1 +1 @@
1
- {"version":3,"file":"JSONRoomsFile.d.ts","sourceRoot":"","sources":["../../src/interfaces/JSONRoomsFile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,2BAA2B;AAC3B,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE;QACD,yCAAyC;QACzC,UAAU,EAAE,MAAM,CAAC;QAEnB,yCAAyC;QACzC,MAAM,EAAE,MAAM,CAAC;QAEf,IAAI,EAAE,MAAM,CAAC;QAEb,yCAAyC;QACzC,KAAK,EAAE,MAAM,CAAC;QAEd,yCAAyC;QACzC,OAAO,EAAE,MAAM,CAAC;QAEhB,yCAAyC;QACzC,IAAI,EAAE,MAAM,CAAC;QAEb,yCAAyC;QACzC,OAAO,EAAE,MAAM,CAAC;QAEhB,0CAA0C;QAC1C,MAAM,EAAE,MAAM,CAAC;QAEf,yCAAyC;QACzC,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED,2BAA2B;AAC3B,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE;QACD,yEAAyE;QACzE,MAAM,EAAE,MAAM,CAAC;QAEf,yCAAyC;QACzC,CAAC,EAAE,MAAM,CAAC;QAEV,yCAAyC;QACzC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH;AAED,2BAA2B;AAC3B,MAAM,WAAW,SAAS;IACxB,CAAC,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CAAC,EAAE;QACD,yEAAyE;QACzE,MAAM,EAAE,MAAM,CAAC;QAEf,yCAAyC;QACzC,CAAC,EAAE,MAAM,CAAC;QAEV,yCAAyC;QACzC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACH;AAED,2BAA2B;AAC3B,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE;QACD,yCAAyC;QACzC,CAAC,EAAE,MAAM,CAAC;QAEV,yCAAyC;QACzC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;IAEF,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,2BAA2B;AAC3B,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE;QACD,yCAAyC;QACzC,IAAI,EAAE,MAAM,CAAC;QAEb,yCAAyC;QACzC,OAAO,EAAE,MAAM,CAAC;QAEhB,yCAAyC;QACzC,OAAO,EAAE,MAAM,CAAC;QAEhB,0CAA0C;QAC1C,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
@@ -1,5 +1,5 @@
1
1
  import { HeartSubType } from "isaac-typescript-definitions";
2
- /** Used by the `getPlayerHealth` and `setPlayerHealth` helper functions. */
2
+ /** This is used by the `getPlayerHealth` and `setPlayerHealth` helper functions. */
3
3
  export interface PlayerHealth {
4
4
  maxHearts: int;
5
5
  hearts: int;
@@ -1 +1 @@
1
- {"version":3,"file":"PlayerHealth.d.ts","sourceRoot":"","sources":["../../src/interfaces/PlayerHealth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IACZ,aAAa,EAAE,GAAG,CAAC;IAEnB,8FAA8F;IAC9F,UAAU,EAAE,GAAG,CAAC;IAEhB,8FAA8F;IAC9F,UAAU,EAAE,GAAG,CAAC;IAEhB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,GAAG,CAAC;IACjB,YAAY,EAAE,GAAG,CAAC;IAElB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAED,oBAAY,aAAa,GACrB,YAAY,CAAC,IAAI,GACjB,YAAY,CAAC,KAAK,GAClB,YAAY,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"PlayerHealth.d.ts","sourceRoot":"","sources":["../../src/interfaces/PlayerHealth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,oFAAoF;AACpF,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IACZ,aAAa,EAAE,GAAG,CAAC;IAEnB,8FAA8F;IAC9F,UAAU,EAAE,GAAG,CAAC;IAEhB,8FAA8F;IAC9F,UAAU,EAAE,GAAG,CAAC;IAEhB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,GAAG,CAAC;IACjB,YAAY,EAAE,GAAG,CAAC;IAElB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAED,oBAAY,aAAa,GACrB,YAAY,CAAC,IAAI,GACjB,YAAY,CAAC,KAAK,GAClB,YAAY,CAAC,IAAI,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { PocketItemSlot } from "isaac-typescript-definitions";
2
2
  import { PocketItemType } from "../enums/PocketItemType";
3
- /** Used by the `getPocketItems` and related helper functions. */
3
+ /** This is used by the `getPocketItems` and related helper functions. */
4
4
  export interface PocketItemDescription {
5
5
  slot: PocketItemSlot;
6
6
  type: PocketItemType;
@@ -1 +1 @@
1
- {"version":3,"file":"PocketItemDescription.d.ts","sourceRoot":"","sources":["../../src/interfaces/PocketItemDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,GAAG,CAAC;CACd"}
1
+ {"version":3,"file":"PocketItemDescription.d.ts","sourceRoot":"","sources":["../../src/interfaces/PocketItemDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,GAAG,CAAC;CACd"}
@@ -1,5 +1,5 @@
1
1
  import { LevelStage, RoomType, StageID, StageType } from "isaac-typescript-definitions";
2
- /** Used by the room history feature. */
2
+ /** This is used by the room history feature of the standard library. */
3
3
  export interface RoomDescription {
4
4
  stage: LevelStage;
5
5
  stageType: StageType;
@@ -1 +1 @@
1
- {"version":3,"file":"RoomDescription.d.ts","sourceRoot":"","sources":["../../src/interfaces/RoomDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,GAAG,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;CACvB"}
1
+ {"version":3,"file":"RoomDescription.d.ts","sourceRoot":"","sources":["../../src/interfaces/RoomDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAEtC,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,GAAG,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,GAAG,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;CACvB"}
@@ -1,5 +1,9 @@
1
1
  import { TearFlag } from "isaac-typescript-definitions";
2
2
  import { StatType } from "../enums/StatType";
3
+ /**
4
+ * This is an interface mapping a stat type to the data type. For example, `StatType.DAMAGE` is a
5
+ * `float` type.
6
+ */
3
7
  export interface StatTypeType {
4
8
  [StatType.DAMAGE]: float;
5
9
  [StatType.FIRE_DELAY]: float;
@@ -13,6 +17,5 @@ export interface StatTypeType {
13
17
  [StatType.TEAR_COLOR]: Color;
14
18
  [StatType.FLYING]: boolean;
15
19
  [StatType.LUCK]: float;
16
- [StatType.SIZE]: Vector;
17
20
  }
18
21
  //# sourceMappingURL=StatTypeType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatTypeType.d.ts","sourceRoot":"","sources":["../../src/interfaces/StatTypeType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,WAAW,YAAY;IAC3B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE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7B,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC;IAC5C,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC;IACrC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAC7B,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAC7B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;CACxB"}
@@ -1,5 +1,5 @@
1
1
  import { TrinketType } from "isaac-typescript-definitions";
2
- /** Used by the `temporarilyRemoveTrinkets` and related helper functions. */
2
+ /** This is used by the `temporarilyRemoveTrinkets` and related helper functions. */
3
3
  export interface TrinketSituation {
4
4
  trinketTypeRemoved: TrinketType;
5
5
  trinketType1: TrinketType;
@@ -1 +1 @@
1
- {"version":3,"file":"TrinketSituation.d.ts","sourceRoot":"","sources":["../../src/interfaces/TrinketSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,EAAE,WAAW,CAAC;IAChC,YAAY,EAAE,WAAW,CAAC;IAC1B,YAAY,EAAE,WAAW,CAAC;IAC1B,kBAAkB,EAAE,GAAG,CAAC;CACzB"}
1
+ {"version":3,"file":"TrinketSituation.d.ts","sourceRoot":"","sources":["../../src/interfaces/TrinketSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,EAAE,WAAW,CAAC;IAChC,YAAY,EAAE,WAAW,CAAC;IAC1B,YAAY,EAAE,WAAW,CAAC;IAC1B,kBAAkB,EAAE,GAAG,CAAC;CACzB"}
@@ -0,0 +1,4 @@
1
+ import { Keyboard } from "isaac-typescript-definitions";
2
+ /** Maps each keyboard enum member to its corresponding lowercase and uppercase characters. */
3
+ export declare const KEYBOARD_TO_STRING: ReadonlyMap<Keyboard, readonly [lowercaseCharacter: string, uppercaseCharacter: string]>;
4
+ //# sourceMappingURL=keyboardToString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardToString.d.ts","sourceRoot":"","sources":["../../src/maps/keyboardToString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAC1C,QAAQ,EACR,SAAS,CAAC,kBAAkB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAuEjE,CAAC"}
@@ -0,0 +1,73 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local ____exports = {}
5
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
+ local Keyboard = ____isaac_2Dtypescript_2Ddefinitions.Keyboard
7
+ --- Maps each keyboard enum member to its corresponding lowercase and uppercase characters.
8
+ ____exports.KEYBOARD_TO_STRING = __TS__New(Map, {
9
+ {Keyboard.SPACE, {" ", " "}},
10
+ {Keyboard.APOSTROPHE, {"'", "\""}},
11
+ {Keyboard.COMMA, {",", "<"}},
12
+ {Keyboard.MINUS, {"-", "_"}},
13
+ {Keyboard.PERIOD, {".", ">"}},
14
+ {Keyboard.SLASH, {"/", "?"}},
15
+ {Keyboard.ZERO, {"0", ")"}},
16
+ {Keyboard.ONE, {"1", "!"}},
17
+ {Keyboard.TWO, {"2", "@"}},
18
+ {Keyboard.THREE, {"3", "#"}},
19
+ {Keyboard.FOUR, {"4", "$"}},
20
+ {Keyboard.FIVE, {"5", "%"}},
21
+ {Keyboard.SIX, {"6", "^"}},
22
+ {Keyboard.SEVEN, {"7", "&"}},
23
+ {Keyboard.EIGHT, {"8", "*"}},
24
+ {Keyboard.NINE, {"9", "("}},
25
+ {Keyboard.SEMICOLON, {";", ":"}},
26
+ {Keyboard.EQUAL, {"=", "+"}},
27
+ {Keyboard.A, {"a", "A"}},
28
+ {Keyboard.B, {"b", "B"}},
29
+ {Keyboard.C, {"c", "C"}},
30
+ {Keyboard.D, {"d", "D"}},
31
+ {Keyboard.E, {"e", "E"}},
32
+ {Keyboard.F, {"f", "F"}},
33
+ {Keyboard.G, {"g", "G"}},
34
+ {Keyboard.H, {"h", "H"}},
35
+ {Keyboard.I, {"i", "I"}},
36
+ {Keyboard.J, {"j", "J"}},
37
+ {Keyboard.K, {"k", "K"}},
38
+ {Keyboard.L, {"l", "L"}},
39
+ {Keyboard.M, {"m", "M"}},
40
+ {Keyboard.N, {"n", "N"}},
41
+ {Keyboard.O, {"o", "O"}},
42
+ {Keyboard.P, {"p", "P"}},
43
+ {Keyboard.Q, {"q", "Q"}},
44
+ {Keyboard.R, {"r", "R"}},
45
+ {Keyboard.S, {"s", "S"}},
46
+ {Keyboard.T, {"t", "T"}},
47
+ {Keyboard.U, {"u", "U"}},
48
+ {Keyboard.V, {"v", "V"}},
49
+ {Keyboard.W, {"w", "W"}},
50
+ {Keyboard.X, {"x", "X"}},
51
+ {Keyboard.Y, {"y", "Y"}},
52
+ {Keyboard.Z, {"z", "Z"}},
53
+ {Keyboard.KP_0, {"0", "0"}},
54
+ {Keyboard.KP_1, {"1", "1"}},
55
+ {Keyboard.KP_2, {"2", "2"}},
56
+ {Keyboard.KP_3, {"3", "3"}},
57
+ {Keyboard.KP_4, {"4", "4"}},
58
+ {Keyboard.KP_5, {"5", "5"}},
59
+ {Keyboard.KP_6, {"6", "6"}},
60
+ {Keyboard.KP_7, {"7", "7"}},
61
+ {Keyboard.KP_8, {"8", "8"}},
62
+ {Keyboard.KP_9, {"9", "9"}},
63
+ {Keyboard.KP_DECIMAL, {".", "."}},
64
+ {Keyboard.KP_DIVIDE, {"/", "/"}},
65
+ {Keyboard.KP_MULTIPLY, {"*", "*"}},
66
+ {Keyboard.KP_SUBTRACT, {"-", "-"}},
67
+ {Keyboard.KP_ADD, {"+", "+"}},
68
+ {Keyboard.LEFT_BRACKET, {"[", "{"}},
69
+ {Keyboard.BACKSLASH, {"\\", "|"}},
70
+ {Keyboard.RIGHT_BRACKET, {"]", "}"}},
71
+ {Keyboard.GRAVE_ACCENT, {"`", "~"}}
72
+ })
73
+ return ____exports
@@ -9,5 +9,10 @@
9
9
  /// <reference types="isaac-typescript-definitions" />
10
10
  /// <reference types="isaac-typescript-definitions" />
11
11
  /// <reference types="isaac-typescript-definitions" />
12
+ /**
13
+ * A type union that matches `Entity`, `EntityBomb`, `EntityEffect`, and so on.
14
+ *
15
+ * This is useful for building generic functions that should accept any kind of entity.
16
+ */
12
17
  export declare type AnyEntity = Entity | EntityBomb | EntityEffect | EntityFamiliar | EntityKnife | EntityLaser | EntityNPC | EntityPickup | EntityPlayer | EntityProjectile | EntityTear;
13
18
  //# sourceMappingURL=AnyEntity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnyEntity.d.ts","sourceRoot":"","sources":["../../src/types/AnyEntity.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oBAAY,SAAS,GACjB,MAAM,GACN,UAAU,GACV,YAAY,GACZ,cAAc,GACd,WAAW,GACX,WAAW,GACX,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,UAAU,CAAC"}
1
+ {"version":3,"file":"AnyEntity.d.ts","sourceRoot":"","sources":["../../src/types/AnyEntity.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;GAIG;AACH,oBAAY,SAAS,GACjB,MAAM,GACN,UAAU,GACV,YAAY,GACZ,cAAc,GACd,WAAW,GACX,WAAW,GACX,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,UAAU,CAAC"}
@@ -6,5 +6,10 @@
6
6
  /// <reference types="isaac-typescript-definitions" />
7
7
  /// <reference types="isaac-typescript-definitions" />
8
8
  /// <reference types="isaac-typescript-definitions" />
9
+ /**
10
+ * A type union that matches `GridEntity`, `GridEntityDoor`, `GridEntityPit`, and so on.
11
+ *
12
+ * This is useful for building generic functions that should accept any kind of grid entity.
13
+ */
9
14
  export declare type AnyGridEntity = GridEntity | GridEntityDoor | GridEntityPit | GridEntityPoop | GridEntityPressurePlate | GridEntityRock | GridEntitySpikes | GridEntityTNT;
10
15
  //# sourceMappingURL=AnyGridEntity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnyGridEntity.d.ts","sourceRoot":"","sources":["../../src/types/AnyGridEntity.ts"],"names":[],"mappings":";;;;;;;;AAAA,oBAAY,aAAa,GACrB,UAAU,GACV,cAAc,GACd,aAAa,GACb,cAAc,GACd,uBAAuB,GACvB,cAAc,GACd,gBAAgB,GAChB,aAAa,CAAC"}
1
+ {"version":3,"file":"AnyGridEntity.d.ts","sourceRoot":"","sources":["../../src/types/AnyGridEntity.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;GAIG;AACH,oBAAY,aAAa,GACrB,UAAU,GACV,cAAc,GACd,aAAa,GACb,cAAc,GACd,uBAAuB,GACvB,cAAc,GACd,gBAAgB,GAChB,aAAa,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /**
2
- * `CollectibleIndex` is a specific type of string; see the documentation for the
3
- * `getCollectibleIndex` function. Mods can signify that data structures handle collectibles by
4
- * using this type.
2
+ * `CollectibleIndex` is a specific type of string that represents a unique identifier for a
3
+ * collectible. Mods can signify that data structures handle collectibles by using this type.
4
+ *
5
+ * For more information, see the documentation for the `getCollectibleIndex` function.
5
6
  *
6
7
  * For example:
7
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"CollectibleIndex.d.ts","sourceRoot":"","sources":["../../src/types/CollectibleIndex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,gBAAgB,GAAG,MAAM,GAAG;IACtC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C,CAAC"}
1
+ {"version":3,"file":"CollectibleIndex.d.ts","sourceRoot":"","sources":["../../src/types/CollectibleIndex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,oBAAY,gBAAgB,GAAG,MAAM,GAAG;IACtC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C,CAAC"}
@@ -1,5 +1,7 @@
1
1
  /**
2
- * Immutable is a type that will make the given array/map/set/object recursively read-only.
2
+ * Immutable is a utility type that will make the given array/map/set/object recursively read-only.
3
+ *
4
+ * You can use this type to easily build safe data structures.
3
5
  *
4
6
  * From: https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript
5
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Immutable.d.ts","sourceRoot":"","sources":["../../src/types/Immutable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,kBAAkB,GACnD,CAAC,GACD,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACxB,cAAc,CAAC,CAAC,CAAC,GACjB,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAC/B,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAClB,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GACtB,YAAY,CAAC,CAAC,CAAC,GACf,eAAe,CAAC,CAAC,CAAC,CAAC;AAEvB,aAAK,kBAAkB,GACnB,SAAS,GACT,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,CAAC;AACb,aAAK,cAAc,CAAC,CAAC,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,aAAK,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI,WAAW,CAAC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AAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC"}
@@ -1,7 +1,9 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /**
3
- * `PickupIndex` is a specific type of string; see the documentation for the `getPickupIndex`
4
- * function. Mods can signify that data structures handle collectibles by using this type.
3
+ * `PickupIndex` is a specific type of number that represents a unique identifier for a pickup. Mods
4
+ * can signify that data structures handle collectibles by using this type.
5
+ *
6
+ * For more information, see the documentation for the `getPickupIndex` function.
5
7
  *
6
8
  * For example:
7
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PickupIndex.d.ts","sourceRoot":"","sources":["../../src/types/PickupIndex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,oBAAY,WAAW,GAAG,GAAG,GAAG;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC,CAAC"}
1
+ {"version":3,"file":"PickupIndex.d.ts","sourceRoot":"","sources":["../../src/types/PickupIndex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AACH,oBAAY,WAAW,GAAG,GAAG,GAAG;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC,CAAC"}
@@ -1,8 +1,9 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /**
3
3
  * `PlayerIndex` is a specific type of number that represents a unique identifier for a player. Mods
4
- * can signify that data structures handle `EntityPlayer` by using this type. For more information,
5
- * see the documentation for the `getPlayerIndex` function.
4
+ * can signify that data structures handle `EntityPlayer` by using this type.
5
+ *
6
+ * For more information, see the documentation for the `getPlayerIndex` function.
6
7
  *
7
8
  * For example:
8
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PlayerIndex.d.ts","sourceRoot":"","sources":["../../src/types/PlayerIndex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,WAAW,GAAG,GAAG,GAAG;IAAE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"PlayerIndex.d.ts","sourceRoot":"","sources":["../../src/types/PlayerIndex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AACH,oBAAY,WAAW,GAAG,GAAG,GAAG;IAAE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -1,4 +1,10 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
+ /**
3
+ * This is a type representing an Isaac API class like `Color` or `RNG` that has been written to the
4
+ * "save#.dat" file. It is used by the save data manager when reading and writing to that file.
5
+ *
6
+ * For the list of supported classes, see the `CopyableIsaacAPIClassType` enum.
7
+ */
2
8
  export declare type SerializedIsaacAPIClass = LuaMap<string, unknown> & {
3
9
  readonly __serializedIsaacAPIClassBrand: symbol;
4
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SerializedIsaacAPIClass.d.ts","sourceRoot":"","sources":["../../src/types/SerializedIsaacAPIClass.ts"],"names":[],"mappings":";AAAA,oBAAY,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC9D,QAAQ,CAAC,8BAA8B,EAAE,MAAM,CAAC;CACjD,CAAC"}
1
+ {"version":3,"file":"SerializedIsaacAPIClass.d.ts","sourceRoot":"","sources":["../../src/types/SerializedIsaacAPIClass.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,oBAAY,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC9D,QAAQ,CAAC,8BAA8B,EAAE,MAAM,CAAC;CACjD,CAAC"}
@@ -1,4 +1,9 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
+ /**
3
+ * This is a type representing a user-created class from TypeScript code.
4
+ *
5
+ * This type is used by the save data manager to when copying, serializing, and deserializing.
6
+ */
2
7
  export declare type TSTLClass = LuaMap<AnyNotNil, unknown> & {
3
8
  readonly __tstlClassBrand: symbol;
4
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TSTLClass.d.ts","sourceRoot":"","sources":["../../src/types/TSTLClass.ts"],"names":[],"mappings":";AAAA,oBAAY,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG;IACnD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC,CAAC"}
1
+ {"version":3,"file":"TSTLClass.d.ts","sourceRoot":"","sources":["../../src/types/TSTLClass.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,oBAAY,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG;IACnD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC,CAAC"}
@@ -1,3 +1,6 @@
1
1
  import { LevelStage, StageType } from "isaac-typescript-definitions";
2
+ /**
3
+ * This is the type that you need to specify when using the `spawnCustomTrapdoor` helper function.
4
+ */
2
5
  export declare type TrapdoorDestination = [stage: LevelStage, stageType: StageType] | [customStageName: string, floorNum: int];
3
6
  //# sourceMappingURL=TrapdoorDestination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TrapdoorDestination.d.ts","sourceRoot":"","sources":["../../src/types/TrapdoorDestination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE,oBAAY,mBAAmB,GAC3B,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GACzC,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"TrapdoorDestination.d.ts","sourceRoot":"","sources":["../../src/types/TrapdoorDestination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE;;GAEG;AACH,oBAAY,mBAAmB,GAC3B,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GACzC,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "7.1.0",
3
+ "version": "7.2.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "dist/index",
23
23
  "types": "dist/index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^3.2.3"
25
+ "isaac-typescript-definitions": "^3.4.0"
26
26
  }
27
27
  }
@@ -12,6 +12,7 @@ import { ModUpgraded } from "../classes/ModUpgraded";
12
12
  import { ModCallbackCustom } from "../enums/ModCallbackCustom";
13
13
  import { saveDataManager } from "../features/saveDataManager/exports";
14
14
  import { defaultMapGetPlayer } from "../functions/playerDataStructures";
15
+ import { asNumber } from "../functions/types";
15
16
  import {
16
17
  newPickingUpItem,
17
18
  PickingUpItem,
@@ -71,8 +72,10 @@ function postPEffectUpdateReordered(player: EntityPlayer) {
71
72
  }
72
73
 
73
74
  function queueEmpty(player: EntityPlayer, pickingUpItem: PickingUpItem) {
74
- // eslint-disable-next-line isaacscript/strict-enums
75
- if (pickingUpItem.itemType === ItemType.NULL || pickingUpItem.subType === 0) {
75
+ if (
76
+ pickingUpItem.itemType === ItemType.NULL ||
77
+ asNumber(pickingUpItem.subType) === 0
78
+ ) {
76
79
  return;
77
80
  }
78
81
 
@@ -15,11 +15,16 @@ import { directionToVector } from "../functions/direction";
15
15
  import { doorSlotToDirection } from "../functions/doors";
16
16
  import { getEffects, spawnEffect } from "../functions/entitiesSpecific";
17
17
  import { getClosestPlayer } from "../functions/players";
18
+ import { asNumber } from "../functions/types";
18
19
  import {
19
20
  postCustomDoorEnterFire,
20
21
  postCustomDoorEnterHasSubscriptions,
21
22
  } from "./subscriptions/postCustomDoorEnter";
22
23
 
24
+ interface EntityEffectCustomDoor extends EntityEffect {
25
+ State: DoorState;
26
+ }
27
+
23
28
  interface CustomDoorData {
24
29
  slot: DoorSlot;
25
30
  state: DoorState;
@@ -72,41 +77,43 @@ export function initCustomDoorInternal(
72
77
 
73
78
  // ModCallback.POST_EFFECT_UPDATE (55)
74
79
  function postEffectUpdaterCustomEntity(effect: EntityEffect) {
80
+ const customDoor = effect as EntityEffectCustomDoor;
81
+
75
82
  const ptrHash = GetPtrHash(effect);
76
83
  const doorData = v.room.customDoors.get(ptrHash);
77
84
  if (doorData === undefined) {
78
85
  return;
79
86
  }
80
87
 
81
- if (doorData.state === (effect.State as DoorState)) {
88
+ if (doorData.state === customDoor.State) {
82
89
  return;
83
90
  }
84
- doorData.state = effect.State as DoorState;
91
+ doorData.state = customDoor.State;
85
92
 
86
93
  doorChangedState(effect);
87
94
  }
88
95
 
89
- function doorChangedState(effect: EntityEffect) {
96
+ function doorChangedState(door: EntityEffectCustomDoor) {
90
97
  const room = game.GetRoom();
91
98
 
92
- const sprite = effect.GetSprite();
93
- const animation = getAnimationForCustomDoor(effect);
99
+ const sprite = door.GetSprite();
100
+ const animation = getAnimationForCustomDoor(door);
94
101
  sprite.Play(animation, true);
95
102
 
96
- const gridIndex = room.GetGridIndex(effect.Position);
103
+ const gridIndex = room.GetGridIndex(door.Position);
97
104
  const wall = room.GetGridEntity(gridIndex);
98
105
  if (wall !== undefined) {
99
106
  wall.CollisionClass =
100
- (effect.State as DoorState) === DoorState.OPEN
107
+ door.State === DoorState.OPEN
101
108
  ? GridCollisionClass.WALL_EXCEPT_PLAYER
102
109
  : GridCollisionClass.WALL;
103
110
  }
104
111
  }
105
112
 
106
- function getAnimationForCustomDoor(effect: EntityEffect): string {
107
- const freshlySpawned = effect.FrameCount === 0;
113
+ function getAnimationForCustomDoor(door: EntityEffectCustomDoor): string {
114
+ const freshlySpawned = door.FrameCount === 0;
108
115
 
109
- switch (effect.State as DoorState) {
116
+ switch (door.State) {
110
117
  case DoorState.OPEN: {
111
118
  return freshlySpawned ? "Opened" : "Open";
112
119
  }
@@ -220,7 +227,7 @@ export function spawnCustomDoorInternal(
220
227
  effect.RenderZOffset = -10000;
221
228
  effect.PositionOffset = getPositionOffset(doorSlot);
222
229
  const sprite = effect.GetSprite();
223
- sprite.Rotation = (doorSlot as int) * 90 - 90;
230
+ sprite.Rotation = asNumber(doorSlot) * 90 - 90;
224
231
 
225
232
  // Keep track of metadata about this door.
226
233
  const ptrHash = GetPtrHash(effect);
@@ -1,8 +1,4 @@
1
- import {
2
- DiceFloorSubType,
3
- EffectVariant,
4
- ModCallback,
5
- } from "isaac-typescript-definitions";
1
+ import { EffectVariant, ModCallback } from "isaac-typescript-definitions";
6
2
  import { saveDataManager } from "../features/saveDataManager/exports";
7
3
  import { isCloseEnoughToTriggerDiceFloor } from "../functions/effects";
8
4
  import { getClosestPlayer } from "../functions/players";
@@ -34,6 +30,8 @@ function hasSubscriptions() {
34
30
  // ModCallback.POST_EFFECT_UPDATE (55)
35
31
  // EffectVariant.DICE_FLOOR (76)
36
32
  function postEffectUpdateDiceFloor(effect: EntityEffect) {
33
+ const diceFloor = effect as EntityEffectDiceFloor;
34
+
37
35
  if (!hasSubscriptions()) {
38
36
  return;
39
37
  }
@@ -44,16 +42,13 @@ function postEffectUpdateDiceFloor(effect: EntityEffect) {
44
42
 
45
43
  // When using the debug console to go to a dice room, the player can appear on top of the dice
46
44
  // floor before they snap to the door.
47
- if (effect.FrameCount === 0) {
45
+ if (diceFloor.FrameCount === 0) {
48
46
  return;
49
47
  }
50
48
 
51
- const closestPlayer = getClosestPlayer(effect.Position);
52
- if (isCloseEnoughToTriggerDiceFloor(closestPlayer, effect)) {
49
+ const closestPlayer = getClosestPlayer(diceFloor.Position);
50
+ if (isCloseEnoughToTriggerDiceFloor(closestPlayer, diceFloor)) {
53
51
  v.room.diceRoomActivated = true;
54
- postDiceRoomActivatedFire(
55
- closestPlayer,
56
- effect.SubType as DiceFloorSubType,
57
- );
52
+ postDiceRoomActivatedFire(closestPlayer, diceFloor.SubType);
58
53
  }
59
54
  }
@@ -131,11 +131,13 @@ function preNPCCollisionSucker(
131
131
  npc: EntityNPC,
132
132
  collider: Entity,
133
133
  ): boolean | undefined {
134
+ const sucker = npc as EntityNPCSucker;
135
+
134
136
  if (!hasSubscriptions()) {
135
137
  return undefined;
136
138
  }
137
139
 
138
- if (npc.Variant !== (SuckerVariant.BULB as int)) {
140
+ if (sucker.Variant !== SuckerVariant.BULB) {
139
141
  return undefined;
140
142
  }
141
143
 
@@ -4,7 +4,14 @@ import { ModUpgraded } from "../classes/ModUpgraded";
4
4
  import { StatType } from "../enums";
5
5
  import { ModCallbackCustom } from "../enums/ModCallbackCustom";
6
6
  import { saveDataManager } from "../features/saveDataManager/exports";
7
- import { getPlayerStat, isNumber } from "../functions";
7
+ import {
8
+ colorEquals,
9
+ getPlayerStat,
10
+ isBitSet128,
11
+ isBoolean,
12
+ isColor,
13
+ isNumber,
14
+ } from "../functions";
8
15
  import { getEnumValues } from "../functions/enums";
9
16
  import { getPlayerIndex } from "../functions/playerIndex";
10
17
  import { PlayerIndex } from "../types/PlayerIndex";
@@ -13,11 +20,13 @@ import {
13
20
  postPlayerChangeStatHasSubscriptions,
14
21
  } from "./subscriptions/postPlayerChangeStat";
15
22
 
23
+ type PossibleStatType = number | boolean | BitFlags<TearFlag> | Color;
24
+
16
25
  const v = {
17
26
  run: {
18
27
  playersStatMap: new DefaultMap<
19
28
  PlayerIndex,
20
- Map<StatType, number | boolean | BitFlags<TearFlag> | Color | Vector>
29
+ Map<StatType, PossibleStatType>
21
30
  >(() => new Map()),
22
31
  },
23
32
  };
@@ -52,7 +61,11 @@ function postPEffectUpdateReordered(player: EntityPlayer) {
52
61
  const currentStatValue = getPlayerStat(player, statType);
53
62
  playerStatMap.set(statType, currentStatValue);
54
63
 
55
- if (storedStatValue !== undefined && storedStatValue !== currentStatValue) {
64
+ if (storedStatValue === undefined) {
65
+ continue;
66
+ }
67
+
68
+ if (!statEquals(storedStatValue, currentStatValue)) {
56
69
  const isNumberStat =
57
70
  isNumber(storedStatValue) && isNumber(currentStatValue);
58
71
  const difference = isNumberStat ? currentStatValue - storedStatValue : 0;
@@ -66,3 +79,32 @@ function postPEffectUpdateReordered(player: EntityPlayer) {
66
79
  }
67
80
  }
68
81
  }
82
+
83
+ function statEquals(
84
+ oldValue: PossibleStatType,
85
+ newValue: PossibleStatType,
86
+ ): boolean {
87
+ const isNumberStat = isNumber(oldValue) && isNumber(newValue);
88
+ if (isNumberStat) {
89
+ return oldValue === newValue;
90
+ }
91
+
92
+ const isBooleanStat = isBoolean(oldValue) && isBoolean(newValue);
93
+ if (isBooleanStat) {
94
+ return oldValue === newValue;
95
+ }
96
+
97
+ const isBitSet128Stat = isBitSet128(oldValue) && isBitSet128(newValue);
98
+ if (isBitSet128Stat) {
99
+ return oldValue === newValue; // The class has the "__eq" meta-method.
100
+ }
101
+
102
+ const isColorStat = isColor(oldValue) && isColor(newValue);
103
+ if (isColorStat) {
104
+ return colorEquals(oldValue, newValue);
105
+ }
106
+
107
+ error(
108
+ 'Failed to determine the type of a stat in the "POST_PLAYER_CHANGE_STAT" callback.',
109
+ );
110
+ }